@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,181 +1,353 @@
|
|
|
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.AirGapNodeClient = exports.EthereumRPCDataTransfer = exports.EthereumRPCDataBalanceOf = exports.EthereumRPCData = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
toRPCBody() {
|
|
21
|
-
return JSON.stringify(this.toJSON());
|
|
58
|
+
var RPCBody_1 = require("@airgap/coinlib-core/data/RPCBody");
|
|
59
|
+
var axios_0_19_0_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/axios-0.19.0"));
|
|
60
|
+
var bignumber_1 = require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber");
|
|
61
|
+
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
62
|
+
var coinlib_error_1 = require("@airgap/coinlib-core/errors/coinlib-error");
|
|
63
|
+
var IAirGapTransaction_1 = require("@airgap/coinlib-core/interfaces/IAirGapTransaction");
|
|
64
|
+
var EthereumProtocolOptions_1 = require("../../EthereumProtocolOptions");
|
|
65
|
+
var utils_1 = require("../../utils/utils");
|
|
66
|
+
var NodeClient_1 = require("./NodeClient");
|
|
67
|
+
var EthereumRPCBody = /** @class */ (function (_super) {
|
|
68
|
+
__extends(EthereumRPCBody, _super);
|
|
69
|
+
function EthereumRPCBody() {
|
|
70
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
71
|
}
|
|
23
|
-
|
|
72
|
+
EthereumRPCBody.prototype.toRPCBody = function () {
|
|
73
|
+
return JSON.stringify(this.toJSON());
|
|
74
|
+
};
|
|
75
|
+
EthereumRPCBody.prototype.toJSON = function () {
|
|
24
76
|
return {
|
|
25
77
|
jsonrpc: this.jsonrpc,
|
|
26
78
|
method: this.method,
|
|
27
79
|
params: this.params,
|
|
28
80
|
id: this.id
|
|
29
81
|
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
82
|
+
};
|
|
83
|
+
EthereumRPCBody.blockEarliest = 'earliest';
|
|
84
|
+
EthereumRPCBody.blockLatest = 'latest';
|
|
85
|
+
EthereumRPCBody.blockPending = 'pending';
|
|
86
|
+
return EthereumRPCBody;
|
|
87
|
+
}(RPCBody_1.RPCBody));
|
|
88
|
+
var EthereumRPCData = /** @class */ (function () {
|
|
89
|
+
function EthereumRPCData(methodSignature) {
|
|
36
90
|
this.methodSignature = methodSignature;
|
|
37
91
|
}
|
|
38
|
-
abiEncoded() {
|
|
39
|
-
|
|
92
|
+
EthereumRPCData.prototype.abiEncoded = function () {
|
|
93
|
+
var hash = utils_1.EthereumUtils.sha3(this.methodSignature);
|
|
40
94
|
if (hash === null) {
|
|
41
95
|
return '';
|
|
42
96
|
}
|
|
43
|
-
return
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
97
|
+
return "0x".concat(hash.slice(2, 10));
|
|
98
|
+
};
|
|
99
|
+
EthereumRPCData.addLeadingZeroPadding = function (value, targetLength) {
|
|
100
|
+
if (targetLength === void 0) { targetLength = EthereumRPCData.parametersLength; }
|
|
101
|
+
var result = value;
|
|
47
102
|
while (result.length < targetLength) {
|
|
48
103
|
result = '0' + result;
|
|
49
104
|
}
|
|
50
105
|
return result;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
106
|
+
};
|
|
107
|
+
EthereumRPCData.removeLeadingZeroPadding = function (value) {
|
|
108
|
+
var result = value;
|
|
54
109
|
while (result.startsWith('0')) {
|
|
55
110
|
result = result.slice(1); // this can probably be done much more efficiently with a regex
|
|
56
111
|
}
|
|
57
112
|
return result;
|
|
58
|
-
}
|
|
59
|
-
|
|
113
|
+
};
|
|
114
|
+
// 2 chars = 1 byte hence to get to 32 bytes we need 64 chars
|
|
115
|
+
EthereumRPCData.parametersLength = 64;
|
|
116
|
+
return EthereumRPCData;
|
|
117
|
+
}());
|
|
60
118
|
exports.EthereumRPCData = EthereumRPCData;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
119
|
+
var EthereumRPCDataBalanceOf = /** @class */ (function (_super) {
|
|
120
|
+
__extends(EthereumRPCDataBalanceOf, _super);
|
|
121
|
+
function EthereumRPCDataBalanceOf(address) {
|
|
122
|
+
var _this = _super.call(this, "".concat(EthereumRPCDataBalanceOf.methodName, "(address)")) || this;
|
|
123
|
+
_this.address = address;
|
|
124
|
+
return _this;
|
|
66
125
|
}
|
|
67
|
-
abiEncoded() {
|
|
68
|
-
|
|
126
|
+
EthereumRPCDataBalanceOf.prototype.abiEncoded = function () {
|
|
127
|
+
var srcAddress = this.address;
|
|
69
128
|
if (srcAddress.startsWith('0x')) {
|
|
70
129
|
srcAddress = srcAddress.slice(2);
|
|
71
130
|
}
|
|
72
|
-
return
|
|
73
|
-
}
|
|
74
|
-
|
|
131
|
+
return _super.prototype.abiEncoded.call(this) + EthereumRPCData.addLeadingZeroPadding(srcAddress);
|
|
132
|
+
};
|
|
133
|
+
EthereumRPCDataBalanceOf.methodName = 'balanceOf';
|
|
134
|
+
return EthereumRPCDataBalanceOf;
|
|
135
|
+
}(EthereumRPCData));
|
|
75
136
|
exports.EthereumRPCDataBalanceOf = EthereumRPCDataBalanceOf;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
137
|
+
var EthereumRPCDataTransfer = /** @class */ (function (_super) {
|
|
138
|
+
__extends(EthereumRPCDataTransfer, _super);
|
|
139
|
+
function EthereumRPCDataTransfer(toAddressOrData, amount) {
|
|
140
|
+
var _this = _super.call(this, "".concat(EthereumRPCDataTransfer.methodName, "(address,uint256)")) || this;
|
|
80
141
|
if (amount) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
142
|
+
var toAddress = toAddressOrData;
|
|
143
|
+
_this.recipient = toAddress;
|
|
144
|
+
_this.amount = amount;
|
|
84
145
|
}
|
|
85
146
|
else {
|
|
86
|
-
|
|
87
|
-
|
|
147
|
+
var data = toAddressOrData;
|
|
148
|
+
var methodID = _super.prototype.abiEncoded.call(_this);
|
|
88
149
|
if (!data.startsWith(methodID)) {
|
|
89
150
|
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.ETHEREUM, 'unexpected method ID');
|
|
90
151
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
152
|
+
var params = data.slice(methodID.length);
|
|
153
|
+
var recipient = EthereumRPCData.removeLeadingZeroPadding(params.slice(0, EthereumRPCData.parametersLength));
|
|
154
|
+
var parsedAmount = EthereumRPCData.removeLeadingZeroPadding(params.slice(EthereumRPCData.parametersLength));
|
|
155
|
+
_this.recipient = "0x".concat(recipient);
|
|
156
|
+
_this.amount = "0x".concat(parsedAmount);
|
|
96
157
|
}
|
|
158
|
+
return _this;
|
|
97
159
|
}
|
|
98
|
-
abiEncoded() {
|
|
99
|
-
|
|
160
|
+
EthereumRPCDataTransfer.prototype.abiEncoded = function () {
|
|
161
|
+
var dstAddress = this.recipient;
|
|
100
162
|
if (dstAddress.startsWith('0x')) {
|
|
101
163
|
dstAddress = dstAddress.slice(2);
|
|
102
164
|
}
|
|
103
|
-
|
|
165
|
+
var transferAmount = this.amount;
|
|
104
166
|
if (transferAmount.startsWith('0x')) {
|
|
105
167
|
transferAmount = transferAmount.slice(2);
|
|
106
168
|
}
|
|
107
|
-
return (
|
|
169
|
+
return (_super.prototype.abiEncoded.call(this) +
|
|
108
170
|
EthereumRPCData.addLeadingZeroPadding(dstAddress.toLowerCase()) +
|
|
109
171
|
EthereumRPCData.addLeadingZeroPadding(transferAmount.toLowerCase()));
|
|
110
|
-
}
|
|
111
|
-
|
|
172
|
+
};
|
|
173
|
+
EthereumRPCDataTransfer.methodName = 'transfer';
|
|
174
|
+
return EthereumRPCDataTransfer;
|
|
175
|
+
}(EthereumRPCData));
|
|
112
176
|
exports.EthereumRPCDataTransfer = EthereumRPCDataTransfer;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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);
|
|
177
|
+
var AirGapNodeClient = /** @class */ (function (_super) {
|
|
178
|
+
__extends(AirGapNodeClient, _super);
|
|
179
|
+
function AirGapNodeClient(baseURL) {
|
|
180
|
+
if (baseURL === void 0) { baseURL = EthereumProtocolOptions_1.NODE_URL; }
|
|
181
|
+
return _super.call(this, baseURL) || this;
|
|
140
182
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
183
|
+
AirGapNodeClient.prototype.fetchBalance = function (address) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
185
|
+
var body, response;
|
|
186
|
+
return __generator(this, function (_a) {
|
|
187
|
+
switch (_a.label) {
|
|
188
|
+
case 0:
|
|
189
|
+
body = new EthereumRPCBody('eth_getBalance', [address, EthereumRPCBody.blockLatest]);
|
|
190
|
+
return [4 /*yield*/, this.send(body)];
|
|
191
|
+
case 1:
|
|
192
|
+
response = _a.sent();
|
|
193
|
+
return [2 /*return*/, new bignumber_1.BigNumber(response.result)];
|
|
194
|
+
}
|
|
195
|
+
});
|
|
147
196
|
});
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
197
|
+
};
|
|
198
|
+
AirGapNodeClient.prototype.fetchTransactionCount = function (address) {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
200
|
+
var body, response;
|
|
201
|
+
return __generator(this, function (_a) {
|
|
202
|
+
switch (_a.label) {
|
|
203
|
+
case 0:
|
|
204
|
+
body = new EthereumRPCBody('eth_getTransactionCount', [address, EthereumRPCBody.blockLatest]);
|
|
205
|
+
return [4 /*yield*/, this.send(body)];
|
|
206
|
+
case 1:
|
|
207
|
+
response = _a.sent();
|
|
208
|
+
return [2 /*return*/, new bignumber_1.BigNumber(response.result).toNumber()];
|
|
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
|
+
});
|
|
275
|
+
});
|
|
276
|
+
};
|
|
277
|
+
AirGapNodeClient.prototype.balanceOfBody = function (contractAddress, address, id) {
|
|
278
|
+
if (id === void 0) { id = 0; }
|
|
279
|
+
var data = new EthereumRPCDataBalanceOf(address);
|
|
152
280
|
return new EthereumRPCBody('eth_call', [{ to: contractAddress, data: data.abiEncoded() }, EthereumRPCBody.blockLatest], id);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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);
|
|
281
|
+
};
|
|
282
|
+
AirGapNodeClient.prototype.estimateTransactionGas = function (fromAddress, toAddress, amount, data, gas) {
|
|
283
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
284
|
+
var body, response;
|
|
285
|
+
return __generator(this, function (_a) {
|
|
286
|
+
switch (_a.label) {
|
|
287
|
+
case 0:
|
|
288
|
+
body = new EthereumRPCBody('eth_estimateGas', [{ from: fromAddress, to: toAddress, gas: gas, value: amount, data: data }]);
|
|
289
|
+
return [4 /*yield*/, this.send(body)];
|
|
290
|
+
case 1:
|
|
291
|
+
response = _a.sent();
|
|
292
|
+
return [2 /*return*/, new bignumber_1.BigNumber(response.result)];
|
|
293
|
+
}
|
|
294
|
+
});
|
|
172
295
|
});
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
296
|
+
};
|
|
297
|
+
AirGapNodeClient.prototype.estimateTransferGas = function (contractAddress, fromAddress, toAddress, hexAmount) {
|
|
298
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
299
|
+
var data, result;
|
|
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
|
+
});
|
|
348
|
+
});
|
|
349
|
+
};
|
|
350
|
+
return AirGapNodeClient;
|
|
351
|
+
}(NodeClient_1.EthereumNodeClient));
|
|
180
352
|
exports.AirGapNodeClient = AirGapNodeClient;
|
|
181
353
|
//# 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,6DAA2D;AAC3D,oGAAsF;AACtF,gGAA8F;AAC9F,sDAA6E;AAC7E,2EAAkE;AAClE,yFAA4F;AAE5F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sBAAM,CAAC,QAAQ,EAAE,KAAmB,CAAC,CAAA;wBAC9D,CAAC,CAAC,EAAA;;wBAFI,QAAQ,GAAG,SAEf;wBAEF,sBAAO,QAAQ,CAAC,IAAI,EAAA;;;;KACrB;IAEa,oCAAS,GAAvB,UAAwB,MAAyB;;;;;4BACjC,qBAAM,sBAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,MAAM,EAAE,EAAb,CAAa,CAAC,CAAC,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"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EthereumNodeClient = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
var EthereumNodeClient = /** @class */ (function () {
|
|
5
|
+
function EthereumNodeClient(baseURL) {
|
|
6
6
|
this.baseURL = baseURL;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
return EthereumNodeClient;
|
|
9
|
+
}());
|
|
9
10
|
exports.EthereumNodeClient = EthereumNodeClient;
|
|
10
11
|
//# 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;IAGE,4BAAY,OAAe;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAwBH,yBAAC;AAAD,CAAC,AA7BD,IA6BC;AA7BqB,gDAAkB"}
|
|
@@ -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
|
+
var ProtocolSymbols_1 = require("@airgap/coinlib-core/utils/ProtocolSymbols");
|
|
5
|
+
var EthereumProtocolOptions_1 = require("../EthereumProtocolOptions");
|
|
6
|
+
var GenericERC20_1 = require("./GenericERC20");
|
|
7
|
+
var 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,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"}
|