@airgap/ethereum 0.13.8-beta.6 → 0.13.8-beta.7
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 +4 -4
- package/v1/index.d.ts +1 -3
- package/v1/index.js +1 -7
- package/v1/index.js.map +1 -1
- package/v1/module/EthereumModule.d.ts +4 -3
- package/v1/module/EthereumModule.js +11 -4
- package/v1/module/EthereumModule.js.map +1 -1
- package/v1/protocol/EthereumBaseProtocol.d.ts +28 -16
- package/v1/protocol/EthereumBaseProtocol.js +132 -14
- package/v1/protocol/EthereumBaseProtocol.js.map +1 -1
- package/v1/protocol/EthereumProtocol.d.ts +2 -2
- package/v1/protocol/EthereumProtocol.js +1 -257
- package/v1/protocol/EthereumProtocol.js.map +1 -1
- package/v1/protocol/erc20/ERC20Token.d.ts +3 -1
- package/v1/protocol/erc20/ERC20Token.js +15 -6
- package/v1/protocol/erc20/ERC20Token.js.map +1 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +3 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +56 -5
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.d.ts +1 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.d.ts +1 -1
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum-typed.json +1 -5
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum.json +1 -5
- package/v1/serializer/v3/serializer-companion.d.ts +13 -0
- package/v1/serializer/v3/serializer-companion.js +190 -0
- package/v1/serializer/v3/serializer-companion.js.map +1 -0
- package/v1/serializer/v3/validators/transaction-validator.d.ts +1 -4
- package/v1/serializer/v3/validators/transaction-validator.js +1 -10
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
- package/v1/types/transaction.d.ts +2 -0
- package/v1/protocol/EthereumClassicProtocol.d.ts +0 -8
- package/v1/protocol/EthereumClassicProtocol.js +0 -87
- package/v1/protocol/EthereumClassicProtocol.js.map +0 -1
- package/v1/protocol/EthereumRopstenProtocol.d.ts +0 -8
- package/v1/protocol/EthereumRopstenProtocol.js +0 -64
- package/v1/protocol/EthereumRopstenProtocol.js.map +0 -1
- package/v1/utils/transaction.d.ts +0 -3
- package/v1/utils/transaction.js +0 -29
- package/v1/utils/transaction.js.map +0 -1
|
@@ -25,53 +25,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
25
25
|
};
|
|
26
26
|
return __assign.apply(this, arguments);
|
|
27
27
|
};
|
|
28
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
|
-
function step(op) {
|
|
42
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
-
while (_) try {
|
|
44
|
-
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;
|
|
45
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
|
-
switch (op[0]) {
|
|
47
|
-
case 0: case 1: t = op; break;
|
|
48
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
49
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
50
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
51
|
-
default:
|
|
52
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
53
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
55
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
56
|
-
if (t[2]) _.ops.pop();
|
|
57
|
-
_.trys.pop(); continue;
|
|
58
|
-
}
|
|
59
|
-
op = body.call(thisArg, _);
|
|
60
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
61
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
29
|
exports.createEthereumProtocolOptions = exports.ETHEREUM_MAINNET_PROTOCOL_NETWORK = exports.createEthereumProtocol = void 0;
|
|
66
|
-
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
67
|
-
// @ts-ignore
|
|
68
|
-
var bip39_2_5_0_1 = require("@airgap/coinlib-core/dependencies/src/bip39-2.5.0");
|
|
69
|
-
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
70
|
-
var module_kit_1 = require("@airgap/module-kit");
|
|
71
30
|
var EtherscanInfoClient_1 = require("../clients/info/EtherscanInfoClient");
|
|
72
31
|
var AirGapNodeClient_1 = require("../clients/node/AirGapNodeClient");
|
|
73
|
-
var key_1 = require("../utils/key");
|
|
74
|
-
var transaction_1 = require("../utils/transaction");
|
|
75
32
|
var EthereumBaseProtocol_1 = require("./EthereumBaseProtocol");
|
|
76
33
|
// Implementation
|
|
77
34
|
var EthereumProtocolImpl = /** @class */ (function (_super) {
|
|
@@ -79,221 +36,8 @@ var EthereumProtocolImpl = /** @class */ (function (_super) {
|
|
|
79
36
|
function EthereumProtocolImpl(options) {
|
|
80
37
|
if (options === void 0) { options = {}; }
|
|
81
38
|
var completeOptions = createEthereumProtocolOptions(options.network);
|
|
82
|
-
return _super.call(this, new AirGapNodeClient_1.AirGapNodeClient(completeOptions.network.rpcUrl), new EtherscanInfoClient_1.EtherscanInfoClient(completeOptions.network.blockExplorerApi),
|
|
39
|
+
return _super.call(this, new AirGapNodeClient_1.AirGapNodeClient(completeOptions.network.rpcUrl), new EtherscanInfoClient_1.EtherscanInfoClient(completeOptions.network.blockExplorerApi), completeOptions) || this;
|
|
83
40
|
}
|
|
84
|
-
// Common
|
|
85
|
-
EthereumProtocolImpl.prototype.getAddressFromPublicKey = function (publicKey) {
|
|
86
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
-
return __generator(this, function (_a) {
|
|
88
|
-
return [2 /*return*/, _super.prototype.getAddressFromPublicKey.call(this, this.nonExtendedPublicKey(publicKey))];
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
EthereumProtocolImpl.prototype.deriveFromExtendedPublicKey = function (extendedPublicKey, visibilityIndex, addressIndex) {
|
|
93
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
-
return __generator(this, function (_a) {
|
|
95
|
-
return [2 /*return*/, this.getPublicKeyFromExtendedPublicKey(extendedPublicKey, visibilityIndex, addressIndex)];
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
EthereumProtocolImpl.prototype.getDetailsFromTransaction = function (transaction, publicKey) {
|
|
100
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
101
|
-
var _a, dps, derivedPublicKey, ownAddress, derivedPublicKey, ownAddress;
|
|
102
|
-
return __generator(this, function (_b) {
|
|
103
|
-
switch (_b.label) {
|
|
104
|
-
case 0:
|
|
105
|
-
if (publicKey.type === 'pub') {
|
|
106
|
-
return [2 /*return*/, _super.prototype.getDetailsFromTransaction.call(this, transaction, publicKey)];
|
|
107
|
-
}
|
|
108
|
-
_a = transaction.type;
|
|
109
|
-
switch (_a) {
|
|
110
|
-
case 'signed': return [3 /*break*/, 1];
|
|
111
|
-
case 'unsigned': return [3 /*break*/, 2];
|
|
112
|
-
}
|
|
113
|
-
return [3 /*break*/, 6];
|
|
114
|
-
case 1: return [2 /*return*/, this.getDetailsFromSignedTransaction(transaction)];
|
|
115
|
-
case 2:
|
|
116
|
-
if (!(0, transaction_1.isTypedUnsignedTransaction)(transaction)) return [3 /*break*/, 4];
|
|
117
|
-
dps = transaction.derivationPath.split('/');
|
|
118
|
-
derivedPublicKey = this.getPublicKeyFromExtendedPublicKey(publicKey, Number(dps[dps.length - 2]), Number(dps[dps.length - 1]));
|
|
119
|
-
return [4 /*yield*/, this.getAddressFromPublicKey(derivedPublicKey)];
|
|
120
|
-
case 3:
|
|
121
|
-
ownAddress = _b.sent();
|
|
122
|
-
return [2 /*return*/, this.getDetailsFromTypedUnsignedTransaction(transaction, ownAddress)];
|
|
123
|
-
case 4:
|
|
124
|
-
derivedPublicKey = this.getPublicKeyFromExtendedPublicKey(publicKey, 0, 0);
|
|
125
|
-
return [4 /*yield*/, this.getAddressFromPublicKey(derivedPublicKey)];
|
|
126
|
-
case 5:
|
|
127
|
-
ownAddress = _b.sent();
|
|
128
|
-
return [2 /*return*/, this.getDetailsFromRawUnsignedTransaction(transaction, ownAddress)];
|
|
129
|
-
case 6:
|
|
130
|
-
(0, coinlib_core_1.assertNever)(transaction);
|
|
131
|
-
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.ETHEREUM, 'Unsupported transaction type.');
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
};
|
|
136
|
-
EthereumProtocolImpl.prototype.verifyMessageWithPublicKey = function (message, signature, publicKey) {
|
|
137
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
138
|
-
return __generator(this, function (_a) {
|
|
139
|
-
return [2 /*return*/, _super.prototype.verifyMessageWithPublicKey.call(this, message, signature, this.nonExtendedPublicKey(publicKey))];
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
};
|
|
143
|
-
EthereumProtocolImpl.prototype.encryptAsymmetricWithPublicKey = function (payload, publicKey) {
|
|
144
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
145
|
-
return __generator(this, function (_a) {
|
|
146
|
-
return [2 /*return*/, _super.prototype.encryptAsymmetricWithPublicKey.call(this, payload, this.nonExtendedPublicKey(publicKey))];
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
};
|
|
150
|
-
// Offline
|
|
151
|
-
EthereumProtocolImpl.prototype.getExtendedKeyPairFromSecret = function (secret, derivationPath) {
|
|
152
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
153
|
-
return __generator(this, function (_a) {
|
|
154
|
-
switch (secret.type) {
|
|
155
|
-
case 'hex':
|
|
156
|
-
return [2 /*return*/, this.getExtendedKeyPairFromHexSecret(secret.value, derivationPath)];
|
|
157
|
-
case 'mnemonic':
|
|
158
|
-
return [2 /*return*/, this.getExtendedKeyPairFromMnemonic(secret.value, derivationPath, secret.password)];
|
|
159
|
-
default:
|
|
160
|
-
(0, coinlib_core_1.assertNever)(secret);
|
|
161
|
-
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.BITCOIN, 'Unsupported secret type.');
|
|
162
|
-
}
|
|
163
|
-
return [2 /*return*/];
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
};
|
|
167
|
-
EthereumProtocolImpl.prototype.getExtendedKeyPairFromHexSecret = function (secret, derivationPath) {
|
|
168
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
169
|
-
var node, derivedNode;
|
|
170
|
-
return __generator(this, function (_a) {
|
|
171
|
-
node = this.bitcoinJS.lib.HDNode.fromSeedHex(secret, this.bitcoinJS.config.network);
|
|
172
|
-
derivedNode = derivationPath ? node.derivePath(derivationPath) : node;
|
|
173
|
-
return [2 /*return*/, {
|
|
174
|
-
secretKey: (0, module_kit_1.newExtendedSecretKey)(derivedNode.toBase58(), 'encoded'),
|
|
175
|
-
publicKey: (0, module_kit_1.newExtendedPublicKey)(derivedNode.neutered().toBase58(), 'encoded')
|
|
176
|
-
}];
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
};
|
|
180
|
-
EthereumProtocolImpl.prototype.getExtendedKeyPairFromMnemonic = function (mnemonic, derivationPath, password) {
|
|
181
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
182
|
-
var secret;
|
|
183
|
-
return __generator(this, function (_a) {
|
|
184
|
-
secret = (0, bip39_2_5_0_1.mnemonicToSeed)(mnemonic, password);
|
|
185
|
-
return [2 /*return*/, this.getExtendedKeyPairFromHexSecret(secret.toString('hex'), derivationPath)];
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
|
-
EthereumProtocolImpl.prototype.deriveFromExtendedSecretKey = function (extendedSecretKey, visibilityIndex, addressIndex) {
|
|
190
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
191
|
-
return __generator(this, function (_a) {
|
|
192
|
-
return [2 /*return*/, this.getSecretKeyFromExtendedSecretKey(extendedSecretKey, visibilityIndex, addressIndex)];
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
};
|
|
196
|
-
EthereumProtocolImpl.prototype.signTransactionWithSecretKey = function (transaction, secretKey) {
|
|
197
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
198
|
-
return __generator(this, function (_a) {
|
|
199
|
-
return [2 /*return*/, _super.prototype.signTransactionWithSecretKey.call(this, transaction, this.nonExtendedSecretKey(secretKey))];
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
};
|
|
203
|
-
EthereumProtocolImpl.prototype.signMessageWithKeyPair = function (message, keyPair) {
|
|
204
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
205
|
-
return __generator(this, function (_a) {
|
|
206
|
-
return [2 /*return*/, _super.prototype.signMessageWithKeyPair.call(this, message, {
|
|
207
|
-
secretKey: this.nonExtendedSecretKey(keyPair.secretKey),
|
|
208
|
-
publicKey: this.nonExtendedPublicKey(keyPair.publicKey)
|
|
209
|
-
})];
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
};
|
|
213
|
-
EthereumProtocolImpl.prototype.decryptAsymmetricWithKeyPair = function (payload, keyPair) {
|
|
214
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
215
|
-
return __generator(this, function (_a) {
|
|
216
|
-
return [2 /*return*/, _super.prototype.decryptAsymmetricWithKeyPair.call(this, payload, {
|
|
217
|
-
secretKey: this.nonExtendedSecretKey(keyPair.secretKey),
|
|
218
|
-
publicKey: this.nonExtendedPublicKey(keyPair.publicKey)
|
|
219
|
-
})];
|
|
220
|
-
});
|
|
221
|
-
});
|
|
222
|
-
};
|
|
223
|
-
EthereumProtocolImpl.prototype.encryptAESWithSecretKey = function (payload, secretKey) {
|
|
224
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
225
|
-
return __generator(this, function (_a) {
|
|
226
|
-
return [2 /*return*/, _super.prototype.encryptAESWithSecretKey.call(this, payload, this.nonExtendedSecretKey(secretKey))];
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
};
|
|
230
|
-
EthereumProtocolImpl.prototype.decryptAESWithSecretKey = function (payload, secretKey) {
|
|
231
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
232
|
-
return __generator(this, function (_a) {
|
|
233
|
-
return [2 /*return*/, _super.prototype.decryptAESWithSecretKey.call(this, payload, this.nonExtendedSecretKey(secretKey))];
|
|
234
|
-
});
|
|
235
|
-
});
|
|
236
|
-
};
|
|
237
|
-
// Online
|
|
238
|
-
EthereumProtocolImpl.prototype.getTransactionsForPublicKey = function (publicKey, limit, cursor) {
|
|
239
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
240
|
-
return __generator(this, function (_a) {
|
|
241
|
-
return [2 /*return*/, _super.prototype.getTransactionsForPublicKey.call(this, this.nonExtendedPublicKey(publicKey), limit, cursor)];
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
};
|
|
245
|
-
EthereumProtocolImpl.prototype.getBalanceOfPublicKey = function (publicKey) {
|
|
246
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
247
|
-
return __generator(this, function (_a) {
|
|
248
|
-
return [2 /*return*/, _super.prototype.getBalanceOfPublicKey.call(this, this.nonExtendedPublicKey(publicKey))];
|
|
249
|
-
});
|
|
250
|
-
});
|
|
251
|
-
};
|
|
252
|
-
EthereumProtocolImpl.prototype.getTransactionMaxAmountWithPublicKey = function (publicKey, to, configuration) {
|
|
253
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
254
|
-
return __generator(this, function (_a) {
|
|
255
|
-
return [2 /*return*/, _super.prototype.getTransactionMaxAmountWithPublicKey.call(this, this.nonExtendedPublicKey(publicKey), to, configuration)];
|
|
256
|
-
});
|
|
257
|
-
});
|
|
258
|
-
};
|
|
259
|
-
EthereumProtocolImpl.prototype.getTransactionFeeWithPublicKey = function (publicKey, details) {
|
|
260
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
261
|
-
return __generator(this, function (_a) {
|
|
262
|
-
return [2 /*return*/, _super.prototype.getTransactionFeeWithPublicKey.call(this, this.nonExtendedPublicKey(publicKey), details)];
|
|
263
|
-
});
|
|
264
|
-
});
|
|
265
|
-
};
|
|
266
|
-
EthereumProtocolImpl.prototype.prepareTransactionWithPublicKey = function (publicKey, details, configuration) {
|
|
267
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
268
|
-
return __generator(this, function (_a) {
|
|
269
|
-
return [2 /*return*/, _super.prototype.prepareTransactionWithPublicKey.call(this, this.nonExtendedPublicKey(publicKey), details, configuration)];
|
|
270
|
-
});
|
|
271
|
-
});
|
|
272
|
-
};
|
|
273
|
-
// Custom
|
|
274
|
-
EthereumProtocolImpl.prototype.nonExtendedPublicKey = function (publicKey) {
|
|
275
|
-
return publicKey.type === 'pub' ? publicKey : this.getPublicKeyFromExtendedPublicKey(publicKey);
|
|
276
|
-
};
|
|
277
|
-
EthereumProtocolImpl.prototype.nonExtendedSecretKey = function (secretKey) {
|
|
278
|
-
return secretKey.type === 'priv' ? secretKey : this.getSecretKeyFromExtendedSecretKey(secretKey);
|
|
279
|
-
};
|
|
280
|
-
EthereumProtocolImpl.prototype.getPublicKeyFromExtendedPublicKey = function (extendedPublicKey, visibilityIndex, addressIndex) {
|
|
281
|
-
if (visibilityIndex === void 0) { visibilityIndex = 0; }
|
|
282
|
-
if (addressIndex === void 0) { addressIndex = 0; }
|
|
283
|
-
var encodedExtendedPublicKey = (0, key_1.convertExtendedPublicKey)(extendedPublicKey, 'encoded');
|
|
284
|
-
var derivedNode = this.deriveNode(encodedExtendedPublicKey.value, visibilityIndex, addressIndex);
|
|
285
|
-
return (0, module_kit_1.newPublicKey)(derivedNode.neutered().keyPair.getPublicKeyBuffer().toString('hex'), 'hex');
|
|
286
|
-
};
|
|
287
|
-
EthereumProtocolImpl.prototype.getSecretKeyFromExtendedSecretKey = function (extendedSecretKey, visibilityIndex, addressIndex) {
|
|
288
|
-
if (visibilityIndex === void 0) { visibilityIndex = 0; }
|
|
289
|
-
if (addressIndex === void 0) { addressIndex = 0; }
|
|
290
|
-
var encodedExtendedSecretKey = (0, key_1.convertExtendedSecretKey)(extendedSecretKey, 'encoded');
|
|
291
|
-
var derivedNode = this.deriveNode(encodedExtendedSecretKey.value, visibilityIndex, addressIndex);
|
|
292
|
-
return (0, module_kit_1.newSecretKey)(derivedNode.keyPair.getPrivateKeyBuffer().toString('hex'), 'hex');
|
|
293
|
-
};
|
|
294
|
-
EthereumProtocolImpl.prototype.deriveNode = function (base58, visibilityIndex, addressIndex) {
|
|
295
|
-
return [visibilityIndex, addressIndex].reduce(function (node, index) { return node.derive(index); }, this.bitcoinJS.lib.HDNode.fromBase58(base58, this.bitcoinJS.config.network));
|
|
296
|
-
};
|
|
297
41
|
return EthereumProtocolImpl;
|
|
298
42
|
}(EthereumBaseProtocol_1.DefaultEthereumBaseProtocolImpl));
|
|
299
43
|
// Factory
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumProtocol.js","sourceRoot":"","sources":["../../../src/v1/protocol/EthereumProtocol.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumProtocol.js","sourceRoot":"","sources":["../../../src/v1/protocol/EthereumProtocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2EAAyE;AACzE,qEAAmE;AAGnE,+DAA8F;AAO9F,iBAAiB;AAEjB;IAAmC,wCAA+B;IAChE,8BAAmB,OAAuD;QAAvD,wBAAA,EAAA,YAAuD;QACxE,IAAM,eAAe,GAA4B,6BAA6B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;eAE/F,kBACE,IAAI,mCAAgB,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,EACpD,IAAI,yCAAmB,CAAC,eAAe,CAAC,OAAO,CAAC,gBAAgB,CAAC,EACjE,eAAe,CAChB;IACH,CAAC;IACH,2BAAC;AAAD,CAAC,AAVD,CAAmC,sDAA+B,GAUjE;AAED,UAAU;AAEV,SAAgB,sBAAsB,CAAC,OAAuD;IAAvD,wBAAA,EAAA,YAAuD;IAC5F,OAAO,IAAI,oBAAoB,CAAC,OAAO,CAAC,CAAA;AAC1C,CAAC;AAFD,wDAEC;AAEY,QAAA,iCAAiC,GAA4B;IACxE,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,mDAAmD;IAC3D,OAAO,EAAE,CAAC;IACV,gBAAgB,EAAE,0BAA0B;CAC7C,CAAA;AAED,IAAM,iCAAiC,GAA4B,yCAAiC,CAAA;AAEpG,SAAgB,6BAA6B,CAAC,OAA8C;IAA9C,wBAAA,EAAA,YAA8C;IAC1F,OAAO;QACL,OAAO,wBAAO,iCAAiC,GAAK,OAAO,CAAE;KAC9D,CAAA;AACH,CAAC;AAJD,sEAIC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AirGapInterface } from '@airgap/module-kit';
|
|
2
|
-
import { ERC20TokenMetadata } from '../../types/protocol';
|
|
2
|
+
import { ERC20TokenMetadata, EthereumProtocolNetwork, EthereumProtocolOptions } from '../../types/protocol';
|
|
3
3
|
import { EthereumBaseProtocol } from '../EthereumBaseProtocol';
|
|
4
4
|
export interface ERC20Token extends AirGapInterface<EthereumBaseProtocol<string>, 'SingleTokenSubProtocol'> {
|
|
5
5
|
}
|
|
6
6
|
export declare function createERC20Token(metadata: ERC20TokenMetadata): ERC20Token;
|
|
7
|
+
export declare const ETHEREUM_ERC20_MAINNET_PROTOCOL_NETWORK: EthereumProtocolNetwork;
|
|
8
|
+
export declare function createERC20TokenOptions(network?: Partial<EthereumProtocolNetwork>): EthereumProtocolOptions;
|
|
@@ -88,7 +88,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
88
88
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
89
89
|
};
|
|
90
90
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
91
|
-
exports.createERC20Token = void 0;
|
|
91
|
+
exports.createERC20TokenOptions = exports.ETHEREUM_ERC20_MAINNET_PROTOCOL_NETWORK = exports.createERC20Token = void 0;
|
|
92
92
|
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
93
93
|
var bignumber_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber"));
|
|
94
94
|
// @ts-ignore
|
|
@@ -100,9 +100,8 @@ var tx_1 = require("@ethereumjs/tx");
|
|
|
100
100
|
var EtherscanInfoClient_1 = require("../../clients/info/EtherscanInfoClient");
|
|
101
101
|
var AirGapNodeClient_1 = require("../../clients/node/AirGapNodeClient");
|
|
102
102
|
var EthereumUtils_1 = require("../../utils/EthereumUtils");
|
|
103
|
-
var transaction_1 = require("../../utils/transaction");
|
|
104
103
|
var EthereumBaseProtocol_1 = require("../EthereumBaseProtocol");
|
|
105
|
-
var
|
|
104
|
+
var EthereumProtocol_1 = require("../EthereumProtocol");
|
|
106
105
|
var EthereumTransaction = require('@airgap/coinlib-core/dependencies/src/ethereumjs-tx-1.3.7/index');
|
|
107
106
|
// Implementation
|
|
108
107
|
var ERC20TokenImpl = /** @class */ (function (_super) {
|
|
@@ -185,7 +184,7 @@ var ERC20TokenImpl = /** @class */ (function (_super) {
|
|
|
185
184
|
if (ethTransactionDetails.length !== 1) {
|
|
186
185
|
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.ERC20, 'More than one ETH transaction detected.');
|
|
187
186
|
}
|
|
188
|
-
if (
|
|
187
|
+
if (transaction.ethereumType === 'raw') {
|
|
189
188
|
data = transaction.data;
|
|
190
189
|
}
|
|
191
190
|
else {
|
|
@@ -204,7 +203,7 @@ var ERC20TokenImpl = /** @class */ (function (_super) {
|
|
|
204
203
|
return __awaiter(this, void 0, void 0, function () {
|
|
205
204
|
var rawTransaction;
|
|
206
205
|
return __generator(this, function (_a) {
|
|
207
|
-
if (
|
|
206
|
+
if (transaction.ethereumType !== 'raw') {
|
|
208
207
|
// no v0 implementation
|
|
209
208
|
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.ERC20, 'Unsupported unsigned transaction type.');
|
|
210
209
|
}
|
|
@@ -361,6 +360,7 @@ var ERC20TokenImpl = /** @class */ (function (_super) {
|
|
|
361
360
|
? new bignumber_1.default(0)
|
|
362
361
|
: wrappedFee.div(estimatedGas).integerValue(bignumber_1.default.ROUND_CEIL);
|
|
363
362
|
transaction = (0, module_kit_1.newUnsignedTransaction)({
|
|
363
|
+
ethereumType: 'raw',
|
|
364
364
|
nonce: EthereumUtils_1.EthereumUtils.toHex(txCount),
|
|
365
365
|
gasLimit: EthereumUtils_1.EthereumUtils.toHex(estimatedGas.toFixed()),
|
|
366
366
|
gasPrice: EthereumUtils_1.EthereumUtils.toHex(gasPrice.toFixed()),
|
|
@@ -399,7 +399,7 @@ var ERC20TokenImpl = /** @class */ (function (_super) {
|
|
|
399
399
|
// Factory
|
|
400
400
|
function createERC20Token(metadata) {
|
|
401
401
|
var _a;
|
|
402
|
-
var protocolOptions = (
|
|
402
|
+
var protocolOptions = createERC20TokenOptions();
|
|
403
403
|
var tokenOptions = __assign(__assign({}, protocolOptions), { name: metadata.name, identifier: metadata.identifier, contractAddress: metadata.contractAddress, units: (_a = {},
|
|
404
404
|
_a[metadata.symbol] = {
|
|
405
405
|
symbol: { value: metadata.symbol, market: metadata.marketSymbol },
|
|
@@ -409,4 +409,13 @@ function createERC20Token(metadata) {
|
|
|
409
409
|
return new ERC20TokenImpl(new AirGapNodeClient_1.AirGapNodeClient(protocolOptions.network.rpcUrl), new EtherscanInfoClient_1.EtherscanInfoClient(protocolOptions.network.blockExplorerApi), tokenOptions);
|
|
410
410
|
}
|
|
411
411
|
exports.createERC20Token = createERC20Token;
|
|
412
|
+
exports.ETHEREUM_ERC20_MAINNET_PROTOCOL_NETWORK = __assign(__assign({}, EthereumProtocol_1.ETHEREUM_MAINNET_PROTOCOL_NETWORK), { chainId: 3 });
|
|
413
|
+
var DEFAULT_ERC20_PROTOCOL_NETWORK = exports.ETHEREUM_ERC20_MAINNET_PROTOCOL_NETWORK;
|
|
414
|
+
function createERC20TokenOptions(network) {
|
|
415
|
+
if (network === void 0) { network = {}; }
|
|
416
|
+
return {
|
|
417
|
+
network: __assign(__assign({}, DEFAULT_ERC20_PROTOCOL_NETWORK), network)
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
exports.createERC20TokenOptions = createERC20TokenOptions;
|
|
412
421
|
//# sourceMappingURL=ERC20Token.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20Token.js","sourceRoot":"","sources":["../../../../src/v1/protocol/erc20/ERC20Token.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA+E;AAC/E,iHAA0F;AAC1F,aAAa;AACb,mGAAsF;AACtF,sDAAqG;AACrG,sDAAsD;AACtD,iDAc2B;AAC3B,qCAAgF;AAGhF,8EAA4E;AAC5E,wEAA+F;
|
|
1
|
+
{"version":3,"file":"ERC20Token.js","sourceRoot":"","sources":["../../../../src/v1/protocol/erc20/ERC20Token.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA+E;AAC/E,iHAA0F;AAC1F,aAAa;AACb,mGAAsF;AACtF,sDAAqG;AACrG,sDAAsD;AACtD,iDAc2B;AAC3B,qCAAgF;AAGhF,8EAA4E;AAC5E,wEAA+F;AAe/F,2DAAyD;AACzD,gEAAwF;AACxF,wDAAuE;AAEvE,IAAM,mBAAmB,GAAG,OAAO,CAAC,iEAAiE,CAAC,CAAA;AAMtG,iBAAiB;AAEjB;IAA6B,kCAAgC;IAG3D,wBAAmB,UAA8B,EAAE,UAA8B,EAAE,OAA0B;QAA7G,YACE,kBAAM,UAAU,EAAE,UAAU,EAAE;YAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;YAExB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,UAAU,EAAE,OAAO,CAAC,UAAU;YAE9B,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B,CAAC,SAEH;QADC,KAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAA;;IAChD,CAAC;IAED,cAAc;IAED,gCAAO,GAApB;;;gBACE,sBAAO,OAAO,EAAA;;;KAC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IAAM,8BAA8B,GAA4B,+CAAuC,CAAA;AAEvG,SAAgB,uBAAuB,CAAC,OAA8C;IAA9C,wBAAA,EAAA,YAA8C;IACpF,OAAO;QACL,OAAO,wBAAO,8BAA8B,GAAK,OAAO,CAAE;KAC3D,CAAA;AACH,CAAC;AAJD,0DAIC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { EthereumRawUnsignedTransaction, EthereumSignedTransaction, EthereumTypedUnsignedTransaction } from '../../../../types/transaction';
|
|
1
|
+
import { EthereumRawUnsignedTransaction, EthereumSignedTransaction, EthereumTypedUnsignedTransaction, EthereumUnsignedTransaction } from '../../../../types/transaction';
|
|
2
2
|
import { EthereumTransactionSignRequest } from '../definitions/transaction-sign-request-ethereum';
|
|
3
3
|
import { EthereumTypedTransactionSignRequest } from '../definitions/transaction-sign-request-ethereum-typed';
|
|
4
4
|
import { EthereumTransactionSignResponse } from '../definitions/transaction-sign-response-ethereum';
|
|
5
|
+
export declare function ethereumUnsignedTransactionToRequest(unsigned: EthereumUnsignedTransaction, publicKey: string, callbackUrl?: string): EthereumTransactionSignRequest | EthereumTypedTransactionSignRequest;
|
|
5
6
|
export declare function ethereumRawUnsignedTransactionToRequest(unsigned: EthereumRawUnsignedTransaction, publicKey: string, callbackUrl?: string): EthereumTransactionSignRequest;
|
|
6
7
|
export declare function ethereumTypedUnsignedTransactionToRequest(unsigned: EthereumTypedUnsignedTransaction, publicKey: string, callbackUrl?: string): EthereumTypedTransactionSignRequest;
|
|
7
8
|
export declare function ethereumSignedTransactionToResponse(signed: EthereumSignedTransaction, accountIdentifier: string): EthereumTransactionSignResponse;
|
|
9
|
+
export declare function ethereumTransactionSignRequestToUnsigned(request: EthereumTransactionSignRequest | EthereumTypedTransactionSignRequest): EthereumUnsignedTransaction;
|
|
8
10
|
export declare function ethereumTransactionSignRequestToRawUnsigned(request: EthereumTransactionSignRequest): EthereumRawUnsignedTransaction;
|
|
9
11
|
export declare function ethereumTransactionSignRequestToTypedUnsigned(request: EthereumTypedTransactionSignRequest): EthereumTypedUnsignedTransaction;
|
|
10
12
|
export declare function ethereumTransactionSignResponseToSigned(response: EthereumTransactionSignResponse): EthereumSignedTransaction;
|
|
@@ -1,25 +1,76 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
2
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ethereumTransactionSignResponseToSigned = exports.ethereumTransactionSignRequestToTypedUnsigned = exports.ethereumTransactionSignRequestToRawUnsigned = exports.ethereumSignedTransactionToResponse = exports.ethereumTypedUnsignedTransactionToRequest = exports.ethereumRawUnsignedTransactionToRequest = void 0;
|
|
25
|
+
exports.ethereumTransactionSignResponseToSigned = exports.ethereumTransactionSignRequestToTypedUnsigned = exports.ethereumTransactionSignRequestToRawUnsigned = exports.ethereumTransactionSignRequestToUnsigned = exports.ethereumSignedTransactionToResponse = exports.ethereumTypedUnsignedTransactionToRequest = exports.ethereumRawUnsignedTransactionToRequest = exports.ethereumUnsignedTransactionToRequest = void 0;
|
|
4
26
|
var module_kit_1 = require("@airgap/module-kit");
|
|
27
|
+
function isEthereumTypedTransactionSignRequest(request) {
|
|
28
|
+
return (0, module_kit_1.implementsInterface)(request.transaction, {
|
|
29
|
+
derivationPath: 'required',
|
|
30
|
+
masterFingerprint: 'required',
|
|
31
|
+
serialized: 'required'
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function ethereumUnsignedTransactionToRequest(unsigned, publicKey, callbackUrl) {
|
|
35
|
+
return unsigned.ethereumType === 'raw'
|
|
36
|
+
? ethereumRawUnsignedTransactionToRequest(unsigned, publicKey, callbackUrl)
|
|
37
|
+
: ethereumTypedUnsignedTransactionToRequest(unsigned, publicKey, callbackUrl);
|
|
38
|
+
}
|
|
39
|
+
exports.ethereumUnsignedTransactionToRequest = ethereumUnsignedTransactionToRequest;
|
|
5
40
|
function ethereumRawUnsignedTransactionToRequest(unsigned, publicKey, callbackUrl) {
|
|
6
|
-
|
|
41
|
+
var _ = unsigned.type, rest = __rest(unsigned, ["type"]);
|
|
42
|
+
return {
|
|
43
|
+
transaction: rest,
|
|
44
|
+
publicKey: publicKey,
|
|
45
|
+
callbackURL: callbackUrl
|
|
46
|
+
};
|
|
7
47
|
}
|
|
8
48
|
exports.ethereumRawUnsignedTransactionToRequest = ethereumRawUnsignedTransactionToRequest;
|
|
9
49
|
function ethereumTypedUnsignedTransactionToRequest(unsigned, publicKey, callbackUrl) {
|
|
10
|
-
|
|
50
|
+
var _ = unsigned.type, rest = __rest(unsigned, ["type"]);
|
|
51
|
+
return {
|
|
52
|
+
transaction: rest,
|
|
53
|
+
publicKey: publicKey,
|
|
54
|
+
callbackURL: callbackUrl
|
|
55
|
+
};
|
|
11
56
|
}
|
|
12
57
|
exports.ethereumTypedUnsignedTransactionToRequest = ethereumTypedUnsignedTransactionToRequest;
|
|
13
58
|
function ethereumSignedTransactionToResponse(signed, accountIdentifier) {
|
|
14
59
|
return { transaction: signed.serialized, accountIdentifier: accountIdentifier };
|
|
15
60
|
}
|
|
16
61
|
exports.ethereumSignedTransactionToResponse = ethereumSignedTransactionToResponse;
|
|
62
|
+
function ethereumTransactionSignRequestToUnsigned(request) {
|
|
63
|
+
return isEthereumTypedTransactionSignRequest(request)
|
|
64
|
+
? ethereumTransactionSignRequestToTypedUnsigned(request)
|
|
65
|
+
: ethereumTransactionSignRequestToRawUnsigned(request);
|
|
66
|
+
}
|
|
67
|
+
exports.ethereumTransactionSignRequestToUnsigned = ethereumTransactionSignRequestToUnsigned;
|
|
17
68
|
function ethereumTransactionSignRequestToRawUnsigned(request) {
|
|
18
|
-
return request.transaction;
|
|
69
|
+
return (0, module_kit_1.newUnsignedTransaction)(__assign({ ethereumType: 'raw' }, request.transaction));
|
|
19
70
|
}
|
|
20
71
|
exports.ethereumTransactionSignRequestToRawUnsigned = ethereumTransactionSignRequestToRawUnsigned;
|
|
21
72
|
function ethereumTransactionSignRequestToTypedUnsigned(request) {
|
|
22
|
-
return request.transaction;
|
|
73
|
+
return (0, module_kit_1.newUnsignedTransaction)(__assign({ ethereumType: 'typed' }, request.transaction));
|
|
23
74
|
}
|
|
24
75
|
exports.ethereumTransactionSignRequestToTypedUnsigned = ethereumTransactionSignRequestToTypedUnsigned;
|
|
25
76
|
function ethereumTransactionSignResponseToSigned(response) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-converter.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/converter/transaction-converter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transaction-converter.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/converter/transaction-converter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAsG;AAetG,SAAS,qCAAqC,CAC5C,OAA6E;IAE7E,OAAO,IAAA,gCAAmB,EAA+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CAA2C,CAAC,OAAO,CAAC,CAAA;AAC1D,CAAC;AAND,4FAMC;AAED,SAAgB,2CAA2C,CAAC,OAAuC;IACjG,OAAO,IAAA,mCAAsB,aAAmC,YAAY,EAAE,KAAK,IAAK,OAAO,CAAC,WAAW,EAAG,CAAA;AAChH,CAAC;AAFD,kGAEC;AAED,SAAgB,6CAA6C,CAC3D,OAA4C;IAE5C,OAAO,IAAA,mCAAsB,aAAqC,YAAY,EAAE,OAAO,IAAK,OAAO,CAAC,WAAW,EAAG,CAAA;AACpH,CAAC;AAJD,sGAIC;AAED,SAAgB,uCAAuC,CAAC,QAAyC;IAC/F,OAAO,IAAA,iCAAoB,EAA4B,EAAE,UAAU,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;AAC9F,CAAC;AAFD,0FAEC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TransactionSignRequest } from '@airgap/serializer';
|
|
2
2
|
import { HexString } from '@airgap/serializer/v3/schemas/definitions/hex-string';
|
|
3
3
|
import { EthereumTypedUnsignedTransaction } from '../../../../types/transaction';
|
|
4
|
-
export interface SerializableEthereumTypedUnsignedTransaction extends EthereumTypedUnsignedTransaction {
|
|
4
|
+
export interface SerializableEthereumTypedUnsignedTransaction extends Omit<EthereumTypedUnsignedTransaction, 'type' | 'ethereumType'> {
|
|
5
5
|
serialized: HexString;
|
|
6
6
|
derivationPath: string;
|
|
7
7
|
masterFingerprint: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TransactionSignRequest } from '@airgap/serializer';
|
|
2
2
|
import { HexString } from '@airgap/serializer/v3/schemas/definitions/hex-string';
|
|
3
3
|
import { EthereumRawUnsignedTransaction } from '../../../../types/transaction';
|
|
4
|
-
export interface SerializableEthereumRawUnsignedTransaction extends EthereumRawUnsignedTransaction {
|
|
4
|
+
export interface SerializableEthereumRawUnsignedTransaction extends Omit<EthereumRawUnsignedTransaction, 'type' | 'ethereumType'> {
|
|
5
5
|
nonce: HexString;
|
|
6
6
|
gasPrice: HexString;
|
|
7
7
|
gasLimit: HexString;
|
|
@@ -32,13 +32,9 @@
|
|
|
32
32
|
"serialized": {
|
|
33
33
|
"$ref": "#/definitions/HexString",
|
|
34
34
|
"type": "string"
|
|
35
|
-
},
|
|
36
|
-
"type": {
|
|
37
|
-
"enum": ["unsigned"],
|
|
38
|
-
"type": "string"
|
|
39
35
|
}
|
|
40
36
|
},
|
|
41
|
-
"required": ["derivationPath", "masterFingerprint", "serialized"
|
|
37
|
+
"required": ["derivationPath", "masterFingerprint", "serialized"],
|
|
42
38
|
"type": "object"
|
|
43
39
|
}
|
|
44
40
|
}
|
|
@@ -46,16 +46,12 @@
|
|
|
46
46
|
"$ref": "#/definitions/HexString",
|
|
47
47
|
"type": "string"
|
|
48
48
|
},
|
|
49
|
-
"type": {
|
|
50
|
-
"enum": ["unsigned"],
|
|
51
|
-
"type": "string"
|
|
52
|
-
},
|
|
53
49
|
"value": {
|
|
54
50
|
"$ref": "#/definitions/HexString",
|
|
55
51
|
"type": "string"
|
|
56
52
|
}
|
|
57
53
|
},
|
|
58
|
-
"required": ["chainId", "data", "gasLimit", "gasPrice", "nonce", "to", "
|
|
54
|
+
"required": ["chainId", "data", "gasLimit", "gasPrice", "nonce", "to", "value"],
|
|
59
55
|
"type": "object"
|
|
60
56
|
}
|
|
61
57
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AirGapV3SerializerCompanion, SignedTransaction, UnsignedTransaction } from '@airgap/module-kit';
|
|
2
|
+
import { V3SchemaConfiguration } from '@airgap/module-kit/types/serializer';
|
|
3
|
+
import { TransactionSignRequest, TransactionSignResponse } from '@airgap/serializer';
|
|
4
|
+
export declare class EthereumV3SerializerCompanion implements AirGapV3SerializerCompanion {
|
|
5
|
+
readonly schemas: V3SchemaConfiguration[];
|
|
6
|
+
private readonly ethereumTransactionValidator;
|
|
7
|
+
toTransactionSignRequest(identifier: string, unsignedTransaction: UnsignedTransaction, publicKey: string, callbackUrl?: string): Promise<TransactionSignRequest>;
|
|
8
|
+
fromTransactionSignRequest(identifier: string, transactionSignRequest: TransactionSignRequest): Promise<UnsignedTransaction>;
|
|
9
|
+
validateTransactionSignRequest(identifier: string, transactionSignRequest: TransactionSignRequest): Promise<boolean>;
|
|
10
|
+
toTransactionSignResponse(identifier: string, signedTransaction: SignedTransaction, accountIdentifier: string): Promise<TransactionSignResponse>;
|
|
11
|
+
fromTransactionSignResponse(identifier: string, transactionSignResponse: TransactionSignResponse): Promise<SignedTransaction>;
|
|
12
|
+
validateTransactionSignResponse(identifier: string, transactionSignResponse: TransactionSignResponse): Promise<boolean>;
|
|
13
|
+
}
|