/* eslint-disable */ import * as _m0 from "protobufjs/minimal"; import { Transaction, Wallet } from "./multisig"; import { Params } from "./params"; export const protobufPackage = "decimal.multisig.v1"; /** GenesisState defines the module's genesis state. */ export interface GenesisState { /** wallets defines all registered multisig wallets. */ wallets: Wallet[]; /** transactions defines all registered multisig transactions. */ transactions: Transaction[]; /** params defines all the module's parameters. */ params: Params | undefined; } function createBaseGenesisState(): GenesisState { return { wallets: [], transactions: [], params: undefined }; } export const GenesisState = { encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.wallets) { Wallet.encode(v!, writer.uint32(10).fork()).ldelim(); } for (const v of message.transactions) { Transaction.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.params !== undefined) { Params.encode(message.params, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.wallets.push(Wallet.decode(reader, reader.uint32())); break; case 2: message.transactions.push(Transaction.decode(reader, reader.uint32())); break; case 3: message.params = Params.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): GenesisState { return { wallets: Array.isArray(object?.wallets) ? object.wallets.map((e: any) => Wallet.fromJSON(e)) : [], transactions: Array.isArray(object?.transactions) ? object.transactions.map((e: any) => Transaction.fromJSON(e)) : [], params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; if (message.wallets) { obj.wallets = message.wallets.map((e) => e ? Wallet.toJSON(e) : undefined); } else { obj.wallets = []; } if (message.transactions) { obj.transactions = message.transactions.map((e) => e ? Transaction.toJSON(e) : undefined); } else { obj.transactions = []; } message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, fromPartial, I>>(object: I): GenesisState { const message = createBaseGenesisState(); message.wallets = object.wallets?.map((e) => Wallet.fromPartial(e)) || []; message.transactions = object.transactions?.map((e) => Transaction.fromPartial(e)) || []; message.params = (object.params !== undefined && object.params !== null) ? Params.fromPartial(object.params) : undefined; return message; }, }; type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; function isSet(value: any): boolean { return value !== null && value !== undefined; }