@airgap/ethereum 0.13.11-beta.1 → 0.13.11-beta.11

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 (159) hide show
  1. package/index.d.ts +1 -0
  2. package/index.js +18 -0
  3. package/index.js.map +1 -0
  4. package/package.json +1 -5
  5. package/v0/index.d.ts +12 -0
  6. package/v0/index.js +39 -0
  7. package/v0/index.js.map +1 -0
  8. package/v0/protocol/BaseEthereumProtocol.d.ts +98 -0
  9. package/v0/protocol/BaseEthereumProtocol.js +939 -0
  10. package/v0/protocol/BaseEthereumProtocol.js.map +1 -0
  11. package/v0/protocol/EthereumAddress.d.ts +8 -0
  12. package/v0/protocol/EthereumAddress.js +43 -0
  13. package/v0/protocol/EthereumAddress.js.map +1 -0
  14. package/v0/protocol/EthereumChainIDs.d.ts +1 -0
  15. package/v0/protocol/EthereumChainIDs.js +340 -0
  16. package/v0/protocol/EthereumChainIDs.js.map +1 -0
  17. package/v0/protocol/EthereumClassicProtocol.d.ts +6 -0
  18. package/v0/protocol/EthereumClassicProtocol.js +30 -0
  19. package/v0/protocol/EthereumClassicProtocol.js.map +1 -0
  20. package/v0/protocol/EthereumCryptoClient.d.ts +12 -0
  21. package/v0/protocol/EthereumCryptoClient.js +148 -0
  22. package/v0/protocol/EthereumCryptoClient.js.map +1 -0
  23. package/v0/protocol/EthereumProtocol.d.ts +10 -0
  24. package/v0/protocol/EthereumProtocol.js +34 -0
  25. package/v0/protocol/EthereumProtocol.js.map +1 -0
  26. package/v0/protocol/EthereumProtocolOptions.d.ts +46 -0
  27. package/v0/protocol/EthereumProtocolOptions.js +150 -0
  28. package/v0/protocol/EthereumProtocolOptions.js.map +1 -0
  29. package/v0/protocol/EthereumRopstenProtocol.d.ts +6 -0
  30. package/v0/protocol/EthereumRopstenProtocol.js +30 -0
  31. package/v0/protocol/EthereumRopstenProtocol.js.map +1 -0
  32. package/v0/protocol/EthereumTypes.d.ts +14 -0
  33. package/v0/protocol/EthereumTypes.js +3 -0
  34. package/v0/protocol/EthereumTypes.js.map +1 -0
  35. package/v0/protocol/clients/info-clients/EtherscanInfoClient.d.ts +8 -0
  36. package/v0/protocol/clients/info-clients/EtherscanInfoClient.js +195 -0
  37. package/v0/protocol/clients/info-clients/EtherscanInfoClient.js.map +1 -0
  38. package/v0/protocol/clients/info-clients/InfoClient.d.ts +8 -0
  39. package/v0/protocol/clients/info-clients/InfoClient.js +11 -0
  40. package/v0/protocol/clients/info-clients/InfoClient.js.map +1 -0
  41. package/v0/protocol/clients/node-clients/AirGapNodeClient.d.ts +41 -0
  42. package/v0/protocol/clients/node-clients/AirGapNodeClient.js +353 -0
  43. package/v0/protocol/clients/node-clients/AirGapNodeClient.js.map +1 -0
  44. package/v0/protocol/clients/node-clients/NodeClient.d.ts +17 -0
  45. package/v0/protocol/clients/node-clients/NodeClient.js +11 -0
  46. package/v0/protocol/clients/node-clients/NodeClient.js.map +1 -0
  47. package/v0/protocol/erc20/ERC20.d.ts +3 -0
  48. package/v0/protocol/erc20/ERC20.js +9 -0
  49. package/v0/protocol/erc20/ERC20.js.map +1 -0
  50. package/v0/protocol/erc20/GenericERC20.d.ts +32 -0
  51. package/v0/protocol/erc20/GenericERC20.js +335 -0
  52. package/v0/protocol/erc20/GenericERC20.js.map +1 -0
  53. package/v0/protocol/utils/utils.d.ts +13 -0
  54. package/v0/protocol/utils/utils.js +140 -0
  55. package/v0/protocol/utils/utils.js.map +1 -0
  56. package/v0/serializer/schemas/v2/transaction-sign-request-ethereum.json +50 -0
  57. package/v0/serializer/schemas/v2/transaction-sign-response-ethereum.json +19 -0
  58. package/v0/serializer/schemas/v3/transaction-sign-request-ethereum-typed.json +38 -0
  59. package/v0/serializer/schemas/v3/transaction-sign-request-ethereum.json +50 -0
  60. package/v0/serializer/schemas/v3/transaction-sign-response-ethereum.json +19 -0
  61. package/v0/serializer/validators/transaction-validator.d.ts +15 -0
  62. package/v0/serializer/validators/transaction-validator.js +96 -0
  63. package/v0/serializer/validators/transaction-validator.js.map +1 -0
  64. package/v0/serializer/validators/validators.d.ts +1 -0
  65. package/v0/serializer/validators/validators.js +78 -0
  66. package/v0/serializer/validators/validators.js.map +1 -0
  67. package/v0/types/signed-transaction-ethereum.d.ts +5 -0
  68. package/v0/types/signed-transaction-ethereum.js +3 -0
  69. package/v0/types/signed-transaction-ethereum.js.map +1 -0
  70. package/v0/types/transaction-ethereum.d.ts +14 -0
  71. package/v0/types/transaction-ethereum.js +3 -0
  72. package/v0/types/transaction-ethereum.js.map +1 -0
  73. package/v0/types/unsigned-transaction-ethereum-typed.d.ts +11 -0
  74. package/v0/types/unsigned-transaction-ethereum-typed.js +3 -0
  75. package/v0/types/unsigned-transaction-ethereum-typed.js.map +1 -0
  76. package/v0/types/unsigned-transaction-ethereum.d.ts +15 -0
  77. package/v0/types/unsigned-transaction-ethereum.js +3 -0
  78. package/v0/types/unsigned-transaction-ethereum.js.map +1 -0
  79. package/v1/block-explorer/EtherscanBlockExplorer.d.ts +9 -0
  80. package/v1/block-explorer/EtherscanBlockExplorer.js +74 -0
  81. package/v1/block-explorer/EtherscanBlockExplorer.js.map +1 -0
  82. package/v1/clients/crypto/EthereumCryptoClient.d.ts +7 -0
  83. package/v1/clients/crypto/EthereumCryptoClient.js +147 -0
  84. package/v1/clients/crypto/EthereumCryptoClient.js.map +1 -0
  85. package/v1/clients/info/EthereumInfoClient.d.ts +15 -0
  86. package/v1/clients/info/EthereumInfoClient.js +11 -0
  87. package/v1/clients/info/EthereumInfoClient.js.map +1 -0
  88. package/v1/clients/info/EtherscanInfoClient.d.ts +7 -0
  89. package/v1/clients/info/EtherscanInfoClient.js +165 -0
  90. package/v1/clients/info/EtherscanInfoClient.js.map +1 -0
  91. package/v1/clients/node/AirGapNodeClient.d.ts +41 -0
  92. package/v1/clients/node/AirGapNodeClient.js +351 -0
  93. package/v1/clients/node/AirGapNodeClient.js.map +1 -0
  94. package/v1/clients/node/EthereumNodeClient.d.ts +17 -0
  95. package/v1/clients/node/EthereumNodeClient.js +11 -0
  96. package/v1/clients/node/EthereumNodeClient.js.map +1 -0
  97. package/v1/data/EthereumAddress.d.ts +7 -0
  98. package/v1/data/EthereumAddress.js +46 -0
  99. package/v1/data/EthereumAddress.js.map +1 -0
  100. package/v1/index.d.ts +11 -0
  101. package/v1/index.js +13 -0
  102. package/v1/index.js.map +1 -0
  103. package/v1/module/ERC20Tokens.d.ts +3 -0
  104. package/v1/module/ERC20Tokens.js +815 -0
  105. package/v1/module/ERC20Tokens.js.map +1 -0
  106. package/v1/module/EthereumModule.d.ts +13 -0
  107. package/v1/module/EthereumModule.js +125 -0
  108. package/v1/module/EthereumModule.js.map +1 -0
  109. package/v1/module.d.ts +3 -0
  110. package/v1/module.js +24 -0
  111. package/v1/module.js.map +1 -0
  112. package/v1/protocol/EthereumBaseProtocol.d.ts +84 -0
  113. package/v1/protocol/EthereumBaseProtocol.js +827 -0
  114. package/v1/protocol/EthereumBaseProtocol.js.map +1 -0
  115. package/v1/protocol/EthereumChainIds.d.ts +1 -0
  116. package/v1/protocol/EthereumChainIds.js +340 -0
  117. package/v1/protocol/EthereumChainIds.js.map +1 -0
  118. package/v1/protocol/EthereumProtocol.d.ts +8 -0
  119. package/v1/protocol/EthereumProtocol.js +64 -0
  120. package/v1/protocol/EthereumProtocol.js.map +1 -0
  121. package/v1/protocol/erc20/ERC20Token.d.ts +8 -0
  122. package/v1/protocol/erc20/ERC20Token.js +421 -0
  123. package/v1/protocol/erc20/ERC20Token.js.map +1 -0
  124. package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +12 -0
  125. package/v1/serializer/v3/schemas/converter/transaction-converter.js +80 -0
  126. package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -0
  127. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.d.ts +10 -0
  128. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.js +3 -0
  129. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.js.map +1 -0
  130. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.d.ts +14 -0
  131. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.js +3 -0
  132. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.js.map +1 -0
  133. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.d.ts +3 -0
  134. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.js +3 -0
  135. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.js.map +1 -0
  136. package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum-typed.json +41 -0
  137. package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum.json +58 -0
  138. package/v1/serializer/v3/schemas/generated/transaction-sign-response-ethereum.json +19 -0
  139. package/v1/serializer/v3/serializer-companion.d.ts +13 -0
  140. package/v1/serializer/v3/serializer-companion.js +190 -0
  141. package/v1/serializer/v3/serializer-companion.js.map +1 -0
  142. package/v1/serializer/v3/validators/transaction-validator.d.ts +7 -0
  143. package/v1/serializer/v3/validators/transaction-validator.js +71 -0
  144. package/v1/serializer/v3/validators/transaction-validator.js.map +1 -0
  145. package/v1/types/crypto.d.ts +2 -0
  146. package/v1/types/crypto.js +3 -0
  147. package/v1/types/crypto.js.map +1 -0
  148. package/v1/types/protocol.d.ts +32 -0
  149. package/v1/types/protocol.js +3 -0
  150. package/v1/types/protocol.js.map +1 -0
  151. package/v1/types/transaction.d.ts +24 -0
  152. package/v1/types/transaction.js +3 -0
  153. package/v1/types/transaction.js.map +1 -0
  154. package/v1/utils/EthereumUtils.d.ts +13 -0
  155. package/v1/utils/EthereumUtils.js +140 -0
  156. package/v1/utils/EthereumUtils.js.map +1 -0
  157. package/v1/utils/key.d.ts +5 -0
  158. package/v1/utils/key.js +101 -0
  159. package/v1/utils/key.js.map +1 -0
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './v0';
package/index.js ADDED
@@ -0,0 +1,18 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./v0"), exports);
18
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAoB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airgap/ethereum",
3
- "version": "0.13.11-beta.1",
3
+ "version": "0.13.11-beta.11",
4
4
  "description": "The @airgap/ethereum is an Ethereum implementation of the ICoinProtocol interface from @airgap/coinlib-core.",
5
5
  "keywords": [
6
6
  "airgap",
@@ -17,10 +17,6 @@
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
20
- "main": "dist/index.js",
21
- "files": [
22
- "dist"
23
- ],
24
20
  "scripts": {
25
21
  "build": "rm -rf ./dist && node scripts/node-module-es-module-interop.js && tsc && node scripts/copy-files-after-build.js",
26
22
  "build-scripts": "tsc scripts/*.ts",
package/v0/index.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { GenericERC20 } from './protocol/erc20/GenericERC20';
2
+ import { EthereumAddress } from './protocol/EthereumAddress';
3
+ import { EthereumClassicProtocol } from './protocol/EthereumClassicProtocol';
4
+ import { EthereumCryptoClient } from './protocol/EthereumCryptoClient';
5
+ import { EthereumProtocol } from './protocol/EthereumProtocol';
6
+ import { EthereumERC20ProtocolConfig, EthereumERC20ProtocolOptions, EthereumProtocolConfig, EthereumProtocolNetwork, EthereumProtocolNetworkExtras, EthereumProtocolOptions, EtherscanBlockExplorer } from './protocol/EthereumProtocolOptions';
7
+ import { EthereumRopstenProtocol } from './protocol/EthereumRopstenProtocol';
8
+ import { SignedEthereumTransaction } from './types/signed-transaction-ethereum';
9
+ import { RawEthereumTransaction } from './types/transaction-ethereum';
10
+ import { UnsignedEthereumTransaction } from './types/unsigned-transaction-ethereum';
11
+ import { UnsignedTypedEthereumTransaction } from './types/unsigned-transaction-ethereum-typed';
12
+ export { EthereumProtocol, EthereumRopstenProtocol, EthereumClassicProtocol, GenericERC20, EthereumCryptoClient, EthereumProtocolNetworkExtras, EtherscanBlockExplorer, EthereumProtocolNetwork, EthereumProtocolConfig, EthereumProtocolOptions, EthereumERC20ProtocolConfig, EthereumERC20ProtocolOptions, EthereumAddress, RawEthereumTransaction, UnsignedEthereumTransaction, UnsignedTypedEthereumTransaction, SignedEthereumTransaction };
package/v0/index.js ADDED
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EthereumAddress = exports.EthereumERC20ProtocolOptions = exports.EthereumERC20ProtocolConfig = exports.EthereumProtocolOptions = exports.EthereumProtocolConfig = exports.EthereumProtocolNetwork = exports.EtherscanBlockExplorer = exports.EthereumProtocolNetworkExtras = exports.EthereumCryptoClient = exports.GenericERC20 = exports.EthereumClassicProtocol = exports.EthereumRopstenProtocol = exports.EthereumProtocol = void 0;
4
+ var coinlib_core_1 = require("@airgap/coinlib-core");
5
+ var serializer_1 = require("@airgap/serializer");
6
+ var GenericERC20_1 = require("./protocol/erc20/GenericERC20");
7
+ Object.defineProperty(exports, "GenericERC20", { enumerable: true, get: function () { return GenericERC20_1.GenericERC20; } });
8
+ var EthereumAddress_1 = require("./protocol/EthereumAddress");
9
+ Object.defineProperty(exports, "EthereumAddress", { enumerable: true, get: function () { return EthereumAddress_1.EthereumAddress; } });
10
+ var EthereumClassicProtocol_1 = require("./protocol/EthereumClassicProtocol");
11
+ Object.defineProperty(exports, "EthereumClassicProtocol", { enumerable: true, get: function () { return EthereumClassicProtocol_1.EthereumClassicProtocol; } });
12
+ var EthereumCryptoClient_1 = require("./protocol/EthereumCryptoClient");
13
+ Object.defineProperty(exports, "EthereumCryptoClient", { enumerable: true, get: function () { return EthereumCryptoClient_1.EthereumCryptoClient; } });
14
+ var EthereumProtocol_1 = require("./protocol/EthereumProtocol");
15
+ Object.defineProperty(exports, "EthereumProtocol", { enumerable: true, get: function () { return EthereumProtocol_1.EthereumProtocol; } });
16
+ var EthereumProtocolOptions_1 = require("./protocol/EthereumProtocolOptions");
17
+ Object.defineProperty(exports, "EthereumERC20ProtocolConfig", { enumerable: true, get: function () { return EthereumProtocolOptions_1.EthereumERC20ProtocolConfig; } });
18
+ Object.defineProperty(exports, "EthereumERC20ProtocolOptions", { enumerable: true, get: function () { return EthereumProtocolOptions_1.EthereumERC20ProtocolOptions; } });
19
+ Object.defineProperty(exports, "EthereumProtocolConfig", { enumerable: true, get: function () { return EthereumProtocolOptions_1.EthereumProtocolConfig; } });
20
+ Object.defineProperty(exports, "EthereumProtocolNetwork", { enumerable: true, get: function () { return EthereumProtocolOptions_1.EthereumProtocolNetwork; } });
21
+ Object.defineProperty(exports, "EthereumProtocolNetworkExtras", { enumerable: true, get: function () { return EthereumProtocolOptions_1.EthereumProtocolNetworkExtras; } });
22
+ Object.defineProperty(exports, "EthereumProtocolOptions", { enumerable: true, get: function () { return EthereumProtocolOptions_1.EthereumProtocolOptions; } });
23
+ Object.defineProperty(exports, "EtherscanBlockExplorer", { enumerable: true, get: function () { return EthereumProtocolOptions_1.EtherscanBlockExplorer; } });
24
+ var EthereumRopstenProtocol_1 = require("./protocol/EthereumRopstenProtocol");
25
+ Object.defineProperty(exports, "EthereumRopstenProtocol", { enumerable: true, get: function () { return EthereumRopstenProtocol_1.EthereumRopstenProtocol; } });
26
+ var transaction_validator_1 = require("./serializer/validators/transaction-validator");
27
+ // Serializer
28
+ serializer_1.Serializer.addSchema(serializer_1.IACMessageType.TransactionSignRequest, { schema: require('./serializer/schemas/v2/transaction-sign-request-ethereum.json') }, coinlib_core_1.MainProtocolSymbols.ETH);
29
+ serializer_1.Serializer.addSchema(serializer_1.IACMessageType.TransactionSignResponse, { schema: require('./serializer/schemas/v2/transaction-sign-response-ethereum.json') }, coinlib_core_1.MainProtocolSymbols.ETH);
30
+ serializer_1.SerializerV3.addSchema(serializer_1.IACMessageType.TransactionSignRequest, { schema: require('./serializer/schemas/v3/transaction-sign-request-ethereum.json') }, coinlib_core_1.MainProtocolSymbols.ETH);
31
+ serializer_1.SerializerV3.addSchema(serializer_1.IACMessageType.TransactionSignRequest, { schema: require('./serializer/schemas/v3/transaction-sign-request-ethereum-typed.json') }, coinlib_core_1.MainProtocolSymbols.ETH);
32
+ serializer_1.SerializerV3.addSchema(serializer_1.IACMessageType.TransactionSignResponse, { schema: require('./serializer/schemas/v3/transaction-sign-response-ethereum.json') }, coinlib_core_1.MainProtocolSymbols.ETH);
33
+ serializer_1.Serializer.addSchema(serializer_1.IACMessageType.TransactionSignRequest, { schema: require('./serializer/schemas/v2/transaction-sign-request-ethereum.json') }, coinlib_core_1.SubProtocolSymbols.ETH_ERC20);
34
+ serializer_1.Serializer.addSchema(serializer_1.IACMessageType.TransactionSignResponse, { schema: require('./serializer/schemas/v2/transaction-sign-response-ethereum.json') }, coinlib_core_1.SubProtocolSymbols.ETH_ERC20);
35
+ serializer_1.SerializerV3.addSchema(serializer_1.IACMessageType.TransactionSignRequest, { schema: require('./serializer/schemas/v3/transaction-sign-request-ethereum.json') }, coinlib_core_1.SubProtocolSymbols.ETH_ERC20);
36
+ serializer_1.SerializerV3.addSchema(serializer_1.IACMessageType.TransactionSignResponse, { schema: require('./serializer/schemas/v3/transaction-sign-response-ethereum.json') }, coinlib_core_1.SubProtocolSymbols.ETH_ERC20);
37
+ serializer_1.Serializer.addValidator(coinlib_core_1.MainProtocolSymbols.ETH, new transaction_validator_1.EthereumTransactionValidatorFactoryV2());
38
+ serializer_1.SerializerV3.addValidator(coinlib_core_1.MainProtocolSymbols.ETH, new transaction_validator_1.EthereumTransactionValidatorFactory());
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v0/index.ts"],"names":[],"mappings":";;;AAAA,qDAA8E;AAC9E,iDAA6E;AAE7E,8DAA4D;AAyB1D,6FAzBO,2BAAY,OAyBP;AAxBd,8DAA4D;AAiC1D,gGAjCO,iCAAe,OAiCP;AAhCjB,8EAA4E;AAsB1E,wGAtBO,iDAAuB,OAsBP;AArBzB,wEAAsE;AAuBpE,qGAvBO,2CAAoB,OAuBP;AAtBtB,gEAA8D;AAkB5D,iGAlBO,mCAAgB,OAkBP;AAjBlB,8EAQ2C;AAmBzC,4GA1BA,qDAA2B,OA0BA;AAC3B,6GA1BA,sDAA4B,OA0BA;AAH5B,uGAtBA,gDAAsB,OAsBA;AADtB,wGApBA,iDAAuB,OAoBA;AAFvB,8GAjBA,uDAA6B,OAiBA;AAI7B,wGApBA,iDAAuB,OAoBA;AAHvB,uGAhBA,gDAAsB,OAgBA;AAdxB,8EAA4E;AAS1E,wGATO,iDAAuB,OASP;AARzB,uFAA0I;AA0B1I,aAAa;AAEb,uBAAU,CAAC,SAAS,CAClB,2BAAc,CAAC,sBAAsB,EACrC,EAAE,MAAM,EAAE,OAAO,CAAC,gEAAgE,CAAC,EAAE,EACrF,kCAAmB,CAAC,GAAG,CACxB,CAAA;AACD,uBAAU,CAAC,SAAS,CAClB,2BAAc,CAAC,uBAAuB,EACtC,EAAE,MAAM,EAAE,OAAO,CAAC,iEAAiE,CAAC,EAAE,EACtF,kCAAmB,CAAC,GAAG,CACxB,CAAA;AAED,yBAAY,CAAC,SAAS,CACpB,2BAAc,CAAC,sBAAsB,EACrC,EAAE,MAAM,EAAE,OAAO,CAAC,gEAAgE,CAAC,EAAE,EACrF,kCAAmB,CAAC,GAAG,CACxB,CAAA;AACD,yBAAY,CAAC,SAAS,CACpB,2BAAc,CAAC,sBAAsB,EACrC,EAAE,MAAM,EAAE,OAAO,CAAC,sEAAsE,CAAC,EAAE,EAC3F,kCAAmB,CAAC,GAAG,CACxB,CAAA;AACD,yBAAY,CAAC,SAAS,CACpB,2BAAc,CAAC,uBAAuB,EACtC,EAAE,MAAM,EAAE,OAAO,CAAC,iEAAiE,CAAC,EAAE,EACtF,kCAAmB,CAAC,GAAG,CACxB,CAAA;AAED,uBAAU,CAAC,SAAS,CAClB,2BAAc,CAAC,sBAAsB,EACrC,EAAE,MAAM,EAAE,OAAO,CAAC,gEAAgE,CAAC,EAAE,EACrF,iCAAkB,CAAC,SAAS,CAC7B,CAAA;AACD,uBAAU,CAAC,SAAS,CAClB,2BAAc,CAAC,uBAAuB,EACtC,EAAE,MAAM,EAAE,OAAO,CAAC,iEAAiE,CAAC,EAAE,EACtF,iCAAkB,CAAC,SAAS,CAC7B,CAAA;AAED,yBAAY,CAAC,SAAS,CACpB,2BAAc,CAAC,sBAAsB,EACrC,EAAE,MAAM,EAAE,OAAO,CAAC,gEAAgE,CAAC,EAAE,EACrF,iCAAkB,CAAC,SAAS,CAC7B,CAAA;AACD,yBAAY,CAAC,SAAS,CACpB,2BAAc,CAAC,uBAAuB,EACtC,EAAE,MAAM,EAAE,OAAO,CAAC,iEAAiE,CAAC,EAAE,EACtF,iCAAkB,CAAC,SAAS,CAC7B,CAAA;AAED,uBAAU,CAAC,YAAY,CAAC,kCAAmB,CAAC,GAAG,EAAE,IAAI,6DAAqC,EAAE,CAAC,CAAA;AAC7F,yBAAY,CAAC,YAAY,CAAC,kCAAmB,CAAC,GAAG,EAAE,IAAI,2DAAmC,EAAE,CAAC,CAAA"}
@@ -0,0 +1,98 @@
1
+ /// <reference types="node" />
2
+ import { UnsignedTransaction } from '@airgap/coinlib-core';
3
+ import { IAirGapSignedTransaction } from '@airgap/coinlib-core/interfaces/IAirGapSignedTransaction';
4
+ import { AirGapTransactionStatus, IAirGapTransaction } from '@airgap/coinlib-core/interfaces/IAirGapTransaction';
5
+ import { Network } from '@airgap/coinlib-core/networks';
6
+ import { CurrencyUnit, FeeDefaults, ICoinProtocol } from '@airgap/coinlib-core/protocols/ICoinProtocol';
7
+ import { ICoinSubProtocol } from '@airgap/coinlib-core/protocols/ICoinSubProtocol';
8
+ import { ProtocolSymbols } from '@airgap/coinlib-core/utils/ProtocolSymbols';
9
+ import { SignedEthereumTransaction } from '../types/signed-transaction-ethereum';
10
+ import { RawEthereumTransaction, RawTypedEthereumTransaction } from '../types/transaction-ethereum';
11
+ import { EthereumInfoClient } from './clients/info-clients/InfoClient';
12
+ import { EthereumNodeClient } from './clients/node-clients/NodeClient';
13
+ import { EthereumCryptoClient } from './EthereumCryptoClient';
14
+ import { EthereumProtocolOptions } from './EthereumProtocolOptions';
15
+ import { EthereumAddressCursor, EthereumAddressResult, EthereumTransactionCursor, EthereumTransactionResult } from './EthereumTypes';
16
+ export declare abstract class BaseEthereumProtocol<NodeClient extends EthereumNodeClient, InfoClient extends EthereumInfoClient> implements ICoinProtocol {
17
+ readonly options: EthereumProtocolOptions;
18
+ symbol: string;
19
+ name: string;
20
+ marketSymbol: string;
21
+ feeSymbol: string;
22
+ feeDefaults: FeeDefaults;
23
+ decimals: number;
24
+ feeDecimals: number;
25
+ identifier: ProtocolSymbols;
26
+ readonly MAX_GAS_ESTIMATE: string;
27
+ units: CurrencyUnit[];
28
+ supportsHD: boolean;
29
+ standardDerivationPath: string;
30
+ addressIsCaseSensitive: boolean;
31
+ addressValidationPattern: string;
32
+ addressPlaceholder: string;
33
+ network: Network;
34
+ readonly cryptoClient: EthereumCryptoClient;
35
+ constructor(options?: EthereumProtocolOptions);
36
+ getSymbol(): Promise<string>;
37
+ getName(): Promise<string>;
38
+ getMarketSymbol(): Promise<string>;
39
+ getFeeSymbol(): Promise<string>;
40
+ getFeeDefaults(): Promise<FeeDefaults>;
41
+ getDecimals(): Promise<number>;
42
+ getFeeDecimals(): Promise<number>;
43
+ getIdentifier(): Promise<ProtocolSymbols>;
44
+ getUnits(): Promise<CurrencyUnit[]>;
45
+ getSupportsHD(): Promise<boolean>;
46
+ getStandardDerivationPath(): Promise<string>;
47
+ getAddressIsCaseSensitive(): Promise<boolean>;
48
+ getAddressValidationPattern(): Promise<string>;
49
+ getAddressPlaceholder(): Promise<string>;
50
+ getOptions(): Promise<EthereumProtocolOptions>;
51
+ getBlockExplorerLinkForAddress(address: string): Promise<string>;
52
+ getBlockExplorerLinkForTxId(txId: string): Promise<string>;
53
+ getPublicKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
54
+ getPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
55
+ getExtendedPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
56
+ getExtendedPublicKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
57
+ getPublicKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
58
+ getExtendedPublicKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
59
+ getPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
60
+ getExtendedPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
61
+ getAddressFromPublicKey(publicKey: string | Buffer, cursor?: EthereumAddressCursor): Promise<EthereumAddressResult>;
62
+ getAddressesFromPublicKey(publicKey: string | Buffer, cursor?: EthereumAddressCursor): Promise<EthereumAddressResult[]>;
63
+ private getPublicKeyFromExtendedPublicKey;
64
+ getAddressFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressDerivationIndex: number): Promise<EthereumAddressResult>;
65
+ getAddressesFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressCount: number, offset: number): Promise<EthereumAddressResult[]>;
66
+ private getPrivateKeyFromExtendedPrivateKey;
67
+ signWithExtendedPrivateKey(extendedPrivateKey: string, untypedTransaction: RawTypedEthereumTransaction | RawEthereumTransaction, childDerivationPath?: string): Promise<IAirGapSignedTransaction>;
68
+ signWithPrivateKey(privateKey: string, transaction: RawEthereumTransaction): Promise<IAirGapSignedTransaction>;
69
+ getTransactionDetails(unsignedTx: UnsignedTransaction): Promise<IAirGapTransaction[]>;
70
+ getTransactionDetailsFromSigned(transaction: SignedEthereumTransaction): Promise<IAirGapTransaction[]>;
71
+ getBalanceOfPublicKey(publicKey: string): Promise<string>;
72
+ getBalanceOfAddresses(addresses: string[]): Promise<string>;
73
+ getBalanceOfPublicKeyForSubProtocols(publicKey: string, subProtocols: ICoinSubProtocol[]): Promise<string[]>;
74
+ getBalanceOfExtendedPublicKey(extendedPublicKey: string, offset?: number): Promise<string>;
75
+ getAvailableBalanceOfAddresses(addresses: string[]): Promise<string>;
76
+ estimateMaxTransactionValueFromExtendedPublicKey(extendedPublicKey: string, recipients: string[], fee?: string): Promise<string>;
77
+ estimateFeeDefaultsFromExtendedPublicKey(extendedPublicKey: string, recipients: string[], values: string[], data?: any): Promise<FeeDefaults>;
78
+ prepareTransactionFromExtendedPublicKey(extendedPublicKey: string, _offset: number, recipients: string[], values: string[], fee: string, data?: any): Promise<RawEthereumTransaction>;
79
+ estimateMaxTransactionValueFromPublicKey(publicKey: string, recipients: string[], fee?: string): Promise<string>;
80
+ estimateFeeDefaultsFromPublicKey(publicKey: string, recipients: string[], values: string[], data?: any): Promise<FeeDefaults>;
81
+ prepareTransactionFromPublicKey(publicKey: string, recipients: string[], values: string[], fee: string, data?: any): Promise<RawEthereumTransaction>;
82
+ broadcastTransaction(rawTransaction: string): Promise<string>;
83
+ getTransactionsFromExtendedPublicKey(extendedPublicKey: string, limit: number, cursor: EthereumTransactionCursor): Promise<EthereumTransactionResult>;
84
+ getTransactionsFromPublicKey(publicKey: string, limit?: number, cursor?: EthereumTransactionCursor): Promise<EthereumTransactionResult>;
85
+ getTransactionsFromAddresses(addresses: string[], limit: number, cursor?: EthereumTransactionCursor): Promise<EthereumTransactionResult>;
86
+ signMessage(message: string, keypair: {
87
+ privateKey: string;
88
+ }): Promise<string>;
89
+ verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
90
+ encryptAsymmetric(message: string, publicKey: string): Promise<string>;
91
+ decryptAsymmetric(message: string, keypair: {
92
+ publicKey: string;
93
+ privateKey: string;
94
+ }): Promise<string>;
95
+ encryptAES(message: string, privateKey: string): Promise<string>;
96
+ decryptAES(message: string, privateKey: string): Promise<string>;
97
+ getTransactionStatuses(transactionHashes: string[]): Promise<AirGapTransactionStatus[]>;
98
+ }