@airgap/mina 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/v1/block-explorer/MinaExplorerBlockExplorer.js +12 -61
- package/v1/block-explorer/MinaExplorerBlockExplorer.js.map +1 -1
- package/v1/index.js +2 -2
- package/v1/index.js.map +1 -1
- package/v1/indexer/MinaExplorerIndexer.js +64 -107
- package/v1/indexer/MinaExplorerIndexer.js.map +1 -1
- package/v1/module/MinaModule.js +38 -96
- package/v1/module/MinaModule.js.map +1 -1
- package/v1/module.js +2 -3
- package/v1/module.js.map +1 -1
- package/v1/node/GraphQLNode.js +70 -107
- package/v1/node/GraphQLNode.js.map +1 -1
- package/v1/protocol/MinaProtocol.js +179 -317
- package/v1/protocol/MinaProtocol.js.map +1 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +8 -20
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
- package/v1/serializer/v3/serializer-companion.js +69 -148
- package/v1/serializer/v3/serializer-companion.js.map +1 -1
- package/v1/serializer/v3/validators/transaction-validator.js +16 -65
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
- package/v1/serializer/v3/validators/validators.js +36 -81
- package/v1/serializer/v3/validators/validators.js.map +1 -1
- package/v1/types/crypto.d.ts +1 -1
- package/v1/types/protocol.d.ts +2 -2
- package/v1/types/transaction.d.ts +1 -1
- package/v1/utils/key.d.ts +0 -1
- package/v1/utils/key.js +23 -14
- package/v1/utils/key.js.map +1 -1
- package/v1/utils/math.js +7 -11
- package/v1/utils/math.js.map +1 -1
|
@@ -1,15 +1,4 @@
|
|
|
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
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -26,71 +15,46 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
26
15
|
}) : function(o, v) {
|
|
27
16
|
o["default"] = v;
|
|
28
17
|
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
|
-
function step(op) {
|
|
50
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
51
|
-
while (_) try {
|
|
52
|
-
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;
|
|
53
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54
|
-
switch (op[0]) {
|
|
55
|
-
case 0: case 1: t = op; break;
|
|
56
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
57
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
58
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59
|
-
default:
|
|
60
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
61
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
62
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
63
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
64
|
-
if (t[2]) _.ops.pop();
|
|
65
|
-
_.trys.pop(); continue;
|
|
66
|
-
}
|
|
67
|
-
op = body.call(thisArg, _);
|
|
68
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
69
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
|
-
}
|
|
71
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
72
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
73
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
74
37
|
};
|
|
75
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
|
-
exports.
|
|
77
|
-
|
|
78
|
-
|
|
39
|
+
exports.MINA_TESTNET_PROTOCOL_NETWORK = exports.MINA_MAINNET_PROTOCOL_NETWORK = exports.MinaProtocolImpl = void 0;
|
|
40
|
+
exports.createMinaProtocol = createMinaProtocol;
|
|
41
|
+
exports.createMinaProtocolOptions = createMinaProtocolOptions;
|
|
42
|
+
const coinlib_core_1 = require("@airgap/coinlib-core");
|
|
43
|
+
const bignumber_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber"));
|
|
79
44
|
// @ts-ignore
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
45
|
+
const BitGo = __importStar(require("@airgap/coinlib-core/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src"));
|
|
46
|
+
const errors_1 = require("@airgap/coinlib-core/errors");
|
|
47
|
+
const crypto_1 = require("@airgap/crypto");
|
|
48
|
+
const module_kit_1 = require("@airgap/module-kit");
|
|
49
|
+
const mina_signer_1 = __importDefault(require("mina-signer"));
|
|
50
|
+
const MinaExplorerIndexer_1 = require("../indexer/MinaExplorerIndexer");
|
|
51
|
+
const GraphQLNode_1 = require("../node/GraphQLNode");
|
|
52
|
+
const indexer_1 = require("../types/indexer");
|
|
53
|
+
const key_1 = require("../utils/key");
|
|
54
|
+
const math_1 = require("../utils/math");
|
|
90
55
|
// Implementation
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (options === void 0) { options = {}; }
|
|
56
|
+
class MinaProtocolImpl {
|
|
57
|
+
constructor(options = {}, node, indexer) {
|
|
94
58
|
this.bitcoinJS = {
|
|
95
59
|
lib: BitGo,
|
|
96
60
|
config: { network: BitGo.networks.bitcoin }
|
|
@@ -108,7 +72,7 @@ var MinaProtocolImpl = /** @class */ (function () {
|
|
|
108
72
|
units: this.units,
|
|
109
73
|
mainUnit: 'MINA',
|
|
110
74
|
account: {
|
|
111
|
-
standardDerivationPath:
|
|
75
|
+
standardDerivationPath: `m/44'/12586'/0'/0/0`,
|
|
112
76
|
address: {
|
|
113
77
|
isCaseSensitive: true,
|
|
114
78
|
regex: '^B62[a-km-zA-HJ-NP-Z1-9]{52}$',
|
|
@@ -121,31 +85,19 @@ var MinaProtocolImpl = /** @class */ (function () {
|
|
|
121
85
|
algorithm: 'secp256k1'
|
|
122
86
|
};
|
|
123
87
|
this.options = createMinaProtocolOptions(options.network);
|
|
124
|
-
this.node = node
|
|
125
|
-
this.indexer = indexer
|
|
88
|
+
this.node = node ?? new GraphQLNode_1.GraphQLNode(this.options.network.rpcUrl);
|
|
89
|
+
this.indexer = indexer ?? new MinaExplorerIndexer_1.MinaExplorerIndexer(this.options.network.blockExplorerApi);
|
|
126
90
|
}
|
|
127
|
-
|
|
128
|
-
return
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return [2 /*return*/, publicKey.value];
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
};
|
|
141
|
-
MinaProtocolImpl.prototype.getDetailsFromTransaction = function (transaction, publicKey) {
|
|
142
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
143
|
-
return __generator(this, function (_a) {
|
|
144
|
-
return [2 /*return*/, this.getDetailsFromMinaPayment(publicKey, transaction.data)];
|
|
145
|
-
});
|
|
146
|
-
});
|
|
147
|
-
};
|
|
148
|
-
MinaProtocolImpl.prototype.getDetailsFromMinaPayment = function (publicKey, payment) {
|
|
91
|
+
async getMetadata() {
|
|
92
|
+
return this.metadata;
|
|
93
|
+
}
|
|
94
|
+
async getAddressFromPublicKey(publicKey) {
|
|
95
|
+
return publicKey.value;
|
|
96
|
+
}
|
|
97
|
+
async getDetailsFromTransaction(transaction, publicKey) {
|
|
98
|
+
return this.getDetailsFromMinaPayment(publicKey, transaction.data);
|
|
99
|
+
}
|
|
100
|
+
getDetailsFromMinaPayment(publicKey, payment) {
|
|
149
101
|
return [
|
|
150
102
|
{
|
|
151
103
|
from: [payment.from],
|
|
@@ -157,233 +109,145 @@ var MinaProtocolImpl = /** @class */ (function () {
|
|
|
157
109
|
network: this.options.network
|
|
158
110
|
}
|
|
159
111
|
];
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
signed
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
to: signed.data.to,
|
|
199
|
-
from: signed.data.from,
|
|
200
|
-
amount: signed.data.amount.toString(),
|
|
201
|
-
fee: signed.data.fee.toString(),
|
|
202
|
-
nonce: signed.data.nonce.toString(),
|
|
203
|
-
memo: signed.data.memo,
|
|
204
|
-
validUntil: (_a = signed.data.validUntil) === null || _a === void 0 ? void 0 : _a.toString()
|
|
205
|
-
},
|
|
206
|
-
signature: {
|
|
207
|
-
type: 'legacy',
|
|
208
|
-
field: signed.signature.field,
|
|
209
|
-
scalar: signed.signature.scalar
|
|
210
|
-
}
|
|
211
|
-
})];
|
|
212
|
-
});
|
|
112
|
+
}
|
|
113
|
+
async getCryptoConfiguration() {
|
|
114
|
+
return this.cryptoConfiguration;
|
|
115
|
+
}
|
|
116
|
+
async getKeyPairFromDerivative(derivative) {
|
|
117
|
+
const node = this.derivativeToBip32Node(derivative);
|
|
118
|
+
const secretKey = (0, key_1.finalizeSecretKey)(node.keyPair.getPrivateKeyBuffer());
|
|
119
|
+
return {
|
|
120
|
+
secretKey,
|
|
121
|
+
publicKey: (0, key_1.derivePublicKey)(this.getMinaClient(), secretKey)
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
async signTransactionWithSecretKey(transaction, secretKey) {
|
|
125
|
+
const client = this.getMinaClient(transaction.networkType);
|
|
126
|
+
const signed = client.signPayment({
|
|
127
|
+
to: transaction.data.to,
|
|
128
|
+
from: transaction.data.from,
|
|
129
|
+
amount: transaction.data.amount,
|
|
130
|
+
fee: transaction.data.fee,
|
|
131
|
+
nonce: transaction.data.nonce,
|
|
132
|
+
memo: transaction.data.memo,
|
|
133
|
+
validUntil: transaction.data.validUntil
|
|
134
|
+
}, secretKey.value);
|
|
135
|
+
return (0, module_kit_1.newSignedTransaction)({
|
|
136
|
+
data: {
|
|
137
|
+
to: signed.data.to,
|
|
138
|
+
from: signed.data.from,
|
|
139
|
+
amount: signed.data.amount.toString(),
|
|
140
|
+
fee: signed.data.fee.toString(),
|
|
141
|
+
nonce: signed.data.nonce.toString(),
|
|
142
|
+
memo: signed.data.memo,
|
|
143
|
+
validUntil: signed.data.validUntil?.toString()
|
|
144
|
+
},
|
|
145
|
+
signature: {
|
|
146
|
+
type: 'legacy',
|
|
147
|
+
field: signed.signature.field,
|
|
148
|
+
scalar: signed.signature.scalar
|
|
149
|
+
}
|
|
213
150
|
});
|
|
214
|
-
}
|
|
151
|
+
}
|
|
215
152
|
// Online
|
|
216
|
-
|
|
217
|
-
return
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
return __generator(this, function (_a) {
|
|
265
|
-
switch (_a.label) {
|
|
266
|
-
case 0: return [4 /*yield*/, this.node.getBalance(publicKey.value)];
|
|
267
|
-
case 1:
|
|
268
|
-
balance = _a.sent();
|
|
269
|
-
return [2 /*return*/, {
|
|
270
|
-
total: (0, module_kit_1.newAmount)(balance.total, 'blockchain'),
|
|
271
|
-
transferable: (0, module_kit_1.newAmount)(balance.liquid, 'blockchain')
|
|
272
|
-
}];
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
});
|
|
276
|
-
};
|
|
277
|
-
MinaProtocolImpl.prototype.getTransactionMaxAmountWithPublicKey = function (publicKey, _to, configuration) {
|
|
278
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
279
|
-
var balance, fee, maxAmount;
|
|
280
|
-
return __generator(this, function (_a) {
|
|
281
|
-
switch (_a.label) {
|
|
282
|
-
case 0: return [4 /*yield*/, this.node.getBalance(publicKey.value)];
|
|
283
|
-
case 1:
|
|
284
|
-
balance = _a.sent();
|
|
285
|
-
fee = (configuration === null || configuration === void 0 ? void 0 : configuration.fee) ? (0, module_kit_1.newAmount)(configuration.fee).blockchain(this.units).value : '0';
|
|
286
|
-
maxAmount = new bignumber_1.default(balance.liquid).minus(fee);
|
|
287
|
-
return [2 /*return*/, (0, module_kit_1.newAmount)(maxAmount, 'blockchain')];
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
|
-
};
|
|
292
|
-
MinaProtocolImpl.prototype.getTransactionFeeWithPublicKey = function (_publicKey, _details, _configuration) {
|
|
293
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
294
|
-
var fees, feesQuantile;
|
|
295
|
-
return __generator(this, function (_a) {
|
|
296
|
-
switch (_a.label) {
|
|
297
|
-
case 0: return [4 /*yield*/, this.indexer.getLatestFees(20)];
|
|
298
|
-
case 1:
|
|
299
|
-
fees = _a.sent();
|
|
300
|
-
feesQuantile = function (q) {
|
|
301
|
-
return (0, math_1.quantile)(fees, q, {
|
|
302
|
-
isSorted: true /* `getLatestFees` returns an already sorted (ASC) list */,
|
|
303
|
-
roundingMode: bignumber_1.default.ROUND_CEIL
|
|
304
|
-
});
|
|
305
|
-
};
|
|
306
|
-
return [2 /*return*/, {
|
|
307
|
-
low: (0, module_kit_1.newAmount)(feesQuantile(0.25), 'blockchain'),
|
|
308
|
-
medium: (0, module_kit_1.newAmount)(feesQuantile(0.5), 'blockchain'),
|
|
309
|
-
high: (0, module_kit_1.newAmount)(feesQuantile(0.75), 'blockchain')
|
|
310
|
-
}];
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
});
|
|
314
|
-
};
|
|
315
|
-
MinaProtocolImpl.prototype.prepareTransactionWithPublicKey = function (publicKey, details, configuration) {
|
|
316
|
-
var _a, _b;
|
|
317
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
318
|
-
var paymentDetails, nonce, fee, _c, balance, amountBlockchain, feeBlockchain, transferableBlockchain;
|
|
319
|
-
return __generator(this, function (_d) {
|
|
320
|
-
switch (_d.label) {
|
|
321
|
-
case 0:
|
|
322
|
-
if (details.length !== 1) {
|
|
323
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.MINA, 'Multiple transactions not supported.');
|
|
324
|
-
}
|
|
325
|
-
paymentDetails = details[0];
|
|
326
|
-
return [4 /*yield*/, this.node.getNonce(publicKey.value)];
|
|
327
|
-
case 1:
|
|
328
|
-
nonce = _d.sent();
|
|
329
|
-
if (!((_a = configuration === null || configuration === void 0 ? void 0 : configuration.fee) !== null && _a !== void 0)) return [3 /*break*/, 2];
|
|
330
|
-
_c = _a;
|
|
331
|
-
return [3 /*break*/, 4];
|
|
332
|
-
case 2: return [4 /*yield*/, this.getTransactionFeeWithPublicKey(publicKey, details, configuration)];
|
|
333
|
-
case 3:
|
|
334
|
-
_c = (_d.sent()).medium;
|
|
335
|
-
_d.label = 4;
|
|
336
|
-
case 4:
|
|
337
|
-
fee = _c;
|
|
338
|
-
return [4 /*yield*/, this.getBalanceOfPublicKey(publicKey)];
|
|
339
|
-
case 5:
|
|
340
|
-
balance = _d.sent();
|
|
341
|
-
amountBlockchain = (0, module_kit_1.newAmount)(paymentDetails.amount).blockchain(this.units);
|
|
342
|
-
feeBlockchain = (0, module_kit_1.newAmount)(fee).blockchain(this.units);
|
|
343
|
-
transferableBlockchain = (0, module_kit_1.newAmount)((_b = balance.transferable) !== null && _b !== void 0 ? _b : balance.total).blockchain(this.units);
|
|
344
|
-
if (new bignumber_1.default(transferableBlockchain.value).minus(amountBlockchain.value).minus(feeBlockchain.value).lt(0)) {
|
|
345
|
-
throw new errors_1.BalanceError(coinlib_core_1.Domain.MINA, 'Insfficient balance.');
|
|
346
|
-
}
|
|
347
|
-
return [2 /*return*/, (0, module_kit_1.newUnsignedTransaction)({
|
|
348
|
-
networkType: this.options.network.minaType,
|
|
349
|
-
data: {
|
|
350
|
-
to: paymentDetails.to,
|
|
351
|
-
from: publicKey.value,
|
|
352
|
-
amount: amountBlockchain.value,
|
|
353
|
-
fee: feeBlockchain.value,
|
|
354
|
-
nonce: nonce,
|
|
355
|
-
memo: paymentDetails.arbitraryData
|
|
356
|
-
}
|
|
357
|
-
})];
|
|
358
|
-
}
|
|
359
|
-
});
|
|
153
|
+
async getNetwork() {
|
|
154
|
+
return this.options.network;
|
|
155
|
+
}
|
|
156
|
+
async getTransactionsForPublicKey(publicKey, limit, cursor) {
|
|
157
|
+
const transactions = await this.indexer.getTransactions(publicKey.value, limit, cursor?.lastDateTime);
|
|
158
|
+
const lastDateTime = transactions[transactions.length - 1]?.dateTime;
|
|
159
|
+
const hasNext = transactions.length >= limit;
|
|
160
|
+
const airGapTransactions = transactions.map((transaction) => ({
|
|
161
|
+
from: [transaction.from],
|
|
162
|
+
to: [transaction.to],
|
|
163
|
+
isInbound: transaction.to === publicKey.value,
|
|
164
|
+
amount: (0, module_kit_1.newAmount)(transaction.amount, 'blockchain'),
|
|
165
|
+
fee: (0, module_kit_1.newAmount)(transaction.fee, 'blockchain'),
|
|
166
|
+
arbitraryData: transaction.memo,
|
|
167
|
+
network: this.options.network,
|
|
168
|
+
type: transaction.kind !== indexer_1.ACCOUNT_TRANSFER_KIND ? transaction.kind : undefined,
|
|
169
|
+
timestamp: Date.parse(transaction.dateTime),
|
|
170
|
+
status: {
|
|
171
|
+
type: transaction.hash ? 'applied' : transaction.failureReason ? 'failed' : 'unknown',
|
|
172
|
+
hash: transaction.hash
|
|
173
|
+
}
|
|
174
|
+
}));
|
|
175
|
+
return {
|
|
176
|
+
transactions: airGapTransactions,
|
|
177
|
+
cursor: {
|
|
178
|
+
hasNext,
|
|
179
|
+
lastDateTime
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
async getBalanceOfPublicKey(publicKey) {
|
|
184
|
+
const balance = await this.node.getBalance(publicKey.value);
|
|
185
|
+
return {
|
|
186
|
+
total: (0, module_kit_1.newAmount)(balance.total, 'blockchain'),
|
|
187
|
+
transferable: (0, module_kit_1.newAmount)(balance.liquid, 'blockchain')
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
async getTransactionMaxAmountWithPublicKey(publicKey, _to, configuration) {
|
|
191
|
+
const balance = await this.node.getBalance(publicKey.value);
|
|
192
|
+
const fee = configuration?.fee ? (0, module_kit_1.newAmount)(configuration.fee).blockchain(this.units).value : '0';
|
|
193
|
+
const maxAmount = new bignumber_1.default(balance.liquid).minus(fee);
|
|
194
|
+
return (0, module_kit_1.newAmount)(maxAmount, 'blockchain');
|
|
195
|
+
}
|
|
196
|
+
async getTransactionFeeWithPublicKey(_publicKey, _details, _configuration) {
|
|
197
|
+
const fees = await this.indexer.getLatestFees(20);
|
|
198
|
+
const feesQuantile = (q) => (0, math_1.quantile)(fees, q, {
|
|
199
|
+
isSorted: true /* `getLatestFees` returns an already sorted (ASC) list */,
|
|
200
|
+
roundingMode: bignumber_1.default.ROUND_CEIL
|
|
360
201
|
});
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
202
|
+
return {
|
|
203
|
+
low: (0, module_kit_1.newAmount)(feesQuantile(0.25), 'blockchain'),
|
|
204
|
+
medium: (0, module_kit_1.newAmount)(feesQuantile(0.5), 'blockchain'),
|
|
205
|
+
high: (0, module_kit_1.newAmount)(feesQuantile(0.75), 'blockchain')
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
async prepareTransactionWithPublicKey(publicKey, details, configuration) {
|
|
209
|
+
if (details.length !== 1) {
|
|
210
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.MINA, 'Multiple transactions not supported.');
|
|
211
|
+
}
|
|
212
|
+
const paymentDetails = details[0];
|
|
213
|
+
const nonce = await this.node.getNonce(publicKey.value);
|
|
214
|
+
const fee = configuration?.fee ?? (await this.getTransactionFeeWithPublicKey(publicKey, details, configuration)).medium;
|
|
215
|
+
const balance = await this.getBalanceOfPublicKey(publicKey);
|
|
216
|
+
const amountBlockchain = (0, module_kit_1.newAmount)(paymentDetails.amount).blockchain(this.units);
|
|
217
|
+
const feeBlockchain = (0, module_kit_1.newAmount)(fee).blockchain(this.units);
|
|
218
|
+
const transferableBlockchain = (0, module_kit_1.newAmount)(balance.transferable ?? balance.total).blockchain(this.units);
|
|
219
|
+
if (new bignumber_1.default(transferableBlockchain.value).minus(amountBlockchain.value).minus(feeBlockchain.value).lt(0)) {
|
|
220
|
+
throw new errors_1.BalanceError(coinlib_core_1.Domain.MINA, 'Insfficient balance.');
|
|
221
|
+
}
|
|
222
|
+
return (0, module_kit_1.newUnsignedTransaction)({
|
|
223
|
+
networkType: this.options.network.minaType,
|
|
224
|
+
data: {
|
|
225
|
+
to: paymentDetails.to,
|
|
226
|
+
from: publicKey.value,
|
|
227
|
+
amount: amountBlockchain.value,
|
|
228
|
+
fee: feeBlockchain.value,
|
|
229
|
+
nonce,
|
|
230
|
+
memo: paymentDetails.arbitraryData
|
|
231
|
+
}
|
|
367
232
|
});
|
|
368
|
-
}
|
|
233
|
+
}
|
|
234
|
+
async broadcastTransaction(transaction) {
|
|
235
|
+
return this.node.sendTransaction(transaction.data, transaction.signature);
|
|
236
|
+
}
|
|
369
237
|
// Custom
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
var bip32Node = (0, crypto_1.encodeDerivative)('bip32', derivative);
|
|
238
|
+
getMinaClient(network = this.options.network.minaType) {
|
|
239
|
+
return new mina_signer_1.default({ network });
|
|
240
|
+
}
|
|
241
|
+
derivativeToBip32Node(derivative) {
|
|
242
|
+
const bip32Node = (0, crypto_1.encodeDerivative)('bip32', derivative);
|
|
376
243
|
return this.bitcoinJS.lib.HDNode.fromBase58(bip32Node.secretKey, this.bitcoinJS.config.network);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
}());
|
|
244
|
+
}
|
|
245
|
+
}
|
|
380
246
|
exports.MinaProtocolImpl = MinaProtocolImpl;
|
|
381
247
|
// Factory
|
|
382
|
-
function createMinaProtocol(options) {
|
|
383
|
-
if (options === void 0) { options = {}; }
|
|
248
|
+
function createMinaProtocol(options = {}) {
|
|
384
249
|
return new MinaProtocolImpl(options);
|
|
385
250
|
}
|
|
386
|
-
exports.createMinaProtocol = createMinaProtocol;
|
|
387
251
|
exports.MINA_MAINNET_PROTOCOL_NETWORK = {
|
|
388
252
|
name: 'Mainnet',
|
|
389
253
|
type: 'mainnet',
|
|
@@ -400,12 +264,10 @@ exports.MINA_TESTNET_PROTOCOL_NETWORK = {
|
|
|
400
264
|
blockExplorerApi: 'https://devnet.graphql.minaexplorer.com',
|
|
401
265
|
minaType: 'testnet'
|
|
402
266
|
};
|
|
403
|
-
|
|
404
|
-
function createMinaProtocolOptions(network) {
|
|
405
|
-
if (network === void 0) { network = {}; }
|
|
267
|
+
const DEFAULT_MINA_PROTOCOL_NETWORK = exports.MINA_MAINNET_PROTOCOL_NETWORK;
|
|
268
|
+
function createMinaProtocolOptions(network = {}) {
|
|
406
269
|
return {
|
|
407
|
-
network:
|
|
270
|
+
network: { ...DEFAULT_MINA_PROTOCOL_NETWORK, ...network }
|
|
408
271
|
};
|
|
409
272
|
}
|
|
410
|
-
exports.createMinaProtocolOptions = createMinaProtocolOptions;
|
|
411
273
|
//# sourceMappingURL=MinaProtocol.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinaProtocol.js","sourceRoot":"","sources":["../../../src/v1/protocol/MinaProtocol.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MinaProtocol.js","sourceRoot":"","sources":["../../../src/v1/protocol/MinaProtocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqUA,gDAEC;AAsBD,8DAIC;AAjWD,uDAAkE;AAClE,mHAA0F;AAC1F,aAAa;AACb,yIAA0H;AAC1H,wDAAmF;AACnF,2CAAiD;AACjD,mDAqB2B;AAC3B,8DAAgC;AAEhC,wEAAoE;AAEpE,qDAAiD;AAGjD,8CAA4E;AAI5E,sCAAiE;AACjE,wCAAwC;AAgBxC,iBAAiB;AAEjB,MAAa,gBAAgB;IAe3B,YAAmB,UAAiD,EAAE,EAAE,IAAe,EAAE,OAAqB;QAV7F,cAAS,GAKtB;YACF,GAAG,EAAE,KAAK;YACV,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE;SAC5C,CAAA;Q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