@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
|
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
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");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -92,7 +94,7 @@ var EthereumRPCData = /** @class */ (function () {
|
|
|
92
94
|
if (hash === null) {
|
|
93
95
|
return '';
|
|
94
96
|
}
|
|
95
|
-
return "0x"
|
|
97
|
+
return "0x".concat(hash.slice(2, 10));
|
|
96
98
|
};
|
|
97
99
|
EthereumRPCData.addLeadingZeroPadding = function (value, targetLength) {
|
|
98
100
|
if (targetLength === void 0) { targetLength = EthereumRPCData.parametersLength; }
|
|
@@ -117,7 +119,7 @@ exports.EthereumRPCData = EthereumRPCData;
|
|
|
117
119
|
var EthereumRPCDataBalanceOf = /** @class */ (function (_super) {
|
|
118
120
|
__extends(EthereumRPCDataBalanceOf, _super);
|
|
119
121
|
function EthereumRPCDataBalanceOf(address) {
|
|
120
|
-
var _this = _super.call(this, EthereumRPCDataBalanceOf.methodName
|
|
122
|
+
var _this = _super.call(this, "".concat(EthereumRPCDataBalanceOf.methodName, "(address)")) || this;
|
|
121
123
|
_this.address = address;
|
|
122
124
|
return _this;
|
|
123
125
|
}
|
|
@@ -135,7 +137,7 @@ exports.EthereumRPCDataBalanceOf = EthereumRPCDataBalanceOf;
|
|
|
135
137
|
var EthereumRPCDataTransfer = /** @class */ (function (_super) {
|
|
136
138
|
__extends(EthereumRPCDataTransfer, _super);
|
|
137
139
|
function EthereumRPCDataTransfer(toAddressOrData, amount) {
|
|
138
|
-
var _this = _super.call(this, EthereumRPCDataTransfer.methodName
|
|
140
|
+
var _this = _super.call(this, "".concat(EthereumRPCDataTransfer.methodName, "(address,uint256)")) || this;
|
|
139
141
|
if (amount) {
|
|
140
142
|
var toAddress = toAddressOrData;
|
|
141
143
|
_this.recipient = toAddress;
|
|
@@ -150,8 +152,8 @@ var EthereumRPCDataTransfer = /** @class */ (function (_super) {
|
|
|
150
152
|
var params = data.slice(methodID.length);
|
|
151
153
|
var recipient = EthereumRPCData.removeLeadingZeroPadding(params.slice(0, EthereumRPCData.parametersLength));
|
|
152
154
|
var parsedAmount = EthereumRPCData.removeLeadingZeroPadding(params.slice(EthereumRPCData.parametersLength));
|
|
153
|
-
_this.recipient = "0x"
|
|
154
|
-
_this.amount = "0x"
|
|
155
|
+
_this.recipient = "0x".concat(recipient);
|
|
156
|
+
_this.amount = "0x".concat(parsedAmount);
|
|
155
157
|
}
|
|
156
158
|
return _this;
|
|
157
159
|
}
|
|
@@ -323,7 +325,7 @@ var AirGapNodeClient = /** @class */ (function (_super) {
|
|
|
323
325
|
return __generator(this, function (_a) {
|
|
324
326
|
switch (_a.label) {
|
|
325
327
|
case 0: return [4 /*yield*/, axios_0_19_0_1.default.post(this.baseURL, body.toRPCBody()).catch(function (error) {
|
|
326
|
-
throw new errors_1.NetworkError(coinlib_error_1.Domain.
|
|
328
|
+
throw new errors_1.NetworkError(coinlib_error_1.Domain.ETHEREUM, error);
|
|
327
329
|
})];
|
|
328
330
|
case 1:
|
|
329
331
|
response = _a.sent();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AirGapNodeClient.js","sourceRoot":"","sources":["../../../../../src/v0/protocol/clients/node-clients/AirGapNodeClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA2D;AAC3D,oGAAsF;AACtF,gGAA8F;AAC9F,sDAA6E;AAC7E,2EAAkE;AAClE,yFAA4F;AAE5F,yEAAwD;AACxD,2CAAiD;AAEjD,2CAAiD;AAEjD;IAA8B,mCAAO;IAArC;;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,CA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AAC,CAAC,EAAA;;wBAA3F,IAAI,GAAG,CAAC,SAAmF,CAAC,CAAC,IAAI;wBAEvG,sBAAO,IAAI,EAAA;;;;KACZ;IACH,uBAAC;AAAD,CAAC,AArGD,CAAsC,+BAAkB,GAqGvD;AArGY,4CAAgB"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeClient.js","sourceRoot":"","sources":["../../../../../src/v0/protocol/clients/node-clients/NodeClient.ts"],"names":[],"mappings":";;;AAGA;IAGE,4BAAY,OAAe;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAwBH,yBAAC;AAAD,CAAC,AA7BD,IA6BC;AA7BqB,gDAAkB"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ERC20.js","sourceRoot":"","sources":["../../../../src/v0/protocol/erc20/ERC20.ts"],"names":[],"mappings":";;;AAAA,8EAA+E;AAC/E,sEAKmC;AAEnC,+CAA6C;AAE7C,IAAM,UAAU,GAAG,IAAI,2BAAY,CACjC,IAAI,sDAA4B,CAC9B,IAAI,iDAAuB,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,uDAA6B,CAAC,CAAC,CAAC,CAAC,EAC7G,IAAI,qDAA2B,CAC7B,WAAW,EACX,8BAA8B,EAC9B,OAAO,EACP,oCAAkB,CAAC,SAAS,EAC5B,4CAA4C,EAC5C,EAAE,CACH,CACF,CACF,CAAA;AAEQ,gCAAU"}
|
|
File without changes
|
|
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
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");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -14,7 +16,11 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
16
|
})();
|
|
15
17
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
18
|
if (k2 === undefined) k2 = k;
|
|
17
|
-
Object.
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
18
24
|
}) : (function(o, m, k, k2) {
|
|
19
25
|
if (k2 === undefined) k2 = k;
|
|
20
26
|
o[k2] = m[k];
|
|
@@ -292,7 +298,7 @@ var GenericERC20 = /** @class */ (function (_super) {
|
|
|
292
298
|
}
|
|
293
299
|
ethTx = ethTxs[0];
|
|
294
300
|
extractedTx = new EthereumTransaction(signedTx.transaction);
|
|
295
|
-
tokenTransferDetails = new AirGapNodeClient_1.EthereumRPCDataTransfer("0x"
|
|
301
|
+
tokenTransferDetails = new AirGapNodeClient_1.EthereumRPCDataTransfer("0x".concat(extractedTx.data.toString('hex')));
|
|
296
302
|
ethTx.to = [ethUtil.toChecksumAddress(tokenTransferDetails.recipient)];
|
|
297
303
|
ethTx.amount = new bignumber_1.default(tokenTransferDetails.amount).toString(10);
|
|
298
304
|
return [2 /*return*/, [ethTx]];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericERC20.js","sourceRoot":"","sources":["../../../../src/v0/protocol/erc20/GenericERC20.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iHAA0F;AAC1F,mGAAsF;AACtF,sDAAmF;AACnF,2EAAkE;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AM,GAAG,IAAI,mBAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;wBAEtE,sBAAO,CAAC,KAAK,CAAC,EAAA;;;;KACf;IACH,mBAAC;AAAD,CAAC,AAtMD,CAAkC,2CAAoB,GAsMrD;AAtMY,oCAAY"}
|
|
File without changes
|
|
@@ -15,7 +15,7 @@ var EthereumUtils = /** @class */ (function () {
|
|
|
15
15
|
}
|
|
16
16
|
EthereumUtils.toHex = function (value) {
|
|
17
17
|
if (EthereumUtils.isAddress(value)) {
|
|
18
|
-
return "0x"
|
|
18
|
+
return "0x".concat(value.toLowerCase().replace(/^0x/i, ''));
|
|
19
19
|
}
|
|
20
20
|
if (typeof value === 'boolean') {
|
|
21
21
|
return value ? '0x01' : '0x00';
|
|
@@ -43,7 +43,7 @@ var EthereumUtils = /** @class */ (function () {
|
|
|
43
43
|
valueInBytes = EthereumUtils.hexToBytes(value);
|
|
44
44
|
}
|
|
45
45
|
var hash = createKeccakHash('keccak256').update(valueInBytes).digest('hex');
|
|
46
|
-
var returnValue = "0x"
|
|
46
|
+
var returnValue = "0x".concat(hash);
|
|
47
47
|
if (returnValue === EthereumUtils.SHA3_NULL_S) {
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
@@ -56,17 +56,17 @@ var EthereumUtils = /** @class */ (function () {
|
|
|
56
56
|
return value;
|
|
57
57
|
}
|
|
58
58
|
if (!isFinite(Number(value)) && !EthereumUtils.isHexStrict(value)) {
|
|
59
|
-
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.UTILS, "Given input \""
|
|
59
|
+
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.UTILS, "Given input \"".concat(JSON.stringify(value), "\" is not a number."));
|
|
60
60
|
}
|
|
61
61
|
// var number = EthereumUtils.toBN(value)
|
|
62
62
|
var myNumber = new bignumber_1.BigNumber(value);
|
|
63
63
|
var result = myNumber.toString(16);
|
|
64
|
-
return myNumber.lt(new bignumber_1.BigNumber(0)) ? "-0x"
|
|
64
|
+
return myNumber.lt(new bignumber_1.BigNumber(0)) ? "-0x".concat(result.substr(1)) : "0x".concat(result);
|
|
65
65
|
};
|
|
66
66
|
EthereumUtils.hexToBytes = function (value) {
|
|
67
67
|
var hex = typeof value === 'number' ? value.toString(16) : value;
|
|
68
68
|
if (!EthereumUtils.isHexStrict(hex)) {
|
|
69
|
-
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.UTILS, "Given value \""
|
|
69
|
+
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.UTILS, "Given value \"".concat(JSON.stringify(hex), "\" is not a valid hex string."));
|
|
70
70
|
}
|
|
71
71
|
hex = hex.replace(/^0x/i, '');
|
|
72
72
|
var bytes = [];
|
|
@@ -125,9 +125,9 @@ var EthereumUtils = /** @class */ (function () {
|
|
|
125
125
|
for (var i = 0; i < str.length; i++) {
|
|
126
126
|
var code = str.charCodeAt(i);
|
|
127
127
|
var n = code.toString(16);
|
|
128
|
-
hex += n.length < 2 ? "0"
|
|
128
|
+
hex += n.length < 2 ? "0".concat(n) : n;
|
|
129
129
|
}
|
|
130
|
-
return "0x"
|
|
130
|
+
return "0x".concat(hex);
|
|
131
131
|
};
|
|
132
132
|
EthereumUtils.isObject = function (value) {
|
|
133
133
|
var type = typeof value;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/v0/protocol/utils/utils.ts"],"names":[],"mappings":";;;AAAA,gGAA8F;AAC9F,sDAA+D;AAC/D,2EAAkE;AAClE,gCAAgC;AAChC,4EAA4E;AAC5E,2CAA2C;AAC3C,IAAM,IAAI,GAAG,OAAO,CAAC,uDAAuD,CAAC,CAAA;AAC7E,IAAM,gBAAgB,GAAG,OAAO,CAAC,uDAAuD,CAAC,CAAA;AAEzF,qHAAqH;AACrH;IAAA;IAqJA,CAAC;IApJe,mBAAK,GAAnB,UAAoB,KAAU;QAC5B,IAAI,aAAa,CAAC,SA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,CAAA;QACtC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;QACrC,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACnC,IAAM,IAAI,GAAW,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;YACtC,IAAM,CAAC,GAAW,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;YACnC,GAAG,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAI,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,CAAA;SAClC;QAED,OAAO,YAAK,GAAG,CAAE,CAAA;IACnB,CAAC;IAEc,sBAAQ,GAAvB,UAAwB,KAAc;QACpC,IAAM,IAAI,GAAW,OAAO,KAAK,CAAA;QAEjC,OAAO,IAAI,KAAK,UAAU,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,CAAC,CAAA;IAC9D,CAAC;IAxHuB,yBAAW,GAAW,oEAAoE,CAAA;IAyHpH,oBAAC;CAAA,AArJD,IAqJC;AArJY,sCAAa"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/UnsignedEthereumTransaction",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"HexString": {
|
|
6
|
+
"type": "string"
|
|
7
|
+
},
|
|
8
|
+
"UnsignedEthereumTransaction": {
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {
|
|
11
|
+
"callbackURL": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"publicKey": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"transaction": {
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"properties": {
|
|
20
|
+
"chainId": {
|
|
21
|
+
"type": "number"
|
|
22
|
+
},
|
|
23
|
+
"data": {
|
|
24
|
+
"$ref": "#/definitions/HexString"
|
|
25
|
+
},
|
|
26
|
+
"gasLimit": {
|
|
27
|
+
"$ref": "#/definitions/HexString"
|
|
28
|
+
},
|
|
29
|
+
"gasPrice": {
|
|
30
|
+
"$ref": "#/definitions/HexString"
|
|
31
|
+
},
|
|
32
|
+
"nonce": {
|
|
33
|
+
"$ref": "#/definitions/HexString"
|
|
34
|
+
},
|
|
35
|
+
"to": {
|
|
36
|
+
"$ref": "#/definitions/HexString"
|
|
37
|
+
},
|
|
38
|
+
"value": {
|
|
39
|
+
"$ref": "#/definitions/HexString"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"required": ["nonce", "gasPrice", "gasLimit", "to", "value", "chainId", "data"],
|
|
43
|
+
"type": "object"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"required": ["publicKey", "transaction"],
|
|
47
|
+
"type": "object"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/SignedEthereumTransaction",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"SignedEthereumTransaction": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"accountIdentifier": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"transaction": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"required": ["accountIdentifier", "transaction"],
|
|
16
|
+
"type": "object"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/UnsignedTypedEthereumTransaction",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"HexString": {
|
|
6
|
+
"type": "string"
|
|
7
|
+
},
|
|
8
|
+
"UnsignedTypedEthereumTransaction": {
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {
|
|
11
|
+
"callbackURL": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"publicKey": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"transaction": {
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"properties": {
|
|
20
|
+
"derivationPath": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"masterFingerprint": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
},
|
|
26
|
+
"serialized": {
|
|
27
|
+
"$ref": "#/definitions/HexString"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"required": ["serialized", "derivationPath", "masterFingerprint"],
|
|
31
|
+
"type": "object"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"required": ["publicKey", "transaction"],
|
|
35
|
+
"type": "object"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/UnsignedEthereumTransaction",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"HexString": {
|
|
6
|
+
"type": "string"
|
|
7
|
+
},
|
|
8
|
+
"UnsignedEthereumTransaction": {
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {
|
|
11
|
+
"callbackURL": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"publicKey": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"transaction": {
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"properties": {
|
|
20
|
+
"chainId": {
|
|
21
|
+
"type": "number"
|
|
22
|
+
},
|
|
23
|
+
"data": {
|
|
24
|
+
"$ref": "#/definitions/HexString"
|
|
25
|
+
},
|
|
26
|
+
"gasLimit": {
|
|
27
|
+
"$ref": "#/definitions/HexString"
|
|
28
|
+
},
|
|
29
|
+
"gasPrice": {
|
|
30
|
+
"$ref": "#/definitions/HexString"
|
|
31
|
+
},
|
|
32
|
+
"nonce": {
|
|
33
|
+
"$ref": "#/definitions/HexString"
|
|
34
|
+
},
|
|
35
|
+
"to": {
|
|
36
|
+
"$ref": "#/definitions/HexString"
|
|
37
|
+
},
|
|
38
|
+
"value": {
|
|
39
|
+
"$ref": "#/definitions/HexString"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"required": ["nonce", "gasPrice", "gasLimit", "to", "value", "chainId", "data"],
|
|
43
|
+
"type": "object"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"required": ["publicKey", "transaction"],
|
|
47
|
+
"type": "object"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/SignedEthereumTransaction",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"SignedEthereumTransaction": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"accountIdentifier": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"transaction": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"required": ["accountIdentifier", "transaction"],
|
|
16
|
+
"type": "object"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TransactionValidator, TransactionValidatorFactory, TransactionValidatorFactoryV2, TransactionValidatorV2 } from '@airgap/serializer';
|
|
2
|
+
import { SignedEthereumTransaction } from '../../types/signed-transaction-ethereum';
|
|
3
|
+
import { UnsignedEthereumTransaction } from '../../types/unsigned-transaction-ethereum';
|
|
4
|
+
export declare class EthereumTransactionValidator implements TransactionValidator, TransactionValidatorV2 {
|
|
5
|
+
private readonly version;
|
|
6
|
+
constructor(version?: 'v2' | 'v3');
|
|
7
|
+
validateUnsignedTransaction(unsignedTx: UnsignedEthereumTransaction): Promise<any>;
|
|
8
|
+
validateSignedTransaction(signedTx: SignedEthereumTransaction): any;
|
|
9
|
+
}
|
|
10
|
+
export declare class EthereumTransactionValidatorFactory implements TransactionValidatorFactory<EthereumTransactionValidator> {
|
|
11
|
+
create(): EthereumTransactionValidator;
|
|
12
|
+
}
|
|
13
|
+
export declare class EthereumTransactionValidatorFactoryV2 implements TransactionValidatorFactoryV2<EthereumTransactionValidator> {
|
|
14
|
+
create(): EthereumTransactionValidator;
|
|
15
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EthereumTransactionValidatorFactoryV2 = exports.EthereumTransactionValidatorFactory = exports.EthereumTransactionValidator = void 0;
|
|
4
|
+
// tslint:disable: max-classes-per-file
|
|
5
|
+
var validate_1 = require("@airgap/coinlib-core/dependencies/src/validate.js-0.13.1/validate");
|
|
6
|
+
var serializer_1 = require("@airgap/serializer");
|
|
7
|
+
var unsignedTransactionConstraints = {
|
|
8
|
+
nonce: {
|
|
9
|
+
presence: { allowEmpty: false },
|
|
10
|
+
type: 'String',
|
|
11
|
+
isHexStringWithPrefix: true
|
|
12
|
+
},
|
|
13
|
+
gasPrice: {
|
|
14
|
+
presence: { allowEmpty: false },
|
|
15
|
+
type: 'String',
|
|
16
|
+
isHexStringWithPrefix: true
|
|
17
|
+
},
|
|
18
|
+
gasLimit: {
|
|
19
|
+
presence: { allowEmpty: false },
|
|
20
|
+
type: 'String',
|
|
21
|
+
isHexStringWithPrefix: true
|
|
22
|
+
},
|
|
23
|
+
to: {
|
|
24
|
+
presence: { allowEmpty: false },
|
|
25
|
+
type: 'String',
|
|
26
|
+
isHexStringWithPrefix: true,
|
|
27
|
+
format: {
|
|
28
|
+
pattern: '^0x[a-fA-F0-9]{40}$',
|
|
29
|
+
flags: 'i',
|
|
30
|
+
message: 'is not a valid ethereum address'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
value: {
|
|
34
|
+
presence: { allowEmpty: false },
|
|
35
|
+
type: 'String',
|
|
36
|
+
isHexStringWithPrefix: true
|
|
37
|
+
},
|
|
38
|
+
chainId: {
|
|
39
|
+
presence: { allowEmpty: false },
|
|
40
|
+
numericality: { noStrings: true, onlyInteger: true, greaterThanOrEqualTo: 0 }
|
|
41
|
+
},
|
|
42
|
+
data: {
|
|
43
|
+
presence: { allowEmpty: false },
|
|
44
|
+
type: 'String',
|
|
45
|
+
isHexStringWithPrefix: true
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var signedTransactionConstraints = {
|
|
49
|
+
transaction: {
|
|
50
|
+
presence: { allowEmpty: false },
|
|
51
|
+
type: 'String',
|
|
52
|
+
isValidEthereumTransactionString: true
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var success = function () { return undefined; };
|
|
56
|
+
var error = function (errors) { return errors; };
|
|
57
|
+
var EthereumTransactionValidator = /** @class */ (function () {
|
|
58
|
+
function EthereumTransactionValidator(version) {
|
|
59
|
+
if (version === void 0) { version = 'v3'; }
|
|
60
|
+
this.version = version;
|
|
61
|
+
}
|
|
62
|
+
EthereumTransactionValidator.prototype.validateUnsignedTransaction = function (unsignedTx) {
|
|
63
|
+
var rawTx = unsignedTx.transaction;
|
|
64
|
+
if (this.version === 'v3') {
|
|
65
|
+
(0, serializer_1.validateSyncScheme)({});
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
(0, serializer_1.validateSyncSchemeV2)({});
|
|
69
|
+
}
|
|
70
|
+
return (0, validate_1.async)(rawTx, unsignedTransactionConstraints).then(success, error);
|
|
71
|
+
};
|
|
72
|
+
EthereumTransactionValidator.prototype.validateSignedTransaction = function (signedTx) {
|
|
73
|
+
return (0, validate_1.async)(signedTx, signedTransactionConstraints).then(success, error);
|
|
74
|
+
};
|
|
75
|
+
return EthereumTransactionValidator;
|
|
76
|
+
}());
|
|
77
|
+
exports.EthereumTransactionValidator = EthereumTransactionValidator;
|
|
78
|
+
var EthereumTransactionValidatorFactory = /** @class */ (function () {
|
|
79
|
+
function EthereumTransactionValidatorFactory() {
|
|
80
|
+
}
|
|
81
|
+
EthereumTransactionValidatorFactory.prototype.create = function () {
|
|
82
|
+
return new EthereumTransactionValidator('v3');
|
|
83
|
+
};
|
|
84
|
+
return EthereumTransactionValidatorFactory;
|
|
85
|
+
}());
|
|
86
|
+
exports.EthereumTransactionValidatorFactory = EthereumTransactionValidatorFactory;
|
|
87
|
+
var EthereumTransactionValidatorFactoryV2 = /** @class */ (function () {
|
|
88
|
+
function EthereumTransactionValidatorFactoryV2() {
|
|
89
|
+
}
|
|
90
|
+
EthereumTransactionValidatorFactoryV2.prototype.create = function () {
|
|
91
|
+
return new EthereumTransactionValidator('v2');
|
|
92
|
+
};
|
|
93
|
+
return EthereumTransactionValidatorFactoryV2;
|
|
94
|
+
}());
|
|
95
|
+
exports.EthereumTransactionValidatorFactoryV2 = EthereumTransactionValidatorFactoryV2;
|
|
96
|
+
//# sourceMappingURL=transaction-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../src/v0/serializer/validators/transaction-validator.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,8FAAyF;AACzF,iDAO2B;AAK3B,IAAM,8BAA8B,GAAG;IACrC,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE,UAAU,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,MAAM,IAAK,OAAA,MAAM,EAAN,CAAM,CAAA;AAEhC;IACE,sCAA6B,OAA2B;QAA3B,wBAAA,EAAA,cAA2B;QAA3B,YAAO,GAAP,OAAO,CAAoB;IAAG,CAAC;IAErD,kEAA2B,GAAlC,UAAmC,UAAuC;QACxE,IAAM,KAAK,GAA2B,UAAU,CAAC,WAAW,CAAA;QAE5D,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE;YACzB,IAAA,+BAAkB,EAAC,EAAE,CAAC,CAAA;SACvB;aAAM;YACL,IAAA,iCAAoB,EAAC,EAAE,CAAC,CAAA;SACzB;QAED,OAAO,IAAA,gBAAK,EAAC,KAAK,EAAE,8BAA8B,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAC1E,CAAC;IACM,gEAAyB,GAAhC,UAAiC,QAAmC;QAClE,OAAO,IAAA,gBAAK,EAAC,QAAQ,EAAE,4BAA4B,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAC3E,CAAC;IACH,mCAAC;AAAD,CAAC,AAjBD,IAiBC;AAjBY,oEAA4B;AAmBzC;IAAA;IAIA,CAAC;IAHQ,oDAAM,GAAb;QACE,OAAO,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAA;IAC/C,CAAC;IACH,0CAAC;AAAD,CAAC,AAJD,IAIC;AAJY,kFAAmC;AAMhD;IAAA;IAIA,CAAC;IAHQ,sDAAM,GAAb;QACE,OAAO,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAA;IAC/C,CAAC;IACH,4CAAC;AAAD,CAAC,AAJD,IAIC;AAJY,sFAAqC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
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
|
+
var validate_1 = require("@airgap/coinlib-core/dependencies/src/validate.js-0.13.1/validate");
|
|
40
|
+
var EthereumProtocol_1 = require("../../protocol/EthereumProtocol");
|
|
41
|
+
validate_1.validators.isValidEthereumTransactionString = function (transaction) {
|
|
42
|
+
// console.log(binaryTransaction)
|
|
43
|
+
return new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
|
|
44
|
+
var signedTx, protocol, error_1;
|
|
45
|
+
return __generator(this, function (_a) {
|
|
46
|
+
switch (_a.label) {
|
|
47
|
+
case 0:
|
|
48
|
+
if (transaction === null || typeof transaction === 'undefined') {
|
|
49
|
+
reject('not a valid Ethereum transaction');
|
|
50
|
+
}
|
|
51
|
+
signedTx = {
|
|
52
|
+
accountIdentifier: '',
|
|
53
|
+
transaction: transaction
|
|
54
|
+
};
|
|
55
|
+
protocol = new EthereumProtocol_1.EthereumProtocol();
|
|
56
|
+
// allow empty values by default (needs to be checked by "presence" check)
|
|
57
|
+
if (transaction === null || typeof transaction === 'undefined') {
|
|
58
|
+
reject();
|
|
59
|
+
}
|
|
60
|
+
_a.label = 1;
|
|
61
|
+
case 1:
|
|
62
|
+
_a.trys.push([1, 3, , 4]);
|
|
63
|
+
return [4 /*yield*/, protocol.getTransactionDetailsFromSigned(signedTx)];
|
|
64
|
+
case 2:
|
|
65
|
+
_a.sent();
|
|
66
|
+
resolve();
|
|
67
|
+
return [3 /*break*/, 4];
|
|
68
|
+
case 3:
|
|
69
|
+
error_1 = _a.sent();
|
|
70
|
+
// console.log(error)
|
|
71
|
+
reject('not a valid Ethereum transaction');
|
|
72
|
+
return [3 /*break*/, 4];
|
|
73
|
+
case 4: return [2 /*return*/];
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}); });
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../../src/v0/serializer/validators/validators.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA8F;AAE9F,oEAAkE;AAGlE,qBAAU,CAAC,gCAAgC,GAAG,UAAC,WAAmB;IAChE,iCAAiC;IACjC,OAAO,IAAI,OAAO,CAAO,UAAO,OAAO,EAAE,MAAM;;;;;oBAC7C,IAAI,WAAW,KAAK,IAAI,IAAI,OAAO,WAAW,KAAK,WAAW,EAAE;wBAC9D,MAAM,CAAC,kCAAkC,CAAC,CAAA;qBAC3C;oBACK,QAAQ,GAA8B;wBAC1C,iBAAiB,EAAE,EAAE;wBACrB,WAAW,aAAA;qBACZ,CAAA;oBACK,QAAQ,GAAG,IAAI,mCAAgB,EAAE,CAAA;oBACvC,0EAA0E;oBAC1E,IAAI,WAAW,KAAK,IAAI,IAAI,OAAO,WAAW,KAAK,WAAW,EAAE;wBAC9D,MAAM,EAAE,CAAA;qBACT;;;;oBAEC,qBAAM,QAAQ,CAAC,+BAA+B,CAAC,QAAQ,CAAC,EAAA;;oBAAxD,SAAwD,CAAA;oBACxD,OAAO,EAAE,CAAA;;;;oBAET,qBAAqB;oBACrB,MAAM,CAAC,kCAAkC,CAAC,CAAA;;;;;SAE7C,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signed-transaction-ethereum.js","sourceRoot":"","sources":["../../../src/v0/types/signed-transaction-ethereum.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-ethereum.js","sourceRoot":"","sources":["../../../src/v0/types/transaction-ethereum.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TransactionSignRequest, TransactionSignRequestV2 } from '@airgap/serializer';
|
|
2
|
+
import { HexString } from '@airgap/serializer/v3/schemas/definitions/hex-string';
|
|
3
|
+
interface RawTypedEthereumTransaction {
|
|
4
|
+
serialized: HexString;
|
|
5
|
+
derivationPath: string;
|
|
6
|
+
masterFingerprint: string;
|
|
7
|
+
}
|
|
8
|
+
export interface UnsignedTypedEthereumTransaction extends TransactionSignRequest, TransactionSignRequestV2 {
|
|
9
|
+
transaction: RawTypedEthereumTransaction;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
File without changes
|