@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,353 +1,181 @@
|
|
|
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.AirGapNodeClient = exports.EthereumRPCDataTransfer = exports.EthereumRPCDataBalanceOf = exports.EthereumRPCData = void 0;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
EthereumRPCBody.prototype.toRPCBody = function () {
|
|
7
|
+
const RPCBody_1 = require("@airgap/coinlib-core/data/RPCBody");
|
|
8
|
+
const axios_0_19_0_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/axios-0.19.0"));
|
|
9
|
+
const bignumber_1 = require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber");
|
|
10
|
+
const errors_1 = require("@airgap/coinlib-core/errors");
|
|
11
|
+
const coinlib_error_1 = require("@airgap/coinlib-core/errors/coinlib-error");
|
|
12
|
+
const IAirGapTransaction_1 = require("@airgap/coinlib-core/interfaces/IAirGapTransaction");
|
|
13
|
+
const EthereumProtocolOptions_1 = require("../../EthereumProtocolOptions");
|
|
14
|
+
const utils_1 = require("../../utils/utils");
|
|
15
|
+
const NodeClient_1 = require("./NodeClient");
|
|
16
|
+
class EthereumRPCBody extends RPCBody_1.RPCBody {
|
|
17
|
+
static { this.blockEarliest = 'earliest'; }
|
|
18
|
+
static { this.blockLatest = 'latest'; }
|
|
19
|
+
static { this.blockPending = 'pending'; }
|
|
20
|
+
toRPCBody() {
|
|
73
21
|
return JSON.stringify(this.toJSON());
|
|
74
|
-
}
|
|
75
|
-
|
|
22
|
+
}
|
|
23
|
+
toJSON() {
|
|
76
24
|
return {
|
|
77
25
|
jsonrpc: this.jsonrpc,
|
|
78
26
|
method: this.method,
|
|
79
27
|
params: this.params,
|
|
80
28
|
id: this.id
|
|
81
29
|
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
var EthereumRPCData = /** @class */ (function () {
|
|
89
|
-
function EthereumRPCData(methodSignature) {
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
class EthereumRPCData {
|
|
33
|
+
// 2 chars = 1 byte hence to get to 32 bytes we need 64 chars
|
|
34
|
+
static { this.parametersLength = 64; }
|
|
35
|
+
constructor(methodSignature) {
|
|
90
36
|
this.methodSignature = methodSignature;
|
|
91
37
|
}
|
|
92
|
-
|
|
93
|
-
|
|
38
|
+
abiEncoded() {
|
|
39
|
+
const hash = utils_1.EthereumUtils.sha3(this.methodSignature);
|
|
94
40
|
if (hash === null) {
|
|
95
41
|
return '';
|
|
96
42
|
}
|
|
97
|
-
return
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
var result = value;
|
|
43
|
+
return `0x${hash.slice(2, 10)}`;
|
|
44
|
+
}
|
|
45
|
+
static addLeadingZeroPadding(value, targetLength = EthereumRPCData.parametersLength) {
|
|
46
|
+
let result = value;
|
|
102
47
|
while (result.length < targetLength) {
|
|
103
48
|
result = '0' + result;
|
|
104
49
|
}
|
|
105
50
|
return result;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
51
|
+
}
|
|
52
|
+
static removeLeadingZeroPadding(value) {
|
|
53
|
+
let result = value;
|
|
109
54
|
while (result.startsWith('0')) {
|
|
110
55
|
result = result.slice(1); // this can probably be done much more efficiently with a regex
|
|
111
56
|
}
|
|
112
57
|
return result;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
EthereumRPCData.parametersLength = 64;
|
|
116
|
-
return EthereumRPCData;
|
|
117
|
-
}());
|
|
58
|
+
}
|
|
59
|
+
}
|
|
118
60
|
exports.EthereumRPCData = EthereumRPCData;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return _this;
|
|
61
|
+
class EthereumRPCDataBalanceOf extends EthereumRPCData {
|
|
62
|
+
static { this.methodName = 'balanceOf'; }
|
|
63
|
+
constructor(address) {
|
|
64
|
+
super(`${EthereumRPCDataBalanceOf.methodName}(address)`);
|
|
65
|
+
this.address = address;
|
|
125
66
|
}
|
|
126
|
-
|
|
127
|
-
|
|
67
|
+
abiEncoded() {
|
|
68
|
+
let srcAddress = this.address;
|
|
128
69
|
if (srcAddress.startsWith('0x')) {
|
|
129
70
|
srcAddress = srcAddress.slice(2);
|
|
130
71
|
}
|
|
131
|
-
return
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return EthereumRPCDataBalanceOf;
|
|
135
|
-
}(EthereumRPCData));
|
|
72
|
+
return super.abiEncoded() + EthereumRPCData.addLeadingZeroPadding(srcAddress);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
136
75
|
exports.EthereumRPCDataBalanceOf = EthereumRPCDataBalanceOf;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
76
|
+
class EthereumRPCDataTransfer extends EthereumRPCData {
|
|
77
|
+
static { this.methodName = 'transfer'; }
|
|
78
|
+
constructor(toAddressOrData, amount) {
|
|
79
|
+
super(`${EthereumRPCDataTransfer.methodName}(address,uint256)`);
|
|
141
80
|
if (amount) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
81
|
+
const toAddress = toAddressOrData;
|
|
82
|
+
this.recipient = toAddress;
|
|
83
|
+
this.amount = amount;
|
|
145
84
|
}
|
|
146
85
|
else {
|
|
147
|
-
|
|
148
|
-
|
|
86
|
+
const data = toAddressOrData;
|
|
87
|
+
const methodID = super.abiEncoded();
|
|
149
88
|
if (!data.startsWith(methodID)) {
|
|
150
89
|
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.ETHEREUM, 'unexpected method ID');
|
|
151
90
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
91
|
+
const params = data.slice(methodID.length);
|
|
92
|
+
const recipient = EthereumRPCData.removeLeadingZeroPadding(params.slice(0, EthereumRPCData.parametersLength));
|
|
93
|
+
const parsedAmount = EthereumRPCData.removeLeadingZeroPadding(params.slice(EthereumRPCData.parametersLength));
|
|
94
|
+
this.recipient = `0x${recipient}`;
|
|
95
|
+
this.amount = `0x${parsedAmount}`;
|
|
157
96
|
}
|
|
158
|
-
return _this;
|
|
159
97
|
}
|
|
160
|
-
|
|
161
|
-
|
|
98
|
+
abiEncoded() {
|
|
99
|
+
let dstAddress = this.recipient;
|
|
162
100
|
if (dstAddress.startsWith('0x')) {
|
|
163
101
|
dstAddress = dstAddress.slice(2);
|
|
164
102
|
}
|
|
165
|
-
|
|
103
|
+
let transferAmount = this.amount;
|
|
166
104
|
if (transferAmount.startsWith('0x')) {
|
|
167
105
|
transferAmount = transferAmount.slice(2);
|
|
168
106
|
}
|
|
169
|
-
return (
|
|
107
|
+
return (super.abiEncoded() +
|
|
170
108
|
EthereumRPCData.addLeadingZeroPadding(dstAddress.toLowerCase()) +
|
|
171
109
|
EthereumRPCData.addLeadingZeroPadding(transferAmount.toLowerCase()));
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
return EthereumRPCDataTransfer;
|
|
175
|
-
}(EthereumRPCData));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
176
112
|
exports.EthereumRPCDataTransfer = EthereumRPCDataTransfer;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
if (baseURL === void 0) { baseURL = EthereumProtocolOptions_1.NODE_URL; }
|
|
181
|
-
return _super.call(this, baseURL) || this;
|
|
113
|
+
class AirGapNodeClient extends NodeClient_1.EthereumNodeClient {
|
|
114
|
+
constructor(baseURL = EthereumProtocolOptions_1.NODE_URL) {
|
|
115
|
+
super(baseURL);
|
|
182
116
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
AirGapNodeClient.prototype.sendSignedTransaction = function (transaction) {
|
|
214
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
215
|
-
var body;
|
|
216
|
-
return __generator(this, function (_a) {
|
|
217
|
-
switch (_a.label) {
|
|
218
|
-
case 0:
|
|
219
|
-
body = new EthereumRPCBody('eth_sendRawTransaction', [transaction]);
|
|
220
|
-
return [4 /*yield*/, this.send(body)];
|
|
221
|
-
case 1: return [2 /*return*/, (_a.sent()).result];
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
};
|
|
226
|
-
AirGapNodeClient.prototype.getTransactionStatus = function (transactionHash) {
|
|
227
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
228
|
-
var body, response;
|
|
229
|
-
return __generator(this, function (_a) {
|
|
230
|
-
switch (_a.label) {
|
|
231
|
-
case 0:
|
|
232
|
-
body = new EthereumRPCBody('eth_getTransactionReceipt', [transactionHash]);
|
|
233
|
-
return [4 /*yield*/, this.send(body)];
|
|
234
|
-
case 1:
|
|
235
|
-
response = _a.sent();
|
|
236
|
-
return [2 /*return*/, response.result.status === '0x1' ? IAirGapTransaction_1.AirGapTransactionStatus.APPLIED : IAirGapTransaction_1.AirGapTransactionStatus.FAILED];
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
});
|
|
240
|
-
};
|
|
241
|
-
AirGapNodeClient.prototype.callBalanceOf = function (contractAddress, address) {
|
|
242
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
243
|
-
var body, response;
|
|
244
|
-
return __generator(this, function (_a) {
|
|
245
|
-
switch (_a.label) {
|
|
246
|
-
case 0:
|
|
247
|
-
body = this.balanceOfBody(contractAddress, address);
|
|
248
|
-
return [4 /*yield*/, this.send(body)];
|
|
249
|
-
case 1:
|
|
250
|
-
response = _a.sent();
|
|
251
|
-
return [2 /*return*/, new bignumber_1.BigNumber(response.result)];
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
};
|
|
256
|
-
AirGapNodeClient.prototype.callBalanceOfOnContracts = function (contractAddresses, address) {
|
|
257
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
258
|
-
var bodies, responses, result;
|
|
259
|
-
var _this = this;
|
|
260
|
-
return __generator(this, function (_a) {
|
|
261
|
-
switch (_a.label) {
|
|
262
|
-
case 0:
|
|
263
|
-
bodies = contractAddresses.map(function (contractAddress, index) { return _this.balanceOfBody(contractAddress, address, index); });
|
|
264
|
-
return [4 /*yield*/, this.batchSend(bodies)];
|
|
265
|
-
case 1:
|
|
266
|
-
responses = _a.sent();
|
|
267
|
-
result = {};
|
|
268
|
-
responses.forEach(function (response) {
|
|
269
|
-
var _a;
|
|
270
|
-
result[contractAddresses[response.id]] = new bignumber_1.BigNumber((_a = response.result) !== null && _a !== void 0 ? _a : 0);
|
|
271
|
-
});
|
|
272
|
-
return [2 /*return*/, result];
|
|
273
|
-
}
|
|
274
|
-
});
|
|
117
|
+
async fetchBalance(address) {
|
|
118
|
+
const body = new EthereumRPCBody('eth_getBalance', [address, EthereumRPCBody.blockLatest]);
|
|
119
|
+
const response = await this.send(body);
|
|
120
|
+
return new bignumber_1.BigNumber(response.result);
|
|
121
|
+
}
|
|
122
|
+
async fetchTransactionCount(address) {
|
|
123
|
+
const body = new EthereumRPCBody('eth_getTransactionCount', [address, EthereumRPCBody.blockLatest]);
|
|
124
|
+
const response = await this.send(body);
|
|
125
|
+
return new bignumber_1.BigNumber(response.result).toNumber();
|
|
126
|
+
}
|
|
127
|
+
async sendSignedTransaction(transaction) {
|
|
128
|
+
const body = new EthereumRPCBody('eth_sendRawTransaction', [transaction]);
|
|
129
|
+
return (await this.send(body)).result;
|
|
130
|
+
}
|
|
131
|
+
async getTransactionStatus(transactionHash) {
|
|
132
|
+
const body = new EthereumRPCBody('eth_getTransactionReceipt', [transactionHash]);
|
|
133
|
+
const response = await this.send(body);
|
|
134
|
+
return response.result.status === '0x1' ? IAirGapTransaction_1.AirGapTransactionStatus.APPLIED : IAirGapTransaction_1.AirGapTransactionStatus.FAILED;
|
|
135
|
+
}
|
|
136
|
+
async callBalanceOf(contractAddress, address) {
|
|
137
|
+
const body = this.balanceOfBody(contractAddress, address);
|
|
138
|
+
const response = await this.send(body);
|
|
139
|
+
return new bignumber_1.BigNumber(response.result);
|
|
140
|
+
}
|
|
141
|
+
async callBalanceOfOnContracts(contractAddresses, address) {
|
|
142
|
+
const bodies = contractAddresses.map((contractAddress, index) => this.balanceOfBody(contractAddress, address, index));
|
|
143
|
+
const responses = await this.batchSend(bodies);
|
|
144
|
+
const result = {};
|
|
145
|
+
responses.forEach((response) => {
|
|
146
|
+
result[contractAddresses[response.id]] = new bignumber_1.BigNumber(response.result ?? 0);
|
|
275
147
|
});
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
150
|
+
balanceOfBody(contractAddress, address, id = 0) {
|
|
151
|
+
const data = new EthereumRPCDataBalanceOf(address);
|
|
280
152
|
return new EthereumRPCBody('eth_call', [{ to: contractAddress, data: data.abiEncoded() }, EthereumRPCBody.blockLatest], id);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
return __generator(this, function (_a) {
|
|
301
|
-
data = new EthereumRPCDataTransfer(toAddress, hexAmount);
|
|
302
|
-
result = this.estimateTransactionGas(fromAddress, contractAddress, undefined, data.abiEncoded());
|
|
303
|
-
return [2 /*return*/, result];
|
|
304
|
-
});
|
|
305
|
-
});
|
|
306
|
-
};
|
|
307
|
-
AirGapNodeClient.prototype.getGasPrice = function () {
|
|
308
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
309
|
-
var body, response;
|
|
310
|
-
return __generator(this, function (_a) {
|
|
311
|
-
switch (_a.label) {
|
|
312
|
-
case 0:
|
|
313
|
-
body = new EthereumRPCBody('eth_gasPrice', []);
|
|
314
|
-
return [4 /*yield*/, this.send(body)];
|
|
315
|
-
case 1:
|
|
316
|
-
response = _a.sent();
|
|
317
|
-
return [2 /*return*/, new bignumber_1.BigNumber(response.result)];
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
});
|
|
321
|
-
};
|
|
322
|
-
AirGapNodeClient.prototype.send = function (body) {
|
|
323
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
324
|
-
var response;
|
|
325
|
-
return __generator(this, function (_a) {
|
|
326
|
-
switch (_a.label) {
|
|
327
|
-
case 0: return [4 /*yield*/, axios_0_19_0_1.default.post(this.baseURL, body.toRPCBody()).catch(function (error) {
|
|
328
|
-
throw new errors_1.NetworkError(coinlib_error_1.Domain.ETHEREUM, error);
|
|
329
|
-
})];
|
|
330
|
-
case 1:
|
|
331
|
-
response = _a.sent();
|
|
332
|
-
return [2 /*return*/, response.data];
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
});
|
|
336
|
-
};
|
|
337
|
-
AirGapNodeClient.prototype.batchSend = function (bodies) {
|
|
338
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
339
|
-
var data;
|
|
340
|
-
return __generator(this, function (_a) {
|
|
341
|
-
switch (_a.label) {
|
|
342
|
-
case 0: return [4 /*yield*/, axios_0_19_0_1.default.post(this.baseURL, JSON.stringify(bodies.map(function (body) { return body.toJSON(); })))];
|
|
343
|
-
case 1:
|
|
344
|
-
data = (_a.sent()).data;
|
|
345
|
-
return [2 /*return*/, data];
|
|
346
|
-
}
|
|
347
|
-
});
|
|
153
|
+
}
|
|
154
|
+
async estimateTransactionGas(fromAddress, toAddress, amount, data, gas) {
|
|
155
|
+
const body = new EthereumRPCBody('eth_estimateGas', [{ from: fromAddress, to: toAddress, gas, value: amount, data }]);
|
|
156
|
+
const response = await this.send(body);
|
|
157
|
+
return new bignumber_1.BigNumber(response.result);
|
|
158
|
+
}
|
|
159
|
+
async estimateTransferGas(contractAddress, fromAddress, toAddress, hexAmount) {
|
|
160
|
+
const data = new EthereumRPCDataTransfer(toAddress, hexAmount);
|
|
161
|
+
const result = this.estimateTransactionGas(fromAddress, contractAddress, undefined, data.abiEncoded());
|
|
162
|
+
return result;
|
|
163
|
+
}
|
|
164
|
+
async getGasPrice() {
|
|
165
|
+
const body = new EthereumRPCBody('eth_gasPrice', []);
|
|
166
|
+
const response = await this.send(body);
|
|
167
|
+
return new bignumber_1.BigNumber(response.result);
|
|
168
|
+
}
|
|
169
|
+
async send(body) {
|
|
170
|
+
const response = await axios_0_19_0_1.default.post(this.baseURL, body.toRPCBody()).catch((error) => {
|
|
171
|
+
throw new errors_1.NetworkError(coinlib_error_1.Domain.ETHEREUM, error);
|
|
348
172
|
});
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
173
|
+
return response.data;
|
|
174
|
+
}
|
|
175
|
+
async batchSend(bodies) {
|
|
176
|
+
const data = (await axios_0_19_0_1.default.post(this.baseURL, JSON.stringify(bodies.map((body) => body.toJSON())))).data;
|
|
177
|
+
return data;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
352
180
|
exports.AirGapNodeClient = AirGapNodeClient;
|
|
353
181
|
//# sourceMappingURL=AirGapNodeClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AirGapNodeClient.js","sourceRoot":"","sources":["../../../../../src/v0/protocol/clients/node-clients/AirGapNodeClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AirGapNodeClient.js","sourceRoot":"","sources":["../../../../../src/v0/protocol/clients/node-clients/AirGapNodeClient.ts"],"names":[],"mappings":";;;;;;AAAA,+DAA2D;AAC3D,sGAAsF;AACtF,kGAA8F;AAC9F,wDAA6E;AAC7E,6EAAkE;AAClE,2FAA4F;AAE5F,2EAAwD;AACxD,6CAAiD;AAEjD,6CAAiD;AAEjD,MAAM,eAAgB,SAAQ,iBAAO;aACrB,kBAAa,GAAW,UAAU,CAAA;aAClC,gBAAW,GAAW,QAAQ,CAAA;aAC9B,iBAAY,GAAW,SAAS,CAAA;IAEvC,SAAS;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IACtC,CAAC;IAEM,MAAM;QACX,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,EAAE,EAAE,IAAI,CAAC,EAAE;SACZ,CAAA;IACH,CAAC;;AAaH,MAAa,eAAe;IAC1B,6DAA6D;aAC5C,qBAAgB,GAAW,EAAE,CAAA;IAG9C,YAAY,eAAuB;QACjC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;IACxC,CAAC;IAEM,UAAU;QACf,MAAM,IAAI,GAAG,qBAAa,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QACrD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO,EAAE,CAAA;QACX,CAAC;QAED,OAAO,KAAK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IACvC,CAAC;IAEO,KAAK,CAAC,IAAI,CAAC,IAAqB;QACtC,MAAM,QAAQ,GAAG,MAAM,sBAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YAChF,MAAM,IAAI,qBAAY,CAAC,sBAAM,CAAC,QAAQ,EAAE,KAAmB,CAAC,CAAA;QAC9D,CAAC,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;IAEO,KAAK,CAAC,SAAS,CAAC,MAAyB;QAC/C,MAAM,IAAI,GAAG,CAAC,MAAM,sBAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QAEvG,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AArGD,4CAqGC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EthereumNodeClient = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
class EthereumNodeClient {
|
|
5
|
+
constructor(baseURL) {
|
|
6
6
|
this.baseURL = baseURL;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
}());
|
|
8
|
+
}
|
|
10
9
|
exports.EthereumNodeClient = EthereumNodeClient;
|
|
11
10
|
//# sourceMappingURL=NodeClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeClient.js","sourceRoot":"","sources":["../../../../../src/v0/protocol/clients/node-clients/NodeClient.ts"],"names":[],"mappings":";;;AAGA;
|
|
1
|
+
{"version":3,"file":"NodeClient.js","sourceRoot":"","sources":["../../../../../src/v0/protocol/clients/node-clients/NodeClient.ts"],"names":[],"mappings":";;;AAGA,MAAsB,kBAAkB;IAGtC,YAAY,OAAe;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CAwBF;AA7BD,gDA6BC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ERC20Token = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const ProtocolSymbols_1 = require("@airgap/coinlib-core/utils/ProtocolSymbols");
|
|
5
|
+
const EthereumProtocolOptions_1 = require("../EthereumProtocolOptions");
|
|
6
|
+
const GenericERC20_1 = require("./GenericERC20");
|
|
7
|
+
const ERC20Token = new GenericERC20_1.GenericERC20(new EthereumProtocolOptions_1.EthereumERC20ProtocolOptions(new EthereumProtocolOptions_1.EthereumProtocolNetwork(undefined, undefined, undefined, undefined, new EthereumProtocolOptions_1.EthereumProtocolNetworkExtras(3)), new EthereumProtocolOptions_1.EthereumERC20ProtocolConfig('ETH-ERC20', 'Unknown Ethereum ERC20-Token', 'erc20', ProtocolSymbols_1.SubProtocolSymbols.ETH_ERC20, '0x2dd847af80418D280B7078888B6A6133083001C9', 18)));
|
|
8
8
|
exports.ERC20Token = ERC20Token;
|
|
9
9
|
//# sourceMappingURL=ERC20.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20.js","sourceRoot":"","sources":["../../../../src/v0/protocol/erc20/ERC20.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"ERC20.js","sourceRoot":"","sources":["../../../../src/v0/protocol/erc20/ERC20.ts"],"names":[],"mappings":";;;AAAA,gFAA+E;AAC/E,wEAKmC;AAEnC,iDAA6C;AAE7C,MAAM,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"}
|