@firmachain/firma-js 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/dist/index.js +5 -1
  2. package/dist/sdk/FirmaAuthzService.d.ts +8 -7
  3. package/dist/sdk/FirmaAuthzService.js +12 -22
  4. package/dist/sdk/FirmaBankService.js +2 -2
  5. package/dist/sdk/FirmaChainService.js +1 -1
  6. package/dist/sdk/FirmaContractService.d.ts +1 -1
  7. package/dist/sdk/FirmaContractService.js +6 -6
  8. package/dist/sdk/FirmaCosmWasmCw20.d.ts +2 -2
  9. package/dist/sdk/FirmaCosmWasmCw20.js +8 -8
  10. package/dist/sdk/FirmaCosmWasmCw721.d.ts +2 -2
  11. package/dist/sdk/FirmaCosmWasmCw721.js +12 -12
  12. package/dist/sdk/FirmaCosmWasmCwBridge.d.ts +1 -1
  13. package/dist/sdk/FirmaCosmWasmCwBridge.js +8 -8
  14. package/dist/sdk/FirmaCosmWasmCwMarketplace.d.ts +1 -1
  15. package/dist/sdk/FirmaCosmWasmCwMarketplace.js +5 -5
  16. package/dist/sdk/FirmaCosmWasmService.d.ts +1 -1
  17. package/dist/sdk/FirmaCosmWasmService.js +13 -13
  18. package/dist/sdk/FirmaDistributionService.d.ts +1 -1
  19. package/dist/sdk/FirmaDistributionService.js +6 -6
  20. package/dist/sdk/FirmaFeeGrantService.d.ts +7 -6
  21. package/dist/sdk/FirmaFeeGrantService.js +9 -26
  22. package/dist/sdk/FirmaGovService.d.ts +1 -1
  23. package/dist/sdk/FirmaGovService.js +14 -14
  24. package/dist/sdk/FirmaIbcService.d.ts +3 -3
  25. package/dist/sdk/FirmaIbcService.js +11 -8
  26. package/dist/sdk/FirmaIpfsService.js +1 -1
  27. package/dist/sdk/FirmaMintService.js +1 -1
  28. package/dist/sdk/FirmaNftService.d.ts +1 -1
  29. package/dist/sdk/FirmaNftService.js +6 -6
  30. package/dist/sdk/FirmaSlashingService.js +1 -1
  31. package/dist/sdk/FirmaStakingService.d.ts +3 -3
  32. package/dist/sdk/FirmaStakingService.js +6 -6
  33. package/dist/sdk/FirmaTokenService.d.ts +1 -1
  34. package/dist/sdk/FirmaTokenService.js +5 -5
  35. package/dist/sdk/FirmaUtil.d.ts +25 -24
  36. package/dist/sdk/FirmaUtil.js +200 -145
  37. package/dist/sdk/FirmaWalletService.d.ts +6 -7
  38. package/dist/sdk/FirmaWalletService.js +78 -36
  39. package/dist/sdk/firmachain/authz/AuthzQueryClient.js +4 -4
  40. package/dist/sdk/firmachain/authz/AuthzTxTypes.d.ts +8 -11
  41. package/dist/sdk/firmachain/authz/AuthzTxTypes.js +6 -10
  42. package/dist/sdk/firmachain/authz/index.js +5 -1
  43. package/dist/sdk/firmachain/bank/BankQueryClient.js +5 -5
  44. package/dist/sdk/firmachain/bank/index.js +5 -1
  45. package/dist/sdk/firmachain/common/ITxClient.d.ts +2 -4
  46. package/dist/sdk/firmachain/common/ITxClient.js +20 -92
  47. package/dist/sdk/firmachain/common/LedgerWallet.d.ts +19 -3
  48. package/dist/sdk/firmachain/common/LedgerWallet.js +138 -68
  49. package/dist/sdk/firmachain/common/TendermintQueryClient.js +1 -1
  50. package/dist/sdk/firmachain/common/TxCommon.d.ts +13 -29
  51. package/dist/sdk/firmachain/common/accounts.d.ts +1 -1
  52. package/dist/sdk/firmachain/common/accounts.js +7 -7
  53. package/dist/sdk/firmachain/{amino → common}/coins.d.ts +2 -14
  54. package/dist/sdk/firmachain/{amino → common}/coins.js +4 -25
  55. package/dist/sdk/firmachain/common/index.d.ts +0 -1
  56. package/dist/sdk/firmachain/common/index.js +5 -4
  57. package/dist/sdk/firmachain/{amino → common}/wallet.js +15 -11
  58. package/dist/sdk/firmachain/contract/ContractQueryClient.js +3 -3
  59. package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +6 -6
  60. package/dist/sdk/firmachain/contract/index.js +5 -1
  61. package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.js +9 -9
  62. package/dist/sdk/firmachain/cosmwasm/index.js +5 -1
  63. package/dist/sdk/firmachain/distribution/DistributionQueryClient.js +6 -6
  64. package/dist/sdk/firmachain/distribution/index.js +5 -1
  65. package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.js +3 -3
  66. package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.d.ts +4 -45
  67. package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.js +3 -82
  68. package/dist/sdk/firmachain/feegrant/index.js +5 -1
  69. package/dist/sdk/firmachain/google/protobuf/any.d.ts +3 -3
  70. package/dist/sdk/firmachain/google/protobuf/descriptor.d.ts +29 -29
  71. package/dist/sdk/firmachain/google/protobuf/duration.d.ts +3 -3
  72. package/dist/sdk/firmachain/gov/GovQueryClient.js +3 -3
  73. package/dist/sdk/firmachain/gov/index.js +5 -1
  74. package/dist/sdk/firmachain/ibc/IbcQueryClient.js +2 -2
  75. package/dist/sdk/firmachain/ibc/index.js +5 -1
  76. package/dist/sdk/firmachain/mint/MintQueryClient.js +1 -1
  77. package/dist/sdk/firmachain/mint/index.js +5 -1
  78. package/dist/sdk/firmachain/nft/NftQueryClient.js +1 -1
  79. package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +8 -8
  80. package/dist/sdk/firmachain/nft/index.js +5 -1
  81. package/dist/sdk/firmachain/slashing/SlashingQueryClient.js +1 -1
  82. package/dist/sdk/firmachain/slashing/index.js +5 -1
  83. package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +2 -2
  84. package/dist/sdk/firmachain/staking/StakingQueryClient.js +10 -9
  85. package/dist/sdk/firmachain/staking/index.js +5 -1
  86. package/dist/sdk/firmachain/token/TokenQueryClient.js +1 -1
  87. package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +11 -11
  88. package/dist/sdk/firmachain/token/TokenTxTypes.js +1 -1
  89. package/dist/sdk/firmachain/token/index.js +5 -1
  90. package/dist/test/00.wallet.test.js +4 -4
  91. package/dist/test/01.contract_tx.test.js +5 -5
  92. package/dist/test/02.contract_query.test.js +15 -15
  93. package/dist/test/03.contract_scenario.test.js +28 -28
  94. package/dist/test/04.bank_tx.test.js +4 -4
  95. package/dist/test/05.bank_query.test.js +9 -9
  96. package/dist/test/06.feegrant_tx.test.js +59 -35
  97. package/dist/test/07.feegrant_query.test.js +18 -15
  98. package/dist/test/08.gas_estimate.test.js +110 -70
  99. package/dist/test/09.ipfs.test.js +4 -4
  100. package/dist/test/10.nft_tx.test.js +7 -7
  101. package/dist/test/11.nft_query.test.js +9 -9
  102. package/dist/test/12.staking_tx.test.js +27 -15
  103. package/dist/test/13.staking_query.test.js +20 -20
  104. package/dist/test/14.distribution_tx.test.js +8 -8
  105. package/dist/test/15.distribution_query.test.js +15 -15
  106. package/dist/test/16.gov_tx.test.js +17 -17
  107. package/dist/test/17.gov_query.test.js +19 -19
  108. package/dist/test/18.util.test.js +105 -63
  109. package/dist/test/19.chain.test.js +38 -38
  110. package/dist/test/20.slashing_query.test.js +25 -25
  111. package/dist/test/21.token_tx.test.js +6 -6
  112. package/dist/test/22.token_query.test.js +4 -4
  113. package/dist/test/23.authz_tx.test.js +77 -47
  114. package/dist/test/24.authz_query.test.js +66 -67
  115. package/dist/test/25.cosmwasm_tx.test.js +7 -7
  116. package/dist/test/26.cosmwasm_query.test.js +127 -59
  117. package/dist/test/{27.arbitary_sign.test.js → 27.arbitrary_sign.test.js} +34 -62
  118. package/dist/test/28.ibc_tx.test.js +8 -8
  119. package/dist/test/29.mint_query.test.js +2 -2
  120. package/dist/test/30.cw20_tx.test.js +20 -20
  121. package/dist/test/31.cw20_query.test.js +24 -24
  122. package/dist/test/32.cw721_tx.test.js +19 -19
  123. package/dist/test/33.cw721_query.test.js +32 -32
  124. package/dist/test/34.cw_bridge_tx.test.js +19 -19
  125. package/dist/test/35.cw_bridge_tx_low.test.js +13 -13
  126. package/dist/test/36.cw_bridge_query.test.js +20 -20
  127. package/dist/test/37.cw_marketplace_tx.test.js +32 -32
  128. package/dist/test/38.cw_marketplace_query.test.js +2 -2
  129. package/dist/test/config_test.d.ts +1 -1
  130. package/dist/test/config_test.js +2 -2
  131. package/package.json +9 -10
  132. package/dist/sdk/firmachain/amino/addresses.d.ts +0 -5
  133. package/dist/sdk/firmachain/amino/addresses.js +0 -46
  134. package/dist/sdk/firmachain/amino/aminomsgs.d.ts +0 -291
  135. package/dist/sdk/firmachain/amino/aminomsgs.js +0 -81
  136. package/dist/sdk/firmachain/amino/aminotypes.d.ts +0 -22
  137. package/dist/sdk/firmachain/amino/aminotypes.js +0 -538
  138. package/dist/sdk/firmachain/amino/encoding.d.ts +0 -33
  139. package/dist/sdk/firmachain/amino/encoding.js +0 -252
  140. package/dist/sdk/firmachain/amino/multisig.d.ts +0 -10
  141. package/dist/sdk/firmachain/amino/multisig.js +0 -42
  142. package/dist/sdk/firmachain/amino/pubkeys.d.ts +0 -47
  143. package/dist/sdk/firmachain/amino/pubkeys.js +0 -29
  144. package/dist/sdk/firmachain/amino/signature.d.ts +0 -16
  145. package/dist/sdk/firmachain/amino/signature.js +0 -36
  146. package/dist/sdk/firmachain/amino/signdoc.d.ts +0 -44
  147. package/dist/sdk/firmachain/amino/signdoc.js +0 -68
  148. package/dist/sdk/firmachain/amino/signer.d.ts +0 -33
  149. package/dist/sdk/firmachain/amino/signer.js +0 -2
  150. package/dist/sdk/firmachain/amino/stdtx.d.ts +0 -15
  151. package/dist/sdk/firmachain/amino/stdtx.js +0 -17
  152. package/dist/sdk/firmachain/common/LedgerSigningStargateClient.d.ts +0 -22
  153. package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +0 -170
  154. package/dist/sdk/firmachain/common/aminotypes.d.ts +0 -19
  155. package/dist/sdk/firmachain/common/aminotypes.js +0 -74
  156. package/dist/sdk/firmachain/common/events.d.ts +0 -32
  157. package/dist/sdk/firmachain/common/events.js +0 -18
  158. package/dist/sdk/firmachain/common/fee.d.ts +0 -26
  159. package/dist/sdk/firmachain/common/fee.js +0 -83
  160. package/dist/sdk/firmachain/common/modules/auth/queries.d.ts +0 -15
  161. package/dist/sdk/firmachain/common/modules/auth/queries.js +0 -64
  162. package/dist/sdk/firmachain/common/modules/authz/aminomessages.d.ts +0 -2
  163. package/dist/sdk/firmachain/common/modules/authz/aminomessages.js +0 -15
  164. package/dist/sdk/firmachain/common/modules/authz/messages.d.ts +0 -2
  165. package/dist/sdk/firmachain/common/modules/authz/messages.js +0 -9
  166. package/dist/sdk/firmachain/common/modules/authz/queries.d.ts +0 -10
  167. package/dist/sdk/firmachain/common/modules/authz/queries.js +0 -88
  168. package/dist/sdk/firmachain/common/modules/bank/aminomessages.d.ts +0 -35
  169. package/dist/sdk/firmachain/common/modules/bank/aminomessages.js +0 -85
  170. package/dist/sdk/firmachain/common/modules/bank/messages.d.ts +0 -8
  171. package/dist/sdk/firmachain/common/modules/bank/messages.js +0 -12
  172. package/dist/sdk/firmachain/common/modules/bank/queries.d.ts +0 -15
  173. package/dist/sdk/firmachain/common/modules/bank/queries.js +0 -128
  174. package/dist/sdk/firmachain/common/modules/crisis/aminomessages.d.ts +0 -14
  175. package/dist/sdk/firmachain/common/modules/crisis/aminomessages.js +0 -11
  176. package/dist/sdk/firmachain/common/modules/distribution/aminomessages.d.ts +0 -44
  177. package/dist/sdk/firmachain/common/modules/distribution/aminomessages.js +0 -113
  178. package/dist/sdk/firmachain/common/modules/distribution/messages.d.ts +0 -8
  179. package/dist/sdk/firmachain/common/modules/distribution/messages.js +0 -15
  180. package/dist/sdk/firmachain/common/modules/distribution/queries.d.ts +0 -16
  181. package/dist/sdk/firmachain/common/modules/distribution/queries.js +0 -171
  182. package/dist/sdk/firmachain/common/modules/evidence/aminomessages.d.ts +0 -18
  183. package/dist/sdk/firmachain/common/modules/evidence/aminomessages.js +0 -11
  184. package/dist/sdk/firmachain/common/modules/feegrant/aminomessages.d.ts +0 -2
  185. package/dist/sdk/firmachain/common/modules/feegrant/aminomessages.js +0 -14
  186. package/dist/sdk/firmachain/common/modules/feegrant/messages.d.ts +0 -2
  187. package/dist/sdk/firmachain/common/modules/feegrant/messages.js +0 -8
  188. package/dist/sdk/firmachain/common/modules/feegrant/queries.d.ts +0 -9
  189. package/dist/sdk/firmachain/common/modules/feegrant/queries.js +0 -81
  190. package/dist/sdk/firmachain/common/modules/gov/aminomessages.d.ts +0 -79
  191. package/dist/sdk/firmachain/common/modules/gov/aminomessages.js +0 -152
  192. package/dist/sdk/firmachain/common/modules/gov/messages.d.ts +0 -29
  193. package/dist/sdk/firmachain/common/modules/gov/messages.js +0 -39
  194. package/dist/sdk/firmachain/common/modules/gov/queries.d.ts +0 -19
  195. package/dist/sdk/firmachain/common/modules/gov/queries.js +0 -160
  196. package/dist/sdk/firmachain/common/modules/group/aminomessages.d.ts +0 -2
  197. package/dist/sdk/firmachain/common/modules/group/aminomessages.js +0 -8
  198. package/dist/sdk/firmachain/common/modules/group/messages.d.ts +0 -2
  199. package/dist/sdk/firmachain/common/modules/group/messages.js +0 -28
  200. package/dist/sdk/firmachain/common/modules/ibc/aminomessages.d.ts +0 -38
  201. package/dist/sdk/firmachain/common/modules/ibc/aminomessages.js +0 -55
  202. package/dist/sdk/firmachain/common/modules/ibc/messages.d.ts +0 -8
  203. package/dist/sdk/firmachain/common/modules/ibc/messages.js +0 -32
  204. package/dist/sdk/firmachain/common/modules/ibc/queries.d.ts +0 -58
  205. package/dist/sdk/firmachain/common/modules/ibc/queries.js +0 -576
  206. package/dist/sdk/firmachain/common/modules/index.d.ts +0 -32
  207. package/dist/sdk/firmachain/common/modules/index.js +0 -101
  208. package/dist/sdk/firmachain/common/modules/mint/queries.d.ts +0 -21
  209. package/dist/sdk/firmachain/common/modules/mint/queries.js +0 -95
  210. package/dist/sdk/firmachain/common/modules/slashing/aminomessages.d.ts +0 -12
  211. package/dist/sdk/firmachain/common/modules/slashing/aminomessages.js +0 -11
  212. package/dist/sdk/firmachain/common/modules/slashing/queries.d.ts +0 -10
  213. package/dist/sdk/firmachain/common/modules/slashing/queries.js +0 -88
  214. package/dist/sdk/firmachain/common/modules/staking/aminomessages.d.ts +0 -112
  215. package/dist/sdk/firmachain/common/modules/staking/aminomessages.js +0 -234
  216. package/dist/sdk/firmachain/common/modules/staking/messages.d.ts +0 -33
  217. package/dist/sdk/firmachain/common/modules/staking/messages.js +0 -37
  218. package/dist/sdk/firmachain/common/modules/staking/queries.d.ts +0 -23
  219. package/dist/sdk/firmachain/common/modules/staking/queries.js +0 -242
  220. package/dist/sdk/firmachain/common/modules/tx/queries.d.ts +0 -11
  221. package/dist/sdk/firmachain/common/modules/tx/queries.js +0 -103
  222. package/dist/sdk/firmachain/common/modules/vesting/aminomessages.d.ts +0 -16
  223. package/dist/sdk/firmachain/common/modules/vesting/aminomessages.js +0 -56
  224. package/dist/sdk/firmachain/common/modules/vesting/messages.d.ts +0 -2
  225. package/dist/sdk/firmachain/common/modules/vesting/messages.js +0 -7
  226. package/dist/sdk/firmachain/common/queryclient/index.d.ts +0 -2
  227. package/dist/sdk/firmachain/common/queryclient/index.js +0 -10
  228. package/dist/sdk/firmachain/common/queryclient/queryclient.d.ts +0 -75
  229. package/dist/sdk/firmachain/common/queryclient/queryclient.js +0 -157
  230. package/dist/sdk/firmachain/common/queryclient/utils.d.ts +0 -33
  231. package/dist/sdk/firmachain/common/queryclient/utils.js +0 -101
  232. package/dist/sdk/firmachain/common/search.d.ts +0 -10
  233. package/dist/sdk/firmachain/common/search.js +0 -7
  234. package/dist/sdk/firmachain/common/signing.d.ts +0 -15
  235. package/dist/sdk/firmachain/common/signing.js +0 -87
  236. package/dist/sdk/firmachain/common/signingstargateclient.d.ts +0 -121
  237. package/dist/sdk/firmachain/common/signingstargateclient.js +0 -674
  238. package/dist/sdk/firmachain/common/stargateclient.d.ts +0 -210
  239. package/dist/sdk/firmachain/common/stargateclient.js +0 -527
  240. package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +0 -110
  241. package/dist/sdk/firmachain/google/protobuf/timestamp.js +0 -108
  242. /package/dist/sdk/firmachain/{amino → common}/paths.d.ts +0 -0
  243. /package/dist/sdk/firmachain/{amino → common}/paths.js +0 -0
  244. /package/dist/sdk/firmachain/{amino → common}/wallet.d.ts +0 -0
  245. /package/dist/test/{27.arbitary_sign.test.d.ts → 27.arbitrary_sign.test.d.ts} +0 -0
@@ -1,538 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __read = (this && this.__read) || function (o, n) {
14
- var m = typeof Symbol === "function" && o[Symbol.iterator];
15
- if (!m) return o;
16
- var i = m.call(o), r, ar = [], e;
17
- try {
18
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
19
- }
20
- catch (error) { e = { error: error }; }
21
- finally {
22
- try {
23
- if (r && !r.done && (m = i["return"])) m.call(i);
24
- }
25
- finally { if (e) throw e.error; }
26
- }
27
- return ar;
28
- };
29
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
30
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
31
- to[j] = from[i];
32
- return to;
33
- };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.AminoTypes = void 0;
39
- var encoding_1 = require("@cosmjs/encoding");
40
- var utils_1 = require("@cosmjs/utils");
41
- var gov_1 = require("cosmjs-types/cosmos/gov/v1beta1/gov");
42
- var any_1 = require("cosmjs-types/google/protobuf/any");
43
- var long_1 = __importDefault(require("long"));
44
- var encoding_2 = require("./encoding");
45
- function omitDefault(input) {
46
- if (typeof input === "string") {
47
- return input === "" ? undefined : input;
48
- }
49
- if (typeof input === "number") {
50
- return input === 0 ? undefined : input;
51
- }
52
- if (long_1.default.isLong(input)) {
53
- return input.isZero() ? undefined : input;
54
- }
55
- throw new Error("Got unsupported type '" + typeof input + "'");
56
- }
57
- function createDefaultTypes(prefix) {
58
- return {
59
- // bank
60
- "/cosmos.bank.v1beta1.MsgSend": {
61
- aminoType: "cosmos-sdk/MsgSend",
62
- toAmino: function (_a) {
63
- var fromAddress = _a.fromAddress, toAddress = _a.toAddress, amount = _a.amount;
64
- return ({
65
- from_address: fromAddress,
66
- to_address: toAddress,
67
- amount: __spreadArray([], __read(amount)),
68
- });
69
- },
70
- fromAmino: function (_a) {
71
- var from_address = _a.from_address, to_address = _a.to_address, amount = _a.amount;
72
- return ({
73
- fromAddress: from_address,
74
- toAddress: to_address,
75
- amount: __spreadArray([], __read(amount)),
76
- });
77
- },
78
- },
79
- "/cosmos.bank.v1beta1.MsgMultiSend": {
80
- aminoType: "cosmos-sdk/MsgMultiSend",
81
- toAmino: function (_a) {
82
- var inputs = _a.inputs, outputs = _a.outputs;
83
- return ({
84
- inputs: inputs.map(function (input) { return ({
85
- address: input.address,
86
- coins: __spreadArray([], __read(input.coins)),
87
- }); }),
88
- outputs: outputs.map(function (output) { return ({
89
- address: output.address,
90
- coins: __spreadArray([], __read(output.coins)),
91
- }); }),
92
- });
93
- },
94
- fromAmino: function (_a) {
95
- var inputs = _a.inputs, outputs = _a.outputs;
96
- return ({
97
- inputs: inputs.map(function (input) { return ({
98
- address: input.address,
99
- coins: __spreadArray([], __read(input.coins)),
100
- }); }),
101
- outputs: outputs.map(function (output) { return ({
102
- address: output.address,
103
- coins: __spreadArray([], __read(output.coins)),
104
- }); }),
105
- });
106
- },
107
- },
108
- // distribution
109
- "/cosmos.distribution.v1beta1.MsgFundCommunityPool": {
110
- aminoType: "cosmos-sdk/MsgFundCommunityPool",
111
- toAmino: function (_a) {
112
- var amount = _a.amount, depositor = _a.depositor;
113
- return ({
114
- amount: __spreadArray([], __read(amount)),
115
- depositor: depositor,
116
- });
117
- },
118
- fromAmino: function (_a) {
119
- var amount = _a.amount, depositor = _a.depositor;
120
- return ({
121
- amount: __spreadArray([], __read(amount)),
122
- depositor: depositor,
123
- });
124
- },
125
- },
126
- "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress": {
127
- aminoType: "cosmos-sdk/MsgModifyWithdrawAddress",
128
- toAmino: function (_a) {
129
- var delegatorAddress = _a.delegatorAddress, withdrawAddress = _a.withdrawAddress;
130
- return ({
131
- delegator_address: delegatorAddress,
132
- withdraw_address: withdrawAddress,
133
- });
134
- },
135
- fromAmino: function (_a) {
136
- var delegator_address = _a.delegator_address, withdraw_address = _a.withdraw_address;
137
- return ({
138
- delegatorAddress: delegator_address,
139
- withdrawAddress: withdraw_address,
140
- });
141
- },
142
- },
143
- "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward": {
144
- aminoType: "cosmos-sdk/MsgWithdrawDelegationReward",
145
- toAmino: function (_a) {
146
- var delegatorAddress = _a.delegatorAddress, validatorAddress = _a.validatorAddress;
147
- return ({
148
- delegator_address: delegatorAddress,
149
- validator_address: validatorAddress,
150
- });
151
- },
152
- fromAmino: function (_a) {
153
- var delegator_address = _a.delegator_address, validator_address = _a.validator_address;
154
- return ({
155
- delegatorAddress: delegator_address,
156
- validatorAddress: validator_address,
157
- });
158
- },
159
- },
160
- "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission": {
161
- aminoType: "cosmos-sdk/MsgWithdrawValidatorCommission",
162
- toAmino: function (_a) {
163
- var validatorAddress = _a.validatorAddress;
164
- return ({
165
- validator_address: validatorAddress,
166
- });
167
- },
168
- fromAmino: function (_a) {
169
- var validator_address = _a.validator_address;
170
- return ({
171
- validatorAddress: validator_address,
172
- });
173
- },
174
- },
175
- // gov
176
- "/cosmos.gov.v1beta1.MsgDeposit": {
177
- aminoType: "cosmos-sdk/MsgDeposit",
178
- toAmino: function (_a) {
179
- var amount = _a.amount, depositor = _a.depositor, proposalId = _a.proposalId;
180
- return {
181
- amount: amount,
182
- depositor: depositor,
183
- proposal_id: proposalId.toString(),
184
- };
185
- },
186
- fromAmino: function (_a) {
187
- var amount = _a.amount, depositor = _a.depositor, proposal_id = _a.proposal_id;
188
- return {
189
- amount: Array.from(amount),
190
- depositor: depositor,
191
- proposalId: BigInt(proposal_id),
192
- };
193
- },
194
- },
195
- "/cosmos.gov.v1beta1.MsgVote": {
196
- aminoType: "cosmos-sdk/MsgVote",
197
- toAmino: function (_a) {
198
- var option = _a.option, proposalId = _a.proposalId, voter = _a.voter;
199
- return {
200
- option: option,
201
- proposal_id: proposalId.toString(),
202
- voter: voter,
203
- };
204
- },
205
- fromAmino: function (_a) {
206
- var option = _a.option, proposal_id = _a.proposal_id, voter = _a.voter;
207
- return {
208
- option: gov_1.voteOptionFromJSON(option),
209
- proposalId: BigInt(proposal_id),
210
- voter: voter,
211
- };
212
- },
213
- },
214
- "/cosmos.gov.v1beta1.MsgSubmitProposal": {
215
- aminoType: "cosmos-sdk/MsgSubmitProposal",
216
- toAmino: function (_a) {
217
- var initialDeposit = _a.initialDeposit, proposer = _a.proposer, content = _a.content;
218
- utils_1.assertDefinedAndNotNull(content);
219
- var proposal;
220
- switch (content.typeUrl) {
221
- case "/cosmos.gov.v1beta1.TextProposal": {
222
- var textProposal = gov_1.TextProposal.decode(content.value);
223
- proposal = {
224
- type: "cosmos-sdk/TextProposal",
225
- value: {
226
- description: textProposal.description,
227
- title: textProposal.title,
228
- },
229
- };
230
- break;
231
- }
232
- default:
233
- throw new Error("Unsupported proposal type: '" + content.typeUrl + "'");
234
- }
235
- return {
236
- initial_deposit: initialDeposit,
237
- proposer: proposer,
238
- content: proposal,
239
- };
240
- },
241
- fromAmino: function (_a) {
242
- var initial_deposit = _a.initial_deposit, proposer = _a.proposer, content = _a.content;
243
- var any_content;
244
- switch (content.type) {
245
- case "cosmos-sdk/TextProposal": {
246
- var value = content.value;
247
- utils_1.assert(utils_1.isNonNullObject(value));
248
- var _b = value, title = _b.title, description = _b.description;
249
- utils_1.assert(typeof title === "string");
250
- utils_1.assert(typeof description === "string");
251
- any_content = any_1.Any.fromPartial({
252
- typeUrl: "/cosmos.gov.v1beta1.TextProposal",
253
- value: gov_1.TextProposal.encode(gov_1.TextProposal.fromPartial({
254
- title: title,
255
- description: description,
256
- })).finish(),
257
- });
258
- break;
259
- }
260
- default:
261
- throw new Error("Unsupported proposal type: '" + content.type + "'");
262
- }
263
- return {
264
- initialDeposit: Array.from(initial_deposit),
265
- proposer: proposer,
266
- content: any_content,
267
- };
268
- },
269
- },
270
- // cancel proposal
271
- "/cosmos.gov.v1.MsgCancelProposal": {
272
- aminoType: "cosmos-sdk/MsgCancelProposal",
273
- toAmino: function (_a) {
274
- var proposalId = _a.proposalId, proposer = _a.proposer;
275
- return {
276
- proposalId: proposalId.toString(),
277
- proposer: proposer,
278
- };
279
- },
280
- fromAmino: function (_a) {
281
- var proposalId = _a.proposalId, proposer = _a.proposer;
282
- return {
283
- proposalId: BigInt(proposalId),
284
- proposer: proposer,
285
- };
286
- }
287
- },
288
- // staking
289
- "/cosmos.staking.v1beta1.MsgBeginRedelegate": {
290
- aminoType: "cosmos-sdk/MsgBeginRedelegate",
291
- toAmino: function (_a) {
292
- var delegatorAddress = _a.delegatorAddress, validatorSrcAddress = _a.validatorSrcAddress, validatorDstAddress = _a.validatorDstAddress, amount = _a.amount;
293
- utils_1.assertDefinedAndNotNull(amount, "missing amount");
294
- return {
295
- delegator_address: delegatorAddress,
296
- validator_src_address: validatorSrcAddress,
297
- validator_dst_address: validatorDstAddress,
298
- amount: amount,
299
- };
300
- },
301
- fromAmino: function (_a) {
302
- var delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, amount = _a.amount;
303
- return ({
304
- delegatorAddress: delegator_address,
305
- validatorSrcAddress: validator_src_address,
306
- validatorDstAddress: validator_dst_address,
307
- amount: amount,
308
- });
309
- },
310
- },
311
- "/cosmos.staking.v1beta1.MsgCreateValidator": {
312
- aminoType: "cosmos-sdk/MsgCreateValidator",
313
- toAmino: function (_a) {
314
- var description = _a.description, commission = _a.commission, minSelfDelegation = _a.minSelfDelegation, delegatorAddress = _a.delegatorAddress, validatorAddress = _a.validatorAddress, pubkey = _a.pubkey, value = _a.value;
315
- utils_1.assertDefinedAndNotNull(description, "missing description");
316
- utils_1.assertDefinedAndNotNull(commission, "missing commission");
317
- utils_1.assertDefinedAndNotNull(pubkey, "missing pubkey");
318
- utils_1.assertDefinedAndNotNull(value, "missing value");
319
- return {
320
- description: {
321
- moniker: description.moniker,
322
- identity: description.identity,
323
- website: description.website,
324
- security_contact: description.securityContact,
325
- details: description.details,
326
- },
327
- commission: {
328
- rate: commission.rate,
329
- max_rate: commission.maxRate,
330
- max_change_rate: commission.maxChangeRate,
331
- },
332
- min_self_delegation: minSelfDelegation,
333
- delegator_address: delegatorAddress,
334
- validator_address: validatorAddress,
335
- pubkey: encoding_2.encodeBech32Pubkey({
336
- type: "tendermint/PubKeySecp256k1",
337
- value: encoding_1.toBase64(pubkey.value),
338
- }, prefix),
339
- value: value,
340
- };
341
- },
342
- fromAmino: function (_a) {
343
- var description = _a.description, commission = _a.commission, min_self_delegation = _a.min_self_delegation, delegator_address = _a.delegator_address, validator_address = _a.validator_address, pubkey = _a.pubkey, value = _a.value;
344
- var decodedPubkey = encoding_2.decodeBech32Pubkey(pubkey);
345
- if (decodedPubkey.type !== "tendermint/PubKeySecp256k1") {
346
- throw new Error("Only Secp256k1 public keys are supported");
347
- }
348
- return {
349
- description: {
350
- moniker: description.moniker,
351
- identity: description.identity,
352
- website: description.website,
353
- securityContact: description.security_contact,
354
- details: description.details,
355
- },
356
- commission: {
357
- rate: commission.rate,
358
- maxRate: commission.max_rate,
359
- maxChangeRate: commission.max_change_rate,
360
- },
361
- minSelfDelegation: min_self_delegation,
362
- delegatorAddress: delegator_address,
363
- validatorAddress: validator_address,
364
- pubkey: {
365
- typeUrl: "/cosmos.crypto.secp256k1.PubKey",
366
- value: encoding_1.fromBase64(decodedPubkey.value),
367
- },
368
- value: value,
369
- };
370
- },
371
- },
372
- "/cosmos.staking.v1beta1.MsgDelegate": {
373
- aminoType: "cosmos-sdk/MsgDelegate",
374
- toAmino: function (_a) {
375
- var delegatorAddress = _a.delegatorAddress, validatorAddress = _a.validatorAddress, amount = _a.amount;
376
- utils_1.assertDefinedAndNotNull(amount, "missing amount");
377
- return {
378
- delegator_address: delegatorAddress,
379
- validator_address: validatorAddress,
380
- amount: amount,
381
- };
382
- },
383
- fromAmino: function (_a) {
384
- var delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;
385
- return ({
386
- delegatorAddress: delegator_address,
387
- validatorAddress: validator_address,
388
- amount: amount,
389
- });
390
- },
391
- },
392
- "/cosmos.staking.v1beta1.MsgEditValidator": {
393
- aminoType: "cosmos-sdk/MsgEditValidator",
394
- toAmino: function (_a) {
395
- var description = _a.description, commissionRate = _a.commissionRate, minSelfDelegation = _a.minSelfDelegation, validatorAddress = _a.validatorAddress;
396
- utils_1.assertDefinedAndNotNull(description, "missing description");
397
- return {
398
- description: {
399
- moniker: description.moniker,
400
- identity: description.identity,
401
- website: description.website,
402
- security_contact: description.securityContact,
403
- details: description.details,
404
- },
405
- commission_rate: commissionRate,
406
- min_self_delegation: minSelfDelegation,
407
- validator_address: validatorAddress,
408
- };
409
- },
410
- fromAmino: function (_a) {
411
- var description = _a.description, commission_rate = _a.commission_rate, min_self_delegation = _a.min_self_delegation, validator_address = _a.validator_address;
412
- return ({
413
- description: {
414
- moniker: description.moniker,
415
- identity: description.identity,
416
- website: description.website,
417
- securityContact: description.security_contact,
418
- details: description.details,
419
- },
420
- commissionRate: commission_rate,
421
- minSelfDelegation: min_self_delegation,
422
- validatorAddress: validator_address,
423
- });
424
- },
425
- },
426
- "/cosmos.staking.v1beta1.MsgUndelegate": {
427
- aminoType: "cosmos-sdk/MsgUndelegate",
428
- toAmino: function (_a) {
429
- var delegatorAddress = _a.delegatorAddress, validatorAddress = _a.validatorAddress, amount = _a.amount;
430
- utils_1.assertDefinedAndNotNull(amount, "missing amount");
431
- return {
432
- delegator_address: delegatorAddress,
433
- validator_address: validatorAddress,
434
- amount: amount,
435
- };
436
- },
437
- fromAmino: function (_a) {
438
- var delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;
439
- return ({
440
- delegatorAddress: delegator_address,
441
- validatorAddress: validator_address,
442
- amount: amount,
443
- });
444
- },
445
- },
446
- // ibc
447
- "/ibc.applications.transfer.v1.MsgTransfer": {
448
- aminoType: "cosmos-sdk/MsgTransfer",
449
- toAmino: function (_a) {
450
- var _b, _c, _d;
451
- var sourcePort = _a.sourcePort, sourceChannel = _a.sourceChannel, token = _a.token, sender = _a.sender, receiver = _a.receiver, timeoutHeight = _a.timeoutHeight, timeoutTimestamp = _a.timeoutTimestamp;
452
- return ({
453
- source_port: sourcePort,
454
- source_channel: sourceChannel,
455
- token: token,
456
- sender: sender,
457
- receiver: receiver,
458
- timeout_height: timeoutHeight
459
- ? {
460
- revision_height: (_b = omitDefault(timeoutHeight.revisionHeight)) === null || _b === void 0 ? void 0 : _b.toString(),
461
- revision_number: (_c = omitDefault(timeoutHeight.revisionNumber)) === null || _c === void 0 ? void 0 : _c.toString(),
462
- }
463
- : {},
464
- timeout_timestamp: (_d = omitDefault(timeoutTimestamp)) === null || _d === void 0 ? void 0 : _d.toString(),
465
- });
466
- },
467
- fromAmino: function (_a) {
468
- var source_port = _a.source_port, source_channel = _a.source_channel, token = _a.token, sender = _a.sender, receiver = _a.receiver, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp, memo = _a.memo;
469
- return ({
470
- sourcePort: source_port,
471
- sourceChannel: source_channel,
472
- token: token,
473
- sender: sender,
474
- receiver: receiver,
475
- timeoutHeight: {
476
- revisionHeight: BigInt(timeout_height.revision_height || "0"),
477
- revisionNumber: BigInt(timeout_height.revision_number || "0"),
478
- },
479
- timeoutTimestamp: BigInt(timeout_timestamp || "0"),
480
- memo: memo
481
- });
482
- },
483
- },
484
- };
485
- }
486
- /**
487
- * A map from Stargate message types as used in the messages's `Any` type
488
- * to Amino types.
489
- */
490
- var AminoTypes = /** @class */ (function () {
491
- function AminoTypes(_a) {
492
- var _b = _a === void 0 ? {} : _a, _c = _b.additions, additions = _c === void 0 ? {} : _c, _d = _b.prefix, prefix = _d === void 0 ? "cosmos" : _d;
493
- var additionalAminoTypes = Object.values(additions);
494
- var filteredDefaultTypes = Object.entries(createDefaultTypes(prefix)).reduce(function (acc, _a) {
495
- var _b;
496
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
497
- return additionalAminoTypes.find(function (_a) {
498
- var aminoType = _a.aminoType;
499
- return value.aminoType === aminoType;
500
- })
501
- ? acc
502
- : __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
503
- }, {});
504
- this.register = __assign(__assign({}, filteredDefaultTypes), additions);
505
- }
506
- AminoTypes.prototype.toAmino = function (_a) {
507
- var typeUrl = _a.typeUrl, value = _a.value;
508
- var converter = this.register[typeUrl];
509
- if (!converter) {
510
- throw new Error("Type URL does not exist in the Amino message type register. " +
511
- "If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. " +
512
- "If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.");
513
- }
514
- return {
515
- type: converter.aminoType,
516
- value: converter.toAmino(value),
517
- };
518
- };
519
- AminoTypes.prototype.fromAmino = function (_a) {
520
- var type = _a.type, value = _a.value;
521
- var result = Object.entries(this.register).find(function (_a) {
522
- var _b = __read(_a, 2), _typeUrl = _b[0], aminoType = _b[1].aminoType;
523
- return aminoType === type;
524
- });
525
- if (!result) {
526
- throw new Error("Type does not exist in the Amino message type register. " +
527
- "If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. " +
528
- "If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.");
529
- }
530
- var _b = __read(result, 2), typeUrl = _b[0], converter = _b[1];
531
- return {
532
- typeUrl: typeUrl,
533
- value: converter.fromAmino(value),
534
- };
535
- };
536
- return AminoTypes;
537
- }());
538
- exports.AminoTypes = AminoTypes;
@@ -1,33 +0,0 @@
1
- import { Ed25519Pubkey, Pubkey, Secp256k1Pubkey } from "./pubkeys";
2
- /**
3
- * Takes a Secp256k1 public key as raw bytes and returns the Amino JSON
4
- * representation of it (the type/value wrapper object).
5
- */
6
- export declare function encodeSecp256k1Pubkey(pubkey: Uint8Array): Secp256k1Pubkey;
7
- /**
8
- * Takes an Edd25519 public key as raw bytes and returns the Amino JSON
9
- * representation of it (the type/value wrapper object).
10
- */
11
- export declare function encodeEd25519Pubkey(pubkey: Uint8Array): Ed25519Pubkey;
12
- /**
13
- * Decodes a pubkey in the Amino binary format to a type/value object.
14
- */
15
- export declare function decodeAminoPubkey(data: Uint8Array): Pubkey;
16
- /**
17
- * Decodes a bech32 pubkey to Amino binary, which is then decoded to a type/value object.
18
- * The bech32 prefix is ignored and discareded.
19
- *
20
- * @param bechEncoded the bech32 encoded pubkey
21
- */
22
- export declare function decodeBech32Pubkey(bechEncoded: string): Pubkey;
23
- /**
24
- * Encodes a public key to binary Amino.
25
- */
26
- export declare function encodeAminoPubkey(pubkey: Pubkey): Uint8Array;
27
- /**
28
- * Encodes a public key to binary Amino and then to bech32.
29
- *
30
- * @param pubkey the public key to encode
31
- * @param prefix the bech32 prefix (human readable part)
32
- */
33
- export declare function encodeBech32Pubkey(pubkey: Pubkey, prefix: string): string;