@airgap/ethereum 0.13.45-beta.1 → 0.13.45-beta.3
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 +0 -1
- package/v0/protocol/BaseEthereumProtocol.js +460 -872
- package/v0/protocol/BaseEthereumProtocol.js.map +1 -1
- package/v0/protocol/EthereumAddress.d.ts +0 -1
- package/v0/protocol/EthereumAddress.js +26 -17
- package/v0/protocol/EthereumAddress.js.map +1 -1
- package/v0/protocol/EthereumClassicProtocol.js +6 -23
- package/v0/protocol/EthereumClassicProtocol.js.map +1 -1
- package/v0/protocol/EthereumCryptoClient.js +66 -125
- package/v0/protocol/EthereumCryptoClient.js.map +1 -1
- package/v0/protocol/EthereumProtocol.js +9 -28
- package/v0/protocol/EthereumProtocol.js.map +1 -1
- package/v0/protocol/EthereumProtocolOptions.d.ts +1 -1
- package/v0/protocol/EthereumProtocolOptions.js +36 -117
- package/v0/protocol/EthereumProtocolOptions.js.map +1 -1
- package/v0/protocol/EthereumRopstenProtocol.js +6 -23
- package/v0/protocol/EthereumRopstenProtocol.js.map +1 -1
- package/v0/protocol/clients/info-clients/EtherscanInfoClient.js +86 -186
- package/v0/protocol/clients/info-clients/EtherscanInfoClient.js.map +1 -1
- package/v0/protocol/clients/info-clients/InfoClient.js +3 -4
- package/v0/protocol/clients/info-clients/InfoClient.js.map +1 -1
- package/v0/protocol/clients/node-clients/AirGapNodeClient.js +126 -298
- package/v0/protocol/clients/node-clients/AirGapNodeClient.js.map +1 -1
- package/v0/protocol/clients/node-clients/NodeClient.js +3 -4
- 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 +161 -300
- package/v0/protocol/erc20/GenericERC20.js.map +1 -1
- package/v0/protocol/utils/utils.js +52 -55
- package/v0/protocol/utils/utils.js.map +1 -1
- package/v0/serializer/validators/transaction-validator.js +23 -31
- package/v0/serializer/validators/transaction-validator.js.map +1 -1
- package/v0/serializer/validators/validators.js +25 -73
- package/v0/serializer/validators/validators.js.map +1 -1
- package/v1/block-explorer/EtherscanBlockExplorer.js +12 -61
- package/v1/block-explorer/EtherscanBlockExplorer.js.map +1 -1
- package/v1/clients/crypto/EthereumCryptoClient.js +69 -124
- package/v1/clients/crypto/EthereumCryptoClient.js.map +1 -1
- package/v1/clients/info/EthereumInfoClient.d.ts +1 -1
- package/v1/clients/info/EthereumInfoClient.js +3 -4
- package/v1/clients/info/EthereumInfoClient.js.map +1 -1
- package/v1/clients/info/EtherscanInfoClient.js +84 -162
- package/v1/clients/info/EtherscanInfoClient.js.map +1 -1
- package/v1/clients/node/HttpEthereumNodeClient.d.ts +2 -2
- package/v1/clients/node/HttpEthereumNodeClient.js +164 -375
- package/v1/clients/node/HttpEthereumNodeClient.js.map +1 -1
- package/v1/data/EthereumAddress.js +29 -20
- 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 +43 -112
- package/v1/module/EthereumModule.js.map +1 -1
- package/v1/module.js +2 -3
- package/v1/module.js.map +1 -1
- package/v1/protocol/EthereumBaseProtocol.js +467 -788
- package/v1/protocol/EthereumBaseProtocol.js.map +1 -1
- package/v1/protocol/EthereumProtocol.js +15 -46
- package/v1/protocol/EthereumProtocol.js.map +1 -1
- package/v1/protocol/erc20/ERC20Protocol.js +213 -360
- package/v1/protocol/erc20/ERC20Protocol.js.map +1 -1
- package/v1/protocol/erc20/ERC20Token.d.ts +1 -1
- package/v1/protocol/erc20/ERC20Token.js +35 -113
- package/v1/protocol/erc20/ERC20Token.js.map +1 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +25 -42
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
- package/v1/serializer/v3/serializer-companion.js +71 -148
- package/v1/serializer/v3/serializer-companion.js.map +1 -1
- package/v1/serializer/v3/validators/transaction-validator.js +14 -17
- 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 +57 -60
- package/v1/utils/EthereumUtils.js.map +1 -1
- package/v1/utils/key.js +28 -19
- package/v1/utils/key.js.map +1 -1
- package/v1/utils/protocol.js +33 -21
- package/v1/utils/protocol.js.map +1 -1
|
@@ -1,19 +1,4 @@
|
|
|
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
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
3
|
if (k2 === undefined) k2 = k;
|
|
19
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -30,118 +15,78 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
30
15
|
}) : function(o, v) {
|
|
31
16
|
o["default"] = v;
|
|
32
17
|
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
49
|
-
|
|
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
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
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
|
+
})();
|
|
76
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
77
36
|
exports.EthereumCryptoClient = void 0;
|
|
78
37
|
// @ts-ignore
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
38
|
+
const EthereumJSUtils = __importStar(require("@airgap/coinlib-core/dependencies/src/ethereumjs-util-5.2.0"));
|
|
39
|
+
const errors_1 = require("@airgap/coinlib-core/errors");
|
|
40
|
+
const coinlib_error_1 = require("@airgap/coinlib-core/errors/coinlib-error");
|
|
41
|
+
const Secp256k1CryptoClient_1 = require("@airgap/coinlib-core/protocols/Secp256k1CryptoClient");
|
|
42
|
+
const hex_1 = require("@airgap/coinlib-core/utils/hex");
|
|
43
|
+
const module_kit_1 = require("@airgap/module-kit");
|
|
44
|
+
const eth_sig_util_1 = require("@metamask/eth-sig-util");
|
|
45
|
+
const EthereumAddress_1 = require("../../data/EthereumAddress");
|
|
46
|
+
class EthereumCryptoClient extends Secp256k1CryptoClient_1.Secp256k1CryptoClient {
|
|
47
|
+
async signMessage(message, keypair) {
|
|
48
|
+
if (!keypair.privateKey) {
|
|
49
|
+
throw new errors_1.NotFoundError(coinlib_error_1.Domain.ETHEREUM, `Private key not provided`);
|
|
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
|
+
}
|
|
91
74
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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));
|
|
75
|
+
async verifyMessage(message, signature, publicKey) {
|
|
76
|
+
const msgBuffer = EthereumJSUtils.toBuffer(message);
|
|
77
|
+
const msgHash = EthereumJSUtils.hashPersonalMessage(msgBuffer);
|
|
78
|
+
const signatureBuffer = EthereumJSUtils.toBuffer(signature);
|
|
79
|
+
const signatureParams = EthereumJSUtils.fromRpcSig(signatureBuffer);
|
|
80
|
+
const recoveredPublicKey = EthereumJSUtils.ecrecover(msgHash, signatureParams.v, signatureParams.r, signatureParams.s);
|
|
81
|
+
const recoveredAddressBuffer = EthereumJSUtils.publicToAddress(recoveredPublicKey);
|
|
82
|
+
const recoveredAddress = EthereumJSUtils.bufferToHex(recoveredAddressBuffer);
|
|
83
|
+
// TODO: use `PublicKey | ExtendedPublicKey` type
|
|
84
|
+
const hexPublicKey = (0, hex_1.isHex)(publicKey)
|
|
85
|
+
? (0, module_kit_1.newPublicKey)(publicKey, 'hex')
|
|
86
|
+
: (0, module_kit_1.newExtendedPublicKey)(publicKey, 'encoded');
|
|
87
|
+
const address = EthereumAddress_1.EthereumAddress.from(hexPublicKey);
|
|
88
|
+
return recoveredAddress.toLowerCase() === address.asString().toLowerCase();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
146
91
|
exports.EthereumCryptoClient = EthereumCryptoClient;
|
|
147
92
|
//# 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,6GAA8F;AAC9F,wDAA2D;AAC3D,6EAAkE;AAClE,gGAA4F;AAC5F,wDAAsD;AACtD,mDAAqG;AACrG,yDAAuG;AAEvG,gEAA4D;AAE5D,MAAa,oBAAqB,SAAQ,6CAAqB;IACtD,KAAK,CAAC,WAAW,CAAC,OAAe,EAAE,OAA+B;QACvE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YACxB,MAAM,IAAI,sBAAa,CAAC,sBAAM,CAAC,QAAQ,EAAE,0BAA0B,CAAC,CAAA;QACtE,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;QAEzD,IAAI,CAAC;YACH,IAAI,CAAC;gBACH,2CAA2C;gBAC3C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAsB,CAAA,CAAC,aAAa;gBACxE,OAAO,IAAA,4BAAa,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,mCAAoB,CAAC,EAAE,EAAE,CAAC,CAAA;YACzF,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;YACd,IAAI,CAAC;gBACH,8CAA8C;gBAC9C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,OA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CAAC,CAAC,CAAA;QAC9H,MAAM,sBAAsB,GAAW,eAAe,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAA;QAC1F,MAAM,gBAAgB,GAAW,eAAe,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAA;QAEpF,iDAAiD;QACjD,MAAM,YAAY,GAAkC,IAAA,WAAK,EAAC,SAAS,CAAC;YAClE,CAAC,CAAC,IAAA,yBAAY,EAAC,SAAS,EAAE,KAAK,CAAC;YAChC,CAAC,CAAC,IAAA,iCAAoB,EAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QAC9C,MAAM,OAAO,GAAoB,iCAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAEnE,OAAO,gBAAgB,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAA;IAC5E,CAAC;CACF;AAhDD,oDAgDC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AirGapTransaction } from '@airgap/module-kit';
|
|
2
2
|
import { EthereumTransactionCursor } from '../../types/transaction';
|
|
3
|
-
export
|
|
3
|
+
export type EthereumInfoClientTransaction = Omit<AirGapTransaction, 'network'>;
|
|
4
4
|
export interface EthereumInfoClientTransactionsResult {
|
|
5
5
|
transactions: EthereumInfoClientTransaction[];
|
|
6
6
|
cursor: {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EthereumInfoClient = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
class EthereumInfoClient {
|
|
5
|
+
constructor(baseURL) {
|
|
6
6
|
this.baseURL = baseURL;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
}());
|
|
8
|
+
}
|
|
10
9
|
exports.EthereumInfoClient = EthereumInfoClient;
|
|
11
10
|
//# 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,MAAsB,kBAAkB;IAGtC,YAAY,OAAe;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CAaF;AAlBD,gDAkBC"}
|
|
@@ -1,173 +1,95 @@
|
|
|
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
|
-
};
|
|
53
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
4
|
};
|
|
56
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
6
|
exports.EtherscanInfoClient = void 0;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
_this.apiKey = apiKey;
|
|
70
|
-
return _this;
|
|
7
|
+
const axios_0_19_0_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/axios-0.19.0"));
|
|
8
|
+
const bignumber_1 = require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber");
|
|
9
|
+
const validate_1 = require("@airgap/coinlib-core/dependencies/src/validate.js-0.13.1/validate");
|
|
10
|
+
const errors_1 = require("@airgap/coinlib-core/errors");
|
|
11
|
+
const coinlib_error_1 = require("@airgap/coinlib-core/errors/coinlib-error");
|
|
12
|
+
const module_kit_1 = require("@airgap/module-kit");
|
|
13
|
+
const EthereumInfoClient_1 = require("./EthereumInfoClient");
|
|
14
|
+
class EtherscanInfoClient extends EthereumInfoClient_1.EthereumInfoClient {
|
|
15
|
+
constructor(baseURL, apiKey) {
|
|
16
|
+
super(baseURL);
|
|
17
|
+
this.apiKey = apiKey;
|
|
71
18
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
}];
|
|
19
|
+
async fetchTransactions(address, limit, cursor) {
|
|
20
|
+
const airGapTransactions = [];
|
|
21
|
+
const page = cursor?.page ?? 1;
|
|
22
|
+
let url = `${this.baseURL}?module=account&action=txlist&address=${address}&page=${page}&offset=${limit}&sort=desc`;
|
|
23
|
+
if (this.apiKey) {
|
|
24
|
+
url += `&apiKey=${this.apiKey}`;
|
|
25
|
+
}
|
|
26
|
+
const response = await axios_0_19_0_1.default.get(url);
|
|
27
|
+
const transactionResponse = response.data;
|
|
28
|
+
const transactions = transactionResponse.result;
|
|
29
|
+
if (transactionResponse.status === '0' && (transactions === undefined || !(0, validate_1.isArray)(transactions))) {
|
|
30
|
+
throw new errors_1.NetworkError(coinlib_error_1.Domain.ETHEREUM, { response });
|
|
31
|
+
}
|
|
32
|
+
for (const transaction of transactions) {
|
|
33
|
+
const fee = new bignumber_1.BigNumber(transaction.gas).times(new bignumber_1.BigNumber(transaction.gasPrice));
|
|
34
|
+
const airGapTransaction = {
|
|
35
|
+
from: [transaction.from],
|
|
36
|
+
to: [transaction.to],
|
|
37
|
+
isInbound: transaction.to.toLowerCase() === address.toLowerCase(),
|
|
38
|
+
amount: (0, module_kit_1.newAmount)(new bignumber_1.BigNumber(transaction.value), 'blockchain'),
|
|
39
|
+
fee: (0, module_kit_1.newAmount)(fee, 'blockchain'),
|
|
40
|
+
timestamp: parseInt(transaction.timeStamp, 10),
|
|
41
|
+
status: {
|
|
42
|
+
type: transaction.txreceipt_status === undefined || transaction.txreceipt_status === '1' ? 'applied' : 'failed',
|
|
43
|
+
hash: transaction.hash,
|
|
44
|
+
block: new bignumber_1.BigNumber(transaction.blockNumber).toString(10)
|
|
117
45
|
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
}];
|
|
46
|
+
};
|
|
47
|
+
airGapTransactions.push(airGapTransaction);
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
transactions: airGapTransactions,
|
|
51
|
+
cursor: {
|
|
52
|
+
page: page + 1
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
async fetchContractTransactions(contractAddress, address, limit, cursor) {
|
|
57
|
+
const airGapTransactions = [];
|
|
58
|
+
const page = cursor?.page ?? 1;
|
|
59
|
+
let url = `${this.baseURL}?module=account&action=tokentx&address=${address}&contractAddress=${contractAddress}&page=${page}&offset=${limit}&sort=desc`;
|
|
60
|
+
if (this.apiKey) {
|
|
61
|
+
url += `&apiKey=${this.apiKey}`;
|
|
62
|
+
}
|
|
63
|
+
const response = await axios_0_19_0_1.default.get(url);
|
|
64
|
+
const transactionResponse = response.data;
|
|
65
|
+
const transactions = transactionResponse.result;
|
|
66
|
+
if (transactionResponse.status === '0' && (transactions === undefined || !(0, validate_1.isArray)(transactions))) {
|
|
67
|
+
throw new errors_1.NetworkError(coinlib_error_1.Domain.ETHEREUM, { response });
|
|
68
|
+
}
|
|
69
|
+
for (const transaction of transactions) {
|
|
70
|
+
const fee = new bignumber_1.BigNumber(transaction.gas).times(new bignumber_1.BigNumber(transaction.gasPrice));
|
|
71
|
+
const airGapTransaction = {
|
|
72
|
+
from: [transaction.from],
|
|
73
|
+
to: [transaction.to],
|
|
74
|
+
isInbound: transaction.to.toLowerCase() === address.toLowerCase(),
|
|
75
|
+
amount: (0, module_kit_1.newAmount)(new bignumber_1.BigNumber(transaction.value), 'blockchain'),
|
|
76
|
+
fee: (0, module_kit_1.newAmount)(fee, 'blockchain'),
|
|
77
|
+
timestamp: parseInt(transaction.timeStamp, 10),
|
|
78
|
+
status: {
|
|
79
|
+
type: transaction.txreceipt_status === undefined || transaction.txreceipt_status === '1' ? 'applied' : 'failed',
|
|
80
|
+
hash: transaction.hash,
|
|
81
|
+
block: transaction.blockNumber
|
|
166
82
|
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
83
|
+
};
|
|
84
|
+
airGapTransactions.push(airGapTransaction);
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
transactions: airGapTransactions,
|
|
88
|
+
cursor: {
|
|
89
|
+
page: page + 1
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
172
94
|
exports.EtherscanInfoClient = EtherscanInfoClient;
|
|
173
95
|
//# 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,sGAAsE;AACtE,kGAA8F;AAC9F,gGAA2F;AAC3F,wDAA0D;AAC1D,6EAAkE;AAClE,mDAA8C;AAI9C,6DAA8H;AAE9H,MAAa,mBAAoB,SAAQ,uCAAkB;IACzD,YAAY,OAAe,EAAmB,MAAe;QAC3D,KAAK,CAAC,OAAO,CAAC,CAAA;QAD8B,WAAM,GAAN,MAAM,CAAS;IAE7D,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAC5B,OAAe,EACf,KAAU,EACV,MAAkC;QAElC,MAAM,kBAAkB,GAAoC,EAAE,CAAA;QAE9D,MAAM,IAAI,GAAW,MAAM,EAAE,IAAI,IAAI,CAAC,CAAA;QACtC,IAAI,GAAG,GAAW,GAAG,IAAI,CAAC,OAAO,yCAAyC,OAAO,SAAS,IAAI,WAAW,KAAK,YAAY,CAAA;QAC1H,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,GAAG,IAAI,WAAW,IAAI,CAAC,MAAM,EAAE,CAAA;QACjC,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,sBAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACrC,MAAM,mBAAmB,GAAG,QAAQ,CAAC,IAAI,CAAA;QAC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C,WAAW,CAAC,IAAI,CAAC;gBACxB,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;gBACpB,SAAS,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,WAAW,EAAE;gBAEjE,MAAM,EAAE,IAAA,sBAAS,EAAC,IAAI,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;gBACjE,GAAG,EAAE,IAAA,sBAAS,EAAC,GAAG,EAAE,YAAY,CAAC;gBAEjC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,CAAC;gBAC9C,MAAM,EAAE;oBACN,IAAI,EAAE,WAAW,CAAC,gBAAgB,KAAK,SAAS,IAAI,WAAW,CAAC,gBAAgB,KAAK,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;oBAC/G,IAAI,EAAE,WAAW,CAAC,IAAI;oBACtB,KAAK,EAAE,WAAW,CAAC,WAAW;iBAC/B;aACF,CAAA;YAED,kBAAkB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;QAC5C,CAAC;QAED,OAAO;YACL,YAAY,EAAE,kBAAkB;YAChC,MAAM,EAAE;gBACN,IAAI,EAAE,IAAI,GAAG,CAAC;aACf;SACF,CAAA;IACH,CAAC;CACF;AArGD,kDAqGC"}
|
|
@@ -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 | undefined;
|
|
47
|
+
constructor(baseURL: string, headers?: any | undefined);
|
|
48
48
|
fetchBalance(address: string): Promise<BigNumber>;
|
|
49
49
|
fetchTransactionCount(address: string): Promise<number>;
|
|
50
50
|
sendSignedTransaction(transaction: string): Promise<string>;
|