@airgap/groestlcoin 0.13.7-beta.22 → 0.13.7-beta.23

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.
Files changed (55) hide show
  1. package/airgap-coinlib-groestlcoin.min.js +16819 -4275
  2. package/index.d.ts +1 -4
  3. package/index.js +15 -11
  4. package/index.js.map +1 -1
  5. package/package.json +4 -2
  6. package/v0/index.d.ts +4 -0
  7. package/v0/index.js +21 -0
  8. package/v0/index.js.map +1 -0
  9. package/{protocol → v0/protocol}/GroestlcoinProtocol.d.ts +0 -0
  10. package/{protocol → v0/protocol}/GroestlcoinProtocol.js +7 -1
  11. package/v0/protocol/GroestlcoinProtocol.js.map +1 -0
  12. package/{protocol → v0/protocol}/GroestlcoinProtocolOptions.d.ts +0 -0
  13. package/{protocol → v0/protocol}/GroestlcoinProtocolOptions.js +10 -4
  14. package/v0/protocol/GroestlcoinProtocolOptions.js.map +1 -0
  15. package/{protocol → v0/protocol}/GroestlcoinTestnetProtocol.d.ts +0 -0
  16. package/{protocol → v0/protocol}/GroestlcoinTestnetProtocol.js +7 -1
  17. package/v0/protocol/GroestlcoinTestnetProtocol.js.map +1 -0
  18. package/v1/block-explorer/CryptoIDBlockExplorer.d.ts +11 -0
  19. package/v1/block-explorer/CryptoIDBlockExplorer.js +75 -0
  20. package/v1/block-explorer/CryptoIDBlockExplorer.js.map +1 -0
  21. package/v1/index.d.ts +9 -0
  22. package/v1/index.js +10 -0
  23. package/v1/index.js.map +1 -0
  24. package/v1/module/GroestlcoinModule.d.ts +10 -0
  25. package/v1/module/GroestlcoinModule.js +92 -0
  26. package/v1/module/GroestlcoinModule.js.map +1 -0
  27. package/v1/protocol/GroestlcoinProtocol.d.ts +59 -0
  28. package/v1/protocol/GroestlcoinProtocol.js +502 -0
  29. package/v1/protocol/GroestlcoinProtocol.js.map +1 -0
  30. package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +7 -0
  31. package/v1/serializer/v3/schemas/converter/transaction-converter.js +21 -0
  32. package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -0
  33. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-groestlcoin.d.ts +5 -0
  34. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-groestlcoin.js +3 -0
  35. package/v1/serializer/v3/schemas/definitions/transaction-sign-request-groestlcoin.js.map +1 -0
  36. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-groestlcoin.d.ts +3 -0
  37. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-groestlcoin.js +3 -0
  38. package/v1/serializer/v3/schemas/definitions/transaction-sign-response-groestlcoin.js.map +1 -0
  39. package/v1/serializer/v3/schemas/generated/transaction-sign-request-groestlcoin.json +109 -0
  40. package/v1/serializer/v3/schemas/generated/transaction-sign-response-groestlcoin.json +37 -0
  41. package/v1/serializer/v3/validators/transaction-validator.d.ts +7 -0
  42. package/v1/serializer/v3/validators/transaction-validator.js +38 -0
  43. package/v1/serializer/v3/validators/transaction-validator.js.map +1 -0
  44. package/v1/serializer/v3/validators/validators.d.ts +7 -0
  45. package/v1/serializer/v3/validators/validators.js +6 -0
  46. package/v1/serializer/v3/validators/validators.js.map +1 -0
  47. package/v1/types/protocol.d.ts +18 -0
  48. package/v1/types/protocol.js +3 -0
  49. package/v1/types/protocol.js.map +1 -0
  50. package/v1/types/transaction.d.ts +7 -0
  51. package/v1/types/transaction.js +3 -0
  52. package/v1/types/transaction.js.map +1 -0
  53. package/protocol/GroestlcoinProtocol.js.map +0 -1
  54. package/protocol/GroestlcoinProtocolOptions.js.map +0 -1
  55. package/protocol/GroestlcoinTestnetProtocol.js.map +0 -1
@@ -0,0 +1,502 @@
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
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
+ };
72
+ Object.defineProperty(exports, "__esModule", { value: true });
73
+ exports.createGroestlcoinProtocolOptions = exports.GROESTLCOIN_TESTNET_PROTOCOL_NETWORK = exports.GROESTLCOIN_MAINNET_PROTOCOL_NETWORK = exports.createGroestlcoinProtocol = exports.GroestlcoinProtocolImpl = void 0;
74
+ var BitcoinProtocol_1 = require("@airgap/bitcoin/v1/protocol/BitcoinProtocol");
75
+ var coinlib_core_1 = require("@airgap/coinlib-core");
76
+ var bitGoUTXO = __importStar(require("@airgap/coinlib-core/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/index"));
77
+ var groestlcoinJSMessage = __importStar(require("@airgap/coinlib-core/dependencies/src/groestlcoinjs-message-2.1.0/index"));
78
+ var module_kit_1 = require("@airgap/module-kit");
79
+ // Implementation
80
+ var BITCOINJS_MAINNET_NETWORK = 'groestlcoin';
81
+ var GroestlcoinProtocolImpl = /** @class */ (function () {
82
+ function GroestlcoinProtocolImpl(options) {
83
+ // Common
84
+ this.units = {
85
+ GRS: {
86
+ symbol: { value: 'GRS', market: 'grs' },
87
+ decimals: 8
88
+ },
89
+ mGRS: {
90
+ symbol: { value: 'mGRS' },
91
+ decimals: 4
92
+ },
93
+ Satoshi: {
94
+ symbol: { value: 'Satoshi' },
95
+ decimals: 0
96
+ }
97
+ };
98
+ this.feeDefaults = {
99
+ low: (0, module_kit_1.newAmount)(0.00002, 'GRS').blockchain(this.units),
100
+ medium: (0, module_kit_1.newAmount)(0.00004, 'GRS').blockchain(this.units),
101
+ high: (0, module_kit_1.newAmount)(0.00005, 'GRS').blockchain(this.units)
102
+ };
103
+ this.metadata = {
104
+ identifier: coinlib_core_1.MainProtocolSymbols.GRS,
105
+ name: 'Groestlcoin',
106
+ units: this.units,
107
+ mainUnit: 'GRS',
108
+ fee: {
109
+ defaults: this.feeDefaults
110
+ },
111
+ account: {
112
+ standardDerivationPath: "m/44'/17'/0'",
113
+ address: {
114
+ isCaseSensitive: true,
115
+ placeholder: 'Fdb...',
116
+ regex: '^([F3][a-km-zA-HJ-NP-Z1-9]{33}|grs1[a-zA-HJ-NP-Z0-9]{39})$'
117
+ }
118
+ }
119
+ };
120
+ this.bitcoinUnits = undefined;
121
+ this.options = createGroestlcoinProtocolOptions(options.network);
122
+ this.bitcoinProtocol = new BitcoinProtocol_1.BitcoinProtocolImpl(__assign(__assign({}, this.options), { network: __assign(__assign({}, this.options.network), { type: 'custom', bitcoinjsNetworkName: BITCOINJS_MAINNET_NETWORK }) }), bitGoUTXO, groestlcoinJSMessage);
123
+ }
124
+ GroestlcoinProtocolImpl.prototype.getMetadata = function () {
125
+ return __awaiter(this, void 0, void 0, function () {
126
+ return __generator(this, function (_a) {
127
+ return [2 /*return*/, this.metadata];
128
+ });
129
+ });
130
+ };
131
+ GroestlcoinProtocolImpl.prototype.getAddressFromPublicKey = function (publicKey) {
132
+ return __awaiter(this, void 0, void 0, function () {
133
+ return __generator(this, function (_a) {
134
+ return [2 /*return*/, this.bitcoinProtocol.getAddressFromPublicKey(publicKey)];
135
+ });
136
+ });
137
+ };
138
+ GroestlcoinProtocolImpl.prototype.deriveFromExtendedPublicKey = function (extendedPublicKey, visibilityIndex, addressIndex) {
139
+ return __awaiter(this, void 0, void 0, function () {
140
+ return __generator(this, function (_a) {
141
+ return [2 /*return*/, this.bitcoinProtocol.deriveFromExtendedPublicKey(extendedPublicKey, visibilityIndex, addressIndex)];
142
+ });
143
+ });
144
+ };
145
+ GroestlcoinProtocolImpl.prototype.getDetailsFromTransaction = function (transaction, publicKey) {
146
+ return __awaiter(this, void 0, void 0, function () {
147
+ var bitcoinTransactions;
148
+ var _this = this;
149
+ return __generator(this, function (_a) {
150
+ switch (_a.label) {
151
+ case 0: return [4 /*yield*/, this.bitcoinProtocol.getDetailsFromTransaction(transaction, publicKey)];
152
+ case 1:
153
+ bitcoinTransactions = _a.sent();
154
+ return [2 /*return*/, Promise.all(bitcoinTransactions.map(function (transaction) { return _this.fromBitcoinAirGapTransaction(transaction); }))];
155
+ }
156
+ });
157
+ });
158
+ };
159
+ GroestlcoinProtocolImpl.prototype.verifyMessageWithPublicKey = function (message, signature, publicKey) {
160
+ return __awaiter(this, void 0, void 0, function () {
161
+ return __generator(this, function (_a) {
162
+ return [2 /*return*/, this.bitcoinProtocol.verifyMessageWithPublicKey(message, signature, publicKey)];
163
+ });
164
+ });
165
+ };
166
+ GroestlcoinProtocolImpl.prototype.encryptAsymmetricWithPublicKey = function (payload, publicKey) {
167
+ return __awaiter(this, void 0, void 0, function () {
168
+ return __generator(this, function (_a) {
169
+ return [2 /*return*/, this.bitcoinProtocol.encryptAsymmetricWithPublicKey(payload, publicKey)];
170
+ });
171
+ });
172
+ };
173
+ // Offline
174
+ GroestlcoinProtocolImpl.prototype.getKeyPairFromSecret = function (secret, derivationPath) {
175
+ return __awaiter(this, void 0, void 0, function () {
176
+ return __generator(this, function (_a) {
177
+ return [2 /*return*/, this.bitcoinProtocol.getKeyPairFromSecret(secret, derivationPath)];
178
+ });
179
+ });
180
+ };
181
+ GroestlcoinProtocolImpl.prototype.getExtendedKeyPairFromSecret = function (secret, derivationPath) {
182
+ return __awaiter(this, void 0, void 0, function () {
183
+ return __generator(this, function (_a) {
184
+ return [2 /*return*/, this.bitcoinProtocol.getExtendedKeyPairFromSecret(secret, derivationPath)];
185
+ });
186
+ });
187
+ };
188
+ GroestlcoinProtocolImpl.prototype.signTransactionWithSecretKey = function (transaction, secretKey) {
189
+ return __awaiter(this, void 0, void 0, function () {
190
+ return __generator(this, function (_a) {
191
+ return [2 /*return*/, this.bitcoinProtocol.signTransactionWithSecretKey(transaction, secretKey)];
192
+ });
193
+ });
194
+ };
195
+ GroestlcoinProtocolImpl.prototype.signMessageWithKeyPair = function (message, keyPair) {
196
+ return __awaiter(this, void 0, void 0, function () {
197
+ return __generator(this, function (_a) {
198
+ return [2 /*return*/, this.bitcoinProtocol.signMessageWithKeyPair(message, keyPair)];
199
+ });
200
+ });
201
+ };
202
+ GroestlcoinProtocolImpl.prototype.decryptAsymmetricWithKeyPair = function (payload, keyPair) {
203
+ return __awaiter(this, void 0, void 0, function () {
204
+ return __generator(this, function (_a) {
205
+ return [2 /*return*/, this.bitcoinProtocol.decryptAsymmetricWithKeyPair(payload, keyPair)];
206
+ });
207
+ });
208
+ };
209
+ GroestlcoinProtocolImpl.prototype.encryptAESWithSecretKey = function (payload, secretKey) {
210
+ return __awaiter(this, void 0, void 0, function () {
211
+ return __generator(this, function (_a) {
212
+ return [2 /*return*/, this.bitcoinProtocol.encryptAESWithSecretKey(payload, secretKey)];
213
+ });
214
+ });
215
+ };
216
+ GroestlcoinProtocolImpl.prototype.decryptAESWithSecretKey = function (payload, secretKey) {
217
+ return __awaiter(this, void 0, void 0, function () {
218
+ return __generator(this, function (_a) {
219
+ return [2 /*return*/, this.bitcoinProtocol.decryptAESWithSecretKey(payload, secretKey)];
220
+ });
221
+ });
222
+ };
223
+ // Online
224
+ GroestlcoinProtocolImpl.prototype.getNetwork = function () {
225
+ return __awaiter(this, void 0, void 0, function () {
226
+ return __generator(this, function (_a) {
227
+ return [2 /*return*/, this.options.network];
228
+ });
229
+ });
230
+ };
231
+ GroestlcoinProtocolImpl.prototype.getTransactionsForPublicKey = function (publicKey, limit, cursor) {
232
+ return __awaiter(this, void 0, void 0, function () {
233
+ var bitcoinTransactions;
234
+ return __generator(this, function (_a) {
235
+ switch (_a.label) {
236
+ case 0: return [4 /*yield*/, this.bitcoinProtocol.getTransactionsForPublicKey(publicKey, limit, cursor)];
237
+ case 1:
238
+ bitcoinTransactions = _a.sent();
239
+ return [2 /*return*/, this.fromBitcoinAirGapTransactionWithCursor(bitcoinTransactions)];
240
+ }
241
+ });
242
+ });
243
+ };
244
+ GroestlcoinProtocolImpl.prototype.getTransactionsForAddress = function (address, limit, cursor) {
245
+ return __awaiter(this, void 0, void 0, function () {
246
+ var bitcoinTransactions;
247
+ return __generator(this, function (_a) {
248
+ switch (_a.label) {
249
+ case 0: return [4 /*yield*/, this.bitcoinProtocol.getTransactionsForAddress(address, limit, cursor)];
250
+ case 1:
251
+ bitcoinTransactions = _a.sent();
252
+ return [2 /*return*/, this.fromBitcoinAirGapTransactionWithCursor(bitcoinTransactions)];
253
+ }
254
+ });
255
+ });
256
+ };
257
+ GroestlcoinProtocolImpl.prototype.getTransactionsForAddresses = function (addresses, limit, cursor) {
258
+ return __awaiter(this, void 0, void 0, function () {
259
+ var bitcoinTransactions;
260
+ return __generator(this, function (_a) {
261
+ switch (_a.label) {
262
+ case 0: return [4 /*yield*/, this.bitcoinProtocol.getTransactionsForAddresses(addresses, limit, cursor)];
263
+ case 1:
264
+ bitcoinTransactions = _a.sent();
265
+ return [2 /*return*/, this.fromBitcoinAirGapTransactionWithCursor(bitcoinTransactions)];
266
+ }
267
+ });
268
+ });
269
+ };
270
+ GroestlcoinProtocolImpl.prototype.getBalanceOfPublicKey = function (publicKey) {
271
+ return __awaiter(this, void 0, void 0, function () {
272
+ var bitcoinBalance;
273
+ return __generator(this, function (_a) {
274
+ switch (_a.label) {
275
+ case 0: return [4 /*yield*/, this.bitcoinProtocol.getBalanceOfPublicKey(publicKey)];
276
+ case 1:
277
+ bitcoinBalance = _a.sent();
278
+ return [2 /*return*/, this.fromBitcoinBalance(bitcoinBalance)];
279
+ }
280
+ });
281
+ });
282
+ };
283
+ GroestlcoinProtocolImpl.prototype.getBalanceOfAddress = function (address) {
284
+ return __awaiter(this, void 0, void 0, function () {
285
+ var bitcoinBalance;
286
+ return __generator(this, function (_a) {
287
+ switch (_a.label) {
288
+ case 0: return [4 /*yield*/, this.bitcoinProtocol.getBalanceOfAddress(address)];
289
+ case 1:
290
+ bitcoinBalance = _a.sent();
291
+ return [2 /*return*/, this.fromBitcoinBalance(bitcoinBalance)];
292
+ }
293
+ });
294
+ });
295
+ };
296
+ GroestlcoinProtocolImpl.prototype.getBalanceOfAddresses = function (addresses) {
297
+ return __awaiter(this, void 0, void 0, function () {
298
+ var bitcoinBalance;
299
+ return __generator(this, function (_a) {
300
+ switch (_a.label) {
301
+ case 0: return [4 /*yield*/, this.bitcoinProtocol.getBalanceOfAddresses(addresses)];
302
+ case 1:
303
+ bitcoinBalance = _a.sent();
304
+ return [2 /*return*/, this.fromBitcoinBalance(bitcoinBalance)];
305
+ }
306
+ });
307
+ });
308
+ };
309
+ GroestlcoinProtocolImpl.prototype.getTransactionMaxAmountWithPublicKey = function (publicKey, to, configuration) {
310
+ return __awaiter(this, void 0, void 0, function () {
311
+ var bitcoinFee, bitcoinMax;
312
+ return __generator(this, function (_a) {
313
+ switch (_a.label) {
314
+ case 0:
315
+ bitcoinFee = (configuration === null || configuration === void 0 ? void 0 : configuration.fee) ? this.toBitcoinAmount(configuration.fee) : undefined;
316
+ return [4 /*yield*/, this.bitcoinProtocol.getTransactionMaxAmountWithPublicKey(publicKey, to, __assign(__assign({}, configuration), { fee: bitcoinFee }))];
317
+ case 1:
318
+ bitcoinMax = _a.sent();
319
+ return [2 /*return*/, this.fromBitcoinAmount(bitcoinMax)];
320
+ }
321
+ });
322
+ });
323
+ };
324
+ GroestlcoinProtocolImpl.prototype.getTransactionFeeWithPublicKey = function (publicKey, details) {
325
+ return __awaiter(this, void 0, void 0, function () {
326
+ var bitcoinDetails, bitcoinFeeEstimation;
327
+ var _this = this;
328
+ return __generator(this, function (_a) {
329
+ switch (_a.label) {
330
+ case 0:
331
+ bitcoinDetails = details.map(function (details) {
332
+ return _this.toBitcoinTransactionDetails(details);
333
+ });
334
+ return [4 /*yield*/, this.bitcoinProtocol.getTransactionFeeWithPublicKey(publicKey, bitcoinDetails)];
335
+ case 1:
336
+ bitcoinFeeEstimation = _a.sent();
337
+ return [2 /*return*/, this.fromBitcoinFeeEstimation(bitcoinFeeEstimation)];
338
+ }
339
+ });
340
+ });
341
+ };
342
+ GroestlcoinProtocolImpl.prototype.prepareTransactionWithPublicKey = function (publicKey, details, configuration) {
343
+ return __awaiter(this, void 0, void 0, function () {
344
+ var bitcoinDetails, bitcoinFee;
345
+ var _this = this;
346
+ return __generator(this, function (_a) {
347
+ bitcoinDetails = details.map(function (details) {
348
+ return _this.toBitcoinTransactionDetails(details);
349
+ });
350
+ bitcoinFee = (configuration === null || configuration === void 0 ? void 0 : configuration.fee) ? this.toBitcoinAmount(configuration.fee) : undefined;
351
+ return [2 /*return*/, this.bitcoinProtocol.prepareTransactionWithPublicKey(publicKey, bitcoinDetails, __assign(__assign({}, configuration), { fee: bitcoinFee }))];
352
+ });
353
+ });
354
+ };
355
+ GroestlcoinProtocolImpl.prototype.broadcastTransaction = function (transaction) {
356
+ return __awaiter(this, void 0, void 0, function () {
357
+ return __generator(this, function (_a) {
358
+ return [2 /*return*/, this.bitcoinProtocol.broadcastTransaction(transaction)];
359
+ });
360
+ });
361
+ };
362
+ // Custom
363
+ GroestlcoinProtocolImpl.prototype.fromBitcoinAirGapTransaction = function (transaction) {
364
+ return __awaiter(this, void 0, void 0, function () {
365
+ var _a, amount, fee;
366
+ return __generator(this, function (_b) {
367
+ switch (_b.label) {
368
+ case 0: return [4 /*yield*/, Promise.all([
369
+ this.fromBitcoinAmount(transaction.amount),
370
+ this.fromBitcoinAmount(transaction.fee)
371
+ ])];
372
+ case 1:
373
+ _a = _b.sent(), amount = _a[0], fee = _a[1];
374
+ return [2 /*return*/, __assign(__assign({}, transaction), { amount: amount, fee: fee })];
375
+ }
376
+ });
377
+ });
378
+ };
379
+ GroestlcoinProtocolImpl.prototype.fromBitcoinAirGapTransactionWithCursor = function (transactionsWithCursor) {
380
+ return __awaiter(this, void 0, void 0, function () {
381
+ var _a;
382
+ var _this = this;
383
+ return __generator(this, function (_b) {
384
+ switch (_b.label) {
385
+ case 0:
386
+ _a = {};
387
+ return [4 /*yield*/, Promise.all(transactionsWithCursor.transactions.map(function (transaction) {
388
+ return _this.fromBitcoinAirGapTransaction(transaction);
389
+ }))];
390
+ case 1: return [2 /*return*/, (_a.transactions = _b.sent(),
391
+ _a.cursor = {
392
+ hasNext: transactionsWithCursor.cursor.hasNext,
393
+ page: transactionsWithCursor.cursor.page
394
+ },
395
+ _a)];
396
+ }
397
+ });
398
+ });
399
+ };
400
+ GroestlcoinProtocolImpl.prototype.fromBitcoinBalance = function (balance) {
401
+ return __awaiter(this, void 0, void 0, function () {
402
+ var _a, total, transferable;
403
+ return __generator(this, function (_b) {
404
+ switch (_b.label) {
405
+ case 0: return [4 /*yield*/, Promise.all([
406
+ this.fromBitcoinAmount(balance.total),
407
+ balance.transferable ? this.fromBitcoinAmount(balance.transferable) : Promise.resolve(undefined)
408
+ ])];
409
+ case 1:
410
+ _a = _b.sent(), total = _a[0], transferable = _a[1];
411
+ return [2 /*return*/, { total: total, transferable: transferable }];
412
+ }
413
+ });
414
+ });
415
+ };
416
+ GroestlcoinProtocolImpl.prototype.fromBitcoinFeeEstimation = function (feeEstimation) {
417
+ return __awaiter(this, void 0, void 0, function () {
418
+ var _a, low, medium, high;
419
+ return __generator(this, function (_b) {
420
+ switch (_b.label) {
421
+ case 0: return [4 /*yield*/, Promise.all([
422
+ this.fromBitcoinAmount(feeEstimation.low),
423
+ this.fromBitcoinAmount(feeEstimation.medium),
424
+ this.fromBitcoinAmount(feeEstimation.high)
425
+ ])];
426
+ case 1:
427
+ _a = _b.sent(), low = _a[0], medium = _a[1], high = _a[2];
428
+ return [2 /*return*/, { low: low, medium: medium, high: high }];
429
+ }
430
+ });
431
+ });
432
+ };
433
+ GroestlcoinProtocolImpl.prototype.fromBitcoinAmount = function (amount) {
434
+ return __awaiter(this, void 0, void 0, function () {
435
+ var bitcoinUnits;
436
+ return __generator(this, function (_a) {
437
+ switch (_a.label) {
438
+ case 0: return [4 /*yield*/, this.getBitcoinUnits()];
439
+ case 1:
440
+ bitcoinUnits = _a.sent();
441
+ return [2 /*return*/, this.convertAmount(amount, bitcoinUnits)];
442
+ }
443
+ });
444
+ });
445
+ };
446
+ GroestlcoinProtocolImpl.prototype.toBitcoinTransactionDetails = function (details) {
447
+ return __assign(__assign({}, details), { amount: this.toBitcoinAmount(details.amount) });
448
+ };
449
+ GroestlcoinProtocolImpl.prototype.toBitcoinAmount = function (amount) {
450
+ return this.convertAmount(amount, this.units);
451
+ };
452
+ GroestlcoinProtocolImpl.prototype.getBitcoinUnits = function () {
453
+ return __awaiter(this, void 0, void 0, function () {
454
+ var metadata;
455
+ return __generator(this, function (_a) {
456
+ switch (_a.label) {
457
+ case 0:
458
+ if (!(this.bitcoinUnits === undefined)) return [3 /*break*/, 2];
459
+ return [4 /*yield*/, this.bitcoinProtocol.getMetadata()];
460
+ case 1:
461
+ metadata = _a.sent();
462
+ this.bitcoinUnits = metadata.units;
463
+ _a.label = 2;
464
+ case 2: return [2 /*return*/, this.bitcoinUnits];
465
+ }
466
+ });
467
+ });
468
+ };
469
+ GroestlcoinProtocolImpl.prototype.convertAmount = function (amount, fromUnits) {
470
+ return (0, module_kit_1.newAmount)((0, module_kit_1.newAmount)(amount).blockchain(fromUnits).value, 'blockchain');
471
+ };
472
+ return GroestlcoinProtocolImpl;
473
+ }());
474
+ exports.GroestlcoinProtocolImpl = GroestlcoinProtocolImpl;
475
+ // Factory
476
+ function createGroestlcoinProtocol(options) {
477
+ if (options === void 0) { options = {}; }
478
+ return new GroestlcoinProtocolImpl(options);
479
+ }
480
+ exports.createGroestlcoinProtocol = createGroestlcoinProtocol;
481
+ exports.GROESTLCOIN_MAINNET_PROTOCOL_NETWORK = {
482
+ name: 'Mainnet',
483
+ type: 'mainnet',
484
+ rpcUrl: '',
485
+ indexerApi: "https://cors-proxy.airgap.prod.gke.papers.tech/proxy?url='https://blockbook.groestlcoin.org'"
486
+ };
487
+ exports.GROESTLCOIN_TESTNET_PROTOCOL_NETWORK = {
488
+ name: 'Testnet',
489
+ type: 'testnet',
490
+ rpcUrl: '',
491
+ indexerApi: 'https://blockbook-test.groestlcoin.org/'
492
+ };
493
+ var DEFAULT_GROESTLCOIN_PROTOCOL_NETWORK = exports.GROESTLCOIN_MAINNET_PROTOCOL_NETWORK;
494
+ function createGroestlcoinProtocolOptions(network) {
495
+ if (network === void 0) { network = {}; }
496
+ return {
497
+ network: network.type === 'custom'
498
+ ? __assign(__assign(__assign({}, DEFAULT_GROESTLCOIN_PROTOCOL_NETWORK), { bitcoinjsNetworkName: BITCOINJS_MAINNET_NETWORK }), network) : __assign(__assign({}, DEFAULT_GROESTLCOIN_PROTOCOL_NETWORK), network)
499
+ };
500
+ }
501
+ exports.createGroestlcoinProtocolOptions = createGroestlcoinProtocolOptions;
502
+ //# sourceMappingURL=GroestlcoinProtocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroestlcoinProtocol.js","sourceRoot":"","sources":["../../../src/v1/protocol/GroestlcoinProtocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;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AE,oBAAoB,EAAE,yBAAyB,KAAK,OAAO,EACxG,CAAC,CAAE,sBAAK,oCAAoC,GAAK,OAAO,CAAyC;KACtG,CAAA;AACH,CAAC;AAPD,4EAOC"}
@@ -0,0 +1,7 @@
1
+ import { GroestlcoinSignedTransaction, GroestlcoinUnsignedTransaction } from '../../../../types/transaction';
2
+ import { GroestlcoinTransactionSignRequest } from '../definitions/transaction-sign-request-groestlcoin';
3
+ import { GroestlcoinTransactionSignResponse } from '../definitions/transaction-sign-response-groestlcoin';
4
+ export declare function groestlcoinUnsignedTransactionToRequest(unsigned: GroestlcoinUnsignedTransaction, publicKey: string, callbackUrl?: string): GroestlcoinTransactionSignRequest;
5
+ export declare function groestlcoinSignedTransactionToResponse(signed: GroestlcoinSignedTransaction, accountIdentifier: string): GroestlcoinTransactionSignResponse;
6
+ export declare function groestlcoinTransactionSignRequestToUnsigned(request: GroestlcoinTransactionSignRequest): GroestlcoinUnsignedTransaction;
7
+ export declare function groestlcoinTransactionSignResponseToSigned(response: GroestlcoinTransactionSignResponse): GroestlcoinSignedTransaction;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.groestlcoinTransactionSignResponseToSigned = exports.groestlcoinTransactionSignRequestToUnsigned = exports.groestlcoinSignedTransactionToResponse = exports.groestlcoinUnsignedTransactionToRequest = void 0;
4
+ var v1_1 = require("@airgap/bitcoin/v1");
5
+ function groestlcoinUnsignedTransactionToRequest(unsigned, publicKey, callbackUrl) {
6
+ return (0, v1_1.bitcoinUnsignedTransactionToRequest)(unsigned, publicKey, callbackUrl);
7
+ }
8
+ exports.groestlcoinUnsignedTransactionToRequest = groestlcoinUnsignedTransactionToRequest;
9
+ function groestlcoinSignedTransactionToResponse(signed, accountIdentifier) {
10
+ return (0, v1_1.bitcoinSignedTransactionToResponse)(signed, accountIdentifier);
11
+ }
12
+ exports.groestlcoinSignedTransactionToResponse = groestlcoinSignedTransactionToResponse;
13
+ function groestlcoinTransactionSignRequestToUnsigned(request) {
14
+ return (0, v1_1.bitcoinTransactionSignRequestToUnsigned)(request);
15
+ }
16
+ exports.groestlcoinTransactionSignRequestToUnsigned = groestlcoinTransactionSignRequestToUnsigned;
17
+ function groestlcoinTransactionSignResponseToSigned(response) {
18
+ return (0, v1_1.bitcoinTransactionSignResponseToSigned)(response);
19
+ }
20
+ exports.groestlcoinTransactionSignResponseToSigned = groestlcoinTransactionSignResponseToSigned;
21
+ //# sourceMappingURL=transaction-converter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction-converter.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/converter/transaction-converter.ts"],"names":[],"mappings":";;;AAAA,yCAK2B;AAM3B,SAAgB,uCAAuC,CACrD,QAAwC,EACxC,SAAiB,EACjB,WAAoB;IAEpB,OAAO,IAAA,wCAAmC,EAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CAAA;AAC9E,CAAC;AAND,0FAMC;AAED,SAAgB,sCAAsC,CACpD,MAAoC,EACpC,iBAAyB;IAEzB,OAAO,IAAA,uCAAkC,EAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;AACtE,CAAC;AALD,wFAKC;AAED,SAAgB,2CAA2C,CAAC,OAA0C;IACpG,OAAO,IAAA,4CAAuC,EAAC,OAAO,CAAC,CAAA;AACzD,CAAC;AAFD,kGAEC;AAED,SAAgB,0CAA0C,CAAC,QAA4C;IACrG,OAAO,IAAA,2CAAsC,EAAC,QAAQ,CAAC,CAAA;AACzD,CAAC;AAFD,gGAEC"}
@@ -0,0 +1,5 @@
1
+ import { BitcoinTransactionSignRequest } from '@airgap/bitcoin/v1';
2
+ import { GroestlcoinUnsignedTransaction } from '../../../../types/transaction';
3
+ export interface GroestlcoinTransactionSignRequest extends BitcoinTransactionSignRequest {
4
+ transaction: GroestlcoinUnsignedTransaction;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=transaction-sign-request-groestlcoin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction-sign-request-groestlcoin.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/definitions/transaction-sign-request-groestlcoin.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { BitcoinTransactionSignResponse } from '@airgap/bitcoin/v1';
2
+ export interface GroestlcoinTransactionSignResponse extends BitcoinTransactionSignResponse {
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=transaction-sign-response-groestlcoin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction-sign-response-groestlcoin.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/definitions/transaction-sign-response-groestlcoin.ts"],"names":[],"mappings":""}