@moon-x/react-sdk 0.8.0 → 0.9.0
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/README.md +98 -19
- package/dist/{chunk-Y6HSLN2H.mjs → chunk-7XFCJAFG.mjs} +75 -74
- package/dist/{chunk-4YS67FSE.js → chunk-F345C4FX.js} +107 -102
- package/dist/{chunk-RFAKWGRF.mjs → chunk-OAG4S5VJ.mjs} +20 -19
- package/dist/{chunk-YFGHPPR5.js → chunk-VBAVYDWQ.js} +236 -241
- package/dist/{ethereum-CWhbeptv.d.ts → ethereum-Eg3cJKce.d.ts} +20 -6
- package/dist/{ethereum-CGSlkQOw.d.mts → ethereum-lovLlqC2.d.mts} +20 -6
- package/dist/index.d.mts +146 -17
- package/dist/index.d.ts +146 -17
- package/dist/index.js +3085 -2647
- package/dist/index.mjs +1550 -1470
- package/dist/{solana-Cr7r3wi8.d.mts → solana-BVrNImZ1.d.mts} +13 -4
- package/dist/{solana-nUvZo4Zp.d.ts → solana-C9rN8lxH.d.ts} +13 -4
- package/dist/wallets/ethereum.d.mts +1 -1
- package/dist/wallets/ethereum.d.ts +1 -1
- package/dist/wallets/ethereum.js +15 -15
- package/dist/wallets/ethereum.mjs +1 -1
- package/dist/wallets/solana.d.mts +1 -1
- package/dist/wallets/solana.d.ts +1 -1
- package/dist/wallets/solana.js +11 -11
- package/dist/wallets/solana.mjs +1 -1
- package/package.json +6 -3
|
@@ -305,6 +305,7 @@ _chunkSPXMMQ7Zjs.__export.call(void 0, solana_exports, {
|
|
|
305
305
|
});
|
|
306
306
|
var _solana = require('@moon-x/core/react/solana');
|
|
307
307
|
var _react = require('@moon-x/core/react');
|
|
308
|
+
var _lib = require('@moon-x/core/lib');
|
|
308
309
|
// src/wallets/solana/use-fund-wallet.ts
|
|
309
310
|
var useFundWallet = function useFundWallet() {
|
|
310
311
|
var sdk = _chunkSPXMMQ7Zjs.useAuthSDK.call(void 0);
|
|
@@ -600,7 +601,7 @@ var useSendTransaction = function useSendTransaction() {
|
|
|
600
601
|
return {
|
|
601
602
|
sendTransaction: function sendTransaction(params) {
|
|
602
603
|
return _async_to_generator(function() {
|
|
603
|
-
var
|
|
604
|
+
var entry, chain, rpcUrl, wsEndpoint, bs58, transactionString, showWalletUI, error;
|
|
604
605
|
return _ts_generator(this, function(_state) {
|
|
605
606
|
switch(_state.label){
|
|
606
607
|
case 0:
|
|
@@ -610,10 +611,7 @@ var useSendTransaction = function useSendTransaction() {
|
|
|
610
611
|
,
|
|
611
612
|
4
|
|
612
613
|
]);
|
|
613
|
-
|
|
614
|
-
return "solana:mainnet";
|
|
615
|
-
});
|
|
616
|
-
rpcConfig = _optionalChain([
|
|
614
|
+
entry = _lib.resolveSolanaChainEntry.call(void 0, _optionalChain([
|
|
617
615
|
coreSDK,
|
|
618
616
|
'access',
|
|
619
617
|
function(_21) {
|
|
@@ -621,33 +619,36 @@ var useSendTransaction = function useSendTransaction() {
|
|
|
621
619
|
},
|
|
622
620
|
'optionalAccess',
|
|
623
621
|
function(_22) {
|
|
624
|
-
return _22.
|
|
625
|
-
}
|
|
626
|
-
|
|
622
|
+
return _22.chains;
|
|
623
|
+
}
|
|
624
|
+
]), params.chain, _optionalChain([
|
|
625
|
+
coreSDK,
|
|
626
|
+
'access',
|
|
627
627
|
function(_23) {
|
|
628
|
-
return _23.
|
|
628
|
+
return _23.config;
|
|
629
629
|
},
|
|
630
630
|
'optionalAccess',
|
|
631
631
|
function(_24) {
|
|
632
|
-
return _24
|
|
632
|
+
return _24.defaultChain;
|
|
633
633
|
}
|
|
634
|
-
]);
|
|
635
|
-
|
|
636
|
-
|
|
634
|
+
]));
|
|
635
|
+
chain = _nullishCoalesce(_nullishCoalesce(_optionalChain([
|
|
636
|
+
entry,
|
|
637
637
|
'optionalAccess',
|
|
638
638
|
function(_25) {
|
|
639
|
-
return _25.
|
|
640
|
-
}
|
|
641
|
-
]);
|
|
642
|
-
wsEndpoint = _optionalChain([
|
|
643
|
-
rpcConfig,
|
|
644
|
-
'optionalAccess',
|
|
645
|
-
function(_26) {
|
|
646
|
-
return _26.rpcSubscriptions;
|
|
639
|
+
return _25.id;
|
|
647
640
|
}
|
|
648
|
-
])
|
|
641
|
+
]), function() {
|
|
642
|
+
return params.chain;
|
|
643
|
+
}), function() {
|
|
644
|
+
return "solana:mainnet";
|
|
645
|
+
});
|
|
646
|
+
rpcUrl = _nullishCoalesce(params.rpcUrl, function() {
|
|
647
|
+
return entry ? _lib.resolveRpcUrl.call(void 0, entry) : void 0;
|
|
648
|
+
});
|
|
649
|
+
wsEndpoint = entry ? _lib.resolveWsUrl.call(void 0, entry) : void 0;
|
|
649
650
|
if (!rpcUrl) {
|
|
650
|
-
throw new Error(
|
|
651
|
+
throw new Error('No RPC URL for chain "'.concat(chain, '". Add it to `chains` in MoonKeyProvider config, or pass an `rpcUrl`.'));
|
|
651
652
|
}
|
|
652
653
|
return [
|
|
653
654
|
4,
|
|
@@ -661,26 +662,26 @@ var useSendTransaction = function useSendTransaction() {
|
|
|
661
662
|
showWalletUI = _chunkSPXMMQ7Zjs.shouldShowWalletUI.call(void 0, _optionalChain([
|
|
662
663
|
params,
|
|
663
664
|
'access',
|
|
664
|
-
function(
|
|
665
|
-
return
|
|
665
|
+
function(_26) {
|
|
666
|
+
return _26.options;
|
|
666
667
|
},
|
|
667
668
|
'optionalAccess',
|
|
668
|
-
function(
|
|
669
|
-
return
|
|
669
|
+
function(_27) {
|
|
670
|
+
return _27.uiOptions;
|
|
670
671
|
}
|
|
671
672
|
]), _optionalChain([
|
|
672
673
|
coreSDK,
|
|
673
674
|
'access',
|
|
674
|
-
function(
|
|
675
|
-
return
|
|
675
|
+
function(_28) {
|
|
676
|
+
return _28.config;
|
|
676
677
|
},
|
|
677
678
|
'optionalAccess',
|
|
678
|
-
function(
|
|
679
|
-
return
|
|
679
|
+
function(_29) {
|
|
680
|
+
return _29.sendTransactionConfig;
|
|
680
681
|
},
|
|
681
682
|
'optionalAccess',
|
|
682
|
-
function(
|
|
683
|
-
return
|
|
683
|
+
function(_30) {
|
|
684
|
+
return _30.uiConfig;
|
|
684
685
|
}
|
|
685
686
|
]));
|
|
686
687
|
return [
|
|
@@ -725,7 +726,7 @@ var useGetBalance = function useGetBalance() {
|
|
|
725
726
|
return {
|
|
726
727
|
getBalance: function getBalance(params) {
|
|
727
728
|
return _async_to_generator(function() {
|
|
728
|
-
var
|
|
729
|
+
var entry, chain, rpcUrl, wsEndpoint, error;
|
|
729
730
|
return _ts_generator(this, function(_state) {
|
|
730
731
|
switch(_state.label){
|
|
731
732
|
case 0:
|
|
@@ -735,42 +736,44 @@ var useGetBalance = function useGetBalance() {
|
|
|
735
736
|
,
|
|
736
737
|
3
|
|
737
738
|
]);
|
|
738
|
-
|
|
739
|
-
rpcConfig = _optionalChain([
|
|
739
|
+
entry = _lib.resolveSolanaChainEntry.call(void 0, _optionalChain([
|
|
740
740
|
coreSDK,
|
|
741
741
|
'access',
|
|
742
|
-
function(
|
|
743
|
-
return
|
|
742
|
+
function(_31) {
|
|
743
|
+
return _31.config;
|
|
744
744
|
},
|
|
745
745
|
'optionalAccess',
|
|
746
|
+
function(_32) {
|
|
747
|
+
return _32.chains;
|
|
748
|
+
}
|
|
749
|
+
]), params.chain, _optionalChain([
|
|
750
|
+
coreSDK,
|
|
751
|
+
'access',
|
|
746
752
|
function(_33) {
|
|
747
|
-
return _33.
|
|
753
|
+
return _33.config;
|
|
748
754
|
},
|
|
749
755
|
'optionalAccess',
|
|
750
756
|
function(_34) {
|
|
751
|
-
return _34.
|
|
752
|
-
},
|
|
753
|
-
'optionalAccess',
|
|
754
|
-
function(_35) {
|
|
755
|
-
return _35[chain];
|
|
756
|
-
}
|
|
757
|
-
]);
|
|
758
|
-
rpcUrl = _optionalChain([
|
|
759
|
-
rpcConfig,
|
|
760
|
-
'optionalAccess',
|
|
761
|
-
function(_36) {
|
|
762
|
-
return _36.rpc;
|
|
757
|
+
return _34.defaultChain;
|
|
763
758
|
}
|
|
764
|
-
]);
|
|
765
|
-
|
|
766
|
-
|
|
759
|
+
]));
|
|
760
|
+
chain = _nullishCoalesce(_nullishCoalesce(_optionalChain([
|
|
761
|
+
entry,
|
|
767
762
|
'optionalAccess',
|
|
768
|
-
function(
|
|
769
|
-
return
|
|
763
|
+
function(_35) {
|
|
764
|
+
return _35.id;
|
|
770
765
|
}
|
|
771
|
-
])
|
|
766
|
+
]), function() {
|
|
767
|
+
return params.chain;
|
|
768
|
+
}), function() {
|
|
769
|
+
return "solana:mainnet";
|
|
770
|
+
});
|
|
771
|
+
rpcUrl = _nullishCoalesce(params.rpcUrl, function() {
|
|
772
|
+
return entry ? _lib.resolveRpcUrl.call(void 0, entry) : void 0;
|
|
773
|
+
});
|
|
774
|
+
wsEndpoint = entry ? _lib.resolveWsUrl.call(void 0, entry) : void 0;
|
|
772
775
|
if (!rpcUrl) {
|
|
773
|
-
throw new Error(
|
|
776
|
+
throw new Error('No RPC URL for chain "'.concat(chain, '". Add it to `chains` in MoonKeyProvider config, or pass an `rpcUrl`.'));
|
|
774
777
|
}
|
|
775
778
|
return [
|
|
776
779
|
4,
|
|
@@ -808,7 +811,7 @@ var useGetTokenAccounts = function useGetTokenAccounts() {
|
|
|
808
811
|
return {
|
|
809
812
|
getTokenAccounts: function getTokenAccounts(params) {
|
|
810
813
|
return _async_to_generator(function() {
|
|
811
|
-
var
|
|
814
|
+
var entry, chain, rpcUrl, wsEndpoint, error;
|
|
812
815
|
return _ts_generator(this, function(_state) {
|
|
813
816
|
switch(_state.label){
|
|
814
817
|
case 0:
|
|
@@ -818,8 +821,17 @@ var useGetTokenAccounts = function useGetTokenAccounts() {
|
|
|
818
821
|
,
|
|
819
822
|
3
|
|
820
823
|
]);
|
|
821
|
-
|
|
822
|
-
|
|
824
|
+
entry = _lib.resolveSolanaChainEntry.call(void 0, _optionalChain([
|
|
825
|
+
coreSDK,
|
|
826
|
+
'access',
|
|
827
|
+
function(_36) {
|
|
828
|
+
return _36.config;
|
|
829
|
+
},
|
|
830
|
+
'optionalAccess',
|
|
831
|
+
function(_37) {
|
|
832
|
+
return _37.chains;
|
|
833
|
+
}
|
|
834
|
+
]), params.chain, _optionalChain([
|
|
823
835
|
coreSDK,
|
|
824
836
|
'access',
|
|
825
837
|
function(_38) {
|
|
@@ -827,33 +839,26 @@ var useGetTokenAccounts = function useGetTokenAccounts() {
|
|
|
827
839
|
},
|
|
828
840
|
'optionalAccess',
|
|
829
841
|
function(_39) {
|
|
830
|
-
return _39.
|
|
831
|
-
},
|
|
832
|
-
'optionalAccess',
|
|
833
|
-
function(_40) {
|
|
834
|
-
return _40.rpcs;
|
|
835
|
-
},
|
|
836
|
-
'optionalAccess',
|
|
837
|
-
function(_41) {
|
|
838
|
-
return _41[chain];
|
|
842
|
+
return _39.defaultChain;
|
|
839
843
|
}
|
|
840
|
-
]);
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
'optionalAccess',
|
|
844
|
-
function(_42) {
|
|
845
|
-
return _42.rpc;
|
|
846
|
-
}
|
|
847
|
-
]);
|
|
848
|
-
wsEndpoint = _optionalChain([
|
|
849
|
-
rpcConfig,
|
|
844
|
+
]));
|
|
845
|
+
chain = _nullishCoalesce(_nullishCoalesce(_optionalChain([
|
|
846
|
+
entry,
|
|
850
847
|
'optionalAccess',
|
|
851
|
-
function(
|
|
852
|
-
return
|
|
848
|
+
function(_40) {
|
|
849
|
+
return _40.id;
|
|
853
850
|
}
|
|
854
|
-
])
|
|
851
|
+
]), function() {
|
|
852
|
+
return params.chain;
|
|
853
|
+
}), function() {
|
|
854
|
+
return "solana:mainnet";
|
|
855
|
+
});
|
|
856
|
+
rpcUrl = _nullishCoalesce(params.rpcUrl, function() {
|
|
857
|
+
return entry ? _lib.resolveRpcUrl.call(void 0, entry) : void 0;
|
|
858
|
+
});
|
|
859
|
+
wsEndpoint = entry ? _lib.resolveWsUrl.call(void 0, entry) : void 0;
|
|
855
860
|
if (!rpcUrl) {
|
|
856
|
-
throw new Error(
|
|
861
|
+
throw new Error('No RPC URL for chain "'.concat(chain, '". Add it to `chains` in MoonKeyProvider config, or pass an `rpcUrl`.'));
|
|
857
862
|
}
|
|
858
863
|
return [
|
|
859
864
|
4,
|
|
@@ -866,46 +871,46 @@ var useGetTokenAccounts = function useGetTokenAccounts() {
|
|
|
866
871
|
commitment: _optionalChain([
|
|
867
872
|
params,
|
|
868
873
|
'access',
|
|
869
|
-
function(
|
|
870
|
-
return
|
|
874
|
+
function(_41) {
|
|
875
|
+
return _41.options;
|
|
871
876
|
},
|
|
872
877
|
'optionalAccess',
|
|
873
|
-
function(
|
|
874
|
-
return
|
|
878
|
+
function(_42) {
|
|
879
|
+
return _42.commitment;
|
|
875
880
|
}
|
|
876
881
|
]),
|
|
877
882
|
minContextSlot: _optionalChain([
|
|
878
883
|
params,
|
|
879
884
|
'access',
|
|
880
|
-
function(
|
|
881
|
-
return
|
|
885
|
+
function(_43) {
|
|
886
|
+
return _43.options;
|
|
882
887
|
},
|
|
883
888
|
'optionalAccess',
|
|
884
|
-
function(
|
|
885
|
-
return
|
|
889
|
+
function(_44) {
|
|
890
|
+
return _44.minContextSlot;
|
|
886
891
|
}
|
|
887
892
|
]),
|
|
888
893
|
dataSlice: _optionalChain([
|
|
889
894
|
params,
|
|
890
895
|
'access',
|
|
891
|
-
function(
|
|
892
|
-
return
|
|
896
|
+
function(_45) {
|
|
897
|
+
return _45.options;
|
|
893
898
|
},
|
|
894
899
|
'optionalAccess',
|
|
895
|
-
function(
|
|
896
|
-
return
|
|
900
|
+
function(_46) {
|
|
901
|
+
return _46.dataSlice;
|
|
897
902
|
}
|
|
898
903
|
]),
|
|
899
904
|
wsEndpoint: wsEndpoint,
|
|
900
905
|
encoding: _optionalChain([
|
|
901
906
|
params,
|
|
902
907
|
'access',
|
|
903
|
-
function(
|
|
904
|
-
return
|
|
908
|
+
function(_47) {
|
|
909
|
+
return _47.options;
|
|
905
910
|
},
|
|
906
911
|
'optionalAccess',
|
|
907
|
-
function(
|
|
908
|
-
return
|
|
912
|
+
function(_48) {
|
|
913
|
+
return _48.encoding;
|
|
909
914
|
}
|
|
910
915
|
])
|
|
911
916
|
}
|
|
@@ -970,8 +975,8 @@ var useImportKey = function useImportKey() {
|
|
|
970
975
|
if (!(_optionalChain([
|
|
971
976
|
params,
|
|
972
977
|
'optionalAccess',
|
|
973
|
-
function(
|
|
974
|
-
return
|
|
978
|
+
function(_49) {
|
|
979
|
+
return _49.key;
|
|
975
980
|
}
|
|
976
981
|
]) !== void 0)) return [
|
|
977
982
|
3,
|
|
@@ -224,6 +224,7 @@ __export(solana_exports, {
|
|
|
224
224
|
});
|
|
225
225
|
import { useSignMessage as useSharedSolSignMessage, useSignTransaction as useSharedSolSignTransaction, useSendTransaction as useSharedSolSendTransaction, useGetBalance as useSharedSolGetBalance } from "@moon-x/core/react/solana";
|
|
226
226
|
import { useCreateWallet as useSharedCreateWallet, useImportKey as useSharedImportKey, useWallets as useSharedWallets } from "@moon-x/core/react";
|
|
227
|
+
import { resolveSolanaChainEntry, resolveRpcUrl, resolveWsUrl } from "@moon-x/core/lib";
|
|
227
228
|
// src/wallets/solana/use-fund-wallet.ts
|
|
228
229
|
var useFundWallet = function useFundWallet() {
|
|
229
230
|
var sdk = useAuthSDK();
|
|
@@ -418,7 +419,7 @@ var useSendTransaction = function useSendTransaction() {
|
|
|
418
419
|
return {
|
|
419
420
|
sendTransaction: function sendTransaction(params) {
|
|
420
421
|
return _async_to_generator(function() {
|
|
421
|
-
var
|
|
422
|
+
var _ref, _ref1, _params_rpcUrl, _coreSDK_config, _coreSDK_config1, _params_options, _coreSDK_config_sendTransactionConfig, _coreSDK_config2, entry, chain, rpcUrl, wsEndpoint, bs58, transactionString, showWalletUI, error;
|
|
422
423
|
return _ts_generator(this, function(_state) {
|
|
423
424
|
switch(_state.label){
|
|
424
425
|
case 0:
|
|
@@ -428,12 +429,12 @@ var useSendTransaction = function useSendTransaction() {
|
|
|
428
429
|
,
|
|
429
430
|
4
|
|
430
431
|
]);
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
rpcUrl =
|
|
434
|
-
wsEndpoint =
|
|
432
|
+
entry = resolveSolanaChainEntry((_coreSDK_config = coreSDK.config) === null || _coreSDK_config === void 0 ? void 0 : _coreSDK_config.chains, params.chain, (_coreSDK_config1 = coreSDK.config) === null || _coreSDK_config1 === void 0 ? void 0 : _coreSDK_config1.defaultChain);
|
|
433
|
+
chain = (_ref = (_ref1 = entry === null || entry === void 0 ? void 0 : entry.id) !== null && _ref1 !== void 0 ? _ref1 : params.chain) !== null && _ref !== void 0 ? _ref : "solana:mainnet";
|
|
434
|
+
rpcUrl = (_params_rpcUrl = params.rpcUrl) !== null && _params_rpcUrl !== void 0 ? _params_rpcUrl : entry ? resolveRpcUrl(entry) : void 0;
|
|
435
|
+
wsEndpoint = entry ? resolveWsUrl(entry) : void 0;
|
|
435
436
|
if (!rpcUrl) {
|
|
436
|
-
throw new Error(
|
|
437
|
+
throw new Error('No RPC URL for chain "'.concat(chain, '". Add it to `chains` in MoonKeyProvider config, or pass an `rpcUrl`.'));
|
|
437
438
|
}
|
|
438
439
|
return [
|
|
439
440
|
4,
|
|
@@ -442,7 +443,7 @@ var useSendTransaction = function useSendTransaction() {
|
|
|
442
443
|
case 1:
|
|
443
444
|
bs58 = _state.sent();
|
|
444
445
|
transactionString = bs58.default.encode(params.transaction);
|
|
445
|
-
showWalletUI = shouldShowWalletUI((_params_options = params.options) === null || _params_options === void 0 ? void 0 : _params_options.uiOptions, (
|
|
446
|
+
showWalletUI = shouldShowWalletUI((_params_options = params.options) === null || _params_options === void 0 ? void 0 : _params_options.uiOptions, (_coreSDK_config2 = coreSDK.config) === null || _coreSDK_config2 === void 0 ? void 0 : (_coreSDK_config_sendTransactionConfig = _coreSDK_config2.sendTransactionConfig) === null || _coreSDK_config_sendTransactionConfig === void 0 ? void 0 : _coreSDK_config_sendTransactionConfig.uiConfig);
|
|
446
447
|
return [
|
|
447
448
|
4,
|
|
448
449
|
dispatchSignOp({
|
|
@@ -485,7 +486,7 @@ var useGetBalance = function useGetBalance() {
|
|
|
485
486
|
return {
|
|
486
487
|
getBalance: function getBalance(params) {
|
|
487
488
|
return _async_to_generator(function() {
|
|
488
|
-
var
|
|
489
|
+
var _ref, _ref1, _params_rpcUrl, _coreSDK_config, _coreSDK_config1, entry, chain, rpcUrl, wsEndpoint, error;
|
|
489
490
|
return _ts_generator(this, function(_state) {
|
|
490
491
|
switch(_state.label){
|
|
491
492
|
case 0:
|
|
@@ -495,12 +496,12 @@ var useGetBalance = function useGetBalance() {
|
|
|
495
496
|
,
|
|
496
497
|
3
|
|
497
498
|
]);
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
rpcUrl =
|
|
501
|
-
wsEndpoint =
|
|
499
|
+
entry = resolveSolanaChainEntry((_coreSDK_config = coreSDK.config) === null || _coreSDK_config === void 0 ? void 0 : _coreSDK_config.chains, params.chain, (_coreSDK_config1 = coreSDK.config) === null || _coreSDK_config1 === void 0 ? void 0 : _coreSDK_config1.defaultChain);
|
|
500
|
+
chain = (_ref = (_ref1 = entry === null || entry === void 0 ? void 0 : entry.id) !== null && _ref1 !== void 0 ? _ref1 : params.chain) !== null && _ref !== void 0 ? _ref : "solana:mainnet";
|
|
501
|
+
rpcUrl = (_params_rpcUrl = params.rpcUrl) !== null && _params_rpcUrl !== void 0 ? _params_rpcUrl : entry ? resolveRpcUrl(entry) : void 0;
|
|
502
|
+
wsEndpoint = entry ? resolveWsUrl(entry) : void 0;
|
|
502
503
|
if (!rpcUrl) {
|
|
503
|
-
throw new Error(
|
|
504
|
+
throw new Error('No RPC URL for chain "'.concat(chain, '". Add it to `chains` in MoonKeyProvider config, or pass an `rpcUrl`.'));
|
|
504
505
|
}
|
|
505
506
|
return [
|
|
506
507
|
4,
|
|
@@ -538,7 +539,7 @@ var useGetTokenAccounts = function useGetTokenAccounts() {
|
|
|
538
539
|
return {
|
|
539
540
|
getTokenAccounts: function getTokenAccounts(params) {
|
|
540
541
|
return _async_to_generator(function() {
|
|
541
|
-
var
|
|
542
|
+
var _ref, _ref1, _params_rpcUrl, _coreSDK_config, _coreSDK_config1, _params_options, _params_options1, _params_options2, _params_options3, entry, chain, rpcUrl, wsEndpoint, error;
|
|
542
543
|
return _ts_generator(this, function(_state) {
|
|
543
544
|
switch(_state.label){
|
|
544
545
|
case 0:
|
|
@@ -548,12 +549,12 @@ var useGetTokenAccounts = function useGetTokenAccounts() {
|
|
|
548
549
|
,
|
|
549
550
|
3
|
|
550
551
|
]);
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
rpcUrl =
|
|
554
|
-
wsEndpoint =
|
|
552
|
+
entry = resolveSolanaChainEntry((_coreSDK_config = coreSDK.config) === null || _coreSDK_config === void 0 ? void 0 : _coreSDK_config.chains, params.chain, (_coreSDK_config1 = coreSDK.config) === null || _coreSDK_config1 === void 0 ? void 0 : _coreSDK_config1.defaultChain);
|
|
553
|
+
chain = (_ref = (_ref1 = entry === null || entry === void 0 ? void 0 : entry.id) !== null && _ref1 !== void 0 ? _ref1 : params.chain) !== null && _ref !== void 0 ? _ref : "solana:mainnet";
|
|
554
|
+
rpcUrl = (_params_rpcUrl = params.rpcUrl) !== null && _params_rpcUrl !== void 0 ? _params_rpcUrl : entry ? resolveRpcUrl(entry) : void 0;
|
|
555
|
+
wsEndpoint = entry ? resolveWsUrl(entry) : void 0;
|
|
555
556
|
if (!rpcUrl) {
|
|
556
|
-
throw new Error(
|
|
557
|
+
throw new Error('No RPC URL for chain "'.concat(chain, '". Add it to `chains` in MoonKeyProvider config, or pass an `rpcUrl`.'));
|
|
557
558
|
}
|
|
558
559
|
return [
|
|
559
560
|
4,
|