diff --git a/packages/xchain-mayachain/genMsgs.sh b/packages/xchain-mayachain/genMsgs.sh index d13e984e8..1f864c307 100755 --- a/packages/xchain-mayachain/genMsgs.sh +++ b/packages/xchain-mayachain/genMsgs.sh @@ -1,31 +1,126 @@ #!/bin/bash -# this script checks out mayanode master and generates the proto3 typescript buindings for MsgDeposit and MsgSend +# This script updates MAYAChain Protobuf bindings for MsgDeposit and MsgSend +set -euo pipefail # Exit on error, undefined variables, and pipe failures + +# Check for required tools +for tool in yarn git curl sed; do + if ! command -v "$tool" &>/dev/null; then + echo "Error: Required tool '$tool' is not installed" + exit 1 + fi +done MSG_COMPILED_OUTPUTFILE=src/types/proto/MsgCompiled.js MSG_COMPILED_TYPES_OUTPUTFILE=src/types/proto/MsgCompiled.d.ts +# Ensure output directory exists +mkdir -p "$(dirname "$MSG_COMPILED_OUTPUTFILE")" + TMP_DIR=$(mktemp -d) +# Cleanup function +cleanup() { + if [ -d "$TMP_DIR" ]; then + tput setaf 2 + echo "Cleaning up $TMP_DIR" + tput sgr0 + rm -rf "$TMP_DIR" + fi +} +trap cleanup EXIT + +tput setaf 2 +echo "Checking out https://gitlab.com/mayachain/mayanode to $TMP_DIR" +tput sgr0 +if ! (cd "$TMP_DIR" && git clone --depth 1 --single-branch https://gitlab.com/mayachain/mayanode); then + echo "Error: Failed to clone mayanode repository" + exit 1 +fi + +# Verify proto files exist tput setaf 2 -echo "Checking out https://gitlab.com/mayachain/mayanode to $TMP_DIR" +echo "Checking proto files" tput sgr0 -(cd $TMP_DIR && git clone https://gitlab.com/mayachain/mayanode) +MISSING_FILES=0 +for proto_file in \ + "$TMP_DIR/mayanode/proto/mayachain/v1/common/common.proto" \ + "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_deposit.proto" \ + "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_send.proto"; do + if [ ! -f "$proto_file" ]; then + echo "Error: $(basename "$proto_file") missing" + MISSING_FILES=1 + else + echo "✓ $(basename "$proto_file") found" + fi +done -# Generate msgs +if [ $MISSING_FILES -eq 1 ]; then + echo "Error: Required proto files are missing" + exit 1 +fi + +# Download cosmos/base/v1beta1/coin.proto from cosmossdk if not exists +COSMOS_COIN_PROTO="$TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1/coin.proto" +if [ ! -f "$COSMOS_COIN_PROTO" ]; then + tput setaf 2 + echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" + tput sgr0 + mkdir -p "$TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1" + if ! curl -fSL --retry 3 --retry-delay 2 -o "$COSMOS_COIN_PROTO" \ + "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto"; then + echo "Error: Failed to download cosmos coin.proto" + exit 1 + fi + echo "✓ Downloaded cosmos coin.proto" +else + echo "✓ cosmos coin.proto already exists" +fi + +# Generate Protobuf JS bindings using sparse mode to only include referenced types tput setaf 2 -echo "Generating $MSG_COMPILED_OUTPUTFILE" +echo "Generating $MSG_COMPILED_OUTPUTFILE (using sparse mode to avoid bloat)" tput sgr0 -yarn run pbjs -w commonjs -t static-module $TMP_DIR/mayanode/proto/mayachain/v1/common/common.proto $TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_deposit.proto $TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_send.proto $TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1/coin.proto -o $MSG_COMPILED_OUTPUTFILE +if ! yarn pbjs -w commonjs -t static-module --sparse \ + -p "$TMP_DIR/mayanode/proto" \ + -p "$TMP_DIR/mayanode/third_party/proto" \ + "$TMP_DIR/mayanode/proto/mayachain/v1/common/common.proto" \ + "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_deposit.proto" \ + "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_send.proto" \ + -o "$MSG_COMPILED_OUTPUTFILE" 2>pbjs_errors.txt; then + echo "Error: Failed to generate JavaScript bindings" + cat pbjs_errors.txt + exit 1 +fi + # Fix import to be ESM-compatible (no omitted file extension) sed -i -E 's|"(protobufjs/minimal)"|"\1.js"|' "$MSG_COMPILED_OUTPUTFILE" +# Generate TypeScript definitions tput setaf 2 echo "Generating $MSG_COMPILED_TYPES_OUTPUTFILE" tput sgr0 -yarn run pbts $MSG_COMPILED_OUTPUTFILE -o $MSG_COMPILED_TYPES_OUTPUTFILE +if ! yarn pbts --name types "$MSG_COMPILED_OUTPUTFILE" -o "$MSG_COMPILED_TYPES_OUTPUTFILE" 2>pbts_errors.txt; then + echo "Error: Failed to generate TypeScript definitions" + cat pbts_errors.txt + exit 1 +fi + +# Verify generated files +if [ ! -f "$MSG_COMPILED_OUTPUTFILE" ] || [ ! -s "$MSG_COMPILED_OUTPUTFILE" ]; then + echo "Error: Generated JavaScript file is missing or empty" + exit 1 +fi + +if [ ! -f "$MSG_COMPILED_TYPES_OUTPUTFILE" ] || [ ! -s "$MSG_COMPILED_TYPES_OUTPUTFILE" ]; then + echo "Error: Generated TypeScript definitions file is missing or empty" + exit 1 +fi + +# Clean up error files if they're empty +[ ! -s pbjs_errors.txt ] && rm -f pbjs_errors.txt +[ ! -s pbts_errors.txt ] && rm -f pbts_errors.txt tput setaf 2 -echo "Removing $TMP_DIR/mayanode" +echo "✓ Successfully generated protobuf bindings" tput sgr0 -rm -rf $TMP_DIR diff --git a/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts b/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts index 9ee549297..abb227bbe 100644 --- a/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts +++ b/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts @@ -1,1219 +1,949 @@ import * as $protobuf from "protobufjs"; -/** Namespace common. */ -export namespace common { +export = types; - /** Properties of an Asset. */ - interface IAsset { +declare namespace types { - /** Asset chain */ - chain?: (string|null); - /** Asset symbol */ - symbol?: (string|null); + /** Namespace common. */ + namespace common { - /** Asset ticker */ - ticker?: (string|null); + /** Properties of an Asset. */ + interface IAsset { - /** Asset synth */ - synth?: (boolean|null); + /** Asset chain */ + chain?: (string|null); - /** Asset trade */ - trade?: (boolean|null); - } - - /** Represents an Asset. */ - class Asset implements IAsset { - - /** - * Constructs a new Asset. - * @param [properties] Properties to set - */ - constructor(properties?: common.IAsset); - - /** Asset chain. */ - public chain: string; - - /** Asset symbol. */ - public symbol: string; - - /** Asset ticker. */ - public ticker: string; - - /** Asset synth. */ - public synth: boolean; - - /** Asset trade. */ - public trade: boolean; - - /** - * Creates a new Asset instance using the specified properties. - * @param [properties] Properties to set - * @returns Asset instance - */ - public static create(properties?: common.IAsset): common.Asset; - - /** - * Encodes the specified Asset message. Does not implicitly {@link common.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link common.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Asset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Asset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Asset; - - /** - * Decodes an Asset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Asset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Asset; - - /** - * Verifies an Asset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Asset - */ - public static fromObject(object: { [k: string]: any }): common.Asset; - - /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Asset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Coin. */ - interface ICoin { - - /** Coin asset */ - asset?: (common.IAsset|null); - - /** Coin amount */ - amount?: (string|null); - - /** Coin decimals */ - decimals?: (number|Long|null); - } - - /** Represents a Coin. */ - class Coin implements ICoin { - - /** - * Constructs a new Coin. - * @param [properties] Properties to set - */ - constructor(properties?: common.ICoin); - - /** Coin asset. */ - public asset?: (common.IAsset|null); - - /** Coin amount. */ - public amount: string; - - /** Coin decimals. */ - public decimals: (number|Long); - - /** - * Creates a new Coin instance using the specified properties. - * @param [properties] Properties to set - * @returns Coin instance - */ - public static create(properties?: common.ICoin): common.Coin; - - /** - * Encodes the specified Coin message. Does not implicitly {@link common.Coin.verify|verify} messages. - * @param message Coin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Coin message, length delimited. Does not implicitly {@link common.Coin.verify|verify} messages. - * @param message Coin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Coin; - - /** - * Decodes a Coin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Coin; - - /** - * Verifies a Coin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Coin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Coin - */ - public static fromObject(object: { [k: string]: any }): common.Coin; - - /** - * Creates a plain object from a Coin message. Also converts values to other types if specified. - * @param message Coin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.Coin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Coin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PubKeySet. */ - interface IPubKeySet { + /** Asset symbol */ + symbol?: (string|null); - /** PubKeySet secp256k1 */ - secp256k1?: (string|null); + /** Asset ticker */ + ticker?: (string|null); - /** PubKeySet ed25519 */ - ed25519?: (string|null); - } - - /** Represents a PubKeySet. */ - class PubKeySet implements IPubKeySet { - - /** - * Constructs a new PubKeySet. - * @param [properties] Properties to set - */ - constructor(properties?: common.IPubKeySet); - - /** PubKeySet secp256k1. */ - public secp256k1: string; - - /** PubKeySet ed25519. */ - public ed25519: string; - - /** - * Creates a new PubKeySet instance using the specified properties. - * @param [properties] Properties to set - * @returns PubKeySet instance - */ - public static create(properties?: common.IPubKeySet): common.PubKeySet; - - /** - * Encodes the specified PubKeySet message. Does not implicitly {@link common.PubKeySet.verify|verify} messages. - * @param message PubKeySet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IPubKeySet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PubKeySet message, length delimited. Does not implicitly {@link common.PubKeySet.verify|verify} messages. - * @param message PubKeySet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IPubKeySet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PubKeySet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PubKeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.PubKeySet; - - /** - * Decodes a PubKeySet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PubKeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.PubKeySet; - - /** - * Verifies a PubKeySet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PubKeySet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PubKeySet - */ - public static fromObject(object: { [k: string]: any }): common.PubKeySet; - - /** - * Creates a plain object from a PubKeySet message. Also converts values to other types if specified. - * @param message PubKeySet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.PubKeySet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PubKeySet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Asset synth */ + synth?: (boolean|null); - /** Properties of a Tx. */ - interface ITx { + /** Asset trade */ + trade?: (boolean|null); + } - /** Tx id */ - id?: (string|null); + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: common.IAsset); + + /** Asset chain. */ + public chain: string; + + /** Asset symbol. */ + public symbol: string; + + /** Asset ticker. */ + public ticker: string; + + /** Asset synth. */ + public synth: boolean; + + /** Asset trade. */ + public trade: boolean; + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: common.IAsset): common.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link common.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link common.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Asset; + + /** + * Verifies an Asset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): common.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Tx chain */ - chain?: (string|null); + /** Properties of a Coin. */ + interface ICoin { - /** Tx fromAddress */ - fromAddress?: (string|null); + /** Coin asset */ + asset?: (common.IAsset|null); - /** Tx toAddress */ - toAddress?: (string|null); + /** Coin amount */ + amount?: (string|null); - /** Tx coins */ - coins?: (common.ICoin[]|null); + /** Coin decimals */ + decimals?: (number|Long|null); + } - /** Tx gas */ - gas?: (common.ICoin[]|null); + /** Represents a Coin. */ + class Coin implements ICoin { + + /** + * Constructs a new Coin. + * @param [properties] Properties to set + */ + constructor(properties?: common.ICoin); + + /** Coin asset. */ + public asset?: (common.IAsset|null); + + /** Coin amount. */ + public amount: string; + + /** Coin decimals. */ + public decimals: (number|Long); + + /** + * Creates a new Coin instance using the specified properties. + * @param [properties] Properties to set + * @returns Coin instance + */ + public static create(properties?: common.ICoin): common.Coin; + + /** + * Encodes the specified Coin message. Does not implicitly {@link common.Coin.verify|verify} messages. + * @param message Coin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Coin message, length delimited. Does not implicitly {@link common.Coin.verify|verify} messages. + * @param message Coin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Coin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Coin; + + /** + * Decodes a Coin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Coin; + + /** + * Verifies a Coin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Coin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Coin + */ + public static fromObject(object: { [k: string]: any }): common.Coin; + + /** + * Creates a plain object from a Coin message. Also converts values to other types if specified. + * @param message Coin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.Coin, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Coin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Tx memo */ - memo?: (string|null); - } + /** Properties of a PubKeySet. */ + interface IPubKeySet { - /** Represents a Tx. */ - class Tx implements ITx { - - /** - * Constructs a new Tx. - * @param [properties] Properties to set - */ - constructor(properties?: common.ITx); - - /** Tx id. */ - public id: string; - - /** Tx chain. */ - public chain: string; - - /** Tx fromAddress. */ - public fromAddress: string; - - /** Tx toAddress. */ - public toAddress: string; - - /** Tx coins. */ - public coins: common.ICoin[]; - - /** Tx gas. */ - public gas: common.ICoin[]; - - /** Tx memo. */ - public memo: string; - - /** - * Creates a new Tx instance using the specified properties. - * @param [properties] Properties to set - * @returns Tx instance - */ - public static create(properties?: common.ITx): common.Tx; - - /** - * Encodes the specified Tx message. Does not implicitly {@link common.Tx.verify|verify} messages. - * @param message Tx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.ITx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Tx message, length delimited. Does not implicitly {@link common.Tx.verify|verify} messages. - * @param message Tx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.ITx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Tx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Tx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Tx; - - /** - * Decodes a Tx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Tx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Tx; - - /** - * Verifies a Tx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Tx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Tx - */ - public static fromObject(object: { [k: string]: any }): common.Tx; - - /** - * Creates a plain object from a Tx message. Also converts values to other types if specified. - * @param message Tx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.Tx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Tx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** PubKeySet secp256k1 */ + secp256k1?: (string|null); - /** Properties of a Fee. */ - interface IFee { + /** PubKeySet ed25519 */ + ed25519?: (string|null); + } - /** Fee coins */ - coins?: (common.ICoin[]|null); + /** Represents a PubKeySet. */ + class PubKeySet implements IPubKeySet { + + /** + * Constructs a new PubKeySet. + * @param [properties] Properties to set + */ + constructor(properties?: common.IPubKeySet); + + /** PubKeySet secp256k1. */ + public secp256k1: string; + + /** PubKeySet ed25519. */ + public ed25519: string; + + /** + * Creates a new PubKeySet instance using the specified properties. + * @param [properties] Properties to set + * @returns PubKeySet instance + */ + public static create(properties?: common.IPubKeySet): common.PubKeySet; + + /** + * Encodes the specified PubKeySet message. Does not implicitly {@link common.PubKeySet.verify|verify} messages. + * @param message PubKeySet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IPubKeySet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubKeySet message, length delimited. Does not implicitly {@link common.PubKeySet.verify|verify} messages. + * @param message PubKeySet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IPubKeySet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubKeySet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubKeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.PubKeySet; + + /** + * Decodes a PubKeySet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubKeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.PubKeySet; + + /** + * Verifies a PubKeySet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PubKeySet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubKeySet + */ + public static fromObject(object: { [k: string]: any }): common.PubKeySet; + + /** + * Creates a plain object from a PubKeySet message. Also converts values to other types if specified. + * @param message PubKeySet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.PubKeySet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubKeySet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Fee poolDeduct */ - poolDeduct?: (string|null); - } + /** Properties of a Tx. */ + interface ITx { - /** Represents a Fee. */ - class Fee implements IFee { - - /** - * Constructs a new Fee. - * @param [properties] Properties to set - */ - constructor(properties?: common.IFee); - - /** Fee coins. */ - public coins: common.ICoin[]; - - /** Fee poolDeduct. */ - public poolDeduct: string; - - /** - * Creates a new Fee instance using the specified properties. - * @param [properties] Properties to set - * @returns Fee instance - */ - public static create(properties?: common.IFee): common.Fee; - - /** - * Encodes the specified Fee message. Does not implicitly {@link common.Fee.verify|verify} messages. - * @param message Fee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Fee message, length delimited. Does not implicitly {@link common.Fee.verify|verify} messages. - * @param message Fee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Fee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Fee; - - /** - * Decodes a Fee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Fee; - - /** - * Verifies a Fee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Fee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Fee - */ - public static fromObject(object: { [k: string]: any }): common.Fee; - - /** - * Creates a plain object from a Fee message. Also converts values to other types if specified. - * @param message Fee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.Fee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Fee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Tx id */ + id?: (string|null); - /** Properties of a ProtoUint. */ - interface IProtoUint { + /** Tx chain */ + chain?: (string|null); - /** ProtoUint value */ - value?: (string|null); - } + /** Tx fromAddress */ + fromAddress?: (string|null); - /** Represents a ProtoUint. */ - class ProtoUint implements IProtoUint { - - /** - * Constructs a new ProtoUint. - * @param [properties] Properties to set - */ - constructor(properties?: common.IProtoUint); - - /** ProtoUint value. */ - public value: string; - - /** - * Creates a new ProtoUint instance using the specified properties. - * @param [properties] Properties to set - * @returns ProtoUint instance - */ - public static create(properties?: common.IProtoUint): common.ProtoUint; - - /** - * Encodes the specified ProtoUint message. Does not implicitly {@link common.ProtoUint.verify|verify} messages. - * @param message ProtoUint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IProtoUint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProtoUint message, length delimited. Does not implicitly {@link common.ProtoUint.verify|verify} messages. - * @param message ProtoUint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IProtoUint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProtoUint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProtoUint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.ProtoUint; - - /** - * Decodes a ProtoUint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProtoUint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.ProtoUint; - - /** - * Verifies a ProtoUint message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProtoUint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProtoUint - */ - public static fromObject(object: { [k: string]: any }): common.ProtoUint; - - /** - * Creates a plain object from a ProtoUint message. Also converts values to other types if specified. - * @param message ProtoUint - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.ProtoUint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProtoUint to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } -} + /** Tx toAddress */ + toAddress?: (string|null); -/** Namespace types. */ -export namespace types { + /** Tx coins */ + coins?: (common.ICoin[]|null); - /** Properties of a MsgDeposit. */ - interface IMsgDeposit { + /** Tx gas */ + gas?: (common.ICoin[]|null); - /** MsgDeposit coins */ - coins?: (common.ICoin[]|null); + /** Tx memo */ + memo?: (string|null); + } - /** MsgDeposit memo */ - memo?: (string|null); + /** Represents a Tx. */ + class Tx implements ITx { + + /** + * Constructs a new Tx. + * @param [properties] Properties to set + */ + constructor(properties?: common.ITx); + + /** Tx id. */ + public id: string; + + /** Tx chain. */ + public chain: string; + + /** Tx fromAddress. */ + public fromAddress: string; + + /** Tx toAddress. */ + public toAddress: string; + + /** Tx coins. */ + public coins: common.ICoin[]; + + /** Tx gas. */ + public gas: common.ICoin[]; + + /** Tx memo. */ + public memo: string; + + /** + * Creates a new Tx instance using the specified properties. + * @param [properties] Properties to set + * @returns Tx instance + */ + public static create(properties?: common.ITx): common.Tx; + + /** + * Encodes the specified Tx message. Does not implicitly {@link common.Tx.verify|verify} messages. + * @param message Tx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.ITx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tx message, length delimited. Does not implicitly {@link common.Tx.verify|verify} messages. + * @param message Tx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.ITx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tx message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Tx; + + /** + * Decodes a Tx message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Tx; + + /** + * Verifies a Tx message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tx message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tx + */ + public static fromObject(object: { [k: string]: any }): common.Tx; + + /** + * Creates a plain object from a Tx message. Also converts values to other types if specified. + * @param message Tx + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.Tx, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tx to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** MsgDeposit signer */ - signer?: (Uint8Array|null); - } + /** Properties of a Fee. */ + interface IFee { - /** Represents a MsgDeposit. */ - class MsgDeposit implements IMsgDeposit { - - /** - * Constructs a new MsgDeposit. - * @param [properties] Properties to set - */ - constructor(properties?: types.IMsgDeposit); - - /** MsgDeposit coins. */ - public coins: common.ICoin[]; - - /** MsgDeposit memo. */ - public memo: string; - - /** MsgDeposit signer. */ - public signer: Uint8Array; - - /** - * Creates a new MsgDeposit instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgDeposit instance - */ - public static create(properties?: types.IMsgDeposit): types.MsgDeposit; - - /** - * Encodes the specified MsgDeposit message. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. - * @param message MsgDeposit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: types.IMsgDeposit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. - * @param message MsgDeposit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: types.IMsgDeposit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgDeposit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgDeposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): types.MsgDeposit; - - /** - * Decodes a MsgDeposit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgDeposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): types.MsgDeposit; - - /** - * Verifies a MsgDeposit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgDeposit - */ - public static fromObject(object: { [k: string]: any }): types.MsgDeposit; - - /** - * Creates a plain object from a MsgDeposit message. Also converts values to other types if specified. - * @param message MsgDeposit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: types.MsgDeposit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgDeposit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Fee coins */ + coins?: (common.ICoin[]|null); - /** Properties of a MsgSend. */ - interface IMsgSend { + /** Fee poolDeduct */ + poolDeduct?: (string|null); + } - /** MsgSend fromAddress */ - fromAddress?: (Uint8Array|null); + /** Represents a Fee. */ + class Fee implements IFee { + + /** + * Constructs a new Fee. + * @param [properties] Properties to set + */ + constructor(properties?: common.IFee); + + /** Fee coins. */ + public coins: common.ICoin[]; + + /** Fee poolDeduct. */ + public poolDeduct: string; + + /** + * Creates a new Fee instance using the specified properties. + * @param [properties] Properties to set + * @returns Fee instance + */ + public static create(properties?: common.IFee): common.Fee; + + /** + * Encodes the specified Fee message. Does not implicitly {@link common.Fee.verify|verify} messages. + * @param message Fee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IFee, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Fee message, length delimited. Does not implicitly {@link common.Fee.verify|verify} messages. + * @param message Fee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IFee, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fee message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Fee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Fee; + + /** + * Decodes a Fee message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Fee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Fee; + + /** + * Verifies a Fee message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Fee message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Fee + */ + public static fromObject(object: { [k: string]: any }): common.Fee; + + /** + * Creates a plain object from a Fee message. Also converts values to other types if specified. + * @param message Fee + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.Fee, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Fee to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** MsgSend toAddress */ - toAddress?: (Uint8Array|null); + /** Properties of a ProtoUint. */ + interface IProtoUint { - /** MsgSend amount */ - amount?: (cosmos.base.v1beta1.ICoin[]|null); - } + /** ProtoUint value */ + value?: (string|null); + } - /** Represents a MsgSend. */ - class MsgSend implements IMsgSend { - - /** - * Constructs a new MsgSend. - * @param [properties] Properties to set - */ - constructor(properties?: types.IMsgSend); - - /** MsgSend fromAddress. */ - public fromAddress: Uint8Array; - - /** MsgSend toAddress. */ - public toAddress: Uint8Array; - - /** MsgSend amount. */ - public amount: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new MsgSend instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgSend instance - */ - public static create(properties?: types.IMsgSend): types.MsgSend; - - /** - * Encodes the specified MsgSend message. Does not implicitly {@link types.MsgSend.verify|verify} messages. - * @param message MsgSend message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: types.IMsgSend, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgSend message, length delimited. Does not implicitly {@link types.MsgSend.verify|verify} messages. - * @param message MsgSend message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: types.IMsgSend, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSend message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgSend - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): types.MsgSend; - - /** - * Decodes a MsgSend message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgSend - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): types.MsgSend; - - /** - * Verifies a MsgSend message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgSend message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgSend - */ - public static fromObject(object: { [k: string]: any }): types.MsgSend; - - /** - * Creates a plain object from a MsgSend message. Also converts values to other types if specified. - * @param message MsgSend - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: types.MsgSend, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgSend to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Represents a ProtoUint. */ + class ProtoUint implements IProtoUint { + + /** + * Constructs a new ProtoUint. + * @param [properties] Properties to set + */ + constructor(properties?: common.IProtoUint); + + /** ProtoUint value. */ + public value: string; + + /** + * Creates a new ProtoUint instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoUint instance + */ + public static create(properties?: common.IProtoUint): common.ProtoUint; + + /** + * Encodes the specified ProtoUint message. Does not implicitly {@link common.ProtoUint.verify|verify} messages. + * @param message ProtoUint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IProtoUint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoUint message, length delimited. Does not implicitly {@link common.ProtoUint.verify|verify} messages. + * @param message ProtoUint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IProtoUint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoUint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoUint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.ProtoUint; + + /** + * Decodes a ProtoUint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoUint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.ProtoUint; + + /** + * Verifies a ProtoUint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoUint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoUint + */ + public static fromObject(object: { [k: string]: any }): common.ProtoUint; + + /** + * Creates a plain object from a ProtoUint message. Also converts values to other types if specified. + * @param message ProtoUint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.ProtoUint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoUint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } -} - -/** Namespace cosmos. */ -export namespace cosmos { - /** Namespace base. */ - namespace base { + /** Namespace types. */ + namespace types { - /** Namespace v1beta1. */ - namespace v1beta1 { + /** Properties of a MsgDeposit. */ + interface IMsgDeposit { - /** Properties of a Coin. */ - interface ICoin { + /** MsgDeposit coins */ + coins?: (common.ICoin[]|null); - /** Coin denom */ - denom?: (string|null); + /** MsgDeposit memo */ + memo?: (string|null); - /** Coin amount */ - amount?: (string|null); - } - - /** Represents a Coin. */ - class Coin implements ICoin { - - /** - * Constructs a new Coin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.ICoin); - - /** Coin denom. */ - public denom: string; - - /** Coin amount. */ - public amount: string; - - /** - * Creates a new Coin instance using the specified properties. - * @param [properties] Properties to set - * @returns Coin instance - */ - public static create(properties?: cosmos.base.v1beta1.ICoin): cosmos.base.v1beta1.Coin; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @param message Coin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @param message Coin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.Coin; - - /** - * Decodes a Coin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.Coin; - - /** - * Verifies a Coin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Coin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Coin - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.Coin; - - /** - * Creates a plain object from a Coin message. Also converts values to other types if specified. - * @param message Coin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.Coin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Coin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DecCoin. */ - interface IDecCoin { - - /** DecCoin denom */ - denom?: (string|null); + /** MsgDeposit signer */ + signer?: (Uint8Array|null); + } - /** DecCoin amount */ - amount?: (string|null); - } + /** Represents a MsgDeposit. */ + class MsgDeposit implements IMsgDeposit { + + /** + * Constructs a new MsgDeposit. + * @param [properties] Properties to set + */ + constructor(properties?: types.IMsgDeposit); + + /** MsgDeposit coins. */ + public coins: common.ICoin[]; + + /** MsgDeposit memo. */ + public memo: string; + + /** MsgDeposit signer. */ + public signer: Uint8Array; + + /** + * Creates a new MsgDeposit instance using the specified properties. + * @param [properties] Properties to set + * @returns MsgDeposit instance + */ + public static create(properties?: types.IMsgDeposit): types.MsgDeposit; + + /** + * Encodes the specified MsgDeposit message. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. + * @param message MsgDeposit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: types.IMsgDeposit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. + * @param message MsgDeposit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: types.IMsgDeposit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MsgDeposit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MsgDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): types.MsgDeposit; + + /** + * Decodes a MsgDeposit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MsgDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): types.MsgDeposit; + + /** + * Verifies a MsgDeposit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MsgDeposit + */ + public static fromObject(object: { [k: string]: any }): types.MsgDeposit; + + /** + * Creates a plain object from a MsgDeposit message. Also converts values to other types if specified. + * @param message MsgDeposit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: types.MsgDeposit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MsgDeposit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a DecCoin. */ - class DecCoin implements IDecCoin { - - /** - * Constructs a new DecCoin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IDecCoin); - - /** DecCoin denom. */ - public denom: string; - - /** DecCoin amount. */ - public amount: string; - - /** - * Creates a new DecCoin instance using the specified properties. - * @param [properties] Properties to set - * @returns DecCoin instance - */ - public static create(properties?: cosmos.base.v1beta1.IDecCoin): cosmos.base.v1beta1.DecCoin; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param message DecCoin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IDecCoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param message DecCoin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IDecCoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.DecCoin; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.DecCoin; - - /** - * Verifies a DecCoin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecCoin - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.DecCoin; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @param message DecCoin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.DecCoin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DecCoin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a MsgSend. */ + interface IMsgSend { - /** Properties of an IntProto. */ - interface IIntProto { + /** MsgSend fromAddress */ + fromAddress?: (Uint8Array|null); - /** IntProto int */ - int?: (string|null); - } + /** MsgSend toAddress */ + toAddress?: (Uint8Array|null); - /** Represents an IntProto. */ - class IntProto implements IIntProto { - - /** - * Constructs a new IntProto. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IIntProto); - - /** IntProto int. */ - public int: string; - - /** - * Creates a new IntProto instance using the specified properties. - * @param [properties] Properties to set - * @returns IntProto instance - */ - public static create(properties?: cosmos.base.v1beta1.IIntProto): cosmos.base.v1beta1.IntProto; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param message IntProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IIntProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param message IntProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IIntProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.IntProto; - - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.IntProto; - - /** - * Verifies an IntProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntProto - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.IntProto; - - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @param message IntProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.IntProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IntProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DecProto. */ - interface IDecProto { + /** MsgSend amount */ + amount?: (cosmos.base.v1beta1.ICoin[]|null); + } - /** DecProto dec */ - dec?: (string|null); - } + /** Represents a MsgSend. */ + class MsgSend implements IMsgSend { + + /** + * Constructs a new MsgSend. + * @param [properties] Properties to set + */ + constructor(properties?: types.IMsgSend); + + /** MsgSend fromAddress. */ + public fromAddress: Uint8Array; + + /** MsgSend toAddress. */ + public toAddress: Uint8Array; + + /** MsgSend amount. */ + public amount: cosmos.base.v1beta1.ICoin[]; + + /** + * Creates a new MsgSend instance using the specified properties. + * @param [properties] Properties to set + * @returns MsgSend instance + */ + public static create(properties?: types.IMsgSend): types.MsgSend; + + /** + * Encodes the specified MsgSend message. Does not implicitly {@link types.MsgSend.verify|verify} messages. + * @param message MsgSend message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: types.IMsgSend, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MsgSend message, length delimited. Does not implicitly {@link types.MsgSend.verify|verify} messages. + * @param message MsgSend message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: types.IMsgSend, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MsgSend message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MsgSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): types.MsgSend; + + /** + * Decodes a MsgSend message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MsgSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): types.MsgSend; + + /** + * Verifies a MsgSend message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MsgSend message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MsgSend + */ + public static fromObject(object: { [k: string]: any }): types.MsgSend; + + /** + * Creates a plain object from a MsgSend message. Also converts values to other types if specified. + * @param message MsgSend + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: types.MsgSend, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MsgSend to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** Represents a DecProto. */ - class DecProto implements IDecProto { - - /** - * Constructs a new DecProto. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IDecProto); - - /** DecProto dec. */ - public dec: string; - - /** - * Creates a new DecProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DecProto instance - */ - public static create(properties?: cosmos.base.v1beta1.IDecProto): cosmos.base.v1beta1.DecProto; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param message DecProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IDecProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param message DecProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IDecProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.DecProto; - - /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.DecProto; - - /** - * Verifies a DecProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecProto - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.DecProto; - - /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. - * @param message DecProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.DecProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DecProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Namespace cosmos. */ + namespace cosmos { + + /** Namespace base. */ + namespace base { + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Properties of a Coin. */ + interface ICoin { + + /** Coin denom */ + denom?: (string|null); + + /** Coin amount */ + amount?: (string|null); + } + + /** Represents a Coin. */ + class Coin implements ICoin { + + /** + * Constructs a new Coin. + * @param [properties] Properties to set + */ + constructor(properties?: cosmos.base.v1beta1.ICoin); + + /** Coin denom. */ + public denom: string; + + /** Coin amount. */ + public amount: string; + + /** + * Creates a new Coin instance using the specified properties. + * @param [properties] Properties to set + * @returns Coin instance + */ + public static create(properties?: cosmos.base.v1beta1.ICoin): cosmos.base.v1beta1.Coin; + + /** + * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @param message Coin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: cosmos.base.v1beta1.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @param message Coin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: cosmos.base.v1beta1.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Coin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.Coin; + + /** + * Decodes a Coin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.Coin; + + /** + * Verifies a Coin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Coin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Coin + */ + public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.Coin; + + /** + * Creates a plain object from a Coin message. Also converts values to other types if specified. + * @param message Coin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: cosmos.base.v1beta1.Coin, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Coin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } } } diff --git a/packages/xchain-mayachain/src/types/proto/MsgCompiled.js b/packages/xchain-mayachain/src/types/proto/MsgCompiled.js index 24b3c6194..93f8c418a 100644 --- a/packages/xchain-mayachain/src/types/proto/MsgCompiled.js +++ b/packages/xchain-mayachain/src/types/proto/MsgCompiled.js @@ -2324,590 +2324,6 @@ $root.cosmos = (function() { return Coin; })(); - v1beta1.DecCoin = (function() { - - /** - * Properties of a DecCoin. - * @memberof cosmos.base.v1beta1 - * @interface IDecCoin - * @property {string|null} [denom] DecCoin denom - * @property {string|null} [amount] DecCoin amount - */ - - /** - * Constructs a new DecCoin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecCoin. - * @implements IDecCoin - * @constructor - * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set - */ - function DecCoin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DecCoin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.denom = ""; - - /** - * DecCoin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.amount = ""; - - /** - * Creates a new DecCoin instance using the specified properties. - * @function create - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin instance - */ - DecCoin.create = function create(properties) { - return new DecCoin(properties); - }; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecCoin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecCoin message. - * @function verify - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecCoin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - */ - DecCoin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecCoin) - return object; - var message = new $root.cosmos.base.v1beta1.DecCoin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.DecCoin} message DecCoin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecCoin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this DecCoin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - * @returns {Object.} JSON object - */ - DecCoin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecCoin; - })(); - - v1beta1.IntProto = (function() { - - /** - * Properties of an IntProto. - * @memberof cosmos.base.v1beta1 - * @interface IIntProto - * @property {string|null} [int] IntProto int - */ - - /** - * Constructs a new IntProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents an IntProto. - * @implements IIntProto - * @constructor - * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set - */ - function IntProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IntProto int. - * @member {string} int - * @memberof cosmos.base.v1beta1.IntProto - * @instance - */ - IntProto.prototype.int = ""; - - /** - * Creates a new IntProto instance using the specified properties. - * @function create - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set - * @returns {cosmos.base.v1beta1.IntProto} IntProto instance - */ - IntProto.create = function create(properties) { - return new IntProto(properties); - }; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.int != null && Object.hasOwnProperty.call(message, "int")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.int); - return writer; - }; - - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.IntProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.int = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IntProto message. - * @function verify - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.int != null && message.hasOwnProperty("int")) - if (!$util.isString(message.int)) - return "int: string expected"; - return null; - }; - - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.IntProto} IntProto - */ - IntProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.IntProto) - return object; - var message = new $root.cosmos.base.v1beta1.IntProto(); - if (object.int != null) - message.int = String(object.int); - return message; - }; - - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IntProto} message IntProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.int = ""; - if (message.int != null && message.hasOwnProperty("int")) - object.int = message.int; - return object; - }; - - /** - * Converts this IntProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.IntProto - * @instance - * @returns {Object.} JSON object - */ - IntProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IntProto; - })(); - - v1beta1.DecProto = (function() { - - /** - * Properties of a DecProto. - * @memberof cosmos.base.v1beta1 - * @interface IDecProto - * @property {string|null} [dec] DecProto dec - */ - - /** - * Constructs a new DecProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecProto. - * @implements IDecProto - * @constructor - * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set - */ - function DecProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DecProto dec. - * @member {string} dec - * @memberof cosmos.base.v1beta1.DecProto - * @instance - */ - DecProto.prototype.dec = ""; - - /** - * Creates a new DecProto instance using the specified properties. - * @function create - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set - * @returns {cosmos.base.v1beta1.DecProto} DecProto instance - */ - DecProto.create = function create(properties) { - return new DecProto(properties); - }; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dec != null && Object.hasOwnProperty.call(message, "dec")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dec); - return writer; - }; - - /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecProto} DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dec = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecProto} DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecProto message. - * @function verify - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dec != null && message.hasOwnProperty("dec")) - if (!$util.isString(message.dec)) - return "dec: string expected"; - return null; - }; - - /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecProto} DecProto - */ - DecProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecProto) - return object; - var message = new $root.cosmos.base.v1beta1.DecProto(); - if (object.dec != null) - message.dec = String(object.dec); - return message; - }; - - /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.DecProto} message DecProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.dec = ""; - if (message.dec != null && message.hasOwnProperty("dec")) - object.dec = message.dec; - return object; - }; - - /** - * Converts this DecProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecProto - * @instance - * @returns {Object.} JSON object - */ - DecProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecProto; - })(); - return v1beta1; })(); diff --git a/packages/xchain-thorchain/genMsgs.sh b/packages/xchain-thorchain/genMsgs.sh index 316a09bab..012f8a316 100755 --- a/packages/xchain-thorchain/genMsgs.sh +++ b/packages/xchain-thorchain/genMsgs.sh @@ -1,45 +1,108 @@ #!/bin/bash # This script updates THORChain Protobuf bindings for MsgDeposit and MsgSend +set -euo pipefail # Exit on error, undefined variables, and pipe failures + +# Check for required tools +for tool in yarn git curl sed; do + if ! command -v "$tool" &>/dev/null; then + echo "Error: Required tool '$tool' is not installed" + exit 1 + fi +done MSG_COMPILED_OUTPUTFILE=src/types/proto/MsgCompiled.js MSG_COMPILED_TYPES_OUTPUTFILE=src/types/proto/MsgCompiled.d.ts +# Ensure output directory exists +mkdir -p "$(dirname "$MSG_COMPILED_OUTPUTFILE")" + TMP_DIR=$(mktemp -d) +# Cleanup function +cleanup() { + if [ -d "$TMP_DIR" ]; then + tput setaf 2 + echo "Cleaning up $TMP_DIR" + tput sgr0 + rm -rf "$TMP_DIR" + fi +} +trap cleanup EXIT + tput setaf 2 echo "Checking out https://gitlab.com/thorchain/thornode to $TMP_DIR" tput sgr0 -(cd "$TMP_DIR" && git clone --branch develop https://gitlab.com/thorchain/thornode) +if ! (cd "$TMP_DIR" && git clone --depth 1 --single-branch --branch develop https://gitlab.com/thorchain/thornode); then + echo "Error: Failed to clone thornode repository" + exit 1 +fi # Verify proto files exist tput setaf 2 echo "Checking proto files" tput sgr0 -ls "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto" || echo "common.proto missing" -ls "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_deposit.proto" || echo "msg_deposit.proto missing" -ls "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_send.proto" || echo "msg_send.proto missing" +MISSING_FILES=0 +for proto_file in \ + "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_deposit.proto" \ + "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_send.proto"; do + if [ ! -f "$proto_file" ]; then + echo "Error: $(basename "$proto_file") missing" + MISSING_FILES=1 + else + echo "✓ $(basename "$proto_file") found" + fi +done + +if [ $MISSING_FILES -eq 1 ]; then + echo "Error: Required proto files are missing" + exit 1 +fi -# Download cosmos/base/v1beta1/coin.proto from cosmossdk +# Copy minimal common.proto to temp directory tput setaf 2 -echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" +echo "Using minimal common.proto to avoid bloat" tput sgr0 -mkdir -p "$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1" -curl -o "$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1/coin.proto" \ - "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +mkdir -p "$TMP_DIR/thornode/proto/thorchain/v1/common" +if ! cp "$SCRIPT_DIR/proto/common/common_minimal.proto" "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto"; then + echo "Error: Failed to copy minimal common.proto" + exit 1 +fi +echo "✓ Using minimal common.proto" -# Generate Protobuf JS bindings with include path +# Download cosmos/base/v1beta1/coin.proto from cosmossdk if not exists +COSMOS_COIN_PROTO="$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1/coin.proto" +if [ ! -f "$COSMOS_COIN_PROTO" ]; then + tput setaf 2 + echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" + tput sgr0 + mkdir -p "$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1" + if ! curl -fSL --retry 3 --retry-delay 2 -o "$COSMOS_COIN_PROTO" \ + "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto"; then + echo "Error: Failed to download cosmos coin.proto" + exit 1 + fi + echo "✓ Downloaded cosmos coin.proto" +else + echo "✓ cosmos coin.proto already exists" +fi + +# Generate Protobuf JS bindings using sparse mode to only include referenced types tput setaf 2 -echo "Generating $MSG_COMPILED_OUTPUTFILE" +echo "Generating $MSG_COMPILED_OUTPUTFILE (using sparse mode to avoid bloat)" tput sgr0 -yarn pbjs -w commonjs -t static-module \ +if ! yarn pbjs -w commonjs -t static-module --sparse \ -p "$TMP_DIR/thornode/proto" \ -p "$TMP_DIR/thornode/third_party/proto" \ "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto" \ "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_deposit.proto" \ "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_send.proto" \ - "$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1/coin.proto" \ - -o "$MSG_COMPILED_OUTPUTFILE" 2>pbjs_errors.txt + -o "$MSG_COMPILED_OUTPUTFILE" 2>pbjs_errors.txt; then + echo "Error: Failed to generate JavaScript bindings" + cat pbjs_errors.txt + exit 1 +fi # Fix import to be ESM-compatible (no omitted file extension) sed -i -E 's|"(protobufjs/minimal)"|"\1.js"|' "$MSG_COMPILED_OUTPUTFILE" @@ -48,9 +111,27 @@ sed -i -E 's|"(protobufjs/minimal)"|"\1.js"|' "$MSG_COMPILED_OUTPUTFILE" tput setaf 2 echo "Generating $MSG_COMPILED_TYPES_OUTPUTFILE" tput sgr0 -yarn pbts --name types "$MSG_COMPILED_OUTPUTFILE" -o "$MSG_COMPILED_TYPES_OUTPUTFILE" 2>pbts_errors.txt +if ! yarn pbts --name types "$MSG_COMPILED_OUTPUTFILE" -o "$MSG_COMPILED_TYPES_OUTPUTFILE" 2>pbts_errors.txt; then + echo "Error: Failed to generate TypeScript definitions" + cat pbts_errors.txt + exit 1 +fi + +# Verify generated files +if [ ! -f "$MSG_COMPILED_OUTPUTFILE" ] || [ ! -s "$MSG_COMPILED_OUTPUTFILE" ]; then + echo "Error: Generated JavaScript file is missing or empty" + exit 1 +fi + +if [ ! -f "$MSG_COMPILED_TYPES_OUTPUTFILE" ] || [ ! -s "$MSG_COMPILED_TYPES_OUTPUTFILE" ]; then + echo "Error: Generated TypeScript definitions file is missing or empty" + exit 1 +fi + +# Clean up error files if they're empty +[ ! -s pbjs_errors.txt ] && rm -f pbjs_errors.txt +[ ! -s pbts_errors.txt ] && rm -f pbts_errors.txt tput setaf 2 -echo "Removing $TMP_DIR/thornode" +echo "✓ Successfully generated protobuf bindings" tput sgr0 -rm -rf "$TMP_DIR" diff --git a/packages/xchain-thorchain/proto/common/common_minimal.proto b/packages/xchain-thorchain/proto/common/common_minimal.proto new file mode 100644 index 000000000..df2db7be7 --- /dev/null +++ b/packages/xchain-thorchain/proto/common/common_minimal.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package common; + +option go_package = "gitlab.com/thorchain/thornode/v3/common"; + +// Minimal common.proto with only types needed by MsgDeposit +message Asset { + string chain = 1; + string symbol = 2; + string ticker = 3; + bool synth = 4; + bool trade = 5; + bool secured = 6; +} + +message Coin { + Asset asset = 1; + string amount = 2; + int64 decimals = 3; +} \ No newline at end of file diff --git a/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts b/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts index 32353b79a..fb46ab031 100644 --- a/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts +++ b/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts @@ -228,414 +228,6 @@ declare namespace types { */ public toJSON(): { [k: string]: any }; } - - /** Properties of a PubKeySet. */ - interface IPubKeySet { - - /** PubKeySet secp256k1 */ - secp256k1?: (string|null); - - /** PubKeySet ed25519 */ - ed25519?: (string|null); - } - - /** Represents a PubKeySet. */ - class PubKeySet implements IPubKeySet { - - /** - * Constructs a new PubKeySet. - * @param [properties] Properties to set - */ - constructor(properties?: common.IPubKeySet); - - /** PubKeySet secp256k1. */ - public secp256k1: string; - - /** PubKeySet ed25519. */ - public ed25519: string; - - /** - * Creates a new PubKeySet instance using the specified properties. - * @param [properties] Properties to set - * @returns PubKeySet instance - */ - public static create(properties?: common.IPubKeySet): common.PubKeySet; - - /** - * Encodes the specified PubKeySet message. Does not implicitly {@link common.PubKeySet.verify|verify} messages. - * @param message PubKeySet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IPubKeySet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PubKeySet message, length delimited. Does not implicitly {@link common.PubKeySet.verify|verify} messages. - * @param message PubKeySet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IPubKeySet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PubKeySet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PubKeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.PubKeySet; - - /** - * Decodes a PubKeySet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PubKeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.PubKeySet; - - /** - * Verifies a PubKeySet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PubKeySet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PubKeySet - */ - public static fromObject(object: { [k: string]: any }): common.PubKeySet; - - /** - * Creates a plain object from a PubKeySet message. Also converts values to other types if specified. - * @param message PubKeySet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.PubKeySet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PubKeySet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Tx. */ - interface ITx { - - /** Tx id */ - id?: (string|null); - - /** Tx chain */ - chain?: (string|null); - - /** Tx fromAddress */ - fromAddress?: (string|null); - - /** Tx toAddress */ - toAddress?: (string|null); - - /** Tx coins */ - coins?: (common.ICoin[]|null); - - /** Tx gas */ - gas?: (common.ICoin[]|null); - - /** Tx memo */ - memo?: (string|null); - } - - /** Represents a Tx. */ - class Tx implements ITx { - - /** - * Constructs a new Tx. - * @param [properties] Properties to set - */ - constructor(properties?: common.ITx); - - /** Tx id. */ - public id: string; - - /** Tx chain. */ - public chain: string; - - /** Tx fromAddress. */ - public fromAddress: string; - - /** Tx toAddress. */ - public toAddress: string; - - /** Tx coins. */ - public coins: common.ICoin[]; - - /** Tx gas. */ - public gas: common.ICoin[]; - - /** Tx memo. */ - public memo: string; - - /** - * Creates a new Tx instance using the specified properties. - * @param [properties] Properties to set - * @returns Tx instance - */ - public static create(properties?: common.ITx): common.Tx; - - /** - * Encodes the specified Tx message. Does not implicitly {@link common.Tx.verify|verify} messages. - * @param message Tx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.ITx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Tx message, length delimited. Does not implicitly {@link common.Tx.verify|verify} messages. - * @param message Tx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.ITx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Tx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Tx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Tx; - - /** - * Decodes a Tx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Tx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Tx; - - /** - * Verifies a Tx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Tx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Tx - */ - public static fromObject(object: { [k: string]: any }): common.Tx; - - /** - * Creates a plain object from a Tx message. Also converts values to other types if specified. - * @param message Tx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.Tx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Tx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Fee. */ - interface IFee { - - /** Fee coins */ - coins?: (common.ICoin[]|null); - - /** Fee poolDeduct */ - poolDeduct?: (string|null); - } - - /** Represents a Fee. */ - class Fee implements IFee { - - /** - * Constructs a new Fee. - * @param [properties] Properties to set - */ - constructor(properties?: common.IFee); - - /** Fee coins. */ - public coins: common.ICoin[]; - - /** Fee poolDeduct. */ - public poolDeduct: string; - - /** - * Creates a new Fee instance using the specified properties. - * @param [properties] Properties to set - * @returns Fee instance - */ - public static create(properties?: common.IFee): common.Fee; - - /** - * Encodes the specified Fee message. Does not implicitly {@link common.Fee.verify|verify} messages. - * @param message Fee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Fee message, length delimited. Does not implicitly {@link common.Fee.verify|verify} messages. - * @param message Fee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Fee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Fee; - - /** - * Decodes a Fee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Fee; - - /** - * Verifies a Fee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Fee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Fee - */ - public static fromObject(object: { [k: string]: any }): common.Fee; - - /** - * Creates a plain object from a Fee message. Also converts values to other types if specified. - * @param message Fee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.Fee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Fee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ProtoUint. */ - interface IProtoUint { - - /** ProtoUint value */ - value?: (string|null); - } - - /** Represents a ProtoUint. */ - class ProtoUint implements IProtoUint { - - /** - * Constructs a new ProtoUint. - * @param [properties] Properties to set - */ - constructor(properties?: common.IProtoUint); - - /** ProtoUint value. */ - public value: string; - - /** - * Creates a new ProtoUint instance using the specified properties. - * @param [properties] Properties to set - * @returns ProtoUint instance - */ - public static create(properties?: common.IProtoUint): common.ProtoUint; - - /** - * Encodes the specified ProtoUint message. Does not implicitly {@link common.ProtoUint.verify|verify} messages. - * @param message ProtoUint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IProtoUint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProtoUint message, length delimited. Does not implicitly {@link common.ProtoUint.verify|verify} messages. - * @param message ProtoUint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IProtoUint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProtoUint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProtoUint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.ProtoUint; - - /** - * Decodes a ProtoUint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProtoUint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.ProtoUint; - - /** - * Verifies a ProtoUint message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProtoUint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProtoUint - */ - public static fromObject(object: { [k: string]: any }): common.ProtoUint; - - /** - * Creates a plain object from a ProtoUint message. Also converts values to other types if specified. - * @param message ProtoUint - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.ProtoUint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProtoUint to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } } /** Namespace types. */ @@ -950,282 +542,6 @@ declare namespace types { */ public toJSON(): { [k: string]: any }; } - - /** Properties of a DecCoin. */ - interface IDecCoin { - - /** DecCoin denom */ - denom?: (string|null); - - /** DecCoin amount */ - amount?: (string|null); - } - - /** Represents a DecCoin. */ - class DecCoin implements IDecCoin { - - /** - * Constructs a new DecCoin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IDecCoin); - - /** DecCoin denom. */ - public denom: string; - - /** DecCoin amount. */ - public amount: string; - - /** - * Creates a new DecCoin instance using the specified properties. - * @param [properties] Properties to set - * @returns DecCoin instance - */ - public static create(properties?: cosmos.base.v1beta1.IDecCoin): cosmos.base.v1beta1.DecCoin; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param message DecCoin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IDecCoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param message DecCoin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IDecCoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.DecCoin; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.DecCoin; - - /** - * Verifies a DecCoin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecCoin - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.DecCoin; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @param message DecCoin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.DecCoin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DecCoin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an IntProto. */ - interface IIntProto { - - /** IntProto int */ - int?: (string|null); - } - - /** Represents an IntProto. */ - class IntProto implements IIntProto { - - /** - * Constructs a new IntProto. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IIntProto); - - /** IntProto int. */ - public int: string; - - /** - * Creates a new IntProto instance using the specified properties. - * @param [properties] Properties to set - * @returns IntProto instance - */ - public static create(properties?: cosmos.base.v1beta1.IIntProto): cosmos.base.v1beta1.IntProto; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param message IntProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IIntProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param message IntProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IIntProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.IntProto; - - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.IntProto; - - /** - * Verifies an IntProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntProto - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.IntProto; - - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @param message IntProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.IntProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IntProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DecProto. */ - interface IDecProto { - - /** DecProto dec */ - dec?: (string|null); - } - - /** Represents a DecProto. */ - class DecProto implements IDecProto { - - /** - * Constructs a new DecProto. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IDecProto); - - /** DecProto dec. */ - public dec: string; - - /** - * Creates a new DecProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DecProto instance - */ - public static create(properties?: cosmos.base.v1beta1.IDecProto): cosmos.base.v1beta1.DecProto; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param message DecProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IDecProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param message DecProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IDecProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.DecProto; - - /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.DecProto; - - /** - * Verifies a DecProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecProto - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.DecProto; - - /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. - * @param message DecProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.DecProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DecProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } } } } diff --git a/packages/xchain-thorchain/src/types/proto/MsgCompiled.js b/packages/xchain-thorchain/src/types/proto/MsgCompiled.js index 403f2edd3..fe4face6f 100644 --- a/packages/xchain-thorchain/src/types/proto/MsgCompiled.js +++ b/packages/xchain-thorchain/src/types/proto/MsgCompiled.js @@ -567,25 +567,39 @@ $root.common = (function() { return Coin; })(); - common.PubKeySet = (function() { + return common; +})(); + +$root.types = (function() { + + /** + * Namespace types. + * @exports types + * @namespace + */ + var types = {}; + + types.MsgDeposit = (function() { /** - * Properties of a PubKeySet. - * @memberof common - * @interface IPubKeySet - * @property {string|null} [secp256k1] PubKeySet secp256k1 - * @property {string|null} [ed25519] PubKeySet ed25519 + * Properties of a MsgDeposit. + * @memberof types + * @interface IMsgDeposit + * @property {Array.|null} [coins] MsgDeposit coins + * @property {string|null} [memo] MsgDeposit memo + * @property {Uint8Array|null} [signer] MsgDeposit signer */ /** - * Constructs a new PubKeySet. - * @memberof common - * @classdesc Represents a PubKeySet. - * @implements IPubKeySet + * Constructs a new MsgDeposit. + * @memberof types + * @classdesc Represents a MsgDeposit. + * @implements IMsgDeposit * @constructor - * @param {common.IPubKeySet=} [properties] Properties to set + * @param {types.IMsgDeposit=} [properties] Properties to set */ - function PubKeySet(properties) { + function MsgDeposit(properties) { + this.coins = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -593,88 +607,104 @@ $root.common = (function() { } /** - * PubKeySet secp256k1. - * @member {string} secp256k1 - * @memberof common.PubKeySet + * MsgDeposit coins. + * @member {Array.} coins + * @memberof types.MsgDeposit + * @instance + */ + MsgDeposit.prototype.coins = $util.emptyArray; + + /** + * MsgDeposit memo. + * @member {string} memo + * @memberof types.MsgDeposit * @instance */ - PubKeySet.prototype.secp256k1 = ""; + MsgDeposit.prototype.memo = ""; /** - * PubKeySet ed25519. - * @member {string} ed25519 - * @memberof common.PubKeySet + * MsgDeposit signer. + * @member {Uint8Array} signer + * @memberof types.MsgDeposit * @instance */ - PubKeySet.prototype.ed25519 = ""; + MsgDeposit.prototype.signer = $util.newBuffer([]); /** - * Creates a new PubKeySet instance using the specified properties. + * Creates a new MsgDeposit instance using the specified properties. * @function create - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static - * @param {common.IPubKeySet=} [properties] Properties to set - * @returns {common.PubKeySet} PubKeySet instance + * @param {types.IMsgDeposit=} [properties] Properties to set + * @returns {types.MsgDeposit} MsgDeposit instance */ - PubKeySet.create = function create(properties) { - return new PubKeySet(properties); + MsgDeposit.create = function create(properties) { + return new MsgDeposit(properties); }; /** - * Encodes the specified PubKeySet message. Does not implicitly {@link common.PubKeySet.verify|verify} messages. + * Encodes the specified MsgDeposit message. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. * @function encode - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static - * @param {common.IPubKeySet} message PubKeySet message or plain object to encode + * @param {types.IMsgDeposit} message MsgDeposit message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PubKeySet.encode = function encode(message, writer) { + MsgDeposit.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.secp256k1 != null && Object.hasOwnProperty.call(message, "secp256k1")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.secp256k1); - if (message.ed25519 != null && Object.hasOwnProperty.call(message, "ed25519")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ed25519); + if (message.coins != null && message.coins.length) + for (var i = 0; i < message.coins.length; ++i) + $root.common.Coin.encode(message.coins[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.memo); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signer); return writer; }; /** - * Encodes the specified PubKeySet message, length delimited. Does not implicitly {@link common.PubKeySet.verify|verify} messages. + * Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. * @function encodeDelimited - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static - * @param {common.IPubKeySet} message PubKeySet message or plain object to encode + * @param {types.IMsgDeposit} message MsgDeposit message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PubKeySet.encodeDelimited = function encodeDelimited(message, writer) { + MsgDeposit.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PubKeySet message from the specified reader or buffer. + * Decodes a MsgDeposit message from the specified reader or buffer. * @function decode - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {common.PubKeySet} PubKeySet + * @returns {types.MsgDeposit} MsgDeposit * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PubKeySet.decode = function decode(reader, length) { + MsgDeposit.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.common.PubKeySet(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.MsgDeposit(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.secp256k1 = reader.string(); + if (!(message.coins && message.coins.length)) + message.coins = []; + message.coins.push($root.common.Coin.decode(reader, reader.uint32())); break; case 2: - message.ed25519 = reader.string(); + message.memo = reader.string(); + break; + case 3: + message.signer = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -685,124 +715,154 @@ $root.common = (function() { }; /** - * Decodes a PubKeySet message from the specified reader or buffer, length delimited. + * Decodes a MsgDeposit message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.PubKeySet} PubKeySet + * @returns {types.MsgDeposit} MsgDeposit * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PubKeySet.decodeDelimited = function decodeDelimited(reader) { + MsgDeposit.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PubKeySet message. + * Verifies a MsgDeposit message. * @function verify - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PubKeySet.verify = function verify(message) { + MsgDeposit.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) - if (!$util.isString(message.secp256k1)) - return "secp256k1: string expected"; - if (message.ed25519 != null && message.hasOwnProperty("ed25519")) - if (!$util.isString(message.ed25519)) - return "ed25519: string expected"; + if (message.coins != null && message.hasOwnProperty("coins")) { + if (!Array.isArray(message.coins)) + return "coins: array expected"; + for (var i = 0; i < message.coins.length; ++i) { + var error = $root.common.Coin.verify(message.coins[i]); + if (error) + return "coins." + error; + } + } + if (message.memo != null && message.hasOwnProperty("memo")) + if (!$util.isString(message.memo)) + return "memo: string expected"; + if (message.signer != null && message.hasOwnProperty("signer")) + if (!(message.signer && typeof message.signer.length === "number" || $util.isString(message.signer))) + return "signer: buffer expected"; return null; }; /** - * Creates a PubKeySet message from a plain object. Also converts values to their respective internal types. + * Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static * @param {Object.} object Plain object - * @returns {common.PubKeySet} PubKeySet + * @returns {types.MsgDeposit} MsgDeposit */ - PubKeySet.fromObject = function fromObject(object) { - if (object instanceof $root.common.PubKeySet) + MsgDeposit.fromObject = function fromObject(object) { + if (object instanceof $root.types.MsgDeposit) return object; - var message = new $root.common.PubKeySet(); - if (object.secp256k1 != null) - message.secp256k1 = String(object.secp256k1); - if (object.ed25519 != null) - message.ed25519 = String(object.ed25519); + var message = new $root.types.MsgDeposit(); + if (object.coins) { + if (!Array.isArray(object.coins)) + throw TypeError(".types.MsgDeposit.coins: array expected"); + message.coins = []; + for (var i = 0; i < object.coins.length; ++i) { + if (typeof object.coins[i] !== "object") + throw TypeError(".types.MsgDeposit.coins: object expected"); + message.coins[i] = $root.common.Coin.fromObject(object.coins[i]); + } + } + if (object.memo != null) + message.memo = String(object.memo); + if (object.signer != null) + if (typeof object.signer === "string") + $util.base64.decode(object.signer, message.signer = $util.newBuffer($util.base64.length(object.signer)), 0); + else if (object.signer.length) + message.signer = object.signer; return message; }; /** - * Creates a plain object from a PubKeySet message. Also converts values to other types if specified. + * Creates a plain object from a MsgDeposit message. Also converts values to other types if specified. * @function toObject - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static - * @param {common.PubKeySet} message PubKeySet + * @param {types.MsgDeposit} message MsgDeposit * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PubKeySet.toObject = function toObject(message, options) { + MsgDeposit.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.coins = []; if (options.defaults) { - object.secp256k1 = ""; - object.ed25519 = ""; + object.memo = ""; + if (options.bytes === String) + object.signer = ""; + else { + object.signer = []; + if (options.bytes !== Array) + object.signer = $util.newBuffer(object.signer); + } } - if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) - object.secp256k1 = message.secp256k1; - if (message.ed25519 != null && message.hasOwnProperty("ed25519")) - object.ed25519 = message.ed25519; + if (message.coins && message.coins.length) { + object.coins = []; + for (var j = 0; j < message.coins.length; ++j) + object.coins[j] = $root.common.Coin.toObject(message.coins[j], options); + } + if (message.memo != null && message.hasOwnProperty("memo")) + object.memo = message.memo; + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = options.bytes === String ? $util.base64.encode(message.signer, 0, message.signer.length) : options.bytes === Array ? Array.prototype.slice.call(message.signer) : message.signer; return object; }; /** - * Converts this PubKeySet to JSON. + * Converts this MsgDeposit to JSON. * @function toJSON - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @instance * @returns {Object.} JSON object */ - PubKeySet.prototype.toJSON = function toJSON() { + MsgDeposit.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PubKeySet; + return MsgDeposit; })(); - common.Tx = (function() { + types.MsgSend = (function() { /** - * Properties of a Tx. - * @memberof common - * @interface ITx - * @property {string|null} [id] Tx id - * @property {string|null} [chain] Tx chain - * @property {string|null} [fromAddress] Tx fromAddress - * @property {string|null} [toAddress] Tx toAddress - * @property {Array.|null} [coins] Tx coins - * @property {Array.|null} [gas] Tx gas - * @property {string|null} [memo] Tx memo + * Properties of a MsgSend. + * @memberof types + * @interface IMsgSend + * @property {Uint8Array|null} [fromAddress] MsgSend fromAddress + * @property {Uint8Array|null} [toAddress] MsgSend toAddress + * @property {Array.|null} [amount] MsgSend amount */ /** - * Constructs a new Tx. - * @memberof common - * @classdesc Represents a Tx. - * @implements ITx + * Constructs a new MsgSend. + * @memberof types + * @classdesc Represents a MsgSend. + * @implements IMsgSend * @constructor - * @param {common.ITx=} [properties] Properties to set + * @param {types.IMsgSend=} [properties] Properties to set */ - function Tx(properties) { - this.coins = []; - this.gas = []; + function MsgSend(properties) { + this.amount = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -810,159 +870,104 @@ $root.common = (function() { } /** - * Tx id. - * @member {string} id - * @memberof common.Tx - * @instance - */ - Tx.prototype.id = ""; - - /** - * Tx chain. - * @member {string} chain - * @memberof common.Tx - * @instance - */ - Tx.prototype.chain = ""; - - /** - * Tx fromAddress. - * @member {string} fromAddress - * @memberof common.Tx - * @instance - */ - Tx.prototype.fromAddress = ""; - - /** - * Tx toAddress. - * @member {string} toAddress - * @memberof common.Tx - * @instance - */ - Tx.prototype.toAddress = ""; - - /** - * Tx coins. - * @member {Array.} coins - * @memberof common.Tx + * MsgSend fromAddress. + * @member {Uint8Array} fromAddress + * @memberof types.MsgSend * @instance */ - Tx.prototype.coins = $util.emptyArray; + MsgSend.prototype.fromAddress = $util.newBuffer([]); /** - * Tx gas. - * @member {Array.} gas - * @memberof common.Tx + * MsgSend toAddress. + * @member {Uint8Array} toAddress + * @memberof types.MsgSend * @instance */ - Tx.prototype.gas = $util.emptyArray; + MsgSend.prototype.toAddress = $util.newBuffer([]); /** - * Tx memo. - * @member {string} memo - * @memberof common.Tx + * MsgSend amount. + * @member {Array.} amount + * @memberof types.MsgSend * @instance */ - Tx.prototype.memo = ""; + MsgSend.prototype.amount = $util.emptyArray; /** - * Creates a new Tx instance using the specified properties. + * Creates a new MsgSend instance using the specified properties. * @function create - * @memberof common.Tx + * @memberof types.MsgSend * @static - * @param {common.ITx=} [properties] Properties to set - * @returns {common.Tx} Tx instance + * @param {types.IMsgSend=} [properties] Properties to set + * @returns {types.MsgSend} MsgSend instance */ - Tx.create = function create(properties) { - return new Tx(properties); + MsgSend.create = function create(properties) { + return new MsgSend(properties); }; /** - * Encodes the specified Tx message. Does not implicitly {@link common.Tx.verify|verify} messages. + * Encodes the specified MsgSend message. Does not implicitly {@link types.MsgSend.verify|verify} messages. * @function encode - * @memberof common.Tx + * @memberof types.MsgSend * @static - * @param {common.ITx} message Tx message or plain object to encode + * @param {types.IMsgSend} message MsgSend message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Tx.encode = function encode(message, writer) { + MsgSend.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.chain); if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.fromAddress); + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.fromAddress); if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.toAddress); - if (message.coins != null && message.coins.length) - for (var i = 0; i < message.coins.length; ++i) - $root.common.Coin.encode(message.coins[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.gas != null && message.gas.length) - for (var i = 0; i < message.gas.length; ++i) - $root.common.Coin.encode(message.gas[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.memo); + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.toAddress); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified Tx message, length delimited. Does not implicitly {@link common.Tx.verify|verify} messages. + * Encodes the specified MsgSend message, length delimited. Does not implicitly {@link types.MsgSend.verify|verify} messages. * @function encodeDelimited - * @memberof common.Tx + * @memberof types.MsgSend * @static - * @param {common.ITx} message Tx message or plain object to encode + * @param {types.IMsgSend} message MsgSend message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Tx.encodeDelimited = function encodeDelimited(message, writer) { + MsgSend.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Tx message from the specified reader or buffer. + * Decodes a MsgSend message from the specified reader or buffer. * @function decode - * @memberof common.Tx + * @memberof types.MsgSend * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {common.Tx} Tx + * @returns {types.MsgSend} MsgSend * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Tx.decode = function decode(reader, length) { + MsgSend.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.common.Tx(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.MsgSend(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.string(); + message.fromAddress = reader.bytes(); break; case 2: - message.chain = reader.string(); + message.toAddress = reader.bytes(); break; case 3: - message.fromAddress = reader.string(); - break; - case 4: - message.toAddress = reader.string(); - break; - case 5: - if (!(message.coins && message.coins.length)) - message.coins = []; - message.coins.push($root.common.Coin.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.gas && message.gas.length)) - message.gas = []; - message.gas.push($root.common.Coin.decode(reader, reader.uint32())); - break; - case 7: - message.memo = reader.string(); + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -973,1794 +978,191 @@ $root.common = (function() { }; /** - * Decodes a Tx message from the specified reader or buffer, length delimited. + * Decodes a MsgSend message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof common.Tx + * @memberof types.MsgSend * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.Tx} Tx + * @returns {types.MsgSend} MsgSend * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Tx.decodeDelimited = function decodeDelimited(reader) { + MsgSend.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Tx message. + * Verifies a MsgSend message. * @function verify - * @memberof common.Tx + * @memberof types.MsgSend * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Tx.verify = function verify(message) { + MsgSend.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.chain != null && message.hasOwnProperty("chain")) - if (!$util.isString(message.chain)) - return "chain: string expected"; if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) - if (!$util.isString(message.fromAddress)) - return "fromAddress: string expected"; + if (!(message.fromAddress && typeof message.fromAddress.length === "number" || $util.isString(message.fromAddress))) + return "fromAddress: buffer expected"; if (message.toAddress != null && message.hasOwnProperty("toAddress")) - if (!$util.isString(message.toAddress)) - return "toAddress: string expected"; - if (message.coins != null && message.hasOwnProperty("coins")) { - if (!Array.isArray(message.coins)) - return "coins: array expected"; - for (var i = 0; i < message.coins.length; ++i) { - var error = $root.common.Coin.verify(message.coins[i]); - if (error) - return "coins." + error; - } - } - if (message.gas != null && message.hasOwnProperty("gas")) { - if (!Array.isArray(message.gas)) - return "gas: array expected"; - for (var i = 0; i < message.gas.length; ++i) { - var error = $root.common.Coin.verify(message.gas[i]); + if (!(message.toAddress && typeof message.toAddress.length === "number" || $util.isString(message.toAddress))) + return "toAddress: buffer expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); if (error) - return "gas." + error; + return "amount." + error; } } - if (message.memo != null && message.hasOwnProperty("memo")) - if (!$util.isString(message.memo)) - return "memo: string expected"; return null; }; /** - * Creates a Tx message from a plain object. Also converts values to their respective internal types. + * Creates a MsgSend message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof common.Tx + * @memberof types.MsgSend * @static * @param {Object.} object Plain object - * @returns {common.Tx} Tx + * @returns {types.MsgSend} MsgSend */ - Tx.fromObject = function fromObject(object) { - if (object instanceof $root.common.Tx) + MsgSend.fromObject = function fromObject(object) { + if (object instanceof $root.types.MsgSend) return object; - var message = new $root.common.Tx(); - if (object.id != null) - message.id = String(object.id); - if (object.chain != null) - message.chain = String(object.chain); + var message = new $root.types.MsgSend(); if (object.fromAddress != null) - message.fromAddress = String(object.fromAddress); + if (typeof object.fromAddress === "string") + $util.base64.decode(object.fromAddress, message.fromAddress = $util.newBuffer($util.base64.length(object.fromAddress)), 0); + else if (object.fromAddress.length) + message.fromAddress = object.fromAddress; if (object.toAddress != null) - message.toAddress = String(object.toAddress); - if (object.coins) { - if (!Array.isArray(object.coins)) - throw TypeError(".common.Tx.coins: array expected"); - message.coins = []; - for (var i = 0; i < object.coins.length; ++i) { - if (typeof object.coins[i] !== "object") - throw TypeError(".common.Tx.coins: object expected"); - message.coins[i] = $root.common.Coin.fromObject(object.coins[i]); - } - } - if (object.gas) { - if (!Array.isArray(object.gas)) - throw TypeError(".common.Tx.gas: array expected"); - message.gas = []; - for (var i = 0; i < object.gas.length; ++i) { - if (typeof object.gas[i] !== "object") - throw TypeError(".common.Tx.gas: object expected"); - message.gas[i] = $root.common.Coin.fromObject(object.gas[i]); - } - } - if (object.memo != null) - message.memo = String(object.memo); - return message; - }; - - /** - * Creates a plain object from a Tx message. Also converts values to other types if specified. - * @function toObject - * @memberof common.Tx - * @static - * @param {common.Tx} message Tx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Tx.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.coins = []; - object.gas = []; - } - if (options.defaults) { - object.id = ""; - object.chain = ""; - object.fromAddress = ""; - object.toAddress = ""; - object.memo = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.chain != null && message.hasOwnProperty("chain")) - object.chain = message.chain; - if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) - object.fromAddress = message.fromAddress; - if (message.toAddress != null && message.hasOwnProperty("toAddress")) - object.toAddress = message.toAddress; - if (message.coins && message.coins.length) { - object.coins = []; - for (var j = 0; j < message.coins.length; ++j) - object.coins[j] = $root.common.Coin.toObject(message.coins[j], options); - } - if (message.gas && message.gas.length) { - object.gas = []; - for (var j = 0; j < message.gas.length; ++j) - object.gas[j] = $root.common.Coin.toObject(message.gas[j], options); - } - if (message.memo != null && message.hasOwnProperty("memo")) - object.memo = message.memo; - return object; - }; - - /** - * Converts this Tx to JSON. - * @function toJSON - * @memberof common.Tx - * @instance - * @returns {Object.} JSON object - */ - Tx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Tx; - })(); - - common.Fee = (function() { - - /** - * Properties of a Fee. - * @memberof common - * @interface IFee - * @property {Array.|null} [coins] Fee coins - * @property {string|null} [poolDeduct] Fee poolDeduct - */ - - /** - * Constructs a new Fee. - * @memberof common - * @classdesc Represents a Fee. - * @implements IFee - * @constructor - * @param {common.IFee=} [properties] Properties to set - */ - function Fee(properties) { - this.coins = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Fee coins. - * @member {Array.} coins - * @memberof common.Fee - * @instance - */ - Fee.prototype.coins = $util.emptyArray; - - /** - * Fee poolDeduct. - * @member {string} poolDeduct - * @memberof common.Fee - * @instance - */ - Fee.prototype.poolDeduct = ""; - - /** - * Creates a new Fee instance using the specified properties. - * @function create - * @memberof common.Fee - * @static - * @param {common.IFee=} [properties] Properties to set - * @returns {common.Fee} Fee instance - */ - Fee.create = function create(properties) { - return new Fee(properties); - }; - - /** - * Encodes the specified Fee message. Does not implicitly {@link common.Fee.verify|verify} messages. - * @function encode - * @memberof common.Fee - * @static - * @param {common.IFee} message Fee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Fee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.coins != null && message.coins.length) - for (var i = 0; i < message.coins.length; ++i) - $root.common.Coin.encode(message.coins[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.poolDeduct != null && Object.hasOwnProperty.call(message, "poolDeduct")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.poolDeduct); - return writer; - }; - - /** - * Encodes the specified Fee message, length delimited. Does not implicitly {@link common.Fee.verify|verify} messages. - * @function encodeDelimited - * @memberof common.Fee - * @static - * @param {common.IFee} message Fee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Fee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Fee message from the specified reader or buffer. - * @function decode - * @memberof common.Fee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.Fee} Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Fee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.common.Fee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.coins && message.coins.length)) - message.coins = []; - message.coins.push($root.common.Coin.decode(reader, reader.uint32())); - break; - case 2: - message.poolDeduct = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Fee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.Fee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.Fee} Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Fee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Fee message. - * @function verify - * @memberof common.Fee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Fee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.coins != null && message.hasOwnProperty("coins")) { - if (!Array.isArray(message.coins)) - return "coins: array expected"; - for (var i = 0; i < message.coins.length; ++i) { - var error = $root.common.Coin.verify(message.coins[i]); - if (error) - return "coins." + error; - } - } - if (message.poolDeduct != null && message.hasOwnProperty("poolDeduct")) - if (!$util.isString(message.poolDeduct)) - return "poolDeduct: string expected"; - return null; - }; - - /** - * Creates a Fee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.Fee - * @static - * @param {Object.} object Plain object - * @returns {common.Fee} Fee - */ - Fee.fromObject = function fromObject(object) { - if (object instanceof $root.common.Fee) - return object; - var message = new $root.common.Fee(); - if (object.coins) { - if (!Array.isArray(object.coins)) - throw TypeError(".common.Fee.coins: array expected"); - message.coins = []; - for (var i = 0; i < object.coins.length; ++i) { - if (typeof object.coins[i] !== "object") - throw TypeError(".common.Fee.coins: object expected"); - message.coins[i] = $root.common.Coin.fromObject(object.coins[i]); + if (typeof object.toAddress === "string") + $util.base64.decode(object.toAddress, message.toAddress = $util.newBuffer($util.base64.length(object.toAddress)), 0); + else if (object.toAddress.length) + message.toAddress = object.toAddress; + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".types.MsgSend.amount: array expected"); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".types.MsgSend.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); } } - if (object.poolDeduct != null) - message.poolDeduct = String(object.poolDeduct); return message; }; /** - * Creates a plain object from a Fee message. Also converts values to other types if specified. + * Creates a plain object from a MsgSend message. Also converts values to other types if specified. * @function toObject - * @memberof common.Fee + * @memberof types.MsgSend * @static - * @param {common.Fee} message Fee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Fee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.coins = []; - if (options.defaults) - object.poolDeduct = ""; - if (message.coins && message.coins.length) { - object.coins = []; - for (var j = 0; j < message.coins.length; ++j) - object.coins[j] = $root.common.Coin.toObject(message.coins[j], options); - } - if (message.poolDeduct != null && message.hasOwnProperty("poolDeduct")) - object.poolDeduct = message.poolDeduct; - return object; - }; - - /** - * Converts this Fee to JSON. - * @function toJSON - * @memberof common.Fee - * @instance - * @returns {Object.} JSON object - */ - Fee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Fee; - })(); - - common.ProtoUint = (function() { - - /** - * Properties of a ProtoUint. - * @memberof common - * @interface IProtoUint - * @property {string|null} [value] ProtoUint value - */ - - /** - * Constructs a new ProtoUint. - * @memberof common - * @classdesc Represents a ProtoUint. - * @implements IProtoUint - * @constructor - * @param {common.IProtoUint=} [properties] Properties to set - */ - function ProtoUint(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProtoUint value. - * @member {string} value - * @memberof common.ProtoUint - * @instance - */ - ProtoUint.prototype.value = ""; - - /** - * Creates a new ProtoUint instance using the specified properties. - * @function create - * @memberof common.ProtoUint - * @static - * @param {common.IProtoUint=} [properties] Properties to set - * @returns {common.ProtoUint} ProtoUint instance - */ - ProtoUint.create = function create(properties) { - return new ProtoUint(properties); - }; - - /** - * Encodes the specified ProtoUint message. Does not implicitly {@link common.ProtoUint.verify|verify} messages. - * @function encode - * @memberof common.ProtoUint - * @static - * @param {common.IProtoUint} message ProtoUint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProtoUint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; - - /** - * Encodes the specified ProtoUint message, length delimited. Does not implicitly {@link common.ProtoUint.verify|verify} messages. - * @function encodeDelimited - * @memberof common.ProtoUint - * @static - * @param {common.IProtoUint} message ProtoUint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProtoUint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProtoUint message from the specified reader or buffer. - * @function decode - * @memberof common.ProtoUint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.ProtoUint} ProtoUint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProtoUint.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.common.ProtoUint(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProtoUint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.ProtoUint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.ProtoUint} ProtoUint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProtoUint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProtoUint message. - * @function verify - * @memberof common.ProtoUint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProtoUint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a ProtoUint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.ProtoUint - * @static - * @param {Object.} object Plain object - * @returns {common.ProtoUint} ProtoUint - */ - ProtoUint.fromObject = function fromObject(object) { - if (object instanceof $root.common.ProtoUint) - return object; - var message = new $root.common.ProtoUint(); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a ProtoUint message. Also converts values to other types if specified. - * @function toObject - * @memberof common.ProtoUint - * @static - * @param {common.ProtoUint} message ProtoUint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProtoUint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this ProtoUint to JSON. - * @function toJSON - * @memberof common.ProtoUint - * @instance - * @returns {Object.} JSON object - */ - ProtoUint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ProtoUint; - })(); - - return common; -})(); - -$root.types = (function() { - - /** - * Namespace types. - * @exports types - * @namespace - */ - var types = {}; - - types.MsgDeposit = (function() { - - /** - * Properties of a MsgDeposit. - * @memberof types - * @interface IMsgDeposit - * @property {Array.|null} [coins] MsgDeposit coins - * @property {string|null} [memo] MsgDeposit memo - * @property {Uint8Array|null} [signer] MsgDeposit signer - */ - - /** - * Constructs a new MsgDeposit. - * @memberof types - * @classdesc Represents a MsgDeposit. - * @implements IMsgDeposit - * @constructor - * @param {types.IMsgDeposit=} [properties] Properties to set - */ - function MsgDeposit(properties) { - this.coins = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgDeposit coins. - * @member {Array.} coins - * @memberof types.MsgDeposit - * @instance - */ - MsgDeposit.prototype.coins = $util.emptyArray; - - /** - * MsgDeposit memo. - * @member {string} memo - * @memberof types.MsgDeposit - * @instance - */ - MsgDeposit.prototype.memo = ""; - - /** - * MsgDeposit signer. - * @member {Uint8Array} signer - * @memberof types.MsgDeposit - * @instance - */ - MsgDeposit.prototype.signer = $util.newBuffer([]); - - /** - * Creates a new MsgDeposit instance using the specified properties. - * @function create - * @memberof types.MsgDeposit - * @static - * @param {types.IMsgDeposit=} [properties] Properties to set - * @returns {types.MsgDeposit} MsgDeposit instance - */ - MsgDeposit.create = function create(properties) { - return new MsgDeposit(properties); - }; - - /** - * Encodes the specified MsgDeposit message. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. - * @function encode - * @memberof types.MsgDeposit - * @static - * @param {types.IMsgDeposit} message MsgDeposit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeposit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.coins != null && message.coins.length) - for (var i = 0; i < message.coins.length; ++i) - $root.common.Coin.encode(message.coins[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.memo); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. - * @function encodeDelimited - * @memberof types.MsgDeposit - * @static - * @param {types.IMsgDeposit} message MsgDeposit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeposit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgDeposit message from the specified reader or buffer. - * @function decode - * @memberof types.MsgDeposit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {types.MsgDeposit} MsgDeposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeposit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.MsgDeposit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.coins && message.coins.length)) - message.coins = []; - message.coins.push($root.common.Coin.decode(reader, reader.uint32())); - break; - case 2: - message.memo = reader.string(); - break; - case 3: - message.signer = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgDeposit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof types.MsgDeposit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {types.MsgDeposit} MsgDeposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeposit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgDeposit message. - * @function verify - * @memberof types.MsgDeposit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgDeposit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.coins != null && message.hasOwnProperty("coins")) { - if (!Array.isArray(message.coins)) - return "coins: array expected"; - for (var i = 0; i < message.coins.length; ++i) { - var error = $root.common.Coin.verify(message.coins[i]); - if (error) - return "coins." + error; - } - } - if (message.memo != null && message.hasOwnProperty("memo")) - if (!$util.isString(message.memo)) - return "memo: string expected"; - if (message.signer != null && message.hasOwnProperty("signer")) - if (!(message.signer && typeof message.signer.length === "number" || $util.isString(message.signer))) - return "signer: buffer expected"; - return null; - }; - - /** - * Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof types.MsgDeposit - * @static - * @param {Object.} object Plain object - * @returns {types.MsgDeposit} MsgDeposit - */ - MsgDeposit.fromObject = function fromObject(object) { - if (object instanceof $root.types.MsgDeposit) - return object; - var message = new $root.types.MsgDeposit(); - if (object.coins) { - if (!Array.isArray(object.coins)) - throw TypeError(".types.MsgDeposit.coins: array expected"); - message.coins = []; - for (var i = 0; i < object.coins.length; ++i) { - if (typeof object.coins[i] !== "object") - throw TypeError(".types.MsgDeposit.coins: object expected"); - message.coins[i] = $root.common.Coin.fromObject(object.coins[i]); - } - } - if (object.memo != null) - message.memo = String(object.memo); - if (object.signer != null) - if (typeof object.signer === "string") - $util.base64.decode(object.signer, message.signer = $util.newBuffer($util.base64.length(object.signer)), 0); - else if (object.signer.length) - message.signer = object.signer; - return message; - }; - - /** - * Creates a plain object from a MsgDeposit message. Also converts values to other types if specified. - * @function toObject - * @memberof types.MsgDeposit - * @static - * @param {types.MsgDeposit} message MsgDeposit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgDeposit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.coins = []; - if (options.defaults) { - object.memo = ""; - if (options.bytes === String) - object.signer = ""; - else { - object.signer = []; - if (options.bytes !== Array) - object.signer = $util.newBuffer(object.signer); - } - } - if (message.coins && message.coins.length) { - object.coins = []; - for (var j = 0; j < message.coins.length; ++j) - object.coins[j] = $root.common.Coin.toObject(message.coins[j], options); - } - if (message.memo != null && message.hasOwnProperty("memo")) - object.memo = message.memo; - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = options.bytes === String ? $util.base64.encode(message.signer, 0, message.signer.length) : options.bytes === Array ? Array.prototype.slice.call(message.signer) : message.signer; - return object; - }; - - /** - * Converts this MsgDeposit to JSON. - * @function toJSON - * @memberof types.MsgDeposit - * @instance - * @returns {Object.} JSON object - */ - MsgDeposit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgDeposit; - })(); - - types.MsgSend = (function() { - - /** - * Properties of a MsgSend. - * @memberof types - * @interface IMsgSend - * @property {Uint8Array|null} [fromAddress] MsgSend fromAddress - * @property {Uint8Array|null} [toAddress] MsgSend toAddress - * @property {Array.|null} [amount] MsgSend amount - */ - - /** - * Constructs a new MsgSend. - * @memberof types - * @classdesc Represents a MsgSend. - * @implements IMsgSend - * @constructor - * @param {types.IMsgSend=} [properties] Properties to set - */ - function MsgSend(properties) { - this.amount = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgSend fromAddress. - * @member {Uint8Array} fromAddress - * @memberof types.MsgSend - * @instance - */ - MsgSend.prototype.fromAddress = $util.newBuffer([]); - - /** - * MsgSend toAddress. - * @member {Uint8Array} toAddress - * @memberof types.MsgSend - * @instance - */ - MsgSend.prototype.toAddress = $util.newBuffer([]); - - /** - * MsgSend amount. - * @member {Array.} amount - * @memberof types.MsgSend - * @instance - */ - MsgSend.prototype.amount = $util.emptyArray; - - /** - * Creates a new MsgSend instance using the specified properties. - * @function create - * @memberof types.MsgSend - * @static - * @param {types.IMsgSend=} [properties] Properties to set - * @returns {types.MsgSend} MsgSend instance - */ - MsgSend.create = function create(properties) { - return new MsgSend(properties); - }; - - /** - * Encodes the specified MsgSend message. Does not implicitly {@link types.MsgSend.verify|verify} messages. - * @function encode - * @memberof types.MsgSend - * @static - * @param {types.IMsgSend} message MsgSend message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSend.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.fromAddress); - if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.toAddress); - if (message.amount != null && message.amount.length) - for (var i = 0; i < message.amount.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MsgSend message, length delimited. Does not implicitly {@link types.MsgSend.verify|verify} messages. - * @function encodeDelimited - * @memberof types.MsgSend - * @static - * @param {types.IMsgSend} message MsgSend message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSend.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSend message from the specified reader or buffer. - * @function decode - * @memberof types.MsgSend - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {types.MsgSend} MsgSend - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSend.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.MsgSend(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fromAddress = reader.bytes(); - break; - case 2: - message.toAddress = reader.bytes(); - break; - case 3: - if (!(message.amount && message.amount.length)) - message.amount = []; - message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSend message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof types.MsgSend - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {types.MsgSend} MsgSend - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSend.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSend message. - * @function verify - * @memberof types.MsgSend - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSend.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) - if (!(message.fromAddress && typeof message.fromAddress.length === "number" || $util.isString(message.fromAddress))) - return "fromAddress: buffer expected"; - if (message.toAddress != null && message.hasOwnProperty("toAddress")) - if (!(message.toAddress && typeof message.toAddress.length === "number" || $util.isString(message.toAddress))) - return "toAddress: buffer expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - if (!Array.isArray(message.amount)) - return "amount: array expected"; - for (var i = 0; i < message.amount.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); - if (error) - return "amount." + error; - } - } - return null; - }; - - /** - * Creates a MsgSend message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof types.MsgSend - * @static - * @param {Object.} object Plain object - * @returns {types.MsgSend} MsgSend - */ - MsgSend.fromObject = function fromObject(object) { - if (object instanceof $root.types.MsgSend) - return object; - var message = new $root.types.MsgSend(); - if (object.fromAddress != null) - if (typeof object.fromAddress === "string") - $util.base64.decode(object.fromAddress, message.fromAddress = $util.newBuffer($util.base64.length(object.fromAddress)), 0); - else if (object.fromAddress.length) - message.fromAddress = object.fromAddress; - if (object.toAddress != null) - if (typeof object.toAddress === "string") - $util.base64.decode(object.toAddress, message.toAddress = $util.newBuffer($util.base64.length(object.toAddress)), 0); - else if (object.toAddress.length) - message.toAddress = object.toAddress; - if (object.amount) { - if (!Array.isArray(object.amount)) - throw TypeError(".types.MsgSend.amount: array expected"); - message.amount = []; - for (var i = 0; i < object.amount.length; ++i) { - if (typeof object.amount[i] !== "object") - throw TypeError(".types.MsgSend.amount: object expected"); - message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MsgSend message. Also converts values to other types if specified. - * @function toObject - * @memberof types.MsgSend - * @static - * @param {types.MsgSend} message MsgSend - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSend.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.amount = []; - if (options.defaults) { - if (options.bytes === String) - object.fromAddress = ""; - else { - object.fromAddress = []; - if (options.bytes !== Array) - object.fromAddress = $util.newBuffer(object.fromAddress); - } - if (options.bytes === String) - object.toAddress = ""; - else { - object.toAddress = []; - if (options.bytes !== Array) - object.toAddress = $util.newBuffer(object.toAddress); - } - } - if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) - object.fromAddress = options.bytes === String ? $util.base64.encode(message.fromAddress, 0, message.fromAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.fromAddress) : message.fromAddress; - if (message.toAddress != null && message.hasOwnProperty("toAddress")) - object.toAddress = options.bytes === String ? $util.base64.encode(message.toAddress, 0, message.toAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.toAddress) : message.toAddress; - if (message.amount && message.amount.length) { - object.amount = []; - for (var j = 0; j < message.amount.length; ++j) - object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); - } - return object; - }; - - /** - * Converts this MsgSend to JSON. - * @function toJSON - * @memberof types.MsgSend - * @instance - * @returns {Object.} JSON object - */ - MsgSend.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSend; - })(); - - return types; -})(); - -$root.cosmos = (function() { - - /** - * Namespace cosmos. - * @exports cosmos - * @namespace - */ - var cosmos = {}; - - cosmos.base = (function() { - - /** - * Namespace base. - * @memberof cosmos - * @namespace - */ - var base = {}; - - base.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.base - * @namespace - */ - var v1beta1 = {}; - - v1beta1.Coin = (function() { - - /** - * Properties of a Coin. - * @memberof cosmos.base.v1beta1 - * @interface ICoin - * @property {string|null} [denom] Coin denom - * @property {string|null} [amount] Coin amount - */ - - /** - * Constructs a new Coin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a Coin. - * @implements ICoin - * @constructor - * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set - */ - function Coin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Coin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.Coin - * @instance - */ - Coin.prototype.denom = ""; - - /** - * Coin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.Coin - * @instance - */ - Coin.prototype.amount = ""; - - /** - * Creates a new Coin instance using the specified properties. - * @function create - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set - * @returns {cosmos.base.v1beta1.Coin} Coin instance - */ - Coin.create = function create(properties) { - return new Coin(properties); - }; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Coin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Coin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.Coin} Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Coin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.Coin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Coin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.Coin} Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Coin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Coin message. - * @function verify - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Coin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a Coin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.Coin} Coin - */ - Coin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.Coin) - return object; - var message = new $root.cosmos.base.v1beta1.Coin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a Coin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.Coin} message Coin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Coin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this Coin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.Coin - * @instance - * @returns {Object.} JSON object - */ - Coin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Coin; - })(); - - v1beta1.DecCoin = (function() { - - /** - * Properties of a DecCoin. - * @memberof cosmos.base.v1beta1 - * @interface IDecCoin - * @property {string|null} [denom] DecCoin denom - * @property {string|null} [amount] DecCoin amount - */ - - /** - * Constructs a new DecCoin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecCoin. - * @implements IDecCoin - * @constructor - * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set - */ - function DecCoin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DecCoin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.denom = ""; - - /** - * DecCoin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.amount = ""; - - /** - * Creates a new DecCoin instance using the specified properties. - * @function create - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin instance - */ - DecCoin.create = function create(properties) { - return new DecCoin(properties); - }; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecCoin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecCoin message. - * @function verify - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecCoin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - */ - DecCoin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecCoin) - return object; - var message = new $root.cosmos.base.v1beta1.DecCoin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.DecCoin} message DecCoin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecCoin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this DecCoin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - * @returns {Object.} JSON object - */ - DecCoin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecCoin; - })(); - - v1beta1.IntProto = (function() { - - /** - * Properties of an IntProto. - * @memberof cosmos.base.v1beta1 - * @interface IIntProto - * @property {string|null} [int] IntProto int - */ - - /** - * Constructs a new IntProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents an IntProto. - * @implements IIntProto - * @constructor - * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set - */ - function IntProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + * @param {types.MsgSend} message MsgSend + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSend.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + if (options.bytes === String) + object.fromAddress = ""; + else { + object.fromAddress = []; + if (options.bytes !== Array) + object.fromAddress = $util.newBuffer(object.fromAddress); } + if (options.bytes === String) + object.toAddress = ""; + else { + object.toAddress = []; + if (options.bytes !== Array) + object.toAddress = $util.newBuffer(object.toAddress); + } + } + if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) + object.fromAddress = options.bytes === String ? $util.base64.encode(message.fromAddress, 0, message.fromAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.fromAddress) : message.fromAddress; + if (message.toAddress != null && message.hasOwnProperty("toAddress")) + object.toAddress = options.bytes === String ? $util.base64.encode(message.toAddress, 0, message.toAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.toAddress) : message.toAddress; + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + return object; + }; - /** - * IntProto int. - * @member {string} int - * @memberof cosmos.base.v1beta1.IntProto - * @instance - */ - IntProto.prototype.int = ""; - - /** - * Creates a new IntProto instance using the specified properties. - * @function create - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set - * @returns {cosmos.base.v1beta1.IntProto} IntProto instance - */ - IntProto.create = function create(properties) { - return new IntProto(properties); - }; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.int != null && Object.hasOwnProperty.call(message, "int")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.int); - return writer; - }; + /** + * Converts this MsgSend to JSON. + * @function toJSON + * @memberof types.MsgSend + * @instance + * @returns {Object.} JSON object + */ + MsgSend.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return MsgSend; + })(); - /** - * Decodes an IntProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.IntProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.int = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return types; +})(); - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; +$root.cosmos = (function() { - /** - * Verifies an IntProto message. - * @function verify - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.int != null && message.hasOwnProperty("int")) - if (!$util.isString(message.int)) - return "int: string expected"; - return null; - }; + /** + * Namespace cosmos. + * @exports cosmos + * @namespace + */ + var cosmos = {}; - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.IntProto} IntProto - */ - IntProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.IntProto) - return object; - var message = new $root.cosmos.base.v1beta1.IntProto(); - if (object.int != null) - message.int = String(object.int); - return message; - }; + cosmos.base = (function() { - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IntProto} message IntProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.int = ""; - if (message.int != null && message.hasOwnProperty("int")) - object.int = message.int; - return object; - }; + /** + * Namespace base. + * @memberof cosmos + * @namespace + */ + var base = {}; - /** - * Converts this IntProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.IntProto - * @instance - * @returns {Object.} JSON object - */ - IntProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + base.v1beta1 = (function() { - return IntProto; - })(); + /** + * Namespace v1beta1. + * @memberof cosmos.base + * @namespace + */ + var v1beta1 = {}; - v1beta1.DecProto = (function() { + v1beta1.Coin = (function() { /** - * Properties of a DecProto. + * Properties of a Coin. * @memberof cosmos.base.v1beta1 - * @interface IDecProto - * @property {string|null} [dec] DecProto dec + * @interface ICoin + * @property {string|null} [denom] Coin denom + * @property {string|null} [amount] Coin amount */ /** - * Constructs a new DecProto. + * Constructs a new Coin. * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecProto. - * @implements IDecProto + * @classdesc Represents a Coin. + * @implements ICoin * @constructor - * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set + * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set */ - function DecProto(properties) { + function Coin(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2768,75 +1170,88 @@ $root.cosmos = (function() { } /** - * DecProto dec. - * @member {string} dec - * @memberof cosmos.base.v1beta1.DecProto + * Coin denom. + * @member {string} denom + * @memberof cosmos.base.v1beta1.Coin + * @instance + */ + Coin.prototype.denom = ""; + + /** + * Coin amount. + * @member {string} amount + * @memberof cosmos.base.v1beta1.Coin * @instance */ - DecProto.prototype.dec = ""; + Coin.prototype.amount = ""; /** - * Creates a new DecProto instance using the specified properties. + * Creates a new Coin instance using the specified properties. * @function create - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static - * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set - * @returns {cosmos.base.v1beta1.DecProto} DecProto instance + * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.Coin} Coin instance */ - DecProto.create = function create(properties) { - return new DecProto(properties); + Coin.create = function create(properties) { + return new Coin(properties); }; /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. * @function encode - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode + * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DecProto.encode = function encode(message, writer) { + Coin.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dec != null && Object.hasOwnProperty.call(message, "dec")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dec); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); return writer; }; /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode + * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DecProto.encodeDelimited = function encodeDelimited(message, writer) { + Coin.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DecProto message from the specified reader or buffer. + * Decodes a Coin message from the specified reader or buffer. * @function decode - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @returns {cosmos.base.v1beta1.Coin} Coin * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DecProto.decode = function decode(reader, length) { + Coin.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.Coin(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.dec = reader.string(); + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); break; default: reader.skipType(tag & 7); @@ -2847,87 +1262,96 @@ $root.cosmos = (function() { }; /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. + * Decodes a Coin message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @returns {cosmos.base.v1beta1.Coin} Coin * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DecProto.decodeDelimited = function decodeDelimited(reader) { + Coin.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DecProto message. + * Verifies a Coin message. * @function verify - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DecProto.verify = function verify(message) { + Coin.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dec != null && message.hasOwnProperty("dec")) - if (!$util.isString(message.dec)) - return "dec: string expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isString(message.amount)) + return "amount: string expected"; return null; }; /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. + * Creates a Coin message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @returns {cosmos.base.v1beta1.Coin} Coin */ - DecProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecProto) + Coin.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.Coin) return object; - var message = new $root.cosmos.base.v1beta1.DecProto(); - if (object.dec != null) - message.dec = String(object.dec); + var message = new $root.cosmos.base.v1beta1.Coin(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.amount != null) + message.amount = String(object.amount); return message; }; /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. + * Creates a plain object from a Coin message. Also converts values to other types if specified. * @function toObject - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static - * @param {cosmos.base.v1beta1.DecProto} message DecProto + * @param {cosmos.base.v1beta1.Coin} message Coin * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DecProto.toObject = function toObject(message, options) { + Coin.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.dec = ""; - if (message.dec != null && message.hasOwnProperty("dec")) - object.dec = message.dec; + if (options.defaults) { + object.denom = ""; + object.amount = ""; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = message.amount; return object; }; /** - * Converts this DecProto to JSON. + * Converts this Coin to JSON. * @function toJSON - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @instance * @returns {Object.} JSON object */ - DecProto.prototype.toJSON = function toJSON() { + Coin.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DecProto; + return Coin; })(); return v1beta1;