@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,4 +1,19 @@
|
|
|
1
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
|
+
})();
|
|
2
17
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
18
|
if (k2 === undefined) k2 = k;
|
|
4
19
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -15,78 +30,118 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
30
|
}) : function(o, v) {
|
|
16
31
|
o["default"] = v;
|
|
17
32
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
return function (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
41
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
42
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
43
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
44
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
45
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
46
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
50
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
51
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
52
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
53
|
+
function step(op) {
|
|
54
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
55
|
+
while (_) try {
|
|
56
|
+
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;
|
|
57
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
58
|
+
switch (op[0]) {
|
|
59
|
+
case 0: case 1: t = op; break;
|
|
60
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
61
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
62
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
63
|
+
default:
|
|
64
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
65
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
66
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
67
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
68
|
+
if (t[2]) _.ops.pop();
|
|
69
|
+
_.trys.pop(); continue;
|
|
70
|
+
}
|
|
71
|
+
op = body.call(thisArg, _);
|
|
72
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
73
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
74
|
+
}
|
|
75
|
+
};
|
|
35
76
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
77
|
exports.EthereumCryptoClient = void 0;
|
|
37
78
|
// @ts-ignore
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
const privateKey = Buffer.from(keypair.privateKey, 'hex');
|
|
52
|
-
try {
|
|
53
|
-
try {
|
|
54
|
-
// v4 data supports arrays in the structure
|
|
55
|
-
const msgParams = JSON.parse(message); // TODO types
|
|
56
|
-
return (0, eth_sig_util_1.signTypedData)({ privateKey, data: msgParams, version: eth_sig_util_1.SignTypedDataVersion.V4 });
|
|
57
|
-
}
|
|
58
|
-
catch (e) { }
|
|
59
|
-
try {
|
|
60
|
-
// v3 does not support arrays in the structure
|
|
61
|
-
const msgParams = JSON.parse(message); // TODO types
|
|
62
|
-
return (0, eth_sig_util_1.signTypedData)({ privateKey, data: msgParams, version: eth_sig_util_1.SignTypedDataVersion.V3 });
|
|
63
|
-
}
|
|
64
|
-
catch (e) { }
|
|
65
|
-
// v1 has a different structure than v3 and v4, it is an array
|
|
66
|
-
const msgParams = JSON.parse(message);
|
|
67
|
-
return (0, eth_sig_util_1.signTypedData)({ privateKey, data: msgParams, version: eth_sig_util_1.SignTypedDataVersion.V1 });
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
const messageBuffer = EthereumJSUtils.hashPersonalMessage(EthereumJSUtils.toBuffer(message));
|
|
71
|
-
const signature = EthereumJSUtils.ecsign(messageBuffer, privateKey);
|
|
72
|
-
return EthereumJSUtils.toRpcSig(signature.v, signature.r, signature.s);
|
|
73
|
-
}
|
|
79
|
+
var EthereumJSUtils = __importStar(require("@airgap/coinlib-core/dependencies/src/ethereumjs-util-5.2.0"));
|
|
80
|
+
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
81
|
+
var coinlib_error_1 = require("@airgap/coinlib-core/errors/coinlib-error");
|
|
82
|
+
var Secp256k1CryptoClient_1 = require("@airgap/coinlib-core/protocols/Secp256k1CryptoClient");
|
|
83
|
+
var hex_1 = require("@airgap/coinlib-core/utils/hex");
|
|
84
|
+
var module_kit_1 = require("@airgap/module-kit");
|
|
85
|
+
var eth_sig_util_1 = require("@metamask/eth-sig-util");
|
|
86
|
+
var EthereumAddress_1 = require("../../data/EthereumAddress");
|
|
87
|
+
var EthereumCryptoClient = /** @class */ (function (_super) {
|
|
88
|
+
__extends(EthereumCryptoClient, _super);
|
|
89
|
+
function EthereumCryptoClient() {
|
|
90
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
74
91
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
EthereumCryptoClient.prototype.signMessage = function (message, keypair) {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
+
var privateKey, msgParams_1, msgParams_2, msgParams, messageBuffer, signature;
|
|
95
|
+
return __generator(this, function (_a) {
|
|
96
|
+
if (!keypair.privateKey) {
|
|
97
|
+
throw new errors_1.NotFoundError(coinlib_error_1.Domain.ETHEREUM, "Private key not provided");
|
|
98
|
+
}
|
|
99
|
+
privateKey = Buffer.from(keypair.privateKey, 'hex');
|
|
100
|
+
try {
|
|
101
|
+
try {
|
|
102
|
+
msgParams_1 = JSON.parse(message) // TODO types
|
|
103
|
+
;
|
|
104
|
+
return [2 /*return*/, (0, eth_sig_util_1.signTypedData)({ privateKey: privateKey, data: msgParams_1, version: eth_sig_util_1.SignTypedDataVersion.V4 })];
|
|
105
|
+
}
|
|
106
|
+
catch (e) { }
|
|
107
|
+
try {
|
|
108
|
+
msgParams_2 = JSON.parse(message) // TODO types
|
|
109
|
+
;
|
|
110
|
+
return [2 /*return*/, (0, eth_sig_util_1.signTypedData)({ privateKey: privateKey, data: msgParams_2, version: eth_sig_util_1.SignTypedDataVersion.V3 })];
|
|
111
|
+
}
|
|
112
|
+
catch (e) { }
|
|
113
|
+
msgParams = JSON.parse(message);
|
|
114
|
+
return [2 /*return*/, (0, eth_sig_util_1.signTypedData)({ privateKey: privateKey, data: msgParams, version: eth_sig_util_1.SignTypedDataVersion.V1 })];
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
messageBuffer = EthereumJSUtils.hashPersonalMessage(EthereumJSUtils.toBuffer(message));
|
|
118
|
+
signature = EthereumJSUtils.ecsign(messageBuffer, privateKey);
|
|
119
|
+
return [2 /*return*/, EthereumJSUtils.toRpcSig(signature.v, signature.r, signature.s)];
|
|
120
|
+
}
|
|
121
|
+
return [2 /*return*/];
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
EthereumCryptoClient.prototype.verifyMessage = function (message, signature, publicKey) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
127
|
+
var msgBuffer, msgHash, signatureBuffer, signatureParams, recoveredPublicKey, recoveredAddressBuffer, recoveredAddress, hexPublicKey, address;
|
|
128
|
+
return __generator(this, function (_a) {
|
|
129
|
+
msgBuffer = EthereumJSUtils.toBuffer(message);
|
|
130
|
+
msgHash = EthereumJSUtils.hashPersonalMessage(msgBuffer);
|
|
131
|
+
signatureBuffer = EthereumJSUtils.toBuffer(signature);
|
|
132
|
+
signatureParams = EthereumJSUtils.fromRpcSig(signatureBuffer);
|
|
133
|
+
recoveredPublicKey = EthereumJSUtils.ecrecover(msgHash, signatureParams.v, signatureParams.r, signatureParams.s);
|
|
134
|
+
recoveredAddressBuffer = EthereumJSUtils.publicToAddress(recoveredPublicKey);
|
|
135
|
+
recoveredAddress = EthereumJSUtils.bufferToHex(recoveredAddressBuffer);
|
|
136
|
+
hexPublicKey = (0, hex_1.isHex)(publicKey)
|
|
137
|
+
? (0, module_kit_1.newPublicKey)(publicKey, 'hex')
|
|
138
|
+
: (0, module_kit_1.newExtendedPublicKey)(publicKey, 'encoded');
|
|
139
|
+
address = EthereumAddress_1.EthereumAddress.from(hexPublicKey);
|
|
140
|
+
return [2 /*return*/, recoveredAddress.toLowerCase() === address.asString().toLowerCase()];
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
return EthereumCryptoClient;
|
|
145
|
+
}(Secp256k1CryptoClient_1.Secp256k1CryptoClient));
|
|
91
146
|
exports.EthereumCryptoClient = EthereumCryptoClient;
|
|
92
147
|
//# sourceMappingURL=EthereumCryptoClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumCryptoClient.js","sourceRoot":"","sources":["../../../../src/v1/clients/crypto/EthereumCryptoClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumCryptoClient.js","sourceRoot":"","sources":["../../../../src/v1/clients/crypto/EthereumCryptoClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,aAAa;AACb,2GAA8F;AAC9F,sDAA2D;AAC3D,2EAAkE;AAClE,8FAA4F;AAC5F,sDAAsD;AACtD,iDAAqG;AACrG,uDAAuG;AAEvG,8DAA4D;AAE5D;IAA0C,wCAAqB;IAA/D;;IAgDA,CAAC;IA/Cc,0CAAW,GAAxB,UAAyB,OAAe,EAAE,OAA+B;;;;gBACvE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;oBACvB,MAAM,IAAI,sBAAa,CAAC,sBAAM,CAAC,QAAQ,EAAE,0BAA0B,CAAC,CAAA;iBACrE;gBAEK,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;gBAEzD,IAAI;oBACF,IAAI;wBAEI,cAAY,IAAI,CAAC,KAAK,CAAC,OAAO,CAAsB,CAAC,aAAa;wBAAd,CAAA;wBAC1D,sBAAO,IAAA,4BAAa,EAAC,EAAE,UAAU,YAAA,EAAE,IAAI,EAAE,WAAS,EAAE,OAAO,EAAE,mCAAoB,CAAC,EAAE,EAAE,CAAC,EAAA;qBACxF;oBAAC,OAAO,CAAC,EAAE,GAAE;oBACd,IAAI;wBAEI,cAAY,IAAI,CAAC,KAAK,CAAC,OAAO,CAAsB,CAAC,aAAa;wBAAd,CAAA;wBAC1D,sBAAO,IAAA,4BAA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W,CAAC,sBAAsB,CAAC,CAAA;gBAG9E,YAAY,GAAkC,IAAA,WAAK,EAAC,SAAS,CAAC;oBAClE,CAAC,CAAC,IAAA,yBAAY,EAAC,SAAS,EAAE,KAAK,CAAC;oBAChC,CAAC,CAAC,IAAA,iCAAoB,EAAC,SAAS,EAAE,SAAS,CAAC,CAAA;gBACxC,OAAO,GAAoB,iCAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;gBAEnE,sBAAO,gBAAgB,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,EAAA;;;KAC3E;IACH,2BAAC;AAAD,CAAC,AAhDD,CAA0C,6CAAqB,GAgD9D;AAhDY,oDAAoB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AirGapTransaction } from '@airgap/module-kit';
|
|
2
2
|
import { EthereumTransactionCursor } from '../../types/transaction';
|
|
3
|
-
export type EthereumInfoClientTransaction = Omit<AirGapTransaction, 'network'>;
|
|
3
|
+
export declare type EthereumInfoClientTransaction = Omit<AirGapTransaction, 'network'>;
|
|
4
4
|
export interface EthereumInfoClientTransactionsResult {
|
|
5
5
|
transactions: EthereumInfoClientTransaction[];
|
|
6
6
|
cursor: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EthereumInfoClient = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
var EthereumInfoClient = /** @class */ (function () {
|
|
5
|
+
function EthereumInfoClient(baseURL) {
|
|
6
6
|
this.baseURL = baseURL;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
return EthereumInfoClient;
|
|
9
|
+
}());
|
|
9
10
|
exports.EthereumInfoClient = EthereumInfoClient;
|
|
10
11
|
//# sourceMappingURL=EthereumInfoClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumInfoClient.js","sourceRoot":"","sources":["../../../../src/v1/clients/info/EthereumInfoClient.ts"],"names":[],"mappings":";;;AAYA
|
|
1
|
+
{"version":3,"file":"EthereumInfoClient.js","sourceRoot":"","sources":["../../../../src/v1/clients/info/EthereumInfoClient.ts"],"names":[],"mappings":";;;AAYA;IAGE,4BAAY,OAAe;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAaH,yBAAC;AAAD,CAAC,AAlBD,IAkBC;AAlBqB,gDAAkB"}
|
|
@@ -1,95 +1,173 @@
|
|
|
1
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
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;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
2
53
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
54
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
55
|
};
|
|
5
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
57
|
exports.EtherscanInfoClient = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
58
|
+
var axios_0_19_0_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/axios-0.19.0"));
|
|
59
|
+
var bignumber_1 = require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber");
|
|
60
|
+
var validate_1 = require("@airgap/coinlib-core/dependencies/src/validate.js-0.13.1/validate");
|
|
61
|
+
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
62
|
+
var coinlib_error_1 = require("@airgap/coinlib-core/errors/coinlib-error");
|
|
63
|
+
var module_kit_1 = require("@airgap/module-kit");
|
|
64
|
+
var EthereumInfoClient_1 = require("./EthereumInfoClient");
|
|
65
|
+
var EtherscanInfoClient = /** @class */ (function (_super) {
|
|
66
|
+
__extends(EtherscanInfoClient, _super);
|
|
67
|
+
function EtherscanInfoClient(baseURL, apiKey) {
|
|
68
|
+
var _this = _super.call(this, baseURL) || this;
|
|
69
|
+
_this.apiKey = apiKey;
|
|
70
|
+
return _this;
|
|
18
71
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
72
|
+
EtherscanInfoClient.prototype.fetchTransactions = function (address, limit, cursor) {
|
|
73
|
+
var _a;
|
|
74
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
75
|
+
var airGapTransactions, page, url, response, transactionResponse, transactions, _i, transactions_1, transaction, fee, airGapTransaction;
|
|
76
|
+
return __generator(this, function (_b) {
|
|
77
|
+
switch (_b.label) {
|
|
78
|
+
case 0:
|
|
79
|
+
airGapTransactions = [];
|
|
80
|
+
page = (_a = cursor === null || cursor === void 0 ? void 0 : cursor.page) !== null && _a !== void 0 ? _a : 1;
|
|
81
|
+
url = "".concat(this.baseURL, "?module=account&action=txlist&address=").concat(address, "&page=").concat(page, "&offset=").concat(limit, "&sort=desc");
|
|
82
|
+
if (this.apiKey) {
|
|
83
|
+
url += "&apiKey=".concat(this.apiKey);
|
|
84
|
+
}
|
|
85
|
+
return [4 /*yield*/, axios_0_19_0_1.default.get(url)];
|
|
86
|
+
case 1:
|
|
87
|
+
response = _b.sent();
|
|
88
|
+
transactionResponse = response.data;
|
|
89
|
+
transactions = transactionResponse.result;
|
|
90
|
+
if (transactionResponse.status === '0' && (transactions === undefined || !(0, validate_1.isArray)(transactions))) {
|
|
91
|
+
throw new errors_1.NetworkError(coinlib_error_1.Domain.ETHEREUM, { response: response });
|
|
92
|
+
}
|
|
93
|
+
for (_i = 0, transactions_1 = transactions; _i < transactions_1.length; _i++) {
|
|
94
|
+
transaction = transactions_1[_i];
|
|
95
|
+
fee = new bignumber_1.BigNumber(transaction.gas).times(new bignumber_1.BigNumber(transaction.gasPrice));
|
|
96
|
+
airGapTransaction = {
|
|
97
|
+
from: [transaction.from],
|
|
98
|
+
to: [transaction.to],
|
|
99
|
+
isInbound: transaction.to.toLowerCase() === address.toLowerCase(),
|
|
100
|
+
amount: (0, module_kit_1.newAmount)(new bignumber_1.BigNumber(transaction.value), 'blockchain'),
|
|
101
|
+
fee: (0, module_kit_1.newAmount)(fee, 'blockchain'),
|
|
102
|
+
timestamp: parseInt(transaction.timeStamp, 10),
|
|
103
|
+
status: {
|
|
104
|
+
type: transaction.txreceipt_status === undefined || transaction.txreceipt_status === '1' ? 'applied' : 'failed',
|
|
105
|
+
hash: transaction.hash,
|
|
106
|
+
block: new bignumber_1.BigNumber(transaction.blockNumber).toString(10)
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
airGapTransactions.push(airGapTransaction);
|
|
110
|
+
}
|
|
111
|
+
return [2 /*return*/, {
|
|
112
|
+
transactions: airGapTransactions,
|
|
113
|
+
cursor: {
|
|
114
|
+
page: page + 1
|
|
115
|
+
}
|
|
116
|
+
}];
|
|
45
117
|
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
EtherscanInfoClient.prototype.fetchContractTransactions = function (contractAddress, address, limit, cursor) {
|
|
122
|
+
var _a;
|
|
123
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
124
|
+
var airGapTransactions, page, url, response, transactionResponse, transactions, _i, transactions_2, transaction, fee, airGapTransaction;
|
|
125
|
+
return __generator(this, function (_b) {
|
|
126
|
+
switch (_b.label) {
|
|
127
|
+
case 0:
|
|
128
|
+
airGapTransactions = [];
|
|
129
|
+
page = (_a = cursor === null || cursor === void 0 ? void 0 : cursor.page) !== null && _a !== void 0 ? _a : 1;
|
|
130
|
+
url = "".concat(this.baseURL, "?module=account&action=tokentx&address=").concat(address, "&contractAddress=").concat(contractAddress, "&page=").concat(page, "&offset=").concat(limit, "&sort=desc");
|
|
131
|
+
if (this.apiKey) {
|
|
132
|
+
url += "&apiKey=".concat(this.apiKey);
|
|
133
|
+
}
|
|
134
|
+
return [4 /*yield*/, axios_0_19_0_1.default.get(url)];
|
|
135
|
+
case 1:
|
|
136
|
+
response = _b.sent();
|
|
137
|
+
transactionResponse = response.data;
|
|
138
|
+
transactions = transactionResponse.result;
|
|
139
|
+
if (transactionResponse.status === '0' && (transactions === undefined || !(0, validate_1.isArray)(transactions))) {
|
|
140
|
+
throw new errors_1.NetworkError(coinlib_error_1.Domain.ETHEREUM, { response: response });
|
|
141
|
+
}
|
|
142
|
+
for (_i = 0, transactions_2 = transactions; _i < transactions_2.length; _i++) {
|
|
143
|
+
transaction = transactions_2[_i];
|
|
144
|
+
fee = new bignumber_1.BigNumber(transaction.gas).times(new bignumber_1.BigNumber(transaction.gasPrice));
|
|
145
|
+
airGapTransaction = {
|
|
146
|
+
from: [transaction.from],
|
|
147
|
+
to: [transaction.to],
|
|
148
|
+
isInbound: transaction.to.toLowerCase() === address.toLowerCase(),
|
|
149
|
+
amount: (0, module_kit_1.newAmount)(new bignumber_1.BigNumber(transaction.value), 'blockchain'),
|
|
150
|
+
fee: (0, module_kit_1.newAmount)(fee, 'blockchain'),
|
|
151
|
+
timestamp: parseInt(transaction.timeStamp, 10),
|
|
152
|
+
status: {
|
|
153
|
+
type: transaction.txreceipt_status === undefined || transaction.txreceipt_status === '1' ? 'applied' : 'failed',
|
|
154
|
+
hash: transaction.hash,
|
|
155
|
+
block: transaction.blockNumber
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
airGapTransactions.push(airGapTransaction);
|
|
159
|
+
}
|
|
160
|
+
return [2 /*return*/, {
|
|
161
|
+
transactions: airGapTransactions,
|
|
162
|
+
cursor: {
|
|
163
|
+
page: page + 1
|
|
164
|
+
}
|
|
165
|
+
}];
|
|
82
166
|
}
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
cursor: {
|
|
89
|
-
page: page + 1
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
return EtherscanInfoClient;
|
|
171
|
+
}(EthereumInfoClient_1.EthereumInfoClient));
|
|
94
172
|
exports.EtherscanInfoClient = EtherscanInfoClient;
|
|
95
173
|
//# sourceMappingURL=EtherscanInfoClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EtherscanInfoClient.js","sourceRoot":"","sources":["../../../../src/v1/clients/info/EtherscanInfoClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EtherscanInfoClient.js","sourceRoot":"","sources":["../../../../src/v1/clients/info/EtherscanInfoClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oGAAsE;AACtE,gGAA8F;AAC9F,8FAA2F;AAC3F,sDAA0D;AAC1D,2EAAkE;AAClE,iDAA8C;AAI9C,2DAA8H;AAE9H;IAAyC,uCAAkB;IACzD,6BAAY,OAAe,EAAmB,MAAe;QAA7D,YACE,kBAAM,OAAO,CAAC,SACf;QAF6C,YAAM,GAAN,MAAM,CAAS;;IAE7D,CAAC;IAEY,+CAAiB,GAA9B,UACE,OAAe,EACf,KAAU,EACV,MAAkC;;;;;;;wBAE5B,kBAAkB,GAAoC,EAAE,CAAA;wBAExD,IAAI,GAAW,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,mCAAI,CAAC,CAAA;wBAClC,GAAG,GAAW,UAAG,IAAI,CAAC,OAAO,mDAAyC,OAAO,mBAAS,IA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 -43,8 +43,8 @@ export declare class EthereumRPCDataTransfer extends EthereumRPCData {
|
|
|
43
43
|
}
|
|
44
44
|
export declare class HttpEthereumNodeClient implements EthereumNodeClient {
|
|
45
45
|
protected readonly baseURL: string;
|
|
46
|
-
protected readonly headers?: any
|
|
47
|
-
constructor(baseURL: string, headers?: any
|
|
46
|
+
protected readonly headers?: any;
|
|
47
|
+
constructor(baseURL: string, headers?: any);
|
|
48
48
|
fetchBalance(address: string): Promise<BigNumber>;
|
|
49
49
|
fetchTransactionCount(address: string): Promise<number>;
|
|
50
50
|
sendSignedTransaction(transaction: string): Promise<string>;
|