From 9f7b358dd38542a224257547a53e0d749cb4e5ed Mon Sep 17 00:00:00 2001 From: Cameron Gilbert Date: Wed, 2 Apr 2025 15:36:46 -0400 Subject: [PATCH 1/4] chore: unstoppable domain proxy (#404) --- src/gql/heart-monitor/heart-monitor.test.ts | 15 ++++-- src/gql/heart-monitor/heart-monitor.ts | 9 ++-- src/gql/query/proxies.ts | 42 ++++++++++++----- src/gql/query/user.ts | 5 +- src/gql/utils/consts.ts | 5 +- src/gql/utils/defaultObjects.ts | 52 +++++++++++++++------ src/gql/utils/generated.ts | 39 +++++++++++++++- src/gql/utils/schema.graphql | 31 +++++++++++- 8 files changed, 159 insertions(+), 39 deletions(-) diff --git a/src/gql/heart-monitor/heart-monitor.test.ts b/src/gql/heart-monitor/heart-monitor.test.ts index b8d49423..6b6784df 100644 --- a/src/gql/heart-monitor/heart-monitor.test.ts +++ b/src/gql/heart-monitor/heart-monitor.test.ts @@ -42,7 +42,6 @@ import { defaultInflationDistribution, GQLFeatureFlags, defaultFeatureFlags, - defaultProxy, GQLProxies, defaultInflationReward, featureFlagsQueryString, @@ -54,6 +53,8 @@ import { GQLQueryGqlUserArgs, GQLEvm, defaultEvm, + defaultBybit, + defaultProxy, } from ".." const nibiruUrl = "testnet-2" @@ -360,19 +361,23 @@ test.skip("oraclePricesSubscription", async () => { ) }) -const testProxies = async (fields: GQLProxies) => { - const resp = await heartMonitor.proxies(fields) +const testProxies = async (fields: GQLProxies, domainName?: string) => { + const resp = await heartMonitor.proxies(fields, domainName) expect(resp).toHaveProperty("proxies") if (resp.proxies) { const { proxies } = resp - checkFields([proxies], ["bybit"]) + checkFields( + [proxies], + ["bybit", ...(domainName ? ["unstoppableDomains"] : [])] + ) } } test("proxies", async () => { - await testProxies(defaultProxy) + await testProxies(defaultProxy, "cameron.nibi") + await testProxies({ bybit: defaultBybit }) }) const testEvm = async (fields: GQLEvm) => { diff --git a/src/gql/heart-monitor/heart-monitor.ts b/src/gql/heart-monitor/heart-monitor.ts index 00e6d228..1c959271 100644 --- a/src/gql/heart-monitor/heart-monitor.ts +++ b/src/gql/heart-monitor/heart-monitor.ts @@ -106,7 +106,10 @@ export interface IHeartMonitor { AsyncIterableIterator> | undefined > - readonly proxies: (fields: DeepPartial) => Promise + readonly proxies: ( + fields: DeepPartial, + domainName?: string + ) => Promise readonly evm: (fields: DeepPartial) => Promise @@ -198,8 +201,8 @@ export class HeartMonitor implements IHeartMonitor { fields: DeepPartial ) => oraclePricesSubscription(args, fields, this.subscriptionClient) - proxies = async (fields: DeepPartial) => - proxies(this.gqlEndpt, fields) + proxies = async (fields: DeepPartial, domainName?: string) => + proxies(this.gqlEndpt, fields, domainName) evm = async (fields: DeepPartial) => evm(this.gqlEndpt, fields) diff --git a/src/gql/query/proxies.ts b/src/gql/query/proxies.ts index c921100f..050a46b8 100644 --- a/src/gql/query/proxies.ts +++ b/src/gql/query/proxies.ts @@ -12,18 +12,38 @@ export interface GqlOutProxies { } export const proxiesQueryString = ( - excludeParentObject: boolean, - fields: DeepPartial -) => - gqlQuery( - "proxies", - {}, - convertObjectToPropertiesString(fields), - excludeParentObject - ) + fields: DeepPartial, + domainName?: string +) => { + const proxiesQuery: string[] = [] + + if (fields.bybit) { + proxiesQuery.push( + gqlQuery("bybit", {}, convertObjectToPropertiesString(fields.bybit), true) + ) + } + + if (fields.unstoppableDomains) { + proxiesQuery.push( + gqlQuery( + "unstoppableDomains", + { domainName }, + convertObjectToPropertiesString(fields.unstoppableDomains), + true + ) + ) + } + + return `{ + proxies { + ${proxiesQuery.join("\n")} + } + }` +} export const proxies = async ( endpt: string, - fields: DeepPartial + fields: DeepPartial, + domainName?: string ): Promise => - doGqlQuery(proxiesQueryString(false, fields), endpt) + doGqlQuery(proxiesQueryString(fields, domainName), endpt) diff --git a/src/gql/query/user.ts b/src/gql/query/user.ts index 237893e4..b5174a2c 100644 --- a/src/gql/query/user.ts +++ b/src/gql/query/user.ts @@ -16,14 +16,13 @@ export const userQueryString = ( args: GQLQueryGqlUserArgs, excludeParentObject: boolean, fields: DeepPartial -) => { - return gqlQuery( +) => + gqlQuery( "user", args, convertObjectToPropertiesString(fields), excludeParentObject ) -} export const user = async ( args: GQLQueryGqlUserArgs, diff --git a/src/gql/utils/consts.ts b/src/gql/utils/consts.ts index ad98ba81..676c8743 100644 --- a/src/gql/utils/consts.ts +++ b/src/gql/utils/consts.ts @@ -1,5 +1,4 @@ import { fetch } from "cross-fetch" -import { Client } from "graphql-ws" type OptionalArrayOr = T extends T[] ? T[] | undefined : Otherwise type OptionalUndefinedOr = T extends undefined @@ -163,7 +162,9 @@ export const gqlQuery = ( delete typedQueryArgs.where Object.keys(typedQueryArgs).forEach((key) => - queryArgList.push(arg(key, typedQueryArgs[key], true)) + // key !== "domainName" normally `true`, however domainName is a special case + // Will need to future proof this if more special cases arise + queryArgList.push(arg(key, typedQueryArgs[key], key !== "domainName")) ) const hasQueryList = (char: string) => (queryArgList.length > 0 ? char : "") diff --git a/src/gql/utils/defaultObjects.ts b/src/gql/utils/defaultObjects.ts index 1e0b6cfd..e01ec659 100644 --- a/src/gql/utils/defaultObjects.ts +++ b/src/gql/utils/defaultObjects.ts @@ -1,5 +1,6 @@ import { GQLBlock, + GQLBybitResponse, GQLDelegation, GQLDistributionCommission, GQLEvm, @@ -235,20 +236,45 @@ export const defaultFeatureFlags: GQLFeatureFlags = { wasm: true, } +export const defaultBybit: GQLBybitResponse = { + ask1Price: "", + ask1Size: "", + bid1Price: "", + bid1Size: "", + highPrice24h: "", + lastPrice: "", + lowPrice24h: "", + prevPrice24h: "", + price24hPcnt: "", + symbol: "", + turnover24h: "", + volume24h: "", +} + export const defaultProxy: GQLProxies = { - bybit: { - ask1Price: "", - ask1Size: "", - bid1Price: "", - bid1Size: "", - highPrice24h: "", - lastPrice: "", - lowPrice24h: "", - prevPrice24h: "", - price24hPcnt: "", - symbol: "", - turnover24h: "", - volume24h: "", + bybit: defaultBybit, + unstoppableDomains: { + records: { + cryptoEthAddress: "", + cryptoNibiAddress: "", + ipfsHtmlValue: "", + tokenEvmEthEthAddress: "", + tokenEvmMaticMaticAddress: "", + tokenEvmMaticPolAddress: "", + tokenNibiNibiNibiAddress: "", + }, + meta: { + blockchain: "", + domain: "", + namehash: "", + owner: "", + networkId: 0, + registry: "", + resolver: "", + tokenId: "", + reverse: false, + type: "", + }, }, } diff --git a/src/gql/utils/generated.ts b/src/gql/utils/generated.ts index 4c796da7..c6b1845f 100644 --- a/src/gql/utils/generated.ts +++ b/src/gql/utils/generated.ts @@ -512,7 +512,13 @@ export enum GQLOraclesOrder { export type GQLProxies = { readonly __typename?: 'Proxies'; - readonly bybit: GQLBybitResponse; + readonly bybit?: Maybe; + readonly unstoppableDomains?: Maybe; +}; + + +export type GQLProxiesGqlUnstoppableDomainsArgs = { + domainName: Scalars['String']['input']; }; export type GQLQuery = { @@ -614,6 +620,17 @@ export type GQLQueryGqlValidatorsArgs = { where?: InputMaybe; }; +export type GQLRecords = { + readonly __typename?: 'Records'; + readonly cryptoEthAddress?: Maybe; + readonly cryptoNibiAddress?: Maybe; + readonly ipfsHtmlValue?: Maybe; + readonly tokenEvmEthEthAddress?: Maybe; + readonly tokenEvmMaticMaticAddress?: Maybe; + readonly tokenEvmMaticPolAddress?: Maybe; + readonly tokenNibiNibiNibiAddress?: Maybe; +}; + export type GQLRedelegation = { readonly __typename?: 'Redelegation'; readonly amount: Scalars['Int']['output']; @@ -824,6 +841,26 @@ export enum GQLUnbondingOrder { GQLValidatorAddress = 'validator_address' } +export type GQLUnstoppableDomainsMeta = { + readonly __typename?: 'UnstoppableDomainsMeta'; + readonly blockchain: Scalars['String']['output']; + readonly domain: Scalars['String']['output']; + readonly namehash: Scalars['String']['output']; + readonly networkId: Scalars['Int']['output']; + readonly owner: Scalars['String']['output']; + readonly registry: Scalars['String']['output']; + readonly resolver: Scalars['String']['output']; + readonly reverse: Scalars['Boolean']['output']; + readonly tokenId: Scalars['String']['output']; + readonly type: Scalars['String']['output']; +}; + +export type GQLUnstoppableDomainsResponse = { + readonly __typename?: 'UnstoppableDomainsResponse'; + readonly meta: GQLUnstoppableDomainsMeta; + readonly records: GQLRecords; +}; + export type GQLUser = { readonly __typename?: 'User'; readonly address: Scalars['String']['output']; diff --git a/src/gql/utils/schema.graphql b/src/gql/utils/schema.graphql index 22fde16e..ca7b5cb6 100644 --- a/src/gql/utils/schema.graphql +++ b/src/gql/utils/schema.graphql @@ -393,7 +393,8 @@ enum OraclesOrder { } type Proxies { - bybit: BybitResponse! + bybit: BybitResponse + unstoppableDomains(domainName: String!): UnstoppableDomainsResponse } type Query { @@ -419,6 +420,16 @@ type Query { wasm: Wasm! } +type Records { + cryptoEthAddress: String + cryptoNibiAddress: String + ipfsHtmlValue: String + tokenEvmEthEthAddress: String + tokenEvmMaticMaticAddress: String + tokenEvmMaticPolAddress: String + tokenNibiNibiNibiAddress: String +} + type Redelegation { amount: Int! completion_time: String! @@ -565,6 +576,24 @@ enum UnbondingOrder { validator_address } +type UnstoppableDomainsMeta { + blockchain: String! + domain: String! + namehash: String! + networkId: Int! + owner: String! + registry: String! + resolver: String! + reverse: Boolean! + tokenId: String! + type: String! +} + +type UnstoppableDomainsResponse { + meta: UnstoppableDomainsMeta! + records: Records! +} + type User { address: String! all_balances: [Balance!]! From 96a9ace4eaca6c345a1cd98f82a865a5b27a2a8f Mon Sep 17 00:00:00 2001 From: Cameron Gilbert Date: Fri, 4 Apr 2025 15:07:04 -0400 Subject: [PATCH 2/4] fix: move curly braces --- nibiru | 2 +- src/gql/query/proxies.ts | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/nibiru b/nibiru index c073eed8..b7b187f4 160000 --- a/nibiru +++ b/nibiru @@ -1 +1 @@ -Subproject commit c073eed8cc9330972d398151919ca31871bf09b7 +Subproject commit b7b187f4af8d37f40596c5f21abf40311a6ea026 diff --git a/src/gql/query/proxies.ts b/src/gql/query/proxies.ts index 050a46b8..d284e56d 100644 --- a/src/gql/query/proxies.ts +++ b/src/gql/query/proxies.ts @@ -34,11 +34,11 @@ export const proxiesQueryString = ( ) } - return `{ + return ` proxies { ${proxiesQuery.join("\n")} } - }` + ` } export const proxies = async ( @@ -46,4 +46,9 @@ export const proxies = async ( fields: DeepPartial, domainName?: string ): Promise => - doGqlQuery(proxiesQueryString(fields, domainName), endpt) + doGqlQuery( + `{ + ${proxiesQueryString(fields, domainName)} + }`, + endpt + ) From c9e895d388b71deab666c2c67cb0dc12f714a56f Mon Sep 17 00:00:00 2001 From: Calico Nino <54007257+CalicoNino@users.noreply.github.com> Date: Wed, 9 Apr 2025 09:58:59 -0400 Subject: [PATCH 3/4] refactor: adding custom amino messages (#407) * refactor: adding custom amino converter for convert to evm msg * chore: comment and linting * chore: new file instead of index * chore: linting --- nibiru | 2 +- src/sdk/aminomsgs/customamino.ts | 79 +++++++++++++++++++++++++++ src/sdk/aminomsgs/index.ts | 5 ++ src/sdk/core/signingcosmwasmclient.ts | 2 + src/sdk/index.ts | 1 + 5 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 src/sdk/aminomsgs/customamino.ts create mode 100644 src/sdk/aminomsgs/index.ts diff --git a/nibiru b/nibiru index b7b187f4..1f1d3d3f 160000 --- a/nibiru +++ b/nibiru @@ -1 +1 @@ -Subproject commit b7b187f4af8d37f40596c5f21abf40311a6ea026 +Subproject commit 1f1d3d3faceac9e167e170da478a2e9f666a1532 diff --git a/src/sdk/aminomsgs/customamino.ts b/src/sdk/aminomsgs/customamino.ts new file mode 100644 index 00000000..c9b88b71 --- /dev/null +++ b/src/sdk/aminomsgs/customamino.ts @@ -0,0 +1,79 @@ +import { AminoConverter } from "@cosmjs/stargate" + +/** + * MsgConvertCoinToEvm defines the structure of the Protobuf message + * used to convert a Cosmos coin to its EVM representation. + */ +interface MsgConvertCoinToEvm { + /** The target Ethereum address that will receive the converted tokens */ + toEthAddr: string + + /** The Cosmos sender address initiating the conversion */ + sender: string + + /** The bank coin object containing the denom and amount to convert */ + bankCoin: { + denom: string + amount: string + } +} + +/** + * Amino-encoded version of MsgConvertCoinToEvm. + * Uses snake_case field names as required by the Amino standard. + */ +interface AminoMsgConvertCoinToEvm { + /** The Ethereum address in snake_case format */ + to_eth_addr: string + + /** The Cosmos sender address */ + sender: string + + /** The coin to be converted, in Amino format */ + bank_coin: { + denom: string + amount: string + } +} + +/** + * AminoConverters used by the AminoTypes class to serialize/deserialize + * MsgConvertCoinToEvm messages to/from Amino-compatible JSON format. + */ +export const customAminoConverters: Record = { + "/eth.evm.v1.MsgConvertCoinToEvm": { + /** + * Identifier for this Amino message type. + * This must match the type used by legacy clients or signing tools. + */ + aminoType: "eth/MsgConvertCoinToEvm", + + /** + * Converts a Protobuf MsgConvertCoinToEvm into its Amino-encoded representation. + * @param msg - The Protobuf message object + * @returns The Amino-encoded JSON representation + */ + toAmino: (msg: MsgConvertCoinToEvm): AminoMsgConvertCoinToEvm => ({ + to_eth_addr: msg.toEthAddr, + sender: msg.sender, + bank_coin: { + denom: msg.bankCoin.denom, + amount: msg.bankCoin.amount, + }, + }), + + /** + * Converts an Amino-encoded MsgConvertCoinToEvm into its Protobuf representation. + * @param amino - The Amino JSON object + * @returns The Protobuf-style message object + */ + fromAmino: (amino: AminoMsgConvertCoinToEvm): MsgConvertCoinToEvm => ({ + toEthAddr: amino.to_eth_addr, + sender: amino.sender, + bankCoin: { + denom: amino.bank_coin.denom, + amount: amino.bank_coin.amount, + }, + }), + }, +} diff --git a/src/sdk/aminomsgs/index.ts b/src/sdk/aminomsgs/index.ts new file mode 100644 index 00000000..248d4807 --- /dev/null +++ b/src/sdk/aminomsgs/index.ts @@ -0,0 +1,5 @@ +/** + * @file Automatically generated by barrelsby. + */ + +export * from "./customamino" diff --git a/src/sdk/core/signingcosmwasmclient.ts b/src/sdk/core/signingcosmwasmclient.ts index 8fd5df95..ce250b35 100644 --- a/src/sdk/core/signingcosmwasmclient.ts +++ b/src/sdk/core/signingcosmwasmclient.ts @@ -74,6 +74,7 @@ import { import { MsgWithdrawDelegatorReward } from "cosmjs-types/cosmos/distribution/v1beta1/tx" import { SignMode } from "cosmjs-types/cosmos/tx/signing/v1beta1/signing" import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx" +import { customAminoConverters } from "../aminomsgs" function createDeliverTxResponseErrorMessage( result: DeliverTxResponse @@ -162,6 +163,7 @@ export class NibiSigningCosmWasmClient extends NibiCosmWasmClient { aminoTypes = new AminoTypes({ ...createDefaultAminoConverters(), ...createWasmAminoConverters(), + ...customAminoConverters, }), } = options this.registry = registry diff --git a/src/sdk/index.ts b/src/sdk/index.ts index 18656a5a..7af72b4d 100644 --- a/src/sdk/index.ts +++ b/src/sdk/index.ts @@ -2,6 +2,7 @@ * @file Automatically generated by barrelsby. */ +export * from "./aminomsgs/index" export * from "./core/index" export * from "./msg/index" export * from "./query/index" From c1c2175d2763c118aba6028f36ffc79d14de4870 Mon Sep 17 00:00:00 2001 From: Cameron Gilbert Date: Wed, 21 May 2025 10:12:07 -0400 Subject: [PATCH 4/4] chore: pull latest protos --- nibiru | 2 +- src/protojs/cosmos/app/v1alpha1/module.ts | 330 ++++++++++++++++++ src/protojs/eth/evm/module/module.ts | 172 +++++++++ src/protojs/index.cosmos.app.ts | 3 + src/protojs/index.cosmos.app.v1alpha1.ts | 3 + src/protojs/index.eth.evm.v1.ts | 2 +- src/protojs/index.nibiru.devgas.v1.ts | 4 +- src/protojs/index.nibiru.epochs.module.ts | 3 + src/protojs/index.nibiru.epochs.module.v1.ts | 3 + src/protojs/index.nibiru.epochs.v1.ts | 2 +- src/protojs/index.nibiru.evm.module.ts | 3 + src/protojs/index.nibiru.evm.module.v1.ts | 3 + src/protojs/index.nibiru.evm.ts | 3 + src/protojs/index.nibiru.inflation.module.ts | 3 + .../index.nibiru.inflation.module.v1.ts | 3 + src/protojs/index.nibiru.inflation.v1.ts | 3 +- src/protojs/index.nibiru.oracle.module.ts | 3 + src/protojs/index.nibiru.oracle.module.v1.ts | 3 + src/protojs/index.nibiru.oracle.v1.ts | 2 +- src/protojs/index.nibiru.sudo.module.ts | 3 + src/protojs/index.nibiru.sudo.module.v1.ts | 3 + src/protojs/index.nibiru.sudo.v1.ts | 3 +- .../index.nibiru.tokenfactory.module.ts | 3 + .../index.nibiru.tokenfactory.module.v1.ts | 3 + src/protojs/index.nibiru.tokenfactory.v1.ts | 3 +- src/protojs/nibiru/epochs/module/module.ts | 197 +++++++++++ src/protojs/nibiru/inflation/module/module.ts | 172 +++++++++ src/protojs/nibiru/oracle/module/module.ts | 172 +++++++++ src/protojs/nibiru/oracle/v1/oracle.ts | 2 +- src/protojs/nibiru/sudo/module/module.ts | 172 +++++++++ src/protojs/nibiru/sudo/v1/event.ts | 2 +- .../nibiru/tokenfactory/module/module.ts | 172 +++++++++ 32 files changed, 1446 insertions(+), 11 deletions(-) create mode 100644 src/protojs/cosmos/app/v1alpha1/module.ts create mode 100644 src/protojs/eth/evm/module/module.ts create mode 100644 src/protojs/index.cosmos.app.ts create mode 100644 src/protojs/index.cosmos.app.v1alpha1.ts create mode 100644 src/protojs/index.nibiru.epochs.module.ts create mode 100644 src/protojs/index.nibiru.epochs.module.v1.ts create mode 100644 src/protojs/index.nibiru.evm.module.ts create mode 100644 src/protojs/index.nibiru.evm.module.v1.ts create mode 100644 src/protojs/index.nibiru.evm.ts create mode 100644 src/protojs/index.nibiru.inflation.module.ts create mode 100644 src/protojs/index.nibiru.inflation.module.v1.ts create mode 100644 src/protojs/index.nibiru.oracle.module.ts create mode 100644 src/protojs/index.nibiru.oracle.module.v1.ts create mode 100644 src/protojs/index.nibiru.sudo.module.ts create mode 100644 src/protojs/index.nibiru.sudo.module.v1.ts create mode 100644 src/protojs/index.nibiru.tokenfactory.module.ts create mode 100644 src/protojs/index.nibiru.tokenfactory.module.v1.ts create mode 100644 src/protojs/nibiru/epochs/module/module.ts create mode 100644 src/protojs/nibiru/inflation/module/module.ts create mode 100644 src/protojs/nibiru/oracle/module/module.ts create mode 100644 src/protojs/nibiru/sudo/module/module.ts create mode 100644 src/protojs/nibiru/tokenfactory/module/module.ts diff --git a/nibiru b/nibiru index 82affcbb..04ba8366 160000 --- a/nibiru +++ b/nibiru @@ -1 +1 @@ -Subproject commit 82affcbbce49314bb80e7af571d5c9bc1f359d40 +Subproject commit 04ba83662994c9e9f3e057278f0afeb8a7f2194e diff --git a/src/protojs/cosmos/app/v1alpha1/module.ts b/src/protojs/cosmos/app/v1alpha1/module.ts new file mode 100644 index 00000000..302bb6ab --- /dev/null +++ b/src/protojs/cosmos/app/v1alpha1/module.ts @@ -0,0 +1,330 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +/** 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. It is required to make debugging + * of configuration errors easier for users. + */ + 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[]; +} + +/** 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 files containing the + * text "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; +} + +/** + * 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; +} + +function createBaseModuleDescriptor(): ModuleDescriptor { + return { goImport: "", usePackage: [], canMigrateFrom: [] }; +} + +export const ModuleDescriptor = { + encode(message: ModuleDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + 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: _m0.Reader | Uint8Array, length?: number): ModuleDescriptor { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(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: + if (tag !== 10) { + break; + } + + message.goImport = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.usePackage.push(PackageReference.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.canMigrateFrom.push(MigrateFromInfo.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ModuleDescriptor { + return { + goImport: isSet(object.goImport) ? String(object.goImport) : "", + usePackage: Array.isArray(object?.usePackage) + ? object.usePackage.map((e: any) => PackageReference.fromJSON(e)) + : [], + canMigrateFrom: Array.isArray(object?.canMigrateFrom) + ? object.canMigrateFrom.map((e: any) => MigrateFromInfo.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ModuleDescriptor): unknown { + const obj: any = {}; + message.goImport !== undefined && (obj.goImport = message.goImport); + if (message.usePackage) { + obj.usePackage = message.usePackage.map((e) => e ? PackageReference.toJSON(e) : undefined); + } else { + obj.usePackage = []; + } + if (message.canMigrateFrom) { + obj.canMigrateFrom = message.canMigrateFrom.map((e) => e ? MigrateFromInfo.toJSON(e) : undefined); + } else { + obj.canMigrateFrom = []; + } + return obj; + }, + + create, I>>(base?: I): ModuleDescriptor { + return ModuleDescriptor.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): 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; + }, +}; + +function createBasePackageReference(): PackageReference { + return { name: "", revision: 0 }; +} + +export const PackageReference = { + encode(message: PackageReference, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.revision !== 0) { + writer.uint32(16).uint32(message.revision); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PackageReference { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(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: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.revision = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): PackageReference { + return { + name: isSet(object.name) ? String(object.name) : "", + revision: isSet(object.revision) ? Number(object.revision) : 0, + }; + }, + + toJSON(message: PackageReference): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.revision !== undefined && (obj.revision = Math.round(message.revision)); + return obj; + }, + + create, I>>(base?: I): PackageReference { + return PackageReference.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): PackageReference { + const message = createBasePackageReference(); + message.name = object.name ?? ""; + message.revision = object.revision ?? 0; + return message; + }, +}; + +function createBaseMigrateFromInfo(): MigrateFromInfo { + return { module: "" }; +} + +export const MigrateFromInfo = { + encode(message: MigrateFromInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.module !== "") { + writer.uint32(10).string(message.module); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MigrateFromInfo { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(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: + if (tag !== 10) { + break; + } + + message.module = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MigrateFromInfo { + return { module: isSet(object.module) ? String(object.module) : "" }; + }, + + toJSON(message: MigrateFromInfo): unknown { + const obj: any = {}; + message.module !== undefined && (obj.module = message.module); + return obj; + }, + + create, I>>(base?: I): MigrateFromInfo { + return MigrateFromInfo.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): MigrateFromInfo { + const message = createBaseMigrateFromInfo(); + message.module = object.module ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends Array ? Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/protojs/eth/evm/module/module.ts b/src/protojs/eth/evm/module/module.ts new file mode 100644 index 00000000..6e13be70 --- /dev/null +++ b/src/protojs/eth/evm/module/module.ts @@ -0,0 +1,172 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +/** Module is the config object for the devgas module. */ +export interface Module { + /** authority defines the custom module authority. If not set, defaults to the governance module. */ + authority: string; +} + +/** ModuleAccountPermission represents permissions for a module account. */ +export interface ModuleAccountPermission { + /** account is the name of the module. */ + account: string; + /** + * permissions are the permissions this module has. Currently recognized + * values are minter, burner and staking. + */ + permissions: string[]; +} + +function createBaseModule(): Module { + return { authority: "" }; +} + +export const Module = { + encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Module { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.authority = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Module { + return { authority: isSet(object.authority) ? String(object.authority) : "" }; + }, + + toJSON(message: Module): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + return obj; + }, + + create, I>>(base?: I): Module { + return Module.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Module { + const message = createBaseModule(); + message.authority = object.authority ?? ""; + return message; + }, +}; + +function createBaseModuleAccountPermission(): ModuleAccountPermission { + return { account: "", permissions: [] }; +} + +export const ModuleAccountPermission = { + encode(message: ModuleAccountPermission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + for (const v of message.permissions) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleAccountPermission { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleAccountPermission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.account = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.permissions.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ModuleAccountPermission { + return { + account: isSet(object.account) ? String(object.account) : "", + permissions: Array.isArray(object?.permissions) ? object.permissions.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: ModuleAccountPermission): unknown { + const obj: any = {}; + message.account !== undefined && (obj.account = message.account); + if (message.permissions) { + obj.permissions = message.permissions.map((e) => e); + } else { + obj.permissions = []; + } + return obj; + }, + + create, I>>(base?: I): ModuleAccountPermission { + return ModuleAccountPermission.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ModuleAccountPermission { + const message = createBaseModuleAccountPermission(); + message.account = object.account ?? ""; + message.permissions = object.permissions?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends Array ? Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/protojs/index.cosmos.app.ts b/src/protojs/index.cosmos.app.ts new file mode 100644 index 00000000..4caedf56 --- /dev/null +++ b/src/protojs/index.cosmos.app.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * as v1alpha1 from "./index.cosmos.app.v1alpha1"; diff --git a/src/protojs/index.cosmos.app.v1alpha1.ts b/src/protojs/index.cosmos.app.v1alpha1.ts new file mode 100644 index 00000000..6b069abb --- /dev/null +++ b/src/protojs/index.cosmos.app.v1alpha1.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * from "./cosmos/app/v1alpha1/module"; diff --git a/src/protojs/index.eth.evm.v1.ts b/src/protojs/index.eth.evm.v1.ts index f3179cbd..4e16621b 100644 --- a/src/protojs/index.eth.evm.v1.ts +++ b/src/protojs/index.eth.evm.v1.ts @@ -1,4 +1,4 @@ /* eslint-disable */ export * from "./eth/evm/v1/evm"; -export * from "./eth/evm/v1/events"; +export * from "./eth/evm/v1/tx"; diff --git a/src/protojs/index.nibiru.devgas.v1.ts b/src/protojs/index.nibiru.devgas.v1.ts index 143a15b9..c4ebcfe0 100644 --- a/src/protojs/index.nibiru.devgas.v1.ts +++ b/src/protojs/index.nibiru.devgas.v1.ts @@ -1,3 +1,5 @@ /* eslint-disable */ -export * from "./nibiru/devgas/v1/event"; +export * from "./nibiru/devgas/v1/devgas"; +export * from "./nibiru/devgas/v1/genesis"; +export * from "./nibiru/devgas/v1/tx"; diff --git a/src/protojs/index.nibiru.epochs.module.ts b/src/protojs/index.nibiru.epochs.module.ts new file mode 100644 index 00000000..823abad2 --- /dev/null +++ b/src/protojs/index.nibiru.epochs.module.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * as v1 from "./index.nibiru.epochs.module.v1"; diff --git a/src/protojs/index.nibiru.epochs.module.v1.ts b/src/protojs/index.nibiru.epochs.module.v1.ts new file mode 100644 index 00000000..e9e110f7 --- /dev/null +++ b/src/protojs/index.nibiru.epochs.module.v1.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * from "./nibiru/epochs/module/module"; diff --git a/src/protojs/index.nibiru.epochs.v1.ts b/src/protojs/index.nibiru.epochs.v1.ts index 2871806e..b814312d 100644 --- a/src/protojs/index.nibiru.epochs.v1.ts +++ b/src/protojs/index.nibiru.epochs.v1.ts @@ -1,3 +1,3 @@ /* eslint-disable */ -export * from "./nibiru/epochs/v1/event"; +export * from "./nibiru/epochs/v1/state"; diff --git a/src/protojs/index.nibiru.evm.module.ts b/src/protojs/index.nibiru.evm.module.ts new file mode 100644 index 00000000..31c1327e --- /dev/null +++ b/src/protojs/index.nibiru.evm.module.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * as v1 from "./index.nibiru.evm.module.v1"; diff --git a/src/protojs/index.nibiru.evm.module.v1.ts b/src/protojs/index.nibiru.evm.module.v1.ts new file mode 100644 index 00000000..fe36f48c --- /dev/null +++ b/src/protojs/index.nibiru.evm.module.v1.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * from "./eth/evm/module/module"; diff --git a/src/protojs/index.nibiru.evm.ts b/src/protojs/index.nibiru.evm.ts new file mode 100644 index 00000000..7cd34ad4 --- /dev/null +++ b/src/protojs/index.nibiru.evm.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * as module from "./index.nibiru.evm.module"; diff --git a/src/protojs/index.nibiru.inflation.module.ts b/src/protojs/index.nibiru.inflation.module.ts new file mode 100644 index 00000000..7612e062 --- /dev/null +++ b/src/protojs/index.nibiru.inflation.module.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * as v1 from "./index.nibiru.inflation.module.v1"; diff --git a/src/protojs/index.nibiru.inflation.module.v1.ts b/src/protojs/index.nibiru.inflation.module.v1.ts new file mode 100644 index 00000000..a0ab9773 --- /dev/null +++ b/src/protojs/index.nibiru.inflation.module.v1.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * from "./nibiru/inflation/module/module"; diff --git a/src/protojs/index.nibiru.inflation.v1.ts b/src/protojs/index.nibiru.inflation.v1.ts index 3de5b9db..fe47db74 100644 --- a/src/protojs/index.nibiru.inflation.v1.ts +++ b/src/protojs/index.nibiru.inflation.v1.ts @@ -1,3 +1,4 @@ /* eslint-disable */ -export * from "./nibiru/inflation/v1/event"; +export * from "./nibiru/inflation/v1/inflation"; +export * from "./nibiru/inflation/v1/tx"; diff --git a/src/protojs/index.nibiru.oracle.module.ts b/src/protojs/index.nibiru.oracle.module.ts new file mode 100644 index 00000000..0ba8757a --- /dev/null +++ b/src/protojs/index.nibiru.oracle.module.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * as v1 from "./index.nibiru.oracle.module.v1"; diff --git a/src/protojs/index.nibiru.oracle.module.v1.ts b/src/protojs/index.nibiru.oracle.module.v1.ts new file mode 100644 index 00000000..a059e543 --- /dev/null +++ b/src/protojs/index.nibiru.oracle.module.v1.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * from "./nibiru/oracle/module/module"; diff --git a/src/protojs/index.nibiru.oracle.v1.ts b/src/protojs/index.nibiru.oracle.v1.ts index b22bf545..62f33089 100644 --- a/src/protojs/index.nibiru.oracle.v1.ts +++ b/src/protojs/index.nibiru.oracle.v1.ts @@ -1,4 +1,4 @@ /* eslint-disable */ export * from "./nibiru/oracle/v1/oracle"; -export * from "./nibiru/oracle/v1/event"; +export * from "./nibiru/oracle/v1/tx"; diff --git a/src/protojs/index.nibiru.sudo.module.ts b/src/protojs/index.nibiru.sudo.module.ts new file mode 100644 index 00000000..16de0fe6 --- /dev/null +++ b/src/protojs/index.nibiru.sudo.module.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * as v1 from "./index.nibiru.sudo.module.v1"; diff --git a/src/protojs/index.nibiru.sudo.module.v1.ts b/src/protojs/index.nibiru.sudo.module.v1.ts new file mode 100644 index 00000000..b6a6f482 --- /dev/null +++ b/src/protojs/index.nibiru.sudo.module.v1.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * from "./nibiru/sudo/module/module"; diff --git a/src/protojs/index.nibiru.sudo.v1.ts b/src/protojs/index.nibiru.sudo.v1.ts index 545236d3..a58d6c45 100644 --- a/src/protojs/index.nibiru.sudo.v1.ts +++ b/src/protojs/index.nibiru.sudo.v1.ts @@ -1,4 +1,3 @@ /* eslint-disable */ -export * from "./nibiru/sudo/v1/state"; -export * from "./nibiru/sudo/v1/event"; +export * from "./nibiru/sudo/v1/tx"; diff --git a/src/protojs/index.nibiru.tokenfactory.module.ts b/src/protojs/index.nibiru.tokenfactory.module.ts new file mode 100644 index 00000000..148ce8d1 --- /dev/null +++ b/src/protojs/index.nibiru.tokenfactory.module.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * as v1 from "./index.nibiru.tokenfactory.module.v1"; diff --git a/src/protojs/index.nibiru.tokenfactory.module.v1.ts b/src/protojs/index.nibiru.tokenfactory.module.v1.ts new file mode 100644 index 00000000..7d97cf45 --- /dev/null +++ b/src/protojs/index.nibiru.tokenfactory.module.v1.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export * from "./nibiru/tokenfactory/module/module"; diff --git a/src/protojs/index.nibiru.tokenfactory.v1.ts b/src/protojs/index.nibiru.tokenfactory.v1.ts index 89e2a7c2..ec2bd889 100644 --- a/src/protojs/index.nibiru.tokenfactory.v1.ts +++ b/src/protojs/index.nibiru.tokenfactory.v1.ts @@ -1,3 +1,4 @@ /* eslint-disable */ -export * from "./nibiru/tokenfactory/v1/event"; +export * from "./nibiru/tokenfactory/v1/state"; +export * from "./nibiru/tokenfactory/v1/tx"; diff --git a/src/protojs/nibiru/epochs/module/module.ts b/src/protojs/nibiru/epochs/module/module.ts new file mode 100644 index 00000000..1e35f3a3 --- /dev/null +++ b/src/protojs/nibiru/epochs/module/module.ts @@ -0,0 +1,197 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +/** Module is the config object for the epochs module. */ +export interface Module { + /** + * hooks_order specifies the order of staking hooks and should be a list + * of module names which provide a staking hooks instance. If no order is + * provided, then hooks will be applied in alphabetical order of module names. + */ + hooksOrder: string[]; + /** authority defines the custom module authority. If not set, defaults to the governance module. */ + authority: string; +} + +/** ModuleAccountPermission represents permissions for a module account. */ +export interface ModuleAccountPermission { + /** account is the name of the module. */ + account: string; + /** + * permissions are the permissions this module has. Currently recognized + * values are minter, burner and staking. + */ + permissions: string[]; +} + +function createBaseModule(): Module { + return { hooksOrder: [], authority: "" }; +} + +export const Module = { + encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.hooksOrder) { + writer.uint32(10).string(v!); + } + if (message.authority !== "") { + writer.uint32(18).string(message.authority); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Module { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.hooksOrder.push(reader.string()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.authority = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Module { + return { + hooksOrder: Array.isArray(object?.hooksOrder) ? object.hooksOrder.map((e: any) => String(e)) : [], + authority: isSet(object.authority) ? String(object.authority) : "", + }; + }, + + toJSON(message: Module): unknown { + const obj: any = {}; + if (message.hooksOrder) { + obj.hooksOrder = message.hooksOrder.map((e) => e); + } else { + obj.hooksOrder = []; + } + message.authority !== undefined && (obj.authority = message.authority); + return obj; + }, + + create, I>>(base?: I): Module { + return Module.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Module { + const message = createBaseModule(); + message.hooksOrder = object.hooksOrder?.map((e) => e) || []; + message.authority = object.authority ?? ""; + return message; + }, +}; + +function createBaseModuleAccountPermission(): ModuleAccountPermission { + return { account: "", permissions: [] }; +} + +export const ModuleAccountPermission = { + encode(message: ModuleAccountPermission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + for (const v of message.permissions) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleAccountPermission { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleAccountPermission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.account = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.permissions.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ModuleAccountPermission { + return { + account: isSet(object.account) ? String(object.account) : "", + permissions: Array.isArray(object?.permissions) ? object.permissions.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: ModuleAccountPermission): unknown { + const obj: any = {}; + message.account !== undefined && (obj.account = message.account); + if (message.permissions) { + obj.permissions = message.permissions.map((e) => e); + } else { + obj.permissions = []; + } + return obj; + }, + + create, I>>(base?: I): ModuleAccountPermission { + return ModuleAccountPermission.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ModuleAccountPermission { + const message = createBaseModuleAccountPermission(); + message.account = object.account ?? ""; + message.permissions = object.permissions?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends Array ? Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/protojs/nibiru/inflation/module/module.ts b/src/protojs/nibiru/inflation/module/module.ts new file mode 100644 index 00000000..7d14f1cc --- /dev/null +++ b/src/protojs/nibiru/inflation/module/module.ts @@ -0,0 +1,172 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +/** Module is the config object for the inflation module. */ +export interface Module { + /** authority defines the custom module authority. If not set, defaults to the governance module. */ + authority: string; +} + +/** ModuleAccountPermission represents permissions for a module account. */ +export interface ModuleAccountPermission { + /** account is the name of the module. */ + account: string; + /** + * permissions are the permissions this module has. Currently recognized + * values are minter, burner and staking. + */ + permissions: string[]; +} + +function createBaseModule(): Module { + return { authority: "" }; +} + +export const Module = { + encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Module { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.authority = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Module { + return { authority: isSet(object.authority) ? String(object.authority) : "" }; + }, + + toJSON(message: Module): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + return obj; + }, + + create, I>>(base?: I): Module { + return Module.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Module { + const message = createBaseModule(); + message.authority = object.authority ?? ""; + return message; + }, +}; + +function createBaseModuleAccountPermission(): ModuleAccountPermission { + return { account: "", permissions: [] }; +} + +export const ModuleAccountPermission = { + encode(message: ModuleAccountPermission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + for (const v of message.permissions) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleAccountPermission { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleAccountPermission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.account = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.permissions.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ModuleAccountPermission { + return { + account: isSet(object.account) ? String(object.account) : "", + permissions: Array.isArray(object?.permissions) ? object.permissions.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: ModuleAccountPermission): unknown { + const obj: any = {}; + message.account !== undefined && (obj.account = message.account); + if (message.permissions) { + obj.permissions = message.permissions.map((e) => e); + } else { + obj.permissions = []; + } + return obj; + }, + + create, I>>(base?: I): ModuleAccountPermission { + return ModuleAccountPermission.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ModuleAccountPermission { + const message = createBaseModuleAccountPermission(); + message.account = object.account ?? ""; + message.permissions = object.permissions?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends Array ? Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/protojs/nibiru/oracle/module/module.ts b/src/protojs/nibiru/oracle/module/module.ts new file mode 100644 index 00000000..5b071026 --- /dev/null +++ b/src/protojs/nibiru/oracle/module/module.ts @@ -0,0 +1,172 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +/** Module is the config object for the oracle module. */ +export interface Module { + /** authority defines the custom module authority. If not set, defaults to the governance module. */ + authority: string; +} + +/** ModuleAccountPermission represents permissions for a module account. */ +export interface ModuleAccountPermission { + /** account is the name of the module. */ + account: string; + /** + * permissions are the permissions this module has. Currently recognized + * values are minter, burner and staking. + */ + permissions: string[]; +} + +function createBaseModule(): Module { + return { authority: "" }; +} + +export const Module = { + encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Module { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.authority = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Module { + return { authority: isSet(object.authority) ? String(object.authority) : "" }; + }, + + toJSON(message: Module): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + return obj; + }, + + create, I>>(base?: I): Module { + return Module.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Module { + const message = createBaseModule(); + message.authority = object.authority ?? ""; + return message; + }, +}; + +function createBaseModuleAccountPermission(): ModuleAccountPermission { + return { account: "", permissions: [] }; +} + +export const ModuleAccountPermission = { + encode(message: ModuleAccountPermission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + for (const v of message.permissions) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleAccountPermission { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleAccountPermission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.account = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.permissions.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ModuleAccountPermission { + return { + account: isSet(object.account) ? String(object.account) : "", + permissions: Array.isArray(object?.permissions) ? object.permissions.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: ModuleAccountPermission): unknown { + const obj: any = {}; + message.account !== undefined && (obj.account = message.account); + if (message.permissions) { + obj.permissions = message.permissions.map((e) => e); + } else { + obj.permissions = []; + } + return obj; + }, + + create, I>>(base?: I): ModuleAccountPermission { + return ModuleAccountPermission.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ModuleAccountPermission { + const message = createBaseModuleAccountPermission(); + message.account = object.account ?? ""; + message.permissions = object.permissions?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends Array ? Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/protojs/nibiru/oracle/v1/oracle.ts b/src/protojs/nibiru/oracle/v1/oracle.ts index bc8ce253..ba9f323a 100644 --- a/src/protojs/nibiru/oracle/v1/oracle.ts +++ b/src/protojs/nibiru/oracle/v1/oracle.ts @@ -14,7 +14,7 @@ export interface Params { */ voteThreshold: string; /** - * RewardBand defines a maxium divergence that a price vote can have from the + * RewardBand defines a maximum divergence that a price vote can have from the * weighted median in the ballot. If a vote lies within the valid range * defined by: * μ := weightedMedian, diff --git a/src/protojs/nibiru/sudo/module/module.ts b/src/protojs/nibiru/sudo/module/module.ts new file mode 100644 index 00000000..75def39c --- /dev/null +++ b/src/protojs/nibiru/sudo/module/module.ts @@ -0,0 +1,172 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +/** Module is the config object for the sudo module. */ +export interface Module { + /** authority defines the custom module authority. If not set, defaults to the governance module. */ + authority: string; +} + +/** ModuleAccountPermission represents permissions for a module account. */ +export interface ModuleAccountPermission { + /** account is the name of the module. */ + account: string; + /** + * permissions are the permissions this module has. Currently recognized + * values are minter, burner and staking. + */ + permissions: string[]; +} + +function createBaseModule(): Module { + return { authority: "" }; +} + +export const Module = { + encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Module { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.authority = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Module { + return { authority: isSet(object.authority) ? String(object.authority) : "" }; + }, + + toJSON(message: Module): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + return obj; + }, + + create, I>>(base?: I): Module { + return Module.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Module { + const message = createBaseModule(); + message.authority = object.authority ?? ""; + return message; + }, +}; + +function createBaseModuleAccountPermission(): ModuleAccountPermission { + return { account: "", permissions: [] }; +} + +export const ModuleAccountPermission = { + encode(message: ModuleAccountPermission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + for (const v of message.permissions) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleAccountPermission { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleAccountPermission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.account = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.permissions.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ModuleAccountPermission { + return { + account: isSet(object.account) ? String(object.account) : "", + permissions: Array.isArray(object?.permissions) ? object.permissions.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: ModuleAccountPermission): unknown { + const obj: any = {}; + message.account !== undefined && (obj.account = message.account); + if (message.permissions) { + obj.permissions = message.permissions.map((e) => e); + } else { + obj.permissions = []; + } + return obj; + }, + + create, I>>(base?: I): ModuleAccountPermission { + return ModuleAccountPermission.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ModuleAccountPermission { + const message = createBaseModuleAccountPermission(); + message.account = object.account ?? ""; + message.permissions = object.permissions?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends Array ? Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/protojs/nibiru/sudo/v1/event.ts b/src/protojs/nibiru/sudo/v1/event.ts index aacd1540..3dc4c445 100644 --- a/src/protojs/nibiru/sudo/v1/event.ts +++ b/src/protojs/nibiru/sudo/v1/event.ts @@ -6,7 +6,7 @@ import { Sudoers } from "./state"; /** EventUpdateSudoers: ABCI event emitted upon execution of "MsgEditSudoers". */ export interface EventUpdateSudoers { sudoers?: Sudoers; - /** Action is the type of update that occured to the "sudoers" */ + /** Action is the type of update that occurred to the "sudoers" */ action: string; } diff --git a/src/protojs/nibiru/tokenfactory/module/module.ts b/src/protojs/nibiru/tokenfactory/module/module.ts new file mode 100644 index 00000000..3d1051b6 --- /dev/null +++ b/src/protojs/nibiru/tokenfactory/module/module.ts @@ -0,0 +1,172 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +/** Module is the config object for the tokenfactory module. */ +export interface Module { + /** authority defines the custom module authority. If not set, defaults to the governance module. */ + authority: string; +} + +/** ModuleAccountPermission represents permissions for a module account. */ +export interface ModuleAccountPermission { + /** account is the name of the module. */ + account: string; + /** + * permissions are the permissions this module has. Currently recognized + * values are minter, burner and staking. + */ + permissions: string[]; +} + +function createBaseModule(): Module { + return { authority: "" }; +} + +export const Module = { + encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Module { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.authority = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Module { + return { authority: isSet(object.authority) ? String(object.authority) : "" }; + }, + + toJSON(message: Module): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + return obj; + }, + + create, I>>(base?: I): Module { + return Module.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Module { + const message = createBaseModule(); + message.authority = object.authority ?? ""; + return message; + }, +}; + +function createBaseModuleAccountPermission(): ModuleAccountPermission { + return { account: "", permissions: [] }; +} + +export const ModuleAccountPermission = { + encode(message: ModuleAccountPermission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + for (const v of message.permissions) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleAccountPermission { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleAccountPermission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.account = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.permissions.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ModuleAccountPermission { + return { + account: isSet(object.account) ? String(object.account) : "", + permissions: Array.isArray(object?.permissions) ? object.permissions.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: ModuleAccountPermission): unknown { + const obj: any = {}; + message.account !== undefined && (obj.account = message.account); + if (message.permissions) { + obj.permissions = message.permissions.map((e) => e); + } else { + obj.permissions = []; + } + return obj; + }, + + create, I>>(base?: I): ModuleAccountPermission { + return ModuleAccountPermission.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ModuleAccountPermission { + const message = createBaseModuleAccountPermission(); + message.account = object.account ?? ""; + message.permissions = object.permissions?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends Array ? Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +}