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