@airgap/ethereum 0.13.8-beta.3 → 0.13.8-beta.4

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 (45) hide show
  1. package/airgap-coinlib-ethereum.min.js +6 -1
  2. package/package.json +2 -2
  3. package/v0/protocol/BaseEthereumProtocol.js +2 -0
  4. package/v0/protocol/BaseEthereumProtocol.js.map +1 -1
  5. package/v0/protocol/EthereumAddress.js +1 -0
  6. package/v0/protocol/EthereumAddress.js.map +1 -1
  7. package/v0/protocol/EthereumCryptoClient.js +2 -1
  8. package/v0/protocol/EthereumCryptoClient.js.map +1 -1
  9. package/v0/protocol/erc20/GenericERC20.js +1 -0
  10. package/v0/protocol/erc20/GenericERC20.js.map +1 -1
  11. package/v0/serializer/validators/transaction-validator.js.map +1 -1
  12. package/v1/clients/crypto/EthereumCryptoClient.js +1 -0
  13. package/v1/clients/crypto/EthereumCryptoClient.js.map +1 -1
  14. package/v1/data/EthereumAddress.js +1 -0
  15. package/v1/data/EthereumAddress.js.map +1 -1
  16. package/v1/index.d.ts +1 -3
  17. package/v1/index.js +1 -5
  18. package/v1/index.js.map +1 -1
  19. package/v1/module/ERC20Tokens.d.ts +3 -0
  20. package/v1/module/ERC20Tokens.js +815 -0
  21. package/v1/module/ERC20Tokens.js.map +1 -0
  22. package/v1/module/EthereumModule.d.ts +10 -5
  23. package/v1/module/EthereumModule.js +107 -21
  24. package/v1/module/EthereumModule.js.map +1 -1
  25. package/v1/protocol/EthereumBaseProtocol.js +2 -0
  26. package/v1/protocol/EthereumBaseProtocol.js.map +1 -1
  27. package/v1/protocol/EthereumProtocol.js +1 -0
  28. package/v1/protocol/EthereumProtocol.js.map +1 -1
  29. package/v1/protocol/erc20/ERC20Token.js +8 -0
  30. package/v1/protocol/erc20/ERC20Token.js.map +1 -1
  31. package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
  32. package/v1/utils/key.js +1 -0
  33. package/v1/utils/key.js.map +1 -1
  34. package/v1/module/ERC20Module.d.ts +0 -9
  35. package/v1/module/ERC20Module.js +0 -69
  36. package/v1/module/ERC20Module.js.map +0 -1
  37. package/v1/module/EthereumBaseModule.d.ts +0 -13
  38. package/v1/module/EthereumBaseModule.js +0 -83
  39. package/v1/module/EthereumBaseModule.js.map +0 -1
  40. package/v1/module/EthereumClassicModule.d.ts +0 -7
  41. package/v1/module/EthereumClassicModule.js +0 -32
  42. package/v1/module/EthereumClassicModule.js.map +0 -1
  43. package/v1/module/EthereumRopstenModule.d.ts +0 -7
  44. package/v1/module/EthereumRopstenModule.js +0 -32
  45. package/v1/module/EthereumRopstenModule.js.map +0 -1
@@ -1,83 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,7 +0,0 @@
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
- }
@@ -1,32 +0,0 @@
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
@@ -1 +0,0 @@
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,7 +0,0 @@
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
- }
@@ -1,32 +0,0 @@
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
@@ -1 +0,0 @@
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"}