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