@airgap/ethereum 0.13.8-beta.7 → 0.13.8-beta.8

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 (54) hide show
  1. package/package.json +4 -4
  2. package/v1/index.d.ts +6 -2
  3. package/v1/index.js +11 -1
  4. package/v1/index.js.map +1 -1
  5. package/v1/module/ERC20Module.d.ts +9 -0
  6. package/v1/module/ERC20Module.js +69 -0
  7. package/v1/module/ERC20Module.js.map +1 -0
  8. package/v1/module/EthereumBaseModule.d.ts +13 -0
  9. package/v1/module/EthereumBaseModule.js +83 -0
  10. package/v1/module/EthereumBaseModule.js.map +1 -0
  11. package/v1/module/EthereumClassicModule.d.ts +7 -0
  12. package/v1/module/EthereumClassicModule.js +32 -0
  13. package/v1/module/EthereumClassicModule.js.map +1 -0
  14. package/v1/module/EthereumModule.d.ts +5 -11
  15. package/v1/module/EthereumModule.js +21 -114
  16. package/v1/module/EthereumModule.js.map +1 -1
  17. package/v1/module/EthereumRopstenModule.d.ts +7 -0
  18. package/v1/module/EthereumRopstenModule.js +32 -0
  19. package/v1/module/EthereumRopstenModule.js.map +1 -0
  20. package/v1/protocol/EthereumBaseProtocol.d.ts +16 -28
  21. package/v1/protocol/EthereumBaseProtocol.js +17 -137
  22. package/v1/protocol/EthereumBaseProtocol.js.map +1 -1
  23. package/v1/protocol/EthereumClassicProtocol.d.ts +8 -0
  24. package/v1/protocol/EthereumClassicProtocol.js +87 -0
  25. package/v1/protocol/EthereumClassicProtocol.js.map +1 -0
  26. package/v1/protocol/EthereumProtocol.d.ts +2 -2
  27. package/v1/protocol/EthereumProtocol.js +250 -1
  28. package/v1/protocol/EthereumProtocol.js.map +1 -1
  29. package/v1/protocol/EthereumRopstenProtocol.d.ts +8 -0
  30. package/v1/protocol/EthereumRopstenProtocol.js +64 -0
  31. package/v1/protocol/EthereumRopstenProtocol.js.map +1 -0
  32. package/v1/protocol/erc20/ERC20Token.d.ts +1 -3
  33. package/v1/protocol/erc20/ERC20Token.js +6 -22
  34. package/v1/protocol/erc20/ERC20Token.js.map +1 -1
  35. package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +1 -3
  36. package/v1/serializer/v3/schemas/converter/transaction-converter.js +5 -56
  37. package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
  38. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.d.ts +1 -1
  39. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.d.ts +1 -1
  40. package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum-typed.json +5 -1
  41. package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum.json +5 -1
  42. package/v1/serializer/v3/validators/transaction-validator.d.ts +4 -1
  43. package/v1/serializer/v3/validators/transaction-validator.js +10 -1
  44. package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
  45. package/v1/types/transaction.d.ts +0 -2
  46. package/v1/utils/transaction.d.ts +3 -0
  47. package/v1/utils/transaction.js +29 -0
  48. package/v1/utils/transaction.js.map +1 -0
  49. package/v1/module/ERC20Tokens.d.ts +0 -3
  50. package/v1/module/ERC20Tokens.js +0 -815
  51. package/v1/module/ERC20Tokens.js.map +0 -1
  52. package/v1/serializer/v3/serializer-companion.d.ts +0 -13
  53. package/v1/serializer/v3/serializer-companion.js +0 -190
  54. package/v1/serializer/v3/serializer-companion.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airgap/ethereum",
3
- "version": "0.13.8-beta.7",
3
+ "version": "0.13.8-beta.8",
4
4
  "description": "The @airgap/ethereum is an Ethereum implementation of the ICoinProtocol interface from @airgap/coinlib-core.",
5
5
  "keywords": [
6
6
  "airgap",
@@ -36,9 +36,9 @@
36
36
  "@metamask/eth-sig-util": "4.0.0"
37
37
  },
38
38
  "peerDependencies": {
39
- "@airgap/coinlib-core": "^0.13.8-beta.6",
40
- "@airgap/module-kit": "^0.13.8-beta.6",
41
- "@airgap/serializer": "^0.13.8-beta.6"
39
+ "@airgap/coinlib-core": "^0.13.8-beta.7",
40
+ "@airgap/module-kit": "^0.13.8-beta.7",
41
+ "@airgap/serializer": "^0.13.8-beta.7"
42
42
  },
43
43
  "localDependencies": {
44
44
  "ethereumjs-tx": "1.3.7",
package/v1/index.d.ts CHANGED
@@ -1,10 +1,14 @@
1
1
  import { EtherscanBlockExplorer } from './block-explorer/EtherscanBlockExplorer';
2
+ import { EthereumClassicModule } from './module/EthereumClassicModule';
2
3
  import { EthereumModule } from './module/EthereumModule';
4
+ import { EthereumRopstenModule } from './module/EthereumRopstenModule';
3
5
  import { createERC20Token, ERC20Token } from './protocol/erc20/ERC20Token';
6
+ import { createEthereumClassicProtocol, createEthereumClassicProtocolOptions, EthereumClassicProtocol } from './protocol/EthereumClassicProtocol';
4
7
  import { createEthereumProtocol, createEthereumProtocolOptions, EthereumProtocol } from './protocol/EthereumProtocol';
8
+ import { createEthereumRopstenProtocol, createEthereumRopstenProtocolOptions, EthereumRopstenProtocol } from './protocol/EthereumRopstenProtocol';
5
9
  import { ERC20TokenMetadata, EthereumProtocolNetwork, EthereumProtocolOptions, EthereumUnits } from './types/protocol';
6
10
  import { EthereumRawUnsignedTransaction, EthereumSignedTransaction, EthereumTransactionCursor, EthereumTypedUnsignedTransaction, EthereumUnsignedTransaction } from './types/transaction';
7
- export { EthereumModule };
8
- export { EthereumProtocol, createEthereumProtocol, createEthereumProtocolOptions, ERC20Token, createERC20Token };
11
+ export { EthereumModule, EthereumClassicModule, EthereumRopstenModule };
12
+ export { EthereumProtocol, createEthereumProtocol, createEthereumProtocolOptions, EthereumClassicProtocol, createEthereumClassicProtocol, createEthereumClassicProtocolOptions, EthereumRopstenProtocol, createEthereumRopstenProtocol, createEthereumRopstenProtocolOptions, ERC20Token, createERC20Token };
9
13
  export { EtherscanBlockExplorer };
10
14
  export { EthereumUnits, EthereumProtocolNetwork, EthereumProtocolOptions, ERC20TokenMetadata, EthereumUnsignedTransaction, EthereumTypedUnsignedTransaction, EthereumRawUnsignedTransaction, EthereumSignedTransaction, EthereumTransactionCursor };
package/v1/index.js CHANGED
@@ -1,13 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EtherscanBlockExplorer = exports.createERC20Token = exports.createEthereumProtocolOptions = exports.createEthereumProtocol = exports.EthereumModule = void 0;
3
+ exports.EtherscanBlockExplorer = exports.createERC20Token = exports.createEthereumRopstenProtocolOptions = exports.createEthereumRopstenProtocol = exports.createEthereumClassicProtocolOptions = exports.createEthereumClassicProtocol = exports.createEthereumProtocolOptions = exports.createEthereumProtocol = exports.EthereumRopstenModule = exports.EthereumClassicModule = exports.EthereumModule = void 0;
4
4
  var EtherscanBlockExplorer_1 = require("./block-explorer/EtherscanBlockExplorer");
5
5
  Object.defineProperty(exports, "EtherscanBlockExplorer", { enumerable: true, get: function () { return EtherscanBlockExplorer_1.EtherscanBlockExplorer; } });
6
+ var EthereumClassicModule_1 = require("./module/EthereumClassicModule");
7
+ Object.defineProperty(exports, "EthereumClassicModule", { enumerable: true, get: function () { return EthereumClassicModule_1.EthereumClassicModule; } });
6
8
  var EthereumModule_1 = require("./module/EthereumModule");
7
9
  Object.defineProperty(exports, "EthereumModule", { enumerable: true, get: function () { return EthereumModule_1.EthereumModule; } });
10
+ var EthereumRopstenModule_1 = require("./module/EthereumRopstenModule");
11
+ Object.defineProperty(exports, "EthereumRopstenModule", { enumerable: true, get: function () { return EthereumRopstenModule_1.EthereumRopstenModule; } });
8
12
  var ERC20Token_1 = require("./protocol/erc20/ERC20Token");
9
13
  Object.defineProperty(exports, "createERC20Token", { enumerable: true, get: function () { return ERC20Token_1.createERC20Token; } });
14
+ var EthereumClassicProtocol_1 = require("./protocol/EthereumClassicProtocol");
15
+ Object.defineProperty(exports, "createEthereumClassicProtocol", { enumerable: true, get: function () { return EthereumClassicProtocol_1.createEthereumClassicProtocol; } });
16
+ Object.defineProperty(exports, "createEthereumClassicProtocolOptions", { enumerable: true, get: function () { return EthereumClassicProtocol_1.createEthereumClassicProtocolOptions; } });
10
17
  var EthereumProtocol_1 = require("./protocol/EthereumProtocol");
11
18
  Object.defineProperty(exports, "createEthereumProtocol", { enumerable: true, get: function () { return EthereumProtocol_1.createEthereumProtocol; } });
12
19
  Object.defineProperty(exports, "createEthereumProtocolOptions", { enumerable: true, get: function () { return EthereumProtocol_1.createEthereumProtocolOptions; } });
20
+ var EthereumRopstenProtocol_1 = require("./protocol/EthereumRopstenProtocol");
21
+ Object.defineProperty(exports, "createEthereumRopstenProtocol", { enumerable: true, get: function () { return EthereumRopstenProtocol_1.createEthereumRopstenProtocol; } });
22
+ Object.defineProperty(exports, "createEthereumRopstenProtocolOptions", { enumerable: true, get: function () { return EthereumRopstenProtocol_1.createEthereumRopstenProtocolOptions; } });
13
23
  //# sourceMappingURL=index.js.map
package/v1/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,kFAAgF;AAuBvE,uGAvBA,+CAAsB,OAuBA;AAtB/B,0DAAwD;AAc/C,+FAdA,+BAAc,OAcA;AAbvB,0DAA0E;AAiBoB,iGAjBrF,6BAAgB,OAiBqF;AAhB9G,gEAAqH;AAgB1F,uGAhBlB,yCAAsB,OAgBkB;AAAE,8GAhBlB,gDAA6B,OAgBkB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,kFAAgF;AA+CvE,uGA/CA,+CAAsB,OA+CA;AA9C/B,wEAAsE;AA0B7C,sGA1BhB,6CAAqB,OA0BgB;AAzB9C,0DAAwD;AAyB/C,+FAzBA,+BAAc,OAyBA;AAxBvB,wEAAsE;AAwBtB,sGAxBvC,6CAAqB,OAwBuC;AAvBrE,0DAA0E;AAsCxE,iGAtCO,6BAAgB,OAsCP;AArClB,8EAI2C;AA2BzC,8GA9BA,uDAA6B,OA8BA;AAC7B,qHA9BA,8DAAoC,OA8BA;AA3BtC,gEAAqH;AAuBnH,uGAvBO,yCAAsB,OAuBP;AACtB,8GAxB+B,gDAA6B,OAwB/B;AAvB/B,8EAI2C;AAwBzC,8GA3BA,uDAA6B,OA2BA;AAC7B,qHA3BA,8DAAoC,OA2BA"}
@@ -0,0 +1,9 @@
1
+ import { AirGapModule, ProtocolNetwork } from '@airgap/module-kit';
2
+ import { BlockExplorer } from '@airgap/module-kit/block-explorer/block-explorer';
3
+ import { OfflineProtocol, OnlineProtocol } from '@airgap/module-kit/protocol/protocol';
4
+ export declare class ERC20Module implements AirGapModule {
5
+ readonly supportedNetworks: Record<string, ProtocolNetwork>;
6
+ createOfflineProtocol(): Promise<OfflineProtocol | undefined>;
7
+ createOnlineProtocol(networkId?: string | undefined): Promise<OnlineProtocol | undefined>;
8
+ createBlockExplorer(networkId?: string | undefined): Promise<BlockExplorer | undefined>;
9
+ }
@@ -0,0 +1,69 @@
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.ERC20Module = void 0;
40
+ var ERC20Module = /** @class */ (function () {
41
+ function ERC20Module() {
42
+ // TODO: figure out what to do with modules that should create generic protocols instances
43
+ this.supportedNetworks = {};
44
+ }
45
+ ERC20Module.prototype.createOfflineProtocol = function () {
46
+ return __awaiter(this, void 0, void 0, function () {
47
+ return __generator(this, function (_a) {
48
+ throw new Error('Method not implemented.');
49
+ });
50
+ });
51
+ };
52
+ ERC20Module.prototype.createOnlineProtocol = function (networkId) {
53
+ return __awaiter(this, void 0, void 0, function () {
54
+ return __generator(this, function (_a) {
55
+ throw new Error('Method not implemented.');
56
+ });
57
+ });
58
+ };
59
+ ERC20Module.prototype.createBlockExplorer = function (networkId) {
60
+ return __awaiter(this, void 0, void 0, function () {
61
+ return __generator(this, function (_a) {
62
+ throw new Error('Method not implemented.');
63
+ });
64
+ });
65
+ };
66
+ return ERC20Module;
67
+ }());
68
+ exports.ERC20Module = ERC20Module;
69
+ //# sourceMappingURL=ERC20Module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ERC20Module.js","sourceRoot":"","sources":["../../../src/v1/module/ERC20Module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;IAAA;QACE,0FAA0F;QAE1E,sBAAiB,GAAoC,EAAE,CAAA;IAazE,CAAC;IAXc,2CAAqB,GAAlC;;;gBACE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAA;;;KAC3C;IAEY,0CAAoB,GAAjC,UAAkC,SAA8B;;;gBAC9D,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAA;;;KAC3C;IAEY,yCAAmB,GAAhC,UAAiC,SAA8B;;;gBAC7D,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAA;;;KAC3C;IACH,kBAAC;AAAD,CAAC,AAhBD,IAgBC;AAhBY,kCAAW"}
@@ -0,0 +1,13 @@
1
+ import { AirGapModule, ProtocolNetwork } from '@airgap/module-kit';
2
+ import { BlockExplorer } from '@airgap/module-kit/block-explorer/block-explorer';
3
+ import { OfflineProtocol, OnlineProtocol } from '@airgap/module-kit/protocol/protocol';
4
+ import { EthereumBaseProtocol } from '../protocol/EthereumBaseProtocol';
5
+ export declare abstract class EthereumBaseModule implements AirGapModule {
6
+ readonly supportedNetworks: Record<string, ProtocolNetwork>;
7
+ private readonly networkRegistry;
8
+ protected constructor(supportedNetworks: ProtocolNetwork[], defaultNetwork?: ProtocolNetwork);
9
+ abstract createEthereumProtocol(network?: ProtocolNetwork): EthereumBaseProtocol;
10
+ createOfflineProtocol(): Promise<OfflineProtocol | undefined>;
11
+ createOnlineProtocol(networkId?: string | undefined): Promise<OnlineProtocol | undefined>;
12
+ createBlockExplorer(networkId?: string | undefined): Promise<BlockExplorer | undefined>;
13
+ }
@@ -0,0 +1,83 @@
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.EthereumBaseModule = void 0;
40
+ var coinlib_core_1 = require("@airgap/coinlib-core");
41
+ var errors_1 = require("@airgap/coinlib-core/errors");
42
+ var module_kit_1 = require("@airgap/module-kit");
43
+ var EtherscanBlockExplorer_1 = require("../block-explorer/EtherscanBlockExplorer");
44
+ var EthereumBaseModule = /** @class */ (function () {
45
+ function EthereumBaseModule(supportedNetworks, defaultNetwork) {
46
+ this.networkRegistry = new module_kit_1.ModuleNetworkRegistry({ supportedNetworks: supportedNetworks, defaultNetwork: defaultNetwork });
47
+ this.supportedNetworks = this.networkRegistry.supportedNetworks;
48
+ }
49
+ EthereumBaseModule.prototype.createOfflineProtocol = function () {
50
+ return __awaiter(this, void 0, void 0, function () {
51
+ return __generator(this, function (_a) {
52
+ return [2 /*return*/, this.createEthereumProtocol()];
53
+ });
54
+ });
55
+ };
56
+ EthereumBaseModule.prototype.createOnlineProtocol = function (networkId) {
57
+ return __awaiter(this, void 0, void 0, function () {
58
+ var network;
59
+ return __generator(this, function (_a) {
60
+ network = this.networkRegistry.findNetwork(networkId);
61
+ if (network === undefined) {
62
+ throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.ETHEREUM, 'Protocol network type not supported.');
63
+ }
64
+ return [2 /*return*/, this.createEthereumProtocol(network)];
65
+ });
66
+ });
67
+ };
68
+ EthereumBaseModule.prototype.createBlockExplorer = function (networkId) {
69
+ return __awaiter(this, void 0, void 0, function () {
70
+ var network;
71
+ return __generator(this, function (_a) {
72
+ network = this.networkRegistry.findNetwork(networkId);
73
+ if (network === undefined) {
74
+ throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.ETHEREUM, 'Block Explorer network type not supported.');
75
+ }
76
+ return [2 /*return*/, new EtherscanBlockExplorer_1.EtherscanBlockExplorer()];
77
+ });
78
+ });
79
+ };
80
+ return EthereumBaseModule;
81
+ }());
82
+ exports.EthereumBaseModule = EthereumBaseModule;
83
+ //# sourceMappingURL=EthereumBaseModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EthereumBaseModule.js","sourceRoot":"","sources":["../../../src/v1/module/EthereumBaseModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA6C;AAC7C,sDAAqE;AACrE,iDAAyF;AAIzF,mFAAiF;AAGjF;IAKE,4BAAsB,iBAAoC,EAAE,cAAgC;QAC1F,IAAI,CAAC,eAAe,GAAG,IAAI,kCAAqB,CAAC,EAAE,iBAAiB,mBAAA,EAAE,cAAc,gBAAA,EAAE,CAAC,CAAA;QACvF,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAA;IACjE,CAAC;IAIY,kDAAqB,GAAlC;;;gBACE,sBAAO,IAAI,CAAC,sBAAsB,EAAE,EAAA;;;KACrC;IAEY,iDAAoB,GAAjC,UAAkC,SAA8B;;;;gBACxD,OAAO,GAAgC,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;gBACxF,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,QAAQ,EAAE,sCAAsC,CAAC,CAAA;iBAC3F;gBAED,sBAAO,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAA;;;KAC5C;IAEY,gDAAmB,GAAhC,UAAiC,SAA8B;;;;gBACvD,OAAO,GAAgC,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;gBACxF,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,QAAQ,EAAE,4CAA4C,CAAC,CAAA;iBACjG;gBAED,sBAAO,IAAI,+CAAsB,EAAE,EAAA;;;KACpC;IACH,yBAAC;AAAD,CAAC,AAjCD,IAiCC;AAjCqB,gDAAkB"}
@@ -0,0 +1,7 @@
1
+ import { ProtocolNetwork } from '@airgap/module-kit';
2
+ import { EthereumBaseProtocol } from '../protocol/EthereumBaseProtocol';
3
+ import { EthereumBaseModule } from './EthereumBaseModule';
4
+ export declare class EthereumClassicModule extends EthereumBaseModule {
5
+ constructor();
6
+ createEthereumProtocol(network?: ProtocolNetwork | undefined): EthereumBaseProtocol;
7
+ }
@@ -0,0 +1,32 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.EthereumClassicModule = void 0;
19
+ var EthereumClassicProtocol_1 = require("../protocol/EthereumClassicProtocol");
20
+ var EthereumBaseModule_1 = require("./EthereumBaseModule");
21
+ var EthereumClassicModule = /** @class */ (function (_super) {
22
+ __extends(EthereumClassicModule, _super);
23
+ function EthereumClassicModule() {
24
+ return _super.call(this, [EthereumClassicProtocol_1.ETHEREUM_CLASSIC_MAINNET_PROTOCOL_NETWORK]) || this;
25
+ }
26
+ EthereumClassicModule.prototype.createEthereumProtocol = function (network) {
27
+ return (0, EthereumClassicProtocol_1.createEthereumClassicProtocol)({ network: network });
28
+ };
29
+ return EthereumClassicModule;
30
+ }(EthereumBaseModule_1.EthereumBaseModule));
31
+ exports.EthereumClassicModule = EthereumClassicModule;
32
+ //# sourceMappingURL=EthereumClassicModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EthereumClassicModule.js","sourceRoot":"","sources":["../../../src/v1/module/EthereumClassicModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAGA,+EAA8H;AAE9H,2DAAyD;AAEzD;IAA2C,yCAAkB;IAC3D;eACE,kBAAM,CAAC,mEAAyC,CAAC,CAAC;IACpD,CAAC;IAEM,sDAAsB,GAA7B,UAA8B,OAAqC;QACjE,OAAO,IAAA,uDAA6B,EAAC,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;IACnD,CAAC;IACH,4BAAC;AAAD,CAAC,AARD,CAA2C,uCAAkB,GAQ5D;AARY,sDAAqB"}
@@ -1,13 +1,7 @@
1
- import { AirGapModule, AirGapV3SerializerCompanion, ProtocolConfiguration } from '@airgap/module-kit';
2
- import { BlockExplorer } from '@airgap/module-kit/block-explorer/block-explorer';
3
- import { OfflineProtocol, OnlineProtocol } from '@airgap/module-kit/protocol/protocol';
4
- export declare class EthereumModule implements AirGapModule {
5
- private readonly networkRegistries;
6
- readonly supportedProtocols: Record<string, ProtocolConfiguration>;
1
+ import { ProtocolNetwork } from '@airgap/module-kit';
2
+ import { EthereumBaseProtocol } from '../protocol/EthereumBaseProtocol';
3
+ import { EthereumBaseModule } from './EthereumBaseModule';
4
+ export declare class EthereumModule extends EthereumBaseModule {
7
5
  constructor();
8
- createOfflineProtocol(identifier: string): Promise<OfflineProtocol | undefined>;
9
- createOnlineProtocol(identifier: string, networkId?: string): Promise<OnlineProtocol | undefined>;
10
- createBlockExplorer(identifier: string, networkId?: string): Promise<BlockExplorer | undefined>;
11
- createV3SerializerCompanion(): Promise<AirGapV3SerializerCompanion>;
12
- private createProtocol;
6
+ createEthereumProtocol(network?: ProtocolNetwork | undefined): EthereumBaseProtocol;
13
7
  }
@@ -1,125 +1,32 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
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);
10
8
  };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
29
- 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;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
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
+ })();
49
17
  Object.defineProperty(exports, "__esModule", { value: true });
50
18
  exports.EthereumModule = void 0;
51
- var coinlib_core_1 = require("@airgap/coinlib-core");
52
- var errors_1 = require("@airgap/coinlib-core/errors");
53
- var module_kit_1 = require("@airgap/module-kit");
54
- var EtherscanBlockExplorer_1 = require("../block-explorer/EtherscanBlockExplorer");
55
- var ERC20Token_1 = require("../protocol/erc20/ERC20Token");
56
19
  var EthereumProtocol_1 = require("../protocol/EthereumProtocol");
57
- var serializer_companion_1 = require("../serializer/v3/serializer-companion");
58
- var ERC20Tokens_1 = require("./ERC20Tokens");
59
- var EthereumModule = /** @class */ (function () {
20
+ var EthereumBaseModule_1 = require("./EthereumBaseModule");
21
+ var EthereumModule = /** @class */ (function (_super) {
22
+ __extends(EthereumModule, _super);
60
23
  function EthereumModule() {
61
- var _a;
62
- var networkRegistry = new module_kit_1.ModuleNetworkRegistry({
63
- supportedNetworks: [EthereumProtocol_1.ETHEREUM_MAINNET_PROTOCOL_NETWORK]
64
- });
65
- var erc20NetworkRegistry = new module_kit_1.ModuleNetworkRegistry({
66
- supportedNetworks: [ERC20Token_1.ETHEREUM_ERC20_MAINNET_PROTOCOL_NETWORK]
67
- });
68
- this.networkRegistries = __assign((_a = {}, _a[coinlib_core_1.MainProtocolSymbols.ETH] = networkRegistry, _a), ERC20Tokens_1.erc20TokensIdentifiers.reduce(function (obj, next) {
69
- var _a;
70
- return Object.assign(obj, (_a = {}, _a[next] = erc20NetworkRegistry, _a));
71
- }, {}));
72
- this.supportedProtocols = (0, module_kit_1.createSupportedProtocols)(this.networkRegistries);
24
+ return _super.call(this, [EthereumProtocol_1.ETHEREUM_MAINNET_PROTOCOL_NETWORK]) || this;
73
25
  }
74
- EthereumModule.prototype.createOfflineProtocol = function (identifier) {
75
- return __awaiter(this, void 0, void 0, function () {
76
- return __generator(this, function (_a) {
77
- return [2 /*return*/, this.createProtocol(identifier)];
78
- });
79
- });
80
- };
81
- EthereumModule.prototype.createOnlineProtocol = function (identifier, networkId) {
82
- return __awaiter(this, void 0, void 0, function () {
83
- var network;
84
- return __generator(this, function (_a) {
85
- network = this.networkRegistries[identifier].findNetwork(networkId);
86
- if (network === undefined) {
87
- throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.ETHEREUM, 'Protocol network type not supported.');
88
- }
89
- return [2 /*return*/, this.createProtocol(identifier, network)];
90
- });
91
- });
92
- };
93
- EthereumModule.prototype.createBlockExplorer = function (identifier, networkId) {
94
- return __awaiter(this, void 0, void 0, function () {
95
- var network;
96
- return __generator(this, function (_a) {
97
- network = this.networkRegistries[identifier].findNetwork(networkId);
98
- if (network === undefined) {
99
- throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.ETHEREUM, 'Block Explorer network type not supported.');
100
- }
101
- return [2 /*return*/, new EtherscanBlockExplorer_1.EtherscanBlockExplorer()];
102
- });
103
- });
104
- };
105
- EthereumModule.prototype.createV3SerializerCompanion = function () {
106
- return __awaiter(this, void 0, void 0, function () {
107
- return __generator(this, function (_a) {
108
- return [2 /*return*/, new serializer_companion_1.EthereumV3SerializerCompanion()];
109
- });
110
- });
111
- };
112
- EthereumModule.prototype.createProtocol = function (identifier, network) {
113
- if (identifier === coinlib_core_1.MainProtocolSymbols.ETH) {
114
- return (0, EthereumProtocol_1.createEthereumProtocol)({ network: network });
115
- }
116
- if (ERC20Tokens_1.erc20Tokens[identifier] !== undefined) {
117
- var tokenMetadata = ERC20Tokens_1.erc20Tokens[identifier];
118
- return (0, ERC20Token_1.createERC20Token)(tokenMetadata);
119
- }
120
- throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.ETHEREUM, "Protocol ".concat(identifier, " not supported."));
26
+ EthereumModule.prototype.createEthereumProtocol = function (network) {
27
+ return (0, EthereumProtocol_1.createEthereumProtocol)({ network: network });
121
28
  };
122
29
  return EthereumModule;
123
- }());
30
+ }(EthereumBaseModule_1.EthereumBaseModule));
124
31
  exports.EthereumModule = EthereumModule;
125
32
  //# sourceMappingURL=EthereumModule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumModule.js","sourceRoot":"","sources":["../../../src/v1/module/EthereumModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAkE;AAClE,sDAAqE;AACrE,iDAO2B;AAI3B,mFAAiF;AACjF,2DAAwG;AACxG,iEAAwG;AACxG,8EAAqF;AAGrF,6CAAmE;AAEnE;IAIE;;QACE,IAAM,eAAe,GAA0B,IAAI,kCAAqB,CAAC;YACvE,iBAAiB,EAAE,CAAC,oDAAiC,CAAC;SACvD,CAAC,CAAA;QACF,IAAM,oBAAoB,GAA0B,IAAI,kCAAqB,CAAC;YAC5E,iBAAiB,EAAE,CAAC,oDAAuC,CAAC;SAC7D,CAAC,CAAA;QAEF,IAAI,CAAC,iBAAiB,yBACnB,kCAAmB,CAAC,GAAG,IAAG,eAAe,OACvC,oCAAsB,CAAC,MAAM,CAC9B,UAAC,GAA0C,EAAE,IAAY;;YAAK,OAAA,MAAM,CAAC,MAAM,CAAC,GAAG,YAAI,GAAC,IAAI,IAAG,oBAAoB,MAAG;QAApD,CAAoD,EAClH,EAAE,CACH,CACF,CAAA;QACD,IAAI,CAAC,kBAAkB,GAAG,IAAA,qCAAwB,EAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;IAC5E,CAAC;IAEY,8CAAqB,GAAlC,UAAmC,UAAkB;;;gBACnD,sBAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAA;;;KACvC;IAEY,6CAAoB,GAAjC,UAAkC,UAAkB,EAAE,SAAkB;;;;gBAChE,OAAO,GAAgC,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;gBACtG,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,QAAQ,EAAE,sCAAsC,CAAC,CAAA;iBAC3F;gBAED,sBAAO,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,EAAA;;;KAChD;IAEY,4CAAmB,GAAhC,UAAiC,UAAkB,EAAE,SAAkB;;;;gBAC/D,OAAO,GAAgC,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;gBACtG,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,QAAQ,EAAE,4CAA4C,CAAC,CAAA;iBACjG;gBAED,sBAAO,IAAI,+CAAsB,EAAE,EAAA;;;KACpC;IAEY,oDAA2B,GAAxC;;;gBACE,sBAAO,IAAI,oDAA6B,EAAE,EAAA;;;KAC3C;IAEO,uCAAc,GAAtB,UAAuB,UAAkB,EAAE,OAAyB;QAClE,IAAI,UAAU,KAAK,kCAAmB,CAAC,GAAG,EAAE;YAC1C,OAAO,IAAA,yCAAsB,EAAC,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;SAC3C;QAED,IAAI,yBAAW,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;YACzC,IAAM,aAAa,GAAuB,yBAAW,CAAC,UAAU,CAAC,CAAA;YAEjE,OAAO,IAAA,6BAAgB,EAAC,aAAa,CAAC,CAAA;SACvC;QAED,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,QAAQ,EAAE,mBAAY,UAAU,oBAAiB,CAAC,CAAA;IAC7F,CAAC;IACH,qBAAC;AAAD,CAAC,AA7DD,IA6DC;AA7DY,wCAAc"}
1
+ {"version":3,"file":"EthereumModule.js","sourceRoot":"","sources":["../../../src/v1/module/EthereumModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAGA,iEAAwG;AAExG,2DAAyD;AAEzD;IAAoC,kCAAkB;IACpD;eACE,kBAAM,CAAC,oDAAiC,CAAC,CAAC;IAC5C,CAAC;IAEM,+CAAsB,GAA7B,UAA8B,OAAqC;QACjE,OAAO,IAAA,yCAAsB,EAAC,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;IAC5C,CAAC;IACH,qBAAC;AAAD,CAAC,AARD,CAAoC,uCAAkB,GAQrD;AARY,wCAAc"}
@@ -0,0 +1,7 @@
1
+ import { ProtocolNetwork } from '@airgap/module-kit';
2
+ import { EthereumBaseProtocol } from '../protocol/EthereumBaseProtocol';
3
+ import { EthereumBaseModule } from './EthereumBaseModule';
4
+ export declare class EthereumRopstenModule extends EthereumBaseModule {
5
+ constructor();
6
+ createEthereumProtocol(network?: ProtocolNetwork | undefined): EthereumBaseProtocol;
7
+ }
@@ -0,0 +1,32 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.EthereumRopstenModule = void 0;
19
+ var EthereumRopstenProtocol_1 = require("../protocol/EthereumRopstenProtocol");
20
+ var EthereumBaseModule_1 = require("./EthereumBaseModule");
21
+ var EthereumRopstenModule = /** @class */ (function (_super) {
22
+ __extends(EthereumRopstenModule, _super);
23
+ function EthereumRopstenModule() {
24
+ return _super.call(this, [EthereumRopstenProtocol_1.ETHEREUM_ROPSTEN_MAINNET_PROTOCOL_NETWORK]) || this;
25
+ }
26
+ EthereumRopstenModule.prototype.createEthereumProtocol = function (network) {
27
+ return (0, EthereumRopstenProtocol_1.createEthereumRopstenProtocol)({ network: network });
28
+ };
29
+ return EthereumRopstenModule;
30
+ }(EthereumBaseModule_1.EthereumBaseModule));
31
+ exports.EthereumRopstenModule = EthereumRopstenModule;
32
+ //# sourceMappingURL=EthereumRopstenModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EthereumRopstenModule.js","sourceRoot":"","sources":["../../../src/v1/module/EthereumRopstenModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAGA,+EAA8H;AAE9H,2DAAyD;AAEzD;IAA2C,yCAAkB;IAC3D;eACE,kBAAM,CAAC,mEAAyC,CAAC,CAAC;IACpD,CAAC;IAEM,sDAAsB,GAA7B,UAA8B,OAAqC;QACjE,OAAO,IAAA,uDAA6B,EAAC,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;IACnD,CAAC;IACH,4BAAC;AAAD,CAAC,AARD,CAA2C,uCAAkB,GAQ5D;AARY,sDAAqB"}
@@ -1,5 +1,5 @@
1
1
  import { BigNumber } from '@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber';
2
- import { Address, AirGapProtocol, AirGapTransaction, AirGapTransactionStatus, AirGapTransactionsWithCursor, Amount, Balance, ExtendedKeyPair, ExtendedPublicKey, ExtendedSecretKey, FeeDefaults, KeyPair, ProtocolMetadata, ProtocolUnitsMetadata, PublicKey, Secret, SecretKey, Signature, TransactionConfiguration, TransactionDetails } from '@airgap/module-kit';
2
+ import { Address, AirGapProtocol, AirGapTransaction, AirGapTransactionStatus, AirGapTransactionsWithCursor, Amount, Balance, FeeDefaults, KeyPair, ProtocolMetadata, ProtocolUnitsMetadata, PublicKey, Secret, SecretKey, Signature, TransactionConfiguration, TransactionDetails } from '@airgap/module-kit';
3
3
  import { EthereumCryptoClient } from '../clients/crypto/EthereumCryptoClient';
4
4
  import { EthereumInfoClient } from '../clients/info/EthereumInfoClient';
5
5
  import { EthereumNodeClient } from '../clients/node/EthereumNodeClient';
@@ -14,7 +14,7 @@ export interface EthereumBaseProtocol<_Units extends string = EthereumUnits> ext
14
14
  SignedTransaction: EthereumSignedTransaction;
15
15
  UnsignedTransaction: EthereumUnsignedTransaction;
16
16
  TransactionCursor: EthereumTransactionCursor;
17
- }, 'Bip32', 'Crypto', 'FetchDataForAddress', 'FetchDataForMultipleAddresses', 'TransactionStatusChecker'> {
17
+ }, 'Crypto', 'FetchDataForAddress', 'FetchDataForMultipleAddresses', 'TransactionStatusChecker'> {
18
18
  }
19
19
  export declare const DEFAULT_ETHEREUM_UNITS_METADATA: ProtocolUnitsMetadata<EthereumUnits>;
20
20
  export declare abstract class EthereumBaseProtocolImpl<_Units extends string = EthereumUnits> implements EthereumBaseProtocol<_Units> {
@@ -34,48 +34,36 @@ export declare abstract class EthereumBaseProtocolImpl<_Units extends string = E
34
34
  protected readonly feeDefaults: FeeDefaults<EthereumUnits>;
35
35
  protected readonly metadata: ProtocolMetadata<_Units, EthereumUnits>;
36
36
  getMetadata(): Promise<ProtocolMetadata<_Units, EthereumUnits>>;
37
- getAddressFromPublicKey(publicKey: PublicKey | ExtendedPublicKey): Promise<string>;
38
- deriveFromExtendedPublicKey(extendedPublicKey: ExtendedPublicKey, visibilityIndex: number, addressIndex: number): Promise<PublicKey>;
39
- getDetailsFromTransaction(transaction: EthereumSignedTransaction | EthereumUnsignedTransaction, publicKey: PublicKey | ExtendedPublicKey): Promise<AirGapTransaction<_Units, EthereumUnits>[]>;
40
- private getDetailsFromTransactionWithPublicKey;
41
- private getDetailsFromTransactionWithExtendedPublicKey;
37
+ getAddressFromPublicKey(publicKey: PublicKey): Promise<string>;
38
+ getDetailsFromTransaction(transaction: EthereumSignedTransaction | EthereumUnsignedTransaction, publicKey: PublicKey): Promise<AirGapTransaction<_Units, EthereumUnits>[]>;
42
39
  protected getDetailsFromSignedTransaction(transaction: EthereumSignedTransaction): Promise<AirGapTransaction<_Units, EthereumUnits>[]>;
43
40
  protected getDetailsFromTypedUnsignedTransaction(transaction: EthereumTypedUnsignedTransaction, ownAddress: string): Promise<AirGapTransaction<_Units, EthereumUnits>[]>;
44
41
  protected getDetailsFromRawUnsignedTransaction(transaction: EthereumRawUnsignedTransaction, ownAddress: string): Promise<AirGapTransaction<_Units, EthereumUnits>[]>;
45
- verifyMessageWithPublicKey(message: string, signature: Signature, publicKey: PublicKey | ExtendedPublicKey): Promise<boolean>;
46
- encryptAsymmetricWithPublicKey(payload: string, publicKey: PublicKey | ExtendedPublicKey): Promise<string>;
42
+ verifyMessageWithPublicKey(message: string, signature: Signature, publicKey: PublicKey): Promise<boolean>;
43
+ encryptAsymmetricWithPublicKey(payload: string, publicKey: PublicKey): Promise<string>;
47
44
  getKeyPairFromSecret(secret: Secret, derivationPath?: string): Promise<KeyPair>;
48
45
  private getKeyPairFromHexSecret;
49
46
  private getKeyPairFromMnemonic;
50
- getExtendedKeyPairFromSecret(secret: Secret, derivationPath?: string): Promise<ExtendedKeyPair>;
51
- private getExtendedKeyPairFromHexSecret;
52
- private getExtendedKeyPairFromMnemonic;
53
- deriveFromExtendedSecretKey(extendedSecretKey: ExtendedSecretKey, visibilityIndex: number, addressIndex: number): Promise<SecretKey>;
54
- signTransactionWithSecretKey(transaction: EthereumUnsignedTransaction, secretKey: SecretKey | ExtendedSecretKey): Promise<EthereumSignedTransaction>;
47
+ signTransactionWithSecretKey(transaction: EthereumUnsignedTransaction, secretKey: SecretKey): Promise<EthereumSignedTransaction>;
55
48
  private signTypedUnsignedTransactionWithSecretKey;
56
49
  private signRawUnsignedTransactionWithSecretKey;
57
50
  private signTypedTransactionWithSecretKey;
58
- signMessageWithKeyPair(message: string, keyPair: KeyPair | ExtendedKeyPair): Promise<Signature>;
59
- decryptAsymmetricWithKeyPair(payload: string, keyPair: KeyPair | ExtendedKeyPair): Promise<string>;
60
- encryptAESWithSecretKey(payload: string, secretKey: SecretKey | ExtendedSecretKey): Promise<string>;
61
- decryptAESWithSecretKey(payload: string, secretKey: SecretKey | ExtendedSecretKey): Promise<string>;
51
+ signMessageWithKeyPair(message: string, keyPair: KeyPair): Promise<Signature>;
52
+ decryptAsymmetricWithKeyPair(payload: string, keyPair: KeyPair): Promise<string>;
53
+ encryptAESWithSecretKey(payload: string, secretKey: SecretKey): Promise<string>;
54
+ decryptAESWithSecretKey(payload: string, secretKey: SecretKey): Promise<string>;
62
55
  getNetwork(): Promise<EthereumProtocolNetwork>;
63
- getTransactionsForPublicKey(publicKey: PublicKey | ExtendedPublicKey, limit: number, cursor?: EthereumTransactionCursor): Promise<AirGapTransactionsWithCursor<EthereumTransactionCursor, _Units, EthereumUnits>>;
56
+ getTransactionsForPublicKey(publicKey: PublicKey, limit: number, cursor?: EthereumTransactionCursor): Promise<AirGapTransactionsWithCursor<EthereumTransactionCursor, _Units, EthereumUnits>>;
64
57
  getTransactionsForAddress(address: string, limit: number, cursor?: EthereumTransactionCursor): Promise<AirGapTransactionsWithCursor<EthereumTransactionCursor, _Units, EthereumUnits>>;
65
58
  getTransactionsForAddresses(addresses: string[], limit: number, cursor?: EthereumTransactionCursor): Promise<AirGapTransactionsWithCursor<EthereumTransactionCursor, _Units, EthereumUnits>>;
66
59
  getTransactionStatus(transactionIds: string[]): Promise<Record<string, AirGapTransactionStatus>>;
67
- getBalanceOfPublicKey(publicKey: PublicKey | ExtendedPublicKey): Promise<Balance<_Units>>;
60
+ getBalanceOfPublicKey(publicKey: PublicKey): Promise<Balance<_Units>>;
68
61
  getBalanceOfAddress(address: string): Promise<Balance<_Units>>;
69
62
  getBalanceOfAddresses(addresses: string[]): Promise<Balance<_Units>>;
70
- getTransactionMaxAmountWithPublicKey(publicKey: PublicKey | ExtendedPublicKey, to: string[], configuration?: TransactionConfiguration<EthereumUnits>): Promise<Amount<_Units>>;
71
- getTransactionFeeWithPublicKey(publicKey: PublicKey | ExtendedPublicKey, details: TransactionDetails<_Units>[]): Promise<FeeDefaults<EthereumUnits>>;
72
- prepareTransactionWithPublicKey(publicKey: PublicKey | ExtendedPublicKey, details: TransactionDetails<_Units>[], configuration?: TransactionConfiguration<EthereumUnits>): Promise<EthereumUnsignedTransaction>;
63
+ getTransactionMaxAmountWithPublicKey(publicKey: PublicKey, to: string[], configuration?: TransactionConfiguration<EthereumUnits>): Promise<Amount<_Units>>;
64
+ getTransactionFeeWithPublicKey(publicKey: PublicKey, details: TransactionDetails<_Units>[]): Promise<FeeDefaults<EthereumUnits>>;
65
+ prepareTransactionWithPublicKey(publicKey: PublicKey, details: TransactionDetails<_Units>[], configuration?: TransactionConfiguration<EthereumUnits>): Promise<EthereumUnsignedTransaction>;
73
66
  broadcastTransaction(transaction: EthereumSignedTransaction): Promise<string>;
74
- private nonExtendedPublicKey;
75
- private nonExtendedSecretKey;
76
- private getPublicKeyFromExtendedPublicKey;
77
- private getSecretKeyFromExtendedSecretKey;
78
- private deriveNode;
79
67
  protected estimateGas(fromAddress: string, toAddress: string, amount: string | number | BigNumber | Amount<_Units>, data?: string): Promise<BigNumber>;
80
68
  }
81
69
  export declare abstract class DefaultEthereumBaseProtocolImpl extends EthereumBaseProtocolImpl {