@block52/poker-vm-sdk 1.2.3 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ var stargate = require('@cosmjs/stargate');
5
5
  var events = require('events');
6
6
  var crypto = require('@cosmjs/crypto');
7
7
  var crypto$1 = require('crypto');
8
+ var encoding = require('@cosmjs/encoding');
8
9
 
9
10
  /// <reference path="./types.d.ts" />
10
11
  const defaultFee$q = {
@@ -4169,6 +4170,74 @@ const MsgDeleteGame = {
4169
4170
  return message;
4170
4171
  },
4171
4172
  };
4173
+ function createBaseMsgForceCloseGame() {
4174
+ return { creator: "", gameId: "" };
4175
+ }
4176
+ const MsgForceCloseGame = {
4177
+ encode(message, writer = new BinaryWriter()) {
4178
+ if (message.creator !== "") {
4179
+ writer.uint32(10).string(message.creator);
4180
+ }
4181
+ if (message.gameId !== "") {
4182
+ writer.uint32(18).string(message.gameId);
4183
+ }
4184
+ return writer;
4185
+ },
4186
+ decode(input, length) {
4187
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4188
+ const end = length === undefined ? reader.len : reader.pos + length;
4189
+ const message = createBaseMsgForceCloseGame();
4190
+ while (reader.pos < end) {
4191
+ const tag = reader.uint32();
4192
+ switch (tag >>> 3) {
4193
+ case 1: {
4194
+ if (tag !== 10) {
4195
+ break;
4196
+ }
4197
+ message.creator = reader.string();
4198
+ continue;
4199
+ }
4200
+ case 2: {
4201
+ if (tag !== 18) {
4202
+ break;
4203
+ }
4204
+ message.gameId = reader.string();
4205
+ continue;
4206
+ }
4207
+ }
4208
+ if ((tag & 7) === 4 || tag === 0) {
4209
+ break;
4210
+ }
4211
+ reader.skip(tag & 7);
4212
+ }
4213
+ return message;
4214
+ },
4215
+ fromJSON(object) {
4216
+ return {
4217
+ creator: isSet$2b(object.creator) ? globalThis.String(object.creator) : "",
4218
+ gameId: isSet$2b(object.gameId) ? globalThis.String(object.gameId) : "",
4219
+ };
4220
+ },
4221
+ toJSON(message) {
4222
+ const obj = {};
4223
+ if (message.creator !== "") {
4224
+ obj.creator = message.creator;
4225
+ }
4226
+ if (message.gameId !== "") {
4227
+ obj.gameId = message.gameId;
4228
+ }
4229
+ return obj;
4230
+ },
4231
+ create(base) {
4232
+ return MsgForceCloseGame.fromPartial(base ?? {});
4233
+ },
4234
+ fromPartial(object) {
4235
+ const message = createBaseMsgForceCloseGame();
4236
+ message.creator = object.creator ?? "";
4237
+ message.gameId = object.gameId ?? "";
4238
+ return message;
4239
+ },
4240
+ };
4172
4241
  function createBaseMsgRegisterNftAvatar() {
4173
4242
  return { creator: "", ethAddress: "", contractAddress: "", tokenId: "", ethSignature: "" };
4174
4243
  }
@@ -4302,6 +4371,7 @@ const msgTypes$u = [
4302
4371
  ["/pokerchain.poker.v1.MsgUpdateEthBlockHeight", MsgUpdateEthBlockHeight],
4303
4372
  ["/pokerchain.poker.v1.MsgTopUp", MsgTopUp],
4304
4373
  ["/pokerchain.poker.v1.MsgDeleteGame", MsgDeleteGame],
4374
+ ["/pokerchain.poker.v1.MsgForceCloseGame", MsgForceCloseGame],
4305
4375
  ["/pokerchain.poker.v1.MsgRegisterNftAvatar", MsgRegisterNftAvatar],
4306
4376
  ];
4307
4377
 
@@ -57681,6 +57751,2982 @@ const getDefaultCosmosConfig = (domain = "localhost") => ({
57681
57751
  gasPrice: "0.0stake" // Gas price in stake (not used in REST-only mode)
57682
57752
  });
57683
57753
 
57754
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
57755
+
57756
+ var tx = {};
57757
+
57758
+ var any = {};
57759
+
57760
+ var binary = {};
57761
+
57762
+ var utf8 = {};
57763
+
57764
+ /* eslint-disable */
57765
+
57766
+ var hasRequiredUtf8;
57767
+
57768
+ function requireUtf8 () {
57769
+ if (hasRequiredUtf8) return utf8;
57770
+ hasRequiredUtf8 = 1;
57771
+ Object.defineProperty(utf8, "__esModule", { value: true });
57772
+ utf8.utf8Write = utf8.utf8Read = utf8.utf8Length = void 0;
57773
+ /**
57774
+ * Calculates the UTF8 byte length of a string.
57775
+ * @param {string} string String
57776
+ * @returns {number} Byte length
57777
+ */
57778
+ function utf8Length(str) {
57779
+ let len = 0, c = 0;
57780
+ for (let i = 0; i < str.length; ++i) {
57781
+ c = str.charCodeAt(i);
57782
+ if (c < 128)
57783
+ len += 1;
57784
+ else if (c < 2048)
57785
+ len += 2;
57786
+ else if ((c & 0xfc00) === 0xd800 && (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {
57787
+ ++i;
57788
+ len += 4;
57789
+ }
57790
+ else
57791
+ len += 3;
57792
+ }
57793
+ return len;
57794
+ }
57795
+ utf8.utf8Length = utf8Length;
57796
+ /**
57797
+ * Reads UTF8 bytes as a string.
57798
+ * @param {Uint8Array} buffer Source buffer
57799
+ * @param {number} start Source start
57800
+ * @param {number} end Source end
57801
+ * @returns {string} String read
57802
+ */
57803
+ function utf8Read(buffer, start, end) {
57804
+ const len = end - start;
57805
+ if (len < 1)
57806
+ return "";
57807
+ const chunk = [];
57808
+ let parts = [], i = 0, // char offset
57809
+ t; // temporary
57810
+ while (start < end) {
57811
+ t = buffer[start++];
57812
+ if (t < 128)
57813
+ chunk[i++] = t;
57814
+ else if (t > 191 && t < 224)
57815
+ chunk[i++] = ((t & 31) << 6) | (buffer[start++] & 63);
57816
+ else if (t > 239 && t < 365) {
57817
+ t =
57818
+ (((t & 7) << 18) |
57819
+ ((buffer[start++] & 63) << 12) |
57820
+ ((buffer[start++] & 63) << 6) |
57821
+ (buffer[start++] & 63)) -
57822
+ 0x10000;
57823
+ chunk[i++] = 0xd800 + (t >> 10);
57824
+ chunk[i++] = 0xdc00 + (t & 1023);
57825
+ }
57826
+ else
57827
+ chunk[i++] = ((t & 15) << 12) | ((buffer[start++] & 63) << 6) | (buffer[start++] & 63);
57828
+ if (i > 8191) {
57829
+ (parts || (parts = [])).push(String.fromCharCode(...chunk));
57830
+ i = 0;
57831
+ }
57832
+ }
57833
+ if (parts) {
57834
+ if (i)
57835
+ parts.push(String.fromCharCode(...chunk.slice(0, i)));
57836
+ return parts.join("");
57837
+ }
57838
+ return String.fromCharCode(...chunk.slice(0, i));
57839
+ }
57840
+ utf8.utf8Read = utf8Read;
57841
+ /**
57842
+ * Writes a string as UTF8 bytes.
57843
+ * @param {string} string Source string
57844
+ * @param {Uint8Array} buffer Destination buffer
57845
+ * @param {number} offset Destination offset
57846
+ * @returns {number} Bytes written
57847
+ */
57848
+ function utf8Write(str, buffer, offset) {
57849
+ const start = offset;
57850
+ let c1, // character 1
57851
+ c2; // character 2
57852
+ for (let i = 0; i < str.length; ++i) {
57853
+ c1 = str.charCodeAt(i);
57854
+ if (c1 < 128) {
57855
+ buffer[offset++] = c1;
57856
+ }
57857
+ else if (c1 < 2048) {
57858
+ buffer[offset++] = (c1 >> 6) | 192;
57859
+ buffer[offset++] = (c1 & 63) | 128;
57860
+ }
57861
+ else if ((c1 & 0xfc00) === 0xd800 && ((c2 = str.charCodeAt(i + 1)) & 0xfc00) === 0xdc00) {
57862
+ c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff);
57863
+ ++i;
57864
+ buffer[offset++] = (c1 >> 18) | 240;
57865
+ buffer[offset++] = ((c1 >> 12) & 63) | 128;
57866
+ buffer[offset++] = ((c1 >> 6) & 63) | 128;
57867
+ buffer[offset++] = (c1 & 63) | 128;
57868
+ }
57869
+ else {
57870
+ buffer[offset++] = (c1 >> 12) | 224;
57871
+ buffer[offset++] = ((c1 >> 6) & 63) | 128;
57872
+ buffer[offset++] = (c1 & 63) | 128;
57873
+ }
57874
+ }
57875
+ return offset - start;
57876
+ }
57877
+ utf8.utf8Write = utf8Write;
57878
+
57879
+ return utf8;
57880
+ }
57881
+
57882
+ var varint = {};
57883
+
57884
+ var hasRequiredVarint;
57885
+
57886
+ function requireVarint () {
57887
+ if (hasRequiredVarint) return varint;
57888
+ hasRequiredVarint = 1;
57889
+ /* eslint-disable */
57890
+ /**
57891
+ * This file and any referenced files were automatically generated by @cosmology/telescope@1.0.7
57892
+ * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
57893
+ * and run the transpile command or yarn proto command to regenerate this bundle.
57894
+ */
57895
+ Object.defineProperty(varint, "__esModule", { value: true });
57896
+ varint.writeByte = varint.writeFixed32 = varint.int64Length = varint.writeVarint64 = varint.writeVarint32 = varint.readInt32 = varint.readUInt32 = varint.zzDecode = varint.zzEncode = varint.varint32read = varint.varint32write = varint.uInt64ToString = varint.int64ToString = varint.int64FromString = varint.varint64write = varint.varint64read = void 0;
57897
+ // Copyright 2008 Google Inc. All rights reserved.
57898
+ //
57899
+ // Redistribution and use in source and binary forms, with or without
57900
+ // modification, are permitted provided that the following conditions are
57901
+ // met:
57902
+ //
57903
+ // * Redistributions of source code must retain the above copyright
57904
+ // notice, this list of conditions and the following disclaimer.
57905
+ // * Redistributions in binary form must reproduce the above
57906
+ // copyright notice, this list of conditions and the following disclaimer
57907
+ // in the documentation and/or other materials provided with the
57908
+ // distribution.
57909
+ // * Neither the name of Google Inc. nor the names of its
57910
+ // contributors may be used to endorse or promote products derived from
57911
+ // this software without specific prior written permission.
57912
+ //
57913
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
57914
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
57915
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
57916
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
57917
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
57918
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
57919
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
57920
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
57921
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
57922
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
57923
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57924
+ //
57925
+ // Code generated by the Protocol Buffer compiler is owned by the owner
57926
+ // of the input file used when generating it. This code is not
57927
+ // standalone and requires a support library to be linked with it. This
57928
+ // support library is itself covered by the above license.
57929
+ /* eslint-disable prefer-const,@typescript-eslint/restrict-plus-operands */
57930
+ /**
57931
+ * Read a 64 bit varint as two JS numbers.
57932
+ *
57933
+ * Returns tuple:
57934
+ * [0]: low bits
57935
+ * [1]: high bits
57936
+ *
57937
+ * Copyright 2008 Google Inc. All rights reserved.
57938
+ *
57939
+ * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175
57940
+ */
57941
+ function varint64read() {
57942
+ let lowBits = 0;
57943
+ let highBits = 0;
57944
+ for (let shift = 0; shift < 28; shift += 7) {
57945
+ let b = this.buf[this.pos++];
57946
+ lowBits |= (b & 0x7f) << shift;
57947
+ if ((b & 0x80) == 0) {
57948
+ this.assertBounds();
57949
+ return [lowBits, highBits];
57950
+ }
57951
+ }
57952
+ let middleByte = this.buf[this.pos++];
57953
+ // last four bits of the first 32 bit number
57954
+ lowBits |= (middleByte & 0x0f) << 28;
57955
+ // 3 upper bits are part of the next 32 bit number
57956
+ highBits = (middleByte & 0x70) >> 4;
57957
+ if ((middleByte & 0x80) == 0) {
57958
+ this.assertBounds();
57959
+ return [lowBits, highBits];
57960
+ }
57961
+ for (let shift = 3; shift <= 31; shift += 7) {
57962
+ let b = this.buf[this.pos++];
57963
+ highBits |= (b & 0x7f) << shift;
57964
+ if ((b & 0x80) == 0) {
57965
+ this.assertBounds();
57966
+ return [lowBits, highBits];
57967
+ }
57968
+ }
57969
+ throw new Error("invalid varint");
57970
+ }
57971
+ varint.varint64read = varint64read;
57972
+ /**
57973
+ * Write a 64 bit varint, given as two JS numbers, to the given bytes array.
57974
+ *
57975
+ * Copyright 2008 Google Inc. All rights reserved.
57976
+ *
57977
+ * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344
57978
+ */
57979
+ function varint64write(lo, hi, bytes) {
57980
+ for (let i = 0; i < 28; i = i + 7) {
57981
+ const shift = lo >>> i;
57982
+ const hasNext = !(shift >>> 7 == 0 && hi == 0);
57983
+ const byte = (hasNext ? shift | 0x80 : shift) & 0xff;
57984
+ bytes.push(byte);
57985
+ if (!hasNext) {
57986
+ return;
57987
+ }
57988
+ }
57989
+ const splitBits = ((lo >>> 28) & 0x0f) | ((hi & 0x07) << 4);
57990
+ const hasMoreBits = !(hi >> 3 == 0);
57991
+ bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) & 0xff);
57992
+ if (!hasMoreBits) {
57993
+ return;
57994
+ }
57995
+ for (let i = 3; i < 31; i = i + 7) {
57996
+ const shift = hi >>> i;
57997
+ const hasNext = !(shift >>> 7 == 0);
57998
+ const byte = (hasNext ? shift | 0x80 : shift) & 0xff;
57999
+ bytes.push(byte);
58000
+ if (!hasNext) {
58001
+ return;
58002
+ }
58003
+ }
58004
+ bytes.push((hi >>> 31) & 0x01);
58005
+ }
58006
+ varint.varint64write = varint64write;
58007
+ // constants for binary math
58008
+ const TWO_PWR_32_DBL = 0x100000000;
58009
+ /**
58010
+ * Parse decimal string of 64 bit integer value as two JS numbers.
58011
+ *
58012
+ * Copyright 2008 Google Inc. All rights reserved.
58013
+ *
58014
+ * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10
58015
+ */
58016
+ function int64FromString(dec) {
58017
+ // Check for minus sign.
58018
+ const minus = dec[0] === "-";
58019
+ if (minus) {
58020
+ dec = dec.slice(1);
58021
+ }
58022
+ // Work 6 decimal digits at a time, acting like we're converting base 1e6
58023
+ // digits to binary. This is safe to do with floating point math because
58024
+ // Number.isSafeInteger(ALL_32_BITS * 1e6) == true.
58025
+ const base = 1e6;
58026
+ let lowBits = 0;
58027
+ let highBits = 0;
58028
+ function add1e6digit(begin, end) {
58029
+ // Note: Number('') is 0.
58030
+ const digit1e6 = Number(dec.slice(begin, end));
58031
+ highBits *= base;
58032
+ lowBits = lowBits * base + digit1e6;
58033
+ // Carry bits from lowBits to
58034
+ if (lowBits >= TWO_PWR_32_DBL) {
58035
+ highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0);
58036
+ lowBits = lowBits % TWO_PWR_32_DBL;
58037
+ }
58038
+ }
58039
+ add1e6digit(-24, -18);
58040
+ add1e6digit(-18, -12);
58041
+ add1e6digit(-12, -6);
58042
+ add1e6digit(-6);
58043
+ return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits);
58044
+ }
58045
+ varint.int64FromString = int64FromString;
58046
+ /**
58047
+ * Losslessly converts a 64-bit signed integer in 32:32 split representation
58048
+ * into a decimal string.
58049
+ *
58050
+ * Copyright 2008 Google Inc. All rights reserved.
58051
+ *
58052
+ * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10
58053
+ */
58054
+ function int64ToString(lo, hi) {
58055
+ let bits = newBits(lo, hi);
58056
+ // If we're treating the input as a signed value and the high bit is set, do
58057
+ // a manual two's complement conversion before the decimal conversion.
58058
+ const negative = bits.hi & 0x80000000;
58059
+ if (negative) {
58060
+ bits = negate(bits.lo, bits.hi);
58061
+ }
58062
+ const result = uInt64ToString(bits.lo, bits.hi);
58063
+ return negative ? "-" + result : result;
58064
+ }
58065
+ varint.int64ToString = int64ToString;
58066
+ /**
58067
+ * Losslessly converts a 64-bit unsigned integer in 32:32 split representation
58068
+ * into a decimal string.
58069
+ *
58070
+ * Copyright 2008 Google Inc. All rights reserved.
58071
+ *
58072
+ * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10
58073
+ */
58074
+ function uInt64ToString(lo, hi) {
58075
+ ({ lo, hi } = toUnsigned(lo, hi));
58076
+ // Skip the expensive conversion if the number is small enough to use the
58077
+ // built-in conversions.
58078
+ // Number.MAX_SAFE_INTEGER = 0x001FFFFF FFFFFFFF, thus any number with
58079
+ // highBits <= 0x1FFFFF can be safely expressed with a double and retain
58080
+ // integer precision.
58081
+ // Proven by: Number.isSafeInteger(0x1FFFFF * 2**32 + 0xFFFFFFFF) == true.
58082
+ if (hi <= 0x1fffff) {
58083
+ return String(TWO_PWR_32_DBL * hi + lo);
58084
+ }
58085
+ // What this code is doing is essentially converting the input number from
58086
+ // base-2 to base-1e7, which allows us to represent the 64-bit range with
58087
+ // only 3 (very large) digits. Those digits are then trivial to convert to
58088
+ // a base-10 string.
58089
+ // The magic numbers used here are -
58090
+ // 2^24 = 16777216 = (1,6777216) in base-1e7.
58091
+ // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7.
58092
+ // Split 32:32 representation into 16:24:24 representation so our
58093
+ // intermediate digits don't overflow.
58094
+ const low = lo & 0xffffff;
58095
+ const mid = ((lo >>> 24) | (hi << 8)) & 0xffffff;
58096
+ const high = (hi >> 16) & 0xffff;
58097
+ // Assemble our three base-1e7 digits, ignoring carries. The maximum
58098
+ // value in a digit at this step is representable as a 48-bit integer, which
58099
+ // can be stored in a 64-bit floating point number.
58100
+ let digitA = low + mid * 6777216 + high * 6710656;
58101
+ let digitB = mid + high * 8147497;
58102
+ let digitC = high * 2;
58103
+ // Apply carries from A to B and from B to C.
58104
+ const base = 10000000;
58105
+ if (digitA >= base) {
58106
+ digitB += Math.floor(digitA / base);
58107
+ digitA %= base;
58108
+ }
58109
+ if (digitB >= base) {
58110
+ digitC += Math.floor(digitB / base);
58111
+ digitB %= base;
58112
+ }
58113
+ // If digitC is 0, then we should have returned in the trivial code path
58114
+ // at the top for non-safe integers. Given this, we can assume both digitB
58115
+ // and digitA need leading zeros.
58116
+ return digitC.toString() + decimalFrom1e7WithLeadingZeros(digitB) + decimalFrom1e7WithLeadingZeros(digitA);
58117
+ }
58118
+ varint.uInt64ToString = uInt64ToString;
58119
+ function toUnsigned(lo, hi) {
58120
+ return { lo: lo >>> 0, hi: hi >>> 0 };
58121
+ }
58122
+ function newBits(lo, hi) {
58123
+ return { lo: lo | 0, hi: hi | 0 };
58124
+ }
58125
+ /**
58126
+ * Returns two's compliment negation of input.
58127
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Signed_32-bit_integers
58128
+ */
58129
+ function negate(lowBits, highBits) {
58130
+ highBits = ~highBits;
58131
+ if (lowBits) {
58132
+ lowBits = ~lowBits + 1;
58133
+ }
58134
+ else {
58135
+ // If lowBits is 0, then bitwise-not is 0xFFFFFFFF,
58136
+ // adding 1 to that, results in 0x100000000, which leaves
58137
+ // the low bits 0x0 and simply adds one to the high bits.
58138
+ highBits += 1;
58139
+ }
58140
+ return newBits(lowBits, highBits);
58141
+ }
58142
+ /**
58143
+ * Returns decimal representation of digit1e7 with leading zeros.
58144
+ */
58145
+ const decimalFrom1e7WithLeadingZeros = (digit1e7) => {
58146
+ const partial = String(digit1e7);
58147
+ return "0000000".slice(partial.length) + partial;
58148
+ };
58149
+ /**
58150
+ * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)`
58151
+ *
58152
+ * Copyright 2008 Google Inc. All rights reserved.
58153
+ *
58154
+ * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144
58155
+ */
58156
+ function varint32write(value, bytes) {
58157
+ if (value >= 0) {
58158
+ // write value as varint 32
58159
+ while (value > 0x7f) {
58160
+ bytes.push((value & 0x7f) | 0x80);
58161
+ value = value >>> 7;
58162
+ }
58163
+ bytes.push(value);
58164
+ }
58165
+ else {
58166
+ for (let i = 0; i < 9; i++) {
58167
+ bytes.push((value & 127) | 128);
58168
+ value = value >> 7;
58169
+ }
58170
+ bytes.push(1);
58171
+ }
58172
+ }
58173
+ varint.varint32write = varint32write;
58174
+ /**
58175
+ * Read an unsigned 32 bit varint.
58176
+ *
58177
+ * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220
58178
+ */
58179
+ function varint32read() {
58180
+ let b = this.buf[this.pos++];
58181
+ let result = b & 0x7f;
58182
+ if ((b & 0x80) == 0) {
58183
+ this.assertBounds();
58184
+ return result;
58185
+ }
58186
+ b = this.buf[this.pos++];
58187
+ result |= (b & 0x7f) << 7;
58188
+ if ((b & 0x80) == 0) {
58189
+ this.assertBounds();
58190
+ return result;
58191
+ }
58192
+ b = this.buf[this.pos++];
58193
+ result |= (b & 0x7f) << 14;
58194
+ if ((b & 0x80) == 0) {
58195
+ this.assertBounds();
58196
+ return result;
58197
+ }
58198
+ b = this.buf[this.pos++];
58199
+ result |= (b & 0x7f) << 21;
58200
+ if ((b & 0x80) == 0) {
58201
+ this.assertBounds();
58202
+ return result;
58203
+ }
58204
+ // Extract only last 4 bits
58205
+ b = this.buf[this.pos++];
58206
+ result |= (b & 0x0f) << 28;
58207
+ for (let readBytes = 5; (b & 0x80) !== 0 && readBytes < 10; readBytes++)
58208
+ b = this.buf[this.pos++];
58209
+ if ((b & 0x80) != 0)
58210
+ throw new Error("invalid varint");
58211
+ this.assertBounds();
58212
+ // Result can have 32 bits, convert it to unsigned
58213
+ return result >>> 0;
58214
+ }
58215
+ varint.varint32read = varint32read;
58216
+ /**
58217
+ * encode zig zag
58218
+ */
58219
+ function zzEncode(lo, hi) {
58220
+ let mask = hi >> 31;
58221
+ hi = (((hi << 1) | (lo >>> 31)) ^ mask) >>> 0;
58222
+ lo = ((lo << 1) ^ mask) >>> 0;
58223
+ return [lo, hi];
58224
+ }
58225
+ varint.zzEncode = zzEncode;
58226
+ /**
58227
+ * decode zig zag
58228
+ */
58229
+ function zzDecode(lo, hi) {
58230
+ let mask = -(lo & 1);
58231
+ lo = (((lo >>> 1) | (hi << 31)) ^ mask) >>> 0;
58232
+ hi = ((hi >>> 1) ^ mask) >>> 0;
58233
+ return [lo, hi];
58234
+ }
58235
+ varint.zzDecode = zzDecode;
58236
+ /**
58237
+ * unsigned int32 without moving pos.
58238
+ */
58239
+ function readUInt32(buf, pos) {
58240
+ return (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + buf[pos + 3] * 0x1000000;
58241
+ }
58242
+ varint.readUInt32 = readUInt32;
58243
+ /**
58244
+ * signed int32 without moving pos.
58245
+ */
58246
+ function readInt32(buf, pos) {
58247
+ return (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + (buf[pos + 3] << 24);
58248
+ }
58249
+ varint.readInt32 = readInt32;
58250
+ /**
58251
+ * writing varint32 to pos
58252
+ */
58253
+ function writeVarint32(val, buf, pos) {
58254
+ while (val > 127) {
58255
+ buf[pos++] = (val & 127) | 128;
58256
+ val >>>= 7;
58257
+ }
58258
+ buf[pos] = val;
58259
+ }
58260
+ varint.writeVarint32 = writeVarint32;
58261
+ /**
58262
+ * writing varint64 to pos
58263
+ */
58264
+ function writeVarint64(val, buf, pos) {
58265
+ while (val.hi) {
58266
+ buf[pos++] = (val.lo & 127) | 128;
58267
+ val.lo = ((val.lo >>> 7) | (val.hi << 25)) >>> 0;
58268
+ val.hi >>>= 7;
58269
+ }
58270
+ while (val.lo > 127) {
58271
+ buf[pos++] = (val.lo & 127) | 128;
58272
+ val.lo = val.lo >>> 7;
58273
+ }
58274
+ buf[pos++] = val.lo;
58275
+ }
58276
+ varint.writeVarint64 = writeVarint64;
58277
+ function int64Length(lo, hi) {
58278
+ let part0 = lo, part1 = ((lo >>> 28) | (hi << 4)) >>> 0, part2 = hi >>> 24;
58279
+ return part2 === 0
58280
+ ? part1 === 0
58281
+ ? part0 < 16384
58282
+ ? part0 < 128
58283
+ ? 1
58284
+ : 2
58285
+ : part0 < 2097152
58286
+ ? 3
58287
+ : 4
58288
+ : part1 < 16384
58289
+ ? part1 < 128
58290
+ ? 5
58291
+ : 6
58292
+ : part1 < 2097152
58293
+ ? 7
58294
+ : 8
58295
+ : part2 < 128
58296
+ ? 9
58297
+ : 10;
58298
+ }
58299
+ varint.int64Length = int64Length;
58300
+ function writeFixed32(val, buf, pos) {
58301
+ buf[pos] = val & 255;
58302
+ buf[pos + 1] = (val >>> 8) & 255;
58303
+ buf[pos + 2] = (val >>> 16) & 255;
58304
+ buf[pos + 3] = val >>> 24;
58305
+ }
58306
+ varint.writeFixed32 = writeFixed32;
58307
+ function writeByte(val, buf, pos) {
58308
+ buf[pos] = val & 255;
58309
+ }
58310
+ varint.writeByte = writeByte;
58311
+
58312
+ return varint;
58313
+ }
58314
+
58315
+ var hasRequiredBinary;
58316
+
58317
+ function requireBinary () {
58318
+ if (hasRequiredBinary) return binary;
58319
+ hasRequiredBinary = 1;
58320
+ /* eslint-disable */
58321
+ /**
58322
+ * This file and any referenced files were automatically generated by @cosmology/telescope@1.0.7
58323
+ * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
58324
+ * and run the transpile command or yarn proto command to regenerate this bundle.
58325
+ */
58326
+ Object.defineProperty(binary, "__esModule", { value: true });
58327
+ binary.BinaryWriter = binary.BinaryReader = binary.WireType = void 0;
58328
+ // Copyright (c) 2016, Daniel Wirtz All rights reserved.
58329
+ // Redistribution and use in source and binary forms, with or without
58330
+ // modification, are permitted provided that the following conditions are
58331
+ // met:
58332
+ // * Redistributions of source code must retain the above copyright
58333
+ // notice, this list of conditions and the following disclaimer.
58334
+ // * Redistributions in binary form must reproduce the above copyright
58335
+ // notice, this list of conditions and the following disclaimer in the
58336
+ // documentation and/or other materials provided with the distribution.
58337
+ // * Neither the name of its author, nor the names of its contributors
58338
+ // may be used to endorse or promote products derived from this software
58339
+ // without specific prior written permission.
58340
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
58341
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
58342
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
58343
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
58344
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
58345
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
58346
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
58347
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
58348
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
58349
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
58350
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58351
+ // ---
58352
+ // Code generated by the command line utilities is owned by the owner
58353
+ // of the input file used when generating it. This code is not
58354
+ // standalone and requires a support library to be linked with it. This
58355
+ // support library is itself covered by the above license.
58356
+ const utf8_1 = requireUtf8();
58357
+ const varint_1 = requireVarint();
58358
+ var WireType;
58359
+ (function (WireType) {
58360
+ WireType[WireType["Varint"] = 0] = "Varint";
58361
+ WireType[WireType["Fixed64"] = 1] = "Fixed64";
58362
+ WireType[WireType["Bytes"] = 2] = "Bytes";
58363
+ WireType[WireType["Fixed32"] = 5] = "Fixed32";
58364
+ })(WireType || (binary.WireType = WireType = {}));
58365
+ class BinaryReader {
58366
+ assertBounds() {
58367
+ if (this.pos > this.len)
58368
+ throw new RangeError("premature EOF");
58369
+ }
58370
+ constructor(buf) {
58371
+ this.buf = buf ? new Uint8Array(buf) : new Uint8Array(0);
58372
+ this.pos = 0;
58373
+ this.type = 0;
58374
+ this.len = this.buf.length;
58375
+ }
58376
+ tag() {
58377
+ const tag = this.uint32(), fieldNo = tag >>> 3, wireType = tag & 7;
58378
+ if (fieldNo <= 0 || wireType < 0 || wireType > 5)
58379
+ throw new Error("illegal tag: field no " + fieldNo + " wire type " + wireType);
58380
+ return [fieldNo, wireType, tag];
58381
+ }
58382
+ skip(length) {
58383
+ if (typeof length === "number") {
58384
+ if (this.pos + length > this.len)
58385
+ throw indexOutOfRange(this, length);
58386
+ this.pos += length;
58387
+ }
58388
+ else {
58389
+ do {
58390
+ if (this.pos >= this.len)
58391
+ throw indexOutOfRange(this);
58392
+ } while (this.buf[this.pos++] & 128);
58393
+ }
58394
+ return this;
58395
+ }
58396
+ skipType(wireType) {
58397
+ switch (wireType) {
58398
+ case WireType.Varint:
58399
+ this.skip();
58400
+ break;
58401
+ case WireType.Fixed64:
58402
+ this.skip(8);
58403
+ break;
58404
+ case WireType.Bytes:
58405
+ this.skip(this.uint32());
58406
+ break;
58407
+ case 3:
58408
+ while ((wireType = this.uint32() & 7) !== 4) {
58409
+ this.skipType(wireType);
58410
+ }
58411
+ break;
58412
+ case WireType.Fixed32:
58413
+ this.skip(4);
58414
+ break;
58415
+ /* istanbul ignore next */
58416
+ default:
58417
+ throw Error("invalid wire type " + wireType + " at offset " + this.pos);
58418
+ }
58419
+ return this;
58420
+ }
58421
+ uint32() {
58422
+ return varint_1.varint32read.bind(this)();
58423
+ }
58424
+ int32() {
58425
+ return this.uint32() | 0;
58426
+ }
58427
+ sint32() {
58428
+ const num = this.uint32();
58429
+ return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding
58430
+ }
58431
+ fixed32() {
58432
+ const val = (0, varint_1.readUInt32)(this.buf, this.pos);
58433
+ this.pos += 4;
58434
+ return val;
58435
+ }
58436
+ sfixed32() {
58437
+ const val = (0, varint_1.readInt32)(this.buf, this.pos);
58438
+ this.pos += 4;
58439
+ return val;
58440
+ }
58441
+ int64() {
58442
+ const [lo, hi] = varint_1.varint64read.bind(this)();
58443
+ return BigInt((0, varint_1.int64ToString)(lo, hi));
58444
+ }
58445
+ uint64() {
58446
+ const [lo, hi] = varint_1.varint64read.bind(this)();
58447
+ return BigInt((0, varint_1.uInt64ToString)(lo, hi));
58448
+ }
58449
+ sint64() {
58450
+ let [lo, hi] = varint_1.varint64read.bind(this)();
58451
+ // zig zag
58452
+ [lo, hi] = (0, varint_1.zzDecode)(lo, hi);
58453
+ return BigInt((0, varint_1.int64ToString)(lo, hi));
58454
+ }
58455
+ fixed64() {
58456
+ const lo = this.sfixed32();
58457
+ const hi = this.sfixed32();
58458
+ return BigInt((0, varint_1.uInt64ToString)(lo, hi));
58459
+ }
58460
+ sfixed64() {
58461
+ const lo = this.sfixed32();
58462
+ const hi = this.sfixed32();
58463
+ return BigInt((0, varint_1.int64ToString)(lo, hi));
58464
+ }
58465
+ float() {
58466
+ throw new Error("float not supported");
58467
+ }
58468
+ double() {
58469
+ throw new Error("double not supported");
58470
+ }
58471
+ bool() {
58472
+ const [lo, hi] = varint_1.varint64read.bind(this)();
58473
+ return lo !== 0 || hi !== 0;
58474
+ }
58475
+ bytes() {
58476
+ const len = this.uint32(), start = this.pos;
58477
+ this.pos += len;
58478
+ this.assertBounds();
58479
+ return this.buf.subarray(start, start + len);
58480
+ }
58481
+ string() {
58482
+ const bytes = this.bytes();
58483
+ return (0, utf8_1.utf8Read)(bytes, 0, bytes.length);
58484
+ }
58485
+ }
58486
+ binary.BinaryReader = BinaryReader;
58487
+ class Op {
58488
+ constructor(fn, len, val) {
58489
+ this.fn = fn;
58490
+ this.len = len;
58491
+ this.val = val;
58492
+ }
58493
+ proceed(buf, pos) {
58494
+ if (this.fn) {
58495
+ this.fn(this.val, buf, pos);
58496
+ }
58497
+ }
58498
+ }
58499
+ class State {
58500
+ constructor(writer) {
58501
+ this.head = writer.head;
58502
+ this.tail = writer.tail;
58503
+ this.len = writer.len;
58504
+ this.next = writer.states;
58505
+ }
58506
+ }
58507
+ class BinaryWriter {
58508
+ constructor() {
58509
+ this.len = 0;
58510
+ // uint64 is the same with int64
58511
+ this.uint64 = BinaryWriter.prototype.int64;
58512
+ // sfixed64 is the same with fixed64
58513
+ this.sfixed64 = BinaryWriter.prototype.fixed64;
58514
+ // sfixed32 is the same with fixed32
58515
+ this.sfixed32 = BinaryWriter.prototype.fixed32;
58516
+ this.head = new Op(null, 0, 0);
58517
+ this.tail = this.head;
58518
+ this.states = null;
58519
+ }
58520
+ static create() {
58521
+ return new BinaryWriter();
58522
+ }
58523
+ static alloc(size) {
58524
+ if (typeof Uint8Array !== "undefined") {
58525
+ return pool((size) => new Uint8Array(size), Uint8Array.prototype.subarray)(size);
58526
+ }
58527
+ else {
58528
+ return new Array(size);
58529
+ }
58530
+ }
58531
+ _push(fn, len, val) {
58532
+ this.tail = this.tail.next = new Op(fn, len, val);
58533
+ this.len += len;
58534
+ return this;
58535
+ }
58536
+ finish() {
58537
+ let head = this.head.next, pos = 0;
58538
+ const buf = BinaryWriter.alloc(this.len);
58539
+ while (head) {
58540
+ head.proceed(buf, pos);
58541
+ pos += head.len;
58542
+ head = head.next;
58543
+ }
58544
+ return buf;
58545
+ }
58546
+ fork() {
58547
+ this.states = new State(this);
58548
+ this.head = this.tail = new Op(null, 0, 0);
58549
+ this.len = 0;
58550
+ return this;
58551
+ }
58552
+ reset() {
58553
+ if (this.states) {
58554
+ this.head = this.states.head;
58555
+ this.tail = this.states.tail;
58556
+ this.len = this.states.len;
58557
+ this.states = this.states.next;
58558
+ }
58559
+ else {
58560
+ this.head = this.tail = new Op(null, 0, 0);
58561
+ this.len = 0;
58562
+ }
58563
+ return this;
58564
+ }
58565
+ ldelim() {
58566
+ const head = this.head, tail = this.tail, len = this.len;
58567
+ this.reset().uint32(len);
58568
+ if (len) {
58569
+ this.tail.next = head.next; // skip noop
58570
+ this.tail = tail;
58571
+ this.len += len;
58572
+ }
58573
+ return this;
58574
+ }
58575
+ tag(fieldNo, type) {
58576
+ return this.uint32(((fieldNo << 3) | type) >>> 0);
58577
+ }
58578
+ uint32(value) {
58579
+ this.len += (this.tail = this.tail.next =
58580
+ new Op(varint_1.writeVarint32, (value = value >>> 0) < 128 ? 1 : value < 16384 ? 2 : value < 2097152 ? 3 : value < 268435456 ? 4 : 5, value)).len;
58581
+ return this;
58582
+ }
58583
+ int32(value) {
58584
+ return value < 0
58585
+ ? this._push(varint_1.writeVarint64, 10, (0, varint_1.int64FromString)(value.toString())) // 10 bytes per spec
58586
+ : this.uint32(value);
58587
+ }
58588
+ sint32(value) {
58589
+ return this.uint32(((value << 1) ^ (value >> 31)) >>> 0);
58590
+ }
58591
+ int64(value) {
58592
+ const { lo, hi } = (0, varint_1.int64FromString)(value.toString());
58593
+ return this._push(varint_1.writeVarint64, (0, varint_1.int64Length)(lo, hi), { lo, hi });
58594
+ }
58595
+ sint64(value) {
58596
+ let { lo, hi } = (0, varint_1.int64FromString)(value.toString());
58597
+ // zig zag
58598
+ [lo, hi] = (0, varint_1.zzEncode)(lo, hi);
58599
+ return this._push(varint_1.writeVarint64, (0, varint_1.int64Length)(lo, hi), { lo, hi });
58600
+ }
58601
+ fixed64(value) {
58602
+ const { lo, hi } = (0, varint_1.int64FromString)(value.toString());
58603
+ return this._push(varint_1.writeFixed32, 4, lo)._push(varint_1.writeFixed32, 4, hi);
58604
+ }
58605
+ bool(value) {
58606
+ return this._push(varint_1.writeByte, 1, value ? 1 : 0);
58607
+ }
58608
+ fixed32(value) {
58609
+ return this._push(varint_1.writeFixed32, 4, value >>> 0);
58610
+ }
58611
+ float(value) {
58612
+ throw new Error("float not supported" + value);
58613
+ }
58614
+ double(value) {
58615
+ throw new Error("double not supported" + value);
58616
+ }
58617
+ bytes(value) {
58618
+ const len = value.length >>> 0;
58619
+ if (!len)
58620
+ return this._push(varint_1.writeByte, 1, 0);
58621
+ return this.uint32(len)._push(writeBytes, len, value);
58622
+ }
58623
+ string(value) {
58624
+ const len = (0, utf8_1.utf8Length)(value);
58625
+ return len ? this.uint32(len)._push(utf8_1.utf8Write, len, value) : this._push(varint_1.writeByte, 1, 0);
58626
+ }
58627
+ }
58628
+ binary.BinaryWriter = BinaryWriter;
58629
+ function writeBytes(val, buf, pos) {
58630
+ if (typeof Uint8Array !== "undefined") {
58631
+ buf.set(val, pos);
58632
+ }
58633
+ else {
58634
+ for (let i = 0; i < val.length; ++i)
58635
+ buf[pos + i] = val[i];
58636
+ }
58637
+ }
58638
+ function pool(alloc, slice, size) {
58639
+ const SIZE = 8192;
58640
+ const MAX = SIZE >>> 1;
58641
+ let slab = null;
58642
+ let offset = SIZE;
58643
+ return function pool_alloc(size) {
58644
+ if (size < 1 || size > MAX)
58645
+ return alloc(size);
58646
+ if (offset + size > SIZE) {
58647
+ slab = alloc(SIZE);
58648
+ offset = 0;
58649
+ }
58650
+ const buf = slice.call(slab, offset, (offset += size));
58651
+ if (offset & 7)
58652
+ // align to 32 bit
58653
+ offset = (offset | 7) + 1;
58654
+ return buf;
58655
+ };
58656
+ }
58657
+ function indexOutOfRange(reader, writeLength) {
58658
+ return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len);
58659
+ }
58660
+
58661
+ return binary;
58662
+ }
58663
+
58664
+ var helpers = {};
58665
+
58666
+ var hasRequiredHelpers;
58667
+
58668
+ function requireHelpers () {
58669
+ if (hasRequiredHelpers) return helpers;
58670
+ hasRequiredHelpers = 1;
58671
+ /* eslint-disable */
58672
+ /**
58673
+ * This file and any referenced files were automatically generated by @cosmology/telescope@1.0.7
58674
+ * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
58675
+ * and run the transpile command or yarn proto command to regenerate this bundle.
58676
+ */
58677
+ Object.defineProperty(helpers, "__esModule", { value: true });
58678
+ helpers.fromJsonTimestamp = helpers.fromTimestamp = helpers.toTimestamp = helpers.setPaginationParams = helpers.isObject = helpers.isSet = helpers.fromDuration = helpers.toDuration = helpers.omitDefault = helpers.base64FromBytes = helpers.bytesFromBase64 = void 0;
58679
+ var globalThis = (() => {
58680
+ if (typeof globalThis !== "undefined")
58681
+ return globalThis;
58682
+ if (typeof self !== "undefined")
58683
+ return self;
58684
+ if (typeof window !== "undefined")
58685
+ return window;
58686
+ if (typeof commonjsGlobal !== "undefined")
58687
+ return commonjsGlobal;
58688
+ throw "Unable to locate global object";
58689
+ })();
58690
+ const atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
58691
+ function bytesFromBase64(b64) {
58692
+ const bin = atob(b64);
58693
+ const arr = new Uint8Array(bin.length);
58694
+ for (let i = 0; i < bin.length; ++i) {
58695
+ arr[i] = bin.charCodeAt(i);
58696
+ }
58697
+ return arr;
58698
+ }
58699
+ helpers.bytesFromBase64 = bytesFromBase64;
58700
+ const btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
58701
+ function base64FromBytes(arr) {
58702
+ const bin = [];
58703
+ arr.forEach((byte) => {
58704
+ bin.push(String.fromCharCode(byte));
58705
+ });
58706
+ return btoa(bin.join(""));
58707
+ }
58708
+ helpers.base64FromBytes = base64FromBytes;
58709
+ function omitDefault(input) {
58710
+ if (typeof input === "string") {
58711
+ return input === "" ? undefined : input;
58712
+ }
58713
+ if (typeof input === "number") {
58714
+ return input === 0 ? undefined : input;
58715
+ }
58716
+ if (typeof input === "bigint") {
58717
+ return input === BigInt(0) ? undefined : input;
58718
+ }
58719
+ throw new Error(`Got unsupported type ${typeof input}`);
58720
+ }
58721
+ helpers.omitDefault = omitDefault;
58722
+ function toDuration(duration) {
58723
+ return {
58724
+ seconds: BigInt(Math.floor(parseInt(duration) / 1000000000)),
58725
+ nanos: parseInt(duration) % 1000000000,
58726
+ };
58727
+ }
58728
+ helpers.toDuration = toDuration;
58729
+ function fromDuration(duration) {
58730
+ return (parseInt(duration.seconds.toString()) * 1000000000 + duration.nanos).toString();
58731
+ }
58732
+ helpers.fromDuration = fromDuration;
58733
+ function isSet(value) {
58734
+ return value !== null && value !== undefined;
58735
+ }
58736
+ helpers.isSet = isSet;
58737
+ function isObject(value) {
58738
+ return typeof value === "object" && value !== null;
58739
+ }
58740
+ helpers.isObject = isObject;
58741
+ const setPaginationParams = (options, pagination) => {
58742
+ if (!pagination) {
58743
+ return options;
58744
+ }
58745
+ if (typeof pagination?.countTotal !== "undefined") {
58746
+ options.params["pagination.count_total"] = pagination.countTotal;
58747
+ }
58748
+ if (typeof pagination?.key !== "undefined") {
58749
+ // String to Uint8Array
58750
+ // let uint8arr = new Uint8Array(Buffer.from(data,'base64'));
58751
+ // Uint8Array to String
58752
+ options.params["pagination.key"] = Buffer.from(pagination.key).toString("base64");
58753
+ }
58754
+ if (typeof pagination?.limit !== "undefined") {
58755
+ options.params["pagination.limit"] = pagination.limit.toString();
58756
+ }
58757
+ if (typeof pagination?.offset !== "undefined") {
58758
+ options.params["pagination.offset"] = pagination.offset.toString();
58759
+ }
58760
+ if (typeof pagination?.reverse !== "undefined") {
58761
+ options.params["pagination.reverse"] = pagination.reverse;
58762
+ }
58763
+ return options;
58764
+ };
58765
+ helpers.setPaginationParams = setPaginationParams;
58766
+ function toTimestamp(date) {
58767
+ const seconds = numberToLong(date.getTime() / 1000);
58768
+ const nanos = (date.getTime() % 1000) * 1000000;
58769
+ return {
58770
+ seconds,
58771
+ nanos,
58772
+ };
58773
+ }
58774
+ helpers.toTimestamp = toTimestamp;
58775
+ function fromTimestamp(t) {
58776
+ let millis = Number(t.seconds) * 1000;
58777
+ millis += t.nanos / 1000000;
58778
+ return new Date(millis);
58779
+ }
58780
+ helpers.fromTimestamp = fromTimestamp;
58781
+ const timestampFromJSON = (object) => {
58782
+ return {
58783
+ seconds: isSet(object.seconds) ? BigInt(object.seconds.toString()) : BigInt(0),
58784
+ nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
58785
+ };
58786
+ };
58787
+ function fromJsonTimestamp(o) {
58788
+ if (o instanceof Date) {
58789
+ return toTimestamp(o);
58790
+ }
58791
+ else if (typeof o === "string") {
58792
+ return toTimestamp(new Date(o));
58793
+ }
58794
+ else {
58795
+ return timestampFromJSON(o);
58796
+ }
58797
+ }
58798
+ helpers.fromJsonTimestamp = fromJsonTimestamp;
58799
+ function numberToLong(number) {
58800
+ return BigInt(Math.trunc(number));
58801
+ }
58802
+
58803
+ return helpers;
58804
+ }
58805
+
58806
+ var hasRequiredAny;
58807
+
58808
+ function requireAny () {
58809
+ if (hasRequiredAny) return any;
58810
+ hasRequiredAny = 1;
58811
+ Object.defineProperty(any, "__esModule", { value: true });
58812
+ any.Any = any.protobufPackage = void 0;
58813
+ /* eslint-disable */
58814
+ const binary_1 = requireBinary();
58815
+ const helpers_1 = requireHelpers();
58816
+ any.protobufPackage = "google.protobuf";
58817
+ function createBaseAny() {
58818
+ return {
58819
+ typeUrl: "",
58820
+ value: new Uint8Array(),
58821
+ };
58822
+ }
58823
+ any.Any = {
58824
+ typeUrl: "/google.protobuf.Any",
58825
+ encode(message, writer = binary_1.BinaryWriter.create()) {
58826
+ if (message.typeUrl !== "") {
58827
+ writer.uint32(10).string(message.typeUrl);
58828
+ }
58829
+ if (message.value.length !== 0) {
58830
+ writer.uint32(18).bytes(message.value);
58831
+ }
58832
+ return writer;
58833
+ },
58834
+ decode(input, length) {
58835
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
58836
+ let end = length === undefined ? reader.len : reader.pos + length;
58837
+ const message = createBaseAny();
58838
+ while (reader.pos < end) {
58839
+ const tag = reader.uint32();
58840
+ switch (tag >>> 3) {
58841
+ case 1:
58842
+ message.typeUrl = reader.string();
58843
+ break;
58844
+ case 2:
58845
+ message.value = reader.bytes();
58846
+ break;
58847
+ default:
58848
+ reader.skipType(tag & 7);
58849
+ break;
58850
+ }
58851
+ }
58852
+ return message;
58853
+ },
58854
+ fromJSON(object) {
58855
+ const obj = createBaseAny();
58856
+ if ((0, helpers_1.isSet)(object.typeUrl))
58857
+ obj.typeUrl = String(object.typeUrl);
58858
+ if ((0, helpers_1.isSet)(object.value))
58859
+ obj.value = (0, helpers_1.bytesFromBase64)(object.value);
58860
+ return obj;
58861
+ },
58862
+ toJSON(message) {
58863
+ const obj = {};
58864
+ message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl);
58865
+ message.value !== undefined &&
58866
+ (obj.value = (0, helpers_1.base64FromBytes)(message.value !== undefined ? message.value : new Uint8Array()));
58867
+ return obj;
58868
+ },
58869
+ fromPartial(object) {
58870
+ const message = createBaseAny();
58871
+ message.typeUrl = object.typeUrl ?? "";
58872
+ message.value = object.value ?? new Uint8Array();
58873
+ return message;
58874
+ },
58875
+ };
58876
+
58877
+ return any;
58878
+ }
58879
+
58880
+ var signing = {};
58881
+
58882
+ var multisig = {};
58883
+
58884
+ var hasRequiredMultisig;
58885
+
58886
+ function requireMultisig () {
58887
+ if (hasRequiredMultisig) return multisig;
58888
+ hasRequiredMultisig = 1;
58889
+ Object.defineProperty(multisig, "__esModule", { value: true });
58890
+ multisig.CompactBitArray = multisig.MultiSignature = multisig.protobufPackage = void 0;
58891
+ /* eslint-disable */
58892
+ const binary_1 = requireBinary();
58893
+ const helpers_1 = requireHelpers();
58894
+ multisig.protobufPackage = "cosmos.crypto.multisig.v1beta1";
58895
+ function createBaseMultiSignature() {
58896
+ return {
58897
+ signatures: [],
58898
+ };
58899
+ }
58900
+ multisig.MultiSignature = {
58901
+ typeUrl: "/cosmos.crypto.multisig.v1beta1.MultiSignature",
58902
+ encode(message, writer = binary_1.BinaryWriter.create()) {
58903
+ for (const v of message.signatures) {
58904
+ writer.uint32(10).bytes(v);
58905
+ }
58906
+ return writer;
58907
+ },
58908
+ decode(input, length) {
58909
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
58910
+ let end = length === undefined ? reader.len : reader.pos + length;
58911
+ const message = createBaseMultiSignature();
58912
+ while (reader.pos < end) {
58913
+ const tag = reader.uint32();
58914
+ switch (tag >>> 3) {
58915
+ case 1:
58916
+ message.signatures.push(reader.bytes());
58917
+ break;
58918
+ default:
58919
+ reader.skipType(tag & 7);
58920
+ break;
58921
+ }
58922
+ }
58923
+ return message;
58924
+ },
58925
+ fromJSON(object) {
58926
+ const obj = createBaseMultiSignature();
58927
+ if (Array.isArray(object?.signatures))
58928
+ obj.signatures = object.signatures.map((e) => (0, helpers_1.bytesFromBase64)(e));
58929
+ return obj;
58930
+ },
58931
+ toJSON(message) {
58932
+ const obj = {};
58933
+ if (message.signatures) {
58934
+ obj.signatures = message.signatures.map((e) => (0, helpers_1.base64FromBytes)(e !== undefined ? e : new Uint8Array()));
58935
+ }
58936
+ else {
58937
+ obj.signatures = [];
58938
+ }
58939
+ return obj;
58940
+ },
58941
+ fromPartial(object) {
58942
+ const message = createBaseMultiSignature();
58943
+ message.signatures = object.signatures?.map((e) => e) || [];
58944
+ return message;
58945
+ },
58946
+ };
58947
+ function createBaseCompactBitArray() {
58948
+ return {
58949
+ extraBitsStored: 0,
58950
+ elems: new Uint8Array(),
58951
+ };
58952
+ }
58953
+ multisig.CompactBitArray = {
58954
+ typeUrl: "/cosmos.crypto.multisig.v1beta1.CompactBitArray",
58955
+ encode(message, writer = binary_1.BinaryWriter.create()) {
58956
+ if (message.extraBitsStored !== 0) {
58957
+ writer.uint32(8).uint32(message.extraBitsStored);
58958
+ }
58959
+ if (message.elems.length !== 0) {
58960
+ writer.uint32(18).bytes(message.elems);
58961
+ }
58962
+ return writer;
58963
+ },
58964
+ decode(input, length) {
58965
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
58966
+ let end = length === undefined ? reader.len : reader.pos + length;
58967
+ const message = createBaseCompactBitArray();
58968
+ while (reader.pos < end) {
58969
+ const tag = reader.uint32();
58970
+ switch (tag >>> 3) {
58971
+ case 1:
58972
+ message.extraBitsStored = reader.uint32();
58973
+ break;
58974
+ case 2:
58975
+ message.elems = reader.bytes();
58976
+ break;
58977
+ default:
58978
+ reader.skipType(tag & 7);
58979
+ break;
58980
+ }
58981
+ }
58982
+ return message;
58983
+ },
58984
+ fromJSON(object) {
58985
+ const obj = createBaseCompactBitArray();
58986
+ if ((0, helpers_1.isSet)(object.extraBitsStored))
58987
+ obj.extraBitsStored = Number(object.extraBitsStored);
58988
+ if ((0, helpers_1.isSet)(object.elems))
58989
+ obj.elems = (0, helpers_1.bytesFromBase64)(object.elems);
58990
+ return obj;
58991
+ },
58992
+ toJSON(message) {
58993
+ const obj = {};
58994
+ message.extraBitsStored !== undefined && (obj.extraBitsStored = Math.round(message.extraBitsStored));
58995
+ message.elems !== undefined &&
58996
+ (obj.elems = (0, helpers_1.base64FromBytes)(message.elems !== undefined ? message.elems : new Uint8Array()));
58997
+ return obj;
58998
+ },
58999
+ fromPartial(object) {
59000
+ const message = createBaseCompactBitArray();
59001
+ message.extraBitsStored = object.extraBitsStored ?? 0;
59002
+ message.elems = object.elems ?? new Uint8Array();
59003
+ return message;
59004
+ },
59005
+ };
59006
+
59007
+ return multisig;
59008
+ }
59009
+
59010
+ var hasRequiredSigning;
59011
+
59012
+ function requireSigning () {
59013
+ if (hasRequiredSigning) return signing;
59014
+ hasRequiredSigning = 1;
59015
+ (function (exports$1) {
59016
+ Object.defineProperty(exports$1, "__esModule", { value: true });
59017
+ exports$1.SignatureDescriptor_Data_Multi = exports$1.SignatureDescriptor_Data_Single = exports$1.SignatureDescriptor_Data = exports$1.SignatureDescriptor = exports$1.SignatureDescriptors = exports$1.signModeToJSON = exports$1.signModeFromJSON = exports$1.SignMode = exports$1.protobufPackage = void 0;
59018
+ /* eslint-disable */
59019
+ const multisig_1 = requireMultisig();
59020
+ const any_1 = requireAny();
59021
+ const binary_1 = requireBinary();
59022
+ const helpers_1 = requireHelpers();
59023
+ exports$1.protobufPackage = "cosmos.tx.signing.v1beta1";
59024
+ /**
59025
+ * SignMode represents a signing mode with its own security guarantees.
59026
+ *
59027
+ * This enum should be considered a registry of all known sign modes
59028
+ * in the Cosmos ecosystem. Apps are not expected to support all known
59029
+ * sign modes. Apps that would like to support custom sign modes are
59030
+ * encouraged to open a small PR against this file to add a new case
59031
+ * to this SignMode enum describing their sign mode so that different
59032
+ * apps have a consistent version of this enum.
59033
+ */
59034
+ var SignMode;
59035
+ (function (SignMode) {
59036
+ /**
59037
+ * SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be
59038
+ * rejected.
59039
+ */
59040
+ SignMode[SignMode["SIGN_MODE_UNSPECIFIED"] = 0] = "SIGN_MODE_UNSPECIFIED";
59041
+ /**
59042
+ * SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is
59043
+ * verified with raw bytes from Tx.
59044
+ */
59045
+ SignMode[SignMode["SIGN_MODE_DIRECT"] = 1] = "SIGN_MODE_DIRECT";
59046
+ /**
59047
+ * SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some
59048
+ * human-readable textual representation on top of the binary representation
59049
+ * from SIGN_MODE_DIRECT. It is currently not supported.
59050
+ */
59051
+ SignMode[SignMode["SIGN_MODE_TEXTUAL"] = 2] = "SIGN_MODE_TEXTUAL";
59052
+ /**
59053
+ * SIGN_MODE_DIRECT_AUX - SIGN_MODE_DIRECT_AUX specifies a signing mode which uses
59054
+ * SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not
59055
+ * require signers signing over other signers' `signer_info`. It also allows
59056
+ * for adding Tips in transactions.
59057
+ *
59058
+ * Since: cosmos-sdk 0.46
59059
+ */
59060
+ SignMode[SignMode["SIGN_MODE_DIRECT_AUX"] = 3] = "SIGN_MODE_DIRECT_AUX";
59061
+ /**
59062
+ * SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
59063
+ * Amino JSON and will be removed in the future.
59064
+ */
59065
+ SignMode[SignMode["SIGN_MODE_LEGACY_AMINO_JSON"] = 127] = "SIGN_MODE_LEGACY_AMINO_JSON";
59066
+ /**
59067
+ * SIGN_MODE_EIP_191 - SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos
59068
+ * SDK. Ref: https://eips.ethereum.org/EIPS/eip-191
59069
+ *
59070
+ * Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant,
59071
+ * but is not implemented on the SDK by default. To enable EIP-191, you need
59072
+ * to pass a custom `TxConfig` that has an implementation of
59073
+ * `SignModeHandler` for EIP-191. The SDK may decide to fully support
59074
+ * EIP-191 in the future.
59075
+ *
59076
+ * Since: cosmos-sdk 0.45.2
59077
+ */
59078
+ SignMode[SignMode["SIGN_MODE_EIP_191"] = 191] = "SIGN_MODE_EIP_191";
59079
+ SignMode[SignMode["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
59080
+ })(SignMode || (exports$1.SignMode = SignMode = {}));
59081
+ function signModeFromJSON(object) {
59082
+ switch (object) {
59083
+ case 0:
59084
+ case "SIGN_MODE_UNSPECIFIED":
59085
+ return SignMode.SIGN_MODE_UNSPECIFIED;
59086
+ case 1:
59087
+ case "SIGN_MODE_DIRECT":
59088
+ return SignMode.SIGN_MODE_DIRECT;
59089
+ case 2:
59090
+ case "SIGN_MODE_TEXTUAL":
59091
+ return SignMode.SIGN_MODE_TEXTUAL;
59092
+ case 3:
59093
+ case "SIGN_MODE_DIRECT_AUX":
59094
+ return SignMode.SIGN_MODE_DIRECT_AUX;
59095
+ case 127:
59096
+ case "SIGN_MODE_LEGACY_AMINO_JSON":
59097
+ return SignMode.SIGN_MODE_LEGACY_AMINO_JSON;
59098
+ case 191:
59099
+ case "SIGN_MODE_EIP_191":
59100
+ return SignMode.SIGN_MODE_EIP_191;
59101
+ case -1:
59102
+ case "UNRECOGNIZED":
59103
+ default:
59104
+ return SignMode.UNRECOGNIZED;
59105
+ }
59106
+ }
59107
+ exports$1.signModeFromJSON = signModeFromJSON;
59108
+ function signModeToJSON(object) {
59109
+ switch (object) {
59110
+ case SignMode.SIGN_MODE_UNSPECIFIED:
59111
+ return "SIGN_MODE_UNSPECIFIED";
59112
+ case SignMode.SIGN_MODE_DIRECT:
59113
+ return "SIGN_MODE_DIRECT";
59114
+ case SignMode.SIGN_MODE_TEXTUAL:
59115
+ return "SIGN_MODE_TEXTUAL";
59116
+ case SignMode.SIGN_MODE_DIRECT_AUX:
59117
+ return "SIGN_MODE_DIRECT_AUX";
59118
+ case SignMode.SIGN_MODE_LEGACY_AMINO_JSON:
59119
+ return "SIGN_MODE_LEGACY_AMINO_JSON";
59120
+ case SignMode.SIGN_MODE_EIP_191:
59121
+ return "SIGN_MODE_EIP_191";
59122
+ case SignMode.UNRECOGNIZED:
59123
+ default:
59124
+ return "UNRECOGNIZED";
59125
+ }
59126
+ }
59127
+ exports$1.signModeToJSON = signModeToJSON;
59128
+ function createBaseSignatureDescriptors() {
59129
+ return {
59130
+ signatures: [],
59131
+ };
59132
+ }
59133
+ exports$1.SignatureDescriptors = {
59134
+ typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptors",
59135
+ encode(message, writer = binary_1.BinaryWriter.create()) {
59136
+ for (const v of message.signatures) {
59137
+ exports$1.SignatureDescriptor.encode(v, writer.uint32(10).fork()).ldelim();
59138
+ }
59139
+ return writer;
59140
+ },
59141
+ decode(input, length) {
59142
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
59143
+ let end = length === undefined ? reader.len : reader.pos + length;
59144
+ const message = createBaseSignatureDescriptors();
59145
+ while (reader.pos < end) {
59146
+ const tag = reader.uint32();
59147
+ switch (tag >>> 3) {
59148
+ case 1:
59149
+ message.signatures.push(exports$1.SignatureDescriptor.decode(reader, reader.uint32()));
59150
+ break;
59151
+ default:
59152
+ reader.skipType(tag & 7);
59153
+ break;
59154
+ }
59155
+ }
59156
+ return message;
59157
+ },
59158
+ fromJSON(object) {
59159
+ const obj = createBaseSignatureDescriptors();
59160
+ if (Array.isArray(object?.signatures))
59161
+ obj.signatures = object.signatures.map((e) => exports$1.SignatureDescriptor.fromJSON(e));
59162
+ return obj;
59163
+ },
59164
+ toJSON(message) {
59165
+ const obj = {};
59166
+ if (message.signatures) {
59167
+ obj.signatures = message.signatures.map((e) => (e ? exports$1.SignatureDescriptor.toJSON(e) : undefined));
59168
+ }
59169
+ else {
59170
+ obj.signatures = [];
59171
+ }
59172
+ return obj;
59173
+ },
59174
+ fromPartial(object) {
59175
+ const message = createBaseSignatureDescriptors();
59176
+ message.signatures = object.signatures?.map((e) => exports$1.SignatureDescriptor.fromPartial(e)) || [];
59177
+ return message;
59178
+ },
59179
+ };
59180
+ function createBaseSignatureDescriptor() {
59181
+ return {
59182
+ publicKey: undefined,
59183
+ data: undefined,
59184
+ sequence: BigInt(0),
59185
+ };
59186
+ }
59187
+ exports$1.SignatureDescriptor = {
59188
+ typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor",
59189
+ encode(message, writer = binary_1.BinaryWriter.create()) {
59190
+ if (message.publicKey !== undefined) {
59191
+ any_1.Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim();
59192
+ }
59193
+ if (message.data !== undefined) {
59194
+ exports$1.SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim();
59195
+ }
59196
+ if (message.sequence !== BigInt(0)) {
59197
+ writer.uint32(24).uint64(message.sequence);
59198
+ }
59199
+ return writer;
59200
+ },
59201
+ decode(input, length) {
59202
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
59203
+ let end = length === undefined ? reader.len : reader.pos + length;
59204
+ const message = createBaseSignatureDescriptor();
59205
+ while (reader.pos < end) {
59206
+ const tag = reader.uint32();
59207
+ switch (tag >>> 3) {
59208
+ case 1:
59209
+ message.publicKey = any_1.Any.decode(reader, reader.uint32());
59210
+ break;
59211
+ case 2:
59212
+ message.data = exports$1.SignatureDescriptor_Data.decode(reader, reader.uint32());
59213
+ break;
59214
+ case 3:
59215
+ message.sequence = reader.uint64();
59216
+ break;
59217
+ default:
59218
+ reader.skipType(tag & 7);
59219
+ break;
59220
+ }
59221
+ }
59222
+ return message;
59223
+ },
59224
+ fromJSON(object) {
59225
+ const obj = createBaseSignatureDescriptor();
59226
+ if ((0, helpers_1.isSet)(object.publicKey))
59227
+ obj.publicKey = any_1.Any.fromJSON(object.publicKey);
59228
+ if ((0, helpers_1.isSet)(object.data))
59229
+ obj.data = exports$1.SignatureDescriptor_Data.fromJSON(object.data);
59230
+ if ((0, helpers_1.isSet)(object.sequence))
59231
+ obj.sequence = BigInt(object.sequence.toString());
59232
+ return obj;
59233
+ },
59234
+ toJSON(message) {
59235
+ const obj = {};
59236
+ message.publicKey !== undefined &&
59237
+ (obj.publicKey = message.publicKey ? any_1.Any.toJSON(message.publicKey) : undefined);
59238
+ message.data !== undefined &&
59239
+ (obj.data = message.data ? exports$1.SignatureDescriptor_Data.toJSON(message.data) : undefined);
59240
+ message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString());
59241
+ return obj;
59242
+ },
59243
+ fromPartial(object) {
59244
+ const message = createBaseSignatureDescriptor();
59245
+ if (object.publicKey !== undefined && object.publicKey !== null) {
59246
+ message.publicKey = any_1.Any.fromPartial(object.publicKey);
59247
+ }
59248
+ if (object.data !== undefined && object.data !== null) {
59249
+ message.data = exports$1.SignatureDescriptor_Data.fromPartial(object.data);
59250
+ }
59251
+ if (object.sequence !== undefined && object.sequence !== null) {
59252
+ message.sequence = BigInt(object.sequence.toString());
59253
+ }
59254
+ return message;
59255
+ },
59256
+ };
59257
+ function createBaseSignatureDescriptor_Data() {
59258
+ return {
59259
+ single: undefined,
59260
+ multi: undefined,
59261
+ };
59262
+ }
59263
+ exports$1.SignatureDescriptor_Data = {
59264
+ typeUrl: "/cosmos.tx.signing.v1beta1.Data",
59265
+ encode(message, writer = binary_1.BinaryWriter.create()) {
59266
+ if (message.single !== undefined) {
59267
+ exports$1.SignatureDescriptor_Data_Single.encode(message.single, writer.uint32(10).fork()).ldelim();
59268
+ }
59269
+ if (message.multi !== undefined) {
59270
+ exports$1.SignatureDescriptor_Data_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim();
59271
+ }
59272
+ return writer;
59273
+ },
59274
+ decode(input, length) {
59275
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
59276
+ let end = length === undefined ? reader.len : reader.pos + length;
59277
+ const message = createBaseSignatureDescriptor_Data();
59278
+ while (reader.pos < end) {
59279
+ const tag = reader.uint32();
59280
+ switch (tag >>> 3) {
59281
+ case 1:
59282
+ message.single = exports$1.SignatureDescriptor_Data_Single.decode(reader, reader.uint32());
59283
+ break;
59284
+ case 2:
59285
+ message.multi = exports$1.SignatureDescriptor_Data_Multi.decode(reader, reader.uint32());
59286
+ break;
59287
+ default:
59288
+ reader.skipType(tag & 7);
59289
+ break;
59290
+ }
59291
+ }
59292
+ return message;
59293
+ },
59294
+ fromJSON(object) {
59295
+ const obj = createBaseSignatureDescriptor_Data();
59296
+ if ((0, helpers_1.isSet)(object.single))
59297
+ obj.single = exports$1.SignatureDescriptor_Data_Single.fromJSON(object.single);
59298
+ if ((0, helpers_1.isSet)(object.multi))
59299
+ obj.multi = exports$1.SignatureDescriptor_Data_Multi.fromJSON(object.multi);
59300
+ return obj;
59301
+ },
59302
+ toJSON(message) {
59303
+ const obj = {};
59304
+ message.single !== undefined &&
59305
+ (obj.single = message.single ? exports$1.SignatureDescriptor_Data_Single.toJSON(message.single) : undefined);
59306
+ message.multi !== undefined &&
59307
+ (obj.multi = message.multi ? exports$1.SignatureDescriptor_Data_Multi.toJSON(message.multi) : undefined);
59308
+ return obj;
59309
+ },
59310
+ fromPartial(object) {
59311
+ const message = createBaseSignatureDescriptor_Data();
59312
+ if (object.single !== undefined && object.single !== null) {
59313
+ message.single = exports$1.SignatureDescriptor_Data_Single.fromPartial(object.single);
59314
+ }
59315
+ if (object.multi !== undefined && object.multi !== null) {
59316
+ message.multi = exports$1.SignatureDescriptor_Data_Multi.fromPartial(object.multi);
59317
+ }
59318
+ return message;
59319
+ },
59320
+ };
59321
+ function createBaseSignatureDescriptor_Data_Single() {
59322
+ return {
59323
+ mode: 0,
59324
+ signature: new Uint8Array(),
59325
+ };
59326
+ }
59327
+ exports$1.SignatureDescriptor_Data_Single = {
59328
+ typeUrl: "/cosmos.tx.signing.v1beta1.Single",
59329
+ encode(message, writer = binary_1.BinaryWriter.create()) {
59330
+ if (message.mode !== 0) {
59331
+ writer.uint32(8).int32(message.mode);
59332
+ }
59333
+ if (message.signature.length !== 0) {
59334
+ writer.uint32(18).bytes(message.signature);
59335
+ }
59336
+ return writer;
59337
+ },
59338
+ decode(input, length) {
59339
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
59340
+ let end = length === undefined ? reader.len : reader.pos + length;
59341
+ const message = createBaseSignatureDescriptor_Data_Single();
59342
+ while (reader.pos < end) {
59343
+ const tag = reader.uint32();
59344
+ switch (tag >>> 3) {
59345
+ case 1:
59346
+ message.mode = reader.int32();
59347
+ break;
59348
+ case 2:
59349
+ message.signature = reader.bytes();
59350
+ break;
59351
+ default:
59352
+ reader.skipType(tag & 7);
59353
+ break;
59354
+ }
59355
+ }
59356
+ return message;
59357
+ },
59358
+ fromJSON(object) {
59359
+ const obj = createBaseSignatureDescriptor_Data_Single();
59360
+ if ((0, helpers_1.isSet)(object.mode))
59361
+ obj.mode = signModeFromJSON(object.mode);
59362
+ if ((0, helpers_1.isSet)(object.signature))
59363
+ obj.signature = (0, helpers_1.bytesFromBase64)(object.signature);
59364
+ return obj;
59365
+ },
59366
+ toJSON(message) {
59367
+ const obj = {};
59368
+ message.mode !== undefined && (obj.mode = signModeToJSON(message.mode));
59369
+ message.signature !== undefined &&
59370
+ (obj.signature = (0, helpers_1.base64FromBytes)(message.signature !== undefined ? message.signature : new Uint8Array()));
59371
+ return obj;
59372
+ },
59373
+ fromPartial(object) {
59374
+ const message = createBaseSignatureDescriptor_Data_Single();
59375
+ message.mode = object.mode ?? 0;
59376
+ message.signature = object.signature ?? new Uint8Array();
59377
+ return message;
59378
+ },
59379
+ };
59380
+ function createBaseSignatureDescriptor_Data_Multi() {
59381
+ return {
59382
+ bitarray: undefined,
59383
+ signatures: [],
59384
+ };
59385
+ }
59386
+ exports$1.SignatureDescriptor_Data_Multi = {
59387
+ typeUrl: "/cosmos.tx.signing.v1beta1.Multi",
59388
+ encode(message, writer = binary_1.BinaryWriter.create()) {
59389
+ if (message.bitarray !== undefined) {
59390
+ multisig_1.CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim();
59391
+ }
59392
+ for (const v of message.signatures) {
59393
+ exports$1.SignatureDescriptor_Data.encode(v, writer.uint32(18).fork()).ldelim();
59394
+ }
59395
+ return writer;
59396
+ },
59397
+ decode(input, length) {
59398
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
59399
+ let end = length === undefined ? reader.len : reader.pos + length;
59400
+ const message = createBaseSignatureDescriptor_Data_Multi();
59401
+ while (reader.pos < end) {
59402
+ const tag = reader.uint32();
59403
+ switch (tag >>> 3) {
59404
+ case 1:
59405
+ message.bitarray = multisig_1.CompactBitArray.decode(reader, reader.uint32());
59406
+ break;
59407
+ case 2:
59408
+ message.signatures.push(exports$1.SignatureDescriptor_Data.decode(reader, reader.uint32()));
59409
+ break;
59410
+ default:
59411
+ reader.skipType(tag & 7);
59412
+ break;
59413
+ }
59414
+ }
59415
+ return message;
59416
+ },
59417
+ fromJSON(object) {
59418
+ const obj = createBaseSignatureDescriptor_Data_Multi();
59419
+ if ((0, helpers_1.isSet)(object.bitarray))
59420
+ obj.bitarray = multisig_1.CompactBitArray.fromJSON(object.bitarray);
59421
+ if (Array.isArray(object?.signatures))
59422
+ obj.signatures = object.signatures.map((e) => exports$1.SignatureDescriptor_Data.fromJSON(e));
59423
+ return obj;
59424
+ },
59425
+ toJSON(message) {
59426
+ const obj = {};
59427
+ message.bitarray !== undefined &&
59428
+ (obj.bitarray = message.bitarray ? multisig_1.CompactBitArray.toJSON(message.bitarray) : undefined);
59429
+ if (message.signatures) {
59430
+ obj.signatures = message.signatures.map((e) => (e ? exports$1.SignatureDescriptor_Data.toJSON(e) : undefined));
59431
+ }
59432
+ else {
59433
+ obj.signatures = [];
59434
+ }
59435
+ return obj;
59436
+ },
59437
+ fromPartial(object) {
59438
+ const message = createBaseSignatureDescriptor_Data_Multi();
59439
+ if (object.bitarray !== undefined && object.bitarray !== null) {
59440
+ message.bitarray = multisig_1.CompactBitArray.fromPartial(object.bitarray);
59441
+ }
59442
+ message.signatures = object.signatures?.map((e) => exports$1.SignatureDescriptor_Data.fromPartial(e)) || [];
59443
+ return message;
59444
+ },
59445
+ };
59446
+
59447
+ } (signing));
59448
+ return signing;
59449
+ }
59450
+
59451
+ var coin = {};
59452
+
59453
+ var hasRequiredCoin;
59454
+
59455
+ function requireCoin () {
59456
+ if (hasRequiredCoin) return coin;
59457
+ hasRequiredCoin = 1;
59458
+ Object.defineProperty(coin, "__esModule", { value: true });
59459
+ coin.DecProto = coin.IntProto = coin.DecCoin = coin.Coin = coin.protobufPackage = void 0;
59460
+ /* eslint-disable */
59461
+ const binary_1 = requireBinary();
59462
+ const helpers_1 = requireHelpers();
59463
+ coin.protobufPackage = "cosmos.base.v1beta1";
59464
+ function createBaseCoin() {
59465
+ return {
59466
+ denom: "",
59467
+ amount: "",
59468
+ };
59469
+ }
59470
+ coin.Coin = {
59471
+ typeUrl: "/cosmos.base.v1beta1.Coin",
59472
+ encode(message, writer = binary_1.BinaryWriter.create()) {
59473
+ if (message.denom !== "") {
59474
+ writer.uint32(10).string(message.denom);
59475
+ }
59476
+ if (message.amount !== "") {
59477
+ writer.uint32(18).string(message.amount);
59478
+ }
59479
+ return writer;
59480
+ },
59481
+ decode(input, length) {
59482
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
59483
+ let end = length === undefined ? reader.len : reader.pos + length;
59484
+ const message = createBaseCoin();
59485
+ while (reader.pos < end) {
59486
+ const tag = reader.uint32();
59487
+ switch (tag >>> 3) {
59488
+ case 1:
59489
+ message.denom = reader.string();
59490
+ break;
59491
+ case 2:
59492
+ message.amount = reader.string();
59493
+ break;
59494
+ default:
59495
+ reader.skipType(tag & 7);
59496
+ break;
59497
+ }
59498
+ }
59499
+ return message;
59500
+ },
59501
+ fromJSON(object) {
59502
+ const obj = createBaseCoin();
59503
+ if ((0, helpers_1.isSet)(object.denom))
59504
+ obj.denom = String(object.denom);
59505
+ if ((0, helpers_1.isSet)(object.amount))
59506
+ obj.amount = String(object.amount);
59507
+ return obj;
59508
+ },
59509
+ toJSON(message) {
59510
+ const obj = {};
59511
+ message.denom !== undefined && (obj.denom = message.denom);
59512
+ message.amount !== undefined && (obj.amount = message.amount);
59513
+ return obj;
59514
+ },
59515
+ fromPartial(object) {
59516
+ const message = createBaseCoin();
59517
+ message.denom = object.denom ?? "";
59518
+ message.amount = object.amount ?? "";
59519
+ return message;
59520
+ },
59521
+ };
59522
+ function createBaseDecCoin() {
59523
+ return {
59524
+ denom: "",
59525
+ amount: "",
59526
+ };
59527
+ }
59528
+ coin.DecCoin = {
59529
+ typeUrl: "/cosmos.base.v1beta1.DecCoin",
59530
+ encode(message, writer = binary_1.BinaryWriter.create()) {
59531
+ if (message.denom !== "") {
59532
+ writer.uint32(10).string(message.denom);
59533
+ }
59534
+ if (message.amount !== "") {
59535
+ writer.uint32(18).string(message.amount);
59536
+ }
59537
+ return writer;
59538
+ },
59539
+ decode(input, length) {
59540
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
59541
+ let end = length === undefined ? reader.len : reader.pos + length;
59542
+ const message = createBaseDecCoin();
59543
+ while (reader.pos < end) {
59544
+ const tag = reader.uint32();
59545
+ switch (tag >>> 3) {
59546
+ case 1:
59547
+ message.denom = reader.string();
59548
+ break;
59549
+ case 2:
59550
+ message.amount = reader.string();
59551
+ break;
59552
+ default:
59553
+ reader.skipType(tag & 7);
59554
+ break;
59555
+ }
59556
+ }
59557
+ return message;
59558
+ },
59559
+ fromJSON(object) {
59560
+ const obj = createBaseDecCoin();
59561
+ if ((0, helpers_1.isSet)(object.denom))
59562
+ obj.denom = String(object.denom);
59563
+ if ((0, helpers_1.isSet)(object.amount))
59564
+ obj.amount = String(object.amount);
59565
+ return obj;
59566
+ },
59567
+ toJSON(message) {
59568
+ const obj = {};
59569
+ message.denom !== undefined && (obj.denom = message.denom);
59570
+ message.amount !== undefined && (obj.amount = message.amount);
59571
+ return obj;
59572
+ },
59573
+ fromPartial(object) {
59574
+ const message = createBaseDecCoin();
59575
+ message.denom = object.denom ?? "";
59576
+ message.amount = object.amount ?? "";
59577
+ return message;
59578
+ },
59579
+ };
59580
+ function createBaseIntProto() {
59581
+ return {
59582
+ int: "",
59583
+ };
59584
+ }
59585
+ coin.IntProto = {
59586
+ typeUrl: "/cosmos.base.v1beta1.IntProto",
59587
+ encode(message, writer = binary_1.BinaryWriter.create()) {
59588
+ if (message.int !== "") {
59589
+ writer.uint32(10).string(message.int);
59590
+ }
59591
+ return writer;
59592
+ },
59593
+ decode(input, length) {
59594
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
59595
+ let end = length === undefined ? reader.len : reader.pos + length;
59596
+ const message = createBaseIntProto();
59597
+ while (reader.pos < end) {
59598
+ const tag = reader.uint32();
59599
+ switch (tag >>> 3) {
59600
+ case 1:
59601
+ message.int = reader.string();
59602
+ break;
59603
+ default:
59604
+ reader.skipType(tag & 7);
59605
+ break;
59606
+ }
59607
+ }
59608
+ return message;
59609
+ },
59610
+ fromJSON(object) {
59611
+ const obj = createBaseIntProto();
59612
+ if ((0, helpers_1.isSet)(object.int))
59613
+ obj.int = String(object.int);
59614
+ return obj;
59615
+ },
59616
+ toJSON(message) {
59617
+ const obj = {};
59618
+ message.int !== undefined && (obj.int = message.int);
59619
+ return obj;
59620
+ },
59621
+ fromPartial(object) {
59622
+ const message = createBaseIntProto();
59623
+ message.int = object.int ?? "";
59624
+ return message;
59625
+ },
59626
+ };
59627
+ function createBaseDecProto() {
59628
+ return {
59629
+ dec: "",
59630
+ };
59631
+ }
59632
+ coin.DecProto = {
59633
+ typeUrl: "/cosmos.base.v1beta1.DecProto",
59634
+ encode(message, writer = binary_1.BinaryWriter.create()) {
59635
+ if (message.dec !== "") {
59636
+ writer.uint32(10).string(message.dec);
59637
+ }
59638
+ return writer;
59639
+ },
59640
+ decode(input, length) {
59641
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
59642
+ let end = length === undefined ? reader.len : reader.pos + length;
59643
+ const message = createBaseDecProto();
59644
+ while (reader.pos < end) {
59645
+ const tag = reader.uint32();
59646
+ switch (tag >>> 3) {
59647
+ case 1:
59648
+ message.dec = reader.string();
59649
+ break;
59650
+ default:
59651
+ reader.skipType(tag & 7);
59652
+ break;
59653
+ }
59654
+ }
59655
+ return message;
59656
+ },
59657
+ fromJSON(object) {
59658
+ const obj = createBaseDecProto();
59659
+ if ((0, helpers_1.isSet)(object.dec))
59660
+ obj.dec = String(object.dec);
59661
+ return obj;
59662
+ },
59663
+ toJSON(message) {
59664
+ const obj = {};
59665
+ message.dec !== undefined && (obj.dec = message.dec);
59666
+ return obj;
59667
+ },
59668
+ fromPartial(object) {
59669
+ const message = createBaseDecProto();
59670
+ message.dec = object.dec ?? "";
59671
+ return message;
59672
+ },
59673
+ };
59674
+
59675
+ return coin;
59676
+ }
59677
+
59678
+ var hasRequiredTx;
59679
+
59680
+ function requireTx () {
59681
+ if (hasRequiredTx) return tx;
59682
+ hasRequiredTx = 1;
59683
+ (function (exports$1) {
59684
+ Object.defineProperty(exports$1, "__esModule", { value: true });
59685
+ exports$1.AuxSignerData = exports$1.Tip = exports$1.Fee = exports$1.ModeInfo_Multi = exports$1.ModeInfo_Single = exports$1.ModeInfo = exports$1.SignerInfo = exports$1.AuthInfo = exports$1.TxBody = exports$1.SignDocDirectAux = exports$1.SignDoc = exports$1.TxRaw = exports$1.Tx = exports$1.protobufPackage = void 0;
59686
+ /* eslint-disable */
59687
+ const any_1 = requireAny();
59688
+ const signing_1 = requireSigning();
59689
+ const multisig_1 = requireMultisig();
59690
+ const coin_1 = requireCoin();
59691
+ const binary_1 = requireBinary();
59692
+ const helpers_1 = requireHelpers();
59693
+ exports$1.protobufPackage = "cosmos.tx.v1beta1";
59694
+ function createBaseTx() {
59695
+ return {
59696
+ body: undefined,
59697
+ authInfo: undefined,
59698
+ signatures: [],
59699
+ };
59700
+ }
59701
+ exports$1.Tx = {
59702
+ typeUrl: "/cosmos.tx.v1beta1.Tx",
59703
+ encode(message, writer = binary_1.BinaryWriter.create()) {
59704
+ if (message.body !== undefined) {
59705
+ exports$1.TxBody.encode(message.body, writer.uint32(10).fork()).ldelim();
59706
+ }
59707
+ if (message.authInfo !== undefined) {
59708
+ exports$1.AuthInfo.encode(message.authInfo, writer.uint32(18).fork()).ldelim();
59709
+ }
59710
+ for (const v of message.signatures) {
59711
+ writer.uint32(26).bytes(v);
59712
+ }
59713
+ return writer;
59714
+ },
59715
+ decode(input, length) {
59716
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
59717
+ let end = length === undefined ? reader.len : reader.pos + length;
59718
+ const message = createBaseTx();
59719
+ while (reader.pos < end) {
59720
+ const tag = reader.uint32();
59721
+ switch (tag >>> 3) {
59722
+ case 1:
59723
+ message.body = exports$1.TxBody.decode(reader, reader.uint32());
59724
+ break;
59725
+ case 2:
59726
+ message.authInfo = exports$1.AuthInfo.decode(reader, reader.uint32());
59727
+ break;
59728
+ case 3:
59729
+ message.signatures.push(reader.bytes());
59730
+ break;
59731
+ default:
59732
+ reader.skipType(tag & 7);
59733
+ break;
59734
+ }
59735
+ }
59736
+ return message;
59737
+ },
59738
+ fromJSON(object) {
59739
+ const obj = createBaseTx();
59740
+ if ((0, helpers_1.isSet)(object.body))
59741
+ obj.body = exports$1.TxBody.fromJSON(object.body);
59742
+ if ((0, helpers_1.isSet)(object.authInfo))
59743
+ obj.authInfo = exports$1.AuthInfo.fromJSON(object.authInfo);
59744
+ if (Array.isArray(object?.signatures))
59745
+ obj.signatures = object.signatures.map((e) => (0, helpers_1.bytesFromBase64)(e));
59746
+ return obj;
59747
+ },
59748
+ toJSON(message) {
59749
+ const obj = {};
59750
+ message.body !== undefined && (obj.body = message.body ? exports$1.TxBody.toJSON(message.body) : undefined);
59751
+ message.authInfo !== undefined &&
59752
+ (obj.authInfo = message.authInfo ? exports$1.AuthInfo.toJSON(message.authInfo) : undefined);
59753
+ if (message.signatures) {
59754
+ obj.signatures = message.signatures.map((e) => (0, helpers_1.base64FromBytes)(e !== undefined ? e : new Uint8Array()));
59755
+ }
59756
+ else {
59757
+ obj.signatures = [];
59758
+ }
59759
+ return obj;
59760
+ },
59761
+ fromPartial(object) {
59762
+ const message = createBaseTx();
59763
+ if (object.body !== undefined && object.body !== null) {
59764
+ message.body = exports$1.TxBody.fromPartial(object.body);
59765
+ }
59766
+ if (object.authInfo !== undefined && object.authInfo !== null) {
59767
+ message.authInfo = exports$1.AuthInfo.fromPartial(object.authInfo);
59768
+ }
59769
+ message.signatures = object.signatures?.map((e) => e) || [];
59770
+ return message;
59771
+ },
59772
+ };
59773
+ function createBaseTxRaw() {
59774
+ return {
59775
+ bodyBytes: new Uint8Array(),
59776
+ authInfoBytes: new Uint8Array(),
59777
+ signatures: [],
59778
+ };
59779
+ }
59780
+ exports$1.TxRaw = {
59781
+ typeUrl: "/cosmos.tx.v1beta1.TxRaw",
59782
+ encode(message, writer = binary_1.BinaryWriter.create()) {
59783
+ if (message.bodyBytes.length !== 0) {
59784
+ writer.uint32(10).bytes(message.bodyBytes);
59785
+ }
59786
+ if (message.authInfoBytes.length !== 0) {
59787
+ writer.uint32(18).bytes(message.authInfoBytes);
59788
+ }
59789
+ for (const v of message.signatures) {
59790
+ writer.uint32(26).bytes(v);
59791
+ }
59792
+ return writer;
59793
+ },
59794
+ decode(input, length) {
59795
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
59796
+ let end = length === undefined ? reader.len : reader.pos + length;
59797
+ const message = createBaseTxRaw();
59798
+ while (reader.pos < end) {
59799
+ const tag = reader.uint32();
59800
+ switch (tag >>> 3) {
59801
+ case 1:
59802
+ message.bodyBytes = reader.bytes();
59803
+ break;
59804
+ case 2:
59805
+ message.authInfoBytes = reader.bytes();
59806
+ break;
59807
+ case 3:
59808
+ message.signatures.push(reader.bytes());
59809
+ break;
59810
+ default:
59811
+ reader.skipType(tag & 7);
59812
+ break;
59813
+ }
59814
+ }
59815
+ return message;
59816
+ },
59817
+ fromJSON(object) {
59818
+ const obj = createBaseTxRaw();
59819
+ if ((0, helpers_1.isSet)(object.bodyBytes))
59820
+ obj.bodyBytes = (0, helpers_1.bytesFromBase64)(object.bodyBytes);
59821
+ if ((0, helpers_1.isSet)(object.authInfoBytes))
59822
+ obj.authInfoBytes = (0, helpers_1.bytesFromBase64)(object.authInfoBytes);
59823
+ if (Array.isArray(object?.signatures))
59824
+ obj.signatures = object.signatures.map((e) => (0, helpers_1.bytesFromBase64)(e));
59825
+ return obj;
59826
+ },
59827
+ toJSON(message) {
59828
+ const obj = {};
59829
+ message.bodyBytes !== undefined &&
59830
+ (obj.bodyBytes = (0, helpers_1.base64FromBytes)(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array()));
59831
+ message.authInfoBytes !== undefined &&
59832
+ (obj.authInfoBytes = (0, helpers_1.base64FromBytes)(message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array()));
59833
+ if (message.signatures) {
59834
+ obj.signatures = message.signatures.map((e) => (0, helpers_1.base64FromBytes)(e !== undefined ? e : new Uint8Array()));
59835
+ }
59836
+ else {
59837
+ obj.signatures = [];
59838
+ }
59839
+ return obj;
59840
+ },
59841
+ fromPartial(object) {
59842
+ const message = createBaseTxRaw();
59843
+ message.bodyBytes = object.bodyBytes ?? new Uint8Array();
59844
+ message.authInfoBytes = object.authInfoBytes ?? new Uint8Array();
59845
+ message.signatures = object.signatures?.map((e) => e) || [];
59846
+ return message;
59847
+ },
59848
+ };
59849
+ function createBaseSignDoc() {
59850
+ return {
59851
+ bodyBytes: new Uint8Array(),
59852
+ authInfoBytes: new Uint8Array(),
59853
+ chainId: "",
59854
+ accountNumber: BigInt(0),
59855
+ };
59856
+ }
59857
+ exports$1.SignDoc = {
59858
+ typeUrl: "/cosmos.tx.v1beta1.SignDoc",
59859
+ encode(message, writer = binary_1.BinaryWriter.create()) {
59860
+ if (message.bodyBytes.length !== 0) {
59861
+ writer.uint32(10).bytes(message.bodyBytes);
59862
+ }
59863
+ if (message.authInfoBytes.length !== 0) {
59864
+ writer.uint32(18).bytes(message.authInfoBytes);
59865
+ }
59866
+ if (message.chainId !== "") {
59867
+ writer.uint32(26).string(message.chainId);
59868
+ }
59869
+ if (message.accountNumber !== BigInt(0)) {
59870
+ writer.uint32(32).uint64(message.accountNumber);
59871
+ }
59872
+ return writer;
59873
+ },
59874
+ decode(input, length) {
59875
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
59876
+ let end = length === undefined ? reader.len : reader.pos + length;
59877
+ const message = createBaseSignDoc();
59878
+ while (reader.pos < end) {
59879
+ const tag = reader.uint32();
59880
+ switch (tag >>> 3) {
59881
+ case 1:
59882
+ message.bodyBytes = reader.bytes();
59883
+ break;
59884
+ case 2:
59885
+ message.authInfoBytes = reader.bytes();
59886
+ break;
59887
+ case 3:
59888
+ message.chainId = reader.string();
59889
+ break;
59890
+ case 4:
59891
+ message.accountNumber = reader.uint64();
59892
+ break;
59893
+ default:
59894
+ reader.skipType(tag & 7);
59895
+ break;
59896
+ }
59897
+ }
59898
+ return message;
59899
+ },
59900
+ fromJSON(object) {
59901
+ const obj = createBaseSignDoc();
59902
+ if ((0, helpers_1.isSet)(object.bodyBytes))
59903
+ obj.bodyBytes = (0, helpers_1.bytesFromBase64)(object.bodyBytes);
59904
+ if ((0, helpers_1.isSet)(object.authInfoBytes))
59905
+ obj.authInfoBytes = (0, helpers_1.bytesFromBase64)(object.authInfoBytes);
59906
+ if ((0, helpers_1.isSet)(object.chainId))
59907
+ obj.chainId = String(object.chainId);
59908
+ if ((0, helpers_1.isSet)(object.accountNumber))
59909
+ obj.accountNumber = BigInt(object.accountNumber.toString());
59910
+ return obj;
59911
+ },
59912
+ toJSON(message) {
59913
+ const obj = {};
59914
+ message.bodyBytes !== undefined &&
59915
+ (obj.bodyBytes = (0, helpers_1.base64FromBytes)(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array()));
59916
+ message.authInfoBytes !== undefined &&
59917
+ (obj.authInfoBytes = (0, helpers_1.base64FromBytes)(message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array()));
59918
+ message.chainId !== undefined && (obj.chainId = message.chainId);
59919
+ message.accountNumber !== undefined &&
59920
+ (obj.accountNumber = (message.accountNumber || BigInt(0)).toString());
59921
+ return obj;
59922
+ },
59923
+ fromPartial(object) {
59924
+ const message = createBaseSignDoc();
59925
+ message.bodyBytes = object.bodyBytes ?? new Uint8Array();
59926
+ message.authInfoBytes = object.authInfoBytes ?? new Uint8Array();
59927
+ message.chainId = object.chainId ?? "";
59928
+ if (object.accountNumber !== undefined && object.accountNumber !== null) {
59929
+ message.accountNumber = BigInt(object.accountNumber.toString());
59930
+ }
59931
+ return message;
59932
+ },
59933
+ };
59934
+ function createBaseSignDocDirectAux() {
59935
+ return {
59936
+ bodyBytes: new Uint8Array(),
59937
+ publicKey: undefined,
59938
+ chainId: "",
59939
+ accountNumber: BigInt(0),
59940
+ sequence: BigInt(0),
59941
+ tip: undefined,
59942
+ };
59943
+ }
59944
+ exports$1.SignDocDirectAux = {
59945
+ typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux",
59946
+ encode(message, writer = binary_1.BinaryWriter.create()) {
59947
+ if (message.bodyBytes.length !== 0) {
59948
+ writer.uint32(10).bytes(message.bodyBytes);
59949
+ }
59950
+ if (message.publicKey !== undefined) {
59951
+ any_1.Any.encode(message.publicKey, writer.uint32(18).fork()).ldelim();
59952
+ }
59953
+ if (message.chainId !== "") {
59954
+ writer.uint32(26).string(message.chainId);
59955
+ }
59956
+ if (message.accountNumber !== BigInt(0)) {
59957
+ writer.uint32(32).uint64(message.accountNumber);
59958
+ }
59959
+ if (message.sequence !== BigInt(0)) {
59960
+ writer.uint32(40).uint64(message.sequence);
59961
+ }
59962
+ if (message.tip !== undefined) {
59963
+ exports$1.Tip.encode(message.tip, writer.uint32(50).fork()).ldelim();
59964
+ }
59965
+ return writer;
59966
+ },
59967
+ decode(input, length) {
59968
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
59969
+ let end = length === undefined ? reader.len : reader.pos + length;
59970
+ const message = createBaseSignDocDirectAux();
59971
+ while (reader.pos < end) {
59972
+ const tag = reader.uint32();
59973
+ switch (tag >>> 3) {
59974
+ case 1:
59975
+ message.bodyBytes = reader.bytes();
59976
+ break;
59977
+ case 2:
59978
+ message.publicKey = any_1.Any.decode(reader, reader.uint32());
59979
+ break;
59980
+ case 3:
59981
+ message.chainId = reader.string();
59982
+ break;
59983
+ case 4:
59984
+ message.accountNumber = reader.uint64();
59985
+ break;
59986
+ case 5:
59987
+ message.sequence = reader.uint64();
59988
+ break;
59989
+ case 6:
59990
+ message.tip = exports$1.Tip.decode(reader, reader.uint32());
59991
+ break;
59992
+ default:
59993
+ reader.skipType(tag & 7);
59994
+ break;
59995
+ }
59996
+ }
59997
+ return message;
59998
+ },
59999
+ fromJSON(object) {
60000
+ const obj = createBaseSignDocDirectAux();
60001
+ if ((0, helpers_1.isSet)(object.bodyBytes))
60002
+ obj.bodyBytes = (0, helpers_1.bytesFromBase64)(object.bodyBytes);
60003
+ if ((0, helpers_1.isSet)(object.publicKey))
60004
+ obj.publicKey = any_1.Any.fromJSON(object.publicKey);
60005
+ if ((0, helpers_1.isSet)(object.chainId))
60006
+ obj.chainId = String(object.chainId);
60007
+ if ((0, helpers_1.isSet)(object.accountNumber))
60008
+ obj.accountNumber = BigInt(object.accountNumber.toString());
60009
+ if ((0, helpers_1.isSet)(object.sequence))
60010
+ obj.sequence = BigInt(object.sequence.toString());
60011
+ if ((0, helpers_1.isSet)(object.tip))
60012
+ obj.tip = exports$1.Tip.fromJSON(object.tip);
60013
+ return obj;
60014
+ },
60015
+ toJSON(message) {
60016
+ const obj = {};
60017
+ message.bodyBytes !== undefined &&
60018
+ (obj.bodyBytes = (0, helpers_1.base64FromBytes)(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array()));
60019
+ message.publicKey !== undefined &&
60020
+ (obj.publicKey = message.publicKey ? any_1.Any.toJSON(message.publicKey) : undefined);
60021
+ message.chainId !== undefined && (obj.chainId = message.chainId);
60022
+ message.accountNumber !== undefined &&
60023
+ (obj.accountNumber = (message.accountNumber || BigInt(0)).toString());
60024
+ message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString());
60025
+ message.tip !== undefined && (obj.tip = message.tip ? exports$1.Tip.toJSON(message.tip) : undefined);
60026
+ return obj;
60027
+ },
60028
+ fromPartial(object) {
60029
+ const message = createBaseSignDocDirectAux();
60030
+ message.bodyBytes = object.bodyBytes ?? new Uint8Array();
60031
+ if (object.publicKey !== undefined && object.publicKey !== null) {
60032
+ message.publicKey = any_1.Any.fromPartial(object.publicKey);
60033
+ }
60034
+ message.chainId = object.chainId ?? "";
60035
+ if (object.accountNumber !== undefined && object.accountNumber !== null) {
60036
+ message.accountNumber = BigInt(object.accountNumber.toString());
60037
+ }
60038
+ if (object.sequence !== undefined && object.sequence !== null) {
60039
+ message.sequence = BigInt(object.sequence.toString());
60040
+ }
60041
+ if (object.tip !== undefined && object.tip !== null) {
60042
+ message.tip = exports$1.Tip.fromPartial(object.tip);
60043
+ }
60044
+ return message;
60045
+ },
60046
+ };
60047
+ function createBaseTxBody() {
60048
+ return {
60049
+ messages: [],
60050
+ memo: "",
60051
+ timeoutHeight: BigInt(0),
60052
+ extensionOptions: [],
60053
+ nonCriticalExtensionOptions: [],
60054
+ };
60055
+ }
60056
+ exports$1.TxBody = {
60057
+ typeUrl: "/cosmos.tx.v1beta1.TxBody",
60058
+ encode(message, writer = binary_1.BinaryWriter.create()) {
60059
+ for (const v of message.messages) {
60060
+ any_1.Any.encode(v, writer.uint32(10).fork()).ldelim();
60061
+ }
60062
+ if (message.memo !== "") {
60063
+ writer.uint32(18).string(message.memo);
60064
+ }
60065
+ if (message.timeoutHeight !== BigInt(0)) {
60066
+ writer.uint32(24).uint64(message.timeoutHeight);
60067
+ }
60068
+ for (const v of message.extensionOptions) {
60069
+ any_1.Any.encode(v, writer.uint32(8186).fork()).ldelim();
60070
+ }
60071
+ for (const v of message.nonCriticalExtensionOptions) {
60072
+ any_1.Any.encode(v, writer.uint32(16378).fork()).ldelim();
60073
+ }
60074
+ return writer;
60075
+ },
60076
+ decode(input, length) {
60077
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
60078
+ let end = length === undefined ? reader.len : reader.pos + length;
60079
+ const message = createBaseTxBody();
60080
+ while (reader.pos < end) {
60081
+ const tag = reader.uint32();
60082
+ switch (tag >>> 3) {
60083
+ case 1:
60084
+ message.messages.push(any_1.Any.decode(reader, reader.uint32()));
60085
+ break;
60086
+ case 2:
60087
+ message.memo = reader.string();
60088
+ break;
60089
+ case 3:
60090
+ message.timeoutHeight = reader.uint64();
60091
+ break;
60092
+ case 1023:
60093
+ message.extensionOptions.push(any_1.Any.decode(reader, reader.uint32()));
60094
+ break;
60095
+ case 2047:
60096
+ message.nonCriticalExtensionOptions.push(any_1.Any.decode(reader, reader.uint32()));
60097
+ break;
60098
+ default:
60099
+ reader.skipType(tag & 7);
60100
+ break;
60101
+ }
60102
+ }
60103
+ return message;
60104
+ },
60105
+ fromJSON(object) {
60106
+ const obj = createBaseTxBody();
60107
+ if (Array.isArray(object?.messages))
60108
+ obj.messages = object.messages.map((e) => any_1.Any.fromJSON(e));
60109
+ if ((0, helpers_1.isSet)(object.memo))
60110
+ obj.memo = String(object.memo);
60111
+ if ((0, helpers_1.isSet)(object.timeoutHeight))
60112
+ obj.timeoutHeight = BigInt(object.timeoutHeight.toString());
60113
+ if (Array.isArray(object?.extensionOptions))
60114
+ obj.extensionOptions = object.extensionOptions.map((e) => any_1.Any.fromJSON(e));
60115
+ if (Array.isArray(object?.nonCriticalExtensionOptions))
60116
+ obj.nonCriticalExtensionOptions = object.nonCriticalExtensionOptions.map((e) => any_1.Any.fromJSON(e));
60117
+ return obj;
60118
+ },
60119
+ toJSON(message) {
60120
+ const obj = {};
60121
+ if (message.messages) {
60122
+ obj.messages = message.messages.map((e) => (e ? any_1.Any.toJSON(e) : undefined));
60123
+ }
60124
+ else {
60125
+ obj.messages = [];
60126
+ }
60127
+ message.memo !== undefined && (obj.memo = message.memo);
60128
+ message.timeoutHeight !== undefined &&
60129
+ (obj.timeoutHeight = (message.timeoutHeight || BigInt(0)).toString());
60130
+ if (message.extensionOptions) {
60131
+ obj.extensionOptions = message.extensionOptions.map((e) => (e ? any_1.Any.toJSON(e) : undefined));
60132
+ }
60133
+ else {
60134
+ obj.extensionOptions = [];
60135
+ }
60136
+ if (message.nonCriticalExtensionOptions) {
60137
+ obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map((e) => e ? any_1.Any.toJSON(e) : undefined);
60138
+ }
60139
+ else {
60140
+ obj.nonCriticalExtensionOptions = [];
60141
+ }
60142
+ return obj;
60143
+ },
60144
+ fromPartial(object) {
60145
+ const message = createBaseTxBody();
60146
+ message.messages = object.messages?.map((e) => any_1.Any.fromPartial(e)) || [];
60147
+ message.memo = object.memo ?? "";
60148
+ if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) {
60149
+ message.timeoutHeight = BigInt(object.timeoutHeight.toString());
60150
+ }
60151
+ message.extensionOptions = object.extensionOptions?.map((e) => any_1.Any.fromPartial(e)) || [];
60152
+ message.nonCriticalExtensionOptions =
60153
+ object.nonCriticalExtensionOptions?.map((e) => any_1.Any.fromPartial(e)) || [];
60154
+ return message;
60155
+ },
60156
+ };
60157
+ function createBaseAuthInfo() {
60158
+ return {
60159
+ signerInfos: [],
60160
+ fee: undefined,
60161
+ tip: undefined,
60162
+ };
60163
+ }
60164
+ exports$1.AuthInfo = {
60165
+ typeUrl: "/cosmos.tx.v1beta1.AuthInfo",
60166
+ encode(message, writer = binary_1.BinaryWriter.create()) {
60167
+ for (const v of message.signerInfos) {
60168
+ exports$1.SignerInfo.encode(v, writer.uint32(10).fork()).ldelim();
60169
+ }
60170
+ if (message.fee !== undefined) {
60171
+ exports$1.Fee.encode(message.fee, writer.uint32(18).fork()).ldelim();
60172
+ }
60173
+ if (message.tip !== undefined) {
60174
+ exports$1.Tip.encode(message.tip, writer.uint32(26).fork()).ldelim();
60175
+ }
60176
+ return writer;
60177
+ },
60178
+ decode(input, length) {
60179
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
60180
+ let end = length === undefined ? reader.len : reader.pos + length;
60181
+ const message = createBaseAuthInfo();
60182
+ while (reader.pos < end) {
60183
+ const tag = reader.uint32();
60184
+ switch (tag >>> 3) {
60185
+ case 1:
60186
+ message.signerInfos.push(exports$1.SignerInfo.decode(reader, reader.uint32()));
60187
+ break;
60188
+ case 2:
60189
+ message.fee = exports$1.Fee.decode(reader, reader.uint32());
60190
+ break;
60191
+ case 3:
60192
+ message.tip = exports$1.Tip.decode(reader, reader.uint32());
60193
+ break;
60194
+ default:
60195
+ reader.skipType(tag & 7);
60196
+ break;
60197
+ }
60198
+ }
60199
+ return message;
60200
+ },
60201
+ fromJSON(object) {
60202
+ const obj = createBaseAuthInfo();
60203
+ if (Array.isArray(object?.signerInfos))
60204
+ obj.signerInfos = object.signerInfos.map((e) => exports$1.SignerInfo.fromJSON(e));
60205
+ if ((0, helpers_1.isSet)(object.fee))
60206
+ obj.fee = exports$1.Fee.fromJSON(object.fee);
60207
+ if ((0, helpers_1.isSet)(object.tip))
60208
+ obj.tip = exports$1.Tip.fromJSON(object.tip);
60209
+ return obj;
60210
+ },
60211
+ toJSON(message) {
60212
+ const obj = {};
60213
+ if (message.signerInfos) {
60214
+ obj.signerInfos = message.signerInfos.map((e) => (e ? exports$1.SignerInfo.toJSON(e) : undefined));
60215
+ }
60216
+ else {
60217
+ obj.signerInfos = [];
60218
+ }
60219
+ message.fee !== undefined && (obj.fee = message.fee ? exports$1.Fee.toJSON(message.fee) : undefined);
60220
+ message.tip !== undefined && (obj.tip = message.tip ? exports$1.Tip.toJSON(message.tip) : undefined);
60221
+ return obj;
60222
+ },
60223
+ fromPartial(object) {
60224
+ const message = createBaseAuthInfo();
60225
+ message.signerInfos = object.signerInfos?.map((e) => exports$1.SignerInfo.fromPartial(e)) || [];
60226
+ if (object.fee !== undefined && object.fee !== null) {
60227
+ message.fee = exports$1.Fee.fromPartial(object.fee);
60228
+ }
60229
+ if (object.tip !== undefined && object.tip !== null) {
60230
+ message.tip = exports$1.Tip.fromPartial(object.tip);
60231
+ }
60232
+ return message;
60233
+ },
60234
+ };
60235
+ function createBaseSignerInfo() {
60236
+ return {
60237
+ publicKey: undefined,
60238
+ modeInfo: undefined,
60239
+ sequence: BigInt(0),
60240
+ };
60241
+ }
60242
+ exports$1.SignerInfo = {
60243
+ typeUrl: "/cosmos.tx.v1beta1.SignerInfo",
60244
+ encode(message, writer = binary_1.BinaryWriter.create()) {
60245
+ if (message.publicKey !== undefined) {
60246
+ any_1.Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim();
60247
+ }
60248
+ if (message.modeInfo !== undefined) {
60249
+ exports$1.ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim();
60250
+ }
60251
+ if (message.sequence !== BigInt(0)) {
60252
+ writer.uint32(24).uint64(message.sequence);
60253
+ }
60254
+ return writer;
60255
+ },
60256
+ decode(input, length) {
60257
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
60258
+ let end = length === undefined ? reader.len : reader.pos + length;
60259
+ const message = createBaseSignerInfo();
60260
+ while (reader.pos < end) {
60261
+ const tag = reader.uint32();
60262
+ switch (tag >>> 3) {
60263
+ case 1:
60264
+ message.publicKey = any_1.Any.decode(reader, reader.uint32());
60265
+ break;
60266
+ case 2:
60267
+ message.modeInfo = exports$1.ModeInfo.decode(reader, reader.uint32());
60268
+ break;
60269
+ case 3:
60270
+ message.sequence = reader.uint64();
60271
+ break;
60272
+ default:
60273
+ reader.skipType(tag & 7);
60274
+ break;
60275
+ }
60276
+ }
60277
+ return message;
60278
+ },
60279
+ fromJSON(object) {
60280
+ const obj = createBaseSignerInfo();
60281
+ if ((0, helpers_1.isSet)(object.publicKey))
60282
+ obj.publicKey = any_1.Any.fromJSON(object.publicKey);
60283
+ if ((0, helpers_1.isSet)(object.modeInfo))
60284
+ obj.modeInfo = exports$1.ModeInfo.fromJSON(object.modeInfo);
60285
+ if ((0, helpers_1.isSet)(object.sequence))
60286
+ obj.sequence = BigInt(object.sequence.toString());
60287
+ return obj;
60288
+ },
60289
+ toJSON(message) {
60290
+ const obj = {};
60291
+ message.publicKey !== undefined &&
60292
+ (obj.publicKey = message.publicKey ? any_1.Any.toJSON(message.publicKey) : undefined);
60293
+ message.modeInfo !== undefined &&
60294
+ (obj.modeInfo = message.modeInfo ? exports$1.ModeInfo.toJSON(message.modeInfo) : undefined);
60295
+ message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString());
60296
+ return obj;
60297
+ },
60298
+ fromPartial(object) {
60299
+ const message = createBaseSignerInfo();
60300
+ if (object.publicKey !== undefined && object.publicKey !== null) {
60301
+ message.publicKey = any_1.Any.fromPartial(object.publicKey);
60302
+ }
60303
+ if (object.modeInfo !== undefined && object.modeInfo !== null) {
60304
+ message.modeInfo = exports$1.ModeInfo.fromPartial(object.modeInfo);
60305
+ }
60306
+ if (object.sequence !== undefined && object.sequence !== null) {
60307
+ message.sequence = BigInt(object.sequence.toString());
60308
+ }
60309
+ return message;
60310
+ },
60311
+ };
60312
+ function createBaseModeInfo() {
60313
+ return {
60314
+ single: undefined,
60315
+ multi: undefined,
60316
+ };
60317
+ }
60318
+ exports$1.ModeInfo = {
60319
+ typeUrl: "/cosmos.tx.v1beta1.ModeInfo",
60320
+ encode(message, writer = binary_1.BinaryWriter.create()) {
60321
+ if (message.single !== undefined) {
60322
+ exports$1.ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim();
60323
+ }
60324
+ if (message.multi !== undefined) {
60325
+ exports$1.ModeInfo_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim();
60326
+ }
60327
+ return writer;
60328
+ },
60329
+ decode(input, length) {
60330
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
60331
+ let end = length === undefined ? reader.len : reader.pos + length;
60332
+ const message = createBaseModeInfo();
60333
+ while (reader.pos < end) {
60334
+ const tag = reader.uint32();
60335
+ switch (tag >>> 3) {
60336
+ case 1:
60337
+ message.single = exports$1.ModeInfo_Single.decode(reader, reader.uint32());
60338
+ break;
60339
+ case 2:
60340
+ message.multi = exports$1.ModeInfo_Multi.decode(reader, reader.uint32());
60341
+ break;
60342
+ default:
60343
+ reader.skipType(tag & 7);
60344
+ break;
60345
+ }
60346
+ }
60347
+ return message;
60348
+ },
60349
+ fromJSON(object) {
60350
+ const obj = createBaseModeInfo();
60351
+ if ((0, helpers_1.isSet)(object.single))
60352
+ obj.single = exports$1.ModeInfo_Single.fromJSON(object.single);
60353
+ if ((0, helpers_1.isSet)(object.multi))
60354
+ obj.multi = exports$1.ModeInfo_Multi.fromJSON(object.multi);
60355
+ return obj;
60356
+ },
60357
+ toJSON(message) {
60358
+ const obj = {};
60359
+ message.single !== undefined &&
60360
+ (obj.single = message.single ? exports$1.ModeInfo_Single.toJSON(message.single) : undefined);
60361
+ message.multi !== undefined &&
60362
+ (obj.multi = message.multi ? exports$1.ModeInfo_Multi.toJSON(message.multi) : undefined);
60363
+ return obj;
60364
+ },
60365
+ fromPartial(object) {
60366
+ const message = createBaseModeInfo();
60367
+ if (object.single !== undefined && object.single !== null) {
60368
+ message.single = exports$1.ModeInfo_Single.fromPartial(object.single);
60369
+ }
60370
+ if (object.multi !== undefined && object.multi !== null) {
60371
+ message.multi = exports$1.ModeInfo_Multi.fromPartial(object.multi);
60372
+ }
60373
+ return message;
60374
+ },
60375
+ };
60376
+ function createBaseModeInfo_Single() {
60377
+ return {
60378
+ mode: 0,
60379
+ };
60380
+ }
60381
+ exports$1.ModeInfo_Single = {
60382
+ typeUrl: "/cosmos.tx.v1beta1.Single",
60383
+ encode(message, writer = binary_1.BinaryWriter.create()) {
60384
+ if (message.mode !== 0) {
60385
+ writer.uint32(8).int32(message.mode);
60386
+ }
60387
+ return writer;
60388
+ },
60389
+ decode(input, length) {
60390
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
60391
+ let end = length === undefined ? reader.len : reader.pos + length;
60392
+ const message = createBaseModeInfo_Single();
60393
+ while (reader.pos < end) {
60394
+ const tag = reader.uint32();
60395
+ switch (tag >>> 3) {
60396
+ case 1:
60397
+ message.mode = reader.int32();
60398
+ break;
60399
+ default:
60400
+ reader.skipType(tag & 7);
60401
+ break;
60402
+ }
60403
+ }
60404
+ return message;
60405
+ },
60406
+ fromJSON(object) {
60407
+ const obj = createBaseModeInfo_Single();
60408
+ if ((0, helpers_1.isSet)(object.mode))
60409
+ obj.mode = (0, signing_1.signModeFromJSON)(object.mode);
60410
+ return obj;
60411
+ },
60412
+ toJSON(message) {
60413
+ const obj = {};
60414
+ message.mode !== undefined && (obj.mode = (0, signing_1.signModeToJSON)(message.mode));
60415
+ return obj;
60416
+ },
60417
+ fromPartial(object) {
60418
+ const message = createBaseModeInfo_Single();
60419
+ message.mode = object.mode ?? 0;
60420
+ return message;
60421
+ },
60422
+ };
60423
+ function createBaseModeInfo_Multi() {
60424
+ return {
60425
+ bitarray: undefined,
60426
+ modeInfos: [],
60427
+ };
60428
+ }
60429
+ exports$1.ModeInfo_Multi = {
60430
+ typeUrl: "/cosmos.tx.v1beta1.Multi",
60431
+ encode(message, writer = binary_1.BinaryWriter.create()) {
60432
+ if (message.bitarray !== undefined) {
60433
+ multisig_1.CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim();
60434
+ }
60435
+ for (const v of message.modeInfos) {
60436
+ exports$1.ModeInfo.encode(v, writer.uint32(18).fork()).ldelim();
60437
+ }
60438
+ return writer;
60439
+ },
60440
+ decode(input, length) {
60441
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
60442
+ let end = length === undefined ? reader.len : reader.pos + length;
60443
+ const message = createBaseModeInfo_Multi();
60444
+ while (reader.pos < end) {
60445
+ const tag = reader.uint32();
60446
+ switch (tag >>> 3) {
60447
+ case 1:
60448
+ message.bitarray = multisig_1.CompactBitArray.decode(reader, reader.uint32());
60449
+ break;
60450
+ case 2:
60451
+ message.modeInfos.push(exports$1.ModeInfo.decode(reader, reader.uint32()));
60452
+ break;
60453
+ default:
60454
+ reader.skipType(tag & 7);
60455
+ break;
60456
+ }
60457
+ }
60458
+ return message;
60459
+ },
60460
+ fromJSON(object) {
60461
+ const obj = createBaseModeInfo_Multi();
60462
+ if ((0, helpers_1.isSet)(object.bitarray))
60463
+ obj.bitarray = multisig_1.CompactBitArray.fromJSON(object.bitarray);
60464
+ if (Array.isArray(object?.modeInfos))
60465
+ obj.modeInfos = object.modeInfos.map((e) => exports$1.ModeInfo.fromJSON(e));
60466
+ return obj;
60467
+ },
60468
+ toJSON(message) {
60469
+ const obj = {};
60470
+ message.bitarray !== undefined &&
60471
+ (obj.bitarray = message.bitarray ? multisig_1.CompactBitArray.toJSON(message.bitarray) : undefined);
60472
+ if (message.modeInfos) {
60473
+ obj.modeInfos = message.modeInfos.map((e) => (e ? exports$1.ModeInfo.toJSON(e) : undefined));
60474
+ }
60475
+ else {
60476
+ obj.modeInfos = [];
60477
+ }
60478
+ return obj;
60479
+ },
60480
+ fromPartial(object) {
60481
+ const message = createBaseModeInfo_Multi();
60482
+ if (object.bitarray !== undefined && object.bitarray !== null) {
60483
+ message.bitarray = multisig_1.CompactBitArray.fromPartial(object.bitarray);
60484
+ }
60485
+ message.modeInfos = object.modeInfos?.map((e) => exports$1.ModeInfo.fromPartial(e)) || [];
60486
+ return message;
60487
+ },
60488
+ };
60489
+ function createBaseFee() {
60490
+ return {
60491
+ amount: [],
60492
+ gasLimit: BigInt(0),
60493
+ payer: "",
60494
+ granter: "",
60495
+ };
60496
+ }
60497
+ exports$1.Fee = {
60498
+ typeUrl: "/cosmos.tx.v1beta1.Fee",
60499
+ encode(message, writer = binary_1.BinaryWriter.create()) {
60500
+ for (const v of message.amount) {
60501
+ coin_1.Coin.encode(v, writer.uint32(10).fork()).ldelim();
60502
+ }
60503
+ if (message.gasLimit !== BigInt(0)) {
60504
+ writer.uint32(16).uint64(message.gasLimit);
60505
+ }
60506
+ if (message.payer !== "") {
60507
+ writer.uint32(26).string(message.payer);
60508
+ }
60509
+ if (message.granter !== "") {
60510
+ writer.uint32(34).string(message.granter);
60511
+ }
60512
+ return writer;
60513
+ },
60514
+ decode(input, length) {
60515
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
60516
+ let end = length === undefined ? reader.len : reader.pos + length;
60517
+ const message = createBaseFee();
60518
+ while (reader.pos < end) {
60519
+ const tag = reader.uint32();
60520
+ switch (tag >>> 3) {
60521
+ case 1:
60522
+ message.amount.push(coin_1.Coin.decode(reader, reader.uint32()));
60523
+ break;
60524
+ case 2:
60525
+ message.gasLimit = reader.uint64();
60526
+ break;
60527
+ case 3:
60528
+ message.payer = reader.string();
60529
+ break;
60530
+ case 4:
60531
+ message.granter = reader.string();
60532
+ break;
60533
+ default:
60534
+ reader.skipType(tag & 7);
60535
+ break;
60536
+ }
60537
+ }
60538
+ return message;
60539
+ },
60540
+ fromJSON(object) {
60541
+ const obj = createBaseFee();
60542
+ if (Array.isArray(object?.amount))
60543
+ obj.amount = object.amount.map((e) => coin_1.Coin.fromJSON(e));
60544
+ if ((0, helpers_1.isSet)(object.gasLimit))
60545
+ obj.gasLimit = BigInt(object.gasLimit.toString());
60546
+ if ((0, helpers_1.isSet)(object.payer))
60547
+ obj.payer = String(object.payer);
60548
+ if ((0, helpers_1.isSet)(object.granter))
60549
+ obj.granter = String(object.granter);
60550
+ return obj;
60551
+ },
60552
+ toJSON(message) {
60553
+ const obj = {};
60554
+ if (message.amount) {
60555
+ obj.amount = message.amount.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));
60556
+ }
60557
+ else {
60558
+ obj.amount = [];
60559
+ }
60560
+ message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || BigInt(0)).toString());
60561
+ message.payer !== undefined && (obj.payer = message.payer);
60562
+ message.granter !== undefined && (obj.granter = message.granter);
60563
+ return obj;
60564
+ },
60565
+ fromPartial(object) {
60566
+ const message = createBaseFee();
60567
+ message.amount = object.amount?.map((e) => coin_1.Coin.fromPartial(e)) || [];
60568
+ if (object.gasLimit !== undefined && object.gasLimit !== null) {
60569
+ message.gasLimit = BigInt(object.gasLimit.toString());
60570
+ }
60571
+ message.payer = object.payer ?? "";
60572
+ message.granter = object.granter ?? "";
60573
+ return message;
60574
+ },
60575
+ };
60576
+ function createBaseTip() {
60577
+ return {
60578
+ amount: [],
60579
+ tipper: "",
60580
+ };
60581
+ }
60582
+ exports$1.Tip = {
60583
+ typeUrl: "/cosmos.tx.v1beta1.Tip",
60584
+ encode(message, writer = binary_1.BinaryWriter.create()) {
60585
+ for (const v of message.amount) {
60586
+ coin_1.Coin.encode(v, writer.uint32(10).fork()).ldelim();
60587
+ }
60588
+ if (message.tipper !== "") {
60589
+ writer.uint32(18).string(message.tipper);
60590
+ }
60591
+ return writer;
60592
+ },
60593
+ decode(input, length) {
60594
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
60595
+ let end = length === undefined ? reader.len : reader.pos + length;
60596
+ const message = createBaseTip();
60597
+ while (reader.pos < end) {
60598
+ const tag = reader.uint32();
60599
+ switch (tag >>> 3) {
60600
+ case 1:
60601
+ message.amount.push(coin_1.Coin.decode(reader, reader.uint32()));
60602
+ break;
60603
+ case 2:
60604
+ message.tipper = reader.string();
60605
+ break;
60606
+ default:
60607
+ reader.skipType(tag & 7);
60608
+ break;
60609
+ }
60610
+ }
60611
+ return message;
60612
+ },
60613
+ fromJSON(object) {
60614
+ const obj = createBaseTip();
60615
+ if (Array.isArray(object?.amount))
60616
+ obj.amount = object.amount.map((e) => coin_1.Coin.fromJSON(e));
60617
+ if ((0, helpers_1.isSet)(object.tipper))
60618
+ obj.tipper = String(object.tipper);
60619
+ return obj;
60620
+ },
60621
+ toJSON(message) {
60622
+ const obj = {};
60623
+ if (message.amount) {
60624
+ obj.amount = message.amount.map((e) => (e ? coin_1.Coin.toJSON(e) : undefined));
60625
+ }
60626
+ else {
60627
+ obj.amount = [];
60628
+ }
60629
+ message.tipper !== undefined && (obj.tipper = message.tipper);
60630
+ return obj;
60631
+ },
60632
+ fromPartial(object) {
60633
+ const message = createBaseTip();
60634
+ message.amount = object.amount?.map((e) => coin_1.Coin.fromPartial(e)) || [];
60635
+ message.tipper = object.tipper ?? "";
60636
+ return message;
60637
+ },
60638
+ };
60639
+ function createBaseAuxSignerData() {
60640
+ return {
60641
+ address: "",
60642
+ signDoc: undefined,
60643
+ mode: 0,
60644
+ sig: new Uint8Array(),
60645
+ };
60646
+ }
60647
+ exports$1.AuxSignerData = {
60648
+ typeUrl: "/cosmos.tx.v1beta1.AuxSignerData",
60649
+ encode(message, writer = binary_1.BinaryWriter.create()) {
60650
+ if (message.address !== "") {
60651
+ writer.uint32(10).string(message.address);
60652
+ }
60653
+ if (message.signDoc !== undefined) {
60654
+ exports$1.SignDocDirectAux.encode(message.signDoc, writer.uint32(18).fork()).ldelim();
60655
+ }
60656
+ if (message.mode !== 0) {
60657
+ writer.uint32(24).int32(message.mode);
60658
+ }
60659
+ if (message.sig.length !== 0) {
60660
+ writer.uint32(34).bytes(message.sig);
60661
+ }
60662
+ return writer;
60663
+ },
60664
+ decode(input, length) {
60665
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
60666
+ let end = length === undefined ? reader.len : reader.pos + length;
60667
+ const message = createBaseAuxSignerData();
60668
+ while (reader.pos < end) {
60669
+ const tag = reader.uint32();
60670
+ switch (tag >>> 3) {
60671
+ case 1:
60672
+ message.address = reader.string();
60673
+ break;
60674
+ case 2:
60675
+ message.signDoc = exports$1.SignDocDirectAux.decode(reader, reader.uint32());
60676
+ break;
60677
+ case 3:
60678
+ message.mode = reader.int32();
60679
+ break;
60680
+ case 4:
60681
+ message.sig = reader.bytes();
60682
+ break;
60683
+ default:
60684
+ reader.skipType(tag & 7);
60685
+ break;
60686
+ }
60687
+ }
60688
+ return message;
60689
+ },
60690
+ fromJSON(object) {
60691
+ const obj = createBaseAuxSignerData();
60692
+ if ((0, helpers_1.isSet)(object.address))
60693
+ obj.address = String(object.address);
60694
+ if ((0, helpers_1.isSet)(object.signDoc))
60695
+ obj.signDoc = exports$1.SignDocDirectAux.fromJSON(object.signDoc);
60696
+ if ((0, helpers_1.isSet)(object.mode))
60697
+ obj.mode = (0, signing_1.signModeFromJSON)(object.mode);
60698
+ if ((0, helpers_1.isSet)(object.sig))
60699
+ obj.sig = (0, helpers_1.bytesFromBase64)(object.sig);
60700
+ return obj;
60701
+ },
60702
+ toJSON(message) {
60703
+ const obj = {};
60704
+ message.address !== undefined && (obj.address = message.address);
60705
+ message.signDoc !== undefined &&
60706
+ (obj.signDoc = message.signDoc ? exports$1.SignDocDirectAux.toJSON(message.signDoc) : undefined);
60707
+ message.mode !== undefined && (obj.mode = (0, signing_1.signModeToJSON)(message.mode));
60708
+ message.sig !== undefined &&
60709
+ (obj.sig = (0, helpers_1.base64FromBytes)(message.sig !== undefined ? message.sig : new Uint8Array()));
60710
+ return obj;
60711
+ },
60712
+ fromPartial(object) {
60713
+ const message = createBaseAuxSignerData();
60714
+ message.address = object.address ?? "";
60715
+ if (object.signDoc !== undefined && object.signDoc !== null) {
60716
+ message.signDoc = exports$1.SignDocDirectAux.fromPartial(object.signDoc);
60717
+ }
60718
+ message.mode = object.mode ?? 0;
60719
+ message.sig = object.sig ?? new Uint8Array();
60720
+ return message;
60721
+ },
60722
+ };
60723
+
60724
+ } (tx));
60725
+ return tx;
60726
+ }
60727
+
60728
+ var txExports = requireTx();
60729
+
57684
60730
  /**
57685
60731
  * Default gas limit for all transactions
57686
60732
  */
@@ -58095,6 +61141,53 @@ class SigningCosmosClient extends CosmosClient {
58095
61141
  throw error;
58096
61142
  }
58097
61143
  }
61144
+ /**
61145
+ * Signs a MsgPerformAction and returns the base64-encoded TxRaw WITHOUT
61146
+ * broadcasting. Used by the optimistic gateway settlement relay
61147
+ * (OPTIMISTIC_ACTION_ARCHITECTURE.md §6.10): the FE hands the signed bytes
61148
+ * to the gateway, which relays them to the chain's existing tx pipeline —
61149
+ * no chain changes, valid player signature.
61150
+ *
61151
+ * Pass `signerData` to use a locally-tracked sequence (the caller queries
61152
+ * the account once and increments +1 per action, avoiding a per-action
61153
+ * sequence query — required because optimistic actions are signed faster
61154
+ * than the chain commits). Omit it to fetch account_number/sequence from
61155
+ * the chain (one-shot, e.g. the first action of a session).
61156
+ *
61157
+ * Requires the player account to EXIST on-chain (funded). Same gasless
61158
+ * fee + msg shape as {@link performActionSync}.
61159
+ */
61160
+ async signPerformAction(gameId, action, amount = 0n, data, signerData) {
61161
+ await this.initializeSigningClient();
61162
+ if (!this.signingClient || !this.wallet) {
61163
+ throw new Error("Signing client not initialized");
61164
+ }
61165
+ const [account] = await this.wallet.getAccounts();
61166
+ const player = account.address;
61167
+ const msgPerformAction = {
61168
+ player,
61169
+ gameId,
61170
+ action,
61171
+ amount: Long.fromString(amount.toString(), true),
61172
+ data: data || ""
61173
+ };
61174
+ const msg = {
61175
+ typeUrl: "/pokerchain.poker.v1.MsgPerformAction",
61176
+ value: msgPerformAction
61177
+ };
61178
+ let explicit = signerData;
61179
+ if (!explicit) {
61180
+ const accountInfo = await this.getAccount(player);
61181
+ explicit = {
61182
+ accountNumber: Number(accountInfo.account.account_number),
61183
+ sequence: Number(accountInfo.account.sequence),
61184
+ chainId: this.config.chainId
61185
+ };
61186
+ }
61187
+ const txRaw = await this.signingClient.sign(player, [msg], gaslessFee(), `Poker action (relay): ${action}`, explicit);
61188
+ const base64 = encoding.toBase64(txExports.TxRaw.encode(txRaw).finish());
61189
+ return { base64, sequence: explicit.sequence, accountNumber: explicit.accountNumber };
61190
+ }
58098
61191
  /**
58099
61192
  * Top up a player's stack at a table
58100
61193
  * The player must be seated at the table and have sufficient wallet balance.