@airgap/ethereum 0.13.10 → 0.13.11-beta.1

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/package.json +11 -9
  2. package/airgap-coinlib-ethereum.min.js +0 -117080
  3. package/index.d.ts +0 -1
  4. package/index.js +0 -18
  5. package/index.js.map +0 -1
  6. package/v0/index.d.ts +0 -12
  7. package/v0/index.js +0 -39
  8. package/v0/index.js.map +0 -1
  9. package/v0/protocol/BaseEthereumProtocol.d.ts +0 -98
  10. package/v0/protocol/BaseEthereumProtocol.js +0 -939
  11. package/v0/protocol/BaseEthereumProtocol.js.map +0 -1
  12. package/v0/protocol/EthereumAddress.d.ts +0 -8
  13. package/v0/protocol/EthereumAddress.js +0 -43
  14. package/v0/protocol/EthereumAddress.js.map +0 -1
  15. package/v0/protocol/EthereumChainIDs.d.ts +0 -1
  16. package/v0/protocol/EthereumChainIDs.js +0 -340
  17. package/v0/protocol/EthereumChainIDs.js.map +0 -1
  18. package/v0/protocol/EthereumClassicProtocol.d.ts +0 -6
  19. package/v0/protocol/EthereumClassicProtocol.js +0 -30
  20. package/v0/protocol/EthereumClassicProtocol.js.map +0 -1
  21. package/v0/protocol/EthereumCryptoClient.d.ts +0 -12
  22. package/v0/protocol/EthereumCryptoClient.js +0 -148
  23. package/v0/protocol/EthereumCryptoClient.js.map +0 -1
  24. package/v0/protocol/EthereumProtocol.d.ts +0 -10
  25. package/v0/protocol/EthereumProtocol.js +0 -34
  26. package/v0/protocol/EthereumProtocol.js.map +0 -1
  27. package/v0/protocol/EthereumProtocolOptions.d.ts +0 -46
  28. package/v0/protocol/EthereumProtocolOptions.js +0 -150
  29. package/v0/protocol/EthereumProtocolOptions.js.map +0 -1
  30. package/v0/protocol/EthereumRopstenProtocol.d.ts +0 -6
  31. package/v0/protocol/EthereumRopstenProtocol.js +0 -30
  32. package/v0/protocol/EthereumRopstenProtocol.js.map +0 -1
  33. package/v0/protocol/EthereumTypes.d.ts +0 -14
  34. package/v0/protocol/EthereumTypes.js +0 -3
  35. package/v0/protocol/EthereumTypes.js.map +0 -1
  36. package/v0/protocol/clients/info-clients/EtherscanInfoClient.d.ts +0 -8
  37. package/v0/protocol/clients/info-clients/EtherscanInfoClient.js +0 -195
  38. package/v0/protocol/clients/info-clients/EtherscanInfoClient.js.map +0 -1
  39. package/v0/protocol/clients/info-clients/InfoClient.d.ts +0 -8
  40. package/v0/protocol/clients/info-clients/InfoClient.js +0 -11
  41. package/v0/protocol/clients/info-clients/InfoClient.js.map +0 -1
  42. package/v0/protocol/clients/node-clients/AirGapNodeClient.d.ts +0 -41
  43. package/v0/protocol/clients/node-clients/AirGapNodeClient.js +0 -353
  44. package/v0/protocol/clients/node-clients/AirGapNodeClient.js.map +0 -1
  45. package/v0/protocol/clients/node-clients/NodeClient.d.ts +0 -17
  46. package/v0/protocol/clients/node-clients/NodeClient.js +0 -11
  47. package/v0/protocol/clients/node-clients/NodeClient.js.map +0 -1
  48. package/v0/protocol/erc20/ERC20.d.ts +0 -3
  49. package/v0/protocol/erc20/ERC20.js +0 -9
  50. package/v0/protocol/erc20/ERC20.js.map +0 -1
  51. package/v0/protocol/erc20/GenericERC20.d.ts +0 -32
  52. package/v0/protocol/erc20/GenericERC20.js +0 -335
  53. package/v0/protocol/erc20/GenericERC20.js.map +0 -1
  54. package/v0/protocol/utils/utils.d.ts +0 -13
  55. package/v0/protocol/utils/utils.js +0 -140
  56. package/v0/protocol/utils/utils.js.map +0 -1
  57. package/v0/serializer/schemas/v2/transaction-sign-request-ethereum.json +0 -50
  58. package/v0/serializer/schemas/v2/transaction-sign-response-ethereum.json +0 -19
  59. package/v0/serializer/schemas/v3/transaction-sign-request-ethereum-typed.json +0 -38
  60. package/v0/serializer/schemas/v3/transaction-sign-request-ethereum.json +0 -50
  61. package/v0/serializer/schemas/v3/transaction-sign-response-ethereum.json +0 -19
  62. package/v0/serializer/validators/transaction-validator.d.ts +0 -15
  63. package/v0/serializer/validators/transaction-validator.js +0 -96
  64. package/v0/serializer/validators/transaction-validator.js.map +0 -1
  65. package/v0/serializer/validators/validators.d.ts +0 -1
  66. package/v0/serializer/validators/validators.js +0 -78
  67. package/v0/serializer/validators/validators.js.map +0 -1
  68. package/v0/types/signed-transaction-ethereum.d.ts +0 -5
  69. package/v0/types/signed-transaction-ethereum.js +0 -3
  70. package/v0/types/signed-transaction-ethereum.js.map +0 -1
  71. package/v0/types/transaction-ethereum.d.ts +0 -14
  72. package/v0/types/transaction-ethereum.js +0 -3
  73. package/v0/types/transaction-ethereum.js.map +0 -1
  74. package/v0/types/unsigned-transaction-ethereum-typed.d.ts +0 -11
  75. package/v0/types/unsigned-transaction-ethereum-typed.js +0 -3
  76. package/v0/types/unsigned-transaction-ethereum-typed.js.map +0 -1
  77. package/v0/types/unsigned-transaction-ethereum.d.ts +0 -15
  78. package/v0/types/unsigned-transaction-ethereum.js +0 -3
  79. package/v0/types/unsigned-transaction-ethereum.js.map +0 -1
  80. package/v1/block-explorer/EtherscanBlockExplorer.d.ts +0 -9
  81. package/v1/block-explorer/EtherscanBlockExplorer.js +0 -74
  82. package/v1/block-explorer/EtherscanBlockExplorer.js.map +0 -1
  83. package/v1/clients/crypto/EthereumCryptoClient.d.ts +0 -7
  84. package/v1/clients/crypto/EthereumCryptoClient.js +0 -147
  85. package/v1/clients/crypto/EthereumCryptoClient.js.map +0 -1
  86. package/v1/clients/info/EthereumInfoClient.d.ts +0 -15
  87. package/v1/clients/info/EthereumInfoClient.js +0 -11
  88. package/v1/clients/info/EthereumInfoClient.js.map +0 -1
  89. package/v1/clients/info/EtherscanInfoClient.d.ts +0 -7
  90. package/v1/clients/info/EtherscanInfoClient.js +0 -165
  91. package/v1/clients/info/EtherscanInfoClient.js.map +0 -1
  92. package/v1/clients/node/AirGapNodeClient.d.ts +0 -41
  93. package/v1/clients/node/AirGapNodeClient.js +0 -351
  94. package/v1/clients/node/AirGapNodeClient.js.map +0 -1
  95. package/v1/clients/node/EthereumNodeClient.d.ts +0 -17
  96. package/v1/clients/node/EthereumNodeClient.js +0 -11
  97. package/v1/clients/node/EthereumNodeClient.js.map +0 -1
  98. package/v1/data/EthereumAddress.d.ts +0 -7
  99. package/v1/data/EthereumAddress.js +0 -46
  100. package/v1/data/EthereumAddress.js.map +0 -1
  101. package/v1/index.d.ts +0 -10
  102. package/v1/index.js +0 -13
  103. package/v1/index.js.map +0 -1
  104. package/v1/module/ERC20Tokens.d.ts +0 -3
  105. package/v1/module/ERC20Tokens.js +0 -815
  106. package/v1/module/ERC20Tokens.js.map +0 -1
  107. package/v1/module/EthereumModule.d.ts +0 -13
  108. package/v1/module/EthereumModule.js +0 -125
  109. package/v1/module/EthereumModule.js.map +0 -1
  110. package/v1/protocol/EthereumBaseProtocol.d.ts +0 -83
  111. package/v1/protocol/EthereumBaseProtocol.js +0 -866
  112. package/v1/protocol/EthereumBaseProtocol.js.map +0 -1
  113. package/v1/protocol/EthereumChainIds.d.ts +0 -1
  114. package/v1/protocol/EthereumChainIds.js +0 -340
  115. package/v1/protocol/EthereumChainIds.js.map +0 -1
  116. package/v1/protocol/EthereumProtocol.d.ts +0 -8
  117. package/v1/protocol/EthereumProtocol.js +0 -64
  118. package/v1/protocol/EthereumProtocol.js.map +0 -1
  119. package/v1/protocol/erc20/ERC20Token.d.ts +0 -8
  120. package/v1/protocol/erc20/ERC20Token.js +0 -421
  121. package/v1/protocol/erc20/ERC20Token.js.map +0 -1
  122. package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +0 -12
  123. package/v1/serializer/v3/schemas/converter/transaction-converter.js +0 -80
  124. package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +0 -1
  125. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.d.ts +0 -10
  126. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.js +0 -3
  127. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.js.map +0 -1
  128. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.d.ts +0 -14
  129. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.js +0 -3
  130. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.js.map +0 -1
  131. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.d.ts +0 -3
  132. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.js +0 -3
  133. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.js.map +0 -1
  134. package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum-typed.json +0 -41
  135. package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum.json +0 -58
  136. package/v1/serializer/v3/schemas/generated/transaction-sign-response-ethereum.json +0 -19
  137. package/v1/serializer/v3/serializer-companion.d.ts +0 -13
  138. package/v1/serializer/v3/serializer-companion.js +0 -190
  139. package/v1/serializer/v3/serializer-companion.js.map +0 -1
  140. package/v1/serializer/v3/validators/transaction-validator.d.ts +0 -7
  141. package/v1/serializer/v3/validators/transaction-validator.js +0 -71
  142. package/v1/serializer/v3/validators/transaction-validator.js.map +0 -1
  143. package/v1/types/protocol.d.ts +0 -32
  144. package/v1/types/protocol.js +0 -3
  145. package/v1/types/protocol.js.map +0 -1
  146. package/v1/types/transaction.d.ts +0 -24
  147. package/v1/types/transaction.js +0 -3
  148. package/v1/types/transaction.js.map +0 -1
  149. package/v1/utils/EthereumUtils.d.ts +0 -13
  150. package/v1/utils/EthereumUtils.js +0 -140
  151. package/v1/utils/EthereumUtils.js.map +0 -1
  152. package/v1/utils/key.d.ts +0 -5
  153. package/v1/utils/key.js +0 -88
  154. package/v1/utils/key.js.map +0 -1
package/v1/utils/key.js DELETED
@@ -1,88 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.convertExtendedPublicKey = exports.convertPublicKey = exports.convertExtendedSecretKey = exports.convertSecretKey = void 0;
27
- var coinlib_core_1 = require("@airgap/coinlib-core");
28
- // @ts-ignore
29
- var bs58check = __importStar(require("@airgap/coinlib-core/dependencies/src/bs58check-2.1.2"));
30
- var errors_1 = require("@airgap/coinlib-core/errors");
31
- var module_kit_1 = require("@airgap/module-kit");
32
- var EXT_PK_PREFIX = '0488b21e'; // xpub
33
- function convertSecretKey(secretKey, targetFormat) {
34
- if (secretKey.format === targetFormat) {
35
- return secretKey;
36
- }
37
- // 'encoded' -> 'hex'
38
- // 'hex' -> 'encoded'
39
- throw new errors_1.UnsupportedError(coinlib_core_1.Domain.ETHEREUM, 'Unsupported secret key format.');
40
- }
41
- exports.convertSecretKey = convertSecretKey;
42
- function convertExtendedSecretKey(extendedSecretKey, targetFormat) {
43
- if (extendedSecretKey.format === targetFormat) {
44
- return extendedSecretKey;
45
- }
46
- // 'encoded' -> 'hex'
47
- // 'hex' -> 'encoded'
48
- throw new errors_1.UnsupportedError(coinlib_core_1.Domain.ETHEREUM, 'Unsupported secret key format.');
49
- }
50
- exports.convertExtendedSecretKey = convertExtendedSecretKey;
51
- function convertPublicKey(publicKey, targetFormat) {
52
- if (publicKey.format === targetFormat) {
53
- return publicKey;
54
- }
55
- // 'encoded' -> 'hex'
56
- // 'hex' -> 'encoded'
57
- throw new errors_1.UnsupportedError(coinlib_core_1.Domain.ETHEREUM, 'Unsupported public key format.');
58
- }
59
- exports.convertPublicKey = convertPublicKey;
60
- function convertExtendedPublicKey(extendedPublicKey, targetFormat) {
61
- if (extendedPublicKey.format === targetFormat) {
62
- return extendedPublicKey;
63
- }
64
- switch (extendedPublicKey.format) {
65
- case 'encoded':
66
- return (0, module_kit_1.newExtendedPublicKey)(convertEncodedExtendedPublicKey(extendedPublicKey.value, targetFormat));
67
- case 'hex':
68
- return (0, module_kit_1.newExtendedPublicKey)(convertHexExtendedPublicKey(extendedPublicKey.value, targetFormat));
69
- default:
70
- (0, coinlib_core_1.assertNever)(extendedPublicKey.format);
71
- throw new errors_1.UnsupportedError(coinlib_core_1.Domain.ETHEREUM, 'Unuspported extended public key format.');
72
- }
73
- }
74
- exports.convertExtendedPublicKey = convertExtendedPublicKey;
75
- function convertEncodedExtendedPublicKey(extendedPublicKey, targetFormat) {
76
- if (targetFormat === 'encoded') {
77
- return extendedPublicKey;
78
- }
79
- var prefixBytes = Buffer.from(EXT_PK_PREFIX, 'hex').length;
80
- return bs58check.decode(extendedPublicKey).slice(prefixBytes).toString('hex');
81
- }
82
- function convertHexExtendedPublicKey(extendedPublicKey, targetFormat) {
83
- if (targetFormat === 'hex') {
84
- return extendedPublicKey;
85
- }
86
- return bs58check.encode(Buffer.concat([Buffer.from(EXT_PK_PREFIX, 'hex'), Buffer.from(extendedPublicKey, 'hex')]));
87
- }
88
- //# sourceMappingURL=key.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"key.js","sourceRoot":"","sources":["../../../src/v1/utils/key.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA0D;AAC1D,aAAa;AACb,+FAAkF;AAClF,sDAA8D;AAC9D,i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