@airgap/mina 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/v1/block-explorer/MinaExplorerBlockExplorer.js +61 -12
- 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 +107 -64
- package/v1/indexer/MinaExplorerIndexer.js.map +1 -1
- package/v1/module/MinaModule.js +96 -38
- package/v1/module/MinaModule.js.map +1 -1
- package/v1/module.js +3 -2
- package/v1/module.js.map +1 -1
- package/v1/node/GraphQLNode.js +107 -70
- package/v1/node/GraphQLNode.js.map +1 -1
- package/v1/protocol/MinaProtocol.js +317 -179
- package/v1/protocol/MinaProtocol.js.map +1 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +20 -8
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
- package/v1/serializer/v3/serializer-companion.js +148 -69
- package/v1/serializer/v3/serializer-companion.js.map +1 -1
- package/v1/serializer/v3/validators/transaction-validator.js +65 -16
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
- package/v1/serializer/v3/validators/validators.js +81 -36
- 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 +1 -0
- package/v1/utils/key.js +14 -23
- package/v1/utils/key.js.map +1 -1
- package/v1/utils/math.js +11 -7
- package/v1/utils/math.js.map +1 -1
|
@@ -1,4 +1,15 @@
|
|
|
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
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -15,46 +26,71 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
26
|
}) : function(o, v) {
|
|
16
27
|
o["default"] = v;
|
|
17
28
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
return function (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
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
|
+
};
|
|
35
72
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
73
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
74
|
};
|
|
38
75
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.MINA_TESTNET_PROTOCOL_NETWORK = exports.MINA_MAINNET_PROTOCOL_NETWORK = exports.MinaProtocolImpl = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
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"));
|
|
76
|
+
exports.createMinaProtocolOptions = exports.MINA_TESTNET_PROTOCOL_NETWORK = exports.MINA_MAINNET_PROTOCOL_NETWORK = exports.createMinaProtocol = exports.MinaProtocolImpl = void 0;
|
|
77
|
+
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
78
|
+
var bignumber_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber"));
|
|
44
79
|
// @ts-ignore
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
80
|
+
var BitGo = __importStar(require("@airgap/coinlib-core/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src"));
|
|
81
|
+
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
82
|
+
var crypto_1 = require("@airgap/crypto");
|
|
83
|
+
var module_kit_1 = require("@airgap/module-kit");
|
|
84
|
+
var mina_signer_1 = __importDefault(require("mina-signer"));
|
|
85
|
+
var MinaExplorerIndexer_1 = require("../indexer/MinaExplorerIndexer");
|
|
86
|
+
var GraphQLNode_1 = require("../node/GraphQLNode");
|
|
87
|
+
var indexer_1 = require("../types/indexer");
|
|
88
|
+
var key_1 = require("../utils/key");
|
|
89
|
+
var math_1 = require("../utils/math");
|
|
55
90
|
// Implementation
|
|
56
|
-
|
|
57
|
-
|
|
91
|
+
var MinaProtocolImpl = /** @class */ (function () {
|
|
92
|
+
function MinaProtocolImpl(options, node, indexer) {
|
|
93
|
+
if (options === void 0) { options = {}; }
|
|
58
94
|
this.bitcoinJS = {
|
|
59
95
|
lib: BitGo,
|
|
60
96
|
config: { network: BitGo.networks.bitcoin }
|
|
@@ -72,7 +108,7 @@ class MinaProtocolImpl {
|
|
|
72
108
|
units: this.units,
|
|
73
109
|
mainUnit: 'MINA',
|
|
74
110
|
account: {
|
|
75
|
-
standardDerivationPath:
|
|
111
|
+
standardDerivationPath: "m/44'/12586'/0'/0/0",
|
|
76
112
|
address: {
|
|
77
113
|
isCaseSensitive: true,
|
|
78
114
|
regex: '^B62[a-km-zA-HJ-NP-Z1-9]{52}$',
|
|
@@ -85,19 +121,31 @@ class MinaProtocolImpl {
|
|
|
85
121
|
algorithm: 'secp256k1'
|
|
86
122
|
};
|
|
87
123
|
this.options = createMinaProtocolOptions(options.network);
|
|
88
|
-
this.node = node
|
|
89
|
-
this.indexer = indexer
|
|
90
|
-
}
|
|
91
|
-
async getMetadata() {
|
|
92
|
-
return this.metadata;
|
|
93
|
-
}
|
|
94
|
-
async getAddressFromPublicKey(publicKey) {
|
|
95
|
-
return publicKey.value;
|
|
124
|
+
this.node = node !== null && node !== void 0 ? node : new GraphQLNode_1.GraphQLNode(this.options.network.rpcUrl);
|
|
125
|
+
this.indexer = indexer !== null && indexer !== void 0 ? indexer : new MinaExplorerIndexer_1.MinaExplorerIndexer(this.options.network.blockExplorerApi);
|
|
96
126
|
}
|
|
97
|
-
|
|
98
|
-
return this
|
|
99
|
-
|
|
100
|
-
|
|
127
|
+
MinaProtocolImpl.prototype.getMetadata = function () {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
129
|
+
return __generator(this, function (_a) {
|
|
130
|
+
return [2 /*return*/, this.metadata];
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
MinaProtocolImpl.prototype.getAddressFromPublicKey = function (publicKey) {
|
|
135
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
136
|
+
return __generator(this, function (_a) {
|
|
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) {
|
|
101
149
|
return [
|
|
102
150
|
{
|
|
103
151
|
from: [payment.from],
|
|
@@ -109,145 +157,233 @@ class MinaProtocolImpl {
|
|
|
109
157
|
network: this.options.network
|
|
110
158
|
}
|
|
111
159
|
];
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return this
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
}
|
|
160
|
+
};
|
|
161
|
+
MinaProtocolImpl.prototype.getCryptoConfiguration = function () {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
163
|
+
return __generator(this, function (_a) {
|
|
164
|
+
return [2 /*return*/, this.cryptoConfiguration];
|
|
165
|
+
});
|
|
150
166
|
});
|
|
151
|
-
}
|
|
167
|
+
};
|
|
168
|
+
MinaProtocolImpl.prototype.getKeyPairFromDerivative = function (derivative) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
170
|
+
var node, secretKey;
|
|
171
|
+
return __generator(this, function (_a) {
|
|
172
|
+
node = this.derivativeToBip32Node(derivative);
|
|
173
|
+
secretKey = (0, key_1.finalizeSecretKey)(node.keyPair.getPrivateKeyBuffer());
|
|
174
|
+
return [2 /*return*/, {
|
|
175
|
+
secretKey: secretKey,
|
|
176
|
+
publicKey: (0, key_1.derivePublicKey)(this.getMinaClient(), secretKey)
|
|
177
|
+
}];
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
MinaProtocolImpl.prototype.signTransactionWithSecretKey = function (transaction, secretKey) {
|
|
182
|
+
var _a;
|
|
183
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
184
|
+
var client, signed;
|
|
185
|
+
return __generator(this, function (_b) {
|
|
186
|
+
client = this.getMinaClient(transaction.networkType);
|
|
187
|
+
signed = client.signPayment({
|
|
188
|
+
to: transaction.data.to,
|
|
189
|
+
from: transaction.data.from,
|
|
190
|
+
amount: transaction.data.amount,
|
|
191
|
+
fee: transaction.data.fee,
|
|
192
|
+
nonce: transaction.data.nonce,
|
|
193
|
+
memo: transaction.data.memo,
|
|
194
|
+
validUntil: transaction.data.validUntil
|
|
195
|
+
}, secretKey.value);
|
|
196
|
+
return [2 /*return*/, (0, module_kit_1.newSignedTransaction)({
|
|
197
|
+
data: {
|
|
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
|
+
});
|
|
213
|
+
});
|
|
214
|
+
};
|
|
152
215
|
// Online
|
|
153
|
-
|
|
154
|
-
return this
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
|
216
|
+
MinaProtocolImpl.prototype.getNetwork = function () {
|
|
217
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
218
|
+
return __generator(this, function (_a) {
|
|
219
|
+
return [2 /*return*/, this.options.network];
|
|
220
|
+
});
|
|
201
221
|
});
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
222
|
+
};
|
|
223
|
+
MinaProtocolImpl.prototype.getTransactionsForPublicKey = function (publicKey, limit, cursor) {
|
|
224
|
+
var _a;
|
|
225
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
226
|
+
var transactions, lastDateTime, hasNext, airGapTransactions;
|
|
227
|
+
var _this = this;
|
|
228
|
+
return __generator(this, function (_b) {
|
|
229
|
+
switch (_b.label) {
|
|
230
|
+
case 0: return [4 /*yield*/, this.indexer.getTransactions(publicKey.value, limit, cursor === null || cursor === void 0 ? void 0 : cursor.lastDateTime)];
|
|
231
|
+
case 1:
|
|
232
|
+
transactions = _b.sent();
|
|
233
|
+
lastDateTime = (_a = transactions[transactions.length - 1]) === null || _a === void 0 ? void 0 : _a.dateTime;
|
|
234
|
+
hasNext = transactions.length >= limit;
|
|
235
|
+
airGapTransactions = transactions.map(function (transaction) { return ({
|
|
236
|
+
from: [transaction.from],
|
|
237
|
+
to: [transaction.to],
|
|
238
|
+
isInbound: transaction.to === publicKey.value,
|
|
239
|
+
amount: (0, module_kit_1.newAmount)(transaction.amount, 'blockchain'),
|
|
240
|
+
fee: (0, module_kit_1.newAmount)(transaction.fee, 'blockchain'),
|
|
241
|
+
arbitraryData: transaction.memo,
|
|
242
|
+
network: _this.options.network,
|
|
243
|
+
type: transaction.kind !== indexer_1.ACCOUNT_TRANSFER_KIND ? transaction.kind : undefined,
|
|
244
|
+
timestamp: Date.parse(transaction.dateTime),
|
|
245
|
+
status: {
|
|
246
|
+
type: transaction.hash ? 'applied' : transaction.failureReason ? 'failed' : 'unknown',
|
|
247
|
+
hash: transaction.hash
|
|
248
|
+
}
|
|
249
|
+
}); });
|
|
250
|
+
return [2 /*return*/, {
|
|
251
|
+
transactions: airGapTransactions,
|
|
252
|
+
cursor: {
|
|
253
|
+
hasNext: hasNext,
|
|
254
|
+
lastDateTime: lastDateTime
|
|
255
|
+
}
|
|
256
|
+
}];
|
|
257
|
+
}
|
|
258
|
+
});
|
|
232
259
|
});
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
return this
|
|
236
|
-
|
|
260
|
+
};
|
|
261
|
+
MinaProtocolImpl.prototype.getBalanceOfPublicKey = function (publicKey) {
|
|
262
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
263
|
+
var balance;
|
|
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
|
+
});
|
|
360
|
+
});
|
|
361
|
+
};
|
|
362
|
+
MinaProtocolImpl.prototype.broadcastTransaction = function (transaction) {
|
|
363
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
364
|
+
return __generator(this, function (_a) {
|
|
365
|
+
return [2 /*return*/, this.node.sendTransaction(transaction.data, transaction.signature)];
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
};
|
|
237
369
|
// Custom
|
|
238
|
-
getMinaClient
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
370
|
+
MinaProtocolImpl.prototype.getMinaClient = function (network) {
|
|
371
|
+
if (network === void 0) { network = this.options.network.minaType; }
|
|
372
|
+
return new mina_signer_1.default({ network: network });
|
|
373
|
+
};
|
|
374
|
+
MinaProtocolImpl.prototype.derivativeToBip32Node = function (derivative) {
|
|
375
|
+
var bip32Node = (0, crypto_1.encodeDerivative)('bip32', derivative);
|
|
243
376
|
return this.bitcoinJS.lib.HDNode.fromBase58(bip32Node.secretKey, this.bitcoinJS.config.network);
|
|
244
|
-
}
|
|
245
|
-
|
|
377
|
+
};
|
|
378
|
+
return MinaProtocolImpl;
|
|
379
|
+
}());
|
|
246
380
|
exports.MinaProtocolImpl = MinaProtocolImpl;
|
|
247
381
|
// Factory
|
|
248
|
-
function createMinaProtocol(options
|
|
382
|
+
function createMinaProtocol(options) {
|
|
383
|
+
if (options === void 0) { options = {}; }
|
|
249
384
|
return new MinaProtocolImpl(options);
|
|
250
385
|
}
|
|
386
|
+
exports.createMinaProtocol = createMinaProtocol;
|
|
251
387
|
exports.MINA_MAINNET_PROTOCOL_NETWORK = {
|
|
252
388
|
name: 'Mainnet',
|
|
253
389
|
type: 'mainnet',
|
|
@@ -264,10 +400,12 @@ exports.MINA_TESTNET_PROTOCOL_NETWORK = {
|
|
|
264
400
|
blockExplorerApi: 'https://devnet.graphql.minaexplorer.com',
|
|
265
401
|
minaType: 'testnet'
|
|
266
402
|
};
|
|
267
|
-
|
|
268
|
-
function createMinaProtocolOptions(network
|
|
403
|
+
var DEFAULT_MINA_PROTOCOL_NETWORK = exports.MINA_MAINNET_PROTOCOL_NETWORK;
|
|
404
|
+
function createMinaProtocolOptions(network) {
|
|
405
|
+
if (network === void 0) { network = {}; }
|
|
269
406
|
return {
|
|
270
|
-
network: {
|
|
407
|
+
network: __assign(__assign({}, DEFAULT_MINA_PROTOCOL_NETWORK), network)
|
|
271
408
|
};
|
|
272
409
|
}
|
|
410
|
+
exports.createMinaProtocolOptions = createMinaProtocolOptions;
|
|
273
411
|
//# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAkE;AAClE,iHAA0F;AAC1F,aAAa;AACb,uIAA0H;AAC1H,sDAAmF;AACnF,yCAAiD;AACjD,iDAqB2B;AAC3B,4DAAgC;AAEhC,sEAAoE;AAEpE,mDAAiD;AAGjD,4CAA4E;AAI5E,oCAAiE;AACjE,sCAAwC;AAgBxC,iBAAiB;AAEjB;IAeE,0BAAmB,OAAmD,EAAE,IAAe,EAAE,OAAqB;QAA3F,wBAAA,EAAA,YAAmD;QAVrD,cAAS,GAKtB;YACF,GAAG,EAAE,KAAK;YACV,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE;SAC5C,CAAA;QAQD,SAAS;QAEQ,UAAK,GAAqC;YACzD,IAA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