@omnisat/lasereyes 0.0.27 → 0.0.29
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/dist/index.d.ts +6 -4
- package/dist/index.js +1707 -125
- package/dist/index.mjs +2097 -293
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -48,6 +48,8 @@ var __forAwait = (obj, it, method) => {
|
|
|
48
48
|
var XVERSE_NETWORK = "Mainnet";
|
|
49
49
|
var UNISAT_MAINNET = "livenet";
|
|
50
50
|
var UNISAT_TESTNET = "testnet";
|
|
51
|
+
var OP_WALLET_MAINNET = "livenet";
|
|
52
|
+
var OP_WALLET_TESTNET = "testnet";
|
|
51
53
|
var XVERSE_MAINNET = "Mainnet";
|
|
52
54
|
var XVERSE_TESTNET = "Testnet";
|
|
53
55
|
var XVERSE_SIGNET = "Signet";
|
|
@@ -184,14 +186,14 @@ var createConfig = (config) => {
|
|
|
184
186
|
|
|
185
187
|
// src/providers/LaserEyesProvider.tsx
|
|
186
188
|
import {
|
|
187
|
-
createContext,
|
|
188
|
-
useCallback,
|
|
189
|
-
useContext,
|
|
190
|
-
useEffect,
|
|
191
|
-
useRef,
|
|
192
|
-
useState
|
|
189
|
+
createContext as createContext17,
|
|
190
|
+
useCallback as useCallback33,
|
|
191
|
+
useContext as useContext17,
|
|
192
|
+
useEffect as useEffect33,
|
|
193
|
+
useRef as useRef17,
|
|
194
|
+
useState as useState33
|
|
193
195
|
} from "react";
|
|
194
|
-
import * as
|
|
196
|
+
import * as bitcoin19 from "bitcoinjs-lib";
|
|
195
197
|
|
|
196
198
|
// src/consts/settings.ts
|
|
197
199
|
var LOCAL_STORAGE_DEFAULT_WALLET = "defaultWallet";
|
|
@@ -212,253 +214,2053 @@ var initialWalletContext = {
|
|
|
212
214
|
paymentAddress: "",
|
|
213
215
|
paymentPublicKey: "",
|
|
214
216
|
balance: void 0,
|
|
215
|
-
network: MAINNET,
|
|
217
|
+
network: MAINNET,
|
|
218
|
+
library: null,
|
|
219
|
+
provider: null,
|
|
220
|
+
accounts: [],
|
|
221
|
+
connect: (walletName) => __async(void 0, null, function* () {
|
|
222
|
+
}),
|
|
223
|
+
disconnect: () => {
|
|
224
|
+
},
|
|
225
|
+
requestAccounts: () => __async(void 0, null, function* () {
|
|
226
|
+
return [];
|
|
227
|
+
}),
|
|
228
|
+
getNetwork: () => __async(void 0, null, function* () {
|
|
229
|
+
return MAINNET;
|
|
230
|
+
}),
|
|
231
|
+
switchNetwork: (network) => __async(void 0, null, function* () {
|
|
232
|
+
}),
|
|
233
|
+
getPublicKey: () => __async(void 0, null, function* () {
|
|
234
|
+
return "";
|
|
235
|
+
}),
|
|
236
|
+
getBalance: () => __async(void 0, null, function* () {
|
|
237
|
+
return "";
|
|
238
|
+
}),
|
|
239
|
+
getInscriptions: () => __async(void 0, null, function* () {
|
|
240
|
+
return [];
|
|
241
|
+
}),
|
|
242
|
+
sendBTC: (to, amount) => __async(void 0, null, function* () {
|
|
243
|
+
return "";
|
|
244
|
+
}),
|
|
245
|
+
signMessage: (message) => __async(void 0, null, function* () {
|
|
246
|
+
return "";
|
|
247
|
+
}),
|
|
248
|
+
signPsbt: (tx) => __async(void 0, null, function* () {
|
|
249
|
+
return {
|
|
250
|
+
signedPsbtHex: "",
|
|
251
|
+
signedPsbtBase64: "",
|
|
252
|
+
txId: ""
|
|
253
|
+
};
|
|
254
|
+
}),
|
|
255
|
+
pushPsbt: (tx) => __async(void 0, null, function* () {
|
|
256
|
+
return "";
|
|
257
|
+
}),
|
|
258
|
+
inscribe: (content) => __async(void 0, null, function* () {
|
|
259
|
+
return "";
|
|
260
|
+
}),
|
|
261
|
+
isCreatingCommit: false,
|
|
262
|
+
isInscribing: false
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
// src/providers/LaserEyesProvider.tsx
|
|
266
|
+
import { useLocalStorage as useLocalStorage17 } from "usehooks-ts";
|
|
267
|
+
|
|
268
|
+
// src/lib/helpers.ts
|
|
269
|
+
import * as bitcoin from "bitcoinjs-lib";
|
|
270
|
+
import axios from "axios";
|
|
271
|
+
|
|
272
|
+
// src/lib/urls.ts
|
|
273
|
+
var MEMPOOL_SPACE_URL2 = "https://mempool.space";
|
|
274
|
+
var MEMPOOL_SPACE_TESTNET_URL2 = "https://mempool.space/testnet";
|
|
275
|
+
var getMempoolSpaceUrl2 = (network) => network === TESTNET ? MEMPOOL_SPACE_TESTNET_URL2 : MEMPOOL_SPACE_URL2;
|
|
276
|
+
|
|
277
|
+
// src/lib/helpers.ts
|
|
278
|
+
import * as ecc from "@bitcoinerlab/secp256k1";
|
|
279
|
+
bitcoin.initEccLib(ecc);
|
|
280
|
+
var getBitcoinNetwork = (network) => {
|
|
281
|
+
if (network === TESTNET) {
|
|
282
|
+
return bitcoin.networks.testnet;
|
|
283
|
+
} else if (network === SIGNET) {
|
|
284
|
+
return bitcoin.networks.testnet;
|
|
285
|
+
} else if (network === REGTEST) {
|
|
286
|
+
return bitcoin.networks.regtest;
|
|
287
|
+
} else {
|
|
288
|
+
return bitcoin.networks.bitcoin;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
var findOrdinalsAddress = (addresses) => {
|
|
292
|
+
return addresses.find(
|
|
293
|
+
({ purpose }) => purpose === "ordinals"
|
|
294
|
+
);
|
|
295
|
+
};
|
|
296
|
+
var findPaymentAddress = (addresses) => {
|
|
297
|
+
return addresses.find(
|
|
298
|
+
({ purpose }) => purpose === "payment"
|
|
299
|
+
);
|
|
300
|
+
};
|
|
301
|
+
var getBTCBalance = (address3) => __async(void 0, null, function* () {
|
|
302
|
+
try {
|
|
303
|
+
return yield axios.get(`https://blockchain.info/q/addressbalance/${address3}`).then((response) => response.data);
|
|
304
|
+
} catch (error) {
|
|
305
|
+
console.error("Error fetching BTC balance:", error);
|
|
306
|
+
throw new Error("Failed to fetch BTC balance");
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
var satoshisToBTC = (satoshis) => {
|
|
310
|
+
if (Number.isNaN(satoshis) || satoshis === void 0)
|
|
311
|
+
return "--";
|
|
312
|
+
const btcValue = satoshis / 1e8;
|
|
313
|
+
return btcValue.toFixed(8);
|
|
314
|
+
};
|
|
315
|
+
var isBase64 = (str) => {
|
|
316
|
+
const base64Regex = /^(?:[A-Za-z0-9+\/]{4})*?(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/;
|
|
317
|
+
return base64Regex.test(str);
|
|
318
|
+
};
|
|
319
|
+
var isHex = (str) => {
|
|
320
|
+
const hexRegex = /^[a-fA-F0-9]+$/;
|
|
321
|
+
return hexRegex.test(str);
|
|
322
|
+
};
|
|
323
|
+
function estimateTxSize(taprootInputCount, nonTaprootInputCount, outputCount) {
|
|
324
|
+
const baseTxSize = 10;
|
|
325
|
+
const taprootInputSize = 57;
|
|
326
|
+
const nonTaprootInputSize = 41;
|
|
327
|
+
const outputSize = 34;
|
|
328
|
+
const totalInputSize = taprootInputCount * taprootInputSize + nonTaprootInputCount * nonTaprootInputSize;
|
|
329
|
+
const totalOutputSize = outputCount * outputSize;
|
|
330
|
+
return baseTxSize + totalInputSize + totalOutputSize;
|
|
331
|
+
}
|
|
332
|
+
function createSendBtcPsbt(address3, paymentAddress, recipientAddress, amount, paymentPublicKey, network, feeRate = 7) {
|
|
333
|
+
return __async(this, null, function* () {
|
|
334
|
+
const isTaprootOnly = address3 === paymentAddress;
|
|
335
|
+
const mempoolUrl = `${getMempoolSpaceUrl2(
|
|
336
|
+
network
|
|
337
|
+
)}/api/address/${paymentAddress}/utxo`;
|
|
338
|
+
const utxos = yield axios.get(mempoolUrl).then((response) => response.data);
|
|
339
|
+
const sortedUtxos = utxos.sort(
|
|
340
|
+
(a, b) => b.value - a.value
|
|
341
|
+
);
|
|
342
|
+
const psbt = new bitcoin.Psbt({ network: getBitcoinNetwork(network) });
|
|
343
|
+
const estTxSize = estimateTxSize(1, 0, 2);
|
|
344
|
+
const satsNeeded = Math.floor(estTxSize * feeRate) + amount;
|
|
345
|
+
let amountGathered = 0;
|
|
346
|
+
let counter = 0;
|
|
347
|
+
try {
|
|
348
|
+
for (var iter = __forAwait(sortedUtxos), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {
|
|
349
|
+
let utxo = temp.value;
|
|
350
|
+
const { txid, vout, value } = utxo;
|
|
351
|
+
const script = bitcoin.address.toOutputScript(
|
|
352
|
+
paymentAddress,
|
|
353
|
+
getBitcoinNetwork(network)
|
|
354
|
+
);
|
|
355
|
+
psbt.addInput({
|
|
356
|
+
hash: txid,
|
|
357
|
+
index: vout,
|
|
358
|
+
witnessUtxo: {
|
|
359
|
+
script,
|
|
360
|
+
value
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
if (!isTaprootOnly) {
|
|
364
|
+
const redeemScript = getRedeemScript(paymentPublicKey, network);
|
|
365
|
+
psbt.updateInput(counter, { redeemScript });
|
|
366
|
+
}
|
|
367
|
+
amountGathered += value;
|
|
368
|
+
if (amountGathered >= satsNeeded) {
|
|
369
|
+
break;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
} catch (temp) {
|
|
373
|
+
error = [temp];
|
|
374
|
+
} finally {
|
|
375
|
+
try {
|
|
376
|
+
more && (temp = iter.return) && (yield temp.call(iter));
|
|
377
|
+
} finally {
|
|
378
|
+
if (error)
|
|
379
|
+
throw error[0];
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
if (amountGathered < satsNeeded) {
|
|
383
|
+
throw new Error("Insufficient funds");
|
|
384
|
+
}
|
|
385
|
+
psbt.addOutput({
|
|
386
|
+
address: recipientAddress,
|
|
387
|
+
value: amount
|
|
388
|
+
});
|
|
389
|
+
if (amountGathered > satsNeeded) {
|
|
390
|
+
psbt.addOutput({
|
|
391
|
+
address: paymentAddress,
|
|
392
|
+
value: amountGathered - satsNeeded - amount
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
return {
|
|
396
|
+
psbtBase64: psbt.toBase64(),
|
|
397
|
+
psbtHex: psbt.toHex()
|
|
398
|
+
};
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
function getRedeemScript(paymentPublicKey, network) {
|
|
402
|
+
var _a;
|
|
403
|
+
const p2wpkh = bitcoin.payments.p2wpkh({
|
|
404
|
+
pubkey: Buffer.from(paymentPublicKey, "hex"),
|
|
405
|
+
network: getBitcoinNetwork(network)
|
|
406
|
+
});
|
|
407
|
+
const p2sh = bitcoin.payments.p2sh({
|
|
408
|
+
redeem: p2wpkh,
|
|
409
|
+
network: getBitcoinNetwork(network)
|
|
410
|
+
});
|
|
411
|
+
return (_a = p2sh == null ? void 0 : p2sh.redeem) == null ? void 0 : _a.output;
|
|
412
|
+
}
|
|
413
|
+
function delay(ms) {
|
|
414
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// src/providers/LaserEyesProvider.tsx
|
|
418
|
+
import {
|
|
419
|
+
BitcoinNetworkType as BitcoinNetworkType17,
|
|
420
|
+
getAddress as getAddress17,
|
|
421
|
+
request as request17,
|
|
422
|
+
RpcErrorCode as RpcErrorCode17,
|
|
423
|
+
signMessage as signMessageSatsConnect17,
|
|
424
|
+
signTransaction as signTransaction17
|
|
425
|
+
} from "sats-connect";
|
|
426
|
+
import { fromOutputScript as fromOutputScript17 } from "bitcoinjs-lib/src/address";
|
|
427
|
+
import axios35 from "axios";
|
|
428
|
+
|
|
429
|
+
// dist/index.mjs
|
|
430
|
+
import {
|
|
431
|
+
createContext as createContext16,
|
|
432
|
+
useCallback as useCallback31,
|
|
433
|
+
useContext as useContext16,
|
|
434
|
+
useEffect as useEffect31,
|
|
435
|
+
useRef as useRef16,
|
|
436
|
+
useState as useState31
|
|
437
|
+
} from "react";
|
|
438
|
+
import * as bitcoin18 from "bitcoinjs-lib";
|
|
439
|
+
import { useLocalStorage as useLocalStorage16 } from "usehooks-ts";
|
|
440
|
+
import * as bitcoin2 from "bitcoinjs-lib";
|
|
441
|
+
import axios2 from "axios";
|
|
442
|
+
import * as ecc2 from "@bitcoinerlab/secp256k1";
|
|
443
|
+
import {
|
|
444
|
+
BitcoinNetworkType as BitcoinNetworkType16,
|
|
445
|
+
getAddress as getAddress16,
|
|
446
|
+
request as request16,
|
|
447
|
+
RpcErrorCode as RpcErrorCode16,
|
|
448
|
+
signMessage as signMessageSatsConnect16,
|
|
449
|
+
signTransaction as signTransaction16
|
|
450
|
+
} from "sats-connect";
|
|
451
|
+
import { fromOutputScript as fromOutputScript16 } from "bitcoinjs-lib/src/address";
|
|
452
|
+
import axios33 from "axios";
|
|
453
|
+
import {
|
|
454
|
+
createContext as createContext15,
|
|
455
|
+
useCallback as useCallback29,
|
|
456
|
+
useContext as useContext15,
|
|
457
|
+
useEffect as useEffect29,
|
|
458
|
+
useRef as useRef15,
|
|
459
|
+
useState as useState29
|
|
460
|
+
} from "react";
|
|
461
|
+
import * as bitcoin17 from "bitcoinjs-lib";
|
|
462
|
+
import { useLocalStorage as useLocalStorage15 } from "usehooks-ts";
|
|
463
|
+
import * as bitcoin22 from "bitcoinjs-lib";
|
|
464
|
+
import axios22 from "axios";
|
|
465
|
+
import * as ecc22 from "@bitcoinerlab/secp256k1";
|
|
466
|
+
import {
|
|
467
|
+
BitcoinNetworkType as BitcoinNetworkType15,
|
|
468
|
+
getAddress as getAddress15,
|
|
469
|
+
request as request15,
|
|
470
|
+
RpcErrorCode as RpcErrorCode15,
|
|
471
|
+
signMessage as signMessageSatsConnect15,
|
|
472
|
+
signTransaction as signTransaction15
|
|
473
|
+
} from "sats-connect";
|
|
474
|
+
import { fromOutputScript as fromOutputScript15 } from "bitcoinjs-lib/src/address";
|
|
475
|
+
import axios31 from "axios";
|
|
476
|
+
import {
|
|
477
|
+
createContext as createContext14,
|
|
478
|
+
useCallback as useCallback27,
|
|
479
|
+
useContext as useContext14,
|
|
480
|
+
useEffect as useEffect27,
|
|
481
|
+
useRef as useRef14,
|
|
482
|
+
useState as useState27
|
|
483
|
+
} from "react";
|
|
484
|
+
import * as bitcoin16 from "bitcoinjs-lib";
|
|
485
|
+
import { useLocalStorage as useLocalStorage14 } from "usehooks-ts";
|
|
486
|
+
import * as bitcoin222 from "bitcoinjs-lib";
|
|
487
|
+
import axios222 from "axios";
|
|
488
|
+
import * as ecc222 from "@bitcoinerlab/secp256k1";
|
|
489
|
+
import {
|
|
490
|
+
BitcoinNetworkType as BitcoinNetworkType14,
|
|
491
|
+
getAddress as getAddress14,
|
|
492
|
+
request as request14,
|
|
493
|
+
RpcErrorCode as RpcErrorCode14,
|
|
494
|
+
signMessage as signMessageSatsConnect14,
|
|
495
|
+
signTransaction as signTransaction14
|
|
496
|
+
} from "sats-connect";
|
|
497
|
+
import { fromOutputScript as fromOutputScript14 } from "bitcoinjs-lib/src/address";
|
|
498
|
+
import axios29 from "axios";
|
|
499
|
+
import {
|
|
500
|
+
createContext as createContext13,
|
|
501
|
+
useCallback as useCallback25,
|
|
502
|
+
useContext as useContext13,
|
|
503
|
+
useEffect as useEffect25,
|
|
504
|
+
useRef as useRef13,
|
|
505
|
+
useState as useState25
|
|
506
|
+
} from "react";
|
|
507
|
+
import * as bitcoin15 from "bitcoinjs-lib";
|
|
508
|
+
import { useLocalStorage as useLocalStorage13 } from "usehooks-ts";
|
|
509
|
+
import * as bitcoin2222 from "bitcoinjs-lib";
|
|
510
|
+
import axios2222 from "axios";
|
|
511
|
+
import * as ecc2222 from "@bitcoinerlab/secp256k1";
|
|
512
|
+
import {
|
|
513
|
+
BitcoinNetworkType as BitcoinNetworkType13,
|
|
514
|
+
getAddress as getAddress13,
|
|
515
|
+
request as request13,
|
|
516
|
+
RpcErrorCode as RpcErrorCode13,
|
|
517
|
+
signMessage as signMessageSatsConnect13,
|
|
518
|
+
signTransaction as signTransaction13
|
|
519
|
+
} from "sats-connect";
|
|
520
|
+
import { fromOutputScript as fromOutputScript13 } from "bitcoinjs-lib/src/address";
|
|
521
|
+
import axios27 from "axios";
|
|
522
|
+
import {
|
|
523
|
+
createContext as createContext12,
|
|
524
|
+
useCallback as useCallback23,
|
|
525
|
+
useContext as useContext12,
|
|
526
|
+
useEffect as useEffect23,
|
|
527
|
+
useRef as useRef12,
|
|
528
|
+
useState as useState23
|
|
529
|
+
} from "react";
|
|
530
|
+
import * as bitcoin14 from "bitcoinjs-lib";
|
|
531
|
+
import { useLocalStorage as useLocalStorage12 } from "usehooks-ts";
|
|
532
|
+
import * as bitcoin22222 from "bitcoinjs-lib";
|
|
533
|
+
import axios22222 from "axios";
|
|
534
|
+
import * as ecc22222 from "@bitcoinerlab/secp256k1";
|
|
535
|
+
import {
|
|
536
|
+
BitcoinNetworkType as BitcoinNetworkType12,
|
|
537
|
+
getAddress as getAddress12,
|
|
538
|
+
request as request12,
|
|
539
|
+
RpcErrorCode as RpcErrorCode12,
|
|
540
|
+
signMessage as signMessageSatsConnect12,
|
|
541
|
+
signTransaction as signTransaction12
|
|
542
|
+
} from "sats-connect";
|
|
543
|
+
import { fromOutputScript as fromOutputScript12 } from "bitcoinjs-lib/src/address";
|
|
544
|
+
import axios25 from "axios";
|
|
545
|
+
import {
|
|
546
|
+
createContext as createContext11,
|
|
547
|
+
useCallback as useCallback21,
|
|
548
|
+
useContext as useContext11,
|
|
549
|
+
useEffect as useEffect21,
|
|
550
|
+
useRef as useRef11,
|
|
551
|
+
useState as useState21
|
|
552
|
+
} from "react";
|
|
553
|
+
import * as bitcoin13 from "bitcoinjs-lib";
|
|
554
|
+
import { useLocalStorage as useLocalStorage11 } from "usehooks-ts";
|
|
555
|
+
import * as bitcoin222222 from "bitcoinjs-lib";
|
|
556
|
+
import axios222222 from "axios";
|
|
557
|
+
import * as ecc222222 from "@bitcoinerlab/secp256k1";
|
|
558
|
+
import {
|
|
559
|
+
BitcoinNetworkType as BitcoinNetworkType11,
|
|
560
|
+
getAddress as getAddress11,
|
|
561
|
+
request as request11,
|
|
562
|
+
RpcErrorCode as RpcErrorCode11,
|
|
563
|
+
signMessage as signMessageSatsConnect11,
|
|
564
|
+
signTransaction as signTransaction11
|
|
565
|
+
} from "sats-connect";
|
|
566
|
+
import { fromOutputScript as fromOutputScript11 } from "bitcoinjs-lib/src/address";
|
|
567
|
+
import axios23 from "axios";
|
|
568
|
+
import {
|
|
569
|
+
createContext as createContext10,
|
|
570
|
+
useCallback as useCallback19,
|
|
571
|
+
useContext as useContext10,
|
|
572
|
+
useEffect as useEffect19,
|
|
573
|
+
useRef as useRef10,
|
|
574
|
+
useState as useState19
|
|
575
|
+
} from "react";
|
|
576
|
+
import * as bitcoin12 from "bitcoinjs-lib";
|
|
577
|
+
import { useLocalStorage as useLocalStorage10 } from "usehooks-ts";
|
|
578
|
+
import * as bitcoin2222222 from "bitcoinjs-lib";
|
|
579
|
+
import axios2222222 from "axios";
|
|
580
|
+
import * as ecc2222222 from "@bitcoinerlab/secp256k1";
|
|
581
|
+
import {
|
|
582
|
+
BitcoinNetworkType as BitcoinNetworkType10,
|
|
583
|
+
getAddress as getAddress10,
|
|
584
|
+
request as request10,
|
|
585
|
+
RpcErrorCode as RpcErrorCode10,
|
|
586
|
+
signMessage as signMessageSatsConnect10,
|
|
587
|
+
signTransaction as signTransaction10
|
|
588
|
+
} from "sats-connect";
|
|
589
|
+
import { fromOutputScript as fromOutputScript10 } from "bitcoinjs-lib/src/address";
|
|
590
|
+
import axios20 from "axios";
|
|
591
|
+
import {
|
|
592
|
+
createContext as createContext9,
|
|
593
|
+
useCallback as useCallback17,
|
|
594
|
+
useContext as useContext9,
|
|
595
|
+
useEffect as useEffect17,
|
|
596
|
+
useRef as useRef9,
|
|
597
|
+
useState as useState17
|
|
598
|
+
} from "react";
|
|
599
|
+
import * as bitcoin11 from "bitcoinjs-lib";
|
|
600
|
+
import { useLocalStorage as useLocalStorage9 } from "usehooks-ts";
|
|
601
|
+
import * as bitcoin22222222 from "bitcoinjs-lib";
|
|
602
|
+
import axios22222222 from "axios";
|
|
603
|
+
import * as ecc22222222 from "@bitcoinerlab/secp256k1";
|
|
604
|
+
import {
|
|
605
|
+
BitcoinNetworkType as BitcoinNetworkType9,
|
|
606
|
+
getAddress as getAddress9,
|
|
607
|
+
request as request9,
|
|
608
|
+
RpcErrorCode as RpcErrorCode9,
|
|
609
|
+
signMessage as signMessageSatsConnect9,
|
|
610
|
+
signTransaction as signTransaction9
|
|
611
|
+
} from "sats-connect";
|
|
612
|
+
import { fromOutputScript as fromOutputScript9 } from "bitcoinjs-lib/src/address";
|
|
613
|
+
import axios18 from "axios";
|
|
614
|
+
import {
|
|
615
|
+
createContext as createContext8,
|
|
616
|
+
useCallback as useCallback15,
|
|
617
|
+
useContext as useContext8,
|
|
618
|
+
useEffect as useEffect15,
|
|
619
|
+
useRef as useRef8,
|
|
620
|
+
useState as useState15
|
|
621
|
+
} from "react";
|
|
622
|
+
import * as bitcoin10 from "bitcoinjs-lib";
|
|
623
|
+
import { useLocalStorage as useLocalStorage8 } from "usehooks-ts";
|
|
624
|
+
import * as bitcoin222222222 from "bitcoinjs-lib";
|
|
625
|
+
import axios222222222 from "axios";
|
|
626
|
+
import * as ecc222222222 from "@bitcoinerlab/secp256k1";
|
|
627
|
+
import {
|
|
628
|
+
BitcoinNetworkType as BitcoinNetworkType8,
|
|
629
|
+
getAddress as getAddress8,
|
|
630
|
+
request as request8,
|
|
631
|
+
RpcErrorCode as RpcErrorCode8,
|
|
632
|
+
signMessage as signMessageSatsConnect8,
|
|
633
|
+
signTransaction as signTransaction8
|
|
634
|
+
} from "sats-connect";
|
|
635
|
+
import { fromOutputScript as fromOutputScript8 } from "bitcoinjs-lib/src/address";
|
|
636
|
+
import axios16 from "axios";
|
|
637
|
+
import {
|
|
638
|
+
createContext as createContext7,
|
|
639
|
+
useCallback as useCallback13,
|
|
640
|
+
useContext as useContext7,
|
|
641
|
+
useEffect as useEffect13,
|
|
642
|
+
useRef as useRef7,
|
|
643
|
+
useState as useState13
|
|
644
|
+
} from "react";
|
|
645
|
+
import * as bitcoin9 from "bitcoinjs-lib";
|
|
646
|
+
import { useLocalStorage as useLocalStorage7 } from "usehooks-ts";
|
|
647
|
+
import * as bitcoin2222222222 from "bitcoinjs-lib";
|
|
648
|
+
import axios2222222222 from "axios";
|
|
649
|
+
import * as ecc2222222222 from "@bitcoinerlab/secp256k1";
|
|
650
|
+
import {
|
|
651
|
+
BitcoinNetworkType as BitcoinNetworkType7,
|
|
652
|
+
getAddress as getAddress7,
|
|
653
|
+
request as request7,
|
|
654
|
+
RpcErrorCode as RpcErrorCode7,
|
|
655
|
+
signMessage as signMessageSatsConnect7,
|
|
656
|
+
signTransaction as signTransaction7
|
|
657
|
+
} from "sats-connect";
|
|
658
|
+
import { fromOutputScript as fromOutputScript7 } from "bitcoinjs-lib/src/address";
|
|
659
|
+
import axios14 from "axios";
|
|
660
|
+
import {
|
|
661
|
+
createContext as createContext6,
|
|
662
|
+
useCallback as useCallback11,
|
|
663
|
+
useContext as useContext6,
|
|
664
|
+
useEffect as useEffect11,
|
|
665
|
+
useRef as useRef6,
|
|
666
|
+
useState as useState11
|
|
667
|
+
} from "react";
|
|
668
|
+
import * as bitcoin8 from "bitcoinjs-lib";
|
|
669
|
+
import { useLocalStorage as useLocalStorage6 } from "usehooks-ts";
|
|
670
|
+
import * as bitcoin22222222222 from "bitcoinjs-lib";
|
|
671
|
+
import axios22222222222 from "axios";
|
|
672
|
+
import * as ecc22222222222 from "@bitcoinerlab/secp256k1";
|
|
673
|
+
import {
|
|
674
|
+
BitcoinNetworkType as BitcoinNetworkType6,
|
|
675
|
+
getAddress as getAddress6,
|
|
676
|
+
request as request6,
|
|
677
|
+
RpcErrorCode as RpcErrorCode6,
|
|
678
|
+
signMessage as signMessageSatsConnect6,
|
|
679
|
+
signTransaction as signTransaction6
|
|
680
|
+
} from "sats-connect";
|
|
681
|
+
import { fromOutputScript as fromOutputScript6 } from "bitcoinjs-lib/src/address";
|
|
682
|
+
import axios12 from "axios";
|
|
683
|
+
import {
|
|
684
|
+
createContext as createContext5,
|
|
685
|
+
useCallback as useCallback9,
|
|
686
|
+
useContext as useContext5,
|
|
687
|
+
useEffect as useEffect9,
|
|
688
|
+
useRef as useRef5,
|
|
689
|
+
useState as useState9
|
|
690
|
+
} from "react";
|
|
691
|
+
import * as bitcoin7 from "bitcoinjs-lib";
|
|
692
|
+
import { useLocalStorage as useLocalStorage5 } from "usehooks-ts";
|
|
693
|
+
import * as bitcoin222222222222 from "bitcoinjs-lib";
|
|
694
|
+
import axios222222222222 from "axios";
|
|
695
|
+
import * as ecc222222222222 from "@bitcoinerlab/secp256k1";
|
|
696
|
+
import {
|
|
697
|
+
BitcoinNetworkType as BitcoinNetworkType5,
|
|
698
|
+
getAddress as getAddress5,
|
|
699
|
+
request as request5,
|
|
700
|
+
RpcErrorCode as RpcErrorCode5,
|
|
701
|
+
signMessage as signMessageSatsConnect5,
|
|
702
|
+
signTransaction as signTransaction5
|
|
703
|
+
} from "sats-connect";
|
|
704
|
+
import { fromOutputScript as fromOutputScript5 } from "bitcoinjs-lib/src/address";
|
|
705
|
+
import axios10 from "axios";
|
|
706
|
+
import {
|
|
707
|
+
createContext as createContext4,
|
|
708
|
+
useCallback as useCallback7,
|
|
709
|
+
useContext as useContext4,
|
|
710
|
+
useEffect as useEffect7,
|
|
711
|
+
useRef as useRef4,
|
|
712
|
+
useState as useState7
|
|
713
|
+
} from "react";
|
|
714
|
+
import * as bitcoin6 from "bitcoinjs-lib";
|
|
715
|
+
import { useLocalStorage as useLocalStorage4 } from "usehooks-ts";
|
|
716
|
+
import * as bitcoin2222222222222 from "bitcoinjs-lib";
|
|
717
|
+
import axios2222222222222 from "axios";
|
|
718
|
+
import * as ecc2222222222222 from "@bitcoinerlab/secp256k1";
|
|
719
|
+
import {
|
|
720
|
+
BitcoinNetworkType as BitcoinNetworkType4,
|
|
721
|
+
getAddress as getAddress4,
|
|
722
|
+
request as request4,
|
|
723
|
+
RpcErrorCode as RpcErrorCode4,
|
|
724
|
+
signMessage as signMessageSatsConnect4,
|
|
725
|
+
signTransaction as signTransaction4
|
|
726
|
+
} from "sats-connect";
|
|
727
|
+
import { fromOutputScript as fromOutputScript4 } from "bitcoinjs-lib/src/address";
|
|
728
|
+
import axios8 from "axios";
|
|
729
|
+
import {
|
|
730
|
+
createContext as createContext3,
|
|
731
|
+
useCallback as useCallback5,
|
|
732
|
+
useContext as useContext3,
|
|
733
|
+
useEffect as useEffect5,
|
|
734
|
+
useRef as useRef3,
|
|
735
|
+
useState as useState5
|
|
736
|
+
} from "react";
|
|
737
|
+
import * as bitcoin5 from "bitcoinjs-lib";
|
|
738
|
+
import { useLocalStorage as useLocalStorage3 } from "usehooks-ts";
|
|
739
|
+
import * as bitcoin22222222222222 from "bitcoinjs-lib";
|
|
740
|
+
import axios22222222222222 from "axios";
|
|
741
|
+
import * as ecc22222222222222 from "@bitcoinerlab/secp256k1";
|
|
742
|
+
import {
|
|
743
|
+
BitcoinNetworkType as BitcoinNetworkType3,
|
|
744
|
+
getAddress as getAddress3,
|
|
745
|
+
request as request3,
|
|
746
|
+
RpcErrorCode as RpcErrorCode3,
|
|
747
|
+
signMessage as signMessageSatsConnect3,
|
|
748
|
+
signTransaction as signTransaction3
|
|
749
|
+
} from "sats-connect";
|
|
750
|
+
import { fromOutputScript as fromOutputScript3 } from "bitcoinjs-lib/src/address";
|
|
751
|
+
import axios6 from "axios";
|
|
752
|
+
import {
|
|
753
|
+
createContext as createContext2,
|
|
754
|
+
useCallback as useCallback3,
|
|
755
|
+
useContext as useContext2,
|
|
756
|
+
useEffect as useEffect3,
|
|
757
|
+
useRef as useRef2,
|
|
758
|
+
useState as useState3
|
|
759
|
+
} from "react";
|
|
760
|
+
import * as bitcoin4 from "bitcoinjs-lib";
|
|
761
|
+
import { useLocalStorage as useLocalStorage2 } from "usehooks-ts";
|
|
762
|
+
import * as bitcoin222222222222222 from "bitcoinjs-lib";
|
|
763
|
+
import axios222222222222222 from "axios";
|
|
764
|
+
import * as ecc222222222222222 from "@bitcoinerlab/secp256k1";
|
|
765
|
+
import {
|
|
766
|
+
BitcoinNetworkType as BitcoinNetworkType2,
|
|
767
|
+
getAddress as getAddress2,
|
|
768
|
+
request as request2,
|
|
769
|
+
RpcErrorCode as RpcErrorCode2,
|
|
770
|
+
signMessage as signMessageSatsConnect2,
|
|
771
|
+
signTransaction as signTransaction2
|
|
772
|
+
} from "sats-connect";
|
|
773
|
+
import { fromOutputScript as fromOutputScript2 } from "bitcoinjs-lib/src/address";
|
|
774
|
+
import axios4 from "axios";
|
|
775
|
+
import {
|
|
776
|
+
createContext,
|
|
777
|
+
useCallback,
|
|
778
|
+
useContext,
|
|
779
|
+
useEffect,
|
|
780
|
+
useRef,
|
|
781
|
+
useState
|
|
782
|
+
} from "react";
|
|
783
|
+
import * as bitcoin2222222222222222 from "bitcoinjs-lib";
|
|
784
|
+
import { useLocalStorage } from "usehooks-ts";
|
|
785
|
+
import * as bitcoin3 from "bitcoinjs-lib";
|
|
786
|
+
import axios2222222222222222 from "axios";
|
|
787
|
+
import * as ecc2222222222222222 from "@bitcoinerlab/secp256k1";
|
|
788
|
+
import {
|
|
789
|
+
BitcoinNetworkType,
|
|
790
|
+
getAddress,
|
|
791
|
+
request,
|
|
792
|
+
RpcErrorCode,
|
|
793
|
+
signMessage as signMessageSatsConnect,
|
|
794
|
+
signTransaction
|
|
795
|
+
} from "sats-connect";
|
|
796
|
+
import { fromOutputScript } from "bitcoinjs-lib/src/address";
|
|
797
|
+
import axios22222222222222222 from "axios";
|
|
798
|
+
import { jsx } from "react/jsx-runtime";
|
|
799
|
+
import { useCallback as useCallback2, useEffect as useEffect2, useState as useState2 } from "react";
|
|
800
|
+
import axios3 from "axios";
|
|
801
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
802
|
+
import { useCallback as useCallback4, useEffect as useEffect4, useState as useState4 } from "react";
|
|
803
|
+
import axios5 from "axios";
|
|
804
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
805
|
+
import { useCallback as useCallback6, useEffect as useEffect6, useState as useState6 } from "react";
|
|
806
|
+
import axios7 from "axios";
|
|
807
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
808
|
+
import { useCallback as useCallback8, useEffect as useEffect8, useState as useState8 } from "react";
|
|
809
|
+
import axios9 from "axios";
|
|
810
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
811
|
+
import { useCallback as useCallback10, useEffect as useEffect10, useState as useState10 } from "react";
|
|
812
|
+
import axios11 from "axios";
|
|
813
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
814
|
+
import { useCallback as useCallback12, useEffect as useEffect12, useState as useState12 } from "react";
|
|
815
|
+
import axios13 from "axios";
|
|
816
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
817
|
+
import { useCallback as useCallback14, useEffect as useEffect14, useState as useState14 } from "react";
|
|
818
|
+
import axios15 from "axios";
|
|
819
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
820
|
+
import { useCallback as useCallback16, useEffect as useEffect16, useState as useState16 } from "react";
|
|
821
|
+
import axios17 from "axios";
|
|
822
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
823
|
+
import { useCallback as useCallback18, useEffect as useEffect18, useState as useState18 } from "react";
|
|
824
|
+
import axios19 from "axios";
|
|
825
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
826
|
+
import { useCallback as useCallback20, useEffect as useEffect20, useState as useState20 } from "react";
|
|
827
|
+
import axios21 from "axios";
|
|
828
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
829
|
+
import { useCallback as useCallback22, useEffect as useEffect22, useState as useState22 } from "react";
|
|
830
|
+
import axios24 from "axios";
|
|
831
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
832
|
+
import { useCallback as useCallback24, useEffect as useEffect24, useState as useState24 } from "react";
|
|
833
|
+
import axios26 from "axios";
|
|
834
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
835
|
+
import { useCallback as useCallback26, useEffect as useEffect26, useState as useState26 } from "react";
|
|
836
|
+
import axios28 from "axios";
|
|
837
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
838
|
+
import { useCallback as useCallback28, useEffect as useEffect28, useState as useState28 } from "react";
|
|
839
|
+
import axios30 from "axios";
|
|
840
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
841
|
+
import { useCallback as useCallback30, useEffect as useEffect30, useState as useState30 } from "react";
|
|
842
|
+
import axios32 from "axios";
|
|
843
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
844
|
+
import { useCallback as useCallback32, useEffect as useEffect32, useState as useState32 } from "react";
|
|
845
|
+
import axios34 from "axios";
|
|
846
|
+
var __async2 = (__this, __arguments, generator) => {
|
|
847
|
+
return new Promise((resolve, reject) => {
|
|
848
|
+
var fulfilled = (value) => {
|
|
849
|
+
try {
|
|
850
|
+
step(generator.next(value));
|
|
851
|
+
} catch (e) {
|
|
852
|
+
reject(e);
|
|
853
|
+
}
|
|
854
|
+
};
|
|
855
|
+
var rejected = (value) => {
|
|
856
|
+
try {
|
|
857
|
+
step(generator.throw(value));
|
|
858
|
+
} catch (e) {
|
|
859
|
+
reject(e);
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
863
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
864
|
+
});
|
|
865
|
+
};
|
|
866
|
+
var MAINNET4 = "mainnet";
|
|
867
|
+
var SIGNET3 = "signet";
|
|
868
|
+
var TESTNET3 = "testnet";
|
|
869
|
+
var initialWalletContext2 = {
|
|
870
|
+
hasUnisat: false,
|
|
871
|
+
hasXverse: false,
|
|
872
|
+
hasOyl: false,
|
|
873
|
+
hasMagicEden: false,
|
|
874
|
+
hasOkx: false,
|
|
875
|
+
hasLeather: false,
|
|
876
|
+
hasPhantom: false,
|
|
877
|
+
hasWizz: false,
|
|
878
|
+
isInitializing: true,
|
|
879
|
+
connected: false,
|
|
880
|
+
isConnecting: false,
|
|
881
|
+
publicKey: "",
|
|
882
|
+
address: "",
|
|
883
|
+
paymentAddress: "",
|
|
884
|
+
paymentPublicKey: "",
|
|
885
|
+
balance: void 0,
|
|
886
|
+
network: MAINNET4,
|
|
887
|
+
library: null,
|
|
888
|
+
provider: null,
|
|
889
|
+
accounts: [],
|
|
890
|
+
connect: (walletName) => __async2(void 0, null, function* () {
|
|
891
|
+
}),
|
|
892
|
+
disconnect: () => {
|
|
893
|
+
},
|
|
894
|
+
requestAccounts: () => __async2(void 0, null, function* () {
|
|
895
|
+
return [];
|
|
896
|
+
}),
|
|
897
|
+
getNetwork: () => __async2(void 0, null, function* () {
|
|
898
|
+
return MAINNET4;
|
|
899
|
+
}),
|
|
900
|
+
switchNetwork: (network) => __async2(void 0, null, function* () {
|
|
901
|
+
}),
|
|
902
|
+
getPublicKey: () => __async2(void 0, null, function* () {
|
|
903
|
+
return "";
|
|
904
|
+
}),
|
|
905
|
+
getBalance: () => __async2(void 0, null, function* () {
|
|
906
|
+
return "";
|
|
907
|
+
}),
|
|
908
|
+
getInscriptions: () => __async2(void 0, null, function* () {
|
|
909
|
+
return [];
|
|
910
|
+
}),
|
|
911
|
+
sendBTC: (to, amount) => __async2(void 0, null, function* () {
|
|
912
|
+
return "";
|
|
913
|
+
}),
|
|
914
|
+
signMessage: (message) => __async2(void 0, null, function* () {
|
|
915
|
+
return "";
|
|
916
|
+
}),
|
|
917
|
+
signPsbt: (tx) => __async2(void 0, null, function* () {
|
|
918
|
+
return {
|
|
919
|
+
signedPsbtHex: "",
|
|
920
|
+
signedPsbtBase64: "",
|
|
921
|
+
txId: ""
|
|
922
|
+
};
|
|
923
|
+
}),
|
|
924
|
+
pushPsbt: (tx) => __async2(void 0, null, function* () {
|
|
925
|
+
return "";
|
|
926
|
+
}),
|
|
927
|
+
inscribe: (content) => __async2(void 0, null, function* () {
|
|
928
|
+
return "";
|
|
929
|
+
}),
|
|
930
|
+
isCreatingCommit: false,
|
|
931
|
+
isInscribing: false
|
|
932
|
+
};
|
|
933
|
+
bitcoin2.initEccLib(ecc2);
|
|
934
|
+
var __async22 = (__this, __arguments, generator) => {
|
|
935
|
+
return new Promise((resolve, reject) => {
|
|
936
|
+
var fulfilled = (value) => {
|
|
937
|
+
try {
|
|
938
|
+
step(generator.next(value));
|
|
939
|
+
} catch (e) {
|
|
940
|
+
reject(e);
|
|
941
|
+
}
|
|
942
|
+
};
|
|
943
|
+
var rejected = (value) => {
|
|
944
|
+
try {
|
|
945
|
+
step(generator.throw(value));
|
|
946
|
+
} catch (e) {
|
|
947
|
+
reject(e);
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
951
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
952
|
+
});
|
|
953
|
+
};
|
|
954
|
+
var MAINNET42 = "mainnet";
|
|
955
|
+
var initialWalletContext22 = {
|
|
956
|
+
hasUnisat: false,
|
|
957
|
+
hasXverse: false,
|
|
958
|
+
hasOyl: false,
|
|
959
|
+
hasMagicEden: false,
|
|
960
|
+
hasOkx: false,
|
|
961
|
+
hasLeather: false,
|
|
962
|
+
hasPhantom: false,
|
|
963
|
+
hasWizz: false,
|
|
964
|
+
isInitializing: true,
|
|
965
|
+
connected: false,
|
|
966
|
+
isConnecting: false,
|
|
967
|
+
publicKey: "",
|
|
968
|
+
address: "",
|
|
969
|
+
paymentAddress: "",
|
|
970
|
+
paymentPublicKey: "",
|
|
971
|
+
balance: void 0,
|
|
972
|
+
network: MAINNET42,
|
|
973
|
+
library: null,
|
|
974
|
+
provider: null,
|
|
975
|
+
accounts: [],
|
|
976
|
+
connect: (walletName) => __async22(void 0, null, function* () {
|
|
977
|
+
}),
|
|
978
|
+
disconnect: () => {
|
|
979
|
+
},
|
|
980
|
+
requestAccounts: () => __async22(void 0, null, function* () {
|
|
981
|
+
return [];
|
|
982
|
+
}),
|
|
983
|
+
getNetwork: () => __async22(void 0, null, function* () {
|
|
984
|
+
return MAINNET42;
|
|
985
|
+
}),
|
|
986
|
+
switchNetwork: (network) => __async22(void 0, null, function* () {
|
|
987
|
+
}),
|
|
988
|
+
getPublicKey: () => __async22(void 0, null, function* () {
|
|
989
|
+
return "";
|
|
990
|
+
}),
|
|
991
|
+
getBalance: () => __async22(void 0, null, function* () {
|
|
992
|
+
return "";
|
|
993
|
+
}),
|
|
994
|
+
getInscriptions: () => __async22(void 0, null, function* () {
|
|
995
|
+
return [];
|
|
996
|
+
}),
|
|
997
|
+
sendBTC: (to, amount) => __async22(void 0, null, function* () {
|
|
998
|
+
return "";
|
|
999
|
+
}),
|
|
1000
|
+
signMessage: (message) => __async22(void 0, null, function* () {
|
|
1001
|
+
return "";
|
|
1002
|
+
}),
|
|
1003
|
+
signPsbt: (tx) => __async22(void 0, null, function* () {
|
|
1004
|
+
return {
|
|
1005
|
+
signedPsbtHex: "",
|
|
1006
|
+
signedPsbtBase64: "",
|
|
1007
|
+
txId: ""
|
|
1008
|
+
};
|
|
1009
|
+
}),
|
|
1010
|
+
pushPsbt: (tx) => __async22(void 0, null, function* () {
|
|
1011
|
+
return "";
|
|
1012
|
+
}),
|
|
1013
|
+
inscribe: (content) => __async22(void 0, null, function* () {
|
|
1014
|
+
return "";
|
|
1015
|
+
}),
|
|
1016
|
+
isCreatingCommit: false,
|
|
1017
|
+
isInscribing: false
|
|
1018
|
+
};
|
|
1019
|
+
bitcoin22.initEccLib(ecc22);
|
|
1020
|
+
var MAINNET422 = "mainnet";
|
|
1021
|
+
var initialWalletContext222 = {
|
|
1022
|
+
hasUnisat: false,
|
|
1023
|
+
hasXverse: false,
|
|
1024
|
+
hasOyl: false,
|
|
1025
|
+
hasMagicEden: false,
|
|
1026
|
+
hasOkx: false,
|
|
1027
|
+
hasLeather: false,
|
|
1028
|
+
hasPhantom: false,
|
|
1029
|
+
hasWizz: false,
|
|
1030
|
+
isInitializing: true,
|
|
1031
|
+
connected: false,
|
|
1032
|
+
isConnecting: false,
|
|
1033
|
+
publicKey: "",
|
|
1034
|
+
address: "",
|
|
1035
|
+
paymentAddress: "",
|
|
1036
|
+
paymentPublicKey: "",
|
|
1037
|
+
balance: void 0,
|
|
1038
|
+
network: MAINNET422,
|
|
1039
|
+
library: null,
|
|
1040
|
+
provider: null,
|
|
1041
|
+
accounts: [],
|
|
1042
|
+
connect: (walletName) => __async22(void 0, null, function* () {
|
|
1043
|
+
}),
|
|
1044
|
+
disconnect: () => {
|
|
1045
|
+
},
|
|
1046
|
+
requestAccounts: () => __async22(void 0, null, function* () {
|
|
1047
|
+
return [];
|
|
1048
|
+
}),
|
|
1049
|
+
getNetwork: () => __async22(void 0, null, function* () {
|
|
1050
|
+
return MAINNET422;
|
|
1051
|
+
}),
|
|
1052
|
+
switchNetwork: (network) => __async22(void 0, null, function* () {
|
|
1053
|
+
}),
|
|
1054
|
+
getPublicKey: () => __async22(void 0, null, function* () {
|
|
1055
|
+
return "";
|
|
1056
|
+
}),
|
|
1057
|
+
getBalance: () => __async22(void 0, null, function* () {
|
|
1058
|
+
return "";
|
|
1059
|
+
}),
|
|
1060
|
+
getInscriptions: () => __async22(void 0, null, function* () {
|
|
1061
|
+
return [];
|
|
1062
|
+
}),
|
|
1063
|
+
sendBTC: (to, amount) => __async22(void 0, null, function* () {
|
|
1064
|
+
return "";
|
|
1065
|
+
}),
|
|
1066
|
+
signMessage: (message) => __async22(void 0, null, function* () {
|
|
1067
|
+
return "";
|
|
1068
|
+
}),
|
|
1069
|
+
signPsbt: (tx) => __async22(void 0, null, function* () {
|
|
1070
|
+
return {
|
|
1071
|
+
signedPsbtHex: "",
|
|
1072
|
+
signedPsbtBase64: "",
|
|
1073
|
+
txId: ""
|
|
1074
|
+
};
|
|
1075
|
+
}),
|
|
1076
|
+
pushPsbt: (tx) => __async22(void 0, null, function* () {
|
|
1077
|
+
return "";
|
|
1078
|
+
}),
|
|
1079
|
+
inscribe: (content) => __async22(void 0, null, function* () {
|
|
1080
|
+
return "";
|
|
1081
|
+
}),
|
|
1082
|
+
isCreatingCommit: false,
|
|
1083
|
+
isInscribing: false
|
|
1084
|
+
};
|
|
1085
|
+
bitcoin222.initEccLib(ecc222);
|
|
1086
|
+
var __async222 = (__this, __arguments, generator) => {
|
|
1087
|
+
return new Promise((resolve, reject) => {
|
|
1088
|
+
var fulfilled = (value) => {
|
|
1089
|
+
try {
|
|
1090
|
+
step(generator.next(value));
|
|
1091
|
+
} catch (e) {
|
|
1092
|
+
reject(e);
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1095
|
+
var rejected = (value) => {
|
|
1096
|
+
try {
|
|
1097
|
+
step(generator.throw(value));
|
|
1098
|
+
} catch (e) {
|
|
1099
|
+
reject(e);
|
|
1100
|
+
}
|
|
1101
|
+
};
|
|
1102
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1103
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1104
|
+
});
|
|
1105
|
+
};
|
|
1106
|
+
var MAINNET4222 = "mainnet";
|
|
1107
|
+
var initialWalletContext2222 = {
|
|
1108
|
+
hasUnisat: false,
|
|
1109
|
+
hasXverse: false,
|
|
1110
|
+
hasOyl: false,
|
|
1111
|
+
hasMagicEden: false,
|
|
1112
|
+
hasOkx: false,
|
|
1113
|
+
hasLeather: false,
|
|
1114
|
+
hasPhantom: false,
|
|
1115
|
+
hasWizz: false,
|
|
1116
|
+
isInitializing: true,
|
|
1117
|
+
connected: false,
|
|
1118
|
+
isConnecting: false,
|
|
1119
|
+
publicKey: "",
|
|
1120
|
+
address: "",
|
|
1121
|
+
paymentAddress: "",
|
|
1122
|
+
paymentPublicKey: "",
|
|
1123
|
+
balance: void 0,
|
|
1124
|
+
network: MAINNET4222,
|
|
1125
|
+
library: null,
|
|
1126
|
+
provider: null,
|
|
1127
|
+
accounts: [],
|
|
1128
|
+
connect: (walletName) => __async222(void 0, null, function* () {
|
|
1129
|
+
}),
|
|
1130
|
+
disconnect: () => {
|
|
1131
|
+
},
|
|
1132
|
+
requestAccounts: () => __async222(void 0, null, function* () {
|
|
1133
|
+
return [];
|
|
1134
|
+
}),
|
|
1135
|
+
getNetwork: () => __async222(void 0, null, function* () {
|
|
1136
|
+
return MAINNET4222;
|
|
1137
|
+
}),
|
|
1138
|
+
switchNetwork: (network) => __async222(void 0, null, function* () {
|
|
1139
|
+
}),
|
|
1140
|
+
getPublicKey: () => __async222(void 0, null, function* () {
|
|
1141
|
+
return "";
|
|
1142
|
+
}),
|
|
1143
|
+
getBalance: () => __async222(void 0, null, function* () {
|
|
1144
|
+
return "";
|
|
1145
|
+
}),
|
|
1146
|
+
getInscriptions: () => __async222(void 0, null, function* () {
|
|
1147
|
+
return [];
|
|
1148
|
+
}),
|
|
1149
|
+
sendBTC: (to, amount) => __async222(void 0, null, function* () {
|
|
1150
|
+
return "";
|
|
1151
|
+
}),
|
|
1152
|
+
signMessage: (message) => __async222(void 0, null, function* () {
|
|
1153
|
+
return "";
|
|
1154
|
+
}),
|
|
1155
|
+
signPsbt: (tx) => __async222(void 0, null, function* () {
|
|
1156
|
+
return {
|
|
1157
|
+
signedPsbtHex: "",
|
|
1158
|
+
signedPsbtBase64: "",
|
|
1159
|
+
txId: ""
|
|
1160
|
+
};
|
|
1161
|
+
}),
|
|
1162
|
+
pushPsbt: (tx) => __async222(void 0, null, function* () {
|
|
1163
|
+
return "";
|
|
1164
|
+
}),
|
|
1165
|
+
inscribe: (content) => __async222(void 0, null, function* () {
|
|
1166
|
+
return "";
|
|
1167
|
+
}),
|
|
1168
|
+
isCreatingCommit: false,
|
|
1169
|
+
isInscribing: false
|
|
1170
|
+
};
|
|
1171
|
+
bitcoin2222.initEccLib(ecc2222);
|
|
1172
|
+
var __async2222 = (__this, __arguments, generator) => {
|
|
1173
|
+
return new Promise((resolve, reject) => {
|
|
1174
|
+
var fulfilled = (value) => {
|
|
1175
|
+
try {
|
|
1176
|
+
step(generator.next(value));
|
|
1177
|
+
} catch (e) {
|
|
1178
|
+
reject(e);
|
|
1179
|
+
}
|
|
1180
|
+
};
|
|
1181
|
+
var rejected = (value) => {
|
|
1182
|
+
try {
|
|
1183
|
+
step(generator.throw(value));
|
|
1184
|
+
} catch (e) {
|
|
1185
|
+
reject(e);
|
|
1186
|
+
}
|
|
1187
|
+
};
|
|
1188
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1189
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1190
|
+
});
|
|
1191
|
+
};
|
|
1192
|
+
var MAINNET42222 = "mainnet";
|
|
1193
|
+
var initialWalletContext22222 = {
|
|
1194
|
+
hasUnisat: false,
|
|
1195
|
+
hasXverse: false,
|
|
1196
|
+
hasOyl: false,
|
|
1197
|
+
hasMagicEden: false,
|
|
1198
|
+
hasOkx: false,
|
|
1199
|
+
hasLeather: false,
|
|
1200
|
+
hasPhantom: false,
|
|
1201
|
+
hasWizz: false,
|
|
1202
|
+
isInitializing: true,
|
|
1203
|
+
connected: false,
|
|
1204
|
+
isConnecting: false,
|
|
1205
|
+
publicKey: "",
|
|
1206
|
+
address: "",
|
|
1207
|
+
paymentAddress: "",
|
|
1208
|
+
paymentPublicKey: "",
|
|
1209
|
+
balance: void 0,
|
|
1210
|
+
network: MAINNET42222,
|
|
1211
|
+
library: null,
|
|
1212
|
+
provider: null,
|
|
1213
|
+
accounts: [],
|
|
1214
|
+
connect: (walletName) => __async2222(void 0, null, function* () {
|
|
1215
|
+
}),
|
|
1216
|
+
disconnect: () => {
|
|
1217
|
+
},
|
|
1218
|
+
requestAccounts: () => __async2222(void 0, null, function* () {
|
|
1219
|
+
return [];
|
|
1220
|
+
}),
|
|
1221
|
+
getNetwork: () => __async2222(void 0, null, function* () {
|
|
1222
|
+
return MAINNET42222;
|
|
1223
|
+
}),
|
|
1224
|
+
switchNetwork: (network) => __async2222(void 0, null, function* () {
|
|
1225
|
+
}),
|
|
1226
|
+
getPublicKey: () => __async2222(void 0, null, function* () {
|
|
1227
|
+
return "";
|
|
1228
|
+
}),
|
|
1229
|
+
getBalance: () => __async2222(void 0, null, function* () {
|
|
1230
|
+
return "";
|
|
1231
|
+
}),
|
|
1232
|
+
getInscriptions: () => __async2222(void 0, null, function* () {
|
|
1233
|
+
return [];
|
|
1234
|
+
}),
|
|
1235
|
+
sendBTC: (to, amount) => __async2222(void 0, null, function* () {
|
|
1236
|
+
return "";
|
|
1237
|
+
}),
|
|
1238
|
+
signMessage: (message) => __async2222(void 0, null, function* () {
|
|
1239
|
+
return "";
|
|
1240
|
+
}),
|
|
1241
|
+
signPsbt: (tx) => __async2222(void 0, null, function* () {
|
|
1242
|
+
return {
|
|
1243
|
+
signedPsbtHex: "",
|
|
1244
|
+
signedPsbtBase64: "",
|
|
1245
|
+
txId: ""
|
|
1246
|
+
};
|
|
1247
|
+
}),
|
|
1248
|
+
pushPsbt: (tx) => __async2222(void 0, null, function* () {
|
|
1249
|
+
return "";
|
|
1250
|
+
}),
|
|
1251
|
+
inscribe: (content) => __async2222(void 0, null, function* () {
|
|
1252
|
+
return "";
|
|
1253
|
+
}),
|
|
1254
|
+
isCreatingCommit: false,
|
|
1255
|
+
isInscribing: false
|
|
1256
|
+
};
|
|
1257
|
+
bitcoin22222.initEccLib(ecc22222);
|
|
1258
|
+
var __async22222 = (__this, __arguments, generator) => {
|
|
1259
|
+
return new Promise((resolve, reject) => {
|
|
1260
|
+
var fulfilled = (value) => {
|
|
1261
|
+
try {
|
|
1262
|
+
step(generator.next(value));
|
|
1263
|
+
} catch (e) {
|
|
1264
|
+
reject(e);
|
|
1265
|
+
}
|
|
1266
|
+
};
|
|
1267
|
+
var rejected = (value) => {
|
|
1268
|
+
try {
|
|
1269
|
+
step(generator.throw(value));
|
|
1270
|
+
} catch (e) {
|
|
1271
|
+
reject(e);
|
|
1272
|
+
}
|
|
1273
|
+
};
|
|
1274
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1275
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1276
|
+
});
|
|
1277
|
+
};
|
|
1278
|
+
var MAINNET422222 = "mainnet";
|
|
1279
|
+
var initialWalletContext222222 = {
|
|
1280
|
+
hasUnisat: false,
|
|
1281
|
+
hasXverse: false,
|
|
1282
|
+
hasOyl: false,
|
|
1283
|
+
hasMagicEden: false,
|
|
1284
|
+
hasOkx: false,
|
|
1285
|
+
hasLeather: false,
|
|
1286
|
+
hasPhantom: false,
|
|
1287
|
+
hasWizz: false,
|
|
1288
|
+
isInitializing: true,
|
|
1289
|
+
connected: false,
|
|
1290
|
+
isConnecting: false,
|
|
1291
|
+
publicKey: "",
|
|
1292
|
+
address: "",
|
|
1293
|
+
paymentAddress: "",
|
|
1294
|
+
paymentPublicKey: "",
|
|
1295
|
+
balance: void 0,
|
|
1296
|
+
network: MAINNET422222,
|
|
1297
|
+
library: null,
|
|
1298
|
+
provider: null,
|
|
1299
|
+
accounts: [],
|
|
1300
|
+
connect: (walletName) => __async22222(void 0, null, function* () {
|
|
1301
|
+
}),
|
|
1302
|
+
disconnect: () => {
|
|
1303
|
+
},
|
|
1304
|
+
requestAccounts: () => __async22222(void 0, null, function* () {
|
|
1305
|
+
return [];
|
|
1306
|
+
}),
|
|
1307
|
+
getNetwork: () => __async22222(void 0, null, function* () {
|
|
1308
|
+
return MAINNET422222;
|
|
1309
|
+
}),
|
|
1310
|
+
switchNetwork: (network) => __async22222(void 0, null, function* () {
|
|
1311
|
+
}),
|
|
1312
|
+
getPublicKey: () => __async22222(void 0, null, function* () {
|
|
1313
|
+
return "";
|
|
1314
|
+
}),
|
|
1315
|
+
getBalance: () => __async22222(void 0, null, function* () {
|
|
1316
|
+
return "";
|
|
1317
|
+
}),
|
|
1318
|
+
getInscriptions: () => __async22222(void 0, null, function* () {
|
|
1319
|
+
return [];
|
|
1320
|
+
}),
|
|
1321
|
+
sendBTC: (to, amount) => __async22222(void 0, null, function* () {
|
|
1322
|
+
return "";
|
|
1323
|
+
}),
|
|
1324
|
+
signMessage: (message) => __async22222(void 0, null, function* () {
|
|
1325
|
+
return "";
|
|
1326
|
+
}),
|
|
1327
|
+
signPsbt: (tx) => __async22222(void 0, null, function* () {
|
|
1328
|
+
return {
|
|
1329
|
+
signedPsbtHex: "",
|
|
1330
|
+
signedPsbtBase64: "",
|
|
1331
|
+
txId: ""
|
|
1332
|
+
};
|
|
1333
|
+
}),
|
|
1334
|
+
pushPsbt: (tx) => __async22222(void 0, null, function* () {
|
|
1335
|
+
return "";
|
|
1336
|
+
}),
|
|
1337
|
+
inscribe: (content) => __async22222(void 0, null, function* () {
|
|
1338
|
+
return "";
|
|
1339
|
+
}),
|
|
1340
|
+
isCreatingCommit: false,
|
|
1341
|
+
isInscribing: false
|
|
1342
|
+
};
|
|
1343
|
+
bitcoin222222.initEccLib(ecc222222);
|
|
1344
|
+
var __async222222 = (__this, __arguments, generator) => {
|
|
1345
|
+
return new Promise((resolve, reject) => {
|
|
1346
|
+
var fulfilled = (value) => {
|
|
1347
|
+
try {
|
|
1348
|
+
step(generator.next(value));
|
|
1349
|
+
} catch (e) {
|
|
1350
|
+
reject(e);
|
|
1351
|
+
}
|
|
1352
|
+
};
|
|
1353
|
+
var rejected = (value) => {
|
|
1354
|
+
try {
|
|
1355
|
+
step(generator.throw(value));
|
|
1356
|
+
} catch (e) {
|
|
1357
|
+
reject(e);
|
|
1358
|
+
}
|
|
1359
|
+
};
|
|
1360
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1361
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1362
|
+
});
|
|
1363
|
+
};
|
|
1364
|
+
var MAINNET4222222 = "mainnet";
|
|
1365
|
+
var initialWalletContext2222222 = {
|
|
1366
|
+
hasUnisat: false,
|
|
1367
|
+
hasXverse: false,
|
|
1368
|
+
hasOyl: false,
|
|
1369
|
+
hasMagicEden: false,
|
|
1370
|
+
hasOkx: false,
|
|
1371
|
+
hasLeather: false,
|
|
1372
|
+
hasPhantom: false,
|
|
1373
|
+
hasWizz: false,
|
|
1374
|
+
isInitializing: true,
|
|
1375
|
+
connected: false,
|
|
1376
|
+
isConnecting: false,
|
|
1377
|
+
publicKey: "",
|
|
1378
|
+
address: "",
|
|
1379
|
+
paymentAddress: "",
|
|
1380
|
+
paymentPublicKey: "",
|
|
1381
|
+
balance: void 0,
|
|
1382
|
+
network: MAINNET4222222,
|
|
1383
|
+
library: null,
|
|
1384
|
+
provider: null,
|
|
1385
|
+
accounts: [],
|
|
1386
|
+
connect: (walletName) => __async222222(void 0, null, function* () {
|
|
1387
|
+
}),
|
|
1388
|
+
disconnect: () => {
|
|
1389
|
+
},
|
|
1390
|
+
requestAccounts: () => __async222222(void 0, null, function* () {
|
|
1391
|
+
return [];
|
|
1392
|
+
}),
|
|
1393
|
+
getNetwork: () => __async222222(void 0, null, function* () {
|
|
1394
|
+
return MAINNET4222222;
|
|
1395
|
+
}),
|
|
1396
|
+
switchNetwork: (network) => __async222222(void 0, null, function* () {
|
|
1397
|
+
}),
|
|
1398
|
+
getPublicKey: () => __async222222(void 0, null, function* () {
|
|
1399
|
+
return "";
|
|
1400
|
+
}),
|
|
1401
|
+
getBalance: () => __async222222(void 0, null, function* () {
|
|
1402
|
+
return "";
|
|
1403
|
+
}),
|
|
1404
|
+
getInscriptions: () => __async222222(void 0, null, function* () {
|
|
1405
|
+
return [];
|
|
1406
|
+
}),
|
|
1407
|
+
sendBTC: (to, amount) => __async222222(void 0, null, function* () {
|
|
1408
|
+
return "";
|
|
1409
|
+
}),
|
|
1410
|
+
signMessage: (message) => __async222222(void 0, null, function* () {
|
|
1411
|
+
return "";
|
|
1412
|
+
}),
|
|
1413
|
+
signPsbt: (tx) => __async222222(void 0, null, function* () {
|
|
1414
|
+
return {
|
|
1415
|
+
signedPsbtHex: "",
|
|
1416
|
+
signedPsbtBase64: "",
|
|
1417
|
+
txId: ""
|
|
1418
|
+
};
|
|
1419
|
+
}),
|
|
1420
|
+
pushPsbt: (tx) => __async222222(void 0, null, function* () {
|
|
1421
|
+
return "";
|
|
1422
|
+
}),
|
|
1423
|
+
inscribe: (content) => __async222222(void 0, null, function* () {
|
|
1424
|
+
return "";
|
|
1425
|
+
}),
|
|
1426
|
+
isCreatingCommit: false,
|
|
1427
|
+
isInscribing: false
|
|
1428
|
+
};
|
|
1429
|
+
bitcoin2222222.initEccLib(ecc2222222);
|
|
1430
|
+
var __async2222222 = (__this, __arguments, generator) => {
|
|
1431
|
+
return new Promise((resolve, reject) => {
|
|
1432
|
+
var fulfilled = (value) => {
|
|
1433
|
+
try {
|
|
1434
|
+
step(generator.next(value));
|
|
1435
|
+
} catch (e) {
|
|
1436
|
+
reject(e);
|
|
1437
|
+
}
|
|
1438
|
+
};
|
|
1439
|
+
var rejected = (value) => {
|
|
1440
|
+
try {
|
|
1441
|
+
step(generator.throw(value));
|
|
1442
|
+
} catch (e) {
|
|
1443
|
+
reject(e);
|
|
1444
|
+
}
|
|
1445
|
+
};
|
|
1446
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1447
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1448
|
+
});
|
|
1449
|
+
};
|
|
1450
|
+
var MAINNET42222222 = "mainnet";
|
|
1451
|
+
var initialWalletContext22222222 = {
|
|
1452
|
+
hasUnisat: false,
|
|
1453
|
+
hasXverse: false,
|
|
1454
|
+
hasOyl: false,
|
|
1455
|
+
hasMagicEden: false,
|
|
1456
|
+
hasOkx: false,
|
|
1457
|
+
hasLeather: false,
|
|
1458
|
+
hasPhantom: false,
|
|
1459
|
+
hasWizz: false,
|
|
1460
|
+
isInitializing: true,
|
|
1461
|
+
connected: false,
|
|
1462
|
+
isConnecting: false,
|
|
1463
|
+
publicKey: "",
|
|
1464
|
+
address: "",
|
|
1465
|
+
paymentAddress: "",
|
|
1466
|
+
paymentPublicKey: "",
|
|
1467
|
+
balance: void 0,
|
|
1468
|
+
network: MAINNET42222222,
|
|
1469
|
+
library: null,
|
|
1470
|
+
provider: null,
|
|
1471
|
+
accounts: [],
|
|
1472
|
+
connect: (walletName) => __async2222222(void 0, null, function* () {
|
|
1473
|
+
}),
|
|
1474
|
+
disconnect: () => {
|
|
1475
|
+
},
|
|
1476
|
+
requestAccounts: () => __async2222222(void 0, null, function* () {
|
|
1477
|
+
return [];
|
|
1478
|
+
}),
|
|
1479
|
+
getNetwork: () => __async2222222(void 0, null, function* () {
|
|
1480
|
+
return MAINNET42222222;
|
|
1481
|
+
}),
|
|
1482
|
+
switchNetwork: (network) => __async2222222(void 0, null, function* () {
|
|
1483
|
+
}),
|
|
1484
|
+
getPublicKey: () => __async2222222(void 0, null, function* () {
|
|
1485
|
+
return "";
|
|
1486
|
+
}),
|
|
1487
|
+
getBalance: () => __async2222222(void 0, null, function* () {
|
|
1488
|
+
return "";
|
|
1489
|
+
}),
|
|
1490
|
+
getInscriptions: () => __async2222222(void 0, null, function* () {
|
|
1491
|
+
return [];
|
|
1492
|
+
}),
|
|
1493
|
+
sendBTC: (to, amount) => __async2222222(void 0, null, function* () {
|
|
1494
|
+
return "";
|
|
1495
|
+
}),
|
|
1496
|
+
signMessage: (message) => __async2222222(void 0, null, function* () {
|
|
1497
|
+
return "";
|
|
1498
|
+
}),
|
|
1499
|
+
signPsbt: (tx) => __async2222222(void 0, null, function* () {
|
|
1500
|
+
return {
|
|
1501
|
+
signedPsbtHex: "",
|
|
1502
|
+
signedPsbtBase64: "",
|
|
1503
|
+
txId: ""
|
|
1504
|
+
};
|
|
1505
|
+
}),
|
|
1506
|
+
pushPsbt: (tx) => __async2222222(void 0, null, function* () {
|
|
1507
|
+
return "";
|
|
1508
|
+
}),
|
|
1509
|
+
inscribe: (content) => __async2222222(void 0, null, function* () {
|
|
1510
|
+
return "";
|
|
1511
|
+
}),
|
|
1512
|
+
isCreatingCommit: false,
|
|
1513
|
+
isInscribing: false
|
|
1514
|
+
};
|
|
1515
|
+
bitcoin22222222.initEccLib(ecc22222222);
|
|
1516
|
+
var __async22222222 = (__this, __arguments, generator) => {
|
|
1517
|
+
return new Promise((resolve, reject) => {
|
|
1518
|
+
var fulfilled = (value) => {
|
|
1519
|
+
try {
|
|
1520
|
+
step(generator.next(value));
|
|
1521
|
+
} catch (e) {
|
|
1522
|
+
reject(e);
|
|
1523
|
+
}
|
|
1524
|
+
};
|
|
1525
|
+
var rejected = (value) => {
|
|
1526
|
+
try {
|
|
1527
|
+
step(generator.throw(value));
|
|
1528
|
+
} catch (e) {
|
|
1529
|
+
reject(e);
|
|
1530
|
+
}
|
|
1531
|
+
};
|
|
1532
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1533
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1534
|
+
});
|
|
1535
|
+
};
|
|
1536
|
+
var MAINNET422222222 = "mainnet";
|
|
1537
|
+
var initialWalletContext222222222 = {
|
|
1538
|
+
hasUnisat: false,
|
|
1539
|
+
hasXverse: false,
|
|
1540
|
+
hasOyl: false,
|
|
1541
|
+
hasMagicEden: false,
|
|
1542
|
+
hasOkx: false,
|
|
1543
|
+
hasLeather: false,
|
|
1544
|
+
hasPhantom: false,
|
|
1545
|
+
hasWizz: false,
|
|
1546
|
+
isInitializing: true,
|
|
1547
|
+
connected: false,
|
|
1548
|
+
isConnecting: false,
|
|
1549
|
+
publicKey: "",
|
|
1550
|
+
address: "",
|
|
1551
|
+
paymentAddress: "",
|
|
1552
|
+
paymentPublicKey: "",
|
|
1553
|
+
balance: void 0,
|
|
1554
|
+
network: MAINNET422222222,
|
|
1555
|
+
library: null,
|
|
1556
|
+
provider: null,
|
|
1557
|
+
accounts: [],
|
|
1558
|
+
connect: (walletName) => __async22222222(void 0, null, function* () {
|
|
1559
|
+
}),
|
|
1560
|
+
disconnect: () => {
|
|
1561
|
+
},
|
|
1562
|
+
requestAccounts: () => __async22222222(void 0, null, function* () {
|
|
1563
|
+
return [];
|
|
1564
|
+
}),
|
|
1565
|
+
getNetwork: () => __async22222222(void 0, null, function* () {
|
|
1566
|
+
return MAINNET422222222;
|
|
1567
|
+
}),
|
|
1568
|
+
switchNetwork: (network) => __async22222222(void 0, null, function* () {
|
|
1569
|
+
}),
|
|
1570
|
+
getPublicKey: () => __async22222222(void 0, null, function* () {
|
|
1571
|
+
return "";
|
|
1572
|
+
}),
|
|
1573
|
+
getBalance: () => __async22222222(void 0, null, function* () {
|
|
1574
|
+
return "";
|
|
1575
|
+
}),
|
|
1576
|
+
getInscriptions: () => __async22222222(void 0, null, function* () {
|
|
1577
|
+
return [];
|
|
1578
|
+
}),
|
|
1579
|
+
sendBTC: (to, amount) => __async22222222(void 0, null, function* () {
|
|
1580
|
+
return "";
|
|
1581
|
+
}),
|
|
1582
|
+
signMessage: (message) => __async22222222(void 0, null, function* () {
|
|
1583
|
+
return "";
|
|
1584
|
+
}),
|
|
1585
|
+
signPsbt: (tx) => __async22222222(void 0, null, function* () {
|
|
1586
|
+
return {
|
|
1587
|
+
signedPsbtHex: "",
|
|
1588
|
+
signedPsbtBase64: "",
|
|
1589
|
+
txId: ""
|
|
1590
|
+
};
|
|
1591
|
+
}),
|
|
1592
|
+
pushPsbt: (tx) => __async22222222(void 0, null, function* () {
|
|
1593
|
+
return "";
|
|
1594
|
+
}),
|
|
1595
|
+
inscribe: (content) => __async22222222(void 0, null, function* () {
|
|
1596
|
+
return "";
|
|
1597
|
+
}),
|
|
1598
|
+
isCreatingCommit: false,
|
|
1599
|
+
isInscribing: false
|
|
1600
|
+
};
|
|
1601
|
+
bitcoin222222222.initEccLib(ecc222222222);
|
|
1602
|
+
var __async222222222 = (__this, __arguments, generator) => {
|
|
1603
|
+
return new Promise((resolve, reject) => {
|
|
1604
|
+
var fulfilled = (value) => {
|
|
1605
|
+
try {
|
|
1606
|
+
step(generator.next(value));
|
|
1607
|
+
} catch (e) {
|
|
1608
|
+
reject(e);
|
|
1609
|
+
}
|
|
1610
|
+
};
|
|
1611
|
+
var rejected = (value) => {
|
|
1612
|
+
try {
|
|
1613
|
+
step(generator.throw(value));
|
|
1614
|
+
} catch (e) {
|
|
1615
|
+
reject(e);
|
|
1616
|
+
}
|
|
1617
|
+
};
|
|
1618
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1619
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1620
|
+
});
|
|
1621
|
+
};
|
|
1622
|
+
var MAINNET4222222222 = "mainnet";
|
|
1623
|
+
var initialWalletContext2222222222 = {
|
|
1624
|
+
hasUnisat: false,
|
|
1625
|
+
hasXverse: false,
|
|
1626
|
+
hasOyl: false,
|
|
1627
|
+
hasMagicEden: false,
|
|
1628
|
+
hasOkx: false,
|
|
1629
|
+
hasLeather: false,
|
|
1630
|
+
hasPhantom: false,
|
|
1631
|
+
hasWizz: false,
|
|
1632
|
+
isInitializing: true,
|
|
1633
|
+
connected: false,
|
|
1634
|
+
isConnecting: false,
|
|
1635
|
+
publicKey: "",
|
|
1636
|
+
address: "",
|
|
1637
|
+
paymentAddress: "",
|
|
1638
|
+
paymentPublicKey: "",
|
|
1639
|
+
balance: void 0,
|
|
1640
|
+
network: MAINNET4222222222,
|
|
1641
|
+
library: null,
|
|
1642
|
+
provider: null,
|
|
1643
|
+
accounts: [],
|
|
1644
|
+
connect: (walletName) => __async222222222(void 0, null, function* () {
|
|
1645
|
+
}),
|
|
1646
|
+
disconnect: () => {
|
|
1647
|
+
},
|
|
1648
|
+
requestAccounts: () => __async222222222(void 0, null, function* () {
|
|
1649
|
+
return [];
|
|
1650
|
+
}),
|
|
1651
|
+
getNetwork: () => __async222222222(void 0, null, function* () {
|
|
1652
|
+
return MAINNET4222222222;
|
|
1653
|
+
}),
|
|
1654
|
+
switchNetwork: (network) => __async222222222(void 0, null, function* () {
|
|
1655
|
+
}),
|
|
1656
|
+
getPublicKey: () => __async222222222(void 0, null, function* () {
|
|
1657
|
+
return "";
|
|
1658
|
+
}),
|
|
1659
|
+
getBalance: () => __async222222222(void 0, null, function* () {
|
|
1660
|
+
return "";
|
|
1661
|
+
}),
|
|
1662
|
+
getInscriptions: () => __async222222222(void 0, null, function* () {
|
|
1663
|
+
return [];
|
|
1664
|
+
}),
|
|
1665
|
+
sendBTC: (to, amount) => __async222222222(void 0, null, function* () {
|
|
1666
|
+
return "";
|
|
1667
|
+
}),
|
|
1668
|
+
signMessage: (message) => __async222222222(void 0, null, function* () {
|
|
1669
|
+
return "";
|
|
1670
|
+
}),
|
|
1671
|
+
signPsbt: (tx) => __async222222222(void 0, null, function* () {
|
|
1672
|
+
return {
|
|
1673
|
+
signedPsbtHex: "",
|
|
1674
|
+
signedPsbtBase64: "",
|
|
1675
|
+
txId: ""
|
|
1676
|
+
};
|
|
1677
|
+
}),
|
|
1678
|
+
pushPsbt: (tx) => __async222222222(void 0, null, function* () {
|
|
1679
|
+
return "";
|
|
1680
|
+
}),
|
|
1681
|
+
inscribe: (content) => __async222222222(void 0, null, function* () {
|
|
1682
|
+
return "";
|
|
1683
|
+
}),
|
|
1684
|
+
isCreatingCommit: false,
|
|
1685
|
+
isInscribing: false
|
|
1686
|
+
};
|
|
1687
|
+
bitcoin2222222222.initEccLib(ecc2222222222);
|
|
1688
|
+
var __async2222222222 = (__this, __arguments, generator) => {
|
|
1689
|
+
return new Promise((resolve, reject) => {
|
|
1690
|
+
var fulfilled = (value) => {
|
|
1691
|
+
try {
|
|
1692
|
+
step(generator.next(value));
|
|
1693
|
+
} catch (e) {
|
|
1694
|
+
reject(e);
|
|
1695
|
+
}
|
|
1696
|
+
};
|
|
1697
|
+
var rejected = (value) => {
|
|
1698
|
+
try {
|
|
1699
|
+
step(generator.throw(value));
|
|
1700
|
+
} catch (e) {
|
|
1701
|
+
reject(e);
|
|
1702
|
+
}
|
|
1703
|
+
};
|
|
1704
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1705
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1706
|
+
});
|
|
1707
|
+
};
|
|
1708
|
+
var MAINNET42222222222 = "mainnet";
|
|
1709
|
+
var initialWalletContext22222222222 = {
|
|
1710
|
+
hasUnisat: false,
|
|
1711
|
+
hasXverse: false,
|
|
1712
|
+
hasOyl: false,
|
|
1713
|
+
hasMagicEden: false,
|
|
1714
|
+
hasOkx: false,
|
|
1715
|
+
hasLeather: false,
|
|
1716
|
+
hasPhantom: false,
|
|
1717
|
+
hasWizz: false,
|
|
1718
|
+
isInitializing: true,
|
|
1719
|
+
connected: false,
|
|
1720
|
+
isConnecting: false,
|
|
1721
|
+
publicKey: "",
|
|
1722
|
+
address: "",
|
|
1723
|
+
paymentAddress: "",
|
|
1724
|
+
paymentPublicKey: "",
|
|
1725
|
+
balance: void 0,
|
|
1726
|
+
network: MAINNET42222222222,
|
|
1727
|
+
library: null,
|
|
1728
|
+
provider: null,
|
|
1729
|
+
accounts: [],
|
|
1730
|
+
connect: (walletName) => __async2222222222(void 0, null, function* () {
|
|
1731
|
+
}),
|
|
1732
|
+
disconnect: () => {
|
|
1733
|
+
},
|
|
1734
|
+
requestAccounts: () => __async2222222222(void 0, null, function* () {
|
|
1735
|
+
return [];
|
|
1736
|
+
}),
|
|
1737
|
+
getNetwork: () => __async2222222222(void 0, null, function* () {
|
|
1738
|
+
return MAINNET42222222222;
|
|
1739
|
+
}),
|
|
1740
|
+
switchNetwork: (network) => __async2222222222(void 0, null, function* () {
|
|
1741
|
+
}),
|
|
1742
|
+
getPublicKey: () => __async2222222222(void 0, null, function* () {
|
|
1743
|
+
return "";
|
|
1744
|
+
}),
|
|
1745
|
+
getBalance: () => __async2222222222(void 0, null, function* () {
|
|
1746
|
+
return "";
|
|
1747
|
+
}),
|
|
1748
|
+
getInscriptions: () => __async2222222222(void 0, null, function* () {
|
|
1749
|
+
return [];
|
|
1750
|
+
}),
|
|
1751
|
+
sendBTC: (to, amount) => __async2222222222(void 0, null, function* () {
|
|
1752
|
+
return "";
|
|
1753
|
+
}),
|
|
1754
|
+
signMessage: (message) => __async2222222222(void 0, null, function* () {
|
|
1755
|
+
return "";
|
|
1756
|
+
}),
|
|
1757
|
+
signPsbt: (tx) => __async2222222222(void 0, null, function* () {
|
|
1758
|
+
return {
|
|
1759
|
+
signedPsbtHex: "",
|
|
1760
|
+
signedPsbtBase64: "",
|
|
1761
|
+
txId: ""
|
|
1762
|
+
};
|
|
1763
|
+
}),
|
|
1764
|
+
pushPsbt: (tx) => __async2222222222(void 0, null, function* () {
|
|
1765
|
+
return "";
|
|
1766
|
+
}),
|
|
1767
|
+
inscribe: (content) => __async2222222222(void 0, null, function* () {
|
|
1768
|
+
return "";
|
|
1769
|
+
}),
|
|
1770
|
+
isCreatingCommit: false,
|
|
1771
|
+
isInscribing: false
|
|
1772
|
+
};
|
|
1773
|
+
bitcoin22222222222.initEccLib(ecc22222222222);
|
|
1774
|
+
var __async22222222222 = (__this, __arguments, generator) => {
|
|
1775
|
+
return new Promise((resolve, reject) => {
|
|
1776
|
+
var fulfilled = (value) => {
|
|
1777
|
+
try {
|
|
1778
|
+
step(generator.next(value));
|
|
1779
|
+
} catch (e) {
|
|
1780
|
+
reject(e);
|
|
1781
|
+
}
|
|
1782
|
+
};
|
|
1783
|
+
var rejected = (value) => {
|
|
1784
|
+
try {
|
|
1785
|
+
step(generator.throw(value));
|
|
1786
|
+
} catch (e) {
|
|
1787
|
+
reject(e);
|
|
1788
|
+
}
|
|
1789
|
+
};
|
|
1790
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1791
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1792
|
+
});
|
|
1793
|
+
};
|
|
1794
|
+
var MAINNET422222222222 = "mainnet";
|
|
1795
|
+
var initialWalletContext222222222222 = {
|
|
1796
|
+
hasUnisat: false,
|
|
1797
|
+
hasXverse: false,
|
|
1798
|
+
hasOyl: false,
|
|
1799
|
+
hasMagicEden: false,
|
|
1800
|
+
hasOkx: false,
|
|
1801
|
+
hasLeather: false,
|
|
1802
|
+
hasPhantom: false,
|
|
1803
|
+
hasWizz: false,
|
|
1804
|
+
isInitializing: true,
|
|
1805
|
+
connected: false,
|
|
1806
|
+
isConnecting: false,
|
|
1807
|
+
publicKey: "",
|
|
1808
|
+
address: "",
|
|
1809
|
+
paymentAddress: "",
|
|
1810
|
+
paymentPublicKey: "",
|
|
1811
|
+
balance: void 0,
|
|
1812
|
+
network: MAINNET422222222222,
|
|
1813
|
+
library: null,
|
|
1814
|
+
provider: null,
|
|
1815
|
+
accounts: [],
|
|
1816
|
+
connect: (walletName) => __async22222222222(void 0, null, function* () {
|
|
1817
|
+
}),
|
|
1818
|
+
disconnect: () => {
|
|
1819
|
+
},
|
|
1820
|
+
requestAccounts: () => __async22222222222(void 0, null, function* () {
|
|
1821
|
+
return [];
|
|
1822
|
+
}),
|
|
1823
|
+
getNetwork: () => __async22222222222(void 0, null, function* () {
|
|
1824
|
+
return MAINNET422222222222;
|
|
1825
|
+
}),
|
|
1826
|
+
switchNetwork: (network) => __async22222222222(void 0, null, function* () {
|
|
1827
|
+
}),
|
|
1828
|
+
getPublicKey: () => __async22222222222(void 0, null, function* () {
|
|
1829
|
+
return "";
|
|
1830
|
+
}),
|
|
1831
|
+
getBalance: () => __async22222222222(void 0, null, function* () {
|
|
1832
|
+
return "";
|
|
1833
|
+
}),
|
|
1834
|
+
getInscriptions: () => __async22222222222(void 0, null, function* () {
|
|
1835
|
+
return [];
|
|
1836
|
+
}),
|
|
1837
|
+
sendBTC: (to, amount) => __async22222222222(void 0, null, function* () {
|
|
1838
|
+
return "";
|
|
1839
|
+
}),
|
|
1840
|
+
signMessage: (message) => __async22222222222(void 0, null, function* () {
|
|
1841
|
+
return "";
|
|
1842
|
+
}),
|
|
1843
|
+
signPsbt: (tx) => __async22222222222(void 0, null, function* () {
|
|
1844
|
+
return {
|
|
1845
|
+
signedPsbtHex: "",
|
|
1846
|
+
signedPsbtBase64: "",
|
|
1847
|
+
txId: ""
|
|
1848
|
+
};
|
|
1849
|
+
}),
|
|
1850
|
+
pushPsbt: (tx) => __async22222222222(void 0, null, function* () {
|
|
1851
|
+
return "";
|
|
1852
|
+
}),
|
|
1853
|
+
inscribe: (content) => __async22222222222(void 0, null, function* () {
|
|
1854
|
+
return "";
|
|
1855
|
+
}),
|
|
1856
|
+
isCreatingCommit: false,
|
|
1857
|
+
isInscribing: false
|
|
1858
|
+
};
|
|
1859
|
+
bitcoin222222222222.initEccLib(ecc222222222222);
|
|
1860
|
+
var __async222222222222 = (__this, __arguments, generator) => {
|
|
1861
|
+
return new Promise((resolve, reject) => {
|
|
1862
|
+
var fulfilled = (value) => {
|
|
1863
|
+
try {
|
|
1864
|
+
step(generator.next(value));
|
|
1865
|
+
} catch (e) {
|
|
1866
|
+
reject(e);
|
|
1867
|
+
}
|
|
1868
|
+
};
|
|
1869
|
+
var rejected = (value) => {
|
|
1870
|
+
try {
|
|
1871
|
+
step(generator.throw(value));
|
|
1872
|
+
} catch (e) {
|
|
1873
|
+
reject(e);
|
|
1874
|
+
}
|
|
1875
|
+
};
|
|
1876
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1877
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1878
|
+
});
|
|
1879
|
+
};
|
|
1880
|
+
var MAINNET4222222222222 = "mainnet";
|
|
1881
|
+
var initialWalletContext2222222222222 = {
|
|
1882
|
+
hasUnisat: false,
|
|
1883
|
+
hasXverse: false,
|
|
1884
|
+
hasOyl: false,
|
|
1885
|
+
hasMagicEden: false,
|
|
1886
|
+
hasOkx: false,
|
|
1887
|
+
hasLeather: false,
|
|
1888
|
+
hasPhantom: false,
|
|
1889
|
+
hasWizz: false,
|
|
1890
|
+
isInitializing: true,
|
|
1891
|
+
connected: false,
|
|
1892
|
+
isConnecting: false,
|
|
1893
|
+
publicKey: "",
|
|
1894
|
+
address: "",
|
|
1895
|
+
paymentAddress: "",
|
|
1896
|
+
paymentPublicKey: "",
|
|
1897
|
+
balance: void 0,
|
|
1898
|
+
network: MAINNET4222222222222,
|
|
1899
|
+
library: null,
|
|
1900
|
+
provider: null,
|
|
1901
|
+
accounts: [],
|
|
1902
|
+
connect: (walletName) => __async222222222222(void 0, null, function* () {
|
|
1903
|
+
}),
|
|
1904
|
+
disconnect: () => {
|
|
1905
|
+
},
|
|
1906
|
+
requestAccounts: () => __async222222222222(void 0, null, function* () {
|
|
1907
|
+
return [];
|
|
1908
|
+
}),
|
|
1909
|
+
getNetwork: () => __async222222222222(void 0, null, function* () {
|
|
1910
|
+
return MAINNET4222222222222;
|
|
1911
|
+
}),
|
|
1912
|
+
switchNetwork: (network) => __async222222222222(void 0, null, function* () {
|
|
1913
|
+
}),
|
|
1914
|
+
getPublicKey: () => __async222222222222(void 0, null, function* () {
|
|
1915
|
+
return "";
|
|
1916
|
+
}),
|
|
1917
|
+
getBalance: () => __async222222222222(void 0, null, function* () {
|
|
1918
|
+
return "";
|
|
1919
|
+
}),
|
|
1920
|
+
getInscriptions: () => __async222222222222(void 0, null, function* () {
|
|
1921
|
+
return [];
|
|
1922
|
+
}),
|
|
1923
|
+
sendBTC: (to, amount) => __async222222222222(void 0, null, function* () {
|
|
1924
|
+
return "";
|
|
1925
|
+
}),
|
|
1926
|
+
signMessage: (message) => __async222222222222(void 0, null, function* () {
|
|
1927
|
+
return "";
|
|
1928
|
+
}),
|
|
1929
|
+
signPsbt: (tx) => __async222222222222(void 0, null, function* () {
|
|
1930
|
+
return {
|
|
1931
|
+
signedPsbtHex: "",
|
|
1932
|
+
signedPsbtBase64: "",
|
|
1933
|
+
txId: ""
|
|
1934
|
+
};
|
|
1935
|
+
}),
|
|
1936
|
+
pushPsbt: (tx) => __async222222222222(void 0, null, function* () {
|
|
1937
|
+
return "";
|
|
1938
|
+
}),
|
|
1939
|
+
inscribe: (content) => __async222222222222(void 0, null, function* () {
|
|
1940
|
+
return "";
|
|
1941
|
+
}),
|
|
1942
|
+
isCreatingCommit: false,
|
|
1943
|
+
isInscribing: false
|
|
1944
|
+
};
|
|
1945
|
+
bitcoin2222222222222.initEccLib(ecc2222222222222);
|
|
1946
|
+
var __async2222222222222 = (__this, __arguments, generator) => {
|
|
1947
|
+
return new Promise((resolve, reject) => {
|
|
1948
|
+
var fulfilled = (value) => {
|
|
1949
|
+
try {
|
|
1950
|
+
step(generator.next(value));
|
|
1951
|
+
} catch (e) {
|
|
1952
|
+
reject(e);
|
|
1953
|
+
}
|
|
1954
|
+
};
|
|
1955
|
+
var rejected = (value) => {
|
|
1956
|
+
try {
|
|
1957
|
+
step(generator.throw(value));
|
|
1958
|
+
} catch (e) {
|
|
1959
|
+
reject(e);
|
|
1960
|
+
}
|
|
1961
|
+
};
|
|
1962
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1963
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1964
|
+
});
|
|
1965
|
+
};
|
|
1966
|
+
var MAINNET42222222222222 = "mainnet";
|
|
1967
|
+
var initialWalletContext22222222222222 = {
|
|
1968
|
+
hasUnisat: false,
|
|
1969
|
+
hasXverse: false,
|
|
1970
|
+
hasOyl: false,
|
|
1971
|
+
hasMagicEden: false,
|
|
1972
|
+
hasOkx: false,
|
|
1973
|
+
hasLeather: false,
|
|
1974
|
+
hasPhantom: false,
|
|
1975
|
+
hasWizz: false,
|
|
1976
|
+
isInitializing: true,
|
|
1977
|
+
connected: false,
|
|
1978
|
+
isConnecting: false,
|
|
1979
|
+
publicKey: "",
|
|
1980
|
+
address: "",
|
|
1981
|
+
paymentAddress: "",
|
|
1982
|
+
paymentPublicKey: "",
|
|
1983
|
+
balance: void 0,
|
|
1984
|
+
network: MAINNET42222222222222,
|
|
1985
|
+
library: null,
|
|
1986
|
+
provider: null,
|
|
1987
|
+
accounts: [],
|
|
1988
|
+
connect: (walletName) => __async2222222222222(void 0, null, function* () {
|
|
1989
|
+
}),
|
|
1990
|
+
disconnect: () => {
|
|
1991
|
+
},
|
|
1992
|
+
requestAccounts: () => __async2222222222222(void 0, null, function* () {
|
|
1993
|
+
return [];
|
|
1994
|
+
}),
|
|
1995
|
+
getNetwork: () => __async2222222222222(void 0, null, function* () {
|
|
1996
|
+
return MAINNET42222222222222;
|
|
1997
|
+
}),
|
|
1998
|
+
switchNetwork: (network) => __async2222222222222(void 0, null, function* () {
|
|
1999
|
+
}),
|
|
2000
|
+
getPublicKey: () => __async2222222222222(void 0, null, function* () {
|
|
2001
|
+
return "";
|
|
2002
|
+
}),
|
|
2003
|
+
getBalance: () => __async2222222222222(void 0, null, function* () {
|
|
2004
|
+
return "";
|
|
2005
|
+
}),
|
|
2006
|
+
getInscriptions: () => __async2222222222222(void 0, null, function* () {
|
|
2007
|
+
return [];
|
|
2008
|
+
}),
|
|
2009
|
+
sendBTC: (to, amount) => __async2222222222222(void 0, null, function* () {
|
|
2010
|
+
return "";
|
|
2011
|
+
}),
|
|
2012
|
+
signMessage: (message) => __async2222222222222(void 0, null, function* () {
|
|
2013
|
+
return "";
|
|
2014
|
+
}),
|
|
2015
|
+
signPsbt: (tx) => __async2222222222222(void 0, null, function* () {
|
|
2016
|
+
return {
|
|
2017
|
+
signedPsbtHex: "",
|
|
2018
|
+
signedPsbtBase64: "",
|
|
2019
|
+
txId: ""
|
|
2020
|
+
};
|
|
2021
|
+
}),
|
|
2022
|
+
pushPsbt: (tx) => __async2222222222222(void 0, null, function* () {
|
|
2023
|
+
return "";
|
|
2024
|
+
}),
|
|
2025
|
+
inscribe: (content) => __async2222222222222(void 0, null, function* () {
|
|
2026
|
+
return "";
|
|
2027
|
+
}),
|
|
2028
|
+
isCreatingCommit: false,
|
|
2029
|
+
isInscribing: false
|
|
2030
|
+
};
|
|
2031
|
+
bitcoin22222222222222.initEccLib(ecc22222222222222);
|
|
2032
|
+
var __async22222222222222 = (__this, __arguments, generator) => {
|
|
2033
|
+
return new Promise((resolve, reject) => {
|
|
2034
|
+
var fulfilled = (value) => {
|
|
2035
|
+
try {
|
|
2036
|
+
step(generator.next(value));
|
|
2037
|
+
} catch (e) {
|
|
2038
|
+
reject(e);
|
|
2039
|
+
}
|
|
2040
|
+
};
|
|
2041
|
+
var rejected = (value) => {
|
|
2042
|
+
try {
|
|
2043
|
+
step(generator.throw(value));
|
|
2044
|
+
} catch (e) {
|
|
2045
|
+
reject(e);
|
|
2046
|
+
}
|
|
2047
|
+
};
|
|
2048
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
2049
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
2050
|
+
});
|
|
2051
|
+
};
|
|
2052
|
+
var MAINNET422222222222222 = "mainnet";
|
|
2053
|
+
var initialWalletContext222222222222222 = {
|
|
2054
|
+
hasUnisat: false,
|
|
2055
|
+
hasXverse: false,
|
|
2056
|
+
hasOyl: false,
|
|
2057
|
+
hasMagicEden: false,
|
|
2058
|
+
hasOkx: false,
|
|
2059
|
+
hasLeather: false,
|
|
2060
|
+
hasPhantom: false,
|
|
2061
|
+
hasWizz: false,
|
|
2062
|
+
isInitializing: true,
|
|
2063
|
+
connected: false,
|
|
2064
|
+
isConnecting: false,
|
|
2065
|
+
publicKey: "",
|
|
2066
|
+
address: "",
|
|
2067
|
+
paymentAddress: "",
|
|
2068
|
+
paymentPublicKey: "",
|
|
2069
|
+
balance: void 0,
|
|
2070
|
+
network: MAINNET422222222222222,
|
|
216
2071
|
library: null,
|
|
217
2072
|
provider: null,
|
|
218
2073
|
accounts: [],
|
|
219
|
-
connect: (walletName) =>
|
|
2074
|
+
connect: (walletName) => __async22222222222222(void 0, null, function* () {
|
|
220
2075
|
}),
|
|
221
2076
|
disconnect: () => {
|
|
222
2077
|
},
|
|
223
|
-
requestAccounts: () =>
|
|
2078
|
+
requestAccounts: () => __async22222222222222(void 0, null, function* () {
|
|
224
2079
|
return [];
|
|
225
2080
|
}),
|
|
226
|
-
getNetwork: () =>
|
|
227
|
-
return
|
|
2081
|
+
getNetwork: () => __async22222222222222(void 0, null, function* () {
|
|
2082
|
+
return MAINNET422222222222222;
|
|
228
2083
|
}),
|
|
229
|
-
switchNetwork: (network) =>
|
|
2084
|
+
switchNetwork: (network) => __async22222222222222(void 0, null, function* () {
|
|
230
2085
|
}),
|
|
231
|
-
getPublicKey: () =>
|
|
2086
|
+
getPublicKey: () => __async22222222222222(void 0, null, function* () {
|
|
232
2087
|
return "";
|
|
233
2088
|
}),
|
|
234
|
-
getBalance: () =>
|
|
2089
|
+
getBalance: () => __async22222222222222(void 0, null, function* () {
|
|
235
2090
|
return "";
|
|
236
2091
|
}),
|
|
237
|
-
getInscriptions: () =>
|
|
2092
|
+
getInscriptions: () => __async22222222222222(void 0, null, function* () {
|
|
238
2093
|
return [];
|
|
239
2094
|
}),
|
|
240
|
-
sendBTC: (to, amount) =>
|
|
2095
|
+
sendBTC: (to, amount) => __async22222222222222(void 0, null, function* () {
|
|
241
2096
|
return "";
|
|
242
2097
|
}),
|
|
243
|
-
signMessage: (message) =>
|
|
2098
|
+
signMessage: (message) => __async22222222222222(void 0, null, function* () {
|
|
244
2099
|
return "";
|
|
245
2100
|
}),
|
|
246
|
-
signPsbt: (tx) =>
|
|
2101
|
+
signPsbt: (tx) => __async22222222222222(void 0, null, function* () {
|
|
247
2102
|
return {
|
|
248
2103
|
signedPsbtHex: "",
|
|
249
2104
|
signedPsbtBase64: "",
|
|
250
2105
|
txId: ""
|
|
251
2106
|
};
|
|
252
2107
|
}),
|
|
253
|
-
pushPsbt: (tx) =>
|
|
2108
|
+
pushPsbt: (tx) => __async22222222222222(void 0, null, function* () {
|
|
254
2109
|
return "";
|
|
255
2110
|
}),
|
|
256
|
-
inscribe: (content) =>
|
|
2111
|
+
inscribe: (content) => __async22222222222222(void 0, null, function* () {
|
|
257
2112
|
return "";
|
|
258
2113
|
}),
|
|
259
2114
|
isCreatingCommit: false,
|
|
260
2115
|
isInscribing: false
|
|
261
2116
|
};
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
// src/lib/urls.ts
|
|
271
|
-
var MEMPOOL_SPACE_URL2 = "https://mempool.space";
|
|
272
|
-
var MEMPOOL_SPACE_TESTNET_URL2 = "https://mempool.space/testnet";
|
|
273
|
-
var getMempoolSpaceUrl2 = (network) => network === TESTNET ? MEMPOOL_SPACE_TESTNET_URL2 : MEMPOOL_SPACE_URL2;
|
|
274
|
-
|
|
275
|
-
// src/lib/helpers.ts
|
|
276
|
-
import * as ecc from "@bitcoinerlab/secp256k1";
|
|
277
|
-
bitcoin.initEccLib(ecc);
|
|
278
|
-
var getBitcoinNetwork = (network) => {
|
|
279
|
-
if (network === TESTNET) {
|
|
280
|
-
return bitcoin.networks.testnet;
|
|
281
|
-
} else if (network === SIGNET) {
|
|
282
|
-
return bitcoin.networks.testnet;
|
|
283
|
-
} else if (network === REGTEST) {
|
|
284
|
-
return bitcoin.networks.regtest;
|
|
285
|
-
} else {
|
|
286
|
-
return bitcoin.networks.bitcoin;
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
var findOrdinalsAddress = (addresses) => {
|
|
290
|
-
return addresses.find(
|
|
291
|
-
({ purpose }) => purpose === "ordinals"
|
|
292
|
-
);
|
|
293
|
-
};
|
|
294
|
-
var findPaymentAddress = (addresses) => {
|
|
295
|
-
return addresses.find(
|
|
296
|
-
({ purpose }) => purpose === "payment"
|
|
297
|
-
);
|
|
298
|
-
};
|
|
299
|
-
var getBTCBalance = (address2) => __async(void 0, null, function* () {
|
|
300
|
-
try {
|
|
301
|
-
return yield axios.get(`https://blockchain.info/q/addressbalance/${address2}`).then((response) => response.data);
|
|
302
|
-
} catch (error) {
|
|
303
|
-
console.error("Error fetching BTC balance:", error);
|
|
304
|
-
throw new Error("Failed to fetch BTC balance");
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
var satoshisToBTC = (satoshis) => {
|
|
308
|
-
if (Number.isNaN(satoshis) || satoshis === void 0)
|
|
309
|
-
return "--";
|
|
310
|
-
const btcValue = satoshis / 1e8;
|
|
311
|
-
return btcValue.toFixed(8);
|
|
312
|
-
};
|
|
313
|
-
var isBase64 = (str) => {
|
|
314
|
-
const base64Regex = /^(?:[A-Za-z0-9+\/]{4})*?(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/;
|
|
315
|
-
return base64Regex.test(str);
|
|
316
|
-
};
|
|
317
|
-
var isHex = (str) => {
|
|
318
|
-
const hexRegex = /^[a-fA-F0-9]+$/;
|
|
319
|
-
return hexRegex.test(str);
|
|
320
|
-
};
|
|
321
|
-
function estimateTxSize(taprootInputCount, nonTaprootInputCount, outputCount) {
|
|
322
|
-
const baseTxSize = 10;
|
|
323
|
-
const taprootInputSize = 57;
|
|
324
|
-
const nonTaprootInputSize = 41;
|
|
325
|
-
const outputSize = 34;
|
|
326
|
-
const totalInputSize = taprootInputCount * taprootInputSize + nonTaprootInputCount * nonTaprootInputSize;
|
|
327
|
-
const totalOutputSize = outputCount * outputSize;
|
|
328
|
-
return baseTxSize + totalInputSize + totalOutputSize;
|
|
329
|
-
}
|
|
330
|
-
function createSendBtcPsbt(address2, paymentAddress, recipientAddress, amount, paymentPublicKey, network, feeRate = 7) {
|
|
331
|
-
return __async(this, null, function* () {
|
|
332
|
-
const isTaprootOnly = address2 === paymentAddress;
|
|
333
|
-
const mempoolUrl = `${getMempoolSpaceUrl2(
|
|
334
|
-
network
|
|
335
|
-
)}/api/address/${paymentAddress}/utxo`;
|
|
336
|
-
const utxos = yield axios.get(mempoolUrl).then((response) => response.data);
|
|
337
|
-
const sortedUtxos = utxos.sort(
|
|
338
|
-
(a, b) => b.value - a.value
|
|
339
|
-
);
|
|
340
|
-
const psbt = new bitcoin.Psbt({ network: getBitcoinNetwork(network) });
|
|
341
|
-
const estTxSize = estimateTxSize(1, 0, 2);
|
|
342
|
-
const satsNeeded = Math.floor(estTxSize * feeRate) + amount;
|
|
343
|
-
let amountGathered = 0;
|
|
344
|
-
let counter = 0;
|
|
345
|
-
try {
|
|
346
|
-
for (var iter = __forAwait(sortedUtxos), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {
|
|
347
|
-
let utxo = temp.value;
|
|
348
|
-
const { txid, vout, value } = utxo;
|
|
349
|
-
const script = bitcoin.address.toOutputScript(
|
|
350
|
-
paymentAddress,
|
|
351
|
-
getBitcoinNetwork(network)
|
|
352
|
-
);
|
|
353
|
-
psbt.addInput({
|
|
354
|
-
hash: txid,
|
|
355
|
-
index: vout,
|
|
356
|
-
witnessUtxo: {
|
|
357
|
-
script,
|
|
358
|
-
value
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
if (!isTaprootOnly) {
|
|
362
|
-
const redeemScript = getRedeemScript(paymentPublicKey, network);
|
|
363
|
-
psbt.updateInput(counter, { redeemScript });
|
|
364
|
-
}
|
|
365
|
-
amountGathered += value;
|
|
366
|
-
if (amountGathered >= satsNeeded) {
|
|
367
|
-
break;
|
|
368
|
-
}
|
|
2117
|
+
bitcoin222222222222222.initEccLib(ecc222222222222222);
|
|
2118
|
+
var __async222222222222222 = (__this, __arguments, generator) => {
|
|
2119
|
+
return new Promise((resolve, reject) => {
|
|
2120
|
+
var fulfilled = (value) => {
|
|
2121
|
+
try {
|
|
2122
|
+
step(generator.next(value));
|
|
2123
|
+
} catch (e) {
|
|
2124
|
+
reject(e);
|
|
369
2125
|
}
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
} finally {
|
|
2126
|
+
};
|
|
2127
|
+
var rejected = (value) => {
|
|
373
2128
|
try {
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
throw error[0];
|
|
2129
|
+
step(generator.throw(value));
|
|
2130
|
+
} catch (e) {
|
|
2131
|
+
reject(e);
|
|
378
2132
|
}
|
|
379
|
-
}
|
|
380
|
-
if (amountGathered < satsNeeded) {
|
|
381
|
-
throw new Error("Insufficient funds");
|
|
382
|
-
}
|
|
383
|
-
psbt.addOutput({
|
|
384
|
-
address: recipientAddress,
|
|
385
|
-
value: amount
|
|
386
|
-
});
|
|
387
|
-
if (amountGathered > satsNeeded) {
|
|
388
|
-
psbt.addOutput({
|
|
389
|
-
address: paymentAddress,
|
|
390
|
-
value: amountGathered - satsNeeded - amount
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
return {
|
|
394
|
-
psbtBase64: psbt.toBase64(),
|
|
395
|
-
psbtHex: psbt.toHex()
|
|
396
2133
|
};
|
|
2134
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
2135
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
397
2136
|
});
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
2137
|
+
};
|
|
2138
|
+
var MAINNET4222222222222222 = "mainnet";
|
|
2139
|
+
var initialWalletContext2222222222222222 = {
|
|
2140
|
+
hasUnisat: false,
|
|
2141
|
+
hasXverse: false,
|
|
2142
|
+
hasOyl: false,
|
|
2143
|
+
hasMagicEden: false,
|
|
2144
|
+
hasOkx: false,
|
|
2145
|
+
hasLeather: false,
|
|
2146
|
+
hasPhantom: false,
|
|
2147
|
+
hasWizz: false,
|
|
2148
|
+
isInitializing: true,
|
|
2149
|
+
connected: false,
|
|
2150
|
+
isConnecting: false,
|
|
2151
|
+
publicKey: "",
|
|
2152
|
+
address: "",
|
|
2153
|
+
paymentAddress: "",
|
|
2154
|
+
paymentPublicKey: "",
|
|
2155
|
+
balance: void 0,
|
|
2156
|
+
network: MAINNET4222222222222222,
|
|
2157
|
+
library: null,
|
|
2158
|
+
provider: null,
|
|
2159
|
+
accounts: [],
|
|
2160
|
+
connect: (walletName) => __async222222222222222(void 0, null, function* () {
|
|
2161
|
+
}),
|
|
2162
|
+
disconnect: () => {
|
|
2163
|
+
},
|
|
2164
|
+
requestAccounts: () => __async222222222222222(void 0, null, function* () {
|
|
2165
|
+
return [];
|
|
2166
|
+
}),
|
|
2167
|
+
getNetwork: () => __async222222222222222(void 0, null, function* () {
|
|
2168
|
+
return MAINNET4222222222222222;
|
|
2169
|
+
}),
|
|
2170
|
+
switchNetwork: (network) => __async222222222222222(void 0, null, function* () {
|
|
2171
|
+
}),
|
|
2172
|
+
getPublicKey: () => __async222222222222222(void 0, null, function* () {
|
|
2173
|
+
return "";
|
|
2174
|
+
}),
|
|
2175
|
+
getBalance: () => __async222222222222222(void 0, null, function* () {
|
|
2176
|
+
return "";
|
|
2177
|
+
}),
|
|
2178
|
+
getInscriptions: () => __async222222222222222(void 0, null, function* () {
|
|
2179
|
+
return [];
|
|
2180
|
+
}),
|
|
2181
|
+
sendBTC: (to, amount) => __async222222222222222(void 0, null, function* () {
|
|
2182
|
+
return "";
|
|
2183
|
+
}),
|
|
2184
|
+
signMessage: (message) => __async222222222222222(void 0, null, function* () {
|
|
2185
|
+
return "";
|
|
2186
|
+
}),
|
|
2187
|
+
signPsbt: (tx) => __async222222222222222(void 0, null, function* () {
|
|
2188
|
+
return {
|
|
2189
|
+
signedPsbtHex: "",
|
|
2190
|
+
signedPsbtBase64: "",
|
|
2191
|
+
txId: ""
|
|
2192
|
+
};
|
|
2193
|
+
}),
|
|
2194
|
+
pushPsbt: (tx) => __async222222222222222(void 0, null, function* () {
|
|
2195
|
+
return "";
|
|
2196
|
+
}),
|
|
2197
|
+
inscribe: (content) => __async222222222222222(void 0, null, function* () {
|
|
2198
|
+
return "";
|
|
2199
|
+
}),
|
|
2200
|
+
isCreatingCommit: false,
|
|
2201
|
+
isInscribing: false
|
|
2202
|
+
};
|
|
2203
|
+
bitcoin3.initEccLib(ecc2222222222222222);
|
|
2204
|
+
var LaserEyesContext = createContext(initialWalletContext2222222222222222);
|
|
2205
|
+
var LaserEyesContext2 = createContext2(initialWalletContext222222222222222);
|
|
2206
|
+
var LaserEyesContext3 = createContext3(initialWalletContext22222222222222);
|
|
2207
|
+
var LaserEyesContext4 = createContext4(initialWalletContext2222222222222);
|
|
2208
|
+
var LaserEyesContext5 = createContext5(initialWalletContext222222222222);
|
|
2209
|
+
var LaserEyesContext6 = createContext6(initialWalletContext22222222222);
|
|
2210
|
+
var LaserEyesContext7 = createContext7(initialWalletContext2222222222);
|
|
2211
|
+
var LaserEyesContext8 = createContext8(initialWalletContext222222222);
|
|
2212
|
+
var LaserEyesContext9 = createContext9(initialWalletContext22222222);
|
|
2213
|
+
var LaserEyesContext10 = createContext10(initialWalletContext2222222);
|
|
2214
|
+
var LaserEyesContext11 = createContext11(initialWalletContext222222);
|
|
2215
|
+
var LaserEyesContext12 = createContext12(initialWalletContext22222);
|
|
2216
|
+
var LaserEyesContext13 = createContext13(initialWalletContext2222);
|
|
2217
|
+
var LaserEyesContext14 = createContext14(initialWalletContext222);
|
|
2218
|
+
var LaserEyesContext15 = createContext15(initialWalletContext22);
|
|
2219
|
+
var LaserEyesContext16 = createContext16(initialWalletContext2);
|
|
2220
|
+
|
|
2221
|
+
// example/lib/urls.ts
|
|
2222
|
+
var MEMPOOL_SPACE_URL3 = "https://mempool.space";
|
|
2223
|
+
var MEMPOOL_SPACE_TESTNET_URL3 = "https://mempool.space/testnet";
|
|
2224
|
+
var MEMPOOL_SPACE_SIGNET_URL2 = "https://mempool.space/signet";
|
|
2225
|
+
var getMempoolSpaceUrl3 = (network) => network === TESTNET3 ? MEMPOOL_SPACE_TESTNET_URL3 : network === SIGNET3 ? MEMPOOL_SPACE_SIGNET_URL2 : MEMPOOL_SPACE_URL3;
|
|
414
2226
|
|
|
415
2227
|
// src/providers/LaserEyesProvider.tsx
|
|
416
|
-
import {
|
|
417
|
-
|
|
418
|
-
getAddress,
|
|
419
|
-
request,
|
|
420
|
-
RpcErrorCode,
|
|
421
|
-
signMessage as signMessageSatsConnect,
|
|
422
|
-
signTransaction
|
|
423
|
-
} from "sats-connect";
|
|
424
|
-
import { fromOutputScript } from "bitcoinjs-lib/src/address";
|
|
425
|
-
import axios2 from "axios";
|
|
426
|
-
import { jsx } from "react/jsx-runtime";
|
|
427
|
-
var LaserEyesContext = createContext(initialWalletContext);
|
|
2228
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2229
|
+
var LaserEyesContext17 = createContext17(initialWalletContext);
|
|
428
2230
|
var useLaserEyes = () => {
|
|
429
|
-
return
|
|
2231
|
+
return useContext17(LaserEyesContext17);
|
|
430
2232
|
};
|
|
431
2233
|
var LaserEyesProvider = ({
|
|
432
2234
|
children,
|
|
433
2235
|
config
|
|
434
2236
|
}) => {
|
|
435
|
-
const selfRef =
|
|
2237
|
+
const selfRef = useRef17({
|
|
436
2238
|
accounts: []
|
|
437
2239
|
});
|
|
438
2240
|
const self = selfRef.current;
|
|
439
|
-
const [library, setLibrary] =
|
|
440
|
-
const [provider, setProvider] =
|
|
441
|
-
const [isInitializing, setIsInitializing] =
|
|
442
|
-
const [connected, setConnected] =
|
|
443
|
-
const [isConnecting, setIsConnecting] =
|
|
444
|
-
const [accounts, setAccounts] =
|
|
445
|
-
const [publicKey, setPublicKey] =
|
|
446
|
-
const [paymentPublicKey, setPaymentPublicKey] =
|
|
447
|
-
const [
|
|
448
|
-
const [paymentAddress, setPaymentAddress] =
|
|
449
|
-
const [balance, setBalance] =
|
|
450
|
-
const [hasUnisat, setHasUnisat] =
|
|
451
|
-
const [hasXverse, setHasXverse] =
|
|
452
|
-
const [hasOyl, setHasOyl] =
|
|
453
|
-
const [hasMagicEden, setHasMagicEden] =
|
|
454
|
-
const [hasOkx, setHasOkx] =
|
|
455
|
-
const [hasLeather, setHasLeather] =
|
|
456
|
-
const [hasPhantom, setHasPhantom] =
|
|
457
|
-
const [hasWizz, setHasWizz] =
|
|
458
|
-
const [network, setNetwork] =
|
|
2241
|
+
const [library, setLibrary] = useState33(null);
|
|
2242
|
+
const [provider, setProvider] = useState33();
|
|
2243
|
+
const [isInitializing, setIsInitializing] = useState33(true);
|
|
2244
|
+
const [connected, setConnected] = useState33(false);
|
|
2245
|
+
const [isConnecting, setIsConnecting] = useState33(false);
|
|
2246
|
+
const [accounts, setAccounts] = useState33([]);
|
|
2247
|
+
const [publicKey, setPublicKey] = useState33("");
|
|
2248
|
+
const [paymentPublicKey, setPaymentPublicKey] = useState33("");
|
|
2249
|
+
const [address3, setAddress] = useState33("");
|
|
2250
|
+
const [paymentAddress, setPaymentAddress] = useState33("");
|
|
2251
|
+
const [balance, setBalance] = useState33();
|
|
2252
|
+
const [hasUnisat, setHasUnisat] = useState33(false);
|
|
2253
|
+
const [hasXverse, setHasXverse] = useState33(false);
|
|
2254
|
+
const [hasOyl, setHasOyl] = useState33(false);
|
|
2255
|
+
const [hasMagicEden, setHasMagicEden] = useState33(false);
|
|
2256
|
+
const [hasOkx, setHasOkx] = useState33(false);
|
|
2257
|
+
const [hasLeather, setHasLeather] = useState33(false);
|
|
2258
|
+
const [hasPhantom, setHasPhantom] = useState33(false);
|
|
2259
|
+
const [hasWizz, setHasWizz] = useState33(false);
|
|
2260
|
+
const [network, setNetwork] = useLocalStorage17("network", MAINNET, {
|
|
459
2261
|
initializeWithValue: false
|
|
460
2262
|
});
|
|
461
|
-
|
|
2263
|
+
useEffect33(() => {
|
|
462
2264
|
if (config) {
|
|
463
2265
|
setNetwork(config.network);
|
|
464
2266
|
getNetwork().then((foundNetwork) => {
|
|
@@ -475,7 +2277,7 @@ var LaserEyesProvider = ({
|
|
|
475
2277
|
setIsInitializing(false);
|
|
476
2278
|
}
|
|
477
2279
|
};
|
|
478
|
-
|
|
2280
|
+
useEffect33(() => {
|
|
479
2281
|
const observer = new MutationObserver(() => {
|
|
480
2282
|
const unisatLib = window == null ? void 0 : window.unisat;
|
|
481
2283
|
if (unisatLib) {
|
|
@@ -488,7 +2290,7 @@ var LaserEyesProvider = ({
|
|
|
488
2290
|
observer.disconnect();
|
|
489
2291
|
};
|
|
490
2292
|
}, []);
|
|
491
|
-
|
|
2293
|
+
useEffect33(() => {
|
|
492
2294
|
const observer = new MutationObserver(() => {
|
|
493
2295
|
var _a;
|
|
494
2296
|
const xverseLib = (_a = window == null ? void 0 : window.XverseProviders) == null ? void 0 : _a.BitcoinProvider;
|
|
@@ -502,7 +2304,7 @@ var LaserEyesProvider = ({
|
|
|
502
2304
|
observer.disconnect();
|
|
503
2305
|
};
|
|
504
2306
|
}, []);
|
|
505
|
-
|
|
2307
|
+
useEffect33(() => {
|
|
506
2308
|
const observer = new MutationObserver(() => {
|
|
507
2309
|
const oylLib = window == null ? void 0 : window.oyl;
|
|
508
2310
|
if (oylLib) {
|
|
@@ -515,7 +2317,7 @@ var LaserEyesProvider = ({
|
|
|
515
2317
|
observer.disconnect();
|
|
516
2318
|
};
|
|
517
2319
|
}, []);
|
|
518
|
-
|
|
2320
|
+
useEffect33(() => {
|
|
519
2321
|
const observer = new MutationObserver(() => {
|
|
520
2322
|
const magicEdenLib = window == null ? void 0 : window.magicEden;
|
|
521
2323
|
if (magicEdenLib) {
|
|
@@ -528,7 +2330,7 @@ var LaserEyesProvider = ({
|
|
|
528
2330
|
observer.disconnect();
|
|
529
2331
|
};
|
|
530
2332
|
}, []);
|
|
531
|
-
|
|
2333
|
+
useEffect33(() => {
|
|
532
2334
|
const observer = new MutationObserver(() => {
|
|
533
2335
|
var _a, _b;
|
|
534
2336
|
let foundOkx;
|
|
@@ -547,7 +2349,7 @@ var LaserEyesProvider = ({
|
|
|
547
2349
|
observer.disconnect();
|
|
548
2350
|
};
|
|
549
2351
|
}, [network]);
|
|
550
|
-
|
|
2352
|
+
useEffect33(() => {
|
|
551
2353
|
const observer = new MutationObserver(() => {
|
|
552
2354
|
const leatherLib = window == null ? void 0 : window.LeatherProvider;
|
|
553
2355
|
if (leatherLib) {
|
|
@@ -560,7 +2362,7 @@ var LaserEyesProvider = ({
|
|
|
560
2362
|
observer.disconnect();
|
|
561
2363
|
};
|
|
562
2364
|
}, []);
|
|
563
|
-
|
|
2365
|
+
useEffect33(() => {
|
|
564
2366
|
const observer = new MutationObserver(() => {
|
|
565
2367
|
var _a;
|
|
566
2368
|
const phantomLib = (_a = window == null ? void 0 : window.phantom) == null ? void 0 : _a.bitcoin;
|
|
@@ -577,7 +2379,7 @@ var LaserEyesProvider = ({
|
|
|
577
2379
|
observer.disconnect();
|
|
578
2380
|
};
|
|
579
2381
|
}, []);
|
|
580
|
-
|
|
2382
|
+
useEffect33(() => {
|
|
581
2383
|
const observer = new MutationObserver(() => {
|
|
582
2384
|
const wizzLib = window == null ? void 0 : window.wizz;
|
|
583
2385
|
if (wizzLib) {
|
|
@@ -590,7 +2392,7 @@ var LaserEyesProvider = ({
|
|
|
590
2392
|
observer.disconnect();
|
|
591
2393
|
};
|
|
592
2394
|
}, []);
|
|
593
|
-
|
|
2395
|
+
useEffect33(() => {
|
|
594
2396
|
checkInitializationComplete();
|
|
595
2397
|
}, [
|
|
596
2398
|
hasUnisat,
|
|
@@ -602,10 +2404,10 @@ var LaserEyesProvider = ({
|
|
|
602
2404
|
hasPhantom,
|
|
603
2405
|
hasWizz
|
|
604
2406
|
]);
|
|
605
|
-
|
|
2407
|
+
useEffect33(() => {
|
|
606
2408
|
setBalance(void 0);
|
|
607
2409
|
}, [network]);
|
|
608
|
-
|
|
2410
|
+
useEffect33(() => {
|
|
609
2411
|
if (provider !== UNISAT && provider !== WIZZ) {
|
|
610
2412
|
return;
|
|
611
2413
|
}
|
|
@@ -619,7 +2421,7 @@ var LaserEyesProvider = ({
|
|
|
619
2421
|
library.removeListener("networkChanged", handleNetworkChanged);
|
|
620
2422
|
};
|
|
621
2423
|
}, [library]);
|
|
622
|
-
|
|
2424
|
+
useEffect33(() => {
|
|
623
2425
|
if (!isInitializing) {
|
|
624
2426
|
const defaultWallet = localStorage == null ? void 0 : localStorage.getItem(
|
|
625
2427
|
LOCAL_STORAGE_DEFAULT_WALLET
|
|
@@ -630,7 +2432,7 @@ var LaserEyesProvider = ({
|
|
|
630
2432
|
}
|
|
631
2433
|
}
|
|
632
2434
|
}, [isInitializing]);
|
|
633
|
-
const connectUnisat =
|
|
2435
|
+
const connectUnisat = useCallback33(() => __async(void 0, null, function* () {
|
|
634
2436
|
try {
|
|
635
2437
|
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, UNISAT);
|
|
636
2438
|
const lib = window.unisat;
|
|
@@ -654,7 +2456,7 @@ var LaserEyesProvider = ({
|
|
|
654
2456
|
throw error;
|
|
655
2457
|
}
|
|
656
2458
|
}), [hasUnisat]);
|
|
657
|
-
const connectXverse =
|
|
2459
|
+
const connectXverse = useCallback33(() => __async(void 0, null, function* () {
|
|
658
2460
|
try {
|
|
659
2461
|
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, XVERSE);
|
|
660
2462
|
let xverseNetwork = getXverseNetwork((config == null ? void 0 : config.network) || MAINNET);
|
|
@@ -688,7 +2490,7 @@ var LaserEyesProvider = ({
|
|
|
688
2490
|
throw new Error(`Can't lasereyes to ${XVERSE} wallet`);
|
|
689
2491
|
}
|
|
690
2492
|
};
|
|
691
|
-
yield
|
|
2493
|
+
yield getAddress17(getAddressOptions);
|
|
692
2494
|
setConnected(true);
|
|
693
2495
|
} catch (error) {
|
|
694
2496
|
throw error;
|
|
@@ -753,7 +2555,7 @@ var LaserEyesProvider = ({
|
|
|
753
2555
|
}
|
|
754
2556
|
};
|
|
755
2557
|
console.log(JSON.stringify(getAddressOptions));
|
|
756
|
-
yield
|
|
2558
|
+
yield getAddress17(getAddressOptions);
|
|
757
2559
|
setConnected(true);
|
|
758
2560
|
} catch (error) {
|
|
759
2561
|
console.log("error", error);
|
|
@@ -784,7 +2586,7 @@ var LaserEyesProvider = ({
|
|
|
784
2586
|
throw error;
|
|
785
2587
|
}
|
|
786
2588
|
});
|
|
787
|
-
const connectLeather =
|
|
2589
|
+
const connectLeather = useCallback33(() => __async(void 0, null, function* () {
|
|
788
2590
|
try {
|
|
789
2591
|
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, LEATHER);
|
|
790
2592
|
const lib = window.LeatherProvider;
|
|
@@ -794,13 +2596,13 @@ var LaserEyesProvider = ({
|
|
|
794
2596
|
const addressesResponse = getAddressesResponse.result;
|
|
795
2597
|
const addresses = addressesResponse.addresses;
|
|
796
2598
|
const leatherAccountsParsed = addresses.map(
|
|
797
|
-
(
|
|
2599
|
+
(address4) => address4.address
|
|
798
2600
|
);
|
|
799
2601
|
const taprootAddress = addresses.find(
|
|
800
|
-
(
|
|
2602
|
+
(address4) => address4.type === P2TR
|
|
801
2603
|
);
|
|
802
2604
|
const segwitAddress = addresses.find(
|
|
803
|
-
(
|
|
2605
|
+
(address4) => address4.type === P2WPKH
|
|
804
2606
|
);
|
|
805
2607
|
setAccounts(leatherAccountsParsed);
|
|
806
2608
|
setAddress(String(taprootAddress == null ? void 0 : taprootAddress.address));
|
|
@@ -977,7 +2779,7 @@ var LaserEyesProvider = ({
|
|
|
977
2779
|
console.log("CANCELLED");
|
|
978
2780
|
}
|
|
979
2781
|
};
|
|
980
|
-
return [
|
|
2782
|
+
return [address3];
|
|
981
2783
|
} else if (provider === OYL) {
|
|
982
2784
|
return yield library.requestAccounts();
|
|
983
2785
|
} else if (provider === OKX) {
|
|
@@ -991,13 +2793,13 @@ var LaserEyesProvider = ({
|
|
|
991
2793
|
const addressesResponse = getAddressesResponse.result;
|
|
992
2794
|
const addresses = addressesResponse.addresses;
|
|
993
2795
|
const leatherAccountsParsed = addresses.map(
|
|
994
|
-
(
|
|
2796
|
+
(address4) => address4.address
|
|
995
2797
|
);
|
|
996
2798
|
const taprootAddress = addresses.find(
|
|
997
|
-
(
|
|
2799
|
+
(address4) => address4.type === P2TR
|
|
998
2800
|
);
|
|
999
2801
|
const segwitAddress = addresses.find(
|
|
1000
|
-
(
|
|
2802
|
+
(address4) => address4.type === P2WPKH
|
|
1001
2803
|
);
|
|
1002
2804
|
setAccounts(leatherAccountsParsed);
|
|
1003
2805
|
setAddress(String(taprootAddress == null ? void 0 : taprootAddress.address));
|
|
@@ -1040,17 +2842,17 @@ var LaserEyesProvider = ({
|
|
|
1040
2842
|
setNetwork(foundNetwork);
|
|
1041
2843
|
return foundNetwork;
|
|
1042
2844
|
} else if (provider === XVERSE) {
|
|
1043
|
-
if (
|
|
2845
|
+
if (address3.slice(0, 1) === "t") {
|
|
1044
2846
|
return TESTNET;
|
|
1045
2847
|
}
|
|
1046
2848
|
return MAINNET;
|
|
1047
2849
|
} else if (provider === OYL) {
|
|
1048
|
-
if (
|
|
2850
|
+
if (address3.slice(0, 1) === "t") {
|
|
1049
2851
|
return TESTNET;
|
|
1050
2852
|
}
|
|
1051
2853
|
return MAINNET;
|
|
1052
2854
|
} else if (provider === MAGIC_EDEN) {
|
|
1053
|
-
if (
|
|
2855
|
+
if (address3.slice(0, 1) === "t") {
|
|
1054
2856
|
return TESTNET;
|
|
1055
2857
|
}
|
|
1056
2858
|
return MAINNET;
|
|
@@ -1059,12 +2861,12 @@ var LaserEyesProvider = ({
|
|
|
1059
2861
|
const foundNetwork = getNetworkForOkx(okxNetwork);
|
|
1060
2862
|
setNetwork(foundNetwork);
|
|
1061
2863
|
} else if (provider === LEATHER) {
|
|
1062
|
-
if (
|
|
2864
|
+
if (address3.slice(0, 1) === "t") {
|
|
1063
2865
|
return TESTNET;
|
|
1064
2866
|
}
|
|
1065
2867
|
return MAINNET;
|
|
1066
2868
|
} else if (provider === PHANTOM) {
|
|
1067
|
-
if (
|
|
2869
|
+
if (address3.slice(0, 1) === "t") {
|
|
1068
2870
|
return TESTNET;
|
|
1069
2871
|
}
|
|
1070
2872
|
return MAINNET;
|
|
@@ -1177,7 +2979,7 @@ var LaserEyesProvider = ({
|
|
|
1177
2979
|
throw new Error("Transaction failed");
|
|
1178
2980
|
return txId;
|
|
1179
2981
|
} else if (provider === XVERSE) {
|
|
1180
|
-
const response = yield
|
|
2982
|
+
const response = yield request17("sendTransfer", {
|
|
1181
2983
|
recipients: [
|
|
1182
2984
|
{
|
|
1183
2985
|
address: to,
|
|
@@ -1188,7 +2990,7 @@ var LaserEyesProvider = ({
|
|
|
1188
2990
|
if (response.status === "success") {
|
|
1189
2991
|
return response.result.txid;
|
|
1190
2992
|
} else {
|
|
1191
|
-
if (response.error.code ===
|
|
2993
|
+
if (response.error.code === RpcErrorCode17.USER_REJECTION) {
|
|
1192
2994
|
throw new Error("User rejected the request");
|
|
1193
2995
|
} else {
|
|
1194
2996
|
throw new Error("Error sending BTC: " + response.error.message);
|
|
@@ -1196,7 +2998,7 @@ var LaserEyesProvider = ({
|
|
|
1196
2998
|
}
|
|
1197
2999
|
} else if (provider === OYL) {
|
|
1198
3000
|
const { psbtHex, psbtBase64 } = yield createSendBtcPsbt(
|
|
1199
|
-
|
|
3001
|
+
address3,
|
|
1200
3002
|
paymentAddress,
|
|
1201
3003
|
to,
|
|
1202
3004
|
amount,
|
|
@@ -1211,7 +3013,7 @@ var LaserEyesProvider = ({
|
|
|
1211
3013
|
return psbt.txId;
|
|
1212
3014
|
} else if (provider === MAGIC_EDEN) {
|
|
1213
3015
|
const { psbtHex, psbtBase64 } = yield createSendBtcPsbt(
|
|
1214
|
-
|
|
3016
|
+
address3,
|
|
1215
3017
|
paymentAddress,
|
|
1216
3018
|
to,
|
|
1217
3019
|
amount,
|
|
@@ -1241,7 +3043,7 @@ var LaserEyesProvider = ({
|
|
|
1241
3043
|
if ((_a = response == null ? void 0 : response.result) == null ? void 0 : _a.txid) {
|
|
1242
3044
|
return response.result.txid;
|
|
1243
3045
|
} else {
|
|
1244
|
-
if (response.error.code ===
|
|
3046
|
+
if (response.error.code === RpcErrorCode17.USER_REJECTION) {
|
|
1245
3047
|
throw new Error("User rejected the request");
|
|
1246
3048
|
} else {
|
|
1247
3049
|
throw new Error("Error sending BTC: " + response.error.message);
|
|
@@ -1267,14 +3069,14 @@ var LaserEyesProvider = ({
|
|
|
1267
3069
|
if (provider === UNISAT) {
|
|
1268
3070
|
return yield library == null ? void 0 : library.signMessage(message);
|
|
1269
3071
|
} else if (provider === XVERSE) {
|
|
1270
|
-
const response = yield
|
|
1271
|
-
address:
|
|
3072
|
+
const response = yield request17("signMessage", {
|
|
3073
|
+
address: address3,
|
|
1272
3074
|
message
|
|
1273
3075
|
});
|
|
1274
3076
|
if (response.status === "success") {
|
|
1275
3077
|
return response.result.signature;
|
|
1276
3078
|
} else {
|
|
1277
|
-
if (response.error.code ===
|
|
3079
|
+
if (response.error.code === RpcErrorCode17.USER_REJECTION) {
|
|
1278
3080
|
throw new Error("User rejected the request");
|
|
1279
3081
|
} else {
|
|
1280
3082
|
throw new Error("Error signing message: " + response.error.message);
|
|
@@ -1282,13 +3084,13 @@ var LaserEyesProvider = ({
|
|
|
1282
3084
|
}
|
|
1283
3085
|
} else if (provider === MAGIC_EDEN) {
|
|
1284
3086
|
let signedMessage;
|
|
1285
|
-
yield
|
|
3087
|
+
yield signMessageSatsConnect17({
|
|
1286
3088
|
getProvider: () => __async(void 0, null, function* () {
|
|
1287
3089
|
return window.magicEden.bitcoin;
|
|
1288
3090
|
}),
|
|
1289
3091
|
payload: {
|
|
1290
3092
|
network: {
|
|
1291
|
-
type:
|
|
3093
|
+
type: BitcoinNetworkType17.Mainnet
|
|
1292
3094
|
},
|
|
1293
3095
|
address: paymentAddress,
|
|
1294
3096
|
message
|
|
@@ -1312,7 +3114,7 @@ var LaserEyesProvider = ({
|
|
|
1312
3114
|
} else if (provider === PHANTOM) {
|
|
1313
3115
|
const utf8Bytes = new TextEncoder().encode(message);
|
|
1314
3116
|
const uintArray = new Uint8Array(utf8Bytes);
|
|
1315
|
-
const response = yield library == null ? void 0 : library.signMessage(
|
|
3117
|
+
const response = yield library == null ? void 0 : library.signMessage(address3, uintArray);
|
|
1316
3118
|
const binaryString = String.fromCharCode(...response.signature);
|
|
1317
3119
|
return btoa(binaryString);
|
|
1318
3120
|
} else if (provider === WIZZ) {
|
|
@@ -1332,11 +3134,11 @@ var LaserEyesProvider = ({
|
|
|
1332
3134
|
if (!psbt)
|
|
1333
3135
|
throw new Error("No PSBT provided");
|
|
1334
3136
|
if (isHex(psbt)) {
|
|
1335
|
-
psbtBase64 =
|
|
3137
|
+
psbtBase64 = bitcoin19.Psbt.fromHex(psbt).toBase64();
|
|
1336
3138
|
psbtHex = psbt;
|
|
1337
3139
|
} else if (isBase64(psbt)) {
|
|
1338
3140
|
psbtBase64 = psbt;
|
|
1339
|
-
psbtHex =
|
|
3141
|
+
psbtHex = bitcoin19.Psbt.fromBase64(psbt).toHex();
|
|
1340
3142
|
} else {
|
|
1341
3143
|
throw new Error("Invalid PSBT format");
|
|
1342
3144
|
}
|
|
@@ -1344,7 +3146,7 @@ var LaserEyesProvider = ({
|
|
|
1344
3146
|
const signedPsbt = yield library == null ? void 0 : library.signPsbt(psbtHex, {
|
|
1345
3147
|
autoFinalized: finalize
|
|
1346
3148
|
});
|
|
1347
|
-
const psbtSignedPsbt =
|
|
3149
|
+
const psbtSignedPsbt = bitcoin19.Psbt.fromHex(signedPsbt);
|
|
1348
3150
|
if (finalize && broadcast) {
|
|
1349
3151
|
const txId = yield pushPsbt(signedPsbt);
|
|
1350
3152
|
return {
|
|
@@ -1359,13 +3161,13 @@ var LaserEyesProvider = ({
|
|
|
1359
3161
|
txId: void 0
|
|
1360
3162
|
};
|
|
1361
3163
|
} else if (provider === XVERSE) {
|
|
1362
|
-
const toSignPsbt =
|
|
3164
|
+
const toSignPsbt = bitcoin19.Psbt.fromBase64(String(psbtBase64), {
|
|
1363
3165
|
network: getBitcoinNetwork(network)
|
|
1364
3166
|
});
|
|
1365
3167
|
const inputs = toSignPsbt.data.inputs;
|
|
1366
3168
|
const inputsToSign = [];
|
|
1367
3169
|
const ordinalAddressData = {
|
|
1368
|
-
address:
|
|
3170
|
+
address: address3,
|
|
1369
3171
|
signingIndexes: []
|
|
1370
3172
|
};
|
|
1371
3173
|
const paymentsAddressData = {
|
|
@@ -1377,13 +3179,13 @@ var LaserEyesProvider = ({
|
|
|
1377
3179
|
for (var iter = __forAwait(inputs), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {
|
|
1378
3180
|
let input = temp.value;
|
|
1379
3181
|
const { script } = input.witnessUtxo;
|
|
1380
|
-
const addressFromScript =
|
|
3182
|
+
const addressFromScript = fromOutputScript17(
|
|
1381
3183
|
script,
|
|
1382
3184
|
getBitcoinNetwork(network)
|
|
1383
3185
|
);
|
|
1384
3186
|
if (addressFromScript === paymentAddress) {
|
|
1385
3187
|
paymentsAddressData.signingIndexes.push(Number(counter));
|
|
1386
|
-
} else if (addressFromScript ===
|
|
3188
|
+
} else if (addressFromScript === address3) {
|
|
1387
3189
|
ordinalAddressData.signingIndexes.push(Number(counter));
|
|
1388
3190
|
}
|
|
1389
3191
|
counter++;
|
|
@@ -1420,7 +3222,7 @@ var LaserEyesProvider = ({
|
|
|
1420
3222
|
if (response.txId) {
|
|
1421
3223
|
txId = response.txId;
|
|
1422
3224
|
} else if (response.psbtBase64) {
|
|
1423
|
-
const signedPsbt =
|
|
3225
|
+
const signedPsbt = bitcoin19.Psbt.fromBase64(
|
|
1424
3226
|
String(response.psbtBase64),
|
|
1425
3227
|
{
|
|
1426
3228
|
network: getBitcoinNetwork(network)
|
|
@@ -1432,7 +3234,7 @@ var LaserEyesProvider = ({
|
|
|
1432
3234
|
},
|
|
1433
3235
|
onCancel: () => console.log("Canceled")
|
|
1434
3236
|
};
|
|
1435
|
-
yield
|
|
3237
|
+
yield signTransaction17(signPsbtOptions);
|
|
1436
3238
|
return {
|
|
1437
3239
|
signedPsbtHex,
|
|
1438
3240
|
signedPsbtBase64,
|
|
@@ -1441,7 +3243,7 @@ var LaserEyesProvider = ({
|
|
|
1441
3243
|
} else if (provider === OYL) {
|
|
1442
3244
|
const signedPsbt = yield library == null ? void 0 : library.signPsbt(psbtHex, true, true);
|
|
1443
3245
|
console.log({ signedPsbt });
|
|
1444
|
-
const psbtSignedPsbt =
|
|
3246
|
+
const psbtSignedPsbt = bitcoin19.Psbt.fromHex(signedPsbt);
|
|
1445
3247
|
if (broadcast) {
|
|
1446
3248
|
const txId = yield pushPsbt(psbtSignedPsbt.toHex());
|
|
1447
3249
|
return {
|
|
@@ -1457,13 +3259,13 @@ var LaserEyesProvider = ({
|
|
|
1457
3259
|
};
|
|
1458
3260
|
}
|
|
1459
3261
|
} else if (provider === MAGIC_EDEN) {
|
|
1460
|
-
const toSignPsbt =
|
|
3262
|
+
const toSignPsbt = bitcoin19.Psbt.fromBase64(String(psbtBase64), {
|
|
1461
3263
|
network: getBitcoinNetwork(network)
|
|
1462
3264
|
});
|
|
1463
3265
|
const inputs = toSignPsbt.data.inputs;
|
|
1464
3266
|
const inputsToSign = [];
|
|
1465
3267
|
const ordinalAddressData = {
|
|
1466
|
-
address:
|
|
3268
|
+
address: address3,
|
|
1467
3269
|
signingIndexes: []
|
|
1468
3270
|
};
|
|
1469
3271
|
const paymentsAddressData = {
|
|
@@ -1475,13 +3277,13 @@ var LaserEyesProvider = ({
|
|
|
1475
3277
|
for (var iter2 = __forAwait(inputs), more2, temp2, error2; more2 = !(temp2 = yield iter2.next()).done; more2 = false) {
|
|
1476
3278
|
let input = temp2.value;
|
|
1477
3279
|
const { script } = input.witnessUtxo;
|
|
1478
|
-
const addressFromScript =
|
|
3280
|
+
const addressFromScript = fromOutputScript17(
|
|
1479
3281
|
script,
|
|
1480
3282
|
getBitcoinNetwork(network)
|
|
1481
3283
|
);
|
|
1482
3284
|
if (addressFromScript === paymentAddress) {
|
|
1483
3285
|
paymentsAddressData.signingIndexes.push(Number(counter));
|
|
1484
|
-
} else if (addressFromScript ===
|
|
3286
|
+
} else if (addressFromScript === address3) {
|
|
1485
3287
|
ordinalAddressData.signingIndexes.push(Number(counter));
|
|
1486
3288
|
}
|
|
1487
3289
|
counter++;
|
|
@@ -1519,7 +3321,7 @@ var LaserEyesProvider = ({
|
|
|
1519
3321
|
},
|
|
1520
3322
|
onFinish: (response) => {
|
|
1521
3323
|
if (response.psbtBase64) {
|
|
1522
|
-
const signedPsbt =
|
|
3324
|
+
const signedPsbt = bitcoin19.Psbt.fromBase64(
|
|
1523
3325
|
String(response.psbtBase64),
|
|
1524
3326
|
{
|
|
1525
3327
|
network: getBitcoinNetwork(network)
|
|
@@ -1538,9 +3340,9 @@ var LaserEyesProvider = ({
|
|
|
1538
3340
|
throw error3;
|
|
1539
3341
|
}
|
|
1540
3342
|
};
|
|
1541
|
-
yield
|
|
3343
|
+
yield signTransaction17(signPsbtOptions);
|
|
1542
3344
|
if (broadcast) {
|
|
1543
|
-
const signed =
|
|
3345
|
+
const signed = bitcoin19.Psbt.fromBase64(String(signedPsbtBase64));
|
|
1544
3346
|
const finalized = signed.finalizeAllInputs();
|
|
1545
3347
|
const extracted = finalized.extractTransaction();
|
|
1546
3348
|
const txId2 = yield pushPsbt(extracted.toHex());
|
|
@@ -1560,7 +3362,7 @@ var LaserEyesProvider = ({
|
|
|
1560
3362
|
const signedPsbt = yield library == null ? void 0 : library.signPsbt(psbtHex, {
|
|
1561
3363
|
autoFinalized: finalize
|
|
1562
3364
|
});
|
|
1563
|
-
const psbtSignedPsbt =
|
|
3365
|
+
const psbtSignedPsbt = bitcoin19.Psbt.fromHex(signedPsbt);
|
|
1564
3366
|
if (finalize && broadcast) {
|
|
1565
3367
|
const txId = yield pushPsbt(signedPsbt);
|
|
1566
3368
|
return {
|
|
@@ -1586,7 +3388,7 @@ var LaserEyesProvider = ({
|
|
|
1586
3388
|
);
|
|
1587
3389
|
const leatherHexResult = response.result;
|
|
1588
3390
|
const signedTx = leatherHexResult.hex;
|
|
1589
|
-
const signed =
|
|
3391
|
+
const signed = bitcoin19.Psbt.fromHex(String(signedTx));
|
|
1590
3392
|
if (finalize && broadcast) {
|
|
1591
3393
|
const finalized = signed.finalizeAllInputs();
|
|
1592
3394
|
const txId = yield pushPsbt(finalized.toHex());
|
|
@@ -1614,7 +3416,7 @@ var LaserEyesProvider = ({
|
|
|
1614
3416
|
autoFinalized: finalize,
|
|
1615
3417
|
broadcast: false
|
|
1616
3418
|
});
|
|
1617
|
-
const psbtSignedPsbt =
|
|
3419
|
+
const psbtSignedPsbt = bitcoin19.Psbt.fromHex(signedPsbt);
|
|
1618
3420
|
if (finalize && broadcast) {
|
|
1619
3421
|
const txId = yield pushPsbt(signedPsbt);
|
|
1620
3422
|
return {
|
|
@@ -1646,11 +3448,11 @@ var LaserEyesProvider = ({
|
|
|
1646
3448
|
} else if (provider === OKX) {
|
|
1647
3449
|
return yield library == null ? void 0 : library.pushPsbt(psbt);
|
|
1648
3450
|
} else if (provider === MAGIC_EDEN) {
|
|
1649
|
-
return yield
|
|
3451
|
+
return yield axios35.post(`${getMempoolSpaceUrl3(network)}/api/tx`, psbt).then((res) => res.data);
|
|
1650
3452
|
} else if (provider === LEATHER) {
|
|
1651
|
-
const decoded =
|
|
3453
|
+
const decoded = bitcoin19.Psbt.fromHex(psbt);
|
|
1652
3454
|
const extracted = decoded.extractTransaction();
|
|
1653
|
-
return yield
|
|
3455
|
+
return yield axios35.post(`${getMempoolSpaceUrl3(network)}/api/tx`, extracted.toHex()).then((res) => res.data);
|
|
1654
3456
|
} else if (provider === WIZZ) {
|
|
1655
3457
|
return yield library == null ? void 0 : library.pushPsbt(psbt);
|
|
1656
3458
|
} else {
|
|
@@ -1660,14 +3462,14 @@ var LaserEyesProvider = ({
|
|
|
1660
3462
|
throw error;
|
|
1661
3463
|
}
|
|
1662
3464
|
});
|
|
1663
|
-
return /* @__PURE__ */
|
|
1664
|
-
|
|
3465
|
+
return /* @__PURE__ */ jsx17(
|
|
3466
|
+
LaserEyesContext17.Provider,
|
|
1665
3467
|
{
|
|
1666
3468
|
value: {
|
|
1667
3469
|
library,
|
|
1668
3470
|
accounts,
|
|
1669
3471
|
publicKey,
|
|
1670
|
-
address:
|
|
3472
|
+
address: address3,
|
|
1671
3473
|
paymentAddress,
|
|
1672
3474
|
paymentPublicKey,
|
|
1673
3475
|
provider,
|
|
@@ -1704,36 +3506,36 @@ var LaserEyesProvider = ({
|
|
|
1704
3506
|
};
|
|
1705
3507
|
|
|
1706
3508
|
// src/hooks/useInscriber.ts
|
|
1707
|
-
import { useCallback as
|
|
3509
|
+
import { useCallback as useCallback34, useEffect as useEffect34, useState as useState34 } from "react";
|
|
1708
3510
|
|
|
1709
3511
|
// src/consts/inscribe.ts
|
|
1710
3512
|
var MIME_TYPE_TEXT = "text/plain;charset=utf-8";
|
|
1711
3513
|
|
|
1712
3514
|
// src/hooks/useInscriber.ts
|
|
1713
|
-
import
|
|
3515
|
+
import axios36 from "axios";
|
|
1714
3516
|
var DESCRIBE_API_URL = "http://localhost:3000/api";
|
|
1715
3517
|
var useInscriber = ({
|
|
1716
3518
|
inscribeApiUrl = DESCRIBE_API_URL
|
|
1717
3519
|
}) => {
|
|
1718
|
-
const { address:
|
|
1719
|
-
const [content, setContent] =
|
|
1720
|
-
const [mimeType, setMimeType] =
|
|
1721
|
-
const [commitPsbtHex, setCommitPsbtHex] =
|
|
1722
|
-
const [commitPsbtBase64, setCommitPsbtBase64] =
|
|
1723
|
-
const [commitTxId, setCommitTxId] =
|
|
1724
|
-
const [feeRate, setFeeRate] =
|
|
1725
|
-
const [totalFees, setTotalFees] =
|
|
1726
|
-
const [inscriberAddress, setInscriberAddress] =
|
|
1727
|
-
const [inscriptionTxId, setInscriptionTxId] =
|
|
1728
|
-
const [previewUrl, setPreviewUrl] =
|
|
1729
|
-
const [isFetchingCommitPsbt, setIsFetchingCommitPsbt] =
|
|
1730
|
-
const [isInscribing, setIsInscribing] =
|
|
1731
|
-
|
|
3520
|
+
const { address: address3, paymentAddress, paymentPublicKey, publicKey, signPsbt } = useLaserEyes();
|
|
3521
|
+
const [content, setContent] = useState34("");
|
|
3522
|
+
const [mimeType, setMimeType] = useState34(MIME_TYPE_TEXT);
|
|
3523
|
+
const [commitPsbtHex, setCommitPsbtHex] = useState34("");
|
|
3524
|
+
const [commitPsbtBase64, setCommitPsbtBase64] = useState34("");
|
|
3525
|
+
const [commitTxId, setCommitTxId] = useState34("");
|
|
3526
|
+
const [feeRate, setFeeRate] = useState34(10);
|
|
3527
|
+
const [totalFees, setTotalFees] = useState34(0);
|
|
3528
|
+
const [inscriberAddress, setInscriberAddress] = useState34("");
|
|
3529
|
+
const [inscriptionTxId, setInscriptionTxId] = useState34("");
|
|
3530
|
+
const [previewUrl, setPreviewUrl] = useState34("");
|
|
3531
|
+
const [isFetchingCommitPsbt, setIsFetchingCommitPsbt] = useState34(false);
|
|
3532
|
+
const [isInscribing, setIsInscribing] = useState34(false);
|
|
3533
|
+
useEffect34(() => {
|
|
1732
3534
|
setCommitPsbtHex("");
|
|
1733
3535
|
setCommitPsbtBase64("");
|
|
1734
3536
|
setCommitTxId("");
|
|
1735
|
-
}, [content,
|
|
1736
|
-
const getCommitPsbt =
|
|
3537
|
+
}, [content, address3, mimeType, feeRate]);
|
|
3538
|
+
const getCommitPsbt = useCallback34(() => __async(void 0, null, function* () {
|
|
1737
3539
|
try {
|
|
1738
3540
|
if (!content)
|
|
1739
3541
|
throw new Error("missing content");
|
|
@@ -1746,7 +3548,7 @@ var useInscriber = ({
|
|
|
1746
3548
|
if (!mimeType)
|
|
1747
3549
|
throw new Error("missing mimeType");
|
|
1748
3550
|
setIsFetchingCommitPsbt(true);
|
|
1749
|
-
return yield
|
|
3551
|
+
return yield axios36.post(`${inscribeApiUrl}/create-inscription`, {
|
|
1750
3552
|
content,
|
|
1751
3553
|
paymentAddress,
|
|
1752
3554
|
paymentPublicKey,
|
|
@@ -1780,7 +3582,7 @@ var useInscriber = ({
|
|
|
1780
3582
|
throw e;
|
|
1781
3583
|
}
|
|
1782
3584
|
});
|
|
1783
|
-
const inscribe =
|
|
3585
|
+
const inscribe = useCallback34(
|
|
1784
3586
|
(_0) => __async(void 0, [_0], function* ({
|
|
1785
3587
|
content: providedContent,
|
|
1786
3588
|
mimeType: providedMimeType,
|
|
@@ -1790,7 +3592,7 @@ var useInscriber = ({
|
|
|
1790
3592
|
try {
|
|
1791
3593
|
const inscribeContent = providedContent != null ? providedContent : content;
|
|
1792
3594
|
const inscribeMimeType = providedMimeType != null ? providedMimeType : mimeType;
|
|
1793
|
-
const inscribeOutputAddress = providedAddress != null ? providedAddress :
|
|
3595
|
+
const inscribeOutputAddress = providedAddress != null ? providedAddress : address3;
|
|
1794
3596
|
let inscribeCommitTxId = providedCommitTxId != null ? providedCommitTxId : commitTxId;
|
|
1795
3597
|
if (!inscribeContent)
|
|
1796
3598
|
throw new Error("missing content");
|
|
@@ -1809,10 +3611,10 @@ var useInscriber = ({
|
|
|
1809
3611
|
yield delay(1e4);
|
|
1810
3612
|
if (!inscribeCommitTxId)
|
|
1811
3613
|
throw new Error("missing commitTxId");
|
|
1812
|
-
return yield
|
|
3614
|
+
return yield axios36.post(`${inscribeApiUrl}/inscribe`, {
|
|
1813
3615
|
content,
|
|
1814
3616
|
mimeType,
|
|
1815
|
-
ordinalAddress:
|
|
3617
|
+
ordinalAddress: address3,
|
|
1816
3618
|
commitTxId: inscribeCommitTxId
|
|
1817
3619
|
}).then((res) => res.data).then((data) => {
|
|
1818
3620
|
setInscriptionTxId(data);
|
|
@@ -1825,7 +3627,7 @@ var useInscriber = ({
|
|
|
1825
3627
|
setIsInscribing(false);
|
|
1826
3628
|
}
|
|
1827
3629
|
}),
|
|
1828
|
-
[
|
|
3630
|
+
[address3, commitTxId, content, mimeType]
|
|
1829
3631
|
);
|
|
1830
3632
|
const reset = () => {
|
|
1831
3633
|
setContent("");
|
|
@@ -1875,6 +3677,8 @@ export {
|
|
|
1875
3677
|
OKX,
|
|
1876
3678
|
OKX_MAINNET,
|
|
1877
3679
|
OKX_TESTNET,
|
|
3680
|
+
OP_WALLET_MAINNET,
|
|
3681
|
+
OP_WALLET_TESTNET,
|
|
1878
3682
|
OYL,
|
|
1879
3683
|
P2PKH,
|
|
1880
3684
|
P2PSH,
|