+
+
+## 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