@airgap/ethereum 0.13.7-beta.21 → 0.13.7-beta.23
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.
- package/airgap-coinlib-ethereum.min.js +17284 -6305
- package/index.d.ts +1 -12
- package/index.js +15 -21
- package/index.js.map +1 -1
- package/package.json +5 -3
- package/v0/index.d.ts +12 -0
- package/v0/index.js +39 -0
- package/v0/index.js.map +1 -0
- package/{protocol → v0/protocol}/BaseEthereumProtocol.d.ts +0 -0
- package/{protocol → v0/protocol}/BaseEthereumProtocol.js +14 -10
- package/v0/protocol/BaseEthereumProtocol.js.map +1 -0
- package/{protocol → v0/protocol}/EthereumAddress.d.ts +0 -0
- package/{protocol → v0/protocol}/EthereumAddress.js +5 -1
- package/v0/protocol/EthereumAddress.js.map +1 -0
- package/{protocol → v0/protocol}/EthereumChainIDs.d.ts +0 -0
- package/{protocol → v0/protocol}/EthereumChainIDs.js +0 -0
- package/v0/protocol/EthereumChainIDs.js.map +1 -0
- package/{protocol → v0/protocol}/EthereumClassicProtocol.d.ts +0 -0
- package/{protocol → v0/protocol}/EthereumClassicProtocol.js +2 -0
- package/v0/protocol/EthereumClassicProtocol.js.map +1 -0
- package/{protocol → v0/protocol}/EthereumCryptoClient.d.ts +0 -0
- package/{protocol → v0/protocol}/EthereumCryptoClient.js +10 -4
- package/v0/protocol/EthereumCryptoClient.js.map +1 -0
- package/{protocol → v0/protocol}/EthereumProtocol.d.ts +0 -0
- package/{protocol → v0/protocol}/EthereumProtocol.js +2 -0
- package/v0/protocol/EthereumProtocol.js.map +1 -0
- package/{protocol → v0/protocol}/EthereumProtocolOptions.d.ts +0 -0
- package/{protocol → v0/protocol}/EthereumProtocolOptions.js +4 -2
- package/v0/protocol/EthereumProtocolOptions.js.map +1 -0
- package/{protocol → v0/protocol}/EthereumRopstenProtocol.d.ts +0 -0
- package/{protocol → v0/protocol}/EthereumRopstenProtocol.js +2 -0
- package/v0/protocol/EthereumRopstenProtocol.js.map +1 -0
- package/{protocol → v0/protocol}/EthereumTypes.d.ts +0 -0
- package/{protocol → v0/protocol}/EthereumTypes.js +0 -0
- package/v0/protocol/EthereumTypes.js.map +1 -0
- package/{protocol → v0/protocol}/clients/info-clients/EtherscanInfoClient.d.ts +0 -0
- package/{protocol → v0/protocol}/clients/info-clients/EtherscanInfoClient.js +8 -6
- package/v0/protocol/clients/info-clients/EtherscanInfoClient.js.map +1 -0
- package/{protocol → v0/protocol}/clients/info-clients/InfoClient.d.ts +0 -0
- package/{protocol → v0/protocol}/clients/info-clients/InfoClient.js +0 -0
- package/v0/protocol/clients/info-clients/InfoClient.js.map +1 -0
- package/{protocol → v0/protocol}/clients/node-clients/AirGapNodeClient.d.ts +0 -0
- package/{protocol → v0/protocol}/clients/node-clients/AirGapNodeClient.js +8 -6
- package/v0/protocol/clients/node-clients/AirGapNodeClient.js.map +1 -0
- package/{protocol → v0/protocol}/clients/node-clients/NodeClient.d.ts +0 -0
- package/{protocol → v0/protocol}/clients/node-clients/NodeClient.js +0 -0
- package/v0/protocol/clients/node-clients/NodeClient.js.map +1 -0
- package/{protocol → v0/protocol}/erc20/ERC20.d.ts +0 -0
- package/{protocol → v0/protocol}/erc20/ERC20.js +0 -0
- package/v0/protocol/erc20/ERC20.js.map +1 -0
- package/{protocol → v0/protocol}/erc20/GenericERC20.d.ts +0 -0
- package/{protocol → v0/protocol}/erc20/GenericERC20.js +8 -2
- package/v0/protocol/erc20/GenericERC20.js.map +1 -0
- package/{protocol → v0/protocol}/utils/utils.d.ts +0 -0
- package/{protocol → v0/protocol}/utils/utils.js +7 -7
- package/v0/protocol/utils/utils.js.map +1 -0
- package/v0/serializer/schemas/v2/transaction-sign-request-ethereum.json +50 -0
- package/v0/serializer/schemas/v2/transaction-sign-response-ethereum.json +19 -0
- package/v0/serializer/schemas/v3/transaction-sign-request-ethereum-typed.json +38 -0
- package/v0/serializer/schemas/v3/transaction-sign-request-ethereum.json +50 -0
- package/v0/serializer/schemas/v3/transaction-sign-response-ethereum.json +19 -0
- package/v0/serializer/validators/transaction-validator.d.ts +15 -0
- package/v0/serializer/validators/transaction-validator.js +96 -0
- package/v0/serializer/validators/transaction-validator.js.map +1 -0
- package/v0/serializer/validators/validators.d.ts +1 -0
- package/v0/serializer/validators/validators.js +78 -0
- package/v0/serializer/validators/validators.js.map +1 -0
- package/v0/types/signed-transaction-ethereum.d.ts +5 -0
- package/{types → v0/types}/signed-transaction-ethereum.js +0 -0
- package/v0/types/signed-transaction-ethereum.js.map +1 -0
- package/{types → v0/types}/transaction-ethereum.d.ts +0 -0
- package/{types → v0/types}/transaction-ethereum.js +0 -0
- package/v0/types/transaction-ethereum.js.map +1 -0
- package/v0/types/unsigned-transaction-ethereum-typed.d.ts +11 -0
- package/{types → v0/types}/unsigned-transaction-ethereum-typed.js +0 -0
- package/v0/types/unsigned-transaction-ethereum-typed.js.map +1 -0
- package/v0/types/unsigned-transaction-ethereum.d.ts +15 -0
- package/{types → v0/types}/unsigned-transaction-ethereum.js +0 -0
- package/v0/types/unsigned-transaction-ethereum.js.map +1 -0
- package/v1/block-explorer/EtherscanBlockExplorer.d.ts +9 -0
- package/v1/block-explorer/EtherscanBlockExplorer.js +74 -0
- package/v1/block-explorer/EtherscanBlockExplorer.js.map +1 -0
- package/v1/clients/crypto/EthereumCryptoClient.d.ts +7 -0
- package/v1/clients/crypto/EthereumCryptoClient.js +146 -0
- package/v1/clients/crypto/EthereumCryptoClient.js.map +1 -0
- package/v1/clients/info/EthereumInfoClient.d.ts +15 -0
- package/v1/clients/info/EthereumInfoClient.js +11 -0
- package/v1/clients/info/EthereumInfoClient.js.map +1 -0
- package/v1/clients/info/EtherscanInfoClient.d.ts +7 -0
- package/v1/clients/info/EtherscanInfoClient.js +165 -0
- package/v1/clients/info/EtherscanInfoClient.js.map +1 -0
- package/v1/clients/node/AirGapNodeClient.d.ts +41 -0
- package/v1/clients/node/AirGapNodeClient.js +351 -0
- package/v1/clients/node/AirGapNodeClient.js.map +1 -0
- package/v1/clients/node/EthereumNodeClient.d.ts +17 -0
- package/v1/clients/node/EthereumNodeClient.js +11 -0
- package/v1/clients/node/EthereumNodeClient.js.map +1 -0
- package/v1/data/EthereumAddress.d.ts +7 -0
- package/v1/data/EthereumAddress.js +45 -0
- package/v1/data/EthereumAddress.js.map +1 -0
- package/v1/index.d.ts +14 -0
- package/v1/index.js +23 -0
- package/v1/index.js.map +1 -0
- package/v1/module/ERC20Module.d.ts +9 -0
- package/v1/module/ERC20Module.js +69 -0
- package/v1/module/ERC20Module.js.map +1 -0
- package/v1/module/EthereumBaseModule.d.ts +13 -0
- package/v1/module/EthereumBaseModule.js +83 -0
- package/v1/module/EthereumBaseModule.js.map +1 -0
- package/v1/module/EthereumClassicModule.d.ts +7 -0
- package/v1/module/EthereumClassicModule.js +32 -0
- package/v1/module/EthereumClassicModule.js.map +1 -0
- package/v1/module/EthereumModule.d.ts +7 -0
- package/v1/module/EthereumModule.js +32 -0
- package/v1/module/EthereumModule.js.map +1 -0
- package/v1/module/EthereumRopstenModule.d.ts +7 -0
- package/v1/module/EthereumRopstenModule.js +32 -0
- package/v1/module/EthereumRopstenModule.js.map +1 -0
- package/v1/protocol/EthereumBaseProtocol.d.ts +71 -0
- package/v1/protocol/EthereumBaseProtocol.js +744 -0
- package/v1/protocol/EthereumBaseProtocol.js.map +1 -0
- package/v1/protocol/EthereumChainIds.d.ts +1 -0
- package/v1/protocol/EthereumChainIds.js +340 -0
- package/v1/protocol/EthereumChainIds.js.map +1 -0
- package/v1/protocol/EthereumClassicProtocol.d.ts +8 -0
- package/v1/protocol/EthereumClassicProtocol.js +87 -0
- package/v1/protocol/EthereumClassicProtocol.js.map +1 -0
- package/v1/protocol/EthereumProtocol.d.ts +8 -0
- package/v1/protocol/EthereumProtocol.js +312 -0
- package/v1/protocol/EthereumProtocol.js.map +1 -0
- package/v1/protocol/EthereumRopstenProtocol.d.ts +8 -0
- package/v1/protocol/EthereumRopstenProtocol.js +64 -0
- package/v1/protocol/EthereumRopstenProtocol.js.map +1 -0
- package/v1/protocol/erc20/ERC20Token.d.ts +6 -0
- package/v1/protocol/erc20/ERC20Token.js +404 -0
- package/v1/protocol/erc20/ERC20Token.js.map +1 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +10 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +29 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.d.ts +10 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.d.ts +14 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.d.ts +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-ethereum.js.map +1 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum-typed.json +45 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum.json +62 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-response-ethereum.json +19 -0
- package/v1/serializer/v3/validators/transaction-validator.d.ts +10 -0
- package/v1/serializer/v3/validators/transaction-validator.js +80 -0
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -0
- package/v1/types/protocol.d.ts +32 -0
- package/v1/types/protocol.js +3 -0
- package/v1/types/protocol.js.map +1 -0
- package/v1/types/transaction.d.ts +22 -0
- package/v1/types/transaction.js +3 -0
- package/v1/types/transaction.js.map +1 -0
- package/v1/utils/EthereumUtils.d.ts +13 -0
- package/v1/utils/EthereumUtils.js +140 -0
- package/v1/utils/EthereumUtils.js.map +1 -0
- package/v1/utils/key.d.ts +5 -0
- package/v1/utils/key.js +87 -0
- package/v1/utils/key.js.map +1 -0
- package/v1/utils/transaction.d.ts +3 -0
- package/v1/utils/transaction.js +29 -0
- package/v1/utils/transaction.js.map +1 -0
- package/protocol/BaseEthereumProtocol.js.map +0 -1
- package/protocol/EthereumAddress.js.map +0 -1
- package/protocol/EthereumChainIDs.js.map +0 -1
- package/protocol/EthereumClassicProtocol.js.map +0 -1
- package/protocol/EthereumCryptoClient.js.map +0 -1
- package/protocol/EthereumProtocol.js.map +0 -1
- package/protocol/EthereumProtocolOptions.js.map +0 -1
- package/protocol/EthereumRopstenProtocol.js.map +0 -1
- package/protocol/EthereumTypes.js.map +0 -1
- package/protocol/clients/info-clients/EtherscanInfoClient.js.map +0 -1
- package/protocol/clients/info-clients/InfoClient.js.map +0 -1
- package/protocol/clients/node-clients/AirGapNodeClient.js.map +0 -1
- package/protocol/clients/node-clients/NodeClient.js.map +0 -1
- package/protocol/erc20/ERC20.js.map +0 -1
- package/protocol/erc20/GenericERC20.js.map +0 -1
- package/protocol/utils/utils.js.map +0 -1
- package/types/signed-transaction-ethereum.d.ts +0 -5
- package/types/signed-transaction-ethereum.js.map +0 -1
- package/types/transaction-ethereum.js.map +0 -1
- package/types/unsigned-transaction-ethereum-typed.d.ts +0 -10
- package/types/unsigned-transaction-ethereum-typed.js.map +0 -1
- package/types/unsigned-transaction-ethereum.d.ts +0 -14
- package/types/unsigned-transaction-ethereum.js.map +0 -1
|
@@ -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"}
|
|
@@ -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 EthereumModule 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.EthereumModule = void 0;
|
|
19
|
+
var EthereumProtocol_1 = require("../protocol/EthereumProtocol");
|
|
20
|
+
var EthereumBaseModule_1 = require("./EthereumBaseModule");
|
|
21
|
+
var EthereumModule = /** @class */ (function (_super) {
|
|
22
|
+
__extends(EthereumModule, _super);
|
|
23
|
+
function EthereumModule() {
|
|
24
|
+
return _super.call(this, [EthereumProtocol_1.ETHEREUM_MAINNET_PROTOCOL_NETWORK]) || this;
|
|
25
|
+
}
|
|
26
|
+
EthereumModule.prototype.createEthereumProtocol = function (network) {
|
|
27
|
+
return (0, EthereumProtocol_1.createEthereumProtocol)({ network: network });
|
|
28
|
+
};
|
|
29
|
+
return EthereumModule;
|
|
30
|
+
}(EthereumBaseModule_1.EthereumBaseModule));
|
|
31
|
+
exports.EthereumModule = EthereumModule;
|
|
32
|
+
//# sourceMappingURL=EthereumModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { BigNumber } from '@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber';
|
|
2
|
+
import { Address, AirGapProtocol, AirGapTransaction, AirGapTransactionStatus, AirGapTransactionsWithCursor, Amount, Balance, FeeDefaults, KeyPair, ProtocolMetadata, ProtocolUnitsMetadata, PublicKey, Secret, SecretKey, Signature, TransactionConfiguration, TransactionDetails } from '@airgap/module-kit';
|
|
3
|
+
import { EthereumCryptoClient } from '../clients/crypto/EthereumCryptoClient';
|
|
4
|
+
import { EthereumInfoClient } from '../clients/info/EthereumInfoClient';
|
|
5
|
+
import { EthereumNodeClient } from '../clients/node/EthereumNodeClient';
|
|
6
|
+
import { EthereumBaseProtocolOptions, EthereumProtocolNetwork, EthereumProtocolOptions, EthereumUnits } from '../types/protocol';
|
|
7
|
+
import { EthereumRawUnsignedTransaction, EthereumSignedTransaction, EthereumTransactionCursor, EthereumTypedUnsignedTransaction, EthereumUnsignedTransaction } from '../types/transaction';
|
|
8
|
+
export interface EthereumBaseProtocol<_Units extends string = EthereumUnits> extends AirGapProtocol<{
|
|
9
|
+
AddressResult: Address;
|
|
10
|
+
ProtocolNetwork: EthereumProtocolNetwork;
|
|
11
|
+
Units: _Units;
|
|
12
|
+
FeeUnits: EthereumUnits;
|
|
13
|
+
FeeEstimation: FeeDefaults<EthereumUnits>;
|
|
14
|
+
SignedTransaction: EthereumSignedTransaction;
|
|
15
|
+
UnsignedTransaction: EthereumUnsignedTransaction;
|
|
16
|
+
TransactionCursor: EthereumTransactionCursor;
|
|
17
|
+
}, 'Crypto', 'FetchDataForAddress', 'FetchDataForMultipleAddresses', 'TransactionStatusChecker'> {
|
|
18
|
+
}
|
|
19
|
+
export declare const DEFAULT_ETHEREUM_UNITS_METADATA: ProtocolUnitsMetadata<EthereumUnits>;
|
|
20
|
+
export declare abstract class EthereumBaseProtocolImpl<_Units extends string = EthereumUnits> implements EthereumBaseProtocol<_Units> {
|
|
21
|
+
protected readonly options: EthereumProtocolOptions;
|
|
22
|
+
protected readonly nodeClient: EthereumNodeClient;
|
|
23
|
+
protected readonly infoClient: EthereumInfoClient;
|
|
24
|
+
protected readonly cryptoClient: EthereumCryptoClient;
|
|
25
|
+
protected readonly bitcoinJS: {
|
|
26
|
+
lib: any;
|
|
27
|
+
config: {
|
|
28
|
+
network: any;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
protected constructor(nodeClient: EthereumNodeClient, infoClient: EthereumInfoClient, options: EthereumBaseProtocolOptions<_Units>);
|
|
32
|
+
protected readonly units: ProtocolUnitsMetadata<_Units>;
|
|
33
|
+
protected readonly feeUnits: ProtocolUnitsMetadata<EthereumUnits>;
|
|
34
|
+
protected readonly feeDefaults: FeeDefaults<EthereumUnits>;
|
|
35
|
+
protected readonly metadata: ProtocolMetadata<_Units, EthereumUnits>;
|
|
36
|
+
getMetadata(): Promise<ProtocolMetadata<_Units, EthereumUnits>>;
|
|
37
|
+
getAddressFromPublicKey(publicKey: PublicKey): Promise<string>;
|
|
38
|
+
getDetailsFromTransaction(transaction: EthereumSignedTransaction | EthereumUnsignedTransaction, publicKey: PublicKey): Promise<AirGapTransaction<_Units, EthereumUnits>[]>;
|
|
39
|
+
protected getDetailsFromSignedTransaction(transaction: EthereumSignedTransaction): Promise<AirGapTransaction<_Units, EthereumUnits>[]>;
|
|
40
|
+
protected getDetailsFromTypedUnsignedTransaction(transaction: EthereumTypedUnsignedTransaction, ownAddress: string): Promise<AirGapTransaction<_Units, EthereumUnits>[]>;
|
|
41
|
+
protected getDetailsFromRawUnsignedTransaction(transaction: EthereumRawUnsignedTransaction, ownAddress: string): Promise<AirGapTransaction<_Units, EthereumUnits>[]>;
|
|
42
|
+
verifyMessageWithPublicKey(message: string, signature: Signature, publicKey: PublicKey): Promise<boolean>;
|
|
43
|
+
encryptAsymmetricWithPublicKey(payload: string, publicKey: PublicKey): Promise<string>;
|
|
44
|
+
getKeyPairFromSecret(secret: Secret, derivationPath?: string): Promise<KeyPair>;
|
|
45
|
+
private getKeyPairFromHexSecret;
|
|
46
|
+
private getKeyPairFromMnemonic;
|
|
47
|
+
signTransactionWithSecretKey(transaction: EthereumUnsignedTransaction, secretKey: SecretKey): Promise<EthereumSignedTransaction>;
|
|
48
|
+
private signTypedUnsignedTransactionWithSecretKey;
|
|
49
|
+
private signRawUnsignedTransactionWithSecretKey;
|
|
50
|
+
private signTypedTransactionWithSecretKey;
|
|
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>;
|
|
55
|
+
getNetwork(): Promise<EthereumProtocolNetwork>;
|
|
56
|
+
getTransactionsForPublicKey(publicKey: PublicKey, limit: number, cursor?: EthereumTransactionCursor): Promise<AirGapTransactionsWithCursor<EthereumTransactionCursor, _Units, EthereumUnits>>;
|
|
57
|
+
getTransactionsForAddress(address: string, limit: number, cursor?: EthereumTransactionCursor): Promise<AirGapTransactionsWithCursor<EthereumTransactionCursor, _Units, EthereumUnits>>;
|
|
58
|
+
getTransactionsForAddresses(addresses: string[], limit: number, cursor?: EthereumTransactionCursor): Promise<AirGapTransactionsWithCursor<EthereumTransactionCursor, _Units, EthereumUnits>>;
|
|
59
|
+
getTransactionStatus(transactionIds: string[]): Promise<Record<string, AirGapTransactionStatus>>;
|
|
60
|
+
getBalanceOfPublicKey(publicKey: PublicKey): Promise<Balance<_Units>>;
|
|
61
|
+
getBalanceOfAddress(address: string): Promise<Balance<_Units>>;
|
|
62
|
+
getBalanceOfAddresses(addresses: string[]): Promise<Balance<_Units>>;
|
|
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>;
|
|
66
|
+
broadcastTransaction(transaction: EthereumSignedTransaction): Promise<string>;
|
|
67
|
+
protected estimateGas(fromAddress: string, toAddress: string, amount: string | number | BigNumber | Amount<_Units>, data?: string): Promise<BigNumber>;
|
|
68
|
+
}
|
|
69
|
+
export declare abstract class DefaultEthereumBaseProtocolImpl extends EthereumBaseProtocolImpl {
|
|
70
|
+
protected constructor(nodeClient: EthereumNodeClient, infoClient: EthereumInfoClient, options: EthereumProtocolOptions & Partial<EthereumBaseProtocolOptions>);
|
|
71
|
+
}
|