@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.js
CHANGED
|
@@ -85,6 +85,8 @@ __export(src_exports, {
|
|
|
85
85
|
OKX: () => OKX,
|
|
86
86
|
OKX_MAINNET: () => OKX_MAINNET,
|
|
87
87
|
OKX_TESTNET: () => OKX_TESTNET,
|
|
88
|
+
OP_WALLET_MAINNET: () => OP_WALLET_MAINNET,
|
|
89
|
+
OP_WALLET_TESTNET: () => OP_WALLET_TESTNET,
|
|
88
90
|
OYL: () => OYL,
|
|
89
91
|
P2PKH: () => P2PKH,
|
|
90
92
|
P2PSH: () => P2PSH,
|
|
@@ -139,6 +141,8 @@ module.exports = __toCommonJS(src_exports);
|
|
|
139
141
|
var XVERSE_NETWORK = "Mainnet";
|
|
140
142
|
var UNISAT_MAINNET = "livenet";
|
|
141
143
|
var UNISAT_TESTNET = "testnet";
|
|
144
|
+
var OP_WALLET_MAINNET = "livenet";
|
|
145
|
+
var OP_WALLET_TESTNET = "testnet";
|
|
142
146
|
var XVERSE_MAINNET = "Mainnet";
|
|
143
147
|
var XVERSE_TESTNET = "Testnet";
|
|
144
148
|
var XVERSE_SIGNET = "Signet";
|
|
@@ -274,8 +278,8 @@ var createConfig = (config) => {
|
|
|
274
278
|
};
|
|
275
279
|
|
|
276
280
|
// src/providers/LaserEyesProvider.tsx
|
|
277
|
-
var
|
|
278
|
-
var
|
|
281
|
+
var import_react33 = _toESM(require("react"));
|
|
282
|
+
var bitcoin19 = __toESM(require("bitcoinjs-lib"));
|
|
279
283
|
|
|
280
284
|
// src/consts/settings.ts
|
|
281
285
|
var LOCAL_STORAGE_DEFAULT_WALLET = "defaultWallet";
|
|
@@ -345,7 +349,7 @@ var initialWalletContext = {
|
|
|
345
349
|
};
|
|
346
350
|
|
|
347
351
|
// src/providers/LaserEyesProvider.tsx
|
|
348
|
-
var
|
|
352
|
+
var import_usehooks_ts17 = _toESM(require("usehooks-ts"));
|
|
349
353
|
|
|
350
354
|
// src/lib/helpers.ts
|
|
351
355
|
var bitcoin = __toESM(require("bitcoinjs-lib"));
|
|
@@ -380,9 +384,9 @@ var findPaymentAddress = (addresses) => {
|
|
|
380
384
|
({ purpose }) => purpose === "payment"
|
|
381
385
|
);
|
|
382
386
|
};
|
|
383
|
-
var getBTCBalance = (
|
|
387
|
+
var getBTCBalance = (address3) => __async(void 0, null, function* () {
|
|
384
388
|
try {
|
|
385
|
-
return yield import_axios.default.get(`https://blockchain.info/q/addressbalance/${
|
|
389
|
+
return yield import_axios.default.get(`https://blockchain.info/q/addressbalance/${address3}`).then((response) => response.data);
|
|
386
390
|
} catch (error) {
|
|
387
391
|
console.error("Error fetching BTC balance:", error);
|
|
388
392
|
throw new Error("Failed to fetch BTC balance");
|
|
@@ -411,9 +415,9 @@ function estimateTxSize(taprootInputCount, nonTaprootInputCount, outputCount) {
|
|
|
411
415
|
const totalOutputSize = outputCount * outputSize;
|
|
412
416
|
return baseTxSize + totalInputSize + totalOutputSize;
|
|
413
417
|
}
|
|
414
|
-
function createSendBtcPsbt(
|
|
418
|
+
function createSendBtcPsbt(address3, paymentAddress, recipientAddress, amount, paymentPublicKey, network, feeRate = 7) {
|
|
415
419
|
return __async(this, null, function* () {
|
|
416
|
-
const isTaprootOnly =
|
|
420
|
+
const isTaprootOnly = address3 === paymentAddress;
|
|
417
421
|
const mempoolUrl = `${getMempoolSpaceUrl2(
|
|
418
422
|
network
|
|
419
423
|
)}/api/address/${paymentAddress}/utxo`;
|
|
@@ -497,45 +501,1621 @@ function delay(ms) {
|
|
|
497
501
|
}
|
|
498
502
|
|
|
499
503
|
// src/providers/LaserEyesProvider.tsx
|
|
500
|
-
var
|
|
501
|
-
var
|
|
502
|
-
var
|
|
503
|
-
|
|
504
|
-
|
|
504
|
+
var import_sats_connect17 = _toESM(require("sats-connect"));
|
|
505
|
+
var import_address17 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
506
|
+
var import_axios50 = __toESM(require("axios"));
|
|
507
|
+
|
|
508
|
+
// dist/index.mjs
|
|
509
|
+
var import_react = _toESM(require("react"));
|
|
510
|
+
var bitcoin18 = __toESM(require("bitcoinjs-lib"), 1);
|
|
511
|
+
var import_usehooks_ts = _toESM(require("usehooks-ts"));
|
|
512
|
+
var bitcoin2 = __toESM(require("bitcoinjs-lib"), 1);
|
|
513
|
+
var import_axios2 = __toESM(require("axios"), 1);
|
|
514
|
+
var ecc2 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
515
|
+
var import_sats_connect = _toESM(require("sats-connect"));
|
|
516
|
+
var import_address = _toESM(require("bitcoinjs-lib/src/address"));
|
|
517
|
+
var import_axios3 = __toESM(require("axios"), 1);
|
|
518
|
+
var import_react2 = _toESM(require("react"));
|
|
519
|
+
var bitcoin17 = __toESM(require("bitcoinjs-lib"), 1);
|
|
520
|
+
var import_usehooks_ts2 = _toESM(require("usehooks-ts"));
|
|
521
|
+
var bitcoin22 = __toESM(require("bitcoinjs-lib"), 1);
|
|
522
|
+
var import_axios4 = __toESM(require("axios"), 1);
|
|
523
|
+
var ecc22 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
524
|
+
var import_sats_connect2 = _toESM(require("sats-connect"));
|
|
525
|
+
var import_address2 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
526
|
+
var import_axios5 = __toESM(require("axios"), 1);
|
|
527
|
+
var import_react3 = _toESM(require("react"));
|
|
528
|
+
var bitcoin16 = __toESM(require("bitcoinjs-lib"), 1);
|
|
529
|
+
var import_usehooks_ts3 = _toESM(require("usehooks-ts"));
|
|
530
|
+
var bitcoin222 = __toESM(require("bitcoinjs-lib"), 1);
|
|
531
|
+
var import_axios6 = __toESM(require("axios"), 1);
|
|
532
|
+
var ecc222 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
533
|
+
var import_sats_connect3 = _toESM(require("sats-connect"));
|
|
534
|
+
var import_address3 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
535
|
+
var import_axios7 = __toESM(require("axios"), 1);
|
|
536
|
+
var import_react4 = _toESM(require("react"));
|
|
537
|
+
var bitcoin15 = __toESM(require("bitcoinjs-lib"), 1);
|
|
538
|
+
var import_usehooks_ts4 = _toESM(require("usehooks-ts"));
|
|
539
|
+
var bitcoin2222 = __toESM(require("bitcoinjs-lib"), 1);
|
|
540
|
+
var import_axios8 = __toESM(require("axios"), 1);
|
|
541
|
+
var ecc2222 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
542
|
+
var import_sats_connect4 = _toESM(require("sats-connect"));
|
|
543
|
+
var import_address4 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
544
|
+
var import_axios9 = __toESM(require("axios"), 1);
|
|
545
|
+
var import_react5 = _toESM(require("react"));
|
|
546
|
+
var bitcoin14 = __toESM(require("bitcoinjs-lib"), 1);
|
|
547
|
+
var import_usehooks_ts5 = _toESM(require("usehooks-ts"));
|
|
548
|
+
var bitcoin22222 = __toESM(require("bitcoinjs-lib"), 1);
|
|
549
|
+
var import_axios10 = __toESM(require("axios"), 1);
|
|
550
|
+
var ecc22222 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
551
|
+
var import_sats_connect5 = _toESM(require("sats-connect"));
|
|
552
|
+
var import_address5 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
553
|
+
var import_axios11 = __toESM(require("axios"), 1);
|
|
554
|
+
var import_react6 = _toESM(require("react"));
|
|
555
|
+
var bitcoin13 = __toESM(require("bitcoinjs-lib"), 1);
|
|
556
|
+
var import_usehooks_ts6 = _toESM(require("usehooks-ts"));
|
|
557
|
+
var bitcoin222222 = __toESM(require("bitcoinjs-lib"), 1);
|
|
558
|
+
var import_axios12 = __toESM(require("axios"), 1);
|
|
559
|
+
var ecc222222 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
560
|
+
var import_sats_connect6 = _toESM(require("sats-connect"));
|
|
561
|
+
var import_address6 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
562
|
+
var import_axios13 = __toESM(require("axios"), 1);
|
|
563
|
+
var import_react7 = _toESM(require("react"));
|
|
564
|
+
var bitcoin12 = __toESM(require("bitcoinjs-lib"), 1);
|
|
565
|
+
var import_usehooks_ts7 = _toESM(require("usehooks-ts"));
|
|
566
|
+
var bitcoin2222222 = __toESM(require("bitcoinjs-lib"), 1);
|
|
567
|
+
var import_axios14 = __toESM(require("axios"), 1);
|
|
568
|
+
var ecc2222222 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
569
|
+
var import_sats_connect7 = _toESM(require("sats-connect"));
|
|
570
|
+
var import_address7 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
571
|
+
var import_axios15 = __toESM(require("axios"), 1);
|
|
572
|
+
var import_react8 = _toESM(require("react"));
|
|
573
|
+
var bitcoin11 = __toESM(require("bitcoinjs-lib"), 1);
|
|
574
|
+
var import_usehooks_ts8 = _toESM(require("usehooks-ts"));
|
|
575
|
+
var bitcoin22222222 = __toESM(require("bitcoinjs-lib"), 1);
|
|
576
|
+
var import_axios16 = __toESM(require("axios"), 1);
|
|
577
|
+
var ecc22222222 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
578
|
+
var import_sats_connect8 = _toESM(require("sats-connect"));
|
|
579
|
+
var import_address8 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
580
|
+
var import_axios17 = __toESM(require("axios"), 1);
|
|
581
|
+
var import_react9 = _toESM(require("react"));
|
|
582
|
+
var bitcoin10 = __toESM(require("bitcoinjs-lib"), 1);
|
|
583
|
+
var import_usehooks_ts9 = _toESM(require("usehooks-ts"));
|
|
584
|
+
var bitcoin222222222 = __toESM(require("bitcoinjs-lib"), 1);
|
|
585
|
+
var import_axios18 = __toESM(require("axios"), 1);
|
|
586
|
+
var ecc222222222 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
587
|
+
var import_sats_connect9 = _toESM(require("sats-connect"));
|
|
588
|
+
var import_address9 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
589
|
+
var import_axios19 = __toESM(require("axios"), 1);
|
|
590
|
+
var import_react10 = _toESM(require("react"));
|
|
591
|
+
var bitcoin9 = __toESM(require("bitcoinjs-lib"), 1);
|
|
592
|
+
var import_usehooks_ts10 = _toESM(require("usehooks-ts"));
|
|
593
|
+
var bitcoin2222222222 = __toESM(require("bitcoinjs-lib"), 1);
|
|
594
|
+
var import_axios20 = __toESM(require("axios"), 1);
|
|
595
|
+
var ecc2222222222 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
596
|
+
var import_sats_connect10 = _toESM(require("sats-connect"));
|
|
597
|
+
var import_address10 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
598
|
+
var import_axios21 = __toESM(require("axios"), 1);
|
|
599
|
+
var import_react11 = _toESM(require("react"));
|
|
600
|
+
var bitcoin8 = __toESM(require("bitcoinjs-lib"), 1);
|
|
601
|
+
var import_usehooks_ts11 = _toESM(require("usehooks-ts"));
|
|
602
|
+
var bitcoin22222222222 = __toESM(require("bitcoinjs-lib"), 1);
|
|
603
|
+
var import_axios22 = __toESM(require("axios"), 1);
|
|
604
|
+
var ecc22222222222 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
605
|
+
var import_sats_connect11 = _toESM(require("sats-connect"));
|
|
606
|
+
var import_address11 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
607
|
+
var import_axios23 = __toESM(require("axios"), 1);
|
|
608
|
+
var import_react12 = _toESM(require("react"));
|
|
609
|
+
var bitcoin7 = __toESM(require("bitcoinjs-lib"), 1);
|
|
610
|
+
var import_usehooks_ts12 = _toESM(require("usehooks-ts"));
|
|
611
|
+
var bitcoin222222222222 = __toESM(require("bitcoinjs-lib"), 1);
|
|
612
|
+
var import_axios24 = __toESM(require("axios"), 1);
|
|
613
|
+
var ecc222222222222 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
614
|
+
var import_sats_connect12 = _toESM(require("sats-connect"));
|
|
615
|
+
var import_address12 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
616
|
+
var import_axios25 = __toESM(require("axios"), 1);
|
|
617
|
+
var import_react13 = _toESM(require("react"));
|
|
618
|
+
var bitcoin6 = __toESM(require("bitcoinjs-lib"), 1);
|
|
619
|
+
var import_usehooks_ts13 = _toESM(require("usehooks-ts"));
|
|
620
|
+
var bitcoin2222222222222 = __toESM(require("bitcoinjs-lib"), 1);
|
|
621
|
+
var import_axios26 = __toESM(require("axios"), 1);
|
|
622
|
+
var ecc2222222222222 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
623
|
+
var import_sats_connect13 = _toESM(require("sats-connect"));
|
|
624
|
+
var import_address13 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
625
|
+
var import_axios27 = __toESM(require("axios"), 1);
|
|
626
|
+
var import_react14 = _toESM(require("react"));
|
|
627
|
+
var bitcoin5 = __toESM(require("bitcoinjs-lib"), 1);
|
|
628
|
+
var import_usehooks_ts14 = _toESM(require("usehooks-ts"));
|
|
629
|
+
var bitcoin22222222222222 = __toESM(require("bitcoinjs-lib"), 1);
|
|
630
|
+
var import_axios28 = __toESM(require("axios"), 1);
|
|
631
|
+
var ecc22222222222222 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
632
|
+
var import_sats_connect14 = _toESM(require("sats-connect"));
|
|
633
|
+
var import_address14 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
634
|
+
var import_axios29 = __toESM(require("axios"), 1);
|
|
635
|
+
var import_react15 = _toESM(require("react"));
|
|
636
|
+
var bitcoin4 = __toESM(require("bitcoinjs-lib"), 1);
|
|
637
|
+
var import_usehooks_ts15 = _toESM(require("usehooks-ts"));
|
|
638
|
+
var bitcoin222222222222222 = __toESM(require("bitcoinjs-lib"), 1);
|
|
639
|
+
var import_axios30 = __toESM(require("axios"), 1);
|
|
640
|
+
var ecc222222222222222 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
641
|
+
var import_sats_connect15 = _toESM(require("sats-connect"));
|
|
642
|
+
var import_address15 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
643
|
+
var import_axios31 = __toESM(require("axios"), 1);
|
|
644
|
+
var import_react16 = _toESM(require("react"));
|
|
645
|
+
var bitcoin2222222222222222 = __toESM(require("bitcoinjs-lib"), 1);
|
|
646
|
+
var import_usehooks_ts16 = _toESM(require("usehooks-ts"));
|
|
647
|
+
var bitcoin3 = __toESM(require("bitcoinjs-lib"), 1);
|
|
648
|
+
var import_axios32 = __toESM(require("axios"), 1);
|
|
649
|
+
var ecc2222222222222222 = __toESM(require("@bitcoinerlab/secp256k1"), 1);
|
|
650
|
+
var import_sats_connect16 = _toESM(require("sats-connect"));
|
|
651
|
+
var import_address16 = _toESM(require("bitcoinjs-lib/src/address"));
|
|
652
|
+
var import_axios33 = __toESM(require("axios"), 1);
|
|
653
|
+
var import_jsx_runtime = _toESM(require("react/jsx-runtime"));
|
|
654
|
+
var import_react17 = _toESM(require("react"));
|
|
655
|
+
var import_axios34 = __toESM(require("axios"), 1);
|
|
656
|
+
var import_jsx_runtime2 = _toESM(require("react/jsx-runtime"));
|
|
657
|
+
var import_react18 = _toESM(require("react"));
|
|
658
|
+
var import_axios35 = __toESM(require("axios"), 1);
|
|
659
|
+
var import_jsx_runtime3 = _toESM(require("react/jsx-runtime"));
|
|
660
|
+
var import_react19 = _toESM(require("react"));
|
|
661
|
+
var import_axios36 = __toESM(require("axios"), 1);
|
|
662
|
+
var import_jsx_runtime4 = _toESM(require("react/jsx-runtime"));
|
|
663
|
+
var import_react20 = _toESM(require("react"));
|
|
664
|
+
var import_axios37 = __toESM(require("axios"), 1);
|
|
665
|
+
var import_jsx_runtime5 = _toESM(require("react/jsx-runtime"));
|
|
666
|
+
var import_react21 = _toESM(require("react"));
|
|
667
|
+
var import_axios38 = __toESM(require("axios"), 1);
|
|
668
|
+
var import_jsx_runtime6 = _toESM(require("react/jsx-runtime"));
|
|
669
|
+
var import_react22 = _toESM(require("react"));
|
|
670
|
+
var import_axios39 = __toESM(require("axios"), 1);
|
|
671
|
+
var import_jsx_runtime7 = _toESM(require("react/jsx-runtime"));
|
|
672
|
+
var import_react23 = _toESM(require("react"));
|
|
673
|
+
var import_axios40 = __toESM(require("axios"), 1);
|
|
674
|
+
var import_jsx_runtime8 = _toESM(require("react/jsx-runtime"));
|
|
675
|
+
var import_react24 = _toESM(require("react"));
|
|
676
|
+
var import_axios41 = __toESM(require("axios"), 1);
|
|
677
|
+
var import_jsx_runtime9 = _toESM(require("react/jsx-runtime"));
|
|
678
|
+
var import_react25 = _toESM(require("react"));
|
|
679
|
+
var import_axios42 = __toESM(require("axios"), 1);
|
|
680
|
+
var import_jsx_runtime10 = _toESM(require("react/jsx-runtime"));
|
|
681
|
+
var import_react26 = _toESM(require("react"));
|
|
682
|
+
var import_axios43 = __toESM(require("axios"), 1);
|
|
683
|
+
var import_jsx_runtime11 = _toESM(require("react/jsx-runtime"));
|
|
684
|
+
var import_react27 = _toESM(require("react"));
|
|
685
|
+
var import_axios44 = __toESM(require("axios"), 1);
|
|
686
|
+
var import_jsx_runtime12 = _toESM(require("react/jsx-runtime"));
|
|
687
|
+
var import_react28 = _toESM(require("react"));
|
|
688
|
+
var import_axios45 = __toESM(require("axios"), 1);
|
|
689
|
+
var import_jsx_runtime13 = _toESM(require("react/jsx-runtime"));
|
|
690
|
+
var import_react29 = _toESM(require("react"));
|
|
691
|
+
var import_axios46 = __toESM(require("axios"), 1);
|
|
692
|
+
var import_jsx_runtime14 = _toESM(require("react/jsx-runtime"));
|
|
693
|
+
var import_react30 = _toESM(require("react"));
|
|
694
|
+
var import_axios47 = __toESM(require("axios"), 1);
|
|
695
|
+
var import_jsx_runtime15 = _toESM(require("react/jsx-runtime"));
|
|
696
|
+
var import_react31 = _toESM(require("react"));
|
|
697
|
+
var import_axios48 = __toESM(require("axios"), 1);
|
|
698
|
+
var import_jsx_runtime16 = _toESM(require("react/jsx-runtime"));
|
|
699
|
+
var import_react32 = _toESM(require("react"));
|
|
700
|
+
var import_axios49 = __toESM(require("axios"), 1);
|
|
701
|
+
var __async2 = (__this, __arguments, generator) => {
|
|
702
|
+
return new Promise((resolve, reject) => {
|
|
703
|
+
var fulfilled = (value) => {
|
|
704
|
+
try {
|
|
705
|
+
step(generator.next(value));
|
|
706
|
+
} catch (e) {
|
|
707
|
+
reject(e);
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
var rejected = (value) => {
|
|
711
|
+
try {
|
|
712
|
+
step(generator.throw(value));
|
|
713
|
+
} catch (e) {
|
|
714
|
+
reject(e);
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
718
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
719
|
+
});
|
|
720
|
+
};
|
|
721
|
+
var MAINNET4 = "mainnet";
|
|
722
|
+
var SIGNET3 = "signet";
|
|
723
|
+
var TESTNET3 = "testnet";
|
|
724
|
+
var initialWalletContext2 = {
|
|
725
|
+
hasUnisat: false,
|
|
726
|
+
hasXverse: false,
|
|
727
|
+
hasOyl: false,
|
|
728
|
+
hasMagicEden: false,
|
|
729
|
+
hasOkx: false,
|
|
730
|
+
hasLeather: false,
|
|
731
|
+
hasPhantom: false,
|
|
732
|
+
hasWizz: false,
|
|
733
|
+
isInitializing: true,
|
|
734
|
+
connected: false,
|
|
735
|
+
isConnecting: false,
|
|
736
|
+
publicKey: "",
|
|
737
|
+
address: "",
|
|
738
|
+
paymentAddress: "",
|
|
739
|
+
paymentPublicKey: "",
|
|
740
|
+
balance: void 0,
|
|
741
|
+
network: MAINNET4,
|
|
742
|
+
library: null,
|
|
743
|
+
provider: null,
|
|
744
|
+
accounts: [],
|
|
745
|
+
connect: (walletName) => __async2(void 0, null, function* () {
|
|
746
|
+
}),
|
|
747
|
+
disconnect: () => {
|
|
748
|
+
},
|
|
749
|
+
requestAccounts: () => __async2(void 0, null, function* () {
|
|
750
|
+
return [];
|
|
751
|
+
}),
|
|
752
|
+
getNetwork: () => __async2(void 0, null, function* () {
|
|
753
|
+
return MAINNET4;
|
|
754
|
+
}),
|
|
755
|
+
switchNetwork: (network) => __async2(void 0, null, function* () {
|
|
756
|
+
}),
|
|
757
|
+
getPublicKey: () => __async2(void 0, null, function* () {
|
|
758
|
+
return "";
|
|
759
|
+
}),
|
|
760
|
+
getBalance: () => __async2(void 0, null, function* () {
|
|
761
|
+
return "";
|
|
762
|
+
}),
|
|
763
|
+
getInscriptions: () => __async2(void 0, null, function* () {
|
|
764
|
+
return [];
|
|
765
|
+
}),
|
|
766
|
+
sendBTC: (to, amount) => __async2(void 0, null, function* () {
|
|
767
|
+
return "";
|
|
768
|
+
}),
|
|
769
|
+
signMessage: (message) => __async2(void 0, null, function* () {
|
|
770
|
+
return "";
|
|
771
|
+
}),
|
|
772
|
+
signPsbt: (tx) => __async2(void 0, null, function* () {
|
|
773
|
+
return {
|
|
774
|
+
signedPsbtHex: "",
|
|
775
|
+
signedPsbtBase64: "",
|
|
776
|
+
txId: ""
|
|
777
|
+
};
|
|
778
|
+
}),
|
|
779
|
+
pushPsbt: (tx) => __async2(void 0, null, function* () {
|
|
780
|
+
return "";
|
|
781
|
+
}),
|
|
782
|
+
inscribe: (content) => __async2(void 0, null, function* () {
|
|
783
|
+
return "";
|
|
784
|
+
}),
|
|
785
|
+
isCreatingCommit: false,
|
|
786
|
+
isInscribing: false
|
|
787
|
+
};
|
|
788
|
+
bitcoin2.initEccLib(ecc2);
|
|
789
|
+
var __async22 = (__this, __arguments, generator) => {
|
|
790
|
+
return new Promise((resolve, reject) => {
|
|
791
|
+
var fulfilled = (value) => {
|
|
792
|
+
try {
|
|
793
|
+
step(generator.next(value));
|
|
794
|
+
} catch (e) {
|
|
795
|
+
reject(e);
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
var rejected = (value) => {
|
|
799
|
+
try {
|
|
800
|
+
step(generator.throw(value));
|
|
801
|
+
} catch (e) {
|
|
802
|
+
reject(e);
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
806
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
807
|
+
});
|
|
808
|
+
};
|
|
809
|
+
var MAINNET42 = "mainnet";
|
|
810
|
+
var initialWalletContext22 = {
|
|
811
|
+
hasUnisat: false,
|
|
812
|
+
hasXverse: false,
|
|
813
|
+
hasOyl: false,
|
|
814
|
+
hasMagicEden: false,
|
|
815
|
+
hasOkx: false,
|
|
816
|
+
hasLeather: false,
|
|
817
|
+
hasPhantom: false,
|
|
818
|
+
hasWizz: false,
|
|
819
|
+
isInitializing: true,
|
|
820
|
+
connected: false,
|
|
821
|
+
isConnecting: false,
|
|
822
|
+
publicKey: "",
|
|
823
|
+
address: "",
|
|
824
|
+
paymentAddress: "",
|
|
825
|
+
paymentPublicKey: "",
|
|
826
|
+
balance: void 0,
|
|
827
|
+
network: MAINNET42,
|
|
828
|
+
library: null,
|
|
829
|
+
provider: null,
|
|
830
|
+
accounts: [],
|
|
831
|
+
connect: (walletName) => __async22(void 0, null, function* () {
|
|
832
|
+
}),
|
|
833
|
+
disconnect: () => {
|
|
834
|
+
},
|
|
835
|
+
requestAccounts: () => __async22(void 0, null, function* () {
|
|
836
|
+
return [];
|
|
837
|
+
}),
|
|
838
|
+
getNetwork: () => __async22(void 0, null, function* () {
|
|
839
|
+
return MAINNET42;
|
|
840
|
+
}),
|
|
841
|
+
switchNetwork: (network) => __async22(void 0, null, function* () {
|
|
842
|
+
}),
|
|
843
|
+
getPublicKey: () => __async22(void 0, null, function* () {
|
|
844
|
+
return "";
|
|
845
|
+
}),
|
|
846
|
+
getBalance: () => __async22(void 0, null, function* () {
|
|
847
|
+
return "";
|
|
848
|
+
}),
|
|
849
|
+
getInscriptions: () => __async22(void 0, null, function* () {
|
|
850
|
+
return [];
|
|
851
|
+
}),
|
|
852
|
+
sendBTC: (to, amount) => __async22(void 0, null, function* () {
|
|
853
|
+
return "";
|
|
854
|
+
}),
|
|
855
|
+
signMessage: (message) => __async22(void 0, null, function* () {
|
|
856
|
+
return "";
|
|
857
|
+
}),
|
|
858
|
+
signPsbt: (tx) => __async22(void 0, null, function* () {
|
|
859
|
+
return {
|
|
860
|
+
signedPsbtHex: "",
|
|
861
|
+
signedPsbtBase64: "",
|
|
862
|
+
txId: ""
|
|
863
|
+
};
|
|
864
|
+
}),
|
|
865
|
+
pushPsbt: (tx) => __async22(void 0, null, function* () {
|
|
866
|
+
return "";
|
|
867
|
+
}),
|
|
868
|
+
inscribe: (content) => __async22(void 0, null, function* () {
|
|
869
|
+
return "";
|
|
870
|
+
}),
|
|
871
|
+
isCreatingCommit: false,
|
|
872
|
+
isInscribing: false
|
|
873
|
+
};
|
|
874
|
+
bitcoin22.initEccLib(ecc22);
|
|
875
|
+
var MAINNET422 = "mainnet";
|
|
876
|
+
var initialWalletContext222 = {
|
|
877
|
+
hasUnisat: false,
|
|
878
|
+
hasXverse: false,
|
|
879
|
+
hasOyl: false,
|
|
880
|
+
hasMagicEden: false,
|
|
881
|
+
hasOkx: false,
|
|
882
|
+
hasLeather: false,
|
|
883
|
+
hasPhantom: false,
|
|
884
|
+
hasWizz: false,
|
|
885
|
+
isInitializing: true,
|
|
886
|
+
connected: false,
|
|
887
|
+
isConnecting: false,
|
|
888
|
+
publicKey: "",
|
|
889
|
+
address: "",
|
|
890
|
+
paymentAddress: "",
|
|
891
|
+
paymentPublicKey: "",
|
|
892
|
+
balance: void 0,
|
|
893
|
+
network: MAINNET422,
|
|
894
|
+
library: null,
|
|
895
|
+
provider: null,
|
|
896
|
+
accounts: [],
|
|
897
|
+
connect: (walletName) => __async22(void 0, null, function* () {
|
|
898
|
+
}),
|
|
899
|
+
disconnect: () => {
|
|
900
|
+
},
|
|
901
|
+
requestAccounts: () => __async22(void 0, null, function* () {
|
|
902
|
+
return [];
|
|
903
|
+
}),
|
|
904
|
+
getNetwork: () => __async22(void 0, null, function* () {
|
|
905
|
+
return MAINNET422;
|
|
906
|
+
}),
|
|
907
|
+
switchNetwork: (network) => __async22(void 0, null, function* () {
|
|
908
|
+
}),
|
|
909
|
+
getPublicKey: () => __async22(void 0, null, function* () {
|
|
910
|
+
return "";
|
|
911
|
+
}),
|
|
912
|
+
getBalance: () => __async22(void 0, null, function* () {
|
|
913
|
+
return "";
|
|
914
|
+
}),
|
|
915
|
+
getInscriptions: () => __async22(void 0, null, function* () {
|
|
916
|
+
return [];
|
|
917
|
+
}),
|
|
918
|
+
sendBTC: (to, amount) => __async22(void 0, null, function* () {
|
|
919
|
+
return "";
|
|
920
|
+
}),
|
|
921
|
+
signMessage: (message) => __async22(void 0, null, function* () {
|
|
922
|
+
return "";
|
|
923
|
+
}),
|
|
924
|
+
signPsbt: (tx) => __async22(void 0, null, function* () {
|
|
925
|
+
return {
|
|
926
|
+
signedPsbtHex: "",
|
|
927
|
+
signedPsbtBase64: "",
|
|
928
|
+
txId: ""
|
|
929
|
+
};
|
|
930
|
+
}),
|
|
931
|
+
pushPsbt: (tx) => __async22(void 0, null, function* () {
|
|
932
|
+
return "";
|
|
933
|
+
}),
|
|
934
|
+
inscribe: (content) => __async22(void 0, null, function* () {
|
|
935
|
+
return "";
|
|
936
|
+
}),
|
|
937
|
+
isCreatingCommit: false,
|
|
938
|
+
isInscribing: false
|
|
939
|
+
};
|
|
940
|
+
bitcoin222.initEccLib(ecc222);
|
|
941
|
+
var __async222 = (__this, __arguments, generator) => {
|
|
942
|
+
return new Promise((resolve, reject) => {
|
|
943
|
+
var fulfilled = (value) => {
|
|
944
|
+
try {
|
|
945
|
+
step(generator.next(value));
|
|
946
|
+
} catch (e) {
|
|
947
|
+
reject(e);
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
var rejected = (value) => {
|
|
951
|
+
try {
|
|
952
|
+
step(generator.throw(value));
|
|
953
|
+
} catch (e) {
|
|
954
|
+
reject(e);
|
|
955
|
+
}
|
|
956
|
+
};
|
|
957
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
958
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
959
|
+
});
|
|
960
|
+
};
|
|
961
|
+
var MAINNET4222 = "mainnet";
|
|
962
|
+
var initialWalletContext2222 = {
|
|
963
|
+
hasUnisat: false,
|
|
964
|
+
hasXverse: false,
|
|
965
|
+
hasOyl: false,
|
|
966
|
+
hasMagicEden: false,
|
|
967
|
+
hasOkx: false,
|
|
968
|
+
hasLeather: false,
|
|
969
|
+
hasPhantom: false,
|
|
970
|
+
hasWizz: false,
|
|
971
|
+
isInitializing: true,
|
|
972
|
+
connected: false,
|
|
973
|
+
isConnecting: false,
|
|
974
|
+
publicKey: "",
|
|
975
|
+
address: "",
|
|
976
|
+
paymentAddress: "",
|
|
977
|
+
paymentPublicKey: "",
|
|
978
|
+
balance: void 0,
|
|
979
|
+
network: MAINNET4222,
|
|
980
|
+
library: null,
|
|
981
|
+
provider: null,
|
|
982
|
+
accounts: [],
|
|
983
|
+
connect: (walletName) => __async222(void 0, null, function* () {
|
|
984
|
+
}),
|
|
985
|
+
disconnect: () => {
|
|
986
|
+
},
|
|
987
|
+
requestAccounts: () => __async222(void 0, null, function* () {
|
|
988
|
+
return [];
|
|
989
|
+
}),
|
|
990
|
+
getNetwork: () => __async222(void 0, null, function* () {
|
|
991
|
+
return MAINNET4222;
|
|
992
|
+
}),
|
|
993
|
+
switchNetwork: (network) => __async222(void 0, null, function* () {
|
|
994
|
+
}),
|
|
995
|
+
getPublicKey: () => __async222(void 0, null, function* () {
|
|
996
|
+
return "";
|
|
997
|
+
}),
|
|
998
|
+
getBalance: () => __async222(void 0, null, function* () {
|
|
999
|
+
return "";
|
|
1000
|
+
}),
|
|
1001
|
+
getInscriptions: () => __async222(void 0, null, function* () {
|
|
1002
|
+
return [];
|
|
1003
|
+
}),
|
|
1004
|
+
sendBTC: (to, amount) => __async222(void 0, null, function* () {
|
|
1005
|
+
return "";
|
|
1006
|
+
}),
|
|
1007
|
+
signMessage: (message) => __async222(void 0, null, function* () {
|
|
1008
|
+
return "";
|
|
1009
|
+
}),
|
|
1010
|
+
signPsbt: (tx) => __async222(void 0, null, function* () {
|
|
1011
|
+
return {
|
|
1012
|
+
signedPsbtHex: "",
|
|
1013
|
+
signedPsbtBase64: "",
|
|
1014
|
+
txId: ""
|
|
1015
|
+
};
|
|
1016
|
+
}),
|
|
1017
|
+
pushPsbt: (tx) => __async222(void 0, null, function* () {
|
|
1018
|
+
return "";
|
|
1019
|
+
}),
|
|
1020
|
+
inscribe: (content) => __async222(void 0, null, function* () {
|
|
1021
|
+
return "";
|
|
1022
|
+
}),
|
|
1023
|
+
isCreatingCommit: false,
|
|
1024
|
+
isInscribing: false
|
|
1025
|
+
};
|
|
1026
|
+
bitcoin2222.initEccLib(ecc2222);
|
|
1027
|
+
var __async2222 = (__this, __arguments, generator) => {
|
|
1028
|
+
return new Promise((resolve, reject) => {
|
|
1029
|
+
var fulfilled = (value) => {
|
|
1030
|
+
try {
|
|
1031
|
+
step(generator.next(value));
|
|
1032
|
+
} catch (e) {
|
|
1033
|
+
reject(e);
|
|
1034
|
+
}
|
|
1035
|
+
};
|
|
1036
|
+
var rejected = (value) => {
|
|
1037
|
+
try {
|
|
1038
|
+
step(generator.throw(value));
|
|
1039
|
+
} catch (e) {
|
|
1040
|
+
reject(e);
|
|
1041
|
+
}
|
|
1042
|
+
};
|
|
1043
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1044
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1045
|
+
});
|
|
1046
|
+
};
|
|
1047
|
+
var MAINNET42222 = "mainnet";
|
|
1048
|
+
var initialWalletContext22222 = {
|
|
1049
|
+
hasUnisat: false,
|
|
1050
|
+
hasXverse: false,
|
|
1051
|
+
hasOyl: false,
|
|
1052
|
+
hasMagicEden: false,
|
|
1053
|
+
hasOkx: false,
|
|
1054
|
+
hasLeather: false,
|
|
1055
|
+
hasPhantom: false,
|
|
1056
|
+
hasWizz: false,
|
|
1057
|
+
isInitializing: true,
|
|
1058
|
+
connected: false,
|
|
1059
|
+
isConnecting: false,
|
|
1060
|
+
publicKey: "",
|
|
1061
|
+
address: "",
|
|
1062
|
+
paymentAddress: "",
|
|
1063
|
+
paymentPublicKey: "",
|
|
1064
|
+
balance: void 0,
|
|
1065
|
+
network: MAINNET42222,
|
|
1066
|
+
library: null,
|
|
1067
|
+
provider: null,
|
|
1068
|
+
accounts: [],
|
|
1069
|
+
connect: (walletName) => __async2222(void 0, null, function* () {
|
|
1070
|
+
}),
|
|
1071
|
+
disconnect: () => {
|
|
1072
|
+
},
|
|
1073
|
+
requestAccounts: () => __async2222(void 0, null, function* () {
|
|
1074
|
+
return [];
|
|
1075
|
+
}),
|
|
1076
|
+
getNetwork: () => __async2222(void 0, null, function* () {
|
|
1077
|
+
return MAINNET42222;
|
|
1078
|
+
}),
|
|
1079
|
+
switchNetwork: (network) => __async2222(void 0, null, function* () {
|
|
1080
|
+
}),
|
|
1081
|
+
getPublicKey: () => __async2222(void 0, null, function* () {
|
|
1082
|
+
return "";
|
|
1083
|
+
}),
|
|
1084
|
+
getBalance: () => __async2222(void 0, null, function* () {
|
|
1085
|
+
return "";
|
|
1086
|
+
}),
|
|
1087
|
+
getInscriptions: () => __async2222(void 0, null, function* () {
|
|
1088
|
+
return [];
|
|
1089
|
+
}),
|
|
1090
|
+
sendBTC: (to, amount) => __async2222(void 0, null, function* () {
|
|
1091
|
+
return "";
|
|
1092
|
+
}),
|
|
1093
|
+
signMessage: (message) => __async2222(void 0, null, function* () {
|
|
1094
|
+
return "";
|
|
1095
|
+
}),
|
|
1096
|
+
signPsbt: (tx) => __async2222(void 0, null, function* () {
|
|
1097
|
+
return {
|
|
1098
|
+
signedPsbtHex: "",
|
|
1099
|
+
signedPsbtBase64: "",
|
|
1100
|
+
txId: ""
|
|
1101
|
+
};
|
|
1102
|
+
}),
|
|
1103
|
+
pushPsbt: (tx) => __async2222(void 0, null, function* () {
|
|
1104
|
+
return "";
|
|
1105
|
+
}),
|
|
1106
|
+
inscribe: (content) => __async2222(void 0, null, function* () {
|
|
1107
|
+
return "";
|
|
1108
|
+
}),
|
|
1109
|
+
isCreatingCommit: false,
|
|
1110
|
+
isInscribing: false
|
|
1111
|
+
};
|
|
1112
|
+
bitcoin22222.initEccLib(ecc22222);
|
|
1113
|
+
var __async22222 = (__this, __arguments, generator) => {
|
|
1114
|
+
return new Promise((resolve, reject) => {
|
|
1115
|
+
var fulfilled = (value) => {
|
|
1116
|
+
try {
|
|
1117
|
+
step(generator.next(value));
|
|
1118
|
+
} catch (e) {
|
|
1119
|
+
reject(e);
|
|
1120
|
+
}
|
|
1121
|
+
};
|
|
1122
|
+
var rejected = (value) => {
|
|
1123
|
+
try {
|
|
1124
|
+
step(generator.throw(value));
|
|
1125
|
+
} catch (e) {
|
|
1126
|
+
reject(e);
|
|
1127
|
+
}
|
|
1128
|
+
};
|
|
1129
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1130
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1131
|
+
});
|
|
1132
|
+
};
|
|
1133
|
+
var MAINNET422222 = "mainnet";
|
|
1134
|
+
var initialWalletContext222222 = {
|
|
1135
|
+
hasUnisat: false,
|
|
1136
|
+
hasXverse: false,
|
|
1137
|
+
hasOyl: false,
|
|
1138
|
+
hasMagicEden: false,
|
|
1139
|
+
hasOkx: false,
|
|
1140
|
+
hasLeather: false,
|
|
1141
|
+
hasPhantom: false,
|
|
1142
|
+
hasWizz: false,
|
|
1143
|
+
isInitializing: true,
|
|
1144
|
+
connected: false,
|
|
1145
|
+
isConnecting: false,
|
|
1146
|
+
publicKey: "",
|
|
1147
|
+
address: "",
|
|
1148
|
+
paymentAddress: "",
|
|
1149
|
+
paymentPublicKey: "",
|
|
1150
|
+
balance: void 0,
|
|
1151
|
+
network: MAINNET422222,
|
|
1152
|
+
library: null,
|
|
1153
|
+
provider: null,
|
|
1154
|
+
accounts: [],
|
|
1155
|
+
connect: (walletName) => __async22222(void 0, null, function* () {
|
|
1156
|
+
}),
|
|
1157
|
+
disconnect: () => {
|
|
1158
|
+
},
|
|
1159
|
+
requestAccounts: () => __async22222(void 0, null, function* () {
|
|
1160
|
+
return [];
|
|
1161
|
+
}),
|
|
1162
|
+
getNetwork: () => __async22222(void 0, null, function* () {
|
|
1163
|
+
return MAINNET422222;
|
|
1164
|
+
}),
|
|
1165
|
+
switchNetwork: (network) => __async22222(void 0, null, function* () {
|
|
1166
|
+
}),
|
|
1167
|
+
getPublicKey: () => __async22222(void 0, null, function* () {
|
|
1168
|
+
return "";
|
|
1169
|
+
}),
|
|
1170
|
+
getBalance: () => __async22222(void 0, null, function* () {
|
|
1171
|
+
return "";
|
|
1172
|
+
}),
|
|
1173
|
+
getInscriptions: () => __async22222(void 0, null, function* () {
|
|
1174
|
+
return [];
|
|
1175
|
+
}),
|
|
1176
|
+
sendBTC: (to, amount) => __async22222(void 0, null, function* () {
|
|
1177
|
+
return "";
|
|
1178
|
+
}),
|
|
1179
|
+
signMessage: (message) => __async22222(void 0, null, function* () {
|
|
1180
|
+
return "";
|
|
1181
|
+
}),
|
|
1182
|
+
signPsbt: (tx) => __async22222(void 0, null, function* () {
|
|
1183
|
+
return {
|
|
1184
|
+
signedPsbtHex: "",
|
|
1185
|
+
signedPsbtBase64: "",
|
|
1186
|
+
txId: ""
|
|
1187
|
+
};
|
|
1188
|
+
}),
|
|
1189
|
+
pushPsbt: (tx) => __async22222(void 0, null, function* () {
|
|
1190
|
+
return "";
|
|
1191
|
+
}),
|
|
1192
|
+
inscribe: (content) => __async22222(void 0, null, function* () {
|
|
1193
|
+
return "";
|
|
1194
|
+
}),
|
|
1195
|
+
isCreatingCommit: false,
|
|
1196
|
+
isInscribing: false
|
|
1197
|
+
};
|
|
1198
|
+
bitcoin222222.initEccLib(ecc222222);
|
|
1199
|
+
var __async222222 = (__this, __arguments, generator) => {
|
|
1200
|
+
return new Promise((resolve, reject) => {
|
|
1201
|
+
var fulfilled = (value) => {
|
|
1202
|
+
try {
|
|
1203
|
+
step(generator.next(value));
|
|
1204
|
+
} catch (e) {
|
|
1205
|
+
reject(e);
|
|
1206
|
+
}
|
|
1207
|
+
};
|
|
1208
|
+
var rejected = (value) => {
|
|
1209
|
+
try {
|
|
1210
|
+
step(generator.throw(value));
|
|
1211
|
+
} catch (e) {
|
|
1212
|
+
reject(e);
|
|
1213
|
+
}
|
|
1214
|
+
};
|
|
1215
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1216
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1217
|
+
});
|
|
1218
|
+
};
|
|
1219
|
+
var MAINNET4222222 = "mainnet";
|
|
1220
|
+
var initialWalletContext2222222 = {
|
|
1221
|
+
hasUnisat: false,
|
|
1222
|
+
hasXverse: false,
|
|
1223
|
+
hasOyl: false,
|
|
1224
|
+
hasMagicEden: false,
|
|
1225
|
+
hasOkx: false,
|
|
1226
|
+
hasLeather: false,
|
|
1227
|
+
hasPhantom: false,
|
|
1228
|
+
hasWizz: false,
|
|
1229
|
+
isInitializing: true,
|
|
1230
|
+
connected: false,
|
|
1231
|
+
isConnecting: false,
|
|
1232
|
+
publicKey: "",
|
|
1233
|
+
address: "",
|
|
1234
|
+
paymentAddress: "",
|
|
1235
|
+
paymentPublicKey: "",
|
|
1236
|
+
balance: void 0,
|
|
1237
|
+
network: MAINNET4222222,
|
|
1238
|
+
library: null,
|
|
1239
|
+
provider: null,
|
|
1240
|
+
accounts: [],
|
|
1241
|
+
connect: (walletName) => __async222222(void 0, null, function* () {
|
|
1242
|
+
}),
|
|
1243
|
+
disconnect: () => {
|
|
1244
|
+
},
|
|
1245
|
+
requestAccounts: () => __async222222(void 0, null, function* () {
|
|
1246
|
+
return [];
|
|
1247
|
+
}),
|
|
1248
|
+
getNetwork: () => __async222222(void 0, null, function* () {
|
|
1249
|
+
return MAINNET4222222;
|
|
1250
|
+
}),
|
|
1251
|
+
switchNetwork: (network) => __async222222(void 0, null, function* () {
|
|
1252
|
+
}),
|
|
1253
|
+
getPublicKey: () => __async222222(void 0, null, function* () {
|
|
1254
|
+
return "";
|
|
1255
|
+
}),
|
|
1256
|
+
getBalance: () => __async222222(void 0, null, function* () {
|
|
1257
|
+
return "";
|
|
1258
|
+
}),
|
|
1259
|
+
getInscriptions: () => __async222222(void 0, null, function* () {
|
|
1260
|
+
return [];
|
|
1261
|
+
}),
|
|
1262
|
+
sendBTC: (to, amount) => __async222222(void 0, null, function* () {
|
|
1263
|
+
return "";
|
|
1264
|
+
}),
|
|
1265
|
+
signMessage: (message) => __async222222(void 0, null, function* () {
|
|
1266
|
+
return "";
|
|
1267
|
+
}),
|
|
1268
|
+
signPsbt: (tx) => __async222222(void 0, null, function* () {
|
|
1269
|
+
return {
|
|
1270
|
+
signedPsbtHex: "",
|
|
1271
|
+
signedPsbtBase64: "",
|
|
1272
|
+
txId: ""
|
|
1273
|
+
};
|
|
1274
|
+
}),
|
|
1275
|
+
pushPsbt: (tx) => __async222222(void 0, null, function* () {
|
|
1276
|
+
return "";
|
|
1277
|
+
}),
|
|
1278
|
+
inscribe: (content) => __async222222(void 0, null, function* () {
|
|
1279
|
+
return "";
|
|
1280
|
+
}),
|
|
1281
|
+
isCreatingCommit: false,
|
|
1282
|
+
isInscribing: false
|
|
1283
|
+
};
|
|
1284
|
+
bitcoin2222222.initEccLib(ecc2222222);
|
|
1285
|
+
var __async2222222 = (__this, __arguments, generator) => {
|
|
1286
|
+
return new Promise((resolve, reject) => {
|
|
1287
|
+
var fulfilled = (value) => {
|
|
1288
|
+
try {
|
|
1289
|
+
step(generator.next(value));
|
|
1290
|
+
} catch (e) {
|
|
1291
|
+
reject(e);
|
|
1292
|
+
}
|
|
1293
|
+
};
|
|
1294
|
+
var rejected = (value) => {
|
|
1295
|
+
try {
|
|
1296
|
+
step(generator.throw(value));
|
|
1297
|
+
} catch (e) {
|
|
1298
|
+
reject(e);
|
|
1299
|
+
}
|
|
1300
|
+
};
|
|
1301
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1302
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1303
|
+
});
|
|
1304
|
+
};
|
|
1305
|
+
var MAINNET42222222 = "mainnet";
|
|
1306
|
+
var initialWalletContext22222222 = {
|
|
1307
|
+
hasUnisat: false,
|
|
1308
|
+
hasXverse: false,
|
|
1309
|
+
hasOyl: false,
|
|
1310
|
+
hasMagicEden: false,
|
|
1311
|
+
hasOkx: false,
|
|
1312
|
+
hasLeather: false,
|
|
1313
|
+
hasPhantom: false,
|
|
1314
|
+
hasWizz: false,
|
|
1315
|
+
isInitializing: true,
|
|
1316
|
+
connected: false,
|
|
1317
|
+
isConnecting: false,
|
|
1318
|
+
publicKey: "",
|
|
1319
|
+
address: "",
|
|
1320
|
+
paymentAddress: "",
|
|
1321
|
+
paymentPublicKey: "",
|
|
1322
|
+
balance: void 0,
|
|
1323
|
+
network: MAINNET42222222,
|
|
1324
|
+
library: null,
|
|
1325
|
+
provider: null,
|
|
1326
|
+
accounts: [],
|
|
1327
|
+
connect: (walletName) => __async2222222(void 0, null, function* () {
|
|
1328
|
+
}),
|
|
1329
|
+
disconnect: () => {
|
|
1330
|
+
},
|
|
1331
|
+
requestAccounts: () => __async2222222(void 0, null, function* () {
|
|
1332
|
+
return [];
|
|
1333
|
+
}),
|
|
1334
|
+
getNetwork: () => __async2222222(void 0, null, function* () {
|
|
1335
|
+
return MAINNET42222222;
|
|
1336
|
+
}),
|
|
1337
|
+
switchNetwork: (network) => __async2222222(void 0, null, function* () {
|
|
1338
|
+
}),
|
|
1339
|
+
getPublicKey: () => __async2222222(void 0, null, function* () {
|
|
1340
|
+
return "";
|
|
1341
|
+
}),
|
|
1342
|
+
getBalance: () => __async2222222(void 0, null, function* () {
|
|
1343
|
+
return "";
|
|
1344
|
+
}),
|
|
1345
|
+
getInscriptions: () => __async2222222(void 0, null, function* () {
|
|
1346
|
+
return [];
|
|
1347
|
+
}),
|
|
1348
|
+
sendBTC: (to, amount) => __async2222222(void 0, null, function* () {
|
|
1349
|
+
return "";
|
|
1350
|
+
}),
|
|
1351
|
+
signMessage: (message) => __async2222222(void 0, null, function* () {
|
|
1352
|
+
return "";
|
|
1353
|
+
}),
|
|
1354
|
+
signPsbt: (tx) => __async2222222(void 0, null, function* () {
|
|
1355
|
+
return {
|
|
1356
|
+
signedPsbtHex: "",
|
|
1357
|
+
signedPsbtBase64: "",
|
|
1358
|
+
txId: ""
|
|
1359
|
+
};
|
|
1360
|
+
}),
|
|
1361
|
+
pushPsbt: (tx) => __async2222222(void 0, null, function* () {
|
|
1362
|
+
return "";
|
|
1363
|
+
}),
|
|
1364
|
+
inscribe: (content) => __async2222222(void 0, null, function* () {
|
|
1365
|
+
return "";
|
|
1366
|
+
}),
|
|
1367
|
+
isCreatingCommit: false,
|
|
1368
|
+
isInscribing: false
|
|
1369
|
+
};
|
|
1370
|
+
bitcoin22222222.initEccLib(ecc22222222);
|
|
1371
|
+
var __async22222222 = (__this, __arguments, generator) => {
|
|
1372
|
+
return new Promise((resolve, reject) => {
|
|
1373
|
+
var fulfilled = (value) => {
|
|
1374
|
+
try {
|
|
1375
|
+
step(generator.next(value));
|
|
1376
|
+
} catch (e) {
|
|
1377
|
+
reject(e);
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
var rejected = (value) => {
|
|
1381
|
+
try {
|
|
1382
|
+
step(generator.throw(value));
|
|
1383
|
+
} catch (e) {
|
|
1384
|
+
reject(e);
|
|
1385
|
+
}
|
|
1386
|
+
};
|
|
1387
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1388
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1389
|
+
});
|
|
1390
|
+
};
|
|
1391
|
+
var MAINNET422222222 = "mainnet";
|
|
1392
|
+
var initialWalletContext222222222 = {
|
|
1393
|
+
hasUnisat: false,
|
|
1394
|
+
hasXverse: false,
|
|
1395
|
+
hasOyl: false,
|
|
1396
|
+
hasMagicEden: false,
|
|
1397
|
+
hasOkx: false,
|
|
1398
|
+
hasLeather: false,
|
|
1399
|
+
hasPhantom: false,
|
|
1400
|
+
hasWizz: false,
|
|
1401
|
+
isInitializing: true,
|
|
1402
|
+
connected: false,
|
|
1403
|
+
isConnecting: false,
|
|
1404
|
+
publicKey: "",
|
|
1405
|
+
address: "",
|
|
1406
|
+
paymentAddress: "",
|
|
1407
|
+
paymentPublicKey: "",
|
|
1408
|
+
balance: void 0,
|
|
1409
|
+
network: MAINNET422222222,
|
|
1410
|
+
library: null,
|
|
1411
|
+
provider: null,
|
|
1412
|
+
accounts: [],
|
|
1413
|
+
connect: (walletName) => __async22222222(void 0, null, function* () {
|
|
1414
|
+
}),
|
|
1415
|
+
disconnect: () => {
|
|
1416
|
+
},
|
|
1417
|
+
requestAccounts: () => __async22222222(void 0, null, function* () {
|
|
1418
|
+
return [];
|
|
1419
|
+
}),
|
|
1420
|
+
getNetwork: () => __async22222222(void 0, null, function* () {
|
|
1421
|
+
return MAINNET422222222;
|
|
1422
|
+
}),
|
|
1423
|
+
switchNetwork: (network) => __async22222222(void 0, null, function* () {
|
|
1424
|
+
}),
|
|
1425
|
+
getPublicKey: () => __async22222222(void 0, null, function* () {
|
|
1426
|
+
return "";
|
|
1427
|
+
}),
|
|
1428
|
+
getBalance: () => __async22222222(void 0, null, function* () {
|
|
1429
|
+
return "";
|
|
1430
|
+
}),
|
|
1431
|
+
getInscriptions: () => __async22222222(void 0, null, function* () {
|
|
1432
|
+
return [];
|
|
1433
|
+
}),
|
|
1434
|
+
sendBTC: (to, amount) => __async22222222(void 0, null, function* () {
|
|
1435
|
+
return "";
|
|
1436
|
+
}),
|
|
1437
|
+
signMessage: (message) => __async22222222(void 0, null, function* () {
|
|
1438
|
+
return "";
|
|
1439
|
+
}),
|
|
1440
|
+
signPsbt: (tx) => __async22222222(void 0, null, function* () {
|
|
1441
|
+
return {
|
|
1442
|
+
signedPsbtHex: "",
|
|
1443
|
+
signedPsbtBase64: "",
|
|
1444
|
+
txId: ""
|
|
1445
|
+
};
|
|
1446
|
+
}),
|
|
1447
|
+
pushPsbt: (tx) => __async22222222(void 0, null, function* () {
|
|
1448
|
+
return "";
|
|
1449
|
+
}),
|
|
1450
|
+
inscribe: (content) => __async22222222(void 0, null, function* () {
|
|
1451
|
+
return "";
|
|
1452
|
+
}),
|
|
1453
|
+
isCreatingCommit: false,
|
|
1454
|
+
isInscribing: false
|
|
1455
|
+
};
|
|
1456
|
+
bitcoin222222222.initEccLib(ecc222222222);
|
|
1457
|
+
var __async222222222 = (__this, __arguments, generator) => {
|
|
1458
|
+
return new Promise((resolve, reject) => {
|
|
1459
|
+
var fulfilled = (value) => {
|
|
1460
|
+
try {
|
|
1461
|
+
step(generator.next(value));
|
|
1462
|
+
} catch (e) {
|
|
1463
|
+
reject(e);
|
|
1464
|
+
}
|
|
1465
|
+
};
|
|
1466
|
+
var rejected = (value) => {
|
|
1467
|
+
try {
|
|
1468
|
+
step(generator.throw(value));
|
|
1469
|
+
} catch (e) {
|
|
1470
|
+
reject(e);
|
|
1471
|
+
}
|
|
1472
|
+
};
|
|
1473
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1474
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1475
|
+
});
|
|
1476
|
+
};
|
|
1477
|
+
var MAINNET4222222222 = "mainnet";
|
|
1478
|
+
var initialWalletContext2222222222 = {
|
|
1479
|
+
hasUnisat: false,
|
|
1480
|
+
hasXverse: false,
|
|
1481
|
+
hasOyl: false,
|
|
1482
|
+
hasMagicEden: false,
|
|
1483
|
+
hasOkx: false,
|
|
1484
|
+
hasLeather: false,
|
|
1485
|
+
hasPhantom: false,
|
|
1486
|
+
hasWizz: false,
|
|
1487
|
+
isInitializing: true,
|
|
1488
|
+
connected: false,
|
|
1489
|
+
isConnecting: false,
|
|
1490
|
+
publicKey: "",
|
|
1491
|
+
address: "",
|
|
1492
|
+
paymentAddress: "",
|
|
1493
|
+
paymentPublicKey: "",
|
|
1494
|
+
balance: void 0,
|
|
1495
|
+
network: MAINNET4222222222,
|
|
1496
|
+
library: null,
|
|
1497
|
+
provider: null,
|
|
1498
|
+
accounts: [],
|
|
1499
|
+
connect: (walletName) => __async222222222(void 0, null, function* () {
|
|
1500
|
+
}),
|
|
1501
|
+
disconnect: () => {
|
|
1502
|
+
},
|
|
1503
|
+
requestAccounts: () => __async222222222(void 0, null, function* () {
|
|
1504
|
+
return [];
|
|
1505
|
+
}),
|
|
1506
|
+
getNetwork: () => __async222222222(void 0, null, function* () {
|
|
1507
|
+
return MAINNET4222222222;
|
|
1508
|
+
}),
|
|
1509
|
+
switchNetwork: (network) => __async222222222(void 0, null, function* () {
|
|
1510
|
+
}),
|
|
1511
|
+
getPublicKey: () => __async222222222(void 0, null, function* () {
|
|
1512
|
+
return "";
|
|
1513
|
+
}),
|
|
1514
|
+
getBalance: () => __async222222222(void 0, null, function* () {
|
|
1515
|
+
return "";
|
|
1516
|
+
}),
|
|
1517
|
+
getInscriptions: () => __async222222222(void 0, null, function* () {
|
|
1518
|
+
return [];
|
|
1519
|
+
}),
|
|
1520
|
+
sendBTC: (to, amount) => __async222222222(void 0, null, function* () {
|
|
1521
|
+
return "";
|
|
1522
|
+
}),
|
|
1523
|
+
signMessage: (message) => __async222222222(void 0, null, function* () {
|
|
1524
|
+
return "";
|
|
1525
|
+
}),
|
|
1526
|
+
signPsbt: (tx) => __async222222222(void 0, null, function* () {
|
|
1527
|
+
return {
|
|
1528
|
+
signedPsbtHex: "",
|
|
1529
|
+
signedPsbtBase64: "",
|
|
1530
|
+
txId: ""
|
|
1531
|
+
};
|
|
1532
|
+
}),
|
|
1533
|
+
pushPsbt: (tx) => __async222222222(void 0, null, function* () {
|
|
1534
|
+
return "";
|
|
1535
|
+
}),
|
|
1536
|
+
inscribe: (content) => __async222222222(void 0, null, function* () {
|
|
1537
|
+
return "";
|
|
1538
|
+
}),
|
|
1539
|
+
isCreatingCommit: false,
|
|
1540
|
+
isInscribing: false
|
|
1541
|
+
};
|
|
1542
|
+
bitcoin2222222222.initEccLib(ecc2222222222);
|
|
1543
|
+
var __async2222222222 = (__this, __arguments, generator) => {
|
|
1544
|
+
return new Promise((resolve, reject) => {
|
|
1545
|
+
var fulfilled = (value) => {
|
|
1546
|
+
try {
|
|
1547
|
+
step(generator.next(value));
|
|
1548
|
+
} catch (e) {
|
|
1549
|
+
reject(e);
|
|
1550
|
+
}
|
|
1551
|
+
};
|
|
1552
|
+
var rejected = (value) => {
|
|
1553
|
+
try {
|
|
1554
|
+
step(generator.throw(value));
|
|
1555
|
+
} catch (e) {
|
|
1556
|
+
reject(e);
|
|
1557
|
+
}
|
|
1558
|
+
};
|
|
1559
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1560
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1561
|
+
});
|
|
1562
|
+
};
|
|
1563
|
+
var MAINNET42222222222 = "mainnet";
|
|
1564
|
+
var initialWalletContext22222222222 = {
|
|
1565
|
+
hasUnisat: false,
|
|
1566
|
+
hasXverse: false,
|
|
1567
|
+
hasOyl: false,
|
|
1568
|
+
hasMagicEden: false,
|
|
1569
|
+
hasOkx: false,
|
|
1570
|
+
hasLeather: false,
|
|
1571
|
+
hasPhantom: false,
|
|
1572
|
+
hasWizz: false,
|
|
1573
|
+
isInitializing: true,
|
|
1574
|
+
connected: false,
|
|
1575
|
+
isConnecting: false,
|
|
1576
|
+
publicKey: "",
|
|
1577
|
+
address: "",
|
|
1578
|
+
paymentAddress: "",
|
|
1579
|
+
paymentPublicKey: "",
|
|
1580
|
+
balance: void 0,
|
|
1581
|
+
network: MAINNET42222222222,
|
|
1582
|
+
library: null,
|
|
1583
|
+
provider: null,
|
|
1584
|
+
accounts: [],
|
|
1585
|
+
connect: (walletName) => __async2222222222(void 0, null, function* () {
|
|
1586
|
+
}),
|
|
1587
|
+
disconnect: () => {
|
|
1588
|
+
},
|
|
1589
|
+
requestAccounts: () => __async2222222222(void 0, null, function* () {
|
|
1590
|
+
return [];
|
|
1591
|
+
}),
|
|
1592
|
+
getNetwork: () => __async2222222222(void 0, null, function* () {
|
|
1593
|
+
return MAINNET42222222222;
|
|
1594
|
+
}),
|
|
1595
|
+
switchNetwork: (network) => __async2222222222(void 0, null, function* () {
|
|
1596
|
+
}),
|
|
1597
|
+
getPublicKey: () => __async2222222222(void 0, null, function* () {
|
|
1598
|
+
return "";
|
|
1599
|
+
}),
|
|
1600
|
+
getBalance: () => __async2222222222(void 0, null, function* () {
|
|
1601
|
+
return "";
|
|
1602
|
+
}),
|
|
1603
|
+
getInscriptions: () => __async2222222222(void 0, null, function* () {
|
|
1604
|
+
return [];
|
|
1605
|
+
}),
|
|
1606
|
+
sendBTC: (to, amount) => __async2222222222(void 0, null, function* () {
|
|
1607
|
+
return "";
|
|
1608
|
+
}),
|
|
1609
|
+
signMessage: (message) => __async2222222222(void 0, null, function* () {
|
|
1610
|
+
return "";
|
|
1611
|
+
}),
|
|
1612
|
+
signPsbt: (tx) => __async2222222222(void 0, null, function* () {
|
|
1613
|
+
return {
|
|
1614
|
+
signedPsbtHex: "",
|
|
1615
|
+
signedPsbtBase64: "",
|
|
1616
|
+
txId: ""
|
|
1617
|
+
};
|
|
1618
|
+
}),
|
|
1619
|
+
pushPsbt: (tx) => __async2222222222(void 0, null, function* () {
|
|
1620
|
+
return "";
|
|
1621
|
+
}),
|
|
1622
|
+
inscribe: (content) => __async2222222222(void 0, null, function* () {
|
|
1623
|
+
return "";
|
|
1624
|
+
}),
|
|
1625
|
+
isCreatingCommit: false,
|
|
1626
|
+
isInscribing: false
|
|
1627
|
+
};
|
|
1628
|
+
bitcoin22222222222.initEccLib(ecc22222222222);
|
|
1629
|
+
var __async22222222222 = (__this, __arguments, generator) => {
|
|
1630
|
+
return new Promise((resolve, reject) => {
|
|
1631
|
+
var fulfilled = (value) => {
|
|
1632
|
+
try {
|
|
1633
|
+
step(generator.next(value));
|
|
1634
|
+
} catch (e) {
|
|
1635
|
+
reject(e);
|
|
1636
|
+
}
|
|
1637
|
+
};
|
|
1638
|
+
var rejected = (value) => {
|
|
1639
|
+
try {
|
|
1640
|
+
step(generator.throw(value));
|
|
1641
|
+
} catch (e) {
|
|
1642
|
+
reject(e);
|
|
1643
|
+
}
|
|
1644
|
+
};
|
|
1645
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1646
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1647
|
+
});
|
|
1648
|
+
};
|
|
1649
|
+
var MAINNET422222222222 = "mainnet";
|
|
1650
|
+
var initialWalletContext222222222222 = {
|
|
1651
|
+
hasUnisat: false,
|
|
1652
|
+
hasXverse: false,
|
|
1653
|
+
hasOyl: false,
|
|
1654
|
+
hasMagicEden: false,
|
|
1655
|
+
hasOkx: false,
|
|
1656
|
+
hasLeather: false,
|
|
1657
|
+
hasPhantom: false,
|
|
1658
|
+
hasWizz: false,
|
|
1659
|
+
isInitializing: true,
|
|
1660
|
+
connected: false,
|
|
1661
|
+
isConnecting: false,
|
|
1662
|
+
publicKey: "",
|
|
1663
|
+
address: "",
|
|
1664
|
+
paymentAddress: "",
|
|
1665
|
+
paymentPublicKey: "",
|
|
1666
|
+
balance: void 0,
|
|
1667
|
+
network: MAINNET422222222222,
|
|
1668
|
+
library: null,
|
|
1669
|
+
provider: null,
|
|
1670
|
+
accounts: [],
|
|
1671
|
+
connect: (walletName) => __async22222222222(void 0, null, function* () {
|
|
1672
|
+
}),
|
|
1673
|
+
disconnect: () => {
|
|
1674
|
+
},
|
|
1675
|
+
requestAccounts: () => __async22222222222(void 0, null, function* () {
|
|
1676
|
+
return [];
|
|
1677
|
+
}),
|
|
1678
|
+
getNetwork: () => __async22222222222(void 0, null, function* () {
|
|
1679
|
+
return MAINNET422222222222;
|
|
1680
|
+
}),
|
|
1681
|
+
switchNetwork: (network) => __async22222222222(void 0, null, function* () {
|
|
1682
|
+
}),
|
|
1683
|
+
getPublicKey: () => __async22222222222(void 0, null, function* () {
|
|
1684
|
+
return "";
|
|
1685
|
+
}),
|
|
1686
|
+
getBalance: () => __async22222222222(void 0, null, function* () {
|
|
1687
|
+
return "";
|
|
1688
|
+
}),
|
|
1689
|
+
getInscriptions: () => __async22222222222(void 0, null, function* () {
|
|
1690
|
+
return [];
|
|
1691
|
+
}),
|
|
1692
|
+
sendBTC: (to, amount) => __async22222222222(void 0, null, function* () {
|
|
1693
|
+
return "";
|
|
1694
|
+
}),
|
|
1695
|
+
signMessage: (message) => __async22222222222(void 0, null, function* () {
|
|
1696
|
+
return "";
|
|
1697
|
+
}),
|
|
1698
|
+
signPsbt: (tx) => __async22222222222(void 0, null, function* () {
|
|
1699
|
+
return {
|
|
1700
|
+
signedPsbtHex: "",
|
|
1701
|
+
signedPsbtBase64: "",
|
|
1702
|
+
txId: ""
|
|
1703
|
+
};
|
|
1704
|
+
}),
|
|
1705
|
+
pushPsbt: (tx) => __async22222222222(void 0, null, function* () {
|
|
1706
|
+
return "";
|
|
1707
|
+
}),
|
|
1708
|
+
inscribe: (content) => __async22222222222(void 0, null, function* () {
|
|
1709
|
+
return "";
|
|
1710
|
+
}),
|
|
1711
|
+
isCreatingCommit: false,
|
|
1712
|
+
isInscribing: false
|
|
1713
|
+
};
|
|
1714
|
+
bitcoin222222222222.initEccLib(ecc222222222222);
|
|
1715
|
+
var __async222222222222 = (__this, __arguments, generator) => {
|
|
1716
|
+
return new Promise((resolve, reject) => {
|
|
1717
|
+
var fulfilled = (value) => {
|
|
1718
|
+
try {
|
|
1719
|
+
step(generator.next(value));
|
|
1720
|
+
} catch (e) {
|
|
1721
|
+
reject(e);
|
|
1722
|
+
}
|
|
1723
|
+
};
|
|
1724
|
+
var rejected = (value) => {
|
|
1725
|
+
try {
|
|
1726
|
+
step(generator.throw(value));
|
|
1727
|
+
} catch (e) {
|
|
1728
|
+
reject(e);
|
|
1729
|
+
}
|
|
1730
|
+
};
|
|
1731
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1732
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1733
|
+
});
|
|
1734
|
+
};
|
|
1735
|
+
var MAINNET4222222222222 = "mainnet";
|
|
1736
|
+
var initialWalletContext2222222222222 = {
|
|
1737
|
+
hasUnisat: false,
|
|
1738
|
+
hasXverse: false,
|
|
1739
|
+
hasOyl: false,
|
|
1740
|
+
hasMagicEden: false,
|
|
1741
|
+
hasOkx: false,
|
|
1742
|
+
hasLeather: false,
|
|
1743
|
+
hasPhantom: false,
|
|
1744
|
+
hasWizz: false,
|
|
1745
|
+
isInitializing: true,
|
|
1746
|
+
connected: false,
|
|
1747
|
+
isConnecting: false,
|
|
1748
|
+
publicKey: "",
|
|
1749
|
+
address: "",
|
|
1750
|
+
paymentAddress: "",
|
|
1751
|
+
paymentPublicKey: "",
|
|
1752
|
+
balance: void 0,
|
|
1753
|
+
network: MAINNET4222222222222,
|
|
1754
|
+
library: null,
|
|
1755
|
+
provider: null,
|
|
1756
|
+
accounts: [],
|
|
1757
|
+
connect: (walletName) => __async222222222222(void 0, null, function* () {
|
|
1758
|
+
}),
|
|
1759
|
+
disconnect: () => {
|
|
1760
|
+
},
|
|
1761
|
+
requestAccounts: () => __async222222222222(void 0, null, function* () {
|
|
1762
|
+
return [];
|
|
1763
|
+
}),
|
|
1764
|
+
getNetwork: () => __async222222222222(void 0, null, function* () {
|
|
1765
|
+
return MAINNET4222222222222;
|
|
1766
|
+
}),
|
|
1767
|
+
switchNetwork: (network) => __async222222222222(void 0, null, function* () {
|
|
1768
|
+
}),
|
|
1769
|
+
getPublicKey: () => __async222222222222(void 0, null, function* () {
|
|
1770
|
+
return "";
|
|
1771
|
+
}),
|
|
1772
|
+
getBalance: () => __async222222222222(void 0, null, function* () {
|
|
1773
|
+
return "";
|
|
1774
|
+
}),
|
|
1775
|
+
getInscriptions: () => __async222222222222(void 0, null, function* () {
|
|
1776
|
+
return [];
|
|
1777
|
+
}),
|
|
1778
|
+
sendBTC: (to, amount) => __async222222222222(void 0, null, function* () {
|
|
1779
|
+
return "";
|
|
1780
|
+
}),
|
|
1781
|
+
signMessage: (message) => __async222222222222(void 0, null, function* () {
|
|
1782
|
+
return "";
|
|
1783
|
+
}),
|
|
1784
|
+
signPsbt: (tx) => __async222222222222(void 0, null, function* () {
|
|
1785
|
+
return {
|
|
1786
|
+
signedPsbtHex: "",
|
|
1787
|
+
signedPsbtBase64: "",
|
|
1788
|
+
txId: ""
|
|
1789
|
+
};
|
|
1790
|
+
}),
|
|
1791
|
+
pushPsbt: (tx) => __async222222222222(void 0, null, function* () {
|
|
1792
|
+
return "";
|
|
1793
|
+
}),
|
|
1794
|
+
inscribe: (content) => __async222222222222(void 0, null, function* () {
|
|
1795
|
+
return "";
|
|
1796
|
+
}),
|
|
1797
|
+
isCreatingCommit: false,
|
|
1798
|
+
isInscribing: false
|
|
1799
|
+
};
|
|
1800
|
+
bitcoin2222222222222.initEccLib(ecc2222222222222);
|
|
1801
|
+
var __async2222222222222 = (__this, __arguments, generator) => {
|
|
1802
|
+
return new Promise((resolve, reject) => {
|
|
1803
|
+
var fulfilled = (value) => {
|
|
1804
|
+
try {
|
|
1805
|
+
step(generator.next(value));
|
|
1806
|
+
} catch (e) {
|
|
1807
|
+
reject(e);
|
|
1808
|
+
}
|
|
1809
|
+
};
|
|
1810
|
+
var rejected = (value) => {
|
|
1811
|
+
try {
|
|
1812
|
+
step(generator.throw(value));
|
|
1813
|
+
} catch (e) {
|
|
1814
|
+
reject(e);
|
|
1815
|
+
}
|
|
1816
|
+
};
|
|
1817
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1818
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1819
|
+
});
|
|
1820
|
+
};
|
|
1821
|
+
var MAINNET42222222222222 = "mainnet";
|
|
1822
|
+
var initialWalletContext22222222222222 = {
|
|
1823
|
+
hasUnisat: false,
|
|
1824
|
+
hasXverse: false,
|
|
1825
|
+
hasOyl: false,
|
|
1826
|
+
hasMagicEden: false,
|
|
1827
|
+
hasOkx: false,
|
|
1828
|
+
hasLeather: false,
|
|
1829
|
+
hasPhantom: false,
|
|
1830
|
+
hasWizz: false,
|
|
1831
|
+
isInitializing: true,
|
|
1832
|
+
connected: false,
|
|
1833
|
+
isConnecting: false,
|
|
1834
|
+
publicKey: "",
|
|
1835
|
+
address: "",
|
|
1836
|
+
paymentAddress: "",
|
|
1837
|
+
paymentPublicKey: "",
|
|
1838
|
+
balance: void 0,
|
|
1839
|
+
network: MAINNET42222222222222,
|
|
1840
|
+
library: null,
|
|
1841
|
+
provider: null,
|
|
1842
|
+
accounts: [],
|
|
1843
|
+
connect: (walletName) => __async2222222222222(void 0, null, function* () {
|
|
1844
|
+
}),
|
|
1845
|
+
disconnect: () => {
|
|
1846
|
+
},
|
|
1847
|
+
requestAccounts: () => __async2222222222222(void 0, null, function* () {
|
|
1848
|
+
return [];
|
|
1849
|
+
}),
|
|
1850
|
+
getNetwork: () => __async2222222222222(void 0, null, function* () {
|
|
1851
|
+
return MAINNET42222222222222;
|
|
1852
|
+
}),
|
|
1853
|
+
switchNetwork: (network) => __async2222222222222(void 0, null, function* () {
|
|
1854
|
+
}),
|
|
1855
|
+
getPublicKey: () => __async2222222222222(void 0, null, function* () {
|
|
1856
|
+
return "";
|
|
1857
|
+
}),
|
|
1858
|
+
getBalance: () => __async2222222222222(void 0, null, function* () {
|
|
1859
|
+
return "";
|
|
1860
|
+
}),
|
|
1861
|
+
getInscriptions: () => __async2222222222222(void 0, null, function* () {
|
|
1862
|
+
return [];
|
|
1863
|
+
}),
|
|
1864
|
+
sendBTC: (to, amount) => __async2222222222222(void 0, null, function* () {
|
|
1865
|
+
return "";
|
|
1866
|
+
}),
|
|
1867
|
+
signMessage: (message) => __async2222222222222(void 0, null, function* () {
|
|
1868
|
+
return "";
|
|
1869
|
+
}),
|
|
1870
|
+
signPsbt: (tx) => __async2222222222222(void 0, null, function* () {
|
|
1871
|
+
return {
|
|
1872
|
+
signedPsbtHex: "",
|
|
1873
|
+
signedPsbtBase64: "",
|
|
1874
|
+
txId: ""
|
|
1875
|
+
};
|
|
1876
|
+
}),
|
|
1877
|
+
pushPsbt: (tx) => __async2222222222222(void 0, null, function* () {
|
|
1878
|
+
return "";
|
|
1879
|
+
}),
|
|
1880
|
+
inscribe: (content) => __async2222222222222(void 0, null, function* () {
|
|
1881
|
+
return "";
|
|
1882
|
+
}),
|
|
1883
|
+
isCreatingCommit: false,
|
|
1884
|
+
isInscribing: false
|
|
1885
|
+
};
|
|
1886
|
+
bitcoin22222222222222.initEccLib(ecc22222222222222);
|
|
1887
|
+
var __async22222222222222 = (__this, __arguments, generator) => {
|
|
1888
|
+
return new Promise((resolve, reject) => {
|
|
1889
|
+
var fulfilled = (value) => {
|
|
1890
|
+
try {
|
|
1891
|
+
step(generator.next(value));
|
|
1892
|
+
} catch (e) {
|
|
1893
|
+
reject(e);
|
|
1894
|
+
}
|
|
1895
|
+
};
|
|
1896
|
+
var rejected = (value) => {
|
|
1897
|
+
try {
|
|
1898
|
+
step(generator.throw(value));
|
|
1899
|
+
} catch (e) {
|
|
1900
|
+
reject(e);
|
|
1901
|
+
}
|
|
1902
|
+
};
|
|
1903
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1904
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1905
|
+
});
|
|
1906
|
+
};
|
|
1907
|
+
var MAINNET422222222222222 = "mainnet";
|
|
1908
|
+
var initialWalletContext222222222222222 = {
|
|
1909
|
+
hasUnisat: false,
|
|
1910
|
+
hasXverse: false,
|
|
1911
|
+
hasOyl: false,
|
|
1912
|
+
hasMagicEden: false,
|
|
1913
|
+
hasOkx: false,
|
|
1914
|
+
hasLeather: false,
|
|
1915
|
+
hasPhantom: false,
|
|
1916
|
+
hasWizz: false,
|
|
1917
|
+
isInitializing: true,
|
|
1918
|
+
connected: false,
|
|
1919
|
+
isConnecting: false,
|
|
1920
|
+
publicKey: "",
|
|
1921
|
+
address: "",
|
|
1922
|
+
paymentAddress: "",
|
|
1923
|
+
paymentPublicKey: "",
|
|
1924
|
+
balance: void 0,
|
|
1925
|
+
network: MAINNET422222222222222,
|
|
1926
|
+
library: null,
|
|
1927
|
+
provider: null,
|
|
1928
|
+
accounts: [],
|
|
1929
|
+
connect: (walletName) => __async22222222222222(void 0, null, function* () {
|
|
1930
|
+
}),
|
|
1931
|
+
disconnect: () => {
|
|
1932
|
+
},
|
|
1933
|
+
requestAccounts: () => __async22222222222222(void 0, null, function* () {
|
|
1934
|
+
return [];
|
|
1935
|
+
}),
|
|
1936
|
+
getNetwork: () => __async22222222222222(void 0, null, function* () {
|
|
1937
|
+
return MAINNET422222222222222;
|
|
1938
|
+
}),
|
|
1939
|
+
switchNetwork: (network) => __async22222222222222(void 0, null, function* () {
|
|
1940
|
+
}),
|
|
1941
|
+
getPublicKey: () => __async22222222222222(void 0, null, function* () {
|
|
1942
|
+
return "";
|
|
1943
|
+
}),
|
|
1944
|
+
getBalance: () => __async22222222222222(void 0, null, function* () {
|
|
1945
|
+
return "";
|
|
1946
|
+
}),
|
|
1947
|
+
getInscriptions: () => __async22222222222222(void 0, null, function* () {
|
|
1948
|
+
return [];
|
|
1949
|
+
}),
|
|
1950
|
+
sendBTC: (to, amount) => __async22222222222222(void 0, null, function* () {
|
|
1951
|
+
return "";
|
|
1952
|
+
}),
|
|
1953
|
+
signMessage: (message) => __async22222222222222(void 0, null, function* () {
|
|
1954
|
+
return "";
|
|
1955
|
+
}),
|
|
1956
|
+
signPsbt: (tx) => __async22222222222222(void 0, null, function* () {
|
|
1957
|
+
return {
|
|
1958
|
+
signedPsbtHex: "",
|
|
1959
|
+
signedPsbtBase64: "",
|
|
1960
|
+
txId: ""
|
|
1961
|
+
};
|
|
1962
|
+
}),
|
|
1963
|
+
pushPsbt: (tx) => __async22222222222222(void 0, null, function* () {
|
|
1964
|
+
return "";
|
|
1965
|
+
}),
|
|
1966
|
+
inscribe: (content) => __async22222222222222(void 0, null, function* () {
|
|
1967
|
+
return "";
|
|
1968
|
+
}),
|
|
1969
|
+
isCreatingCommit: false,
|
|
1970
|
+
isInscribing: false
|
|
1971
|
+
};
|
|
1972
|
+
bitcoin222222222222222.initEccLib(ecc222222222222222);
|
|
1973
|
+
var __async222222222222222 = (__this, __arguments, generator) => {
|
|
1974
|
+
return new Promise((resolve, reject) => {
|
|
1975
|
+
var fulfilled = (value) => {
|
|
1976
|
+
try {
|
|
1977
|
+
step(generator.next(value));
|
|
1978
|
+
} catch (e) {
|
|
1979
|
+
reject(e);
|
|
1980
|
+
}
|
|
1981
|
+
};
|
|
1982
|
+
var rejected = (value) => {
|
|
1983
|
+
try {
|
|
1984
|
+
step(generator.throw(value));
|
|
1985
|
+
} catch (e) {
|
|
1986
|
+
reject(e);
|
|
1987
|
+
}
|
|
1988
|
+
};
|
|
1989
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1990
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1991
|
+
});
|
|
1992
|
+
};
|
|
1993
|
+
var MAINNET4222222222222222 = "mainnet";
|
|
1994
|
+
var initialWalletContext2222222222222222 = {
|
|
1995
|
+
hasUnisat: false,
|
|
1996
|
+
hasXverse: false,
|
|
1997
|
+
hasOyl: false,
|
|
1998
|
+
hasMagicEden: false,
|
|
1999
|
+
hasOkx: false,
|
|
2000
|
+
hasLeather: false,
|
|
2001
|
+
hasPhantom: false,
|
|
2002
|
+
hasWizz: false,
|
|
2003
|
+
isInitializing: true,
|
|
2004
|
+
connected: false,
|
|
2005
|
+
isConnecting: false,
|
|
2006
|
+
publicKey: "",
|
|
2007
|
+
address: "",
|
|
2008
|
+
paymentAddress: "",
|
|
2009
|
+
paymentPublicKey: "",
|
|
2010
|
+
balance: void 0,
|
|
2011
|
+
network: MAINNET4222222222222222,
|
|
2012
|
+
library: null,
|
|
2013
|
+
provider: null,
|
|
2014
|
+
accounts: [],
|
|
2015
|
+
connect: (walletName) => __async222222222222222(void 0, null, function* () {
|
|
2016
|
+
}),
|
|
2017
|
+
disconnect: () => {
|
|
2018
|
+
},
|
|
2019
|
+
requestAccounts: () => __async222222222222222(void 0, null, function* () {
|
|
2020
|
+
return [];
|
|
2021
|
+
}),
|
|
2022
|
+
getNetwork: () => __async222222222222222(void 0, null, function* () {
|
|
2023
|
+
return MAINNET4222222222222222;
|
|
2024
|
+
}),
|
|
2025
|
+
switchNetwork: (network) => __async222222222222222(void 0, null, function* () {
|
|
2026
|
+
}),
|
|
2027
|
+
getPublicKey: () => __async222222222222222(void 0, null, function* () {
|
|
2028
|
+
return "";
|
|
2029
|
+
}),
|
|
2030
|
+
getBalance: () => __async222222222222222(void 0, null, function* () {
|
|
2031
|
+
return "";
|
|
2032
|
+
}),
|
|
2033
|
+
getInscriptions: () => __async222222222222222(void 0, null, function* () {
|
|
2034
|
+
return [];
|
|
2035
|
+
}),
|
|
2036
|
+
sendBTC: (to, amount) => __async222222222222222(void 0, null, function* () {
|
|
2037
|
+
return "";
|
|
2038
|
+
}),
|
|
2039
|
+
signMessage: (message) => __async222222222222222(void 0, null, function* () {
|
|
2040
|
+
return "";
|
|
2041
|
+
}),
|
|
2042
|
+
signPsbt: (tx) => __async222222222222222(void 0, null, function* () {
|
|
2043
|
+
return {
|
|
2044
|
+
signedPsbtHex: "",
|
|
2045
|
+
signedPsbtBase64: "",
|
|
2046
|
+
txId: ""
|
|
2047
|
+
};
|
|
2048
|
+
}),
|
|
2049
|
+
pushPsbt: (tx) => __async222222222222222(void 0, null, function* () {
|
|
2050
|
+
return "";
|
|
2051
|
+
}),
|
|
2052
|
+
inscribe: (content) => __async222222222222222(void 0, null, function* () {
|
|
2053
|
+
return "";
|
|
2054
|
+
}),
|
|
2055
|
+
isCreatingCommit: false,
|
|
2056
|
+
isInscribing: false
|
|
2057
|
+
};
|
|
2058
|
+
bitcoin3.initEccLib(ecc2222222222222222);
|
|
2059
|
+
var LaserEyesContext = (0, import_react16.createContext)(initialWalletContext2222222222222222);
|
|
2060
|
+
var LaserEyesContext2 = (0, import_react15.createContext)(initialWalletContext222222222222222);
|
|
2061
|
+
var LaserEyesContext3 = (0, import_react14.createContext)(initialWalletContext22222222222222);
|
|
2062
|
+
var LaserEyesContext4 = (0, import_react13.createContext)(initialWalletContext2222222222222);
|
|
2063
|
+
var LaserEyesContext5 = (0, import_react12.createContext)(initialWalletContext222222222222);
|
|
2064
|
+
var LaserEyesContext6 = (0, import_react11.createContext)(initialWalletContext22222222222);
|
|
2065
|
+
var LaserEyesContext7 = (0, import_react10.createContext)(initialWalletContext2222222222);
|
|
2066
|
+
var LaserEyesContext8 = (0, import_react9.createContext)(initialWalletContext222222222);
|
|
2067
|
+
var LaserEyesContext9 = (0, import_react8.createContext)(initialWalletContext22222222);
|
|
2068
|
+
var LaserEyesContext10 = (0, import_react7.createContext)(initialWalletContext2222222);
|
|
2069
|
+
var LaserEyesContext11 = (0, import_react6.createContext)(initialWalletContext222222);
|
|
2070
|
+
var LaserEyesContext12 = (0, import_react5.createContext)(initialWalletContext22222);
|
|
2071
|
+
var LaserEyesContext13 = (0, import_react4.createContext)(initialWalletContext2222);
|
|
2072
|
+
var LaserEyesContext14 = (0, import_react3.createContext)(initialWalletContext222);
|
|
2073
|
+
var LaserEyesContext15 = (0, import_react2.createContext)(initialWalletContext22);
|
|
2074
|
+
var LaserEyesContext16 = (0, import_react.createContext)(initialWalletContext2);
|
|
2075
|
+
|
|
2076
|
+
// example/lib/urls.ts
|
|
2077
|
+
var MEMPOOL_SPACE_URL3 = "https://mempool.space";
|
|
2078
|
+
var MEMPOOL_SPACE_TESTNET_URL3 = "https://mempool.space/testnet";
|
|
2079
|
+
var MEMPOOL_SPACE_SIGNET_URL2 = "https://mempool.space/signet";
|
|
2080
|
+
var getMempoolSpaceUrl3 = (network) => network === TESTNET3 ? MEMPOOL_SPACE_TESTNET_URL3 : network === SIGNET3 ? MEMPOOL_SPACE_SIGNET_URL2 : MEMPOOL_SPACE_URL3;
|
|
2081
|
+
|
|
2082
|
+
// src/providers/LaserEyesProvider.tsx
|
|
2083
|
+
var import_jsx_runtime17 = _toESM(require("react/jsx-runtime"));
|
|
2084
|
+
var LaserEyesContext17 = (0, import_react33.createContext)(initialWalletContext);
|
|
505
2085
|
var useLaserEyes = () => {
|
|
506
|
-
return (0,
|
|
2086
|
+
return (0, import_react33.useContext)(LaserEyesContext17);
|
|
507
2087
|
};
|
|
508
2088
|
var LaserEyesProvider = ({
|
|
509
2089
|
children,
|
|
510
2090
|
config
|
|
511
2091
|
}) => {
|
|
512
|
-
const selfRef = (0,
|
|
2092
|
+
const selfRef = (0, import_react33.useRef)({
|
|
513
2093
|
accounts: []
|
|
514
2094
|
});
|
|
515
2095
|
const self = selfRef.current;
|
|
516
|
-
const [library, setLibrary] = (0,
|
|
517
|
-
const [provider, setProvider] = (0,
|
|
518
|
-
const [isInitializing, setIsInitializing] = (0,
|
|
519
|
-
const [connected, setConnected] = (0,
|
|
520
|
-
const [isConnecting, setIsConnecting] = (0,
|
|
521
|
-
const [accounts, setAccounts] = (0,
|
|
522
|
-
const [publicKey, setPublicKey] = (0,
|
|
523
|
-
const [paymentPublicKey, setPaymentPublicKey] = (0,
|
|
524
|
-
const [
|
|
525
|
-
const [paymentAddress, setPaymentAddress] = (0,
|
|
526
|
-
const [balance, setBalance] = (0,
|
|
527
|
-
const [hasUnisat, setHasUnisat] = (0,
|
|
528
|
-
const [hasXverse, setHasXverse] = (0,
|
|
529
|
-
const [hasOyl, setHasOyl] = (0,
|
|
530
|
-
const [hasMagicEden, setHasMagicEden] = (0,
|
|
531
|
-
const [hasOkx, setHasOkx] = (0,
|
|
532
|
-
const [hasLeather, setHasLeather] = (0,
|
|
533
|
-
const [hasPhantom, setHasPhantom] = (0,
|
|
534
|
-
const [hasWizz, setHasWizz] = (0,
|
|
535
|
-
const [network, setNetwork] = (0,
|
|
2096
|
+
const [library, setLibrary] = (0, import_react33.useState)(null);
|
|
2097
|
+
const [provider, setProvider] = (0, import_react33.useState)();
|
|
2098
|
+
const [isInitializing, setIsInitializing] = (0, import_react33.useState)(true);
|
|
2099
|
+
const [connected, setConnected] = (0, import_react33.useState)(false);
|
|
2100
|
+
const [isConnecting, setIsConnecting] = (0, import_react33.useState)(false);
|
|
2101
|
+
const [accounts, setAccounts] = (0, import_react33.useState)([]);
|
|
2102
|
+
const [publicKey, setPublicKey] = (0, import_react33.useState)("");
|
|
2103
|
+
const [paymentPublicKey, setPaymentPublicKey] = (0, import_react33.useState)("");
|
|
2104
|
+
const [address3, setAddress] = (0, import_react33.useState)("");
|
|
2105
|
+
const [paymentAddress, setPaymentAddress] = (0, import_react33.useState)("");
|
|
2106
|
+
const [balance, setBalance] = (0, import_react33.useState)();
|
|
2107
|
+
const [hasUnisat, setHasUnisat] = (0, import_react33.useState)(false);
|
|
2108
|
+
const [hasXverse, setHasXverse] = (0, import_react33.useState)(false);
|
|
2109
|
+
const [hasOyl, setHasOyl] = (0, import_react33.useState)(false);
|
|
2110
|
+
const [hasMagicEden, setHasMagicEden] = (0, import_react33.useState)(false);
|
|
2111
|
+
const [hasOkx, setHasOkx] = (0, import_react33.useState)(false);
|
|
2112
|
+
const [hasLeather, setHasLeather] = (0, import_react33.useState)(false);
|
|
2113
|
+
const [hasPhantom, setHasPhantom] = (0, import_react33.useState)(false);
|
|
2114
|
+
const [hasWizz, setHasWizz] = (0, import_react33.useState)(false);
|
|
2115
|
+
const [network, setNetwork] = (0, import_usehooks_ts17.useLocalStorage)("network", MAINNET, {
|
|
536
2116
|
initializeWithValue: false
|
|
537
2117
|
});
|
|
538
|
-
(0,
|
|
2118
|
+
(0, import_react33.useEffect)(() => {
|
|
539
2119
|
if (config) {
|
|
540
2120
|
setNetwork(config.network);
|
|
541
2121
|
getNetwork().then((foundNetwork) => {
|
|
@@ -552,7 +2132,7 @@ var LaserEyesProvider = ({
|
|
|
552
2132
|
setIsInitializing(false);
|
|
553
2133
|
}
|
|
554
2134
|
};
|
|
555
|
-
(0,
|
|
2135
|
+
(0, import_react33.useEffect)(() => {
|
|
556
2136
|
const observer = new MutationObserver(() => {
|
|
557
2137
|
const unisatLib = window == null ? void 0 : window.unisat;
|
|
558
2138
|
if (unisatLib) {
|
|
@@ -565,7 +2145,7 @@ var LaserEyesProvider = ({
|
|
|
565
2145
|
observer.disconnect();
|
|
566
2146
|
};
|
|
567
2147
|
}, []);
|
|
568
|
-
(0,
|
|
2148
|
+
(0, import_react33.useEffect)(() => {
|
|
569
2149
|
const observer = new MutationObserver(() => {
|
|
570
2150
|
var _a;
|
|
571
2151
|
const xverseLib = (_a = window == null ? void 0 : window.XverseProviders) == null ? void 0 : _a.BitcoinProvider;
|
|
@@ -579,7 +2159,7 @@ var LaserEyesProvider = ({
|
|
|
579
2159
|
observer.disconnect();
|
|
580
2160
|
};
|
|
581
2161
|
}, []);
|
|
582
|
-
(0,
|
|
2162
|
+
(0, import_react33.useEffect)(() => {
|
|
583
2163
|
const observer = new MutationObserver(() => {
|
|
584
2164
|
const oylLib = window == null ? void 0 : window.oyl;
|
|
585
2165
|
if (oylLib) {
|
|
@@ -592,7 +2172,7 @@ var LaserEyesProvider = ({
|
|
|
592
2172
|
observer.disconnect();
|
|
593
2173
|
};
|
|
594
2174
|
}, []);
|
|
595
|
-
(0,
|
|
2175
|
+
(0, import_react33.useEffect)(() => {
|
|
596
2176
|
const observer = new MutationObserver(() => {
|
|
597
2177
|
const magicEdenLib = window == null ? void 0 : window.magicEden;
|
|
598
2178
|
if (magicEdenLib) {
|
|
@@ -605,7 +2185,7 @@ var LaserEyesProvider = ({
|
|
|
605
2185
|
observer.disconnect();
|
|
606
2186
|
};
|
|
607
2187
|
}, []);
|
|
608
|
-
(0,
|
|
2188
|
+
(0, import_react33.useEffect)(() => {
|
|
609
2189
|
const observer = new MutationObserver(() => {
|
|
610
2190
|
var _a, _b;
|
|
611
2191
|
let foundOkx;
|
|
@@ -624,7 +2204,7 @@ var LaserEyesProvider = ({
|
|
|
624
2204
|
observer.disconnect();
|
|
625
2205
|
};
|
|
626
2206
|
}, [network]);
|
|
627
|
-
(0,
|
|
2207
|
+
(0, import_react33.useEffect)(() => {
|
|
628
2208
|
const observer = new MutationObserver(() => {
|
|
629
2209
|
const leatherLib = window == null ? void 0 : window.LeatherProvider;
|
|
630
2210
|
if (leatherLib) {
|
|
@@ -637,7 +2217,7 @@ var LaserEyesProvider = ({
|
|
|
637
2217
|
observer.disconnect();
|
|
638
2218
|
};
|
|
639
2219
|
}, []);
|
|
640
|
-
(0,
|
|
2220
|
+
(0, import_react33.useEffect)(() => {
|
|
641
2221
|
const observer = new MutationObserver(() => {
|
|
642
2222
|
var _a;
|
|
643
2223
|
const phantomLib = (_a = window == null ? void 0 : window.phantom) == null ? void 0 : _a.bitcoin;
|
|
@@ -654,7 +2234,7 @@ var LaserEyesProvider = ({
|
|
|
654
2234
|
observer.disconnect();
|
|
655
2235
|
};
|
|
656
2236
|
}, []);
|
|
657
|
-
(0,
|
|
2237
|
+
(0, import_react33.useEffect)(() => {
|
|
658
2238
|
const observer = new MutationObserver(() => {
|
|
659
2239
|
const wizzLib = window == null ? void 0 : window.wizz;
|
|
660
2240
|
if (wizzLib) {
|
|
@@ -667,7 +2247,7 @@ var LaserEyesProvider = ({
|
|
|
667
2247
|
observer.disconnect();
|
|
668
2248
|
};
|
|
669
2249
|
}, []);
|
|
670
|
-
(0,
|
|
2250
|
+
(0, import_react33.useEffect)(() => {
|
|
671
2251
|
checkInitializationComplete();
|
|
672
2252
|
}, [
|
|
673
2253
|
hasUnisat,
|
|
@@ -679,10 +2259,10 @@ var LaserEyesProvider = ({
|
|
|
679
2259
|
hasPhantom,
|
|
680
2260
|
hasWizz
|
|
681
2261
|
]);
|
|
682
|
-
(0,
|
|
2262
|
+
(0, import_react33.useEffect)(() => {
|
|
683
2263
|
setBalance(void 0);
|
|
684
2264
|
}, [network]);
|
|
685
|
-
(0,
|
|
2265
|
+
(0, import_react33.useEffect)(() => {
|
|
686
2266
|
if (provider !== UNISAT && provider !== WIZZ) {
|
|
687
2267
|
return;
|
|
688
2268
|
}
|
|
@@ -696,7 +2276,7 @@ var LaserEyesProvider = ({
|
|
|
696
2276
|
library.removeListener("networkChanged", handleNetworkChanged);
|
|
697
2277
|
};
|
|
698
2278
|
}, [library]);
|
|
699
|
-
(0,
|
|
2279
|
+
(0, import_react33.useEffect)(() => {
|
|
700
2280
|
if (!isInitializing) {
|
|
701
2281
|
const defaultWallet = localStorage == null ? void 0 : localStorage.getItem(
|
|
702
2282
|
LOCAL_STORAGE_DEFAULT_WALLET
|
|
@@ -707,7 +2287,7 @@ var LaserEyesProvider = ({
|
|
|
707
2287
|
}
|
|
708
2288
|
}
|
|
709
2289
|
}, [isInitializing]);
|
|
710
|
-
const connectUnisat = (0,
|
|
2290
|
+
const connectUnisat = (0, import_react33.useCallback)(() => __async(void 0, null, function* () {
|
|
711
2291
|
try {
|
|
712
2292
|
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, UNISAT);
|
|
713
2293
|
const lib = window.unisat;
|
|
@@ -731,7 +2311,7 @@ var LaserEyesProvider = ({
|
|
|
731
2311
|
throw error;
|
|
732
2312
|
}
|
|
733
2313
|
}), [hasUnisat]);
|
|
734
|
-
const connectXverse = (0,
|
|
2314
|
+
const connectXverse = (0, import_react33.useCallback)(() => __async(void 0, null, function* () {
|
|
735
2315
|
try {
|
|
736
2316
|
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, XVERSE);
|
|
737
2317
|
let xverseNetwork = getXverseNetwork((config == null ? void 0 : config.network) || MAINNET);
|
|
@@ -765,7 +2345,7 @@ var LaserEyesProvider = ({
|
|
|
765
2345
|
throw new Error(`Can't lasereyes to ${XVERSE} wallet`);
|
|
766
2346
|
}
|
|
767
2347
|
};
|
|
768
|
-
yield (0,
|
|
2348
|
+
yield (0, import_sats_connect17.getAddress)(getAddressOptions);
|
|
769
2349
|
setConnected(true);
|
|
770
2350
|
} catch (error) {
|
|
771
2351
|
throw error;
|
|
@@ -830,7 +2410,7 @@ var LaserEyesProvider = ({
|
|
|
830
2410
|
}
|
|
831
2411
|
};
|
|
832
2412
|
console.log(JSON.stringify(getAddressOptions));
|
|
833
|
-
yield (0,
|
|
2413
|
+
yield (0, import_sats_connect17.getAddress)(getAddressOptions);
|
|
834
2414
|
setConnected(true);
|
|
835
2415
|
} catch (error) {
|
|
836
2416
|
console.log("error", error);
|
|
@@ -861,7 +2441,7 @@ var LaserEyesProvider = ({
|
|
|
861
2441
|
throw error;
|
|
862
2442
|
}
|
|
863
2443
|
});
|
|
864
|
-
const connectLeather = (0,
|
|
2444
|
+
const connectLeather = (0, import_react33.useCallback)(() => __async(void 0, null, function* () {
|
|
865
2445
|
try {
|
|
866
2446
|
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, LEATHER);
|
|
867
2447
|
const lib = window.LeatherProvider;
|
|
@@ -871,13 +2451,13 @@ var LaserEyesProvider = ({
|
|
|
871
2451
|
const addressesResponse = getAddressesResponse.result;
|
|
872
2452
|
const addresses = addressesResponse.addresses;
|
|
873
2453
|
const leatherAccountsParsed = addresses.map(
|
|
874
|
-
(
|
|
2454
|
+
(address4) => address4.address
|
|
875
2455
|
);
|
|
876
2456
|
const taprootAddress = addresses.find(
|
|
877
|
-
(
|
|
2457
|
+
(address4) => address4.type === P2TR
|
|
878
2458
|
);
|
|
879
2459
|
const segwitAddress = addresses.find(
|
|
880
|
-
(
|
|
2460
|
+
(address4) => address4.type === P2WPKH
|
|
881
2461
|
);
|
|
882
2462
|
setAccounts(leatherAccountsParsed);
|
|
883
2463
|
setAddress(String(taprootAddress == null ? void 0 : taprootAddress.address));
|
|
@@ -1054,7 +2634,7 @@ var LaserEyesProvider = ({
|
|
|
1054
2634
|
console.log("CANCELLED");
|
|
1055
2635
|
}
|
|
1056
2636
|
};
|
|
1057
|
-
return [
|
|
2637
|
+
return [address3];
|
|
1058
2638
|
} else if (provider === OYL) {
|
|
1059
2639
|
return yield library.requestAccounts();
|
|
1060
2640
|
} else if (provider === OKX) {
|
|
@@ -1068,13 +2648,13 @@ var LaserEyesProvider = ({
|
|
|
1068
2648
|
const addressesResponse = getAddressesResponse.result;
|
|
1069
2649
|
const addresses = addressesResponse.addresses;
|
|
1070
2650
|
const leatherAccountsParsed = addresses.map(
|
|
1071
|
-
(
|
|
2651
|
+
(address4) => address4.address
|
|
1072
2652
|
);
|
|
1073
2653
|
const taprootAddress = addresses.find(
|
|
1074
|
-
(
|
|
2654
|
+
(address4) => address4.type === P2TR
|
|
1075
2655
|
);
|
|
1076
2656
|
const segwitAddress = addresses.find(
|
|
1077
|
-
(
|
|
2657
|
+
(address4) => address4.type === P2WPKH
|
|
1078
2658
|
);
|
|
1079
2659
|
setAccounts(leatherAccountsParsed);
|
|
1080
2660
|
setAddress(String(taprootAddress == null ? void 0 : taprootAddress.address));
|
|
@@ -1117,17 +2697,17 @@ var LaserEyesProvider = ({
|
|
|
1117
2697
|
setNetwork(foundNetwork);
|
|
1118
2698
|
return foundNetwork;
|
|
1119
2699
|
} else if (provider === XVERSE) {
|
|
1120
|
-
if (
|
|
2700
|
+
if (address3.slice(0, 1) === "t") {
|
|
1121
2701
|
return TESTNET;
|
|
1122
2702
|
}
|
|
1123
2703
|
return MAINNET;
|
|
1124
2704
|
} else if (provider === OYL) {
|
|
1125
|
-
if (
|
|
2705
|
+
if (address3.slice(0, 1) === "t") {
|
|
1126
2706
|
return TESTNET;
|
|
1127
2707
|
}
|
|
1128
2708
|
return MAINNET;
|
|
1129
2709
|
} else if (provider === MAGIC_EDEN) {
|
|
1130
|
-
if (
|
|
2710
|
+
if (address3.slice(0, 1) === "t") {
|
|
1131
2711
|
return TESTNET;
|
|
1132
2712
|
}
|
|
1133
2713
|
return MAINNET;
|
|
@@ -1136,12 +2716,12 @@ var LaserEyesProvider = ({
|
|
|
1136
2716
|
const foundNetwork = getNetworkForOkx(okxNetwork);
|
|
1137
2717
|
setNetwork(foundNetwork);
|
|
1138
2718
|
} else if (provider === LEATHER) {
|
|
1139
|
-
if (
|
|
2719
|
+
if (address3.slice(0, 1) === "t") {
|
|
1140
2720
|
return TESTNET;
|
|
1141
2721
|
}
|
|
1142
2722
|
return MAINNET;
|
|
1143
2723
|
} else if (provider === PHANTOM) {
|
|
1144
|
-
if (
|
|
2724
|
+
if (address3.slice(0, 1) === "t") {
|
|
1145
2725
|
return TESTNET;
|
|
1146
2726
|
}
|
|
1147
2727
|
return MAINNET;
|
|
@@ -1254,7 +2834,7 @@ var LaserEyesProvider = ({
|
|
|
1254
2834
|
throw new Error("Transaction failed");
|
|
1255
2835
|
return txId;
|
|
1256
2836
|
} else if (provider === XVERSE) {
|
|
1257
|
-
const response = yield (0,
|
|
2837
|
+
const response = yield (0, import_sats_connect17.request)("sendTransfer", {
|
|
1258
2838
|
recipients: [
|
|
1259
2839
|
{
|
|
1260
2840
|
address: to,
|
|
@@ -1265,7 +2845,7 @@ var LaserEyesProvider = ({
|
|
|
1265
2845
|
if (response.status === "success") {
|
|
1266
2846
|
return response.result.txid;
|
|
1267
2847
|
} else {
|
|
1268
|
-
if (response.error.code ===
|
|
2848
|
+
if (response.error.code === import_sats_connect17.RpcErrorCode.USER_REJECTION) {
|
|
1269
2849
|
throw new Error("User rejected the request");
|
|
1270
2850
|
} else {
|
|
1271
2851
|
throw new Error("Error sending BTC: " + response.error.message);
|
|
@@ -1273,7 +2853,7 @@ var LaserEyesProvider = ({
|
|
|
1273
2853
|
}
|
|
1274
2854
|
} else if (provider === OYL) {
|
|
1275
2855
|
const { psbtHex, psbtBase64 } = yield createSendBtcPsbt(
|
|
1276
|
-
|
|
2856
|
+
address3,
|
|
1277
2857
|
paymentAddress,
|
|
1278
2858
|
to,
|
|
1279
2859
|
amount,
|
|
@@ -1288,7 +2868,7 @@ var LaserEyesProvider = ({
|
|
|
1288
2868
|
return psbt.txId;
|
|
1289
2869
|
} else if (provider === MAGIC_EDEN) {
|
|
1290
2870
|
const { psbtHex, psbtBase64 } = yield createSendBtcPsbt(
|
|
1291
|
-
|
|
2871
|
+
address3,
|
|
1292
2872
|
paymentAddress,
|
|
1293
2873
|
to,
|
|
1294
2874
|
amount,
|
|
@@ -1318,7 +2898,7 @@ var LaserEyesProvider = ({
|
|
|
1318
2898
|
if ((_a = response == null ? void 0 : response.result) == null ? void 0 : _a.txid) {
|
|
1319
2899
|
return response.result.txid;
|
|
1320
2900
|
} else {
|
|
1321
|
-
if (response.error.code ===
|
|
2901
|
+
if (response.error.code === import_sats_connect17.RpcErrorCode.USER_REJECTION) {
|
|
1322
2902
|
throw new Error("User rejected the request");
|
|
1323
2903
|
} else {
|
|
1324
2904
|
throw new Error("Error sending BTC: " + response.error.message);
|
|
@@ -1344,14 +2924,14 @@ var LaserEyesProvider = ({
|
|
|
1344
2924
|
if (provider === UNISAT) {
|
|
1345
2925
|
return yield library == null ? void 0 : library.signMessage(message);
|
|
1346
2926
|
} else if (provider === XVERSE) {
|
|
1347
|
-
const response = yield (0,
|
|
1348
|
-
address:
|
|
2927
|
+
const response = yield (0, import_sats_connect17.request)("signMessage", {
|
|
2928
|
+
address: address3,
|
|
1349
2929
|
message
|
|
1350
2930
|
});
|
|
1351
2931
|
if (response.status === "success") {
|
|
1352
2932
|
return response.result.signature;
|
|
1353
2933
|
} else {
|
|
1354
|
-
if (response.error.code ===
|
|
2934
|
+
if (response.error.code === import_sats_connect17.RpcErrorCode.USER_REJECTION) {
|
|
1355
2935
|
throw new Error("User rejected the request");
|
|
1356
2936
|
} else {
|
|
1357
2937
|
throw new Error("Error signing message: " + response.error.message);
|
|
@@ -1359,13 +2939,13 @@ var LaserEyesProvider = ({
|
|
|
1359
2939
|
}
|
|
1360
2940
|
} else if (provider === MAGIC_EDEN) {
|
|
1361
2941
|
let signedMessage;
|
|
1362
|
-
yield (0,
|
|
2942
|
+
yield (0, import_sats_connect17.signMessage)({
|
|
1363
2943
|
getProvider: () => __async(void 0, null, function* () {
|
|
1364
2944
|
return window.magicEden.bitcoin;
|
|
1365
2945
|
}),
|
|
1366
2946
|
payload: {
|
|
1367
2947
|
network: {
|
|
1368
|
-
type:
|
|
2948
|
+
type: import_sats_connect17.BitcoinNetworkType.Mainnet
|
|
1369
2949
|
},
|
|
1370
2950
|
address: paymentAddress,
|
|
1371
2951
|
message
|
|
@@ -1389,7 +2969,7 @@ var LaserEyesProvider = ({
|
|
|
1389
2969
|
} else if (provider === PHANTOM) {
|
|
1390
2970
|
const utf8Bytes = new TextEncoder().encode(message);
|
|
1391
2971
|
const uintArray = new Uint8Array(utf8Bytes);
|
|
1392
|
-
const response = yield library == null ? void 0 : library.signMessage(
|
|
2972
|
+
const response = yield library == null ? void 0 : library.signMessage(address3, uintArray);
|
|
1393
2973
|
const binaryString = String.fromCharCode(...response.signature);
|
|
1394
2974
|
return btoa(binaryString);
|
|
1395
2975
|
} else if (provider === WIZZ) {
|
|
@@ -1409,11 +2989,11 @@ var LaserEyesProvider = ({
|
|
|
1409
2989
|
if (!psbt)
|
|
1410
2990
|
throw new Error("No PSBT provided");
|
|
1411
2991
|
if (isHex(psbt)) {
|
|
1412
|
-
psbtBase64 =
|
|
2992
|
+
psbtBase64 = bitcoin19.Psbt.fromHex(psbt).toBase64();
|
|
1413
2993
|
psbtHex = psbt;
|
|
1414
2994
|
} else if (isBase64(psbt)) {
|
|
1415
2995
|
psbtBase64 = psbt;
|
|
1416
|
-
psbtHex =
|
|
2996
|
+
psbtHex = bitcoin19.Psbt.fromBase64(psbt).toHex();
|
|
1417
2997
|
} else {
|
|
1418
2998
|
throw new Error("Invalid PSBT format");
|
|
1419
2999
|
}
|
|
@@ -1421,7 +3001,7 @@ var LaserEyesProvider = ({
|
|
|
1421
3001
|
const signedPsbt = yield library == null ? void 0 : library.signPsbt(psbtHex, {
|
|
1422
3002
|
autoFinalized: finalize
|
|
1423
3003
|
});
|
|
1424
|
-
const psbtSignedPsbt =
|
|
3004
|
+
const psbtSignedPsbt = bitcoin19.Psbt.fromHex(signedPsbt);
|
|
1425
3005
|
if (finalize && broadcast) {
|
|
1426
3006
|
const txId = yield pushPsbt(signedPsbt);
|
|
1427
3007
|
return {
|
|
@@ -1436,13 +3016,13 @@ var LaserEyesProvider = ({
|
|
|
1436
3016
|
txId: void 0
|
|
1437
3017
|
};
|
|
1438
3018
|
} else if (provider === XVERSE) {
|
|
1439
|
-
const toSignPsbt =
|
|
3019
|
+
const toSignPsbt = bitcoin19.Psbt.fromBase64(String(psbtBase64), {
|
|
1440
3020
|
network: getBitcoinNetwork(network)
|
|
1441
3021
|
});
|
|
1442
3022
|
const inputs = toSignPsbt.data.inputs;
|
|
1443
3023
|
const inputsToSign = [];
|
|
1444
3024
|
const ordinalAddressData = {
|
|
1445
|
-
address:
|
|
3025
|
+
address: address3,
|
|
1446
3026
|
signingIndexes: []
|
|
1447
3027
|
};
|
|
1448
3028
|
const paymentsAddressData = {
|
|
@@ -1454,13 +3034,13 @@ var LaserEyesProvider = ({
|
|
|
1454
3034
|
for (var iter = __forAwait(inputs), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {
|
|
1455
3035
|
let input = temp.value;
|
|
1456
3036
|
const { script } = input.witnessUtxo;
|
|
1457
|
-
const addressFromScript = (0,
|
|
3037
|
+
const addressFromScript = (0, import_address17.fromOutputScript)(
|
|
1458
3038
|
script,
|
|
1459
3039
|
getBitcoinNetwork(network)
|
|
1460
3040
|
);
|
|
1461
3041
|
if (addressFromScript === paymentAddress) {
|
|
1462
3042
|
paymentsAddressData.signingIndexes.push(Number(counter));
|
|
1463
|
-
} else if (addressFromScript ===
|
|
3043
|
+
} else if (addressFromScript === address3) {
|
|
1464
3044
|
ordinalAddressData.signingIndexes.push(Number(counter));
|
|
1465
3045
|
}
|
|
1466
3046
|
counter++;
|
|
@@ -1497,7 +3077,7 @@ var LaserEyesProvider = ({
|
|
|
1497
3077
|
if (response.txId) {
|
|
1498
3078
|
txId = response.txId;
|
|
1499
3079
|
} else if (response.psbtBase64) {
|
|
1500
|
-
const signedPsbt =
|
|
3080
|
+
const signedPsbt = bitcoin19.Psbt.fromBase64(
|
|
1501
3081
|
String(response.psbtBase64),
|
|
1502
3082
|
{
|
|
1503
3083
|
network: getBitcoinNetwork(network)
|
|
@@ -1509,7 +3089,7 @@ var LaserEyesProvider = ({
|
|
|
1509
3089
|
},
|
|
1510
3090
|
onCancel: () => console.log("Canceled")
|
|
1511
3091
|
};
|
|
1512
|
-
yield (0,
|
|
3092
|
+
yield (0, import_sats_connect17.signTransaction)(signPsbtOptions);
|
|
1513
3093
|
return {
|
|
1514
3094
|
signedPsbtHex,
|
|
1515
3095
|
signedPsbtBase64,
|
|
@@ -1518,7 +3098,7 @@ var LaserEyesProvider = ({
|
|
|
1518
3098
|
} else if (provider === OYL) {
|
|
1519
3099
|
const signedPsbt = yield library == null ? void 0 : library.signPsbt(psbtHex, true, true);
|
|
1520
3100
|
console.log({ signedPsbt });
|
|
1521
|
-
const psbtSignedPsbt =
|
|
3101
|
+
const psbtSignedPsbt = bitcoin19.Psbt.fromHex(signedPsbt);
|
|
1522
3102
|
if (broadcast) {
|
|
1523
3103
|
const txId = yield pushPsbt(psbtSignedPsbt.toHex());
|
|
1524
3104
|
return {
|
|
@@ -1534,13 +3114,13 @@ var LaserEyesProvider = ({
|
|
|
1534
3114
|
};
|
|
1535
3115
|
}
|
|
1536
3116
|
} else if (provider === MAGIC_EDEN) {
|
|
1537
|
-
const toSignPsbt =
|
|
3117
|
+
const toSignPsbt = bitcoin19.Psbt.fromBase64(String(psbtBase64), {
|
|
1538
3118
|
network: getBitcoinNetwork(network)
|
|
1539
3119
|
});
|
|
1540
3120
|
const inputs = toSignPsbt.data.inputs;
|
|
1541
3121
|
const inputsToSign = [];
|
|
1542
3122
|
const ordinalAddressData = {
|
|
1543
|
-
address:
|
|
3123
|
+
address: address3,
|
|
1544
3124
|
signingIndexes: []
|
|
1545
3125
|
};
|
|
1546
3126
|
const paymentsAddressData = {
|
|
@@ -1552,13 +3132,13 @@ var LaserEyesProvider = ({
|
|
|
1552
3132
|
for (var iter2 = __forAwait(inputs), more2, temp2, error2; more2 = !(temp2 = yield iter2.next()).done; more2 = false) {
|
|
1553
3133
|
let input = temp2.value;
|
|
1554
3134
|
const { script } = input.witnessUtxo;
|
|
1555
|
-
const addressFromScript = (0,
|
|
3135
|
+
const addressFromScript = (0, import_address17.fromOutputScript)(
|
|
1556
3136
|
script,
|
|
1557
3137
|
getBitcoinNetwork(network)
|
|
1558
3138
|
);
|
|
1559
3139
|
if (addressFromScript === paymentAddress) {
|
|
1560
3140
|
paymentsAddressData.signingIndexes.push(Number(counter));
|
|
1561
|
-
} else if (addressFromScript ===
|
|
3141
|
+
} else if (addressFromScript === address3) {
|
|
1562
3142
|
ordinalAddressData.signingIndexes.push(Number(counter));
|
|
1563
3143
|
}
|
|
1564
3144
|
counter++;
|
|
@@ -1596,7 +3176,7 @@ var LaserEyesProvider = ({
|
|
|
1596
3176
|
},
|
|
1597
3177
|
onFinish: (response) => {
|
|
1598
3178
|
if (response.psbtBase64) {
|
|
1599
|
-
const signedPsbt =
|
|
3179
|
+
const signedPsbt = bitcoin19.Psbt.fromBase64(
|
|
1600
3180
|
String(response.psbtBase64),
|
|
1601
3181
|
{
|
|
1602
3182
|
network: getBitcoinNetwork(network)
|
|
@@ -1615,9 +3195,9 @@ var LaserEyesProvider = ({
|
|
|
1615
3195
|
throw error3;
|
|
1616
3196
|
}
|
|
1617
3197
|
};
|
|
1618
|
-
yield (0,
|
|
3198
|
+
yield (0, import_sats_connect17.signTransaction)(signPsbtOptions);
|
|
1619
3199
|
if (broadcast) {
|
|
1620
|
-
const signed =
|
|
3200
|
+
const signed = bitcoin19.Psbt.fromBase64(String(signedPsbtBase64));
|
|
1621
3201
|
const finalized = signed.finalizeAllInputs();
|
|
1622
3202
|
const extracted = finalized.extractTransaction();
|
|
1623
3203
|
const txId2 = yield pushPsbt(extracted.toHex());
|
|
@@ -1637,7 +3217,7 @@ var LaserEyesProvider = ({
|
|
|
1637
3217
|
const signedPsbt = yield library == null ? void 0 : library.signPsbt(psbtHex, {
|
|
1638
3218
|
autoFinalized: finalize
|
|
1639
3219
|
});
|
|
1640
|
-
const psbtSignedPsbt =
|
|
3220
|
+
const psbtSignedPsbt = bitcoin19.Psbt.fromHex(signedPsbt);
|
|
1641
3221
|
if (finalize && broadcast) {
|
|
1642
3222
|
const txId = yield pushPsbt(signedPsbt);
|
|
1643
3223
|
return {
|
|
@@ -1663,7 +3243,7 @@ var LaserEyesProvider = ({
|
|
|
1663
3243
|
);
|
|
1664
3244
|
const leatherHexResult = response.result;
|
|
1665
3245
|
const signedTx = leatherHexResult.hex;
|
|
1666
|
-
const signed =
|
|
3246
|
+
const signed = bitcoin19.Psbt.fromHex(String(signedTx));
|
|
1667
3247
|
if (finalize && broadcast) {
|
|
1668
3248
|
const finalized = signed.finalizeAllInputs();
|
|
1669
3249
|
const txId = yield pushPsbt(finalized.toHex());
|
|
@@ -1691,7 +3271,7 @@ var LaserEyesProvider = ({
|
|
|
1691
3271
|
autoFinalized: finalize,
|
|
1692
3272
|
broadcast: false
|
|
1693
3273
|
});
|
|
1694
|
-
const psbtSignedPsbt =
|
|
3274
|
+
const psbtSignedPsbt = bitcoin19.Psbt.fromHex(signedPsbt);
|
|
1695
3275
|
if (finalize && broadcast) {
|
|
1696
3276
|
const txId = yield pushPsbt(signedPsbt);
|
|
1697
3277
|
return {
|
|
@@ -1723,11 +3303,11 @@ var LaserEyesProvider = ({
|
|
|
1723
3303
|
} else if (provider === OKX) {
|
|
1724
3304
|
return yield library == null ? void 0 : library.pushPsbt(psbt);
|
|
1725
3305
|
} else if (provider === MAGIC_EDEN) {
|
|
1726
|
-
return yield
|
|
3306
|
+
return yield import_axios50.default.post(`${getMempoolSpaceUrl3(network)}/api/tx`, psbt).then((res) => res.data);
|
|
1727
3307
|
} else if (provider === LEATHER) {
|
|
1728
|
-
const decoded =
|
|
3308
|
+
const decoded = bitcoin19.Psbt.fromHex(psbt);
|
|
1729
3309
|
const extracted = decoded.extractTransaction();
|
|
1730
|
-
return yield
|
|
3310
|
+
return yield import_axios50.default.post(`${getMempoolSpaceUrl3(network)}/api/tx`, extracted.toHex()).then((res) => res.data);
|
|
1731
3311
|
} else if (provider === WIZZ) {
|
|
1732
3312
|
return yield library == null ? void 0 : library.pushPsbt(psbt);
|
|
1733
3313
|
} else {
|
|
@@ -1737,14 +3317,14 @@ var LaserEyesProvider = ({
|
|
|
1737
3317
|
throw error;
|
|
1738
3318
|
}
|
|
1739
3319
|
});
|
|
1740
|
-
return /* @__PURE__ */ (0,
|
|
1741
|
-
|
|
3320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3321
|
+
LaserEyesContext17.Provider,
|
|
1742
3322
|
{
|
|
1743
3323
|
value: {
|
|
1744
3324
|
library,
|
|
1745
3325
|
accounts,
|
|
1746
3326
|
publicKey,
|
|
1747
|
-
address:
|
|
3327
|
+
address: address3,
|
|
1748
3328
|
paymentAddress,
|
|
1749
3329
|
paymentPublicKey,
|
|
1750
3330
|
provider,
|
|
@@ -1781,36 +3361,36 @@ var LaserEyesProvider = ({
|
|
|
1781
3361
|
};
|
|
1782
3362
|
|
|
1783
3363
|
// src/hooks/useInscriber.ts
|
|
1784
|
-
var
|
|
3364
|
+
var import_react34 = _toESM(require("react"));
|
|
1785
3365
|
|
|
1786
3366
|
// src/consts/inscribe.ts
|
|
1787
3367
|
var MIME_TYPE_TEXT = "text/plain;charset=utf-8";
|
|
1788
3368
|
|
|
1789
3369
|
// src/hooks/useInscriber.ts
|
|
1790
|
-
var
|
|
3370
|
+
var import_axios51 = __toESM(require("axios"));
|
|
1791
3371
|
var DESCRIBE_API_URL = "http://localhost:3000/api";
|
|
1792
3372
|
var useInscriber = ({
|
|
1793
3373
|
inscribeApiUrl = DESCRIBE_API_URL
|
|
1794
3374
|
}) => {
|
|
1795
|
-
const { address:
|
|
1796
|
-
const [content, setContent] = (0,
|
|
1797
|
-
const [mimeType, setMimeType] = (0,
|
|
1798
|
-
const [commitPsbtHex, setCommitPsbtHex] = (0,
|
|
1799
|
-
const [commitPsbtBase64, setCommitPsbtBase64] = (0,
|
|
1800
|
-
const [commitTxId, setCommitTxId] = (0,
|
|
1801
|
-
const [feeRate, setFeeRate] = (0,
|
|
1802
|
-
const [totalFees, setTotalFees] = (0,
|
|
1803
|
-
const [inscriberAddress, setInscriberAddress] = (0,
|
|
1804
|
-
const [inscriptionTxId, setInscriptionTxId] = (0,
|
|
1805
|
-
const [previewUrl, setPreviewUrl] = (0,
|
|
1806
|
-
const [isFetchingCommitPsbt, setIsFetchingCommitPsbt] = (0,
|
|
1807
|
-
const [isInscribing, setIsInscribing] = (0,
|
|
1808
|
-
(0,
|
|
3375
|
+
const { address: address3, paymentAddress, paymentPublicKey, publicKey, signPsbt } = useLaserEyes();
|
|
3376
|
+
const [content, setContent] = (0, import_react34.useState)("");
|
|
3377
|
+
const [mimeType, setMimeType] = (0, import_react34.useState)(MIME_TYPE_TEXT);
|
|
3378
|
+
const [commitPsbtHex, setCommitPsbtHex] = (0, import_react34.useState)("");
|
|
3379
|
+
const [commitPsbtBase64, setCommitPsbtBase64] = (0, import_react34.useState)("");
|
|
3380
|
+
const [commitTxId, setCommitTxId] = (0, import_react34.useState)("");
|
|
3381
|
+
const [feeRate, setFeeRate] = (0, import_react34.useState)(10);
|
|
3382
|
+
const [totalFees, setTotalFees] = (0, import_react34.useState)(0);
|
|
3383
|
+
const [inscriberAddress, setInscriberAddress] = (0, import_react34.useState)("");
|
|
3384
|
+
const [inscriptionTxId, setInscriptionTxId] = (0, import_react34.useState)("");
|
|
3385
|
+
const [previewUrl, setPreviewUrl] = (0, import_react34.useState)("");
|
|
3386
|
+
const [isFetchingCommitPsbt, setIsFetchingCommitPsbt] = (0, import_react34.useState)(false);
|
|
3387
|
+
const [isInscribing, setIsInscribing] = (0, import_react34.useState)(false);
|
|
3388
|
+
(0, import_react34.useEffect)(() => {
|
|
1809
3389
|
setCommitPsbtHex("");
|
|
1810
3390
|
setCommitPsbtBase64("");
|
|
1811
3391
|
setCommitTxId("");
|
|
1812
|
-
}, [content,
|
|
1813
|
-
const getCommitPsbt = (0,
|
|
3392
|
+
}, [content, address3, mimeType, feeRate]);
|
|
3393
|
+
const getCommitPsbt = (0, import_react34.useCallback)(() => __async(void 0, null, function* () {
|
|
1814
3394
|
try {
|
|
1815
3395
|
if (!content)
|
|
1816
3396
|
throw new Error("missing content");
|
|
@@ -1823,7 +3403,7 @@ var useInscriber = ({
|
|
|
1823
3403
|
if (!mimeType)
|
|
1824
3404
|
throw new Error("missing mimeType");
|
|
1825
3405
|
setIsFetchingCommitPsbt(true);
|
|
1826
|
-
return yield
|
|
3406
|
+
return yield import_axios51.default.post(`${inscribeApiUrl}/create-inscription`, {
|
|
1827
3407
|
content,
|
|
1828
3408
|
paymentAddress,
|
|
1829
3409
|
paymentPublicKey,
|
|
@@ -1857,7 +3437,7 @@ var useInscriber = ({
|
|
|
1857
3437
|
throw e;
|
|
1858
3438
|
}
|
|
1859
3439
|
});
|
|
1860
|
-
const inscribe = (0,
|
|
3440
|
+
const inscribe = (0, import_react34.useCallback)(
|
|
1861
3441
|
(_0) => __async(void 0, [_0], function* ({
|
|
1862
3442
|
content: providedContent,
|
|
1863
3443
|
mimeType: providedMimeType,
|
|
@@ -1867,7 +3447,7 @@ var useInscriber = ({
|
|
|
1867
3447
|
try {
|
|
1868
3448
|
const inscribeContent = providedContent != null ? providedContent : content;
|
|
1869
3449
|
const inscribeMimeType = providedMimeType != null ? providedMimeType : mimeType;
|
|
1870
|
-
const inscribeOutputAddress = providedAddress != null ? providedAddress :
|
|
3450
|
+
const inscribeOutputAddress = providedAddress != null ? providedAddress : address3;
|
|
1871
3451
|
let inscribeCommitTxId = providedCommitTxId != null ? providedCommitTxId : commitTxId;
|
|
1872
3452
|
if (!inscribeContent)
|
|
1873
3453
|
throw new Error("missing content");
|
|
@@ -1886,10 +3466,10 @@ var useInscriber = ({
|
|
|
1886
3466
|
yield delay(1e4);
|
|
1887
3467
|
if (!inscribeCommitTxId)
|
|
1888
3468
|
throw new Error("missing commitTxId");
|
|
1889
|
-
return yield
|
|
3469
|
+
return yield import_axios51.default.post(`${inscribeApiUrl}/inscribe`, {
|
|
1890
3470
|
content,
|
|
1891
3471
|
mimeType,
|
|
1892
|
-
ordinalAddress:
|
|
3472
|
+
ordinalAddress: address3,
|
|
1893
3473
|
commitTxId: inscribeCommitTxId
|
|
1894
3474
|
}).then((res) => res.data).then((data) => {
|
|
1895
3475
|
setInscriptionTxId(data);
|
|
@@ -1902,7 +3482,7 @@ var useInscriber = ({
|
|
|
1902
3482
|
setIsInscribing(false);
|
|
1903
3483
|
}
|
|
1904
3484
|
}),
|
|
1905
|
-
[
|
|
3485
|
+
[address3, commitTxId, content, mimeType]
|
|
1906
3486
|
);
|
|
1907
3487
|
const reset = () => {
|
|
1908
3488
|
setContent("");
|
|
@@ -1953,6 +3533,8 @@ var useInscriber = ({
|
|
|
1953
3533
|
OKX,
|
|
1954
3534
|
OKX_MAINNET,
|
|
1955
3535
|
OKX_TESTNET,
|
|
3536
|
+
OP_WALLET_MAINNET,
|
|
3537
|
+
OP_WALLET_TESTNET,
|
|
1956
3538
|
OYL,
|
|
1957
3539
|
P2PKH,
|
|
1958
3540
|
P2PSH,
|