@airgap/cosmos 0.13.7-beta.22 → 0.13.7-beta.23

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 (154) hide show
  1. package/airgap-coinlib-cosmos.min.js +32425 -18722
  2. package/index.d.ts +1 -10
  3. package/index.js +15 -15
  4. package/index.js.map +1 -1
  5. package/package.json +4 -2
  6. package/v0/index.d.ts +10 -0
  7. package/v0/index.js +32 -0
  8. package/v0/index.js.map +1 -0
  9. package/{protocol → v0/protocol}/CosmosAddress.d.ts +0 -0
  10. package/{protocol → v0/protocol}/CosmosAddress.js +0 -0
  11. package/v0/protocol/CosmosAddress.js.map +1 -0
  12. package/{protocol → v0/protocol}/CosmosCoin.d.ts +0 -0
  13. package/{protocol → v0/protocol}/CosmosCoin.js +0 -0
  14. package/v0/protocol/CosmosCoin.js.map +1 -0
  15. package/{protocol → v0/protocol}/CosmosCryptoClient.d.ts +0 -0
  16. package/{protocol → v0/protocol}/CosmosCryptoClient.js +3 -1
  17. package/v0/protocol/CosmosCryptoClient.js.map +1 -0
  18. package/{protocol → v0/protocol}/CosmosFee.d.ts +0 -0
  19. package/{protocol → v0/protocol}/CosmosFee.js +0 -0
  20. package/v0/protocol/CosmosFee.js.map +1 -0
  21. package/{protocol → v0/protocol}/CosmosNodeClient.d.ts +0 -0
  22. package/{protocol → v0/protocol}/CosmosNodeClient.js +15 -15
  23. package/v0/protocol/CosmosNodeClient.js.map +1 -0
  24. package/{protocol → v0/protocol}/CosmosProtocol.d.ts +0 -0
  25. package/{protocol → v0/protocol}/CosmosProtocol.js +22 -20
  26. package/v0/protocol/CosmosProtocol.js.map +1 -0
  27. package/{protocol → v0/protocol}/CosmosProtocolOptions.d.ts +0 -0
  28. package/{protocol → v0/protocol}/CosmosProtocolOptions.js +4 -2
  29. package/v0/protocol/CosmosProtocolOptions.js.map +1 -0
  30. package/{protocol → v0/protocol}/CosmosTransaction.d.ts +0 -0
  31. package/{protocol → v0/protocol}/CosmosTransaction.js +0 -0
  32. package/v0/protocol/CosmosTransaction.js.map +1 -0
  33. package/{protocol → v0/protocol}/CosmosTypes.d.ts +0 -0
  34. package/{protocol → v0/protocol}/CosmosTypes.js +0 -0
  35. package/v0/protocol/CosmosTypes.js.map +1 -0
  36. package/{protocol → v0/protocol}/cosmos-message/CosmosDelegateMessage.d.ts +0 -0
  37. package/{protocol → v0/protocol}/cosmos-message/CosmosDelegateMessage.js +0 -0
  38. package/v0/protocol/cosmos-message/CosmosDelegateMessage.js.map +1 -0
  39. package/{protocol → v0/protocol}/cosmos-message/CosmosMessage.d.ts +0 -0
  40. package/{protocol → v0/protocol}/cosmos-message/CosmosMessage.js +0 -0
  41. package/v0/protocol/cosmos-message/CosmosMessage.js.map +1 -0
  42. package/{protocol → v0/protocol}/cosmos-message/CosmosSendMessage.d.ts +0 -0
  43. package/{protocol → v0/protocol}/cosmos-message/CosmosSendMessage.js +9 -7
  44. package/v0/protocol/cosmos-message/CosmosSendMessage.js.map +1 -0
  45. package/{protocol → v0/protocol}/cosmos-message/CosmosWithdrawDelegationRewardMessage.d.ts +0 -0
  46. package/{protocol → v0/protocol}/cosmos-message/CosmosWithdrawDelegationRewardMessage.js +0 -0
  47. package/v0/protocol/cosmos-message/CosmosWithdrawDelegationRewardMessage.js.map +1 -0
  48. package/v0/serializer/schemas/v2/transaction-sign-request-cosmos.json +100 -0
  49. package/v0/serializer/schemas/v2/transaction-sign-response-cosmos.json +22 -0
  50. package/v0/serializer/schemas/v3/transaction-sign-request-cosmos.json +100 -0
  51. package/v0/serializer/schemas/v3/transaction-sign-response-cosmos.json +19 -0
  52. package/v0/serializer/validators/transaction-validator.d.ts +15 -0
  53. package/v0/serializer/validators/transaction-validator.js +112 -0
  54. package/v0/serializer/validators/transaction-validator.js.map +1 -0
  55. package/v0/types/signed-transaction-cosmos.d.ts +5 -0
  56. package/{types → v0/types}/signed-transaction-cosmos.js +0 -0
  57. package/v0/types/signed-transaction-cosmos.js.map +1 -0
  58. package/{types → v0/types}/transaction-cosmos.d.ts +0 -0
  59. package/{types → v0/types}/transaction-cosmos.js +0 -0
  60. package/v0/types/transaction-cosmos.js.map +1 -0
  61. package/{types → v0/types}/unsigned-transaction-cosmos.d.ts +2 -2
  62. package/{types → v0/types}/unsigned-transaction-cosmos.js +0 -0
  63. package/v0/types/unsigned-transaction-cosmos.js.map +1 -0
  64. package/v1/block-explorer/MintscanBlockExplorer.d.ts +9 -0
  65. package/v1/block-explorer/MintscanBlockExplorer.js +74 -0
  66. package/v1/block-explorer/MintscanBlockExplorer.js.map +1 -0
  67. package/v1/data/CosmosAddress.d.ts +7 -0
  68. package/v1/data/CosmosAddress.js +26 -0
  69. package/v1/data/CosmosAddress.js.map +1 -0
  70. package/v1/data/CosmosCoin.d.ts +19 -0
  71. package/v1/data/CosmosCoin.js +55 -0
  72. package/v1/data/CosmosCoin.js.map +1 -0
  73. package/v1/data/CosmosFee.d.ts +15 -0
  74. package/v1/data/CosmosFee.js +31 -0
  75. package/v1/data/CosmosFee.js.map +1 -0
  76. package/v1/data/transaction/CosmosTransaction.d.ts +36 -0
  77. package/v1/data/transaction/CosmosTransaction.js +107 -0
  78. package/v1/data/transaction/CosmosTransaction.js.map +1 -0
  79. package/v1/data/transaction/message/CosmosDelegateMessage.d.ts +19 -0
  80. package/v1/data/transaction/message/CosmosDelegateMessage.js +70 -0
  81. package/v1/data/transaction/message/CosmosDelegateMessage.js.map +1 -0
  82. package/v1/data/transaction/message/CosmosMessage.d.ts +38 -0
  83. package/v1/data/transaction/message/CosmosMessage.js +47 -0
  84. package/v1/data/transaction/message/CosmosMessage.js.map +1 -0
  85. package/v1/data/transaction/message/CosmosSendMessage.d.ts +19 -0
  86. package/v1/data/transaction/message/CosmosSendMessage.js +83 -0
  87. package/v1/data/transaction/message/CosmosSendMessage.js.map +1 -0
  88. package/v1/data/transaction/message/CosmosWithdrawDelegationRewardMessage.d.ts +23 -0
  89. package/v1/data/transaction/message/CosmosWithdrawDelegationRewardMessage.js +61 -0
  90. package/v1/data/transaction/message/CosmosWithdrawDelegationRewardMessage.js.map +1 -0
  91. package/v1/index.d.ts +9 -0
  92. package/v1/index.js +11 -0
  93. package/v1/index.js.map +1 -0
  94. package/v1/module/CosmosModule.d.ts +8 -0
  95. package/v1/module/CosmosModule.js +86 -0
  96. package/v1/module/CosmosModule.js.map +1 -0
  97. package/v1/node/CosmosNodeClient.d.ts +28 -0
  98. package/v1/node/CosmosNodeClient.js +381 -0
  99. package/v1/node/CosmosNodeClient.js.map +1 -0
  100. package/v1/protocol/CosmosCryptoClient.d.ts +8 -0
  101. package/v1/protocol/CosmosCryptoClient.js +88 -0
  102. package/v1/protocol/CosmosCryptoClient.js.map +1 -0
  103. package/v1/protocol/CosmosProtocol.d.ts +50 -0
  104. package/v1/protocol/CosmosProtocol.js +658 -0
  105. package/v1/protocol/CosmosProtocol.js.map +1 -0
  106. package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +7 -0
  107. package/v1/serializer/v3/schemas/converter/transaction-converter.js +21 -0
  108. package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -0
  109. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-cosmos.d.ts +4 -0
  110. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-cosmos.js +3 -0
  111. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-cosmos.js.map +1 -0
  112. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-cosmos.d.ts +3 -0
  113. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-cosmos.js +3 -0
  114. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-cosmos.js.map +1 -0
  115. package/v1/serializer/v3/schemas/generated/transaction-sign-request-cosmos.json +107 -0
  116. package/v1/serializer/v3/schemas/generated/transaction-sign-response-cosmos.json +19 -0
  117. package/v1/serializer/v3/validators/transaction-validators.d.ts +10 -0
  118. package/v1/serializer/v3/validators/transaction-validators.js +97 -0
  119. package/v1/serializer/v3/validators/transaction-validators.js.map +1 -0
  120. package/v1/types/protocol.d.ts +8 -0
  121. package/v1/types/protocol.js +3 -0
  122. package/v1/types/protocol.js.map +1 -0
  123. package/v1/types/rpc.d.ts +286 -0
  124. package/v1/types/rpc.js +3 -0
  125. package/v1/types/rpc.js.map +1 -0
  126. package/v1/types/transaction.d.ts +44 -0
  127. package/v1/types/transaction.js +10 -0
  128. package/v1/types/transaction.js.map +1 -0
  129. package/v1/utils/key.d.ts +3 -0
  130. package/v1/utils/key.js +20 -0
  131. package/v1/utils/key.js.map +1 -0
  132. package/v1/utils/signature.d.ts +2 -0
  133. package/v1/utils/signature.js +13 -0
  134. package/v1/utils/signature.js.map +1 -0
  135. package/v1/utils/transaction.d.ts +1 -0
  136. package/v1/utils/transaction.js +8 -0
  137. package/v1/utils/transaction.js.map +1 -0
  138. package/protocol/CosmosAddress.js.map +0 -1
  139. package/protocol/CosmosCoin.js.map +0 -1
  140. package/protocol/CosmosCryptoClient.js.map +0 -1
  141. package/protocol/CosmosFee.js.map +0 -1
  142. package/protocol/CosmosNodeClient.js.map +0 -1
  143. package/protocol/CosmosProtocol.js.map +0 -1
  144. package/protocol/CosmosProtocolOptions.js.map +0 -1
  145. package/protocol/CosmosTransaction.js.map +0 -1
  146. package/protocol/CosmosTypes.js.map +0 -1
  147. package/protocol/cosmos-message/CosmosDelegateMessage.js.map +0 -1
  148. package/protocol/cosmos-message/CosmosMessage.js.map +0 -1
  149. package/protocol/cosmos-message/CosmosSendMessage.js.map +0 -1
  150. package/protocol/cosmos-message/CosmosWithdrawDelegationRewardMessage.js.map +0 -1
  151. package/types/signed-transaction-cosmos.d.ts +0 -6
  152. package/types/signed-transaction-cosmos.js.map +0 -1
  153. package/types/transaction-cosmos.js.map +0 -1
  154. package/types/unsigned-transaction-cosmos.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CosmosDelegateMessage.js","sourceRoot":"","sources":["../../../../src/v0/protocol/cosmos-message/CosmosDelegateMessage.ts"],"names":[],"mapp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AK;YACP,KAAK,sBAAsB,CAAC,0BAA0B;gBACpD,IAAI,CAAC,KAAK,GAAG,sBAAsB,CAAC,0BAA0B,CAAA;gBAC9D,MAAK;YACP;gBACE,MAAM,IAAI,0BAAiB,CAAC,sBAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;SAChE;IACH,CAAC;IA1Ba,sBAAI,GAAsB,IAAI,iBAAiB,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAA;IAC5E,0BAAQ,GAAsB,IAAI,iBAAiB,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAA;IACpF,4BAAU,GAAsB,IAAI,iBAAiB,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAA;IACxF,0CAAwB,GAAsB,IAAI,iBAAiB,CAAC,sBAAsB,CAAC,0BAA0B,CAAC,CAAA;IAwBtI,wBAAC;CAAA,AA5BD,IA4BC;AA5BY,8CAAiB"}
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
- var __spreadArrays = (this && this.__spreadArrays) || function () {
3
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
5
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
6
- r[k] = a[j];
7
- return r;
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
+ if (ar || !(i in from)) {
5
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
+ ar[i] = from[i];
7
+ }
8
+ }
9
+ return to.concat(ar || Array.prototype.slice.call(from));
8
10
  };
9
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
10
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -28,7 +30,7 @@ var CosmosSendMessage = /** @class */ (function () {
28
30
  value: {
29
31
  fromAddress: this.fromAddress,
30
32
  toAddress: this.toAddress,
31
- amount: __spreadArrays(this.amount)
33
+ amount: __spreadArray([], this.amount, true)
32
34
  }
33
35
  };
34
36
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CosmosSendMessage.js","sourceRoot":"","sources":["../../../../src/v0/protocol/cosmos-message/CosmosSendMessage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,iHAA0F;AAE1F,yFAA8G;AAC9G,4CAA0D;AAG1D,iDAAqF;AAErF;IAOE,2BAAY,WAAmB,EAAE,SAAiB,EAAE,MAAoB;QAFxD,SAAI,GAAsB,iCAAiB,CAAC,IAAI,CAAA;QAG9D,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAEM,0CAAc,GAArB;QACE,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK;YACxB,KAAK,EAAE;gBACL,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,MAAM,oBAAM,IAAI,CAAC,MAAM,OAAC;aACzB;SACF,CAAA;IACH,CAAC;IAEa,kCAAgB,GAA9B,UAA+B,YAA0B;QACvD,OAAO,IAAI,iBAAiB,CAC1B,YAAY,CAAC,KAAK,CAAC,WAAW,EAC9B,YAAY,CAAC,KAAK,CAAC,SAAS,EAC5B,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,MAAM,IAAK,OAAA,IAAI,uBAAU,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAA3C,CAA2C,CAAC,CACvF,CAAA;IACH,CAAC;IAEM,kCAAM,GAAb;QACE,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,KAAiB,IAAK,OAAA,KAAK,CAAC,MAAM,EA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9B,OAAO,SAAA;YACP,kBAAkB,EAAE,IAAI,CAAC,SAAS,EAAE;YACpC,KAAK,EAAE;gBACL,IAAI,EAAE,0CAAqB,CAAC,KAAK;aAClC;SACF,CAAA;IACH,CAAC;IAEa,6BAAW,GAAzB,UAA0B,IAAS;QACjC,OAAO,IAAI,iBAAiB,CAC1B,IAAI,CAAC,KAAK,CAAC,YAAY,EACvB,IAAI,CAAC,KAAK,CAAC,UAAU,EACrB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,uBAAU,CAAC,WAAW,CAAC,KAAK,CAAC,EAA7B,CAA6B,CAAC,CAChE,CAAA;IACH,CAAC;IACH,wBAAC;AAAD,CAAC,AAtFD,IAsFC;AAtFY,8CAAiB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CosmosWithdrawDelegationRewardMessage.js","sourceRoot":"","sources":["../../../../src/v0/protocol/cosmos-message/CosmosWithdrawDelegationRewardMessage.ts"],"names":[],"mappings":";;;AAKA,iDAAqF;AAErF;IAKE,+CAAY,gBAAwB,EAAE,gBAAwB;QAF9C,SAAI,GAAsB,iCAAiB,CAAC,wBAAwB,CAAA;QAGlF,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAA;QACxC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAA;IAC1C,CAAC;IAEM,8DAAc,GAArB;QACE,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK;YACxB,KAAK,EAAE;gBACL,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;gBACvC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;aACxC;SACF,CAAA;IACH,CAAC;IAEa,sDAAgB,GAA9B,UAA+B,YAA0B;QACvD,OAAO,IAAI,qCAAqC,CAAC,YAAY,CAAC,KAAK,CAAC,gBAAgB,EAAE,YAAY,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;IAC5H,CAAC;IAEM,mEAA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3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "definitions": {
5
+ "SerializableUnsignedCosmosTransaction": {
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "callbackURL": {
9
+ "type": "string"
10
+ },
11
+ "publicKey": {
12
+ "type": "string"
13
+ },
14
+ "transaction": {
15
+ "additionalProperties": false,
16
+ "properties": {
17
+ "accountNumber": {
18
+ "type": "string"
19
+ },
20
+ "chainID": {
21
+ "type": "string"
22
+ },
23
+ "fee": {
24
+ "additionalProperties": false,
25
+ "properties": {
26
+ "amount": {
27
+ "items": {
28
+ "additionalProperties": false,
29
+ "properties": {
30
+ "amount": {
31
+ "type": "string"
32
+ },
33
+ "denom": {
34
+ "type": "string"
35
+ }
36
+ },
37
+ "required": ["denom", "amount"],
38
+ "type": "object"
39
+ },
40
+ "type": "array"
41
+ },
42
+ "gas": {
43
+ "type": "string"
44
+ }
45
+ },
46
+ "required": ["amount", "gas"],
47
+ "type": "object"
48
+ },
49
+ "memo": {
50
+ "type": "string"
51
+ },
52
+ "messages": {
53
+ "items": {
54
+ "additionalProperties": false,
55
+ "properties": {
56
+ "amount": {
57
+ "items": {
58
+ "additionalProperties": false,
59
+ "properties": {
60
+ "amount": {
61
+ "type": "string"
62
+ },
63
+ "denom": {
64
+ "type": "string"
65
+ }
66
+ },
67
+ "required": ["denom", "amount"],
68
+ "type": "object"
69
+ },
70
+ "type": "array"
71
+ },
72
+ "fromAddress": {
73
+ "type": "string"
74
+ },
75
+ "toAddress": {
76
+ "type": "string"
77
+ },
78
+ "type": {
79
+ "enum": [0, 1, 2, 3],
80
+ "type": "number"
81
+ }
82
+ },
83
+ "required": ["type", "amount", "fromAddress", "toAddress"],
84
+ "type": "object"
85
+ },
86
+ "type": "array"
87
+ },
88
+ "sequence": {
89
+ "type": "string"
90
+ }
91
+ },
92
+ "required": ["messages", "fee", "memo", "chainID", "accountNumber", "sequence"],
93
+ "type": "object"
94
+ }
95
+ },
96
+ "required": ["publicKey", "transaction"],
97
+ "type": "object"
98
+ }
99
+ }
100
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$ref": "#/definitions/SignedCosmosTransaction",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "definitions": {
5
+ "IAirGapSignedTransaction": {
6
+ "type": "string"
7
+ },
8
+ "SignedCosmosTransaction": {
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "accountIdentifier": {
12
+ "type": "string"
13
+ },
14
+ "transaction": {
15
+ "$ref": "#/definitions/IAirGapSignedTransaction"
16
+ }
17
+ },
18
+ "required": ["accountIdentifier", "transaction"],
19
+ "type": "object"
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,100 @@
1
+ {
2
+ "$ref": "#/definitions/SerializableUnsignedCosmosTransaction",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "definitions": {
5
+ "SerializableUnsignedCosmosTransaction": {
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "callbackURL": {
9
+ "type": "string"
10
+ },
11
+ "publicKey": {
12
+ "type": "string"
13
+ },
14
+ "transaction": {
15
+ "additionalProperties": false,
16
+ "properties": {
17
+ "accountNumber": {
18
+ "type": "string"
19
+ },
20
+ "chainID": {
21
+ "type": "string"
22
+ },
23
+ "fee": {
24
+ "additionalProperties": false,
25
+ "properties": {
26
+ "amount": {
27
+ "items": {
28
+ "additionalProperties": false,
29
+ "properties": {
30
+ "amount": {
31
+ "type": "string"
32
+ },
33
+ "denom": {
34
+ "type": "string"
35
+ }
36
+ },
37
+ "required": ["denom", "amount"],
38
+ "type": "object"
39
+ },
40
+ "type": "array"
41
+ },
42
+ "gas": {
43
+ "type": "string"
44
+ }
45
+ },
46
+ "required": ["amount", "gas"],
47
+ "type": "object"
48
+ },
49
+ "memo": {
50
+ "type": "string"
51
+ },
52
+ "messages": {
53
+ "items": {
54
+ "additionalProperties": false,
55
+ "properties": {
56
+ "amount": {
57
+ "items": {
58
+ "additionalProperties": false,
59
+ "properties": {
60
+ "amount": {
61
+ "type": "string"
62
+ },
63
+ "denom": {
64
+ "type": "string"
65
+ }
66
+ },
67
+ "required": ["denom", "amount"],
68
+ "type": "object"
69
+ },
70
+ "type": "array"
71
+ },
72
+ "fromAddress": {
73
+ "type": "string"
74
+ },
75
+ "toAddress": {
76
+ "type": "string"
77
+ },
78
+ "type": {
79
+ "enum": [0, 1, 2, 3],
80
+ "type": "number"
81
+ }
82
+ },
83
+ "required": ["type", "amount", "fromAddress", "toAddress"],
84
+ "type": "object"
85
+ },
86
+ "type": "array"
87
+ },
88
+ "sequence": {
89
+ "type": "string"
90
+ }
91
+ },
92
+ "required": ["messages", "fee", "memo", "chainID", "accountNumber", "sequence"],
93
+ "type": "object"
94
+ }
95
+ },
96
+ "required": ["publicKey", "transaction"],
97
+ "type": "object"
98
+ }
99
+ }
100
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$ref": "#/definitions/SignedCosmosTransaction",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "definitions": {
5
+ "SignedCosmosTransaction": {
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "accountIdentifier": {
9
+ "type": "string"
10
+ },
11
+ "transaction": {
12
+ "type": "string"
13
+ }
14
+ },
15
+ "required": ["accountIdentifier", "transaction"],
16
+ "type": "object"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,15 @@
1
+ import { TransactionValidator, TransactionValidatorFactory, TransactionValidatorFactoryV2, TransactionValidatorV2 } from '@airgap/serializer';
2
+ import { SignedCosmosTransaction } from '../../types/signed-transaction-cosmos';
3
+ import { UnsignedCosmosTransaction } from '../../types/transaction-cosmos';
4
+ export declare class CosmosTransactionValidator implements TransactionValidator, TransactionValidatorV2 {
5
+ private readonly version;
6
+ constructor(version?: 'v2' | 'v3');
7
+ validateUnsignedTransaction(unsignedTx: UnsignedCosmosTransaction): Promise<any>;
8
+ validateSignedTransaction(signedTx: SignedCosmosTransaction): Promise<any>;
9
+ }
10
+ export declare class CosmosTransactionValidatorFactory implements TransactionValidatorFactory<CosmosTransactionValidator> {
11
+ create(): CosmosTransactionValidator;
12
+ }
13
+ export declare class CosmosTransactionValidatorFactoryV2 implements TransactionValidatorFactoryV2<CosmosTransactionValidator> {
14
+ create(): CosmosTransactionValidator;
15
+ }
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ // tslint:disable: max-classes-per-file
3
+ // import { async } from '../../dependencies/src/validate.js-0.13.1/validate'
4
+ // import { RawTezosTransaction } from '../types'
5
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
+ return new (P || (P = Promise))(function (resolve, reject) {
8
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
12
+ });
13
+ };
14
+ var __generator = (this && this.__generator) || function (thisArg, body) {
15
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
16
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
17
+ function verb(n) { return function (v) { return step([n, v]); }; }
18
+ function step(op) {
19
+ if (f) throw new TypeError("Generator is already executing.");
20
+ while (_) try {
21
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
22
+ if (y = 0, t) op = [op[0] & 2, t.value];
23
+ switch (op[0]) {
24
+ case 0: case 1: t = op; break;
25
+ case 4: _.label++; return { value: op[1], done: false };
26
+ case 5: _.label++; y = op[1]; op = [0]; continue;
27
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
28
+ default:
29
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
30
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
31
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
32
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
33
+ if (t[2]) _.ops.pop();
34
+ _.trys.pop(); continue;
35
+ }
36
+ op = body.call(thisArg, _);
37
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
38
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
39
+ }
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.CosmosTransactionValidatorFactoryV2 = exports.CosmosTransactionValidatorFactory = exports.CosmosTransactionValidator = void 0;
43
+ var serializer_1 = require("@airgap/serializer");
44
+ // const unsignedTransactionConstraints = {
45
+ // binaryTransaction: {
46
+ // isValidTezosUnsignedTransaction: true,
47
+ // presence: { allowEmpty: false },
48
+ // type: 'String'
49
+ // }
50
+ // }
51
+ // const success = () => undefined
52
+ // const error = errors => errors
53
+ // const signedTransactionConstraints = {
54
+ // transaction: {
55
+ // isValidTezosSignedTransaction: true,
56
+ // presence: { allowEmpty: false },
57
+ // type: 'String'
58
+ // },
59
+ // accountIdentifier: {
60
+ // presence: { allowEmpty: false },
61
+ // type: 'String'
62
+ // }
63
+ // }
64
+ // TODO implement this
65
+ var CosmosTransactionValidator = /** @class */ (function () {
66
+ function CosmosTransactionValidator(version) {
67
+ if (version === void 0) { version = 'v3'; }
68
+ this.version = version;
69
+ }
70
+ CosmosTransactionValidator.prototype.validateUnsignedTransaction = function (unsignedTx) {
71
+ return __awaiter(this, void 0, void 0, function () {
72
+ return __generator(this, function (_a) {
73
+ // const rawTx: RawTezosTransaction = unsignedTx.transaction
74
+ if (this.version === 'v3') {
75
+ (0, serializer_1.validateSyncScheme)({});
76
+ }
77
+ else {
78
+ (0, serializer_1.validateSyncSchemeV2)({});
79
+ }
80
+ return [2 /*return*/, undefined]; // async(rawTx, unsignedTransactionConstraints).then(success, error)
81
+ });
82
+ });
83
+ };
84
+ CosmosTransactionValidator.prototype.validateSignedTransaction = function (signedTx) {
85
+ return __awaiter(this, void 0, void 0, function () {
86
+ return __generator(this, function (_a) {
87
+ return [2 /*return*/, undefined]; // async(signedTx, signedTransactionConstraints).then(success, error)
88
+ });
89
+ });
90
+ };
91
+ return CosmosTransactionValidator;
92
+ }());
93
+ exports.CosmosTransactionValidator = CosmosTransactionValidator;
94
+ var CosmosTransactionValidatorFactory = /** @class */ (function () {
95
+ function CosmosTransactionValidatorFactory() {
96
+ }
97
+ CosmosTransactionValidatorFactory.prototype.create = function () {
98
+ return new CosmosTransactionValidator('v3');
99
+ };
100
+ return CosmosTransactionValidatorFactory;
101
+ }());
102
+ exports.CosmosTransactionValidatorFactory = CosmosTransactionValidatorFactory;
103
+ var CosmosTransactionValidatorFactoryV2 = /** @class */ (function () {
104
+ function CosmosTransactionValidatorFactoryV2() {
105
+ }
106
+ CosmosTransactionValidatorFactoryV2.prototype.create = function () {
107
+ return new CosmosTransactionValidator('v2');
108
+ };
109
+ return CosmosTransactionValidatorFactoryV2;
110
+ }());
111
+ exports.CosmosTransactionValidatorFactoryV2 = CosmosTransactionValidatorFactoryV2;
112
+ //# sourceMappingURL=transaction-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../src/v0/serializer/validators/transaction-validator.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,6EAA6E;AAC7E,iDAAiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjD,iDAO2B;AAK3B,2CAA2C;AAC3C,yBAAyB;AACzB,6CAA6C;AAC7C,uCAAuC;AACvC,qBAAqB;AACrB,MAAM;AACN,IAAI;AACJ,kCAAkC;AAClC,iCAAiC;AAEjC,yCAAyC;AACzC,mBAAmB;AACnB,2CAA2C;AAC3C,uCAAuC;AACvC,qBAAqB;AACrB,OAAO;AACP,yBAAyB;AACzB,uCAAuC;AACvC,qBAAqB;AACrB,MAAM;AACN,IAAI;AAEJ,sBAAsB;AACtB;IACE,oCAA6B,OAA2B;QAA3B,wBAAA,EAAA,cAA2B;QAA3B,YAAO,GAAP,OAAO,CAAoB;IAAG,CAAC;IAE/C,gEAA2B,GAAxC,UAAyC,UAAqC;;;gBAC5E,4DAA4D;gBAC5D,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE;oBACzB,IAAA,+BAAkB,EAAC,EAAE,CAAC,CAAA;iBACvB;qBAAM;oBACL,IAAA,iCAAoB,EAAC,EAAE,CAAC,CAAA;iBACzB;gBAED,sBAAO,SAAS,EAAA,CAAC,oEAAoE;;;KACtF;IACY,8DAAyB,GAAtC,UAAuC,QAAiC;;;gBACtE,sBAAO,SAAS,EAAA,CAAC,qEAAqE;;;KACvF;IACH,iCAAC;AAAD,CAAC,AAhBD,IAgBC;AAhBY,gEAA0B;AAkBvC;IAAA;IAIA,CAAC;IAHQ,kDAAM,GAAb;QACE,OAAO,IAAI,0BAA0B,CAAC,IAAI,CAAC,CAAA;IAC7C,CAAC;IACH,wCAAC;AAAD,CAAC,AAJD,IAIC;AAJY,8EAAiC;AAM9C;IAAA;IAIA,CAAC;IAHQ,oDAAM,GAAb;QACE,OAAO,IAAI,0BAA0B,CAAC,IAAI,CAAC,CAAA;IAC7C,CAAC;IACH,0CAAC;AAAD,CAAC,AAJD,IAIC;AAJY,kFAAmC"}
@@ -0,0 +1,5 @@
1
+ import { TransactionSignResponse, TransactionSignResponseV2 } from '@airgap/serializer';
2
+ export interface SignedCosmosTransaction extends TransactionSignResponse, TransactionSignResponseV2 {
3
+ accountIdentifier: string;
4
+ transaction: string;
5
+ }
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signed-transaction-cosmos.js","sourceRoot":"","sources":["../../../src/v0/types/signed-transaction-cosmos.ts"],"names":[],"mappings":""}
File without changes
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction-cosmos.js","sourceRoot":"","sources":["../../../src/v0/types/transaction-cosmos.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { UnsignedTransaction } from '@airgap/coinlib-core/types/unsigned-transaction';
1
+ import { TransactionSignRequest, TransactionSignRequestV2 } from '@airgap/serializer';
2
2
  interface CosmosCoin {
3
3
  denom: string;
4
4
  amount: string;
@@ -27,7 +27,7 @@ interface CosmosTransaction {
27
27
  accountNumber: string;
28
28
  sequence: string;
29
29
  }
30
- export interface SerializableUnsignedCosmosTransaction extends UnsignedTransaction {
30
+ export interface SerializableUnsignedCosmosTransaction extends TransactionSignRequest, TransactionSignRequestV2 {
31
31
  transaction: CosmosTransaction;
32
32
  }
33
33
  export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsigned-transaction-cosmos.js","sourceRoot":"","sources":["../../../src/v0/types/unsigned-transaction-cosmos.ts"],"names":[],"mappings":";;AAYA,IAAK,sBAKJ;AALD,WAAK,sBAAsB;IACzB,mEAAQ,CAAA;IACR,2EAAY,CAAA;IACZ,+EAAc,CAAA;IACd,+GAA8B,CAAA;AAChC,CAAC,EALI,sBAAsB,KAAtB,sBAAsB,QAK1B"}
@@ -0,0 +1,9 @@
1
+ import { AirGapBlockExplorer, BlockExplorerMetadata } from '@airgap/module-kit';
2
+ export declare class MintscanBlockExplorer implements AirGapBlockExplorer {
3
+ private readonly url;
4
+ private readonly metadata;
5
+ constructor(url?: string);
6
+ getMetadata(): Promise<BlockExplorerMetadata>;
7
+ createAddressUrl(address: string): Promise<string>;
8
+ createTransactionUrl(transactionId: string): Promise<string>;
9
+ }
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.MintscanBlockExplorer = void 0;
40
+ var BLOCK_EXPLORER_URL = 'https://www.mintscan.io';
41
+ var MintscanBlockExplorer = /** @class */ (function () {
42
+ function MintscanBlockExplorer(url) {
43
+ if (url === void 0) { url = BLOCK_EXPLORER_URL; }
44
+ this.url = url;
45
+ this.metadata = {
46
+ name: 'Mintscan',
47
+ url: this.url
48
+ };
49
+ }
50
+ MintscanBlockExplorer.prototype.getMetadata = function () {
51
+ return __awaiter(this, void 0, void 0, function () {
52
+ return __generator(this, function (_a) {
53
+ return [2 /*return*/, this.metadata];
54
+ });
55
+ });
56
+ };
57
+ MintscanBlockExplorer.prototype.createAddressUrl = function (address) {
58
+ return __awaiter(this, void 0, void 0, function () {
59
+ return __generator(this, function (_a) {
60
+ return [2 /*return*/, "".concat(this.url, "/cosmos/account/").concat(address)];
61
+ });
62
+ });
63
+ };
64
+ MintscanBlockExplorer.prototype.createTransactionUrl = function (transactionId) {
65
+ return __awaiter(this, void 0, void 0, function () {
66
+ return __generator(this, function (_a) {
67
+ return [2 /*return*/, "".concat(this.url, "/cosmos/txs/").concat(transactionId)];
68
+ });
69
+ });
70
+ };
71
+ return MintscanBlockExplorer;
72
+ }());
73
+ exports.MintscanBlockExplorer = MintscanBlockExplorer;
74
+ //# sourceMappingURL=MintscanBlockExplorer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MintscanBlockExplorer.js","sourceRoot":"","sources":["../../../src/v1/block-explorer/MintscanBlockExplorer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAM,kBAAkB,GAAW,yBAAyB,CAAA;AAE5D;IAME,+BAAoC,GAAgC;QAAhC,oBAAA,EAAA,wBAAgC;QAAhC,QAAG,GAAH,GAAG,CAA6B;QALnD,aAAQ,GAA0B;YACjD,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAA;IAEsE,CAAC;IAE3D,2CAAW,GAAxB;;;gBACE,sBAAO,IAAI,CAAC,QAAQ,EAAA;;;KACrB;IAEY,gDAAgB,GAA7B,UAA8B,OAAe;;;gBAC3C,sBAAO,UAAG,IAAI,CAAC,GAAG,6BAAmB,OAAO,CAAE,EAAA;;;KAC/C;IAEY,oDAAoB,GAAjC,UAAkC,aAAqB;;;gBACrD,sBAAO,UAAG,IAAI,CAAC,GAAG,yBAAe,aAAa,CAAE,EAAA;;;KACjD;IACH,4BAAC;AAAD,CAAC,AAnBD,IAmBC;AAnBY,sDAAqB"}
@@ -0,0 +1,7 @@
1
+ import { PublicKey } from '@airgap/module-kit';
2
+ export declare class CosmosAddress {
3
+ private readonly value;
4
+ private constructor();
5
+ static from(publicKey: PublicKey): CosmosAddress;
6
+ asString(): string;
7
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CosmosAddress = void 0;
4
+ var BECH32 = require("@airgap/coinlib-core/dependencies/src/bech32-1.1.3/index");
5
+ var RIPEMD160 = require("@airgap/coinlib-core/dependencies/src/ripemd160-2.0.2/index");
6
+ var sha = require("@airgap/coinlib-core/dependencies/src/sha.js-2.4.11/index");
7
+ var key_1 = require("../utils/key");
8
+ var ADDRESS_PREFIX = 'cosmos';
9
+ var CosmosAddress = /** @class */ (function () {
10
+ function CosmosAddress(value) {
11
+ this.value = value;
12
+ }
13
+ CosmosAddress.from = function (publicKey) {
14
+ var hexPublicKey = (0, key_1.convertPublicKey)(publicKey, 'hex');
15
+ var sha256Hash = sha('sha256').update(Buffer.from(hexPublicKey.value, 'hex')).digest();
16
+ var hash = new RIPEMD160().update(Buffer.from(sha256Hash)).digest();
17
+ var address = BECH32.encode(ADDRESS_PREFIX, BECH32.toWords(hash));
18
+ return new CosmosAddress(address);
19
+ };
20
+ CosmosAddress.prototype.asString = function () {
21
+ return this.value;
22
+ };
23
+ return CosmosAddress;
24
+ }());
25
+ exports.CosmosAddress = CosmosAddress;
26
+ //# sourceMappingURL=CosmosAddress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CosmosAddress.js","sourceRoot":"","sources":["../../../src/v1/data/CosmosAddress.ts"],"names":[],"mappings":";;;AAAA,iFAAmF;AACnF,uFAAyF;AACzF,+EAAiF;AAGjF,oCAA+C;AAE/C,IAAM,cAAc,GAAW,QAAQ,CAAA;AAEvC;IACE,uBAAqC,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;IAExC,kBAAI,GAAlB,UAAmB,SAAoB;QACrC,IAAM,YAAY,GAAc,IAAA,sBAAgB,EAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QAElE,IAAM,UAAU,GAAW,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAA;QAChG,IAAM,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,CAAA;QACrE,IAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;QAEnE,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAAA;IACnC,CAAC;IAEM,gCAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IACH,oBAAC;AAAD,CAAC,AAhBD,IAgBC;AAhBY,sCAAa"}
@@ -0,0 +1,19 @@
1
+ import BigNumber from '@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber';
2
+ import { JSONConvertible } from '@airgap/coinlib-core/interfaces/JSONConvertible';
3
+ import { RPCConvertible } from '@airgap/coinlib-core/interfaces/RPCConvertible';
4
+ export interface CosmosCoinJSON {
5
+ denom: string;
6
+ amount: string;
7
+ }
8
+ export declare class CosmosCoin implements JSONConvertible, RPCConvertible {
9
+ private static readonly supportedDenominations;
10
+ readonly denom: string;
11
+ readonly amount: string;
12
+ constructor(denom: string, amount: string);
13
+ toJSON(): CosmosCoinJSON;
14
+ static fromJSON(json: CosmosCoinJSON): CosmosCoin;
15
+ static fromCoins(json: CosmosCoinJSON[]): CosmosCoin[];
16
+ static sum(coins: CosmosCoin[]): BigNumber;
17
+ toRPCBody(): any;
18
+ static fromRPCBody(json: any): CosmosCoin;
19
+ }