coreum-js 2.16.3 → 2.17.0

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.
Files changed (236) hide show
  1. package/dist/main/client/index.js +15 -16
  2. package/dist/main/coreum/asset/ft/v1/authz.d.ts +38 -0
  3. package/dist/main/coreum/asset/ft/v1/authz.js +122 -0
  4. package/dist/main/coreum/asset/ft/v1/event.d.ts +52 -28
  5. package/dist/main/coreum/asset/ft/v1/event.js +744 -138
  6. package/dist/main/coreum/asset/ft/v1/genesis.d.ts +31 -21
  7. package/dist/main/coreum/asset/ft/v1/genesis.js +273 -62
  8. package/dist/main/coreum/asset/ft/v1/params.d.ts +12 -11
  9. package/dist/main/coreum/asset/ft/v1/params.js +37 -33
  10. package/dist/main/coreum/asset/ft/v1/query.d.ts +87 -127
  11. package/dist/main/coreum/asset/ft/v1/query.js +697 -217
  12. package/dist/main/coreum/asset/ft/v1/token.d.ts +17 -51
  13. package/dist/main/coreum/asset/ft/v1/token.js +276 -200
  14. package/dist/main/coreum/asset/ft/v1/tx.d.ts +30 -147
  15. package/dist/main/coreum/asset/ft/v1/tx.js +502 -386
  16. package/dist/main/coreum/asset/index.d.ts +2 -3
  17. package/dist/main/coreum/asset/nft/v1/authz.d.ts +33 -0
  18. package/dist/main/coreum/asset/nft/v1/authz.js +137 -0
  19. package/dist/main/coreum/asset/nft/v1/event.d.ts +35 -43
  20. package/dist/main/coreum/asset/nft/v1/event.js +475 -147
  21. package/dist/main/coreum/asset/nft/v1/genesis.d.ts +27 -36
  22. package/dist/main/coreum/asset/nft/v1/genesis.js +311 -119
  23. package/dist/main/coreum/asset/nft/v1/nft.d.ts +20 -26
  24. package/dist/main/coreum/asset/nft/v1/nft.js +139 -104
  25. package/dist/main/coreum/asset/nft/v1/params.d.ts +12 -12
  26. package/dist/main/coreum/asset/nft/v1/params.js +17 -20
  27. package/dist/main/coreum/asset/nft/v1/query.d.ts +110 -88
  28. package/dist/main/coreum/asset/nft/v1/query.js +1079 -185
  29. package/dist/main/coreum/asset/nft/v1/tx.d.ts +96 -70
  30. package/dist/main/coreum/asset/nft/v1/tx.js +865 -234
  31. package/dist/main/coreum/asset/nft/v1/types.d.ts +38 -11
  32. package/dist/main/coreum/asset/nft/v1/types.js +273 -45
  33. package/dist/main/coreum/customparams/v1/genesis.d.ts +12 -12
  34. package/dist/main/coreum/customparams/v1/genesis.js +26 -22
  35. package/dist/main/coreum/customparams/v1/params.d.ts +11 -11
  36. package/dist/main/coreum/customparams/v1/params.js +23 -20
  37. package/dist/main/coreum/customparams/v1/query.d.ts +14 -20
  38. package/dist/main/coreum/customparams/v1/query.js +35 -29
  39. package/dist/main/coreum/dex/index.d.ts +1 -0
  40. package/dist/main/coreum/dex/index.js +12 -0
  41. package/dist/main/coreum/dex/v1/event.d.ts +73 -0
  42. package/dist/main/coreum/dex/v1/event.js +470 -0
  43. package/dist/main/coreum/dex/v1/genesis.d.ts +49 -0
  44. package/dist/main/coreum/dex/v1/genesis.js +318 -0
  45. package/dist/main/coreum/dex/v1/order.d.ts +172 -0
  46. package/dist/main/coreum/dex/v1/order.js +1137 -0
  47. package/dist/main/coreum/dex/v1/params.d.ts +34 -0
  48. package/dist/main/coreum/dex/v1/params.js +139 -0
  49. package/dist/main/coreum/dex/v1/query.d.ts +133 -0
  50. package/dist/main/coreum/dex/v1/query.js +873 -0
  51. package/dist/main/coreum/dex/v1/tx.d.ts +102 -0
  52. package/dist/main/coreum/dex/v1/tx.js +521 -0
  53. package/dist/main/coreum/extensions/dex.d.ts +12 -0
  54. package/dist/main/coreum/extensions/dex.js +32 -0
  55. package/dist/main/coreum/extensions/ft.js +2 -1
  56. package/dist/main/coreum/extensions/nft.js +2 -1
  57. package/dist/main/coreum/extensions/nftbeta.js +2 -1
  58. package/dist/main/coreum/feemodel/v1/genesis.d.ts +13 -13
  59. package/dist/main/coreum/feemodel/v1/genesis.js +23 -24
  60. package/dist/main/coreum/feemodel/v1/params.d.ts +14 -21
  61. package/dist/main/coreum/feemodel/v1/params.js +113 -66
  62. package/dist/main/coreum/feemodel/v1/query.d.ts +30 -37
  63. package/dist/main/coreum/feemodel/v1/query.js +196 -43
  64. package/dist/main/coreum/index.d.ts +46 -0
  65. package/dist/main/coreum/index.js +58 -1
  66. package/dist/main/coreum/nft/index.d.ts +1 -2
  67. package/dist/main/coreum/nft/v1beta1/event.d.ts +23 -27
  68. package/dist/main/coreum/nft/v1beta1/event.js +103 -77
  69. package/dist/main/coreum/nft/v1beta1/genesis.d.ts +13 -19
  70. package/dist/main/coreum/nft/v1beta1/genesis.js +50 -52
  71. package/dist/main/coreum/nft/v1beta1/nft.d.ts +15 -22
  72. package/dist/main/coreum/nft/v1beta1/nft.js +111 -81
  73. package/dist/main/coreum/nft/v1beta1/query.d.ts +54 -124
  74. package/dist/main/coreum/nft/v1beta1/query.js +259 -223
  75. package/dist/main/coreum/nft/v1beta1/tx.d.ts +13 -19
  76. package/dist/main/coreum/nft/v1beta1/tx.js +54 -43
  77. package/dist/main/cosmos/extensions/bank.js +2 -1
  78. package/dist/main/cosmos/extensions/distribution.d.ts +4 -4
  79. package/dist/main/cosmos/extensions/distribution.js +11 -10
  80. package/dist/main/cosmos/extensions/gov.d.ts +13 -13
  81. package/dist/main/cosmos/extensions/gov.js +16 -9
  82. package/dist/main/cosmos/index.d.ts +8 -8
  83. package/dist/main/google/api/http.d.ts +2636 -6
  84. package/dist/main/google/api/http.js +18 -21
  85. package/dist/main/google/protobuf/any.d.ts +14 -2
  86. package/dist/main/google/protobuf/any.js +6 -7
  87. package/dist/main/google/protobuf/duration.d.ts +14 -2
  88. package/dist/main/google/protobuf/duration.js +3 -4
  89. package/dist/main/google/protobuf/timestamp.d.ts +14 -2
  90. package/dist/main/google/protobuf/timestamp.js +3 -4
  91. package/dist/main/index.js +7 -17
  92. package/dist/main/services/cosmostation.js +1 -1
  93. package/dist/main/tendermint/abci/types.d.ts +6360 -92
  94. package/dist/main/tendermint/abci/types.js +195 -235
  95. package/dist/main/tendermint/crypto/keys.d.ts +14 -2
  96. package/dist/main/tendermint/crypto/keys.js +3 -4
  97. package/dist/main/tendermint/crypto/proof.d.ts +152 -10
  98. package/dist/main/tendermint/crypto/proof.js +19 -24
  99. package/dist/main/tendermint/types/params.d.ts +196 -12
  100. package/dist/main/tendermint/types/params.js +15 -20
  101. package/dist/main/tendermint/types/types.d.ts +1744 -26
  102. package/dist/main/tendermint/types/types.js +62 -73
  103. package/dist/main/tendermint/types/validator.d.ts +230 -6
  104. package/dist/main/tendermint/types/validator.js +10 -13
  105. package/dist/main/tendermint/version/types.d.ts +28 -4
  106. package/dist/main/tendermint/version/types.js +6 -8
  107. package/dist/main/types/core.d.ts +2 -1
  108. package/dist/main/types/core.js +2 -0
  109. package/dist/main/utils/convertStringToAny.d.ts +0 -1
  110. package/dist/main/utils/nft.js +2 -1
  111. package/dist/main/wasm/v1/authz.d.ts +20 -75
  112. package/dist/main/wasm/v1/authz.js +129 -148
  113. package/dist/main/wasm/v1/extensions/wasm.js +2 -1
  114. package/dist/main/wasm/v1/genesis.d.ts +14 -34
  115. package/dist/main/wasm/v1/genesis.js +169 -140
  116. package/dist/main/wasm/v1/ibc.d.ts +13 -26
  117. package/dist/main/wasm/v1/ibc.js +91 -76
  118. package/dist/main/wasm/v1/index.d.ts +1 -2
  119. package/dist/main/wasm/v1/pagination.d.ts +40 -4
  120. package/dist/main/wasm/v1/pagination.js +9 -11
  121. package/dist/main/wasm/v1/proposal.d.ts +23 -106
  122. package/dist/main/wasm/v1/proposal.js +634 -465
  123. package/dist/main/wasm/v1/query.d.ts +35 -187
  124. package/dist/main/wasm/v1/query.js +370 -363
  125. package/dist/main/wasm/v1/tx.d.ts +37 -210
  126. package/dist/main/wasm/v1/tx.js +621 -497
  127. package/dist/main/wasm/v1/types.d.ts +19 -67
  128. package/dist/main/wasm/v1/types.js +224 -195
  129. package/dist/module/client/index.js +2 -1
  130. package/dist/module/coreum/asset/ft/v1/authz.d.ts +38 -0
  131. package/dist/module/coreum/asset/ft/v1/authz.js +119 -0
  132. package/dist/module/coreum/asset/ft/v1/event.d.ts +52 -28
  133. package/dist/module/coreum/asset/ft/v1/event.js +721 -109
  134. package/dist/module/coreum/asset/ft/v1/genesis.d.ts +31 -21
  135. package/dist/module/coreum/asset/ft/v1/genesis.js +266 -50
  136. package/dist/module/coreum/asset/ft/v1/params.d.ts +12 -11
  137. package/dist/module/coreum/asset/ft/v1/params.js +35 -27
  138. package/dist/module/coreum/asset/ft/v1/query.d.ts +87 -127
  139. package/dist/module/coreum/asset/ft/v1/query.js +672 -180
  140. package/dist/module/coreum/asset/ft/v1/token.d.ts +17 -51
  141. package/dist/module/coreum/asset/ft/v1/token.js +236 -152
  142. package/dist/module/coreum/asset/ft/v1/tx.d.ts +30 -147
  143. package/dist/module/coreum/asset/ft/v1/tx.js +437 -301
  144. package/dist/module/coreum/asset/index.d.ts +2 -3
  145. package/dist/module/coreum/asset/nft/v1/authz.d.ts +33 -0
  146. package/dist/module/coreum/asset/nft/v1/authz.js +134 -0
  147. package/dist/module/coreum/asset/nft/v1/event.d.ts +35 -43
  148. package/dist/module/coreum/asset/nft/v1/event.js +448 -112
  149. package/dist/module/coreum/asset/nft/v1/genesis.d.ts +27 -36
  150. package/dist/module/coreum/asset/nft/v1/genesis.js +299 -100
  151. package/dist/module/coreum/asset/nft/v1/nft.d.ts +20 -26
  152. package/dist/module/coreum/asset/nft/v1/nft.js +121 -81
  153. package/dist/module/coreum/asset/nft/v1/params.d.ts +12 -12
  154. package/dist/module/coreum/asset/nft/v1/params.js +16 -16
  155. package/dist/module/coreum/asset/nft/v1/query.d.ts +110 -88
  156. package/dist/module/coreum/asset/nft/v1/query.js +1057 -153
  157. package/dist/module/coreum/asset/nft/v1/tx.d.ts +96 -70
  158. package/dist/module/coreum/asset/nft/v1/tx.js +825 -184
  159. package/dist/module/coreum/asset/nft/v1/types.d.ts +38 -11
  160. package/dist/module/coreum/asset/nft/v1/types.js +269 -39
  161. package/dist/module/coreum/customparams/v1/genesis.d.ts +12 -12
  162. package/dist/module/coreum/customparams/v1/genesis.js +25 -18
  163. package/dist/module/coreum/customparams/v1/params.d.ts +11 -11
  164. package/dist/module/coreum/customparams/v1/params.js +21 -14
  165. package/dist/module/coreum/customparams/v1/query.d.ts +14 -20
  166. package/dist/module/coreum/customparams/v1/query.js +32 -23
  167. package/dist/module/coreum/dex/index.d.ts +1 -0
  168. package/dist/module/coreum/dex/index.js +9 -0
  169. package/dist/module/coreum/dex/v1/event.d.ts +73 -0
  170. package/dist/module/coreum/dex/v1/event.js +467 -0
  171. package/dist/module/coreum/dex/v1/genesis.d.ts +49 -0
  172. package/dist/module/coreum/dex/v1/genesis.js +315 -0
  173. package/dist/module/coreum/dex/v1/order.d.ts +172 -0
  174. package/dist/module/coreum/dex/v1/order.js +1128 -0
  175. package/dist/module/coreum/dex/v1/params.d.ts +34 -0
  176. package/dist/module/coreum/dex/v1/params.js +136 -0
  177. package/dist/module/coreum/dex/v1/query.d.ts +133 -0
  178. package/dist/module/coreum/dex/v1/query.js +871 -0
  179. package/dist/module/coreum/dex/v1/tx.d.ts +102 -0
  180. package/dist/module/coreum/dex/v1/tx.js +519 -0
  181. package/dist/module/coreum/extensions/dex.d.ts +12 -0
  182. package/dist/module/coreum/extensions/dex.js +28 -0
  183. package/dist/module/coreum/feemodel/v1/genesis.d.ts +13 -13
  184. package/dist/module/coreum/feemodel/v1/genesis.js +22 -20
  185. package/dist/module/coreum/feemodel/v1/params.d.ts +14 -21
  186. package/dist/module/coreum/feemodel/v1/params.js +105 -54
  187. package/dist/module/coreum/feemodel/v1/query.d.ts +30 -37
  188. package/dist/module/coreum/feemodel/v1/query.js +191 -35
  189. package/dist/module/coreum/index.d.ts +46 -0
  190. package/dist/module/coreum/index.js +57 -0
  191. package/dist/module/coreum/nft/index.d.ts +1 -2
  192. package/dist/module/coreum/nft/v1beta1/event.d.ts +23 -27
  193. package/dist/module/coreum/nft/v1beta1/event.js +90 -58
  194. package/dist/module/coreum/nft/v1beta1/genesis.d.ts +13 -19
  195. package/dist/module/coreum/nft/v1beta1/genesis.js +44 -41
  196. package/dist/module/coreum/nft/v1beta1/nft.d.ts +15 -22
  197. package/dist/module/coreum/nft/v1beta1/nft.js +99 -64
  198. package/dist/module/coreum/nft/v1beta1/query.d.ts +54 -124
  199. package/dist/module/coreum/nft/v1beta1/query.js +231 -183
  200. package/dist/module/coreum/nft/v1beta1/tx.d.ts +13 -19
  201. package/dist/module/coreum/nft/v1beta1/tx.js +47 -32
  202. package/dist/module/cosmos/extensions/distribution.d.ts +4 -4
  203. package/dist/module/cosmos/extensions/gov.d.ts +13 -13
  204. package/dist/module/cosmos/index.d.ts +8 -8
  205. package/dist/module/google/api/http.d.ts +2636 -6
  206. package/dist/module/google/protobuf/any.d.ts +14 -2
  207. package/dist/module/google/protobuf/duration.d.ts +14 -2
  208. package/dist/module/google/protobuf/timestamp.d.ts +14 -2
  209. package/dist/module/services/cosmostation.js +1 -1
  210. package/dist/module/tendermint/abci/types.d.ts +6360 -92
  211. package/dist/module/tendermint/crypto/keys.d.ts +14 -2
  212. package/dist/module/tendermint/crypto/proof.d.ts +152 -10
  213. package/dist/module/tendermint/types/params.d.ts +196 -12
  214. package/dist/module/tendermint/types/types.d.ts +1744 -26
  215. package/dist/module/tendermint/types/validator.d.ts +230 -6
  216. package/dist/module/tendermint/version/types.d.ts +28 -4
  217. package/dist/module/types/core.d.ts +2 -1
  218. package/dist/module/types/core.js +2 -0
  219. package/dist/module/utils/convertStringToAny.d.ts +0 -1
  220. package/dist/module/wasm/v1/authz.d.ts +20 -75
  221. package/dist/module/wasm/v1/authz.js +111 -119
  222. package/dist/module/wasm/v1/genesis.d.ts +14 -34
  223. package/dist/module/wasm/v1/genesis.js +161 -125
  224. package/dist/module/wasm/v1/ibc.d.ts +13 -26
  225. package/dist/module/wasm/v1/ibc.js +83 -62
  226. package/dist/module/wasm/v1/index.d.ts +1 -2
  227. package/dist/module/wasm/v1/pagination.d.ts +40 -4
  228. package/dist/module/wasm/v1/proposal.d.ts +23 -106
  229. package/dist/module/wasm/v1/proposal.js +562 -377
  230. package/dist/module/wasm/v1/query.d.ts +35 -187
  231. package/dist/module/wasm/v1/query.js +330 -301
  232. package/dist/module/wasm/v1/tx.d.ts +37 -210
  233. package/dist/module/wasm/v1/tx.js +551 -404
  234. package/dist/module/wasm/v1/types.d.ts +19 -67
  235. package/dist/module/wasm/v1/types.js +196 -156
  236. package/package.json +11 -10
@@ -1,61 +1,66 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.7.0
5
+ // protoc v3.21.12
6
+ // source: wasmd/proto/cosmwasm/wasm/v1/query.proto
5
7
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.QueryClientImpl = exports.QueryContractsByCreatorResponse = exports.QueryContractsByCreatorRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryPinnedCodesResponse = exports.QueryPinnedCodesRequest = exports.QueryCodesResponse = exports.QueryCodesRequest = exports.QueryCodeResponse = exports.CodeInfoResponse = exports.QueryCodeRequest = exports.QuerySmartContractStateResponse = exports.QuerySmartContractStateRequest = exports.QueryRawContractStateResponse = exports.QueryRawContractStateRequest = exports.QueryAllContractStateResponse = exports.QueryAllContractStateRequest = exports.QueryContractsByCodeResponse = exports.QueryContractsByCodeRequest = exports.QueryContractHistoryResponse = exports.QueryContractHistoryRequest = exports.QueryContractInfoResponse = exports.QueryContractInfoRequest = exports.protobufPackage = void 0;
8
+ exports.QueryClientImpl = exports.QueryServiceName = exports.QueryContractsByCreatorResponse = exports.QueryContractsByCreatorRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryPinnedCodesResponse = exports.QueryPinnedCodesRequest = exports.QueryCodesResponse = exports.QueryCodesRequest = exports.QueryCodeResponse = exports.CodeInfoResponse = exports.QueryCodeRequest = exports.QuerySmartContractStateResponse = exports.QuerySmartContractStateRequest = exports.QueryRawContractStateResponse = exports.QueryRawContractStateRequest = exports.QueryAllContractStateResponse = exports.QueryAllContractStateRequest = exports.QueryContractsByCodeResponse = exports.QueryContractsByCodeRequest = exports.QueryContractHistoryResponse = exports.QueryContractHistoryRequest = exports.QueryContractInfoResponse = exports.QueryContractInfoRequest = exports.protobufPackage = void 0;
7
9
  /* eslint-disable */
8
- const long_1 = __importDefault(require("long"));
9
- const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
- const pagination_1 = require("./pagination");
10
+ const binary_1 = require("cosmjs-types/binary");
11
+ const pagination_1 = require("cosmjs-types/cosmos/base/query/v1beta1/pagination");
11
12
  const types_1 = require("./types");
12
13
  exports.protobufPackage = "cosmwasm.wasm.v1";
13
14
  function createBaseQueryContractInfoRequest() {
14
15
  return { address: "" };
15
16
  }
16
17
  exports.QueryContractInfoRequest = {
17
- encode(message, writer = minimal_1.default.Writer.create()) {
18
+ encode(message, writer = new binary_1.BinaryWriter()) {
18
19
  if (message.address !== "") {
19
20
  writer.uint32(10).string(message.address);
20
21
  }
21
22
  return writer;
22
23
  },
23
24
  decode(input, length) {
24
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
25
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
25
26
  let end = length === undefined ? reader.len : reader.pos + length;
26
27
  const message = createBaseQueryContractInfoRequest();
27
28
  while (reader.pos < end) {
28
29
  const tag = reader.uint32();
29
30
  switch (tag >>> 3) {
30
- case 1:
31
+ case 1: {
31
32
  if (tag !== 10) {
32
33
  break;
33
34
  }
34
35
  message.address = reader.string();
35
36
  continue;
37
+ }
36
38
  }
37
39
  if ((tag & 7) === 4 || tag === 0) {
38
40
  break;
39
41
  }
40
- reader.skipType(tag & 7);
42
+ reader.skip(tag & 7);
41
43
  }
42
44
  return message;
43
45
  },
44
46
  fromJSON(object) {
45
- return { address: isSet(object.address) ? String(object.address) : "" };
47
+ return {
48
+ address: isSet(object.address) ? globalThis.String(object.address) : "",
49
+ };
46
50
  },
47
51
  toJSON(message) {
48
52
  const obj = {};
49
- message.address !== undefined && (obj.address = message.address);
53
+ if (message.address !== "") {
54
+ obj.address = message.address;
55
+ }
50
56
  return obj;
51
57
  },
52
58
  create(base) {
53
- return exports.QueryContractInfoRequest.fromPartial(base !== null && base !== void 0 ? base : {});
59
+ return exports.QueryContractInfoRequest.fromPartial(base ?? {});
54
60
  },
55
61
  fromPartial(object) {
56
- var _a;
57
62
  const message = createBaseQueryContractInfoRequest();
58
- message.address = (_a = object.address) !== null && _a !== void 0 ? _a : "";
63
+ message.address = object.address ?? "";
59
64
  return message;
60
65
  },
61
66
  };
@@ -63,7 +68,7 @@ function createBaseQueryContractInfoResponse() {
63
68
  return { address: "", contractInfo: undefined };
64
69
  }
65
70
  exports.QueryContractInfoResponse = {
66
- encode(message, writer = minimal_1.default.Writer.create()) {
71
+ encode(message, writer = new binary_1.BinaryWriter()) {
67
72
  if (message.address !== "") {
68
73
  writer.uint32(10).string(message.address);
69
74
  }
@@ -73,35 +78,37 @@ exports.QueryContractInfoResponse = {
73
78
  return writer;
74
79
  },
75
80
  decode(input, length) {
76
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
81
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
77
82
  let end = length === undefined ? reader.len : reader.pos + length;
78
83
  const message = createBaseQueryContractInfoResponse();
79
84
  while (reader.pos < end) {
80
85
  const tag = reader.uint32();
81
86
  switch (tag >>> 3) {
82
- case 1:
87
+ case 1: {
83
88
  if (tag !== 10) {
84
89
  break;
85
90
  }
86
91
  message.address = reader.string();
87
92
  continue;
88
- case 2:
93
+ }
94
+ case 2: {
89
95
  if (tag !== 18) {
90
96
  break;
91
97
  }
92
98
  message.contractInfo = types_1.ContractInfo.decode(reader, reader.uint32());
93
99
  continue;
100
+ }
94
101
  }
95
102
  if ((tag & 7) === 4 || tag === 0) {
96
103
  break;
97
104
  }
98
- reader.skipType(tag & 7);
105
+ reader.skip(tag & 7);
99
106
  }
100
107
  return message;
101
108
  },
102
109
  fromJSON(object) {
103
110
  return {
104
- address: isSet(object.address) ? String(object.address) : "",
111
+ address: isSet(object.address) ? globalThis.String(object.address) : "",
105
112
  contractInfo: isSet(object.contractInfo)
106
113
  ? types_1.ContractInfo.fromJSON(object.contractInfo)
107
114
  : undefined,
@@ -109,20 +116,20 @@ exports.QueryContractInfoResponse = {
109
116
  },
110
117
  toJSON(message) {
111
118
  const obj = {};
112
- message.address !== undefined && (obj.address = message.address);
113
- message.contractInfo !== undefined &&
114
- (obj.contractInfo = message.contractInfo
115
- ? types_1.ContractInfo.toJSON(message.contractInfo)
116
- : undefined);
119
+ if (message.address !== "") {
120
+ obj.address = message.address;
121
+ }
122
+ if (message.contractInfo !== undefined) {
123
+ obj.contractInfo = types_1.ContractInfo.toJSON(message.contractInfo);
124
+ }
117
125
  return obj;
118
126
  },
119
127
  create(base) {
120
- return exports.QueryContractInfoResponse.fromPartial(base !== null && base !== void 0 ? base : {});
128
+ return exports.QueryContractInfoResponse.fromPartial(base ?? {});
121
129
  },
122
130
  fromPartial(object) {
123
- var _a;
124
131
  const message = createBaseQueryContractInfoResponse();
125
- message.address = (_a = object.address) !== null && _a !== void 0 ? _a : "";
132
+ message.address = object.address ?? "";
126
133
  message.contractInfo =
127
134
  object.contractInfo !== undefined && object.contractInfo !== null
128
135
  ? types_1.ContractInfo.fromPartial(object.contractInfo)
@@ -134,7 +141,7 @@ function createBaseQueryContractHistoryRequest() {
134
141
  return { address: "", pagination: undefined };
135
142
  }
136
143
  exports.QueryContractHistoryRequest = {
137
- encode(message, writer = minimal_1.default.Writer.create()) {
144
+ encode(message, writer = new binary_1.BinaryWriter()) {
138
145
  if (message.address !== "") {
139
146
  writer.uint32(10).string(message.address);
140
147
  }
@@ -144,35 +151,37 @@ exports.QueryContractHistoryRequest = {
144
151
  return writer;
145
152
  },
146
153
  decode(input, length) {
147
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
154
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
148
155
  let end = length === undefined ? reader.len : reader.pos + length;
149
156
  const message = createBaseQueryContractHistoryRequest();
150
157
  while (reader.pos < end) {
151
158
  const tag = reader.uint32();
152
159
  switch (tag >>> 3) {
153
- case 1:
160
+ case 1: {
154
161
  if (tag !== 10) {
155
162
  break;
156
163
  }
157
164
  message.address = reader.string();
158
165
  continue;
159
- case 2:
166
+ }
167
+ case 2: {
160
168
  if (tag !== 18) {
161
169
  break;
162
170
  }
163
171
  message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
164
172
  continue;
173
+ }
165
174
  }
166
175
  if ((tag & 7) === 4 || tag === 0) {
167
176
  break;
168
177
  }
169
- reader.skipType(tag & 7);
178
+ reader.skip(tag & 7);
170
179
  }
171
180
  return message;
172
181
  },
173
182
  fromJSON(object) {
174
183
  return {
175
- address: isSet(object.address) ? String(object.address) : "",
184
+ address: isSet(object.address) ? globalThis.String(object.address) : "",
176
185
  pagination: isSet(object.pagination)
177
186
  ? pagination_1.PageRequest.fromJSON(object.pagination)
178
187
  : undefined,
@@ -180,20 +189,20 @@ exports.QueryContractHistoryRequest = {
180
189
  },
181
190
  toJSON(message) {
182
191
  const obj = {};
183
- message.address !== undefined && (obj.address = message.address);
184
- message.pagination !== undefined &&
185
- (obj.pagination = message.pagination
186
- ? pagination_1.PageRequest.toJSON(message.pagination)
187
- : undefined);
192
+ if (message.address !== "") {
193
+ obj.address = message.address;
194
+ }
195
+ if (message.pagination !== undefined) {
196
+ obj.pagination = pagination_1.PageRequest.toJSON(message.pagination);
197
+ }
188
198
  return obj;
189
199
  },
190
200
  create(base) {
191
- return exports.QueryContractHistoryRequest.fromPartial(base !== null && base !== void 0 ? base : {});
201
+ return exports.QueryContractHistoryRequest.fromPartial(base ?? {});
192
202
  },
193
203
  fromPartial(object) {
194
- var _a;
195
204
  const message = createBaseQueryContractHistoryRequest();
196
- message.address = (_a = object.address) !== null && _a !== void 0 ? _a : "";
205
+ message.address = object.address ?? "";
197
206
  message.pagination =
198
207
  object.pagination !== undefined && object.pagination !== null
199
208
  ? pagination_1.PageRequest.fromPartial(object.pagination)
@@ -205,7 +214,7 @@ function createBaseQueryContractHistoryResponse() {
205
214
  return { entries: [], pagination: undefined };
206
215
  }
207
216
  exports.QueryContractHistoryResponse = {
208
- encode(message, writer = minimal_1.default.Writer.create()) {
217
+ encode(message, writer = new binary_1.BinaryWriter()) {
209
218
  for (const v of message.entries) {
210
219
  types_1.ContractCodeHistoryEntry.encode(v, writer.uint32(10).fork()).ldelim();
211
220
  }
@@ -215,35 +224,37 @@ exports.QueryContractHistoryResponse = {
215
224
  return writer;
216
225
  },
217
226
  decode(input, length) {
218
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
227
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
219
228
  let end = length === undefined ? reader.len : reader.pos + length;
220
229
  const message = createBaseQueryContractHistoryResponse();
221
230
  while (reader.pos < end) {
222
231
  const tag = reader.uint32();
223
232
  switch (tag >>> 3) {
224
- case 1:
233
+ case 1: {
225
234
  if (tag !== 10) {
226
235
  break;
227
236
  }
228
237
  message.entries.push(types_1.ContractCodeHistoryEntry.decode(reader, reader.uint32()));
229
238
  continue;
230
- case 2:
239
+ }
240
+ case 2: {
231
241
  if (tag !== 18) {
232
242
  break;
233
243
  }
234
244
  message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
235
245
  continue;
246
+ }
236
247
  }
237
248
  if ((tag & 7) === 4 || tag === 0) {
238
249
  break;
239
250
  }
240
- reader.skipType(tag & 7);
251
+ reader.skip(tag & 7);
241
252
  }
242
253
  return message;
243
254
  },
244
255
  fromJSON(object) {
245
256
  return {
246
- entries: Array.isArray(object === null || object === void 0 ? void 0 : object.entries)
257
+ entries: globalThis.Array.isArray(object?.entries)
247
258
  ? object.entries.map((e) => types_1.ContractCodeHistoryEntry.fromJSON(e))
248
259
  : [],
249
260
  pagination: isSet(object.pagination)
@@ -253,26 +264,22 @@ exports.QueryContractHistoryResponse = {
253
264
  },
254
265
  toJSON(message) {
255
266
  const obj = {};
256
- if (message.entries) {
257
- obj.entries = message.entries.map((e) => e ? types_1.ContractCodeHistoryEntry.toJSON(e) : undefined);
267
+ if (message.entries?.length) {
268
+ obj.entries = message.entries.map((e) => types_1.ContractCodeHistoryEntry.toJSON(e));
258
269
  }
259
- else {
260
- obj.entries = [];
270
+ if (message.pagination !== undefined) {
271
+ obj.pagination = pagination_1.PageResponse.toJSON(message.pagination);
261
272
  }
262
- message.pagination !== undefined &&
263
- (obj.pagination = message.pagination
264
- ? pagination_1.PageResponse.toJSON(message.pagination)
265
- : undefined);
266
273
  return obj;
267
274
  },
268
275
  create(base) {
269
- return exports.QueryContractHistoryResponse.fromPartial(base !== null && base !== void 0 ? base : {});
276
+ return exports.QueryContractHistoryResponse.fromPartial(base ?? {});
270
277
  },
271
278
  fromPartial(object) {
272
- var _a;
273
279
  const message = createBaseQueryContractHistoryResponse();
274
280
  message.entries =
275
- ((_a = object.entries) === null || _a === void 0 ? void 0 : _a.map((e) => types_1.ContractCodeHistoryEntry.fromPartial(e))) || [];
281
+ object.entries?.map((e) => types_1.ContractCodeHistoryEntry.fromPartial(e)) ||
282
+ [];
276
283
  message.pagination =
277
284
  object.pagination !== undefined && object.pagination !== null
278
285
  ? pagination_1.PageResponse.fromPartial(object.pagination)
@@ -284,7 +291,7 @@ function createBaseQueryContractsByCodeRequest() {
284
291
  return { codeId: 0, pagination: undefined };
285
292
  }
286
293
  exports.QueryContractsByCodeRequest = {
287
- encode(message, writer = minimal_1.default.Writer.create()) {
294
+ encode(message, writer = new binary_1.BinaryWriter()) {
288
295
  if (message.codeId !== 0) {
289
296
  writer.uint32(8).uint64(message.codeId);
290
297
  }
@@ -294,35 +301,37 @@ exports.QueryContractsByCodeRequest = {
294
301
  return writer;
295
302
  },
296
303
  decode(input, length) {
297
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
304
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
298
305
  let end = length === undefined ? reader.len : reader.pos + length;
299
306
  const message = createBaseQueryContractsByCodeRequest();
300
307
  while (reader.pos < end) {
301
308
  const tag = reader.uint32();
302
309
  switch (tag >>> 3) {
303
- case 1:
310
+ case 1: {
304
311
  if (tag !== 8) {
305
312
  break;
306
313
  }
307
314
  message.codeId = longToNumber(reader.uint64());
308
315
  continue;
309
- case 2:
316
+ }
317
+ case 2: {
310
318
  if (tag !== 18) {
311
319
  break;
312
320
  }
313
321
  message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
314
322
  continue;
323
+ }
315
324
  }
316
325
  if ((tag & 7) === 4 || tag === 0) {
317
326
  break;
318
327
  }
319
- reader.skipType(tag & 7);
328
+ reader.skip(tag & 7);
320
329
  }
321
330
  return message;
322
331
  },
323
332
  fromJSON(object) {
324
333
  return {
325
- codeId: isSet(object.codeId) ? Number(object.codeId) : 0,
334
+ codeId: isSet(object.codeId) ? globalThis.Number(object.codeId) : 0,
326
335
  pagination: isSet(object.pagination)
327
336
  ? pagination_1.PageRequest.fromJSON(object.pagination)
328
337
  : undefined,
@@ -330,20 +339,20 @@ exports.QueryContractsByCodeRequest = {
330
339
  },
331
340
  toJSON(message) {
332
341
  const obj = {};
333
- message.codeId !== undefined && (obj.codeId = Math.round(message.codeId));
334
- message.pagination !== undefined &&
335
- (obj.pagination = message.pagination
336
- ? pagination_1.PageRequest.toJSON(message.pagination)
337
- : undefined);
342
+ if (message.codeId !== 0) {
343
+ obj.codeId = Math.round(message.codeId);
344
+ }
345
+ if (message.pagination !== undefined) {
346
+ obj.pagination = pagination_1.PageRequest.toJSON(message.pagination);
347
+ }
338
348
  return obj;
339
349
  },
340
350
  create(base) {
341
- return exports.QueryContractsByCodeRequest.fromPartial(base !== null && base !== void 0 ? base : {});
351
+ return exports.QueryContractsByCodeRequest.fromPartial(base ?? {});
342
352
  },
343
353
  fromPartial(object) {
344
- var _a;
345
354
  const message = createBaseQueryContractsByCodeRequest();
346
- message.codeId = (_a = object.codeId) !== null && _a !== void 0 ? _a : 0;
355
+ message.codeId = object.codeId ?? 0;
347
356
  message.pagination =
348
357
  object.pagination !== undefined && object.pagination !== null
349
358
  ? pagination_1.PageRequest.fromPartial(object.pagination)
@@ -355,7 +364,7 @@ function createBaseQueryContractsByCodeResponse() {
355
364
  return { contracts: [], pagination: undefined };
356
365
  }
357
366
  exports.QueryContractsByCodeResponse = {
358
- encode(message, writer = minimal_1.default.Writer.create()) {
367
+ encode(message, writer = new binary_1.BinaryWriter()) {
359
368
  for (const v of message.contracts) {
360
369
  writer.uint32(10).string(v);
361
370
  }
@@ -365,36 +374,38 @@ exports.QueryContractsByCodeResponse = {
365
374
  return writer;
366
375
  },
367
376
  decode(input, length) {
368
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
377
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
369
378
  let end = length === undefined ? reader.len : reader.pos + length;
370
379
  const message = createBaseQueryContractsByCodeResponse();
371
380
  while (reader.pos < end) {
372
381
  const tag = reader.uint32();
373
382
  switch (tag >>> 3) {
374
- case 1:
383
+ case 1: {
375
384
  if (tag !== 10) {
376
385
  break;
377
386
  }
378
387
  message.contracts.push(reader.string());
379
388
  continue;
380
- case 2:
389
+ }
390
+ case 2: {
381
391
  if (tag !== 18) {
382
392
  break;
383
393
  }
384
394
  message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
385
395
  continue;
396
+ }
386
397
  }
387
398
  if ((tag & 7) === 4 || tag === 0) {
388
399
  break;
389
400
  }
390
- reader.skipType(tag & 7);
401
+ reader.skip(tag & 7);
391
402
  }
392
403
  return message;
393
404
  },
394
405
  fromJSON(object) {
395
406
  return {
396
- contracts: Array.isArray(object === null || object === void 0 ? void 0 : object.contracts)
397
- ? object.contracts.map((e) => String(e))
407
+ contracts: globalThis.Array.isArray(object?.contracts)
408
+ ? object.contracts.map((e) => globalThis.String(e))
398
409
  : [],
399
410
  pagination: isSet(object.pagination)
400
411
  ? pagination_1.PageResponse.fromJSON(object.pagination)
@@ -403,25 +414,20 @@ exports.QueryContractsByCodeResponse = {
403
414
  },
404
415
  toJSON(message) {
405
416
  const obj = {};
406
- if (message.contracts) {
407
- obj.contracts = message.contracts.map((e) => e);
417
+ if (message.contracts?.length) {
418
+ obj.contracts = message.contracts;
408
419
  }
409
- else {
410
- obj.contracts = [];
420
+ if (message.pagination !== undefined) {
421
+ obj.pagination = pagination_1.PageResponse.toJSON(message.pagination);
411
422
  }
412
- message.pagination !== undefined &&
413
- (obj.pagination = message.pagination
414
- ? pagination_1.PageResponse.toJSON(message.pagination)
415
- : undefined);
416
423
  return obj;
417
424
  },
418
425
  create(base) {
419
- return exports.QueryContractsByCodeResponse.fromPartial(base !== null && base !== void 0 ? base : {});
426
+ return exports.QueryContractsByCodeResponse.fromPartial(base ?? {});
420
427
  },
421
428
  fromPartial(object) {
422
- var _a;
423
429
  const message = createBaseQueryContractsByCodeResponse();
424
- message.contracts = ((_a = object.contracts) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
430
+ message.contracts = object.contracts?.map((e) => e) || [];
425
431
  message.pagination =
426
432
  object.pagination !== undefined && object.pagination !== null
427
433
  ? pagination_1.PageResponse.fromPartial(object.pagination)
@@ -433,7 +439,7 @@ function createBaseQueryAllContractStateRequest() {
433
439
  return { address: "", pagination: undefined };
434
440
  }
435
441
  exports.QueryAllContractStateRequest = {
436
- encode(message, writer = minimal_1.default.Writer.create()) {
442
+ encode(message, writer = new binary_1.BinaryWriter()) {
437
443
  if (message.address !== "") {
438
444
  writer.uint32(10).string(message.address);
439
445
  }
@@ -443,35 +449,37 @@ exports.QueryAllContractStateRequest = {
443
449
  return writer;
444
450
  },
445
451
  decode(input, length) {
446
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
452
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
447
453
  let end = length === undefined ? reader.len : reader.pos + length;
448
454
  const message = createBaseQueryAllContractStateRequest();
449
455
  while (reader.pos < end) {
450
456
  const tag = reader.uint32();
451
457
  switch (tag >>> 3) {
452
- case 1:
458
+ case 1: {
453
459
  if (tag !== 10) {
454
460
  break;
455
461
  }
456
462
  message.address = reader.string();
457
463
  continue;
458
- case 2:
464
+ }
465
+ case 2: {
459
466
  if (tag !== 18) {
460
467
  break;
461
468
  }
462
469
  message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
463
470
  continue;
471
+ }
464
472
  }
465
473
  if ((tag & 7) === 4 || tag === 0) {
466
474
  break;
467
475
  }
468
- reader.skipType(tag & 7);
476
+ reader.skip(tag & 7);
469
477
  }
470
478
  return message;
471
479
  },
472
480
  fromJSON(object) {
473
481
  return {
474
- address: isSet(object.address) ? String(object.address) : "",
482
+ address: isSet(object.address) ? globalThis.String(object.address) : "",
475
483
  pagination: isSet(object.pagination)
476
484
  ? pagination_1.PageRequest.fromJSON(object.pagination)
477
485
  : undefined,
@@ -479,20 +487,20 @@ exports.QueryAllContractStateRequest = {
479
487
  },
480
488
  toJSON(message) {
481
489
  const obj = {};
482
- message.address !== undefined && (obj.address = message.address);
483
- message.pagination !== undefined &&
484
- (obj.pagination = message.pagination
485
- ? pagination_1.PageRequest.toJSON(message.pagination)
486
- : undefined);
490
+ if (message.address !== "") {
491
+ obj.address = message.address;
492
+ }
493
+ if (message.pagination !== undefined) {
494
+ obj.pagination = pagination_1.PageRequest.toJSON(message.pagination);
495
+ }
487
496
  return obj;
488
497
  },
489
498
  create(base) {
490
- return exports.QueryAllContractStateRequest.fromPartial(base !== null && base !== void 0 ? base : {});
499
+ return exports.QueryAllContractStateRequest.fromPartial(base ?? {});
491
500
  },
492
501
  fromPartial(object) {
493
- var _a;
494
502
  const message = createBaseQueryAllContractStateRequest();
495
- message.address = (_a = object.address) !== null && _a !== void 0 ? _a : "";
503
+ message.address = object.address ?? "";
496
504
  message.pagination =
497
505
  object.pagination !== undefined && object.pagination !== null
498
506
  ? pagination_1.PageRequest.fromPartial(object.pagination)
@@ -504,7 +512,7 @@ function createBaseQueryAllContractStateResponse() {
504
512
  return { models: [], pagination: undefined };
505
513
  }
506
514
  exports.QueryAllContractStateResponse = {
507
- encode(message, writer = minimal_1.default.Writer.create()) {
515
+ encode(message, writer = new binary_1.BinaryWriter()) {
508
516
  for (const v of message.models) {
509
517
  types_1.Model.encode(v, writer.uint32(10).fork()).ldelim();
510
518
  }
@@ -514,35 +522,37 @@ exports.QueryAllContractStateResponse = {
514
522
  return writer;
515
523
  },
516
524
  decode(input, length) {
517
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
525
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
518
526
  let end = length === undefined ? reader.len : reader.pos + length;
519
527
  const message = createBaseQueryAllContractStateResponse();
520
528
  while (reader.pos < end) {
521
529
  const tag = reader.uint32();
522
530
  switch (tag >>> 3) {
523
- case 1:
531
+ case 1: {
524
532
  if (tag !== 10) {
525
533
  break;
526
534
  }
527
535
  message.models.push(types_1.Model.decode(reader, reader.uint32()));
528
536
  continue;
529
- case 2:
537
+ }
538
+ case 2: {
530
539
  if (tag !== 18) {
531
540
  break;
532
541
  }
533
542
  message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
534
543
  continue;
544
+ }
535
545
  }
536
546
  if ((tag & 7) === 4 || tag === 0) {
537
547
  break;
538
548
  }
539
- reader.skipType(tag & 7);
549
+ reader.skip(tag & 7);
540
550
  }
541
551
  return message;
542
552
  },
543
553
  fromJSON(object) {
544
554
  return {
545
- models: Array.isArray(object === null || object === void 0 ? void 0 : object.models)
555
+ models: globalThis.Array.isArray(object?.models)
546
556
  ? object.models.map((e) => types_1.Model.fromJSON(e))
547
557
  : [],
548
558
  pagination: isSet(object.pagination)
@@ -552,25 +562,20 @@ exports.QueryAllContractStateResponse = {
552
562
  },
553
563
  toJSON(message) {
554
564
  const obj = {};
555
- if (message.models) {
556
- obj.models = message.models.map((e) => (e ? types_1.Model.toJSON(e) : undefined));
565
+ if (message.models?.length) {
566
+ obj.models = message.models.map((e) => types_1.Model.toJSON(e));
557
567
  }
558
- else {
559
- obj.models = [];
568
+ if (message.pagination !== undefined) {
569
+ obj.pagination = pagination_1.PageResponse.toJSON(message.pagination);
560
570
  }
561
- message.pagination !== undefined &&
562
- (obj.pagination = message.pagination
563
- ? pagination_1.PageResponse.toJSON(message.pagination)
564
- : undefined);
565
571
  return obj;
566
572
  },
567
573
  create(base) {
568
- return exports.QueryAllContractStateResponse.fromPartial(base !== null && base !== void 0 ? base : {});
574
+ return exports.QueryAllContractStateResponse.fromPartial(base ?? {});
569
575
  },
570
576
  fromPartial(object) {
571
- var _a;
572
577
  const message = createBaseQueryAllContractStateResponse();
573
- message.models = ((_a = object.models) === null || _a === void 0 ? void 0 : _a.map((e) => types_1.Model.fromPartial(e))) || [];
578
+ message.models = object.models?.map((e) => types_1.Model.fromPartial(e)) || [];
574
579
  message.pagination =
575
580
  object.pagination !== undefined && object.pagination !== null
576
581
  ? pagination_1.PageResponse.fromPartial(object.pagination)
@@ -579,10 +584,10 @@ exports.QueryAllContractStateResponse = {
579
584
  },
580
585
  };
581
586
  function createBaseQueryRawContractStateRequest() {
582
- return { address: "", queryData: new Uint8Array() };
587
+ return { address: "", queryData: new Uint8Array(0) };
583
588
  }
584
589
  exports.QueryRawContractStateRequest = {
585
- encode(message, writer = minimal_1.default.Writer.create()) {
590
+ encode(message, writer = new binary_1.BinaryWriter()) {
586
591
  if (message.address !== "") {
587
592
  writer.uint32(10).string(message.address);
588
593
  }
@@ -592,86 +597,91 @@ exports.QueryRawContractStateRequest = {
592
597
  return writer;
593
598
  },
594
599
  decode(input, length) {
595
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
600
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
596
601
  let end = length === undefined ? reader.len : reader.pos + length;
597
602
  const message = createBaseQueryRawContractStateRequest();
598
603
  while (reader.pos < end) {
599
604
  const tag = reader.uint32();
600
605
  switch (tag >>> 3) {
601
- case 1:
606
+ case 1: {
602
607
  if (tag !== 10) {
603
608
  break;
604
609
  }
605
610
  message.address = reader.string();
606
611
  continue;
607
- case 2:
612
+ }
613
+ case 2: {
608
614
  if (tag !== 18) {
609
615
  break;
610
616
  }
611
617
  message.queryData = reader.bytes();
612
618
  continue;
619
+ }
613
620
  }
614
621
  if ((tag & 7) === 4 || tag === 0) {
615
622
  break;
616
623
  }
617
- reader.skipType(tag & 7);
624
+ reader.skip(tag & 7);
618
625
  }
619
626
  return message;
620
627
  },
621
628
  fromJSON(object) {
622
629
  return {
623
- address: isSet(object.address) ? String(object.address) : "",
630
+ address: isSet(object.address) ? globalThis.String(object.address) : "",
624
631
  queryData: isSet(object.queryData)
625
632
  ? bytesFromBase64(object.queryData)
626
- : new Uint8Array(),
633
+ : new Uint8Array(0),
627
634
  };
628
635
  },
629
636
  toJSON(message) {
630
637
  const obj = {};
631
- message.address !== undefined && (obj.address = message.address);
632
- message.queryData !== undefined &&
633
- (obj.queryData = base64FromBytes(message.queryData !== undefined ? message.queryData : new Uint8Array()));
638
+ if (message.address !== "") {
639
+ obj.address = message.address;
640
+ }
641
+ if (message.queryData.length !== 0) {
642
+ obj.queryData = base64FromBytes(message.queryData);
643
+ }
634
644
  return obj;
635
645
  },
636
646
  create(base) {
637
- return exports.QueryRawContractStateRequest.fromPartial(base !== null && base !== void 0 ? base : {});
647
+ return exports.QueryRawContractStateRequest.fromPartial(base ?? {});
638
648
  },
639
649
  fromPartial(object) {
640
- var _a, _b;
641
650
  const message = createBaseQueryRawContractStateRequest();
642
- message.address = (_a = object.address) !== null && _a !== void 0 ? _a : "";
643
- message.queryData = (_b = object.queryData) !== null && _b !== void 0 ? _b : new Uint8Array();
651
+ message.address = object.address ?? "";
652
+ message.queryData = object.queryData ?? new Uint8Array(0);
644
653
  return message;
645
654
  },
646
655
  };
647
656
  function createBaseQueryRawContractStateResponse() {
648
- return { data: new Uint8Array() };
657
+ return { data: new Uint8Array(0) };
649
658
  }
650
659
  exports.QueryRawContractStateResponse = {
651
- encode(message, writer = minimal_1.default.Writer.create()) {
660
+ encode(message, writer = new binary_1.BinaryWriter()) {
652
661
  if (message.data.length !== 0) {
653
662
  writer.uint32(10).bytes(message.data);
654
663
  }
655
664
  return writer;
656
665
  },
657
666
  decode(input, length) {
658
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
667
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
659
668
  let end = length === undefined ? reader.len : reader.pos + length;
660
669
  const message = createBaseQueryRawContractStateResponse();
661
670
  while (reader.pos < end) {
662
671
  const tag = reader.uint32();
663
672
  switch (tag >>> 3) {
664
- case 1:
673
+ case 1: {
665
674
  if (tag !== 10) {
666
675
  break;
667
676
  }
668
677
  message.data = reader.bytes();
669
678
  continue;
679
+ }
670
680
  }
671
681
  if ((tag & 7) === 4 || tag === 0) {
672
682
  break;
673
683
  }
674
- reader.skipType(tag & 7);
684
+ reader.skip(tag & 7);
675
685
  }
676
686
  return message;
677
687
  },
@@ -679,30 +689,30 @@ exports.QueryRawContractStateResponse = {
679
689
  return {
680
690
  data: isSet(object.data)
681
691
  ? bytesFromBase64(object.data)
682
- : new Uint8Array(),
692
+ : new Uint8Array(0),
683
693
  };
684
694
  },
685
695
  toJSON(message) {
686
696
  const obj = {};
687
- message.data !== undefined &&
688
- (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
697
+ if (message.data.length !== 0) {
698
+ obj.data = base64FromBytes(message.data);
699
+ }
689
700
  return obj;
690
701
  },
691
702
  create(base) {
692
- return exports.QueryRawContractStateResponse.fromPartial(base !== null && base !== void 0 ? base : {});
703
+ return exports.QueryRawContractStateResponse.fromPartial(base ?? {});
693
704
  },
694
705
  fromPartial(object) {
695
- var _a;
696
706
  const message = createBaseQueryRawContractStateResponse();
697
- message.data = (_a = object.data) !== null && _a !== void 0 ? _a : new Uint8Array();
707
+ message.data = object.data ?? new Uint8Array(0);
698
708
  return message;
699
709
  },
700
710
  };
701
711
  function createBaseQuerySmartContractStateRequest() {
702
- return { address: "", queryData: new Uint8Array() };
712
+ return { address: "", queryData: new Uint8Array(0) };
703
713
  }
704
714
  exports.QuerySmartContractStateRequest = {
705
- encode(message, writer = minimal_1.default.Writer.create()) {
715
+ encode(message, writer = new binary_1.BinaryWriter()) {
706
716
  if (message.address !== "") {
707
717
  writer.uint32(10).string(message.address);
708
718
  }
@@ -712,86 +722,91 @@ exports.QuerySmartContractStateRequest = {
712
722
  return writer;
713
723
  },
714
724
  decode(input, length) {
715
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
725
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
716
726
  let end = length === undefined ? reader.len : reader.pos + length;
717
727
  const message = createBaseQuerySmartContractStateRequest();
718
728
  while (reader.pos < end) {
719
729
  const tag = reader.uint32();
720
730
  switch (tag >>> 3) {
721
- case 1:
731
+ case 1: {
722
732
  if (tag !== 10) {
723
733
  break;
724
734
  }
725
735
  message.address = reader.string();
726
736
  continue;
727
- case 2:
737
+ }
738
+ case 2: {
728
739
  if (tag !== 18) {
729
740
  break;
730
741
  }
731
742
  message.queryData = reader.bytes();
732
743
  continue;
744
+ }
733
745
  }
734
746
  if ((tag & 7) === 4 || tag === 0) {
735
747
  break;
736
748
  }
737
- reader.skipType(tag & 7);
749
+ reader.skip(tag & 7);
738
750
  }
739
751
  return message;
740
752
  },
741
753
  fromJSON(object) {
742
754
  return {
743
- address: isSet(object.address) ? String(object.address) : "",
755
+ address: isSet(object.address) ? globalThis.String(object.address) : "",
744
756
  queryData: isSet(object.queryData)
745
757
  ? bytesFromBase64(object.queryData)
746
- : new Uint8Array(),
758
+ : new Uint8Array(0),
747
759
  };
748
760
  },
749
761
  toJSON(message) {
750
762
  const obj = {};
751
- message.address !== undefined && (obj.address = message.address);
752
- message.queryData !== undefined &&
753
- (obj.queryData = base64FromBytes(message.queryData !== undefined ? message.queryData : new Uint8Array()));
763
+ if (message.address !== "") {
764
+ obj.address = message.address;
765
+ }
766
+ if (message.queryData.length !== 0) {
767
+ obj.queryData = base64FromBytes(message.queryData);
768
+ }
754
769
  return obj;
755
770
  },
756
771
  create(base) {
757
- return exports.QuerySmartContractStateRequest.fromPartial(base !== null && base !== void 0 ? base : {});
772
+ return exports.QuerySmartContractStateRequest.fromPartial(base ?? {});
758
773
  },
759
774
  fromPartial(object) {
760
- var _a, _b;
761
775
  const message = createBaseQuerySmartContractStateRequest();
762
- message.address = (_a = object.address) !== null && _a !== void 0 ? _a : "";
763
- message.queryData = (_b = object.queryData) !== null && _b !== void 0 ? _b : new Uint8Array();
776
+ message.address = object.address ?? "";
777
+ message.queryData = object.queryData ?? new Uint8Array(0);
764
778
  return message;
765
779
  },
766
780
  };
767
781
  function createBaseQuerySmartContractStateResponse() {
768
- return { data: new Uint8Array() };
782
+ return { data: new Uint8Array(0) };
769
783
  }
770
784
  exports.QuerySmartContractStateResponse = {
771
- encode(message, writer = minimal_1.default.Writer.create()) {
785
+ encode(message, writer = new binary_1.BinaryWriter()) {
772
786
  if (message.data.length !== 0) {
773
787
  writer.uint32(10).bytes(message.data);
774
788
  }
775
789
  return writer;
776
790
  },
777
791
  decode(input, length) {
778
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
792
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
779
793
  let end = length === undefined ? reader.len : reader.pos + length;
780
794
  const message = createBaseQuerySmartContractStateResponse();
781
795
  while (reader.pos < end) {
782
796
  const tag = reader.uint32();
783
797
  switch (tag >>> 3) {
784
- case 1:
798
+ case 1: {
785
799
  if (tag !== 10) {
786
800
  break;
787
801
  }
788
802
  message.data = reader.bytes();
789
803
  continue;
804
+ }
790
805
  }
791
806
  if ((tag & 7) === 4 || tag === 0) {
792
807
  break;
793
808
  }
794
- reader.skipType(tag & 7);
809
+ reader.skip(tag & 7);
795
810
  }
796
811
  return message;
797
812
  },
@@ -799,22 +814,22 @@ exports.QuerySmartContractStateResponse = {
799
814
  return {
800
815
  data: isSet(object.data)
801
816
  ? bytesFromBase64(object.data)
802
- : new Uint8Array(),
817
+ : new Uint8Array(0),
803
818
  };
804
819
  },
805
820
  toJSON(message) {
806
821
  const obj = {};
807
- message.data !== undefined &&
808
- (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
822
+ if (message.data.length !== 0) {
823
+ obj.data = base64FromBytes(message.data);
824
+ }
809
825
  return obj;
810
826
  },
811
827
  create(base) {
812
- return exports.QuerySmartContractStateResponse.fromPartial(base !== null && base !== void 0 ? base : {});
828
+ return exports.QuerySmartContractStateResponse.fromPartial(base ?? {});
813
829
  },
814
830
  fromPartial(object) {
815
- var _a;
816
831
  const message = createBaseQuerySmartContractStateResponse();
817
- message.data = (_a = object.data) !== null && _a !== void 0 ? _a : new Uint8Array();
832
+ message.data = object.data ?? new Uint8Array(0);
818
833
  return message;
819
834
  },
820
835
  };
@@ -822,48 +837,52 @@ function createBaseQueryCodeRequest() {
822
837
  return { codeId: 0 };
823
838
  }
824
839
  exports.QueryCodeRequest = {
825
- encode(message, writer = minimal_1.default.Writer.create()) {
840
+ encode(message, writer = new binary_1.BinaryWriter()) {
826
841
  if (message.codeId !== 0) {
827
842
  writer.uint32(8).uint64(message.codeId);
828
843
  }
829
844
  return writer;
830
845
  },
831
846
  decode(input, length) {
832
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
847
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
833
848
  let end = length === undefined ? reader.len : reader.pos + length;
834
849
  const message = createBaseQueryCodeRequest();
835
850
  while (reader.pos < end) {
836
851
  const tag = reader.uint32();
837
852
  switch (tag >>> 3) {
838
- case 1:
853
+ case 1: {
839
854
  if (tag !== 8) {
840
855
  break;
841
856
  }
842
857
  message.codeId = longToNumber(reader.uint64());
843
858
  continue;
859
+ }
844
860
  }
845
861
  if ((tag & 7) === 4 || tag === 0) {
846
862
  break;
847
863
  }
848
- reader.skipType(tag & 7);
864
+ reader.skip(tag & 7);
849
865
  }
850
866
  return message;
851
867
  },
852
868
  fromJSON(object) {
853
- return { codeId: isSet(object.codeId) ? Number(object.codeId) : 0 };
869
+ return {
870
+ codeId: isSet(object.codeId) ? globalThis.Number(object.codeId) : 0,
871
+ };
854
872
  },
855
873
  toJSON(message) {
856
874
  const obj = {};
857
- message.codeId !== undefined && (obj.codeId = Math.round(message.codeId));
875
+ if (message.codeId !== 0) {
876
+ obj.codeId = Math.round(message.codeId);
877
+ }
858
878
  return obj;
859
879
  },
860
880
  create(base) {
861
- return exports.QueryCodeRequest.fromPartial(base !== null && base !== void 0 ? base : {});
881
+ return exports.QueryCodeRequest.fromPartial(base ?? {});
862
882
  },
863
883
  fromPartial(object) {
864
- var _a;
865
884
  const message = createBaseQueryCodeRequest();
866
- message.codeId = (_a = object.codeId) !== null && _a !== void 0 ? _a : 0;
885
+ message.codeId = object.codeId ?? 0;
867
886
  return message;
868
887
  },
869
888
  };
@@ -871,12 +890,12 @@ function createBaseCodeInfoResponse() {
871
890
  return {
872
891
  codeId: 0,
873
892
  creator: "",
874
- dataHash: new Uint8Array(),
893
+ dataHash: new Uint8Array(0),
875
894
  instantiatePermission: undefined,
876
895
  };
877
896
  }
878
897
  exports.CodeInfoResponse = {
879
- encode(message, writer = minimal_1.default.Writer.create()) {
898
+ encode(message, writer = new binary_1.BinaryWriter()) {
880
899
  if (message.codeId !== 0) {
881
900
  writer.uint32(8).uint64(message.codeId);
882
901
  }
@@ -892,51 +911,55 @@ exports.CodeInfoResponse = {
892
911
  return writer;
893
912
  },
894
913
  decode(input, length) {
895
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
914
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
896
915
  let end = length === undefined ? reader.len : reader.pos + length;
897
916
  const message = createBaseCodeInfoResponse();
898
917
  while (reader.pos < end) {
899
918
  const tag = reader.uint32();
900
919
  switch (tag >>> 3) {
901
- case 1:
920
+ case 1: {
902
921
  if (tag !== 8) {
903
922
  break;
904
923
  }
905
924
  message.codeId = longToNumber(reader.uint64());
906
925
  continue;
907
- case 2:
926
+ }
927
+ case 2: {
908
928
  if (tag !== 18) {
909
929
  break;
910
930
  }
911
931
  message.creator = reader.string();
912
932
  continue;
913
- case 3:
933
+ }
934
+ case 3: {
914
935
  if (tag !== 26) {
915
936
  break;
916
937
  }
917
938
  message.dataHash = reader.bytes();
918
939
  continue;
919
- case 6:
940
+ }
941
+ case 6: {
920
942
  if (tag !== 50) {
921
943
  break;
922
944
  }
923
945
  message.instantiatePermission = types_1.AccessConfig.decode(reader, reader.uint32());
924
946
  continue;
947
+ }
925
948
  }
926
949
  if ((tag & 7) === 4 || tag === 0) {
927
950
  break;
928
951
  }
929
- reader.skipType(tag & 7);
952
+ reader.skip(tag & 7);
930
953
  }
931
954
  return message;
932
955
  },
933
956
  fromJSON(object) {
934
957
  return {
935
- codeId: isSet(object.codeId) ? Number(object.codeId) : 0,
936
- creator: isSet(object.creator) ? String(object.creator) : "",
958
+ codeId: isSet(object.codeId) ? globalThis.Number(object.codeId) : 0,
959
+ creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
937
960
  dataHash: isSet(object.dataHash)
938
961
  ? bytesFromBase64(object.dataHash)
939
- : new Uint8Array(),
962
+ : new Uint8Array(0),
940
963
  instantiatePermission: isSet(object.instantiatePermission)
941
964
  ? types_1.AccessConfig.fromJSON(object.instantiatePermission)
942
965
  : undefined,
@@ -944,25 +967,28 @@ exports.CodeInfoResponse = {
944
967
  },
945
968
  toJSON(message) {
946
969
  const obj = {};
947
- message.codeId !== undefined && (obj.codeId = Math.round(message.codeId));
948
- message.creator !== undefined && (obj.creator = message.creator);
949
- message.dataHash !== undefined &&
950
- (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array()));
951
- message.instantiatePermission !== undefined &&
952
- (obj.instantiatePermission = message.instantiatePermission
953
- ? types_1.AccessConfig.toJSON(message.instantiatePermission)
954
- : undefined);
970
+ if (message.codeId !== 0) {
971
+ obj.codeId = Math.round(message.codeId);
972
+ }
973
+ if (message.creator !== "") {
974
+ obj.creator = message.creator;
975
+ }
976
+ if (message.dataHash.length !== 0) {
977
+ obj.dataHash = base64FromBytes(message.dataHash);
978
+ }
979
+ if (message.instantiatePermission !== undefined) {
980
+ obj.instantiatePermission = types_1.AccessConfig.toJSON(message.instantiatePermission);
981
+ }
955
982
  return obj;
956
983
  },
957
984
  create(base) {
958
- return exports.CodeInfoResponse.fromPartial(base !== null && base !== void 0 ? base : {});
985
+ return exports.CodeInfoResponse.fromPartial(base ?? {});
959
986
  },
960
987
  fromPartial(object) {
961
- var _a, _b, _c;
962
988
  const message = createBaseCodeInfoResponse();
963
- message.codeId = (_a = object.codeId) !== null && _a !== void 0 ? _a : 0;
964
- message.creator = (_b = object.creator) !== null && _b !== void 0 ? _b : "";
965
- message.dataHash = (_c = object.dataHash) !== null && _c !== void 0 ? _c : new Uint8Array();
989
+ message.codeId = object.codeId ?? 0;
990
+ message.creator = object.creator ?? "";
991
+ message.dataHash = object.dataHash ?? new Uint8Array(0);
966
992
  message.instantiatePermission =
967
993
  object.instantiatePermission !== undefined &&
968
994
  object.instantiatePermission !== null
@@ -972,10 +998,10 @@ exports.CodeInfoResponse = {
972
998
  },
973
999
  };
974
1000
  function createBaseQueryCodeResponse() {
975
- return { codeInfo: undefined, data: new Uint8Array() };
1001
+ return { codeInfo: undefined, data: new Uint8Array(0) };
976
1002
  }
977
1003
  exports.QueryCodeResponse = {
978
- encode(message, writer = minimal_1.default.Writer.create()) {
1004
+ encode(message, writer = new binary_1.BinaryWriter()) {
979
1005
  if (message.codeInfo !== undefined) {
980
1006
  exports.CodeInfoResponse.encode(message.codeInfo, writer.uint32(10).fork()).ldelim();
981
1007
  }
@@ -985,29 +1011,31 @@ exports.QueryCodeResponse = {
985
1011
  return writer;
986
1012
  },
987
1013
  decode(input, length) {
988
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
1014
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
989
1015
  let end = length === undefined ? reader.len : reader.pos + length;
990
1016
  const message = createBaseQueryCodeResponse();
991
1017
  while (reader.pos < end) {
992
1018
  const tag = reader.uint32();
993
1019
  switch (tag >>> 3) {
994
- case 1:
1020
+ case 1: {
995
1021
  if (tag !== 10) {
996
1022
  break;
997
1023
  }
998
1024
  message.codeInfo = exports.CodeInfoResponse.decode(reader, reader.uint32());
999
1025
  continue;
1000
- case 2:
1026
+ }
1027
+ case 2: {
1001
1028
  if (tag !== 18) {
1002
1029
  break;
1003
1030
  }
1004
1031
  message.data = reader.bytes();
1005
1032
  continue;
1033
+ }
1006
1034
  }
1007
1035
  if ((tag & 7) === 4 || tag === 0) {
1008
1036
  break;
1009
1037
  }
1010
- reader.skipType(tag & 7);
1038
+ reader.skip(tag & 7);
1011
1039
  }
1012
1040
  return message;
1013
1041
  },
@@ -1018,30 +1046,29 @@ exports.QueryCodeResponse = {
1018
1046
  : undefined,
1019
1047
  data: isSet(object.data)
1020
1048
  ? bytesFromBase64(object.data)
1021
- : new Uint8Array(),
1049
+ : new Uint8Array(0),
1022
1050
  };
1023
1051
  },
1024
1052
  toJSON(message) {
1025
1053
  const obj = {};
1026
- message.codeInfo !== undefined &&
1027
- (obj.codeInfo = message.codeInfo
1028
- ? exports.CodeInfoResponse.toJSON(message.codeInfo)
1029
- : undefined);
1030
- message.data !== undefined &&
1031
- (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
1054
+ if (message.codeInfo !== undefined) {
1055
+ obj.codeInfo = exports.CodeInfoResponse.toJSON(message.codeInfo);
1056
+ }
1057
+ if (message.data.length !== 0) {
1058
+ obj.data = base64FromBytes(message.data);
1059
+ }
1032
1060
  return obj;
1033
1061
  },
1034
1062
  create(base) {
1035
- return exports.QueryCodeResponse.fromPartial(base !== null && base !== void 0 ? base : {});
1063
+ return exports.QueryCodeResponse.fromPartial(base ?? {});
1036
1064
  },
1037
1065
  fromPartial(object) {
1038
- var _a;
1039
1066
  const message = createBaseQueryCodeResponse();
1040
1067
  message.codeInfo =
1041
1068
  object.codeInfo !== undefined && object.codeInfo !== null
1042
1069
  ? exports.CodeInfoResponse.fromPartial(object.codeInfo)
1043
1070
  : undefined;
1044
- message.data = (_a = object.data) !== null && _a !== void 0 ? _a : new Uint8Array();
1071
+ message.data = object.data ?? new Uint8Array(0);
1045
1072
  return message;
1046
1073
  },
1047
1074
  };
@@ -1049,30 +1076,31 @@ function createBaseQueryCodesRequest() {
1049
1076
  return { pagination: undefined };
1050
1077
  }
1051
1078
  exports.QueryCodesRequest = {
1052
- encode(message, writer = minimal_1.default.Writer.create()) {
1079
+ encode(message, writer = new binary_1.BinaryWriter()) {
1053
1080
  if (message.pagination !== undefined) {
1054
1081
  pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
1055
1082
  }
1056
1083
  return writer;
1057
1084
  },
1058
1085
  decode(input, length) {
1059
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
1086
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
1060
1087
  let end = length === undefined ? reader.len : reader.pos + length;
1061
1088
  const message = createBaseQueryCodesRequest();
1062
1089
  while (reader.pos < end) {
1063
1090
  const tag = reader.uint32();
1064
1091
  switch (tag >>> 3) {
1065
- case 1:
1092
+ case 1: {
1066
1093
  if (tag !== 10) {
1067
1094
  break;
1068
1095
  }
1069
1096
  message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
1070
1097
  continue;
1098
+ }
1071
1099
  }
1072
1100
  if ((tag & 7) === 4 || tag === 0) {
1073
1101
  break;
1074
1102
  }
1075
- reader.skipType(tag & 7);
1103
+ reader.skip(tag & 7);
1076
1104
  }
1077
1105
  return message;
1078
1106
  },
@@ -1085,14 +1113,13 @@ exports.QueryCodesRequest = {
1085
1113
  },
1086
1114
  toJSON(message) {
1087
1115
  const obj = {};
1088
- message.pagination !== undefined &&
1089
- (obj.pagination = message.pagination
1090
- ? pagination_1.PageRequest.toJSON(message.pagination)
1091
- : undefined);
1116
+ if (message.pagination !== undefined) {
1117
+ obj.pagination = pagination_1.PageRequest.toJSON(message.pagination);
1118
+ }
1092
1119
  return obj;
1093
1120
  },
1094
1121
  create(base) {
1095
- return exports.QueryCodesRequest.fromPartial(base !== null && base !== void 0 ? base : {});
1122
+ return exports.QueryCodesRequest.fromPartial(base ?? {});
1096
1123
  },
1097
1124
  fromPartial(object) {
1098
1125
  const message = createBaseQueryCodesRequest();
@@ -1107,7 +1134,7 @@ function createBaseQueryCodesResponse() {
1107
1134
  return { codeInfos: [], pagination: undefined };
1108
1135
  }
1109
1136
  exports.QueryCodesResponse = {
1110
- encode(message, writer = minimal_1.default.Writer.create()) {
1137
+ encode(message, writer = new binary_1.BinaryWriter()) {
1111
1138
  for (const v of message.codeInfos) {
1112
1139
  exports.CodeInfoResponse.encode(v, writer.uint32(10).fork()).ldelim();
1113
1140
  }
@@ -1117,35 +1144,37 @@ exports.QueryCodesResponse = {
1117
1144
  return writer;
1118
1145
  },
1119
1146
  decode(input, length) {
1120
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
1147
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
1121
1148
  let end = length === undefined ? reader.len : reader.pos + length;
1122
1149
  const message = createBaseQueryCodesResponse();
1123
1150
  while (reader.pos < end) {
1124
1151
  const tag = reader.uint32();
1125
1152
  switch (tag >>> 3) {
1126
- case 1:
1153
+ case 1: {
1127
1154
  if (tag !== 10) {
1128
1155
  break;
1129
1156
  }
1130
1157
  message.codeInfos.push(exports.CodeInfoResponse.decode(reader, reader.uint32()));
1131
1158
  continue;
1132
- case 2:
1159
+ }
1160
+ case 2: {
1133
1161
  if (tag !== 18) {
1134
1162
  break;
1135
1163
  }
1136
1164
  message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
1137
1165
  continue;
1166
+ }
1138
1167
  }
1139
1168
  if ((tag & 7) === 4 || tag === 0) {
1140
1169
  break;
1141
1170
  }
1142
- reader.skipType(tag & 7);
1171
+ reader.skip(tag & 7);
1143
1172
  }
1144
1173
  return message;
1145
1174
  },
1146
1175
  fromJSON(object) {
1147
1176
  return {
1148
- codeInfos: Array.isArray(object === null || object === void 0 ? void 0 : object.codeInfos)
1177
+ codeInfos: globalThis.Array.isArray(object?.codeInfos)
1149
1178
  ? object.codeInfos.map((e) => exports.CodeInfoResponse.fromJSON(e))
1150
1179
  : [],
1151
1180
  pagination: isSet(object.pagination)
@@ -1155,26 +1184,21 @@ exports.QueryCodesResponse = {
1155
1184
  },
1156
1185
  toJSON(message) {
1157
1186
  const obj = {};
1158
- if (message.codeInfos) {
1159
- obj.codeInfos = message.codeInfos.map((e) => e ? exports.CodeInfoResponse.toJSON(e) : undefined);
1187
+ if (message.codeInfos?.length) {
1188
+ obj.codeInfos = message.codeInfos.map((e) => exports.CodeInfoResponse.toJSON(e));
1160
1189
  }
1161
- else {
1162
- obj.codeInfos = [];
1190
+ if (message.pagination !== undefined) {
1191
+ obj.pagination = pagination_1.PageResponse.toJSON(message.pagination);
1163
1192
  }
1164
- message.pagination !== undefined &&
1165
- (obj.pagination = message.pagination
1166
- ? pagination_1.PageResponse.toJSON(message.pagination)
1167
- : undefined);
1168
1193
  return obj;
1169
1194
  },
1170
1195
  create(base) {
1171
- return exports.QueryCodesResponse.fromPartial(base !== null && base !== void 0 ? base : {});
1196
+ return exports.QueryCodesResponse.fromPartial(base ?? {});
1172
1197
  },
1173
1198
  fromPartial(object) {
1174
- var _a;
1175
1199
  const message = createBaseQueryCodesResponse();
1176
1200
  message.codeInfos =
1177
- ((_a = object.codeInfos) === null || _a === void 0 ? void 0 : _a.map((e) => exports.CodeInfoResponse.fromPartial(e))) || [];
1201
+ object.codeInfos?.map((e) => exports.CodeInfoResponse.fromPartial(e)) || [];
1178
1202
  message.pagination =
1179
1203
  object.pagination !== undefined && object.pagination !== null
1180
1204
  ? pagination_1.PageResponse.fromPartial(object.pagination)
@@ -1186,30 +1210,31 @@ function createBaseQueryPinnedCodesRequest() {
1186
1210
  return { pagination: undefined };
1187
1211
  }
1188
1212
  exports.QueryPinnedCodesRequest = {
1189
- encode(message, writer = minimal_1.default.Writer.create()) {
1213
+ encode(message, writer = new binary_1.BinaryWriter()) {
1190
1214
  if (message.pagination !== undefined) {
1191
1215
  pagination_1.PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim();
1192
1216
  }
1193
1217
  return writer;
1194
1218
  },
1195
1219
  decode(input, length) {
1196
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
1220
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
1197
1221
  let end = length === undefined ? reader.len : reader.pos + length;
1198
1222
  const message = createBaseQueryPinnedCodesRequest();
1199
1223
  while (reader.pos < end) {
1200
1224
  const tag = reader.uint32();
1201
1225
  switch (tag >>> 3) {
1202
- case 2:
1226
+ case 2: {
1203
1227
  if (tag !== 18) {
1204
1228
  break;
1205
1229
  }
1206
1230
  message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
1207
1231
  continue;
1232
+ }
1208
1233
  }
1209
1234
  if ((tag & 7) === 4 || tag === 0) {
1210
1235
  break;
1211
1236
  }
1212
- reader.skipType(tag & 7);
1237
+ reader.skip(tag & 7);
1213
1238
  }
1214
1239
  return message;
1215
1240
  },
@@ -1222,14 +1247,13 @@ exports.QueryPinnedCodesRequest = {
1222
1247
  },
1223
1248
  toJSON(message) {
1224
1249
  const obj = {};
1225
- message.pagination !== undefined &&
1226
- (obj.pagination = message.pagination
1227
- ? pagination_1.PageRequest.toJSON(message.pagination)
1228
- : undefined);
1250
+ if (message.pagination !== undefined) {
1251
+ obj.pagination = pagination_1.PageRequest.toJSON(message.pagination);
1252
+ }
1229
1253
  return obj;
1230
1254
  },
1231
1255
  create(base) {
1232
- return exports.QueryPinnedCodesRequest.fromPartial(base !== null && base !== void 0 ? base : {});
1256
+ return exports.QueryPinnedCodesRequest.fromPartial(base ?? {});
1233
1257
  },
1234
1258
  fromPartial(object) {
1235
1259
  const message = createBaseQueryPinnedCodesRequest();
@@ -1244,7 +1268,7 @@ function createBaseQueryPinnedCodesResponse() {
1244
1268
  return { codeIds: [], pagination: undefined };
1245
1269
  }
1246
1270
  exports.QueryPinnedCodesResponse = {
1247
- encode(message, writer = minimal_1.default.Writer.create()) {
1271
+ encode(message, writer = new binary_1.BinaryWriter()) {
1248
1272
  writer.uint32(10).fork();
1249
1273
  for (const v of message.codeIds) {
1250
1274
  writer.uint64(v);
@@ -1256,13 +1280,13 @@ exports.QueryPinnedCodesResponse = {
1256
1280
  return writer;
1257
1281
  },
1258
1282
  decode(input, length) {
1259
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
1283
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
1260
1284
  let end = length === undefined ? reader.len : reader.pos + length;
1261
1285
  const message = createBaseQueryPinnedCodesResponse();
1262
1286
  while (reader.pos < end) {
1263
1287
  const tag = reader.uint32();
1264
1288
  switch (tag >>> 3) {
1265
- case 1:
1289
+ case 1: {
1266
1290
  if (tag === 8) {
1267
1291
  message.codeIds.push(longToNumber(reader.uint64()));
1268
1292
  continue;
@@ -1275,24 +1299,26 @@ exports.QueryPinnedCodesResponse = {
1275
1299
  continue;
1276
1300
  }
1277
1301
  break;
1278
- case 2:
1302
+ }
1303
+ case 2: {
1279
1304
  if (tag !== 18) {
1280
1305
  break;
1281
1306
  }
1282
1307
  message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
1283
1308
  continue;
1309
+ }
1284
1310
  }
1285
1311
  if ((tag & 7) === 4 || tag === 0) {
1286
1312
  break;
1287
1313
  }
1288
- reader.skipType(tag & 7);
1314
+ reader.skip(tag & 7);
1289
1315
  }
1290
1316
  return message;
1291
1317
  },
1292
1318
  fromJSON(object) {
1293
1319
  return {
1294
- codeIds: Array.isArray(object === null || object === void 0 ? void 0 : object.codeIds)
1295
- ? object.codeIds.map((e) => Number(e))
1320
+ codeIds: globalThis.Array.isArray(object?.codeIds)
1321
+ ? object.codeIds.map((e) => globalThis.Number(e))
1296
1322
  : [],
1297
1323
  pagination: isSet(object.pagination)
1298
1324
  ? pagination_1.PageResponse.fromJSON(object.pagination)
@@ -1301,25 +1327,20 @@ exports.QueryPinnedCodesResponse = {
1301
1327
  },
1302
1328
  toJSON(message) {
1303
1329
  const obj = {};
1304
- if (message.codeIds) {
1330
+ if (message.codeIds?.length) {
1305
1331
  obj.codeIds = message.codeIds.map((e) => Math.round(e));
1306
1332
  }
1307
- else {
1308
- obj.codeIds = [];
1333
+ if (message.pagination !== undefined) {
1334
+ obj.pagination = pagination_1.PageResponse.toJSON(message.pagination);
1309
1335
  }
1310
- message.pagination !== undefined &&
1311
- (obj.pagination = message.pagination
1312
- ? pagination_1.PageResponse.toJSON(message.pagination)
1313
- : undefined);
1314
1336
  return obj;
1315
1337
  },
1316
1338
  create(base) {
1317
- return exports.QueryPinnedCodesResponse.fromPartial(base !== null && base !== void 0 ? base : {});
1339
+ return exports.QueryPinnedCodesResponse.fromPartial(base ?? {});
1318
1340
  },
1319
1341
  fromPartial(object) {
1320
- var _a;
1321
1342
  const message = createBaseQueryPinnedCodesResponse();
1322
- message.codeIds = ((_a = object.codeIds) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
1343
+ message.codeIds = object.codeIds?.map((e) => e) || [];
1323
1344
  message.pagination =
1324
1345
  object.pagination !== undefined && object.pagination !== null
1325
1346
  ? pagination_1.PageResponse.fromPartial(object.pagination)
@@ -1331,11 +1352,11 @@ function createBaseQueryParamsRequest() {
1331
1352
  return {};
1332
1353
  }
1333
1354
  exports.QueryParamsRequest = {
1334
- encode(_, writer = minimal_1.default.Writer.create()) {
1355
+ encode(_, writer = new binary_1.BinaryWriter()) {
1335
1356
  return writer;
1336
1357
  },
1337
1358
  decode(input, length) {
1338
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
1359
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
1339
1360
  let end = length === undefined ? reader.len : reader.pos + length;
1340
1361
  const message = createBaseQueryParamsRequest();
1341
1362
  while (reader.pos < end) {
@@ -1345,7 +1366,7 @@ exports.QueryParamsRequest = {
1345
1366
  if ((tag & 7) === 4 || tag === 0) {
1346
1367
  break;
1347
1368
  }
1348
- reader.skipType(tag & 7);
1369
+ reader.skip(tag & 7);
1349
1370
  }
1350
1371
  return message;
1351
1372
  },
@@ -1357,7 +1378,7 @@ exports.QueryParamsRequest = {
1357
1378
  return obj;
1358
1379
  },
1359
1380
  create(base) {
1360
- return exports.QueryParamsRequest.fromPartial(base !== null && base !== void 0 ? base : {});
1381
+ return exports.QueryParamsRequest.fromPartial(base ?? {});
1361
1382
  },
1362
1383
  fromPartial(_) {
1363
1384
  const message = createBaseQueryParamsRequest();
@@ -1368,30 +1389,31 @@ function createBaseQueryParamsResponse() {
1368
1389
  return { params: undefined };
1369
1390
  }
1370
1391
  exports.QueryParamsResponse = {
1371
- encode(message, writer = minimal_1.default.Writer.create()) {
1392
+ encode(message, writer = new binary_1.BinaryWriter()) {
1372
1393
  if (message.params !== undefined) {
1373
1394
  types_1.Params.encode(message.params, writer.uint32(10).fork()).ldelim();
1374
1395
  }
1375
1396
  return writer;
1376
1397
  },
1377
1398
  decode(input, length) {
1378
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
1399
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
1379
1400
  let end = length === undefined ? reader.len : reader.pos + length;
1380
1401
  const message = createBaseQueryParamsResponse();
1381
1402
  while (reader.pos < end) {
1382
1403
  const tag = reader.uint32();
1383
1404
  switch (tag >>> 3) {
1384
- case 1:
1405
+ case 1: {
1385
1406
  if (tag !== 10) {
1386
1407
  break;
1387
1408
  }
1388
1409
  message.params = types_1.Params.decode(reader, reader.uint32());
1389
1410
  continue;
1411
+ }
1390
1412
  }
1391
1413
  if ((tag & 7) === 4 || tag === 0) {
1392
1414
  break;
1393
1415
  }
1394
- reader.skipType(tag & 7);
1416
+ reader.skip(tag & 7);
1395
1417
  }
1396
1418
  return message;
1397
1419
  },
@@ -1402,12 +1424,13 @@ exports.QueryParamsResponse = {
1402
1424
  },
1403
1425
  toJSON(message) {
1404
1426
  const obj = {};
1405
- message.params !== undefined &&
1406
- (obj.params = message.params ? types_1.Params.toJSON(message.params) : undefined);
1427
+ if (message.params !== undefined) {
1428
+ obj.params = types_1.Params.toJSON(message.params);
1429
+ }
1407
1430
  return obj;
1408
1431
  },
1409
1432
  create(base) {
1410
- return exports.QueryParamsResponse.fromPartial(base !== null && base !== void 0 ? base : {});
1433
+ return exports.QueryParamsResponse.fromPartial(base ?? {});
1411
1434
  },
1412
1435
  fromPartial(object) {
1413
1436
  const message = createBaseQueryParamsResponse();
@@ -1422,7 +1445,7 @@ function createBaseQueryContractsByCreatorRequest() {
1422
1445
  return { creatorAddress: "", pagination: undefined };
1423
1446
  }
1424
1447
  exports.QueryContractsByCreatorRequest = {
1425
- encode(message, writer = minimal_1.default.Writer.create()) {
1448
+ encode(message, writer = new binary_1.BinaryWriter()) {
1426
1449
  if (message.creatorAddress !== "") {
1427
1450
  writer.uint32(10).string(message.creatorAddress);
1428
1451
  }
@@ -1432,36 +1455,38 @@ exports.QueryContractsByCreatorRequest = {
1432
1455
  return writer;
1433
1456
  },
1434
1457
  decode(input, length) {
1435
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
1458
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
1436
1459
  let end = length === undefined ? reader.len : reader.pos + length;
1437
1460
  const message = createBaseQueryContractsByCreatorRequest();
1438
1461
  while (reader.pos < end) {
1439
1462
  const tag = reader.uint32();
1440
1463
  switch (tag >>> 3) {
1441
- case 1:
1464
+ case 1: {
1442
1465
  if (tag !== 10) {
1443
1466
  break;
1444
1467
  }
1445
1468
  message.creatorAddress = reader.string();
1446
1469
  continue;
1447
- case 2:
1470
+ }
1471
+ case 2: {
1448
1472
  if (tag !== 18) {
1449
1473
  break;
1450
1474
  }
1451
1475
  message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
1452
1476
  continue;
1477
+ }
1453
1478
  }
1454
1479
  if ((tag & 7) === 4 || tag === 0) {
1455
1480
  break;
1456
1481
  }
1457
- reader.skipType(tag & 7);
1482
+ reader.skip(tag & 7);
1458
1483
  }
1459
1484
  return message;
1460
1485
  },
1461
1486
  fromJSON(object) {
1462
1487
  return {
1463
1488
  creatorAddress: isSet(object.creatorAddress)
1464
- ? String(object.creatorAddress)
1489
+ ? globalThis.String(object.creatorAddress)
1465
1490
  : "",
1466
1491
  pagination: isSet(object.pagination)
1467
1492
  ? pagination_1.PageRequest.fromJSON(object.pagination)
@@ -1470,21 +1495,20 @@ exports.QueryContractsByCreatorRequest = {
1470
1495
  },
1471
1496
  toJSON(message) {
1472
1497
  const obj = {};
1473
- message.creatorAddress !== undefined &&
1474
- (obj.creatorAddress = message.creatorAddress);
1475
- message.pagination !== undefined &&
1476
- (obj.pagination = message.pagination
1477
- ? pagination_1.PageRequest.toJSON(message.pagination)
1478
- : undefined);
1498
+ if (message.creatorAddress !== "") {
1499
+ obj.creatorAddress = message.creatorAddress;
1500
+ }
1501
+ if (message.pagination !== undefined) {
1502
+ obj.pagination = pagination_1.PageRequest.toJSON(message.pagination);
1503
+ }
1479
1504
  return obj;
1480
1505
  },
1481
1506
  create(base) {
1482
- return exports.QueryContractsByCreatorRequest.fromPartial(base !== null && base !== void 0 ? base : {});
1507
+ return exports.QueryContractsByCreatorRequest.fromPartial(base ?? {});
1483
1508
  },
1484
1509
  fromPartial(object) {
1485
- var _a;
1486
1510
  const message = createBaseQueryContractsByCreatorRequest();
1487
- message.creatorAddress = (_a = object.creatorAddress) !== null && _a !== void 0 ? _a : "";
1511
+ message.creatorAddress = object.creatorAddress ?? "";
1488
1512
  message.pagination =
1489
1513
  object.pagination !== undefined && object.pagination !== null
1490
1514
  ? pagination_1.PageRequest.fromPartial(object.pagination)
@@ -1496,7 +1520,7 @@ function createBaseQueryContractsByCreatorResponse() {
1496
1520
  return { contractAddresses: [], pagination: undefined };
1497
1521
  }
1498
1522
  exports.QueryContractsByCreatorResponse = {
1499
- encode(message, writer = minimal_1.default.Writer.create()) {
1523
+ encode(message, writer = new binary_1.BinaryWriter()) {
1500
1524
  for (const v of message.contractAddresses) {
1501
1525
  writer.uint32(10).string(v);
1502
1526
  }
@@ -1506,36 +1530,38 @@ exports.QueryContractsByCreatorResponse = {
1506
1530
  return writer;
1507
1531
  },
1508
1532
  decode(input, length) {
1509
- const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
1533
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
1510
1534
  let end = length === undefined ? reader.len : reader.pos + length;
1511
1535
  const message = createBaseQueryContractsByCreatorResponse();
1512
1536
  while (reader.pos < end) {
1513
1537
  const tag = reader.uint32();
1514
1538
  switch (tag >>> 3) {
1515
- case 1:
1539
+ case 1: {
1516
1540
  if (tag !== 10) {
1517
1541
  break;
1518
1542
  }
1519
1543
  message.contractAddresses.push(reader.string());
1520
1544
  continue;
1521
- case 2:
1545
+ }
1546
+ case 2: {
1522
1547
  if (tag !== 18) {
1523
1548
  break;
1524
1549
  }
1525
1550
  message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
1526
1551
  continue;
1552
+ }
1527
1553
  }
1528
1554
  if ((tag & 7) === 4 || tag === 0) {
1529
1555
  break;
1530
1556
  }
1531
- reader.skipType(tag & 7);
1557
+ reader.skip(tag & 7);
1532
1558
  }
1533
1559
  return message;
1534
1560
  },
1535
1561
  fromJSON(object) {
1536
1562
  return {
1537
- contractAddresses: Array.isArray(object === null || object === void 0 ? void 0 : object.contractAddresses)
1538
- ? object.contractAddresses.map((e) => String(e))
1563
+ contractAddresses: globalThis.Array.isArray(object?.contractAddresses)
1564
+ ? object.contractAddresses.map((e) => globalThis.String(e))
1539
1565
  : [],
1540
1566
  pagination: isSet(object.pagination)
1541
1567
  ? pagination_1.PageResponse.fromJSON(object.pagination)
@@ -1544,25 +1570,20 @@ exports.QueryContractsByCreatorResponse = {
1544
1570
  },
1545
1571
  toJSON(message) {
1546
1572
  const obj = {};
1547
- if (message.contractAddresses) {
1548
- obj.contractAddresses = message.contractAddresses.map((e) => e);
1573
+ if (message.contractAddresses?.length) {
1574
+ obj.contractAddresses = message.contractAddresses;
1549
1575
  }
1550
- else {
1551
- obj.contractAddresses = [];
1576
+ if (message.pagination !== undefined) {
1577
+ obj.pagination = pagination_1.PageResponse.toJSON(message.pagination);
1552
1578
  }
1553
- message.pagination !== undefined &&
1554
- (obj.pagination = message.pagination
1555
- ? pagination_1.PageResponse.toJSON(message.pagination)
1556
- : undefined);
1557
1579
  return obj;
1558
1580
  },
1559
1581
  create(base) {
1560
- return exports.QueryContractsByCreatorResponse.fromPartial(base !== null && base !== void 0 ? base : {});
1582
+ return exports.QueryContractsByCreatorResponse.fromPartial(base ?? {});
1561
1583
  },
1562
1584
  fromPartial(object) {
1563
- var _a;
1564
1585
  const message = createBaseQueryContractsByCreatorResponse();
1565
- message.contractAddresses = ((_a = object.contractAddresses) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
1586
+ message.contractAddresses = object.contractAddresses?.map((e) => e) || [];
1566
1587
  message.pagination =
1567
1588
  object.pagination !== undefined && object.pagination !== null
1568
1589
  ? pagination_1.PageResponse.fromPartial(object.pagination)
@@ -1570,9 +1591,10 @@ exports.QueryContractsByCreatorResponse = {
1570
1591
  return message;
1571
1592
  },
1572
1593
  };
1594
+ exports.QueryServiceName = "cosmwasm.wasm.v1.Query";
1573
1595
  class QueryClientImpl {
1574
1596
  constructor(rpc, opts) {
1575
- this.service = (opts === null || opts === void 0 ? void 0 : opts.service) || "cosmwasm.wasm.v1.Query";
1597
+ this.service = opts?.service || exports.QueryServiceName;
1576
1598
  this.rpc = rpc;
1577
1599
  this.ContractInfo = this.ContractInfo.bind(this);
1578
1600
  this.ContractHistory = this.ContractHistory.bind(this);
@@ -1589,81 +1611,66 @@ class QueryClientImpl {
1589
1611
  ContractInfo(request) {
1590
1612
  const data = exports.QueryContractInfoRequest.encode(request).finish();
1591
1613
  const promise = this.rpc.request(this.service, "ContractInfo", data);
1592
- return promise.then((data) => exports.QueryContractInfoResponse.decode(minimal_1.default.Reader.create(data)));
1614
+ return promise.then((data) => exports.QueryContractInfoResponse.decode(new binary_1.BinaryReader(data)));
1593
1615
  }
1594
1616
  ContractHistory(request) {
1595
1617
  const data = exports.QueryContractHistoryRequest.encode(request).finish();
1596
1618
  const promise = this.rpc.request(this.service, "ContractHistory", data);
1597
- return promise.then((data) => exports.QueryContractHistoryResponse.decode(minimal_1.default.Reader.create(data)));
1619
+ return promise.then((data) => exports.QueryContractHistoryResponse.decode(new binary_1.BinaryReader(data)));
1598
1620
  }
1599
1621
  ContractsByCode(request) {
1600
1622
  const data = exports.QueryContractsByCodeRequest.encode(request).finish();
1601
1623
  const promise = this.rpc.request(this.service, "ContractsByCode", data);
1602
- return promise.then((data) => exports.QueryContractsByCodeResponse.decode(minimal_1.default.Reader.create(data)));
1624
+ return promise.then((data) => exports.QueryContractsByCodeResponse.decode(new binary_1.BinaryReader(data)));
1603
1625
  }
1604
1626
  AllContractState(request) {
1605
1627
  const data = exports.QueryAllContractStateRequest.encode(request).finish();
1606
1628
  const promise = this.rpc.request(this.service, "AllContractState", data);
1607
- return promise.then((data) => exports.QueryAllContractStateResponse.decode(minimal_1.default.Reader.create(data)));
1629
+ return promise.then((data) => exports.QueryAllContractStateResponse.decode(new binary_1.BinaryReader(data)));
1608
1630
  }
1609
1631
  RawContractState(request) {
1610
1632
  const data = exports.QueryRawContractStateRequest.encode(request).finish();
1611
1633
  const promise = this.rpc.request(this.service, "RawContractState", data);
1612
- return promise.then((data) => exports.QueryRawContractStateResponse.decode(minimal_1.default.Reader.create(data)));
1634
+ return promise.then((data) => exports.QueryRawContractStateResponse.decode(new binary_1.BinaryReader(data)));
1613
1635
  }
1614
1636
  SmartContractState(request) {
1615
1637
  const data = exports.QuerySmartContractStateRequest.encode(request).finish();
1616
1638
  const promise = this.rpc.request(this.service, "SmartContractState", data);
1617
- return promise.then((data) => exports.QuerySmartContractStateResponse.decode(minimal_1.default.Reader.create(data)));
1639
+ return promise.then((data) => exports.QuerySmartContractStateResponse.decode(new binary_1.BinaryReader(data)));
1618
1640
  }
1619
1641
  Code(request) {
1620
1642
  const data = exports.QueryCodeRequest.encode(request).finish();
1621
1643
  const promise = this.rpc.request(this.service, "Code", data);
1622
- return promise.then((data) => exports.QueryCodeResponse.decode(minimal_1.default.Reader.create(data)));
1644
+ return promise.then((data) => exports.QueryCodeResponse.decode(new binary_1.BinaryReader(data)));
1623
1645
  }
1624
1646
  Codes(request) {
1625
1647
  const data = exports.QueryCodesRequest.encode(request).finish();
1626
1648
  const promise = this.rpc.request(this.service, "Codes", data);
1627
- return promise.then((data) => exports.QueryCodesResponse.decode(minimal_1.default.Reader.create(data)));
1649
+ return promise.then((data) => exports.QueryCodesResponse.decode(new binary_1.BinaryReader(data)));
1628
1650
  }
1629
1651
  PinnedCodes(request) {
1630
1652
  const data = exports.QueryPinnedCodesRequest.encode(request).finish();
1631
1653
  const promise = this.rpc.request(this.service, "PinnedCodes", data);
1632
- return promise.then((data) => exports.QueryPinnedCodesResponse.decode(minimal_1.default.Reader.create(data)));
1654
+ return promise.then((data) => exports.QueryPinnedCodesResponse.decode(new binary_1.BinaryReader(data)));
1633
1655
  }
1634
1656
  Params(request) {
1635
1657
  const data = exports.QueryParamsRequest.encode(request).finish();
1636
1658
  const promise = this.rpc.request(this.service, "Params", data);
1637
- return promise.then((data) => exports.QueryParamsResponse.decode(minimal_1.default.Reader.create(data)));
1659
+ return promise.then((data) => exports.QueryParamsResponse.decode(new binary_1.BinaryReader(data)));
1638
1660
  }
1639
1661
  ContractsByCreator(request) {
1640
1662
  const data = exports.QueryContractsByCreatorRequest.encode(request).finish();
1641
1663
  const promise = this.rpc.request(this.service, "ContractsByCreator", data);
1642
- return promise.then((data) => exports.QueryContractsByCreatorResponse.decode(minimal_1.default.Reader.create(data)));
1664
+ return promise.then((data) => exports.QueryContractsByCreatorResponse.decode(new binary_1.BinaryReader(data)));
1643
1665
  }
1644
1666
  }
1645
1667
  exports.QueryClientImpl = QueryClientImpl;
1646
- var tsProtoGlobalThis = (() => {
1647
- if (typeof globalThis !== "undefined") {
1648
- return globalThis;
1649
- }
1650
- if (typeof self !== "undefined") {
1651
- return self;
1652
- }
1653
- if (typeof window !== "undefined") {
1654
- return window;
1655
- }
1656
- if (typeof global !== "undefined") {
1657
- return global;
1658
- }
1659
- throw "Unable to locate global object";
1660
- })();
1661
1668
  function bytesFromBase64(b64) {
1662
- if (tsProtoGlobalThis.Buffer) {
1663
- return Uint8Array.from(tsProtoGlobalThis.Buffer.from(b64, "base64"));
1669
+ if (globalThis.Buffer) {
1670
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
1664
1671
  }
1665
1672
  else {
1666
- const bin = tsProtoGlobalThis.atob(b64);
1673
+ const bin = globalThis.atob(b64);
1667
1674
  const arr = new Uint8Array(bin.length);
1668
1675
  for (let i = 0; i < bin.length; ++i) {
1669
1676
  arr[i] = bin.charCodeAt(i);
@@ -1672,26 +1679,26 @@ function bytesFromBase64(b64) {
1672
1679
  }
1673
1680
  }
1674
1681
  function base64FromBytes(arr) {
1675
- if (tsProtoGlobalThis.Buffer) {
1676
- return tsProtoGlobalThis.Buffer.from(arr).toString("base64");
1682
+ if (globalThis.Buffer) {
1683
+ return globalThis.Buffer.from(arr).toString("base64");
1677
1684
  }
1678
1685
  else {
1679
1686
  const bin = [];
1680
1687
  arr.forEach((byte) => {
1681
- bin.push(String.fromCharCode(byte));
1688
+ bin.push(globalThis.String.fromCharCode(byte));
1682
1689
  });
1683
- return tsProtoGlobalThis.btoa(bin.join(""));
1690
+ return globalThis.btoa(bin.join(""));
1684
1691
  }
1685
1692
  }
1686
- function longToNumber(long) {
1687
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
1688
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1693
+ function longToNumber(int64) {
1694
+ const num = globalThis.Number(int64.toString());
1695
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
1696
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1689
1697
  }
1690
- return long.toNumber();
1691
- }
1692
- if (minimal_1.default.util.Long !== long_1.default) {
1693
- minimal_1.default.util.Long = long_1.default;
1694
- minimal_1.default.configure();
1698
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
1699
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
1700
+ }
1701
+ return num;
1695
1702
  }
1696
1703
  function isSet(value) {
1697
1704
  return value !== null && value !== undefined;