@airgap/ethereum 0.13.45-beta.3 → 0.13.45-beta.5
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/package.json +5 -5
- package/v0/index.js +10 -10
- package/v0/index.js.map +1 -1
- package/v0/protocol/BaseEthereumProtocol.d.ts +1 -0
- package/v0/protocol/BaseEthereumProtocol.js +872 -460
- package/v0/protocol/BaseEthereumProtocol.js.map +1 -1
- package/v0/protocol/EthereumAddress.d.ts +1 -0
- package/v0/protocol/EthereumAddress.js +17 -26
- package/v0/protocol/EthereumAddress.js.map +1 -1
- package/v0/protocol/EthereumClassicProtocol.js +23 -6
- package/v0/protocol/EthereumClassicProtocol.js.map +1 -1
- package/v0/protocol/EthereumCryptoClient.js +125 -66
- package/v0/protocol/EthereumCryptoClient.js.map +1 -1
- package/v0/protocol/EthereumProtocol.js +28 -9
- package/v0/protocol/EthereumProtocol.js.map +1 -1
- package/v0/protocol/EthereumProtocolOptions.d.ts +1 -1
- package/v0/protocol/EthereumProtocolOptions.js +117 -36
- package/v0/protocol/EthereumProtocolOptions.js.map +1 -1
- package/v0/protocol/EthereumRopstenProtocol.js +23 -6
- package/v0/protocol/EthereumRopstenProtocol.js.map +1 -1
- package/v0/protocol/clients/info-clients/EtherscanInfoClient.js +186 -86
- package/v0/protocol/clients/info-clients/EtherscanInfoClient.js.map +1 -1
- package/v0/protocol/clients/info-clients/InfoClient.js +4 -3
- package/v0/protocol/clients/info-clients/InfoClient.js.map +1 -1
- package/v0/protocol/clients/node-clients/AirGapNodeClient.js +298 -126
- package/v0/protocol/clients/node-clients/AirGapNodeClient.js.map +1 -1
- package/v0/protocol/clients/node-clients/NodeClient.js +4 -3
- package/v0/protocol/clients/node-clients/NodeClient.js.map +1 -1
- package/v0/protocol/erc20/ERC20.js +4 -4
- package/v0/protocol/erc20/ERC20.js.map +1 -1
- package/v0/protocol/erc20/GenericERC20.js +300 -161
- package/v0/protocol/erc20/GenericERC20.js.map +1 -1
- package/v0/protocol/utils/utils.js +55 -52
- package/v0/protocol/utils/utils.js.map +1 -1
- package/v0/serializer/validators/transaction-validator.js +31 -23
- package/v0/serializer/validators/transaction-validator.js.map +1 -1
- package/v0/serializer/validators/validators.js +73 -25
- package/v0/serializer/validators/validators.js.map +1 -1
- package/v1/block-explorer/EtherscanBlockExplorer.js +61 -12
- package/v1/block-explorer/EtherscanBlockExplorer.js.map +1 -1
- package/v1/clients/crypto/EthereumCryptoClient.js +124 -69
- package/v1/clients/crypto/EthereumCryptoClient.js.map +1 -1
- package/v1/clients/info/EthereumInfoClient.d.ts +1 -1
- package/v1/clients/info/EthereumInfoClient.js +4 -3
- package/v1/clients/info/EthereumInfoClient.js.map +1 -1
- package/v1/clients/info/EtherscanInfoClient.js +162 -84
- package/v1/clients/info/EtherscanInfoClient.js.map +1 -1
- package/v1/clients/node/HttpEthereumNodeClient.d.ts +2 -2
- package/v1/clients/node/HttpEthereumNodeClient.js +375 -164
- package/v1/clients/node/HttpEthereumNodeClient.js.map +1 -1
- package/v1/data/EthereumAddress.js +20 -29
- package/v1/data/EthereumAddress.js.map +1 -1
- package/v1/index.js +14 -14
- package/v1/index.js.map +1 -1
- package/v1/module/EthereumModule.js +112 -43
- package/v1/module/EthereumModule.js.map +1 -1
- package/v1/module.js +3 -2
- package/v1/module.js.map +1 -1
- package/v1/protocol/EthereumBaseProtocol.js +788 -467
- package/v1/protocol/EthereumBaseProtocol.js.map +1 -1
- package/v1/protocol/EthereumProtocol.js +46 -15
- package/v1/protocol/EthereumProtocol.js.map +1 -1
- package/v1/protocol/erc20/ERC20Protocol.js +360 -213
- package/v1/protocol/erc20/ERC20Protocol.js.map +1 -1
- package/v1/protocol/erc20/ERC20Token.d.ts +1 -1
- package/v1/protocol/erc20/ERC20Token.js +113 -35
- package/v1/protocol/erc20/ERC20Token.js.map +1 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +42 -25
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
- package/v1/serializer/v3/serializer-companion.js +148 -71
- package/v1/serializer/v3/serializer-companion.js.map +1 -1
- package/v1/serializer/v3/validators/transaction-validator.js +17 -14
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
- package/v1/types/crypto.d.ts +1 -1
- package/v1/types/protocol.d.ts +1 -1
- package/v1/types/transaction.d.ts +1 -1
- package/v1/utils/EthereumUtils.js +60 -57
- package/v1/utils/EthereumUtils.js.map +1 -1
- package/v1/utils/key.js +19 -28
- package/v1/utils/key.js.map +1 -1
- package/v1/utils/protocol.js +21 -33
- package/v1/utils/protocol.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpEthereumNodeClient.js","sourceRoot":"","sources":["../../../../src/v1/clients/node/HttpEthereumNodeClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HttpEthereumNodeClient.js","sourceRoot":"","sources":["../../../../src/v1/clients/node/HttpEthereumNodeClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,6DAA2D;AAC3D,oGAAsF;AACtF,gGAA8F;AAC9F,sDAA+F;AAC/F,2EAAkE;AAElE,qDAAkD;AAGlD,2DAAyD;AAIzD;IAAqC,mCAAO;IAA5C;;IAiBA,CAAC;IAZQ,mCAAS,GAAhB;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IACtC,CAAC;IAEM,gCAAM,GAAb;QACE,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,EAAE,EAAE,IAAI,CAAC,EAAE;SACZ,CAAA;IACH,CAAC;IAfa,6BAAa,GAAW,UAAU,CAAA;IAClC,2BAAW,GAAW,QAAQ,CAAA;IAC9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CAAC,KAAK,CAAC,UAAC,KAAK;4BACvG,MAAM,IAAI,qBAAY,CAAC,sBAAM,CAAC,QAAQ,EAAE,KAAmB,CAAC,CAAA;wBAC9D,CAAC,CAAC,EAAA;;wBAFI,QAAQ,GAAG,SAEf;wBAEF,sBAAO,QAAQ,CAAC,IAAI,EAAA;;;;KACrB;IAEe,0CAAS,GAAzB,UAA0B,MAAyB;;;;;4BAChC,qBAAM,sBAAK;6BACzB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,MAAM,EAAE,EAAb,CAAa,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;6BAClG,KAAK,CAAC,UAAC,KAAK;4BACX,MAAM,IAAI,qBAAY,CAAC,sBAAM,CAAC,QAAQ,EAAE,KAAmB,CAAC,CAAA;wBAC9D,CAAC,CAAC,EAAA;;wBAJE,QAAQ,GAAG,SAIb;wBAEJ,sBAAO,QAAQ,CAAC,IAAI,EAAA;;;;KACrB;IACH,6BAAC;AAAD,CAAC,AA5JD,IA4JC;AA5JY,wDAAsB"}
|
|
@@ -15,41 +15,32 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
35
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
26
|
exports.EthereumAddress = void 0;
|
|
37
27
|
// @ts-ignore
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
var ethUtil = __importStar(require("@airgap/coinlib-core/dependencies/src/ethereumjs-util-5.2.0"));
|
|
29
|
+
var key_1 = require("../utils/key");
|
|
30
|
+
var EthereumAddress = /** @class */ (function () {
|
|
31
|
+
function EthereumAddress(value) {
|
|
42
32
|
this.value = value;
|
|
43
33
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
EthereumAddress.from = function (publicKey) {
|
|
35
|
+
var hexPublicKey = publicKey.type === 'pub' ? (0, key_1.convertPublicKey)(publicKey, 'hex') : (0, key_1.convertExtendedPublicKey)(publicKey, 'hex');
|
|
36
|
+
var bufferPublicKey = Buffer.from(hexPublicKey.value, 'hex');
|
|
37
|
+
var address = ethUtil.toChecksumAddress(ethUtil.pubToAddress(bufferPublicKey, true).toString('hex'));
|
|
48
38
|
return new EthereumAddress(address);
|
|
49
|
-
}
|
|
50
|
-
asString() {
|
|
39
|
+
};
|
|
40
|
+
EthereumAddress.prototype.asString = function () {
|
|
51
41
|
return this.value;
|
|
52
|
-
}
|
|
53
|
-
|
|
42
|
+
};
|
|
43
|
+
return EthereumAddress;
|
|
44
|
+
}());
|
|
54
45
|
exports.EthereumAddress = EthereumAddress;
|
|
55
46
|
//# sourceMappingURL=EthereumAddress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumAddress.js","sourceRoot":"","sources":["../../../src/v1/data/EthereumAddress.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumAddress.js","sourceRoot":"","sources":["../../../src/v1/data/EthereumAddress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,aAAa;AACb,mGAAsF;AAGtF,oCAAyE;AAEzE;IACE,yBAAqC,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;IAExC,oBAAI,GAAlB,UAAmB,SAAwC;QACzD,IAAM,YAAY,GAChB,SAAS,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,IAAA,sBAAgB,EAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAA,8BAAwB,EAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QAC5G,IAAM,eAAe,GAAW,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;QAEtE,IAAM,OAAO,GAAW,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,YAAY,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;QAE9G,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAA;IACrC,CAAC;IAEM,kCAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IACH,sBAAC;AAAD,CAAC,AAhBD,IAgBC;AAhBY,0CAAe"}
|
package/v1/index.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.erc20Tokens = exports.isEthereumERC20Token = exports.isEthereumERC20Protocol = exports.isEthereumProtocol = exports.isAnyEthereumProtocol = exports.EthereumUtils = exports.EthereumTransactionValidator = exports.ethereumTransactionSignResponseToSigned = exports.ethereumTransactionSignRequestToUnsigned = exports.ethereumSignedTransactionToResponse = exports.ethereumUnsignedTransactionToRequest = exports.EthereumRPCBody = exports.EthereumRPCData = exports.EtherscanInfoClient = exports.EthereumInfoClient = exports.HttpEthereumNodeClient = exports.DEFAULT_ETHEREUM_UNITS_METADATA = exports.EtherscanBlockExplorer = exports.createERC20Token = exports.ERC20TokenImpl = exports.ERC20ProtocolImpl = exports.createEthereumProtocolOptions = exports.createEthereumProtocol = exports.EthereumBaseProtocolImpl = 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
|
-
|
|
6
|
+
var EthereumInfoClient_1 = require("./clients/info/EthereumInfoClient");
|
|
7
7
|
Object.defineProperty(exports, "EthereumInfoClient", { enumerable: true, get: function () { return EthereumInfoClient_1.EthereumInfoClient; } });
|
|
8
|
-
|
|
8
|
+
var EtherscanInfoClient_1 = require("./clients/info/EtherscanInfoClient");
|
|
9
9
|
Object.defineProperty(exports, "EtherscanInfoClient", { enumerable: true, get: function () { return EtherscanInfoClient_1.EtherscanInfoClient; } });
|
|
10
|
-
|
|
10
|
+
var HttpEthereumNodeClient_1 = require("./clients/node/HttpEthereumNodeClient");
|
|
11
11
|
Object.defineProperty(exports, "HttpEthereumNodeClient", { enumerable: true, get: function () { return HttpEthereumNodeClient_1.HttpEthereumNodeClient; } });
|
|
12
12
|
Object.defineProperty(exports, "EthereumRPCBody", { enumerable: true, get: function () { return HttpEthereumNodeClient_1.EthereumRPCBody; } });
|
|
13
13
|
Object.defineProperty(exports, "EthereumRPCData", { enumerable: true, get: function () { return HttpEthereumNodeClient_1.EthereumRPCData; } });
|
|
14
|
-
|
|
14
|
+
var ERC20Tokens_1 = require("./module/ERC20Tokens");
|
|
15
15
|
Object.defineProperty(exports, "erc20Tokens", { enumerable: true, get: function () { return ERC20Tokens_1.erc20Tokens; } });
|
|
16
|
-
|
|
16
|
+
var EthereumModule_1 = require("./module/EthereumModule");
|
|
17
17
|
Object.defineProperty(exports, "EthereumModule", { enumerable: true, get: function () { return EthereumModule_1.EthereumModule; } });
|
|
18
|
-
|
|
18
|
+
var ERC20Protocol_1 = require("./protocol/erc20/ERC20Protocol");
|
|
19
19
|
Object.defineProperty(exports, "ERC20ProtocolImpl", { enumerable: true, get: function () { return ERC20Protocol_1.ERC20ProtocolImpl; } });
|
|
20
|
-
|
|
20
|
+
var ERC20Token_1 = require("./protocol/erc20/ERC20Token");
|
|
21
21
|
Object.defineProperty(exports, "createERC20Token", { enumerable: true, get: function () { return ERC20Token_1.createERC20Token; } });
|
|
22
22
|
Object.defineProperty(exports, "ERC20TokenImpl", { enumerable: true, get: function () { return ERC20Token_1.ERC20TokenImpl; } });
|
|
23
|
-
|
|
23
|
+
var EthereumBaseProtocol_1 = require("./protocol/EthereumBaseProtocol");
|
|
24
24
|
Object.defineProperty(exports, "DEFAULT_ETHEREUM_UNITS_METADATA", { enumerable: true, get: function () { return EthereumBaseProtocol_1.DEFAULT_ETHEREUM_UNITS_METADATA; } });
|
|
25
25
|
Object.defineProperty(exports, "EthereumBaseProtocolImpl", { enumerable: true, get: function () { return EthereumBaseProtocol_1.EthereumBaseProtocolImpl; } });
|
|
26
|
-
|
|
26
|
+
var EthereumProtocol_1 = require("./protocol/EthereumProtocol");
|
|
27
27
|
Object.defineProperty(exports, "createEthereumProtocol", { enumerable: true, get: function () { return EthereumProtocol_1.createEthereumProtocol; } });
|
|
28
28
|
Object.defineProperty(exports, "createEthereumProtocolOptions", { enumerable: true, get: function () { return EthereumProtocol_1.createEthereumProtocolOptions; } });
|
|
29
|
-
|
|
29
|
+
var transaction_converter_1 = require("./serializer/v3/schemas/converter/transaction-converter");
|
|
30
30
|
Object.defineProperty(exports, "ethereumSignedTransactionToResponse", { enumerable: true, get: function () { return transaction_converter_1.ethereumSignedTransactionToResponse; } });
|
|
31
31
|
Object.defineProperty(exports, "ethereumTransactionSignRequestToUnsigned", { enumerable: true, get: function () { return transaction_converter_1.ethereumTransactionSignRequestToUnsigned; } });
|
|
32
32
|
Object.defineProperty(exports, "ethereumTransactionSignResponseToSigned", { enumerable: true, get: function () { return transaction_converter_1.ethereumTransactionSignResponseToSigned; } });
|
|
33
33
|
Object.defineProperty(exports, "ethereumUnsignedTransactionToRequest", { enumerable: true, get: function () { return transaction_converter_1.ethereumUnsignedTransactionToRequest; } });
|
|
34
|
-
|
|
34
|
+
var transaction_validator_1 = require("./serializer/v3/validators/transaction-validator");
|
|
35
35
|
Object.defineProperty(exports, "EthereumTransactionValidator", { enumerable: true, get: function () { return transaction_validator_1.EthereumTransactionValidator; } });
|
|
36
|
-
|
|
36
|
+
var EthereumUtils_1 = require("./utils/EthereumUtils");
|
|
37
37
|
Object.defineProperty(exports, "EthereumUtils", { enumerable: true, get: function () { return EthereumUtils_1.EthereumUtils; } });
|
|
38
|
-
|
|
38
|
+
var protocol_1 = require("./utils/protocol");
|
|
39
39
|
Object.defineProperty(exports, "isAnyEthereumProtocol", { enumerable: true, get: function () { return protocol_1.isAnyEthereumProtocol; } });
|
|
40
40
|
Object.defineProperty(exports, "isEthereumERC20Protocol", { enumerable: true, get: function () { return protocol_1.isEthereumERC20Protocol; } });
|
|
41
41
|
Object.defineProperty(exports, "isEthereumERC20Token", { enumerable: true, get: function () { return protocol_1.isEthereumERC20Token; } });
|
package/v1/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,kFAAgF;AA6DvE,uGA7DA,+CAAsB,OA6DA;AA5D/B,wEAAsE;AAoEjB,mGApE5C,uCAAkB,OAoE4C;AAnEvE,0EAAwE;AAmEC,oGAnEhE,yCAAmB,OAmEgE;AAlE5F,gFAAqI;AAkExG,uGAlEpB,+CAAsB,OAkEoB;AAkBjD,gGApF+B,wCAAe,OAoF/B;AADf,gGAnFgD,wCAAe,OAmFhD;AAjFjB,oDAAkD;AAyGzC,4FAzGA,yBAAW,OAyGA;AAxGpB,0DAAwD;AAoC/C,+FApCA,+BAAc,OAoCA;AAnCvB,gEAAiF;AA8C/E,kGA9CsB,iCAAiB,OA8CtB;AA7CnB,0DAA0F;AAgDxF,iGAhDO,6BAAgB,OAgDP;AADhB,+FA/CqC,2BAAc,OA+CrC;AA9ChB,wEAAiI;AAwDxH,gHAxDA,sDAA+B,OAwDA;AAjBtC,yGAvC8D,+CAAwB,OAuC9D;AAtC1B,gEAAqH;AAwCnH,uGAxCO,yCAAsB,OAwCP;AACtB,8GAzC+B,gDAA6B,OAyC/B;AAxC/B,iGAKgE;AAkF9D,oHAtFA,2DAAmC,OAsFA;AACnC,yHAtFA,gEAAwC,OAsFA;AACxC,wHAtFA,+DAAuC,OAsFA;AAHvC,qHAlFA,4DAAoC,OAkFA;AAhFtC,0FAA+F;AAoF7F,6GApFO,oDAA4B,OAoFP;AAhE9B,uDAAqD;AAqE5C,8FArEA,6BAAa,OAqEA;AApEtB,6CAA2H;AAoEnG,sGApEf,gCAAqB,OAoEe;AAAsB,wGApEnC,kCAAuB,OAoEmC;AAAE,qGApEnC,+BAAoB,OAoEmC;AAAjE,mGApEgC,6BAAkB,OAoEhC"}
|
|
@@ -1,58 +1,127 @@
|
|
|
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;
|
|
10
|
+
};
|
|
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
|
+
};
|
|
2
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
50
|
exports.EthereumModule = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
+
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 () {
|
|
60
|
+
function EthereumModule() {
|
|
61
|
+
var _a;
|
|
62
|
+
var networkRegistry = new module_kit_1.ModuleNetworkRegistry({
|
|
15
63
|
supportedNetworks: [EthereumProtocol_1.ETHEREUM_MAINNET_PROTOCOL_NETWORK]
|
|
16
64
|
});
|
|
17
|
-
|
|
65
|
+
var erc20NetworkRegistry = new module_kit_1.ModuleNetworkRegistry({
|
|
18
66
|
supportedNetworks: [ERC20Token_1.ETHEREUM_ERC20_MAINNET_PROTOCOL_NETWORK]
|
|
19
67
|
});
|
|
20
|
-
this.networkRegistries = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
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
|
+
}, {}));
|
|
24
72
|
this.supportedProtocols = (0, module_kit_1.createSupportedProtocols)(this.networkRegistries);
|
|
25
73
|
}
|
|
26
|
-
|
|
27
|
-
return this
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
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, networkOrId) {
|
|
82
|
+
var _a;
|
|
83
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
+
var network;
|
|
85
|
+
return __generator(this, function (_b) {
|
|
86
|
+
network = typeof networkOrId === 'object' ? networkOrId : (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkOrId);
|
|
87
|
+
if (network === undefined) {
|
|
88
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.ETHEREUM, 'Protocol network type not supported.');
|
|
89
|
+
}
|
|
90
|
+
return [2 /*return*/, this.createProtocol(identifier, network)];
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
EthereumModule.prototype.createBlockExplorer = function (identifier, networkOrId) {
|
|
95
|
+
var _a;
|
|
96
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
+
var network;
|
|
98
|
+
return __generator(this, function (_b) {
|
|
99
|
+
network = typeof networkOrId === 'object' ? networkOrId : (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkOrId);
|
|
100
|
+
if (network === undefined) {
|
|
101
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.ETHEREUM, 'Block Explorer network type not supported.');
|
|
102
|
+
}
|
|
103
|
+
return [2 /*return*/, new EtherscanBlockExplorer_1.EtherscanBlockExplorer(network.blockExplorerUrl)];
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
EthereumModule.prototype.createV3SerializerCompanion = function () {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
109
|
+
return __generator(this, function (_a) {
|
|
110
|
+
return [2 /*return*/, new serializer_companion_1.EthereumV3SerializerCompanion()];
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
EthereumModule.prototype.createProtocol = function (identifier, network) {
|
|
47
115
|
if (identifier === coinlib_core_1.MainProtocolSymbols.ETH) {
|
|
48
|
-
return (0, EthereumProtocol_1.createEthereumProtocol)({ network });
|
|
116
|
+
return (0, EthereumProtocol_1.createEthereumProtocol)({ network: network });
|
|
49
117
|
}
|
|
50
118
|
if (ERC20Tokens_1.erc20Tokens[identifier] !== undefined) {
|
|
51
|
-
|
|
52
|
-
return (0, ERC20Token_1.createERC20Token)(tokenMetadata, { network });
|
|
119
|
+
var tokenMetadata = ERC20Tokens_1.erc20Tokens[identifier];
|
|
120
|
+
return (0, ERC20Token_1.createERC20Token)(tokenMetadata, { network: network });
|
|
53
121
|
}
|
|
54
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.ETHEREUM,
|
|
55
|
-
}
|
|
56
|
-
|
|
122
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.ETHEREUM, "Protocol ".concat(identifier, " not supported."));
|
|
123
|
+
};
|
|
124
|
+
return EthereumModule;
|
|
125
|
+
}());
|
|
57
126
|
exports.EthereumModule = EthereumModule;
|
|
58
127
|
//# sourceMappingURL=EthereumModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumModule.js","sourceRoot":"","sources":["../../../src/v1/module/EthereumModule.ts"],"names":[],"mappings":"
|
|
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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AAC,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,EAAE,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;SACpD;QAED,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,QAAQ,EAAE,mBAAY,UAAU,oBAAiB,CAAC,CAAA;IAC7F,CAAC;IACH,qBAAC;AAAD,CAAC,AApED,IAoEC;AApEY,wCAAc"}
|
package/v1/module.js
CHANGED
|
@@ -14,10 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.create =
|
|
18
|
-
|
|
17
|
+
exports.create = void 0;
|
|
18
|
+
var EthereumModule_1 = require("./module/EthereumModule");
|
|
19
19
|
__exportStar(require("./index"), exports);
|
|
20
20
|
function create() {
|
|
21
21
|
return new EthereumModule_1.EthereumModule();
|
|
22
22
|
}
|
|
23
|
+
exports.create = create;
|
|
23
24
|
//# sourceMappingURL=module.js.map
|
package/v1/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/v1/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/v1/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,0DAAwD;AAExD,0CAAuB;AAEvB,SAAgB,MAAM;IACpB,OAAO,IAAI,+BAAc,EAAE,CAAA;AAC7B,CAAC;AAFD,wBAEC"}
|