@airgap/coinlib-core 0.13.45-beta.1 → 0.13.45-beta.3

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 (218) hide show
  1. package/actions/Action.js +30 -83
  2. package/actions/Action.js.map +1 -1
  3. package/actions/LinkedAction.js +18 -82
  4. package/actions/LinkedAction.js.map +1 -1
  5. package/actions/RepeatableAction.js +20 -83
  6. package/actions/RepeatableAction.js.map +1 -1
  7. package/actions/SimpleAction.js +12 -74
  8. package/actions/SimpleAction.js.map +1 -1
  9. package/actions/StateMachine.js +16 -17
  10. package/actions/StateMachine.js.map +1 -1
  11. package/data/KeyPair.d.ts +0 -1
  12. package/data/Lazy.js +15 -64
  13. package/data/Lazy.js.map +1 -1
  14. package/data/RPCBody.js +3 -6
  15. package/data/RPCBody.js.map +1 -1
  16. package/dependencies/src/@stablelib/binary-1.0.1/packages/binary/binary.d.ts +12 -12
  17. package/dependencies/src/@stablelib/binary-1.0.1/packages/binary/binary.js +88 -130
  18. package/dependencies/src/@stablelib/binary-1.0.1/packages/binary/binary.js.map +1 -1
  19. package/dependencies/src/@stablelib/blake2b-1.0.1/packages/blake2b/blake2b.d.ts +3 -3
  20. package/dependencies/src/@stablelib/blake2b-1.0.1/packages/blake2b/blake2b.js +57 -61
  21. package/dependencies/src/@stablelib/blake2b-1.0.1/packages/blake2b/blake2b.js.map +1 -1
  22. package/dependencies/src/@stablelib/ed25519-1.0.3/packages/ed25519/ed25519.js +96 -96
  23. package/dependencies/src/@stablelib/ed25519-1.0.3/packages/ed25519/ed25519.js.map +1 -1
  24. package/dependencies/src/@stablelib/hash-1.0.1/packages/hash/hash.js +1 -2
  25. package/dependencies/src/@stablelib/hash-1.0.1/packages/hash/hash.js.map +1 -1
  26. package/dependencies/src/@stablelib/int-1.0.1/packages/int/int.js +8 -10
  27. package/dependencies/src/@stablelib/int-1.0.1/packages/int/int.js.map +1 -1
  28. package/dependencies/src/@stablelib/random-1.0.2/packages/random/random.js +22 -28
  29. package/dependencies/src/@stablelib/random-1.0.2/packages/random/random.js.map +1 -1
  30. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/browser.js +9 -10
  31. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/browser.js.map +1 -1
  32. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/node.js +10 -11
  33. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/node.js.map +1 -1
  34. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/system.js +7 -8
  35. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/system.js.map +1 -1
  36. package/dependencies/src/@stablelib/sha512/packages/sha512/sha512.d.ts +3 -3
  37. package/dependencies/src/@stablelib/sha512/packages/sha512/sha512.js +61 -63
  38. package/dependencies/src/@stablelib/sha512/packages/sha512/sha512.js.map +1 -1
  39. package/dependencies/src/@stablelib/sha512-1.0.1/packages/sha512/sha512.d.ts +4 -4
  40. package/dependencies/src/@stablelib/sha512-1.0.1/packages/sha512/sha512.js +61 -63
  41. package/dependencies/src/@stablelib/sha512-1.0.1/packages/sha512/sha512.js.map +1 -1
  42. package/dependencies/src/@stablelib/wipe-1.0.1/packages/wipe/wipe.d.ts +1 -1
  43. package/dependencies/src/@stablelib/wipe-1.0.1/packages/wipe/wipe.js +2 -3
  44. package/dependencies/src/@stablelib/wipe-1.0.1/packages/wipe/wipe.js.map +1 -1
  45. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/codec.js +111 -111
  46. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/codec.js.map +1 -1
  47. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/constants.js +15 -15
  48. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/constants.js.map +1 -1
  49. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/decoder.d.ts +1 -1
  50. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/decoder.js +47 -76
  51. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/decoder.js.map +1 -1
  52. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/encoder.d.ts +1 -1
  53. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/encoder.js +46 -61
  54. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/encoder.js.map +1 -1
  55. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/error.js +61 -106
  56. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/error.js.map +1 -1
  57. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/interface.d.ts +1 -1
  58. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/michelson/codec.d.ts +6 -6
  59. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/michelson/codec.js +95 -100
  60. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/michelson/codec.js.map +1 -1
  61. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/codec-proto14.js +33 -33
  62. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/codec-proto14.js.map +1 -1
  63. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/constants-proto14.js +9 -9
  64. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/constants-proto14.js.map +1 -1
  65. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/decoder-proto14.d.ts +1 -1
  66. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/decoder-proto14.js +46 -75
  67. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/decoder-proto14.js.map +1 -1
  68. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/encoder-proto14.d.ts +1 -1
  69. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/encoder-proto14.js +45 -70
  70. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/encoder-proto14.js.map +1 -1
  71. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/michelson/codec-proto14.js +41 -41
  72. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/michelson/codec-proto14.js.map +1 -1
  73. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/protocols.js +4 -4
  74. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/protocols.js.map +1 -1
  75. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/schema/operation.d.ts +2 -2
  76. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/schema/operation.js +58 -63
  77. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/schema/operation.js.map +1 -1
  78. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/taquito-local-forging.js +30 -33
  79. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/taquito-local-forging.js.map +1 -1
  80. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/uint8array-consumer.js +18 -20
  81. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/uint8array-consumer.js.map +1 -1
  82. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/utils.d.ts +1 -1
  83. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/utils.js +5 -12
  84. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/utils.js.map +1 -1
  85. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/validator.js +13 -13
  86. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/validator.js.map +1 -1
  87. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/opkind.js +1 -1
  88. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/opkind.js.map +1 -1
  89. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/types.d.ts +78 -78
  90. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/types.js +2 -2
  91. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/types.js.map +1 -1
  92. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/constants.d.ts +45 -45
  93. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/constants.js +75 -76
  94. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/constants.js.map +1 -1
  95. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/errors.js +115 -178
  96. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/errors.js.map +1 -1
  97. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/format.d.ts +1 -1
  98. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/format.js +6 -9
  99. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/format.js.map +1 -1
  100. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/taquito-utils.js +78 -83
  101. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/taquito-utils.js.map +1 -1
  102. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/validators.js +27 -36
  103. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/validators.js.map +1 -1
  104. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/verify-signature.d.ts +1 -1
  105. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/verify-signature.js +25 -26
  106. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/verify-signature.js.map +1 -1
  107. package/dependencies/src/cosmjs/index.d.ts +14 -230
  108. package/dependencies/src/cosmjs/index.js +373 -480
  109. package/dependencies/src/cosmjs/index.js.map +1 -1
  110. package/dependencies/src/eciesjs-0.3.9/src/index.d.ts +0 -1
  111. package/dependencies/src/eciesjs-0.3.9/src/index.js +15 -19
  112. package/dependencies/src/eciesjs-0.3.9/src/index.js.map +1 -1
  113. package/dependencies/src/eciesjs-0.3.9/src/keys/PrivateKey.d.ts +0 -1
  114. package/dependencies/src/eciesjs-0.3.9/src/keys/PrivateKey.js +37 -28
  115. package/dependencies/src/eciesjs-0.3.9/src/keys/PrivateKey.js.map +1 -1
  116. package/dependencies/src/eciesjs-0.3.9/src/keys/PublicKey.d.ts +0 -1
  117. package/dependencies/src/eciesjs-0.3.9/src/keys/PublicKey.js +38 -30
  118. package/dependencies/src/eciesjs-0.3.9/src/keys/PublicKey.js.map +1 -1
  119. package/dependencies/src/eciesjs-0.3.9/src/utils.d.ts +0 -1
  120. package/dependencies/src/eciesjs-0.3.9/src/utils.js +33 -24
  121. package/dependencies/src/eciesjs-0.3.9/src/utils.js.map +1 -1
  122. package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.js +42 -34
  123. package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.js.map +1 -1
  124. package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.js +6 -10
  125. package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.js.map +1 -1
  126. package/errors/coinlib-error.js +16 -37
  127. package/errors/coinlib-error.js.map +1 -1
  128. package/errors/index.d.ts +2 -2
  129. package/errors/index.js +89 -148
  130. package/errors/index.js.map +1 -1
  131. package/index.js +19 -19
  132. package/index.js.map +1 -1
  133. package/interfaces/IAirGapSignedTransaction.d.ts +1 -1
  134. package/interfaces/IAirGapTransaction.js +3 -3
  135. package/interfaces/IAirGapTransaction.js.map +1 -1
  136. package/networks.js +9 -9
  137. package/networks.js.map +1 -1
  138. package/package.json +1 -1
  139. package/protocols/BlockExplorerProtocol.js +7 -54
  140. package/protocols/BlockExplorerProtocol.js.map +1 -1
  141. package/protocols/CryptoClient.js +19 -78
  142. package/protocols/CryptoClient.js.map +1 -1
  143. package/protocols/Ed25519CryptoClient.js +30 -98
  144. package/protocols/Ed25519CryptoClient.js.map +1 -1
  145. package/protocols/ICoinSubProtocol.js +1 -1
  146. package/protocols/ICoinSubProtocol.js.map +1 -1
  147. package/protocols/NonExtendedProtocol.js +26 -29
  148. package/protocols/NonExtendedProtocol.js.map +1 -1
  149. package/protocols/Secp256k1CryptoClient.js +9 -73
  150. package/protocols/Secp256k1CryptoClient.js.map +1 -1
  151. package/protocols/Sr25519CryptoClient.js +12 -76
  152. package/protocols/Sr25519CryptoClient.js.map +1 -1
  153. package/utils/AES.js +81 -132
  154. package/utils/AES.js.map +1 -1
  155. package/utils/ErrorWithData.js +5 -23
  156. package/utils/ErrorWithData.js.map +1 -1
  157. package/utils/Network.js +1 -1
  158. package/utils/Network.js.map +1 -1
  159. package/utils/ProtocolBlockExplorer.js +3 -4
  160. package/utils/ProtocolBlockExplorer.js.map +1 -1
  161. package/utils/ProtocolNetwork.js +11 -16
  162. package/utils/ProtocolNetwork.js.map +1 -1
  163. package/utils/ProtocolSymbols.d.ts +1 -1
  164. package/utils/ProtocolSymbols.js +6 -6
  165. package/utils/ProtocolSymbols.js.map +1 -1
  166. package/utils/array.js +14 -15
  167. package/utils/array.js.map +1 -1
  168. package/utils/assert.js +8 -12
  169. package/utils/assert.js.map +1 -1
  170. package/utils/base64Check.d.ts +0 -1
  171. package/utils/base64Check.js +15 -15
  172. package/utils/base64Check.js.map +1 -1
  173. package/utils/blake2b.js +11 -14
  174. package/utils/blake2b.js.map +1 -1
  175. package/utils/buffer.d.ts +0 -1
  176. package/utils/buffer.js +1 -1
  177. package/utils/buffer.js.map +1 -1
  178. package/utils/cache.js +38 -87
  179. package/utils/cache.js.map +1 -1
  180. package/utils/error.js +2 -3
  181. package/utils/error.js.map +1 -1
  182. package/utils/hex.d.ts +1 -2
  183. package/utils/hex.js +31 -38
  184. package/utils/hex.js.map +1 -1
  185. package/utils/interfaces.js +3 -4
  186. package/utils/interfaces.js.map +1 -1
  187. package/utils/object.js +5 -7
  188. package/utils/object.js.map +1 -1
  189. package/utils/padStart.js +1 -2
  190. package/utils/padStart.js.map +1 -1
  191. package/utils/remote-data/HttpRemoteData.js +24 -107
  192. package/utils/remote-data/HttpRemoteData.js.map +1 -1
  193. package/utils/remote-data/IpfsRemoteData.js +32 -116
  194. package/utils/remote-data/IpfsRemoteData.js.map +1 -1
  195. package/utils/remote-data/RemoteData.d.ts +0 -1
  196. package/utils/remote-data/RemoteData.js +3 -4
  197. package/utils/remote-data/RemoteData.js.map +1 -1
  198. package/utils/remote-data/RemoteDataFactory.d.ts +2 -2
  199. package/utils/remote-data/RemoteDataFactory.js +13 -20
  200. package/utils/remote-data/RemoteDataFactory.js.map +1 -1
  201. package/utils/remote-data/Sha256RemoteData.d.ts +0 -1
  202. package/utils/remote-data/Sha256RemoteData.js +44 -117
  203. package/utils/remote-data/Sha256RemoteData.js.map +1 -1
  204. package/utils/string.js +8 -9
  205. package/utils/string.js.map +1 -1
  206. package/utils/type.js +3 -4
  207. package/utils/type.js.map +1 -1
  208. package/utils/xxhash.d.ts +0 -1
  209. package/utils/xxhash.js +9 -11
  210. package/utils/xxhash.js.map +1 -1
  211. package/wallet/AirGapCoinWallet.js +64 -183
  212. package/wallet/AirGapCoinWallet.js.map +1 -1
  213. package/wallet/AirGapMarketWallet.js +88 -201
  214. package/wallet/AirGapMarketWallet.js.map +1 -1
  215. package/wallet/AirGapNFTWallet.js +48 -165
  216. package/wallet/AirGapNFTWallet.js.map +1 -1
  217. package/wallet/AirGapWallet.js +58 -145
  218. package/wallet/AirGapWallet.js.map +1 -1
@@ -1,172 +1,77 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
33
- 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;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
54
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
55
4
  };
56
5
  Object.defineProperty(exports, "__esModule", { value: true });
57
6
  exports.AirGapMarketWallet = void 0;
58
- var bignumber_1 = __importDefault(require("../dependencies/src/bignumber.js-9.0.0/bignumber"));
59
- var ProtocolSymbols_1 = require("../utils/ProtocolSymbols");
60
- var AirGapWallet_1 = require("./AirGapWallet");
61
- var AirGapMarketWallet = /** @class */ (function (_super) {
62
- __extends(AirGapMarketWallet, _super);
63
- function AirGapMarketWallet(protocol, publicKey, isExtendedPublicKey, derivationPath, masterFingerprint, status, priceService, addressIndex) {
64
- var _this = _super.call(this, protocol, publicKey, isExtendedPublicKey, derivationPath, masterFingerprint, status, addressIndex) || this;
65
- _this.protocol = protocol;
66
- _this.publicKey = publicKey;
67
- _this.isExtendedPublicKey = isExtendedPublicKey;
68
- _this.derivationPath = derivationPath;
69
- _this.masterFingerprint = masterFingerprint;
70
- _this.status = status;
71
- _this.priceService = priceService;
72
- _this.addressIndex = addressIndex;
73
- return _this;
7
+ const bignumber_1 = __importDefault(require("../dependencies/src/bignumber.js-9.0.0/bignumber"));
8
+ const ProtocolSymbols_1 = require("../utils/ProtocolSymbols");
9
+ const AirGapWallet_1 = require("./AirGapWallet");
10
+ class AirGapMarketWallet extends AirGapWallet_1.AirGapWallet {
11
+ constructor(protocol, publicKey, isExtendedPublicKey, derivationPath, masterFingerprint, status, priceService, addressIndex) {
12
+ super(protocol, publicKey, isExtendedPublicKey, derivationPath, masterFingerprint, status, addressIndex);
13
+ this.protocol = protocol;
14
+ this.publicKey = publicKey;
15
+ this.isExtendedPublicKey = isExtendedPublicKey;
16
+ this.derivationPath = derivationPath;
17
+ this.masterFingerprint = masterFingerprint;
18
+ this.status = status;
19
+ this.priceService = priceService;
20
+ this.addressIndex = addressIndex;
74
21
  }
75
- AirGapMarketWallet.prototype.addressesToCheck = function () {
76
- var addressesToReceive = this.addressIndex !== undefined ? [this.addresses[this.addressIndex]] : this.addresses;
22
+ addressesToCheck() {
23
+ const addressesToReceive = this.addressIndex !== undefined ? [this.addresses[this.addressIndex]] : this.addresses;
77
24
  return addressesToReceive;
78
- };
79
- AirGapMarketWallet.prototype.setProtocol = function (protocol) {
80
- return __awaiter(this, void 0, void 0, function () {
81
- return __generator(this, function (_a) {
82
- switch (_a.label) {
83
- case 0: return [4 /*yield*/, _super.prototype.setProtocol.call(this, protocol)];
84
- case 1:
85
- _a.sent();
86
- this.reset();
87
- return [4 /*yield*/, this.synchronize()];
88
- case 2:
89
- _a.sent();
90
- return [2 /*return*/];
91
- }
25
+ }
26
+ async setProtocol(protocol) {
27
+ await super.setProtocol(protocol);
28
+ this.reset();
29
+ await this.synchronize();
30
+ }
31
+ async synchronize(...args) {
32
+ if (this.synchronizePromise === undefined) {
33
+ this.synchronizePromise = this._synchronize(...args).finally(() => {
34
+ this.synchronizePromise = undefined;
92
35
  });
93
- });
94
- };
95
- AirGapMarketWallet.prototype.synchronize = function () {
96
- var args = [];
97
- for (var _i = 0; _i < arguments.length; _i++) {
98
- args[_i] = arguments[_i];
99
36
  }
100
- return __awaiter(this, void 0, void 0, function () {
101
- var _this = this;
102
- return __generator(this, function (_a) {
103
- if (this.synchronizePromise === undefined) {
104
- this.synchronizePromise = this._synchronize.apply(this, args).finally(function () {
105
- _this.synchronizePromise = undefined;
106
- });
107
- }
108
- return [2 /*return*/, this.synchronizePromise];
109
- });
110
- });
111
- };
112
- AirGapMarketWallet.prototype.fetchTransactions = function (limit, cursor) {
113
- return __awaiter(this, void 0, void 0, function () {
114
- var protocolIdentifier, transactionResult;
115
- return __generator(this, function (_a) {
116
- switch (_a.label) {
117
- case 0: return [4 /*yield*/, this.protocol.getIdentifier()
118
- // let transactions: IAirGapTransaction[] = []
119
- ];
120
- case 1:
121
- protocolIdentifier = _a.sent();
122
- if (!((protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.BTC ||
123
- protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.BTC_SEGWIT ||
124
- protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.BTC_TAPROOT ||
125
- protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.GRS) &&
126
- this.isExtendedPublicKey)) return [3 /*break*/, 3];
127
- return [4 /*yield*/, this.protocol.getTransactionsFromExtendedPublicKey(this.publicKey, limit, cursor)];
128
- case 2:
129
- // TODO: Remove and test
130
- /*
131
- We should remove this if BTC also uses blockbook. (And change the order of the if/else below)
132
-
133
- The problem is that we have addresses cached for all protocols. But blockbook (grs) doesn't allow
134
- multiple addresses to be checked at once, so we need to xPub key there (or we would do 100s of requests).
135
-
136
- We can also not simply change the order of the following if/else, because then it would use the xPub method for
137
- BTC as well, which results in the addresses being derived again, which causes massive lags in the apps.
138
- */
139
- transactionResult = _a.sent();
140
- return [3 /*break*/, 11];
141
- case 3:
142
- if (!(protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.XTZ_SHIELDED) /* TODO: cover ALL sapling protocols */) return [3 /*break*/, 5]; /* TODO: cover ALL sapling protocols */
143
- return [4 /*yield*/, this.protocol.getTransactionsFromPublicKey(this.publicKey, limit, cursor)];
144
- case 4:
145
- transactionResult = _a.sent();
146
- return [3 /*break*/, 11];
147
- case 5:
148
- if (!(this.addresses.length > 0)) return [3 /*break*/, 7];
149
- return [4 /*yield*/, this.protocol.getTransactionsFromAddresses(this.addressesToCheck(), limit, cursor)];
150
- case 6:
151
- transactionResult = _a.sent();
152
- return [3 /*break*/, 11];
153
- case 7:
154
- if (!this.isExtendedPublicKey) return [3 /*break*/, 9];
155
- return [4 /*yield*/, this.protocol.getTransactionsFromExtendedPublicKey(this.publicKey, limit, cursor)];
156
- case 8:
157
- transactionResult = _a.sent();
158
- return [3 /*break*/, 11];
159
- case 9: return [4 /*yield*/, this.protocol.getTransactionsFromPublicKey(this.publicKey, limit, cursor)];
160
- case 10:
161
- transactionResult = _a.sent();
162
- _a.label = 11;
163
- case 11: return [2 /*return*/, transactionResult];
164
- }
165
- });
166
- });
167
- };
168
- AirGapMarketWallet.prototype.prepareTransaction = function (recipients, values, fee, data) {
169
- if (data === void 0) { data = {}; }
37
+ return this.synchronizePromise;
38
+ }
39
+ async fetchTransactions(limit, cursor) {
40
+ const protocolIdentifier = await this.protocol.getIdentifier();
41
+ // let transactions: IAirGapTransaction[] = []
42
+ let transactionResult;
43
+ if ((protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.BTC ||
44
+ protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.BTC_SEGWIT ||
45
+ protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.BTC_TAPROOT ||
46
+ protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.GRS) &&
47
+ this.isExtendedPublicKey) {
48
+ // TODO: Remove and test
49
+ /*
50
+ We should remove this if BTC also uses blockbook. (And change the order of the if/else below)
51
+
52
+ The problem is that we have addresses cached for all protocols. But blockbook (grs) doesn't allow
53
+ multiple addresses to be checked at once, so we need to xPub key there (or we would do 100s of requests).
54
+
55
+ We can also not simply change the order of the following if/else, because then it would use the xPub method for
56
+ BTC as well, which results in the addresses being derived again, which causes massive lags in the apps.
57
+ */
58
+ transactionResult = await this.protocol.getTransactionsFromExtendedPublicKey(this.publicKey, limit, cursor);
59
+ }
60
+ else if (protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.XTZ_SHIELDED /* TODO: cover ALL sapling protocols */) {
61
+ transactionResult = await this.protocol.getTransactionsFromPublicKey(this.publicKey, limit, cursor);
62
+ }
63
+ else if (this.addresses.length > 0) {
64
+ transactionResult = await this.protocol.getTransactionsFromAddresses(this.addressesToCheck(), limit, cursor);
65
+ }
66
+ else if (this.isExtendedPublicKey) {
67
+ transactionResult = await this.protocol.getTransactionsFromExtendedPublicKey(this.publicKey, limit, cursor);
68
+ }
69
+ else {
70
+ transactionResult = await this.protocol.getTransactionsFromPublicKey(this.publicKey, limit, cursor);
71
+ }
72
+ return transactionResult;
73
+ }
74
+ prepareTransaction(recipients, values, fee, data = {}) {
170
75
  if (this.isExtendedPublicKey) {
171
76
  return this.protocol.prepareTransactionFromExtendedPublicKey(this.publicKey, 0, recipients, values, fee, data);
172
77
  }
@@ -176,47 +81,29 @@ var AirGapMarketWallet = /** @class */ (function (_super) {
176
81
  }
177
82
  return this.protocol.prepareTransactionFromPublicKey(this.publicKey, recipients, values, fee, data);
178
83
  }
179
- };
180
- AirGapMarketWallet.prototype.getMaxTransferValue = function (recipients, fee, data) {
181
- if (data === void 0) { data = {}; }
182
- return __awaiter(this, void 0, void 0, function () {
183
- var _a, _b;
184
- return __generator(this, function (_c) {
185
- switch (_c.label) {
186
- case 0:
187
- if (!this.isExtendedPublicKey) return [3 /*break*/, 2];
188
- _a = bignumber_1.default.bind;
189
- return [4 /*yield*/, this.protocol.estimateMaxTransactionValueFromExtendedPublicKey(this.publicKey, recipients, fee, data)];
190
- case 1: return [2 /*return*/, new (_a.apply(bignumber_1.default, [void 0, _c.sent()]))()];
191
- case 2:
192
- if (this.addressIndex) {
193
- data = Object.assign(data, { addressIndex: this.addressIndex });
194
- }
195
- _b = bignumber_1.default.bind;
196
- return [4 /*yield*/, this.protocol.estimateMaxTransactionValueFromPublicKey(this.publicKey, recipients, fee, data)];
197
- case 3: return [2 /*return*/, new (_b.apply(bignumber_1.default, [void 0, _c.sent()]))()];
198
- }
199
- });
200
- });
201
- };
202
- AirGapMarketWallet.prototype.estimateFees = function (recipients, values, data) {
203
- if (data === void 0) { data = {}; }
204
- return __awaiter(this, void 0, void 0, function () {
205
- return __generator(this, function (_a) {
206
- if (this.isExtendedPublicKey) {
207
- return [2 /*return*/, this.protocol.estimateFeeDefaultsFromExtendedPublicKey(this.publicKey, recipients, values, data)];
208
- }
209
- else {
210
- if (this.addressIndex) {
211
- data = Object.assign(data, { addressIndex: this.addressIndex });
212
- }
213
- return [2 /*return*/, this.protocol.estimateFeeDefaultsFromPublicKey(this.publicKey, recipients, values, data)];
214
- }
215
- return [2 /*return*/];
216
- });
217
- });
218
- };
219
- return AirGapMarketWallet;
220
- }(AirGapWallet_1.AirGapWallet));
84
+ }
85
+ async getMaxTransferValue(recipients, fee, data = {}) {
86
+ if (this.isExtendedPublicKey) {
87
+ return new bignumber_1.default(await this.protocol.estimateMaxTransactionValueFromExtendedPublicKey(this.publicKey, recipients, fee, data));
88
+ }
89
+ else {
90
+ if (this.addressIndex) {
91
+ data = Object.assign(data, { addressIndex: this.addressIndex });
92
+ }
93
+ return new bignumber_1.default(await this.protocol.estimateMaxTransactionValueFromPublicKey(this.publicKey, recipients, fee, data));
94
+ }
95
+ }
96
+ async estimateFees(recipients, values, data = {}) {
97
+ if (this.isExtendedPublicKey) {
98
+ return this.protocol.estimateFeeDefaultsFromExtendedPublicKey(this.publicKey, recipients, values, data);
99
+ }
100
+ else {
101
+ if (this.addressIndex) {
102
+ data = Object.assign(data, { addressIndex: this.addressIndex });
103
+ }
104
+ return this.protocol.estimateFeeDefaultsFromPublicKey(this.publicKey, recipients, values, data);
105
+ }
106
+ }
107
+ }
221
108
  exports.AirGapMarketWallet = AirGapMarketWallet;
222
109
  //# sourceMappingURL=AirGapMarketWallet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AirGapMarketWallet.js","sourceRoot":"","sources":["../../src/wallet/AirGapMarketWallet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+FAAwE;AAGxE,4DAA8D;AAE9D,+CAAiE;AAMjE;IAAiD,sCAAY;IAG3D,4BACS,QAAuB,EACvB,SAAiB,EACjB,mBAA4B,EAC5B,cAAsB,EACtB,iBAAyB,EACzB,MAA0B,EAC1B,YAAsC,EACtC,YAAqB;QAR9B,YAUE,kBAAM,QAAQ,EAAE,SAAS,EAAE,mBAAmB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,EAAE,YAAY,CAAC,SACzG;QAVQ,cAAQ,GAAR,QAAQ,CAAe;QACvB,eAAS,GAAT,SAAS,CAAQ;QACjB,yBAAmB,GAAnB,mBAAmB,CAAS;QAC5B,oBAAc,GAAd,cAAc,CAAQ;QACtB,uBAAiB,GAAjB,iBAAiB,CAAQ;QACzB,YAAM,GAAN,MAAM,CAAoB;QAC1B,kBAAY,GAAZ,YAAY,CAA0B;QACtC,kBAAY,GAAZ,YAAY,CAAS;;IAG9B,CAAC;IAcS,6CAAgB,GAA1B;QACE,IAAM,kBAAkB,GAAa,IAAI,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAA;QAE3H,OAAO,kBAAkB,CAAA;IAC3B,CAAC;IAEY,wCAAW,GAAxB,UAAyB,QAAuB;;;;4BAC9C,qBAAM,iBAAM,WAAW,YAAC,QAAQ,CAAC,EAAA;;wBAAjC,SAAiC,CAA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AAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAA;QACnI,CAAC;aAAM,CAAC;YACN,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtB,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAA;YACjE,CAAC;YAED,OAAO,IAAI,mBAAS,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,wCAAwC,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAA;QAC3H,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,UAAoB,EAAE,MAAgB,EAAE,OAAmC,EAAE;QACrG,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,wCAAwC,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QACzG,CAAC;aAAM,CAAC;YACN,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtB,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAA;YACjE,CAAC;YAED,OAAO,IAAI,CAAC,QAAQ,CAAC,gCAAgC,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QACjG,CAAC;IACH,CAAC;CACF;AA9HD,gDA8HC"}
@@ -1,179 +1,62 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
33
- 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;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
54
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
55
4
  };
56
5
  Object.defineProperty(exports, "__esModule", { value: true });
57
6
  exports.AirGapNFTWallet = void 0;
58
- var bignumber_1 = __importDefault(require("../dependencies/src/bignumber.js-9.0.0/bignumber"));
59
- var ProtocolNetwork_1 = require("../utils/ProtocolNetwork");
60
- var AirGapMarketWallet_1 = require("./AirGapMarketWallet");
61
- var AirGapNFTWallet = /** @class */ (function (_super) {
62
- __extends(AirGapNFTWallet, _super);
63
- function AirGapNFTWallet() {
64
- var _this = _super !== null && _super.apply(this, arguments) || this;
65
- _this.currentBalance = {};
66
- _this.currentMarketPrice = {};
67
- return _this;
7
+ const bignumber_1 = __importDefault(require("../dependencies/src/bignumber.js-9.0.0/bignumber"));
8
+ const ProtocolNetwork_1 = require("../utils/ProtocolNetwork");
9
+ const AirGapMarketWallet_1 = require("./AirGapMarketWallet");
10
+ class AirGapNFTWallet extends AirGapMarketWallet_1.AirGapMarketWallet {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.currentBalance = {};
14
+ this.currentMarketPrice = {};
68
15
  }
69
- AirGapNFTWallet.prototype.getCurrentBalance = function (assetID) {
16
+ getCurrentBalance(assetID) {
70
17
  return this.currentBalance[assetID];
71
- };
72
- AirGapNFTWallet.prototype.setCurrentBalance = function (balance, assetID) {
18
+ }
19
+ setCurrentBalance(balance, assetID) {
73
20
  this.currentBalance[assetID] = balance;
74
- };
75
- AirGapNFTWallet.prototype.getCurrentMarketPrice = function (assetID) {
21
+ }
22
+ getCurrentMarketPrice(assetID) {
76
23
  return this.currentMarketPrice[assetID];
77
- };
78
- AirGapNFTWallet.prototype.setCurrentMarketPrice = function (marketPrice, assetID) {
79
- return __awaiter(this, void 0, void 0, function () {
80
- var _a, _b;
81
- return __generator(this, function (_c) {
82
- switch (_c.label) {
83
- case 0:
84
- _a = this.getCurrentMarketPrice;
85
- _b = assetID;
86
- return [4 /*yield*/, this.protocol.getOptions()];
87
- case 1:
88
- _a[_b] =
89
- (_c.sent()).network.type === ProtocolNetwork_1.NetworkType.MAINNET ? marketPrice : new bignumber_1.default(0);
90
- return [2 /*return*/];
91
- }
92
- });
93
- });
94
- };
95
- AirGapNFTWallet.prototype.synchronize = function (assetsID) {
96
- if (assetsID === void 0) { assetsID = []; }
97
- return __awaiter(this, void 0, void 0, function () {
98
- return __generator(this, function (_a) {
99
- return [2 /*return*/, _super.prototype.synchronize.call(this, assetsID)];
100
- });
101
- });
102
- };
103
- AirGapNFTWallet.prototype._synchronize = function (assetIDs) {
104
- if (assetIDs === void 0) { assetIDs = []; }
105
- return __awaiter(this, void 0, void 0, function () {
106
- var _this = this;
107
- return __generator(this, function (_a) {
108
- switch (_a.label) {
109
- case 0: return [4 /*yield*/, Promise.all(assetIDs.map(function (assetID) { return __awaiter(_this, void 0, void 0, function () {
110
- var _a, balance, marketPrice;
111
- return __generator(this, function (_b) {
112
- switch (_b.label) {
113
- case 0: return [4 /*yield*/, Promise.all([this.balanceOf(assetID), this.fetchCurrentMarketPrice(assetID)])];
114
- case 1:
115
- _a = _b.sent(), balance = _a[0], marketPrice = _a[1];
116
- this.setCurrentBalance(balance, assetID);
117
- return [4 /*yield*/, this.setCurrentMarketPrice(marketPrice, assetID)];
118
- case 2:
119
- _b.sent();
120
- return [2 /*return*/];
121
- }
122
- });
123
- }); }))];
124
- case 1:
125
- _a.sent();
126
- return [2 /*return*/];
127
- }
128
- });
129
- });
130
- };
131
- AirGapNFTWallet.prototype.reset = function () {
24
+ }
25
+ async setCurrentMarketPrice(marketPrice, assetID) {
26
+ this.getCurrentMarketPrice[assetID] =
27
+ (await this.protocol.getOptions()).network.type === ProtocolNetwork_1.NetworkType.MAINNET ? marketPrice : new bignumber_1.default(0);
28
+ }
29
+ async synchronize(assetsID = []) {
30
+ return super.synchronize(assetsID);
31
+ }
32
+ async _synchronize(assetIDs = []) {
33
+ await Promise.all(assetIDs.map(async (assetID) => {
34
+ const [balance, marketPrice] = await Promise.all([this.balanceOf(assetID), this.fetchCurrentMarketPrice(assetID)]);
35
+ this.setCurrentBalance(balance, assetID);
36
+ await this.setCurrentMarketPrice(marketPrice, assetID);
37
+ }));
38
+ }
39
+ reset() {
132
40
  this.currentBalance = {};
133
41
  this.currentMarketPrice = {};
134
- };
135
- AirGapNFTWallet.prototype.fetchCurrentMarketPrice = function (assetID, _baseSymbol) {
136
- if (_baseSymbol === void 0) { _baseSymbol = 'USD'; }
137
- return __awaiter(this, void 0, void 0, function () {
138
- var result;
139
- return __generator(this, function (_a) {
140
- switch (_a.label) {
141
- case 0:
142
- result = new bignumber_1.default(0);
143
- return [4 /*yield*/, this.setCurrentMarketPrice(result, assetID)];
144
- case 1:
145
- _a.sent();
146
- return [2 /*return*/, result];
147
- }
148
- });
149
- });
150
- };
151
- AirGapNFTWallet.prototype.balanceOf = function (assetID) {
152
- return __awaiter(this, void 0, void 0, function () {
153
- var result, _a, _b;
154
- return __generator(this, function (_c) {
155
- switch (_c.label) {
156
- case 0:
157
- if (!this.isExtendedPublicKey) return [3 /*break*/, 2];
158
- _a = bignumber_1.default.bind;
159
- return [4 /*yield*/, this.protocol.getBalanceOfExtendedPublicKey(this.publicKey, 0, { assetID: assetID })];
160
- case 1:
161
- result = new (_a.apply(bignumber_1.default, [void 0, _c.sent()]))();
162
- return [3 /*break*/, 4];
163
- case 2:
164
- _b = bignumber_1.default.bind;
165
- return [4 /*yield*/, this.protocol.getBalanceOfPublicKey(this.publicKey, { addressIndex: this.addressIndex, assetID: assetID })];
166
- case 3:
167
- result = new (_b.apply(bignumber_1.default, [void 0, _c.sent()]))();
168
- _c.label = 4;
169
- case 4:
170
- this.setCurrentBalance(result, assetID);
171
- return [2 /*return*/, result];
172
- }
173
- });
174
- });
175
- };
176
- return AirGapNFTWallet;
177
- }(AirGapMarketWallet_1.AirGapMarketWallet));
42
+ }
43
+ async fetchCurrentMarketPrice(assetID, _baseSymbol = 'USD') {
44
+ // TODO
45
+ const result = new bignumber_1.default(0);
46
+ await this.setCurrentMarketPrice(result, assetID);
47
+ return result;
48
+ }
49
+ async balanceOf(assetID) {
50
+ let result;
51
+ if (this.isExtendedPublicKey) {
52
+ result = new bignumber_1.default(await this.protocol.getBalanceOfExtendedPublicKey(this.publicKey, 0, { assetID }));
53
+ }
54
+ else {
55
+ result = new bignumber_1.default(await this.protocol.getBalanceOfPublicKey(this.publicKey, { addressIndex: this.addressIndex, assetID }));
56
+ }
57
+ this.setCurrentBalance(result, assetID);
58
+ return result;
59
+ }
60
+ }
178
61
  exports.AirGapNFTWallet = AirGapNFTWallet;
179
62
  //# sourceMappingURL=AirGapNFTWallet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AirGapNFTWallet.js","sourceRoot":"","sources":["../../src/wallet/AirGapNFTWallet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+FAAwE;AACxE,4DAAsD;AAEtD,2DAAyD;AAEzD;IAAqC,mCAAkB;IAAvD;QAAA,qEA2DC;QA1DS,oBAAc,GAA0C,EAAE,CAAA;QAU1D,wBAAkB,GAA0C,EAAE,CAAA;;IAgDxE,CAAC;IAxDQ,2CAAiB,GAAxB,UAAyB,OAAe;QACtC,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;IACrC,CAAC;IAEM,2CAAiB,GAAxB,UAAyB,OAA8B,EAAE,OAAe;QACtE,IAAI,CAAC,cA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