@omnisat/lasereyes 0.0.12 → 0.0.14
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 +18 -2
- package/dist/index.js +640 -8
- package/dist/index.mjs +632 -9
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -50,9 +50,14 @@ var UNISAT_MAINNET = "livenet";
|
|
|
50
50
|
var UNISAT_TESTNET = "testnet";
|
|
51
51
|
var XVERSE_MAINNET = "Mainnet";
|
|
52
52
|
var XVERSE_TESTNET = "Testnet";
|
|
53
|
+
var OKX_MAINNET = "livenet";
|
|
54
|
+
var OKX_TESTNET = "testnet";
|
|
55
|
+
var WIZZ_MAINNET = "livenet";
|
|
56
|
+
var WIZZ_TESTNET = "testnet";
|
|
53
57
|
var LEATHER_MAINNET = "mainnet";
|
|
54
58
|
var LEATHER_TESTNET = "testnet";
|
|
55
59
|
var MAINNET = "mainnet";
|
|
60
|
+
var SIGNET = "signet";
|
|
56
61
|
var TESTNET = "testnet";
|
|
57
62
|
var REGTEST = "regtest";
|
|
58
63
|
var getXverseNetwork = (network) => {
|
|
@@ -76,6 +81,13 @@ var getUnisatNetwork = (network) => {
|
|
|
76
81
|
return UNISAT_TESTNET;
|
|
77
82
|
return UNISAT_MAINNET;
|
|
78
83
|
};
|
|
84
|
+
var getWizzNetwork = (network) => {
|
|
85
|
+
if (network === MAINNET)
|
|
86
|
+
return WIZZ_MAINNET;
|
|
87
|
+
if (network === TESTNET)
|
|
88
|
+
return WIZZ_TESTNET;
|
|
89
|
+
return WIZZ_MAINNET;
|
|
90
|
+
};
|
|
79
91
|
var getNetworkForUnisat = (network) => {
|
|
80
92
|
if (network === UNISAT_MAINNET)
|
|
81
93
|
return MAINNET;
|
|
@@ -97,6 +109,20 @@ var getNetworkForLeather = (network) => {
|
|
|
97
109
|
return TESTNET;
|
|
98
110
|
return MAINNET;
|
|
99
111
|
};
|
|
112
|
+
var getNetworkForOkx = (network) => {
|
|
113
|
+
if (network === OKX_MAINNET)
|
|
114
|
+
return MAINNET;
|
|
115
|
+
if (network === OKX_TESTNET)
|
|
116
|
+
return TESTNET;
|
|
117
|
+
return MAINNET;
|
|
118
|
+
};
|
|
119
|
+
var getNetworkForWizz = (network) => {
|
|
120
|
+
if (network === WIZZ_MAINNET)
|
|
121
|
+
return MAINNET;
|
|
122
|
+
if (network === WIZZ_TESTNET)
|
|
123
|
+
return TESTNET;
|
|
124
|
+
return MAINNET;
|
|
125
|
+
};
|
|
100
126
|
var MEMPOOL_SPACE_URL = "https://mempool.space";
|
|
101
127
|
var MEMPOOL_SPACE_TESTNET_URL = "https://mempool.space/testnet";
|
|
102
128
|
var getMempoolSpaceUrl = (network) => network === TESTNET ? MEMPOOL_SPACE_TESTNET_URL : MEMPOOL_SPACE_URL;
|
|
@@ -107,6 +133,9 @@ var UNISAT = "unisat";
|
|
|
107
133
|
var XVERSE = "xverse";
|
|
108
134
|
var PHANTOM = "phantom";
|
|
109
135
|
var LEATHER = "leather";
|
|
136
|
+
var MAGIC_EDEN = "magic-eden";
|
|
137
|
+
var OKX = "okx";
|
|
138
|
+
var WIZZ = "wizz";
|
|
110
139
|
var P2TR = "p2tr";
|
|
111
140
|
var P2PKH = "p2pkh";
|
|
112
141
|
var P2WPKH = "p2wpkh";
|
|
@@ -165,6 +194,11 @@ var initialWalletContext = {
|
|
|
165
194
|
hasUnisat: false,
|
|
166
195
|
hasXverse: false,
|
|
167
196
|
hasOyl: false,
|
|
197
|
+
hasMagicEden: false,
|
|
198
|
+
hasOkx: false,
|
|
199
|
+
hasLeather: false,
|
|
200
|
+
hasPhantom: false,
|
|
201
|
+
hasWizz: false,
|
|
168
202
|
connected: false,
|
|
169
203
|
isConnecting: false,
|
|
170
204
|
publicKey: "",
|
|
@@ -344,7 +378,7 @@ function createSendBtcPsbt(address2, paymentAddress, recipientAddress, amount, p
|
|
|
344
378
|
value
|
|
345
379
|
}
|
|
346
380
|
});
|
|
347
|
-
if (isTaprootOnly) {
|
|
381
|
+
if (!isTaprootOnly) {
|
|
348
382
|
const redeemScript = getRedeemScript(paymentPublicKey, network);
|
|
349
383
|
psbt.updateInput(counter, { redeemScript });
|
|
350
384
|
}
|
|
@@ -397,12 +431,15 @@ function getRedeemScript(paymentPublicKey, network) {
|
|
|
397
431
|
|
|
398
432
|
// src/providers/LaserEyesProvider.tsx
|
|
399
433
|
import {
|
|
434
|
+
BitcoinNetworkType,
|
|
400
435
|
getAddress,
|
|
401
436
|
request,
|
|
402
437
|
RpcErrorCode,
|
|
403
|
-
signTransaction
|
|
438
|
+
signTransaction,
|
|
439
|
+
signMessage as signMessageSatsConnect
|
|
404
440
|
} from "sats-connect";
|
|
405
441
|
import { fromOutputScript } from "bitcoinjs-lib/src/address";
|
|
442
|
+
import axios2 from "axios";
|
|
406
443
|
import { jsx } from "react/jsx-runtime";
|
|
407
444
|
var LaserEyesContext = createContext(initialWalletContext);
|
|
408
445
|
var useLaserEyes = () => {
|
|
@@ -429,6 +466,11 @@ var LaserEyesProvider = ({
|
|
|
429
466
|
const [hasUnisat, setHasUnisat] = useState(false);
|
|
430
467
|
const [hasXverse, setHasXverse] = useState(false);
|
|
431
468
|
const [hasOyl, setHasOyl] = useState(false);
|
|
469
|
+
const [hasMagicEden, setHasMagicEden] = useState(false);
|
|
470
|
+
const [hasOkx, setHasOkx] = useState(false);
|
|
471
|
+
const [hasLeather, setHasLeather] = useState(false);
|
|
472
|
+
const [hasPhantom, setHasPhantom] = useState(false);
|
|
473
|
+
const [hasWizz, setHasWizz] = useState(false);
|
|
432
474
|
const [network, setNetwork] = useLocalStorage("network", MAINNET, {
|
|
433
475
|
initializeWithValue: false
|
|
434
476
|
});
|
|
@@ -457,11 +499,44 @@ var LaserEyesProvider = ({
|
|
|
457
499
|
const oylLib = window == null ? void 0 : window.oyl;
|
|
458
500
|
setHasOyl(!!oylLib);
|
|
459
501
|
}, []);
|
|
502
|
+
useEffect(() => {
|
|
503
|
+
const magicEdenLib = window == null ? void 0 : window.magicEden;
|
|
504
|
+
setHasMagicEden(!!magicEdenLib);
|
|
505
|
+
}, []);
|
|
506
|
+
useEffect(() => {
|
|
507
|
+
}, []);
|
|
508
|
+
useEffect(() => {
|
|
509
|
+
var _a, _b;
|
|
510
|
+
let foundOkx;
|
|
511
|
+
if (network === TESTNET) {
|
|
512
|
+
foundOkx = (_a = window.okxwallet) == null ? void 0 : _a.bitcoinTestnet;
|
|
513
|
+
} else if (network === MAINNET) {
|
|
514
|
+
foundOkx = (_b = window.okxwallet) == null ? void 0 : _b.bitcoin;
|
|
515
|
+
}
|
|
516
|
+
setHasOkx(!!foundOkx);
|
|
517
|
+
}, []);
|
|
518
|
+
useEffect(() => {
|
|
519
|
+
const leatherLib = window == null ? void 0 : window.LeatherProvider;
|
|
520
|
+
setHasLeather(!!leatherLib);
|
|
521
|
+
}, []);
|
|
522
|
+
useEffect(() => {
|
|
523
|
+
var _a;
|
|
524
|
+
const phantomLib = (_a = window == null ? void 0 : window.phantom) == null ? void 0 : _a.bitcoin;
|
|
525
|
+
if (phantomLib && phantomLib.isPhantom) {
|
|
526
|
+
setHasPhantom(!!phantomLib);
|
|
527
|
+
} else {
|
|
528
|
+
setHasPhantom(false);
|
|
529
|
+
}
|
|
530
|
+
}, []);
|
|
531
|
+
useEffect(() => {
|
|
532
|
+
const wissLib = window == null ? void 0 : window.wizz;
|
|
533
|
+
setHasWizz(!!wissLib);
|
|
534
|
+
}, []);
|
|
460
535
|
useEffect(() => {
|
|
461
536
|
setBalance(void 0);
|
|
462
537
|
}, [network]);
|
|
463
538
|
useEffect(() => {
|
|
464
|
-
if (provider !== UNISAT) {
|
|
539
|
+
if (provider !== UNISAT && provider !== WIZZ) {
|
|
465
540
|
return;
|
|
466
541
|
}
|
|
467
542
|
library.getAccounts().then((accounts2) => {
|
|
@@ -561,23 +636,196 @@ var LaserEyesProvider = ({
|
|
|
561
636
|
setProvider(OYL);
|
|
562
637
|
handleAccountsChanged(result);
|
|
563
638
|
setConnected(true);
|
|
639
|
+
getBTCBalance(result[1]).then((totalBalance) => {
|
|
640
|
+
setBalance(totalBalance);
|
|
641
|
+
});
|
|
564
642
|
} catch (error) {
|
|
565
643
|
throw new Error(`Can't lasereyes to ${OYL} wallet`);
|
|
566
644
|
}
|
|
567
645
|
});
|
|
646
|
+
const connectMagicEden = () => __async(void 0, null, function* () {
|
|
647
|
+
try {
|
|
648
|
+
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, MAGIC_EDEN);
|
|
649
|
+
let xverseNetwork = getXverseNetwork((config == null ? void 0 : config.network) || MAINNET);
|
|
650
|
+
const getAddressOptions = {
|
|
651
|
+
getProvider: () => __async(void 0, null, function* () {
|
|
652
|
+
return window.magicEden.bitcoin;
|
|
653
|
+
}),
|
|
654
|
+
payload: {
|
|
655
|
+
purposes: ["ordinals", "payment"],
|
|
656
|
+
message: "Address for receiving Ordinals and payments",
|
|
657
|
+
network: {
|
|
658
|
+
type: xverseNetwork
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
onFinish: (response) => {
|
|
662
|
+
setPublicKey(String(response.addresses[0].publicKey));
|
|
663
|
+
setPaymentPublicKey(String(response.addresses[1].publicKey));
|
|
664
|
+
const foundAddress = findOrdinalsAddress(response.addresses);
|
|
665
|
+
const foundPaymentAddress = findPaymentAddress(response.addresses);
|
|
666
|
+
if (foundAddress && foundPaymentAddress) {
|
|
667
|
+
setAddress(foundAddress.address);
|
|
668
|
+
setPaymentAddress(foundPaymentAddress.address);
|
|
669
|
+
setProvider(MAGIC_EDEN);
|
|
670
|
+
setLibrary(window.magicEden.bitcoin);
|
|
671
|
+
}
|
|
672
|
+
getBTCBalance(foundPaymentAddress.address).then((totalBalance) => {
|
|
673
|
+
setBalance(totalBalance);
|
|
674
|
+
});
|
|
675
|
+
},
|
|
676
|
+
onCancel: () => {
|
|
677
|
+
throw new Error(`User canceled lasereyes to ${MAGIC_EDEN} wallet`);
|
|
678
|
+
},
|
|
679
|
+
onError: (error) => {
|
|
680
|
+
throw new Error(`Can't lasereyes to ${MAGIC_EDEN} wallet`);
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
console.log(JSON.stringify(getAddressOptions));
|
|
684
|
+
yield getAddress(getAddressOptions);
|
|
685
|
+
setConnected(true);
|
|
686
|
+
} catch (error) {
|
|
687
|
+
console.log("error", error);
|
|
688
|
+
throw error;
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
const connectOkx = () => __async(void 0, null, function* () {
|
|
692
|
+
try {
|
|
693
|
+
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, OKX);
|
|
694
|
+
const lib = network === TESTNET ? window.okxwallet.bitcoinTestnet : window.okxwallet.bitcoin;
|
|
695
|
+
const okxAccounts = yield lib.requestAccounts();
|
|
696
|
+
if (!okxAccounts)
|
|
697
|
+
throw new Error("No accounts found");
|
|
698
|
+
const okxPubKey = yield lib.getPublicKey();
|
|
699
|
+
if (!okxPubKey)
|
|
700
|
+
throw new Error("No public key found");
|
|
701
|
+
setAccounts(okxAccounts);
|
|
702
|
+
setAddress(okxAccounts[0]);
|
|
703
|
+
setPaymentAddress(okxAccounts[0]);
|
|
704
|
+
setPublicKey(okxPubKey);
|
|
705
|
+
setPaymentPublicKey(okxPubKey);
|
|
706
|
+
setLibrary(lib);
|
|
707
|
+
setProvider(OKX);
|
|
708
|
+
setConnected(true);
|
|
709
|
+
const balance2 = yield lib == null ? void 0 : lib.getBalance();
|
|
710
|
+
setBalance(balance2 == null ? void 0 : balance2.total);
|
|
711
|
+
} catch (error) {
|
|
712
|
+
throw error;
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
const connectLeather = () => __async(void 0, null, function* () {
|
|
716
|
+
try {
|
|
717
|
+
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, LEATHER);
|
|
718
|
+
const lib = window.LeatherProvider;
|
|
719
|
+
const getAddressesResponse = yield lib.request(
|
|
720
|
+
"getAddresses"
|
|
721
|
+
);
|
|
722
|
+
const addressesResponse = getAddressesResponse.result;
|
|
723
|
+
const addresses = addressesResponse.addresses;
|
|
724
|
+
const leatherAccountsParsed = addresses.map(
|
|
725
|
+
(address3) => address3.address
|
|
726
|
+
);
|
|
727
|
+
const taprootAddress = addresses.find(
|
|
728
|
+
(address3) => address3.type === P2TR
|
|
729
|
+
);
|
|
730
|
+
const segwitAddress = addresses.find(
|
|
731
|
+
(address3) => address3.type === P2WPKH
|
|
732
|
+
);
|
|
733
|
+
setAccounts(leatherAccountsParsed);
|
|
734
|
+
setAddress(String(taprootAddress == null ? void 0 : taprootAddress.address));
|
|
735
|
+
setPublicKey(String(taprootAddress == null ? void 0 : taprootAddress.publicKey));
|
|
736
|
+
setPaymentAddress(String(segwitAddress == null ? void 0 : segwitAddress.address));
|
|
737
|
+
setPaymentPublicKey(String(segwitAddress == null ? void 0 : segwitAddress.publicKey));
|
|
738
|
+
setLibrary(lib);
|
|
739
|
+
setProvider(LEATHER);
|
|
740
|
+
const balance2 = yield getBTCBalance(String(segwitAddress == null ? void 0 : segwitAddress.address));
|
|
741
|
+
setBalance(balance2);
|
|
742
|
+
handleAccountsChanged(leatherAccountsParsed);
|
|
743
|
+
setConnected(true);
|
|
744
|
+
yield getNetwork().then((network2) => {
|
|
745
|
+
if (!network2) {
|
|
746
|
+
setNetwork(MAINNET);
|
|
747
|
+
} else {
|
|
748
|
+
setNetwork(network2);
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
setConnected(true);
|
|
752
|
+
} catch (error) {
|
|
753
|
+
new Error(`Can't lasereyes to ${LEATHER} wallet`);
|
|
754
|
+
}
|
|
755
|
+
});
|
|
756
|
+
const connectPhantom = () => __async(void 0, null, function* () {
|
|
757
|
+
try {
|
|
758
|
+
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, PHANTOM);
|
|
759
|
+
const lib = window.phantom.bitcoin;
|
|
760
|
+
const phantomAccounts = yield lib.requestAccounts();
|
|
761
|
+
const phantomAccountsParsed = phantomAccounts.map(
|
|
762
|
+
(account) => account.address
|
|
763
|
+
);
|
|
764
|
+
setAccounts(phantomAccountsParsed);
|
|
765
|
+
const ordinalsAccount = phantomAccounts.find(
|
|
766
|
+
(account) => account.purpose === "ordinals"
|
|
767
|
+
);
|
|
768
|
+
const paymentAccount = phantomAccounts.find(
|
|
769
|
+
(account) => account.purpose === "payment"
|
|
770
|
+
);
|
|
771
|
+
setAddress(ordinalsAccount == null ? void 0 : ordinalsAccount.address);
|
|
772
|
+
setPublicKey(ordinalsAccount == null ? void 0 : ordinalsAccount.publicKey);
|
|
773
|
+
setPaymentAddress(paymentAccount == null ? void 0 : paymentAccount.address);
|
|
774
|
+
setPaymentPublicKey(paymentAccount == null ? void 0 : paymentAccount.publicKey);
|
|
775
|
+
setLibrary(lib);
|
|
776
|
+
setProvider(PHANTOM);
|
|
777
|
+
const balance2 = yield getBTCBalance(String(paymentAccount == null ? void 0 : paymentAccount.address));
|
|
778
|
+
setBalance(balance2);
|
|
779
|
+
setConnected(true);
|
|
780
|
+
} catch (error) {
|
|
781
|
+
throw new Error(`Can't lasereyes to ${PHANTOM} wallet`);
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
const connectWizz = () => __async(void 0, null, function* () {
|
|
785
|
+
try {
|
|
786
|
+
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, WIZZ);
|
|
787
|
+
const lib = window.wizz;
|
|
788
|
+
const wizzAccounts = yield lib.requestAccounts();
|
|
789
|
+
if (!wizzAccounts)
|
|
790
|
+
throw new Error("No accounts found");
|
|
791
|
+
const wizzPubKey = yield lib.getPublicKey();
|
|
792
|
+
if (!wizzPubKey)
|
|
793
|
+
throw new Error("No public key found");
|
|
794
|
+
setAccounts(wizzAccounts);
|
|
795
|
+
setAddress(wizzAccounts[0]);
|
|
796
|
+
setPaymentAddress(wizzAccounts[0]);
|
|
797
|
+
setPublicKey(wizzPubKey);
|
|
798
|
+
setPaymentPublicKey(wizzPubKey);
|
|
799
|
+
setLibrary(lib);
|
|
800
|
+
setProvider(WIZZ);
|
|
801
|
+
setConnected(true);
|
|
802
|
+
const balance2 = yield lib == null ? void 0 : lib.getBalance();
|
|
803
|
+
setBalance(balance2 == null ? void 0 : balance2.total);
|
|
804
|
+
} catch (error) {
|
|
805
|
+
throw error;
|
|
806
|
+
}
|
|
807
|
+
});
|
|
568
808
|
const connect = (walletName) => __async(void 0, null, function* () {
|
|
569
809
|
setIsConnecting(true);
|
|
570
810
|
try {
|
|
571
811
|
if (!walletName)
|
|
572
812
|
throw new Error("No wallet provided");
|
|
573
813
|
if (walletName === UNISAT) {
|
|
574
|
-
console.log("connectin unisat");
|
|
575
814
|
yield connectUnisat();
|
|
576
815
|
} else if (walletName === XVERSE) {
|
|
577
816
|
yield connectXverse();
|
|
578
817
|
} else if (walletName === OYL) {
|
|
579
|
-
console.log("connectin oyl");
|
|
580
818
|
yield connectOyl();
|
|
819
|
+
} else if (walletName === MAGIC_EDEN) {
|
|
820
|
+
yield connectMagicEden();
|
|
821
|
+
} else if (walletName === OKX) {
|
|
822
|
+
yield connectOkx();
|
|
823
|
+
} else if (walletName === LEATHER) {
|
|
824
|
+
yield connectLeather();
|
|
825
|
+
} else if (walletName === PHANTOM) {
|
|
826
|
+
yield connectPhantom();
|
|
827
|
+
} else if (walletName === WIZZ) {
|
|
828
|
+
yield connectWizz();
|
|
581
829
|
} else {
|
|
582
830
|
throw new Error("Unsupported wallet..");
|
|
583
831
|
}
|
|
@@ -612,7 +860,6 @@ var LaserEyesProvider = ({
|
|
|
612
860
|
if (self.accounts[0] === _accounts[0]) {
|
|
613
861
|
return;
|
|
614
862
|
}
|
|
615
|
-
console.log("acct changed", _accounts[0]);
|
|
616
863
|
self.accounts = _accounts;
|
|
617
864
|
if (_accounts.length > 0) {
|
|
618
865
|
connect(UNISAT);
|
|
@@ -629,6 +876,10 @@ var LaserEyesProvider = ({
|
|
|
629
876
|
connect(provider);
|
|
630
877
|
} else if (provider === XVERSE) {
|
|
631
878
|
throw new Error("Not implemented");
|
|
879
|
+
} else if (provider === WIZZ) {
|
|
880
|
+
foundNetwork = getNetworkForWizz(network2);
|
|
881
|
+
setNetwork(foundNetwork);
|
|
882
|
+
connect(provider);
|
|
632
883
|
} else {
|
|
633
884
|
throw new Error("The connected wallet doesn't support this method..");
|
|
634
885
|
}
|
|
@@ -667,6 +918,48 @@ var LaserEyesProvider = ({
|
|
|
667
918
|
return [address2];
|
|
668
919
|
} else if (provider === OYL) {
|
|
669
920
|
return yield library.requestAccounts();
|
|
921
|
+
} else if (provider === OKX) {
|
|
922
|
+
return yield library.requestAccounts();
|
|
923
|
+
} else if (provider === LEATHER) {
|
|
924
|
+
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, LEATHER);
|
|
925
|
+
const lib = window.LeatherProvider;
|
|
926
|
+
const getAddressesResponse = yield lib.request(
|
|
927
|
+
"getAddresses"
|
|
928
|
+
);
|
|
929
|
+
const addressesResponse = getAddressesResponse.result;
|
|
930
|
+
const addresses = addressesResponse.addresses;
|
|
931
|
+
const leatherAccountsParsed = addresses.map(
|
|
932
|
+
(address3) => address3.address
|
|
933
|
+
);
|
|
934
|
+
const taprootAddress = addresses.find(
|
|
935
|
+
(address3) => address3.type === P2TR
|
|
936
|
+
);
|
|
937
|
+
const segwitAddress = addresses.find(
|
|
938
|
+
(address3) => address3.type === P2WPKH
|
|
939
|
+
);
|
|
940
|
+
setAccounts(leatherAccountsParsed);
|
|
941
|
+
setAddress(String(taprootAddress == null ? void 0 : taprootAddress.address));
|
|
942
|
+
setPaymentAddress(String(segwitAddress == null ? void 0 : segwitAddress.address));
|
|
943
|
+
setLibrary(lib);
|
|
944
|
+
setProvider(LEATHER);
|
|
945
|
+
handleAccountsChanged(leatherAccountsParsed);
|
|
946
|
+
setConnected(true);
|
|
947
|
+
yield getNetwork().then((network2) => {
|
|
948
|
+
if (!network2) {
|
|
949
|
+
setNetwork(MAINNET);
|
|
950
|
+
} else {
|
|
951
|
+
setNetwork(network2);
|
|
952
|
+
}
|
|
953
|
+
});
|
|
954
|
+
setConnected(true);
|
|
955
|
+
} else if (provider === PHANTOM) {
|
|
956
|
+
const phantomAccounts = yield library.requestAccounts();
|
|
957
|
+
const phantomAccountsParsed = phantomAccounts.map(
|
|
958
|
+
(account) => account.address
|
|
959
|
+
);
|
|
960
|
+
return phantomAccountsParsed;
|
|
961
|
+
} else if (provider === WIZZ) {
|
|
962
|
+
return yield library.requestAccounts();
|
|
670
963
|
} else {
|
|
671
964
|
throw new Error("The connected wallet doesn't support this method..");
|
|
672
965
|
}
|
|
@@ -694,6 +987,29 @@ var LaserEyesProvider = ({
|
|
|
694
987
|
return TESTNET;
|
|
695
988
|
}
|
|
696
989
|
return MAINNET;
|
|
990
|
+
} else if (provider === MAGIC_EDEN) {
|
|
991
|
+
if (address2.slice(0, 1) === "t") {
|
|
992
|
+
return TESTNET;
|
|
993
|
+
}
|
|
994
|
+
return MAINNET;
|
|
995
|
+
} else if (provider === OKX) {
|
|
996
|
+
const okxNetwork = yield library == null ? void 0 : library.getNetwork();
|
|
997
|
+
const foundNetwork = getNetworkForOkx(okxNetwork);
|
|
998
|
+
setNetwork(foundNetwork);
|
|
999
|
+
} else if (provider === LEATHER) {
|
|
1000
|
+
if (address2.slice(0, 1) === "t") {
|
|
1001
|
+
return TESTNET;
|
|
1002
|
+
}
|
|
1003
|
+
return MAINNET;
|
|
1004
|
+
} else if (provider === PHANTOM) {
|
|
1005
|
+
if (address2.slice(0, 1) === "t") {
|
|
1006
|
+
return TESTNET;
|
|
1007
|
+
}
|
|
1008
|
+
return MAINNET;
|
|
1009
|
+
} else if (provider === WIZZ) {
|
|
1010
|
+
const wizzNetwork = yield library == null ? void 0 : library.getNetwork();
|
|
1011
|
+
const foundNetwork = getNetworkForWizz(wizzNetwork);
|
|
1012
|
+
setNetwork(foundNetwork);
|
|
697
1013
|
}
|
|
698
1014
|
return (_a = config == null ? void 0 : config.network) != null ? _a : MAINNET;
|
|
699
1015
|
} catch (error) {
|
|
@@ -705,7 +1021,11 @@ var LaserEyesProvider = ({
|
|
|
705
1021
|
if (!library)
|
|
706
1022
|
return;
|
|
707
1023
|
if (provider === UNISAT) {
|
|
708
|
-
const wantedNetwork =
|
|
1024
|
+
const wantedNetwork = getWizzNetwork(network2);
|
|
1025
|
+
yield library == null ? void 0 : library.switchNetwork(wantedNetwork);
|
|
1026
|
+
setNetwork(network2);
|
|
1027
|
+
} else if (provider === WIZZ) {
|
|
1028
|
+
const wantedNetwork = getNetworkForWizz(network2);
|
|
709
1029
|
yield library == null ? void 0 : library.switchNetwork(wantedNetwork);
|
|
710
1030
|
setNetwork(network2);
|
|
711
1031
|
} else {
|
|
@@ -723,6 +1043,10 @@ var LaserEyesProvider = ({
|
|
|
723
1043
|
return yield library == null ? void 0 : library.getPublicKey();
|
|
724
1044
|
} else if (provider === OYL) {
|
|
725
1045
|
return yield library == null ? void 0 : library.getPublicKey();
|
|
1046
|
+
} else if (provider === OKX) {
|
|
1047
|
+
return yield library == null ? void 0 : library.getPublicKey();
|
|
1048
|
+
} else if (provider === WIZZ) {
|
|
1049
|
+
return yield library == null ? void 0 : library.getPublicKey();
|
|
726
1050
|
} else {
|
|
727
1051
|
throw new Error("The connected wallet doesn't support this method..");
|
|
728
1052
|
}
|
|
@@ -741,6 +1065,17 @@ var LaserEyesProvider = ({
|
|
|
741
1065
|
} else if (provider === OYL) {
|
|
742
1066
|
const balanceResponse = yield library.getBalance();
|
|
743
1067
|
return balanceResponse.btc.total * 1e8;
|
|
1068
|
+
} else if (provider === MAGIC_EDEN) {
|
|
1069
|
+
return yield getBTCBalance(paymentAddress);
|
|
1070
|
+
} else if (provider === OKX) {
|
|
1071
|
+
return yield getBTCBalance(paymentAddress);
|
|
1072
|
+
} else if (provider === LEATHER) {
|
|
1073
|
+
return yield getBTCBalance(paymentAddress);
|
|
1074
|
+
} else if (provider === PHANTOM) {
|
|
1075
|
+
return yield getBTCBalance(paymentAddress);
|
|
1076
|
+
} else if (provider === WIZZ) {
|
|
1077
|
+
const balanceResponse = yield library.getBalance();
|
|
1078
|
+
return balanceResponse.total * 1e8;
|
|
744
1079
|
}
|
|
745
1080
|
} catch (error) {
|
|
746
1081
|
throw error;
|
|
@@ -754,6 +1089,10 @@ var LaserEyesProvider = ({
|
|
|
754
1089
|
return yield library.getInscriptions(0, 10);
|
|
755
1090
|
} else if (provider === OYL) {
|
|
756
1091
|
return yield library.getInscriptions(0, 10);
|
|
1092
|
+
} else if (provider === OKX) {
|
|
1093
|
+
return yield library.getInscriptions(0, 10);
|
|
1094
|
+
} else if (provider === WIZZ) {
|
|
1095
|
+
return yield library.getInscriptions(0, 10);
|
|
757
1096
|
} else {
|
|
758
1097
|
throw new Error("The connected wallet doesn't support this method..");
|
|
759
1098
|
}
|
|
@@ -762,6 +1101,7 @@ var LaserEyesProvider = ({
|
|
|
762
1101
|
}
|
|
763
1102
|
});
|
|
764
1103
|
const sendBTC = (to, amount) => __async(void 0, null, function* () {
|
|
1104
|
+
var _a;
|
|
765
1105
|
try {
|
|
766
1106
|
if (amount <= 0)
|
|
767
1107
|
throw new Error("Amount must be greater than 0");
|
|
@@ -793,6 +1133,21 @@ var LaserEyesProvider = ({
|
|
|
793
1133
|
}
|
|
794
1134
|
}
|
|
795
1135
|
} else if (provider === OYL) {
|
|
1136
|
+
const { psbtHex, psbtBase64 } = yield createSendBtcPsbt(
|
|
1137
|
+
address2,
|
|
1138
|
+
paymentAddress,
|
|
1139
|
+
to,
|
|
1140
|
+
amount,
|
|
1141
|
+
paymentPublicKey,
|
|
1142
|
+
//@ts-ignore
|
|
1143
|
+
network,
|
|
1144
|
+
7
|
|
1145
|
+
);
|
|
1146
|
+
const psbt = yield signPsbt(psbtHex, true, true);
|
|
1147
|
+
if (!psbt)
|
|
1148
|
+
throw new Error("Error sending BTC");
|
|
1149
|
+
return psbt.txId;
|
|
1150
|
+
} else if (provider === MAGIC_EDEN) {
|
|
796
1151
|
const { psbtHex, psbtBase64 } = yield createSendBtcPsbt(
|
|
797
1152
|
address2,
|
|
798
1153
|
paymentAddress,
|
|
@@ -807,12 +1162,43 @@ var LaserEyesProvider = ({
|
|
|
807
1162
|
if (!psbt)
|
|
808
1163
|
throw new Error("Error sending BTC");
|
|
809
1164
|
return psbt.txId;
|
|
1165
|
+
} else if (provider === OKX) {
|
|
1166
|
+
const txId = yield library == null ? void 0 : library.sendBitcoin(to, amount);
|
|
1167
|
+
if (!txId)
|
|
1168
|
+
throw new Error("Transaction failed");
|
|
1169
|
+
return txId;
|
|
1170
|
+
} else if (provider === LEATHER) {
|
|
1171
|
+
const response = yield library == null ? void 0 : library.request("sendTransfer", {
|
|
1172
|
+
recipients: [
|
|
1173
|
+
{
|
|
1174
|
+
address: to,
|
|
1175
|
+
amount
|
|
1176
|
+
}
|
|
1177
|
+
]
|
|
1178
|
+
});
|
|
1179
|
+
if ((_a = response == null ? void 0 : response.result) == null ? void 0 : _a.txid) {
|
|
1180
|
+
return response.result.txid;
|
|
1181
|
+
} else {
|
|
1182
|
+
if (response.error.code === RpcErrorCode.USER_REJECTION) {
|
|
1183
|
+
throw new Error("User rejected the request");
|
|
1184
|
+
} else {
|
|
1185
|
+
throw new Error("Error sending BTC: " + response.error.message);
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
} else if (provider === WIZZ) {
|
|
1189
|
+
const txId = yield library == null ? void 0 : library.sendBitcoin(to, amount);
|
|
1190
|
+
if (txId) {
|
|
1191
|
+
return txId;
|
|
1192
|
+
} else {
|
|
1193
|
+
throw new Error("Error sending BTC");
|
|
1194
|
+
}
|
|
810
1195
|
}
|
|
811
1196
|
} catch (error) {
|
|
812
1197
|
throw error;
|
|
813
1198
|
}
|
|
814
1199
|
});
|
|
815
1200
|
const signMessage = (message) => __async(void 0, null, function* () {
|
|
1201
|
+
var _a;
|
|
816
1202
|
try {
|
|
817
1203
|
if (!library)
|
|
818
1204
|
return;
|
|
@@ -832,6 +1218,47 @@ var LaserEyesProvider = ({
|
|
|
832
1218
|
throw new Error("Error signing message: " + response.error.message);
|
|
833
1219
|
}
|
|
834
1220
|
}
|
|
1221
|
+
} else if (provider === MAGIC_EDEN) {
|
|
1222
|
+
let signedMessage;
|
|
1223
|
+
yield signMessageSatsConnect({
|
|
1224
|
+
getProvider: () => __async(void 0, null, function* () {
|
|
1225
|
+
return window.magicEden.bitcoin;
|
|
1226
|
+
}),
|
|
1227
|
+
payload: {
|
|
1228
|
+
network: {
|
|
1229
|
+
type: BitcoinNetworkType.Mainnet
|
|
1230
|
+
},
|
|
1231
|
+
address: address2,
|
|
1232
|
+
message
|
|
1233
|
+
},
|
|
1234
|
+
onFinish: (response) => {
|
|
1235
|
+
signedMessage = response;
|
|
1236
|
+
},
|
|
1237
|
+
onCancel: () => {
|
|
1238
|
+
alert("Request canceled");
|
|
1239
|
+
}
|
|
1240
|
+
});
|
|
1241
|
+
return signedMessage;
|
|
1242
|
+
} else if (provider === OKX) {
|
|
1243
|
+
return yield library == null ? void 0 : library.signMessage(message);
|
|
1244
|
+
} else if (provider === LEATHER) {
|
|
1245
|
+
const signed = yield library == null ? void 0 : library.request("signMessage", {
|
|
1246
|
+
message,
|
|
1247
|
+
paymentType: P2TR
|
|
1248
|
+
});
|
|
1249
|
+
console.log(signed);
|
|
1250
|
+
return (_a = signed == null ? void 0 : signed.result) == null ? void 0 : _a.signature;
|
|
1251
|
+
} else if (provider === PHANTOM) {
|
|
1252
|
+
const utf8Bytes = new TextEncoder().encode(message);
|
|
1253
|
+
const uintArray = new Uint8Array(utf8Bytes);
|
|
1254
|
+
const response = yield library == null ? void 0 : library.signMessage(address2, uintArray);
|
|
1255
|
+
console.log(response);
|
|
1256
|
+
const binaryString = String.fromCharCode(...response.signature);
|
|
1257
|
+
return btoa(binaryString);
|
|
1258
|
+
} else if (provider === WIZZ) {
|
|
1259
|
+
return yield library == null ? void 0 : library.signMessage(message);
|
|
1260
|
+
} else {
|
|
1261
|
+
throw new Error("The connected wallet doesn't support this method..");
|
|
835
1262
|
}
|
|
836
1263
|
} catch (error) {
|
|
837
1264
|
throw error;
|
|
@@ -969,11 +1396,183 @@ var LaserEyesProvider = ({
|
|
|
969
1396
|
txId: void 0
|
|
970
1397
|
};
|
|
971
1398
|
}
|
|
1399
|
+
} else if (provider === MAGIC_EDEN) {
|
|
1400
|
+
const toSignPsbt = bitcoin2.Psbt.fromBase64(String(psbtBase64), {
|
|
1401
|
+
network: getBitcoinNetwork(network)
|
|
1402
|
+
});
|
|
1403
|
+
const inputs = toSignPsbt.data.inputs;
|
|
1404
|
+
const inputsToSign = [];
|
|
1405
|
+
const ordinalAddressData = {
|
|
1406
|
+
address: address2,
|
|
1407
|
+
signingIndexes: []
|
|
1408
|
+
};
|
|
1409
|
+
const paymentsAddressData = {
|
|
1410
|
+
address: paymentAddress,
|
|
1411
|
+
signingIndexes: []
|
|
1412
|
+
};
|
|
1413
|
+
let counter = 0;
|
|
1414
|
+
try {
|
|
1415
|
+
for (var iter2 = __forAwait(inputs), more2, temp2, error2; more2 = !(temp2 = yield iter2.next()).done; more2 = false) {
|
|
1416
|
+
let input = temp2.value;
|
|
1417
|
+
const { script } = input.witnessUtxo;
|
|
1418
|
+
const addressFromScript = fromOutputScript(
|
|
1419
|
+
script,
|
|
1420
|
+
getBitcoinNetwork(network)
|
|
1421
|
+
);
|
|
1422
|
+
if (addressFromScript === paymentAddress) {
|
|
1423
|
+
paymentsAddressData.signingIndexes.push(Number(counter));
|
|
1424
|
+
} else if (addressFromScript === address2) {
|
|
1425
|
+
ordinalAddressData.signingIndexes.push(Number(counter));
|
|
1426
|
+
}
|
|
1427
|
+
counter++;
|
|
1428
|
+
}
|
|
1429
|
+
} catch (temp2) {
|
|
1430
|
+
error2 = [temp2];
|
|
1431
|
+
} finally {
|
|
1432
|
+
try {
|
|
1433
|
+
more2 && (temp2 = iter2.return) && (yield temp2.call(iter2));
|
|
1434
|
+
} finally {
|
|
1435
|
+
if (error2)
|
|
1436
|
+
throw error2[0];
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
if (ordinalAddressData.signingIndexes.length > 0) {
|
|
1440
|
+
inputsToSign.push(ordinalAddressData);
|
|
1441
|
+
}
|
|
1442
|
+
if (paymentsAddressData.signingIndexes.length > 0) {
|
|
1443
|
+
inputsToSign.push(paymentsAddressData);
|
|
1444
|
+
}
|
|
1445
|
+
let txId, signedPsbtHex, signedPsbtBase64;
|
|
1446
|
+
const xverseNetwork = getXverseNetwork(network);
|
|
1447
|
+
const signPsbtOptions = {
|
|
1448
|
+
getProvider: () => __async(void 0, null, function* () {
|
|
1449
|
+
return window.magicEden.bitcoin;
|
|
1450
|
+
}),
|
|
1451
|
+
payload: {
|
|
1452
|
+
network: {
|
|
1453
|
+
type: xverseNetwork
|
|
1454
|
+
},
|
|
1455
|
+
message: "Sign Transaction",
|
|
1456
|
+
psbtBase64: toSignPsbt.toBase64(),
|
|
1457
|
+
broadcast,
|
|
1458
|
+
inputsToSign
|
|
1459
|
+
},
|
|
1460
|
+
onFinish: (response) => {
|
|
1461
|
+
if (response.psbtBase64) {
|
|
1462
|
+
const signedPsbt = bitcoin2.Psbt.fromBase64(
|
|
1463
|
+
String(response.psbtBase64),
|
|
1464
|
+
{
|
|
1465
|
+
network: getBitcoinNetwork(network)
|
|
1466
|
+
}
|
|
1467
|
+
);
|
|
1468
|
+
signedPsbtHex = signedPsbt.toHex();
|
|
1469
|
+
signedPsbtBase64 = signedPsbt.toBase64();
|
|
1470
|
+
}
|
|
1471
|
+
},
|
|
1472
|
+
onCancel: () => {
|
|
1473
|
+
console.log("Canceled");
|
|
1474
|
+
throw new Error("User canceled the request");
|
|
1475
|
+
},
|
|
1476
|
+
onError: (error3) => {
|
|
1477
|
+
console.log("error", error3);
|
|
1478
|
+
throw error3;
|
|
1479
|
+
}
|
|
1480
|
+
};
|
|
1481
|
+
yield signTransaction(signPsbtOptions);
|
|
1482
|
+
if (broadcast) {
|
|
1483
|
+
const signed = bitcoin2.Psbt.fromBase64(String(signedPsbtBase64));
|
|
1484
|
+
const finalized = signed.finalizeAllInputs();
|
|
1485
|
+
const extracted = finalized.extractTransaction();
|
|
1486
|
+
const txId2 = yield pushPsbt(extracted.toHex());
|
|
1487
|
+
return {
|
|
1488
|
+
signedPsbtHex: extracted.toHex(),
|
|
1489
|
+
signedPsbtBase64: "test",
|
|
1490
|
+
txId: txId2
|
|
1491
|
+
};
|
|
1492
|
+
} else {
|
|
1493
|
+
return {
|
|
1494
|
+
signedPsbtHex,
|
|
1495
|
+
signedPsbtBase64,
|
|
1496
|
+
txId
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1499
|
+
} else if (provider === OKX) {
|
|
1500
|
+
const signedPsbt = yield library == null ? void 0 : library.signPsbt(psbtHex, {
|
|
1501
|
+
autoFinalized: finalize
|
|
1502
|
+
});
|
|
1503
|
+
const psbtSignedPsbt = bitcoin2.Psbt.fromHex(signedPsbt);
|
|
1504
|
+
if (finalize && broadcast) {
|
|
1505
|
+
const txId = yield pushPsbt(signedPsbt);
|
|
1506
|
+
return {
|
|
1507
|
+
signedPsbtHex: psbtSignedPsbt.toHex(),
|
|
1508
|
+
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
1509
|
+
txId
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
return {
|
|
1513
|
+
signedPsbtHex: psbtSignedPsbt.toHex(),
|
|
1514
|
+
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
1515
|
+
txId: void 0
|
|
1516
|
+
};
|
|
1517
|
+
} else if (provider === LEATHER) {
|
|
1518
|
+
const requestParams = {
|
|
1519
|
+
hex: psbtHex,
|
|
1520
|
+
broadcast
|
|
1521
|
+
};
|
|
1522
|
+
const response = yield library == null ? void 0 : library.request(
|
|
1523
|
+
"signPsbt",
|
|
1524
|
+
requestParams
|
|
1525
|
+
);
|
|
1526
|
+
const leatherHexResult = response.result;
|
|
1527
|
+
const signedTx = leatherHexResult.hex;
|
|
1528
|
+
const signed = bitcoin2.Psbt.fromBase64(String(signedTx));
|
|
1529
|
+
if (finalize && broadcast) {
|
|
1530
|
+
const finalized = signed.finalizeAllInputs();
|
|
1531
|
+
const extracted = finalized.extractTransaction();
|
|
1532
|
+
const txId = yield pushPsbt(extracted.toHex());
|
|
1533
|
+
return {
|
|
1534
|
+
signedPsbtHex: signed.toHex(),
|
|
1535
|
+
signedPsbtBase64: signed.toBase64(),
|
|
1536
|
+
txId
|
|
1537
|
+
};
|
|
1538
|
+
} else if (finalize) {
|
|
1539
|
+
const finalized = signed.finalizeAllInputs();
|
|
1540
|
+
return {
|
|
1541
|
+
signedPsbtHex: finalized.toHex(),
|
|
1542
|
+
signedPsbtBase64: finalized.toBase64(),
|
|
1543
|
+
txId: void 0
|
|
1544
|
+
};
|
|
1545
|
+
} else {
|
|
1546
|
+
return {
|
|
1547
|
+
signedPsbtHex: signed.toHex(),
|
|
1548
|
+
signedPsbtBase64: signed.toBase64(),
|
|
1549
|
+
txId: void 0
|
|
1550
|
+
};
|
|
1551
|
+
}
|
|
1552
|
+
} else if (provider === WIZZ) {
|
|
1553
|
+
const signedPsbt = yield library == null ? void 0 : library.signPsbt(psbtHex, {
|
|
1554
|
+
autoFinalized: finalize,
|
|
1555
|
+
broadcast: false
|
|
1556
|
+
});
|
|
1557
|
+
const psbtSignedPsbt = bitcoin2.Psbt.fromHex(signedPsbt);
|
|
1558
|
+
if (finalize && broadcast) {
|
|
1559
|
+
const txId = yield pushPsbt(signedPsbt);
|
|
1560
|
+
return {
|
|
1561
|
+
signedPsbtHex: psbtSignedPsbt.toHex(),
|
|
1562
|
+
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
1563
|
+
txId
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
return {
|
|
1567
|
+
signedPsbtHex: psbtSignedPsbt.toHex(),
|
|
1568
|
+
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
1569
|
+
txId: void 0
|
|
1570
|
+
};
|
|
972
1571
|
} else {
|
|
973
1572
|
throw new Error("The connected wallet doesn't support this method..");
|
|
974
1573
|
}
|
|
975
|
-
} catch (
|
|
976
|
-
throw
|
|
1574
|
+
} catch (error3) {
|
|
1575
|
+
throw error3;
|
|
977
1576
|
}
|
|
978
1577
|
});
|
|
979
1578
|
const pushPsbt = (psbt) => __async(void 0, null, function* () {
|
|
@@ -984,6 +1583,14 @@ var LaserEyesProvider = ({
|
|
|
984
1583
|
return yield library == null ? void 0 : library.pushPsbt(psbt);
|
|
985
1584
|
} else if (provider === OYL) {
|
|
986
1585
|
return yield library == null ? void 0 : library.pushPsbt(psbt);
|
|
1586
|
+
} else if (provider === OKX) {
|
|
1587
|
+
return yield library == null ? void 0 : library.pushPsbt(psbt);
|
|
1588
|
+
} else if (provider === MAGIC_EDEN) {
|
|
1589
|
+
return yield axios2.post("https://mempool.space/api/tx", psbt).then((res) => res.data);
|
|
1590
|
+
} else if (provider === LEATHER) {
|
|
1591
|
+
return yield axios2.post("https://mempool.space/api/tx", psbt).then((res) => res.data);
|
|
1592
|
+
} else if (provider === WIZZ) {
|
|
1593
|
+
return yield library == null ? void 0 : library.pushPsbt(psbt);
|
|
987
1594
|
} else {
|
|
988
1595
|
throw new Error("The connected wallet doesn't support this method..");
|
|
989
1596
|
}
|
|
@@ -1009,6 +1616,11 @@ var LaserEyesProvider = ({
|
|
|
1009
1616
|
hasUnisat,
|
|
1010
1617
|
hasXverse,
|
|
1011
1618
|
hasOyl,
|
|
1619
|
+
hasMagicEden,
|
|
1620
|
+
hasOkx,
|
|
1621
|
+
hasLeather,
|
|
1622
|
+
hasPhantom,
|
|
1623
|
+
hasWizz,
|
|
1012
1624
|
// functions
|
|
1013
1625
|
connect,
|
|
1014
1626
|
disconnect,
|
|
@@ -1032,9 +1644,13 @@ export {
|
|
|
1032
1644
|
LEATHER_MAINNET,
|
|
1033
1645
|
LEATHER_TESTNET,
|
|
1034
1646
|
LaserEyesProvider,
|
|
1647
|
+
MAGIC_EDEN,
|
|
1035
1648
|
MAINNET,
|
|
1036
1649
|
MEMPOOL_SPACE_TESTNET_URL,
|
|
1037
1650
|
MEMPOOL_SPACE_URL,
|
|
1651
|
+
OKX,
|
|
1652
|
+
OKX_MAINNET,
|
|
1653
|
+
OKX_TESTNET,
|
|
1038
1654
|
OYL,
|
|
1039
1655
|
P2PKH,
|
|
1040
1656
|
P2PSH,
|
|
@@ -1044,11 +1660,15 @@ export {
|
|
|
1044
1660
|
P2WSH,
|
|
1045
1661
|
PHANTOM,
|
|
1046
1662
|
REGTEST,
|
|
1663
|
+
SIGNET,
|
|
1047
1664
|
TESTNET,
|
|
1048
1665
|
UNISAT,
|
|
1049
1666
|
UNISAT_MAINNET,
|
|
1050
1667
|
UNISAT_TESTNET,
|
|
1051
1668
|
WALLETS,
|
|
1669
|
+
WIZZ,
|
|
1670
|
+
WIZZ_MAINNET,
|
|
1671
|
+
WIZZ_TESTNET,
|
|
1052
1672
|
XVERSE,
|
|
1053
1673
|
XVERSE_MAINNET,
|
|
1054
1674
|
XVERSE_NETWORK,
|
|
@@ -1065,10 +1685,13 @@ export {
|
|
|
1065
1685
|
getLeatherNetwork,
|
|
1066
1686
|
getMempoolSpaceUrl,
|
|
1067
1687
|
getNetworkForLeather,
|
|
1688
|
+
getNetworkForOkx,
|
|
1068
1689
|
getNetworkForUnisat,
|
|
1690
|
+
getNetworkForWizz,
|
|
1069
1691
|
getNetworkForXverse,
|
|
1070
1692
|
getRedeemScript,
|
|
1071
1693
|
getUnisatNetwork,
|
|
1694
|
+
getWizzNetwork,
|
|
1072
1695
|
getXverseNetwork,
|
|
1073
1696
|
isBase64,
|
|
1074
1697
|
isHex,
|