@0xsquid/react-hooks 6.4.4-beta.4 → 6.4.4-stellar-beta.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/dist/core/client/index.d.ts +17 -0
- package/dist/core/client/index.js +40 -0
- package/dist/core/client/index.js.map +1 -0
- package/dist/core/connectors/bitcoin/helpers.d.ts +15 -0
- package/dist/core/connectors/bitcoin/helpers.js +6 -1
- package/dist/core/connectors/bitcoin/helpers.js.map +1 -1
- package/dist/core/connectors/bitcoin/wallets/index.d.ts +1 -0
- package/dist/core/connectors/bitcoin/wallets/index.js +1 -0
- package/dist/core/connectors/bitcoin/wallets/index.js.map +1 -1
- package/dist/core/connectors/bitcoin/wallets/keplr.d.ts +11 -0
- package/dist/core/connectors/bitcoin/wallets/keplr.js +28 -0
- package/dist/core/connectors/bitcoin/wallets/keplr.js.map +1 -0
- package/dist/core/connectors/xrpl/CrossMark.d.ts +13 -0
- package/dist/core/connectors/{xrp → xrpl}/CrossMark.js +11 -11
- package/dist/core/connectors/xrpl/CrossMark.js.map +1 -0
- package/dist/core/connectors/xrpl/Xaman.d.ts +16 -0
- package/dist/core/connectors/xrpl/Xaman.js +80 -0
- package/dist/core/connectors/xrpl/Xaman.js.map +1 -0
- package/dist/core/connectors/xrpl/XamanQr.d.ts +15 -0
- package/dist/core/connectors/xrpl/XamanQr.js +78 -0
- package/dist/core/connectors/xrpl/XamanQr.js.map +1 -0
- package/dist/core/connectors/{xrp/XrpMetamaskSnap.d.ts → xrpl/XrplMetamaskSnap.d.ts} +7 -16
- package/dist/core/connectors/{xrp/XrpMetamaskSnap.js → xrpl/XrplMetamaskSnap.js} +22 -57
- package/dist/core/connectors/xrpl/XrplMetamaskSnap.js.map +1 -0
- package/dist/core/constants.d.ts +14 -22
- package/dist/core/constants.js +43 -41
- package/dist/core/constants.js.map +1 -1
- package/dist/core/externalLinks.d.ts +1 -1
- package/dist/core/externalLinks.js +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/multicall3.d.ts +5 -1
- package/dist/core/multicall3.js +21 -1
- package/dist/core/multicall3.js.map +1 -1
- package/dist/core/providers/SolanaProvider.d.ts +0 -2
- package/dist/core/providers/SolanaProvider.js.map +1 -1
- package/dist/core/providers/StellarProvider.d.ts +19 -0
- package/dist/core/providers/StellarProvider.js +15 -0
- package/dist/core/providers/StellarProvider.js.map +1 -0
- package/dist/core/providers/SuiProvider.d.ts +19 -0
- package/dist/core/providers/SuiProvider.js +15 -0
- package/dist/core/providers/SuiProvider.js.map +1 -0
- package/dist/core/providers/XrplProvider.d.ts +17 -0
- package/dist/core/providers/XrplProvider.js +15 -0
- package/dist/core/providers/XrplProvider.js.map +1 -0
- package/dist/core/queries/queries-keys.d.ts +25 -30
- package/dist/core/queries/queries-keys.js +76 -86
- package/dist/core/queries/queries-keys.js.map +1 -1
- package/dist/core/stellar-test.d.ts +1 -0
- package/dist/core/stellar-test.js +11 -0
- package/dist/core/stellar-test.js.map +1 -0
- package/dist/core/types/config.d.ts +2 -0
- package/dist/core/types/error.d.ts +4 -3
- package/dist/core/types/error.js.map +1 -1
- package/dist/core/types/event.d.ts +31 -1
- package/dist/core/types/history.d.ts +84 -0
- package/dist/core/types/history.js +7 -0
- package/dist/core/types/history.js.map +1 -0
- package/dist/core/types/index.d.ts +5 -2
- package/dist/core/types/index.js +2 -1
- package/dist/core/types/index.js.map +1 -1
- package/dist/core/types/onramps/index.d.ts +2 -0
- package/dist/core/types/onramps/index.js +3 -0
- package/dist/core/types/onramps/index.js.map +1 -0
- package/dist/core/types/onramps/onramp.d.ts +157 -0
- package/dist/core/types/onramps/onramp.js +2 -0
- package/dist/core/types/onramps/onramp.js.map +1 -0
- package/dist/core/types/onramps/revolut.d.ts +92 -0
- package/dist/core/types/onramps/revolut.js +2 -0
- package/dist/core/types/onramps/revolut.js.map +1 -0
- package/dist/core/types/rpc.d.ts +10 -0
- package/dist/core/types/rpc.js +2 -0
- package/dist/core/types/rpc.js.map +1 -0
- package/dist/core/types/stellar.d.ts +3 -0
- package/dist/core/types/stellar.js +2 -0
- package/dist/core/types/stellar.js.map +1 -0
- package/dist/core/types/sui.d.ts +14 -0
- package/dist/core/types/sui.js +2 -0
- package/dist/core/types/sui.js.map +1 -0
- package/dist/core/types/transaction.d.ts +10 -30
- package/dist/core/types/transaction.js +6 -0
- package/dist/core/types/transaction.js.map +1 -1
- package/dist/core/types/wallet.d.ts +34 -20
- package/dist/core/types/wallet.js +3 -1
- package/dist/core/types/wallet.js.map +1 -1
- package/dist/core/types/xrpl.d.ts +70 -0
- package/dist/core/types/xrpl.js +20 -0
- package/dist/core/types/xrpl.js.map +1 -0
- package/dist/core/wagmiConfig.js +2 -8
- package/dist/core/wagmiConfig.js.map +1 -1
- package/dist/core/wallets.d.ts +2 -1
- package/dist/core/wallets.js +61 -45
- package/dist/core/wallets.js.map +1 -1
- package/dist/hooks/analytics/useTrackSearchEmpty.d.ts +12 -0
- package/dist/hooks/analytics/useTrackSearchEmpty.js +22 -0
- package/dist/hooks/analytics/useTrackSearchEmpty.js.map +1 -0
- package/dist/hooks/chains/useSquidChains.d.ts +1 -0
- package/dist/hooks/chains/useSquidChains.js +22 -3
- package/dist/hooks/chains/useSquidChains.js.map +1 -1
- package/dist/hooks/client/useClient.d.ts +2 -0
- package/dist/hooks/client/useClient.js +58 -1
- package/dist/hooks/client/useClient.js.map +1 -1
- package/dist/hooks/cosmos/useCosmos.d.ts +9 -0
- package/dist/hooks/cosmos/useCosmos.js +49 -39
- package/dist/hooks/cosmos/useCosmos.js.map +1 -1
- package/dist/hooks/cosmos/useCosmosForChain.d.ts +1 -1
- package/dist/hooks/cosmos/useCosmosForChain.js +20 -13
- package/dist/hooks/cosmos/useCosmosForChain.js.map +1 -1
- package/dist/hooks/index.d.ts +10 -3
- package/dist/hooks/index.js +10 -4
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/onramp/useFiatToCrypto.d.ts +84 -0
- package/dist/hooks/onramp/useFiatToCrypto.js +316 -0
- package/dist/hooks/onramp/useFiatToCrypto.js.map +1 -0
- package/dist/hooks/solana/useSolana.d.ts +2 -1
- package/dist/hooks/solana/useSolana.js +12 -4
- package/dist/hooks/solana/useSolana.js.map +1 -1
- package/dist/hooks/squid/useSquid.js +1 -1
- package/dist/hooks/squid/useSquid.js.map +1 -1
- package/dist/hooks/stellar/useStellar.d.ts +2 -0
- package/dist/hooks/stellar/useStellar.js +27 -0
- package/dist/hooks/stellar/useStellar.js.map +1 -0
- package/dist/hooks/stellar/useStellarWallets.d.ts +4 -0
- package/dist/hooks/stellar/useStellarWallets.js +12 -0
- package/dist/hooks/stellar/useStellarWallets.js.map +1 -0
- package/dist/hooks/store/useAddressBookStore.d.ts +1 -1
- package/dist/hooks/store/useAddressBookStore.js +6 -2
- package/dist/hooks/store/useAddressBookStore.js.map +1 -1
- package/dist/hooks/store/useHistoryStore.d.ts +33 -13
- package/dist/hooks/store/useHistoryStore.js +120 -32
- package/dist/hooks/store/useHistoryStore.js.map +1 -1
- package/dist/hooks/store/useSendTransactionStore.d.ts +20 -0
- package/dist/hooks/store/useSendTransactionStore.js +21 -0
- package/dist/hooks/store/useSendTransactionStore.js.map +1 -0
- package/dist/hooks/store/useSquidStore.d.ts +0 -5
- package/dist/hooks/store/useSquidStore.js +0 -2
- package/dist/hooks/store/useSquidStore.js.map +1 -1
- package/dist/hooks/store/useWalletStore.d.ts +8 -5
- package/dist/hooks/store/useWalletStore.js +9 -15
- package/dist/hooks/store/useWalletStore.js.map +1 -1
- package/dist/hooks/sui/useSui.d.ts +2 -0
- package/dist/hooks/sui/useSui.js +28 -0
- package/dist/hooks/sui/useSui.js.map +1 -0
- package/dist/hooks/sui/useSuiWallets.d.ts +7 -0
- package/dist/hooks/sui/useSuiWallets.js +42 -0
- package/dist/hooks/sui/useSuiWallets.js.map +1 -0
- package/dist/hooks/swap/useSwap.d.ts +1 -0
- package/dist/hooks/swap/useSwap.js +4 -16
- package/dist/hooks/swap/useSwap.js.map +1 -1
- package/dist/hooks/tokens/useAllConnectedWalletBalances.d.ts +1 -1
- package/dist/hooks/tokens/useAllConnectedWalletBalances.js +28 -6
- package/dist/hooks/tokens/useAllConnectedWalletBalances.js.map +1 -1
- package/dist/hooks/tokens/useAllTokensWithBalanceForChainType.d.ts +1 -1
- package/dist/hooks/tokens/useAllTokensWithBalanceForChainType.js +34 -17
- package/dist/hooks/tokens/useAllTokensWithBalanceForChainType.js.map +1 -1
- package/dist/hooks/tokens/useBalance.d.ts +3 -1
- package/dist/hooks/tokens/useBalance.js +49 -8
- package/dist/hooks/tokens/useBalance.js.map +1 -1
- package/dist/hooks/tokens/useMultiChainBalance.js +24 -6
- package/dist/hooks/tokens/useMultiChainBalance.js.map +1 -1
- package/dist/hooks/tokens/useNativeBalance.d.ts +3 -1
- package/dist/hooks/tokens/useNativeBalance.js +72 -10
- package/dist/hooks/tokens/useNativeBalance.js.map +1 -1
- package/dist/hooks/tokens/useNativeTokenForChain.js +7 -3
- package/dist/hooks/tokens/useNativeTokenForChain.js.map +1 -1
- package/dist/hooks/tokens/useSquidTokens.d.ts +3 -1
- package/dist/hooks/tokens/useSquidTokens.js +15 -5
- package/dist/hooks/tokens/useSquidTokens.js.map +1 -1
- package/dist/hooks/transaction/send/useEstimateSendTransactionGas.d.ts +28 -0
- package/dist/hooks/transaction/send/useEstimateSendTransactionGas.js +58 -0
- package/dist/hooks/transaction/send/useEstimateSendTransactionGas.js.map +1 -0
- package/dist/hooks/transaction/send/useSendTransaction.d.ts +13 -0
- package/dist/hooks/transaction/send/useSendTransaction.js +256 -0
- package/dist/hooks/transaction/send/useSendTransaction.js.map +1 -0
- package/dist/hooks/transaction/send/useSendTransactionGas.d.ts +6 -0
- package/dist/hooks/transaction/send/useSendTransactionGas.js +73 -0
- package/dist/hooks/transaction/send/useSendTransactionGas.js.map +1 -0
- package/dist/hooks/transaction/useAllTransactionsStatus.d.ts +34 -2
- package/dist/hooks/transaction/useAllTransactionsStatus.js +119 -62
- package/dist/hooks/transaction/useAllTransactionsStatus.js.map +1 -1
- package/dist/hooks/transaction/useApproval.js +3 -3
- package/dist/hooks/transaction/useApproval.js.map +1 -1
- package/dist/hooks/transaction/useEstimate.d.ts +1 -1
- package/dist/hooks/transaction/useExecuteTransaction.d.ts +1 -0
- package/dist/hooks/transaction/useExecuteTransaction.js +175 -99
- package/dist/hooks/transaction/useExecuteTransaction.js.map +1 -1
- package/dist/hooks/transaction/useGetRoute.d.ts +13 -7
- package/dist/hooks/transaction/useGetRoute.js +17 -151
- package/dist/hooks/transaction/useGetRoute.js.map +1 -1
- package/dist/hooks/transaction/useSendTransactionStatus.d.ts +11 -0
- package/dist/hooks/transaction/useSendTransactionStatus.js +63 -0
- package/dist/hooks/transaction/useSendTransactionStatus.js.map +1 -0
- package/dist/hooks/transaction/useSwapTransactionStatus.d.ts +15 -0
- package/dist/hooks/transaction/{useSingleTransaction.js → useSwapTransactionStatus.js} +40 -18
- package/dist/hooks/transaction/useSwapTransactionStatus.js.map +1 -0
- package/dist/hooks/user/useAvatar.js +13 -7
- package/dist/hooks/user/useAvatar.js.map +1 -1
- package/dist/hooks/user/useHistory.d.ts +12 -10
- package/dist/hooks/user/useHistory.js +49 -51
- package/dist/hooks/user/useHistory.js.map +1 -1
- package/dist/hooks/utils/useUtils.d.ts +7 -0
- package/dist/hooks/utils/useUtils.js +20 -0
- package/dist/hooks/utils/useUtils.js.map +1 -0
- package/dist/hooks/wallet/useEns.d.ts +0 -1
- package/dist/hooks/wallet/useEns.js +1 -13
- package/dist/hooks/wallet/useEns.js.map +1 -1
- package/dist/hooks/wallet/useGnosisContext.js +7 -11
- package/dist/hooks/wallet/useGnosisContext.js.map +1 -1
- package/dist/hooks/wallet/useMultiChainWallet.d.ts +4 -0
- package/dist/hooks/wallet/useMultiChainWallet.js +53 -6
- package/dist/hooks/wallet/useMultiChainWallet.js.map +1 -1
- package/dist/hooks/wallet/useSigner.d.ts +9 -6
- package/dist/hooks/wallet/useSigner.js +41 -22
- package/dist/hooks/wallet/useSigner.js.map +1 -1
- package/dist/hooks/wallet/useWallet.d.ts +64 -7
- package/dist/hooks/wallet/useWallet.js +58 -10
- package/dist/hooks/wallet/useWallet.js.map +1 -1
- package/dist/hooks/wallet/useWallets.d.ts +31 -1
- package/dist/hooks/wallet/useWallets.js +35 -1
- package/dist/hooks/wallet/useWallets.js.map +1 -1
- package/dist/hooks/xrpl/useXrpl.d.ts +2 -0
- package/dist/hooks/xrpl/useXrpl.js +21 -0
- package/dist/hooks/xrpl/useXrpl.js.map +1 -0
- package/dist/hooks/xrpl/useXrplTrustLine.d.ts +17 -0
- package/dist/hooks/xrpl/useXrplTrustLine.js +136 -0
- package/dist/hooks/xrpl/useXrplTrustLine.js.map +1 -0
- package/dist/hooks/xrpl/useXrplWallets.d.ts +4 -0
- package/dist/hooks/xrpl/useXrplWallets.js +46 -0
- package/dist/hooks/xrpl/useXrplWallets.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/provider/index.js +9 -4
- package/dist/provider/index.js.map +1 -1
- package/dist/services/external/cosmosRestClient.d.ts +18 -0
- package/dist/services/external/cosmosRestClient.js +45 -0
- package/dist/services/external/cosmosRestClient.js.map +1 -0
- package/dist/services/external/index.d.ts +1 -0
- package/dist/services/external/index.js +2 -0
- package/dist/services/external/index.js.map +1 -0
- package/dist/services/external/onrampAdapter.d.ts +12 -0
- package/dist/services/external/onrampAdapter.js +41 -0
- package/dist/services/external/onrampAdapter.js.map +1 -0
- package/dist/services/external/rpcService.d.ts +13 -8
- package/dist/services/external/rpcService.js +58 -69
- package/dist/services/external/rpcService.js.map +1 -1
- package/dist/services/external/suiRpcClient.d.ts +32 -0
- package/dist/services/external/suiRpcClient.js +80 -0
- package/dist/services/external/suiRpcClient.js.map +1 -0
- package/dist/services/external/websocket.d.ts +6 -0
- package/dist/services/external/websocket.js +34 -0
- package/dist/services/external/websocket.js.map +1 -0
- package/dist/services/external/xaman.d.ts +30 -0
- package/dist/services/external/xaman.js +46 -0
- package/dist/services/external/xaman.js.map +1 -0
- package/dist/services/external/xrplRpcClient.d.ts +11 -11
- package/dist/services/external/xrplRpcClient.js +46 -55
- package/dist/services/external/xrplRpcClient.js.map +1 -1
- package/dist/services/index.d.ts +4 -3
- package/dist/services/index.js +4 -4
- package/dist/services/index.js.map +1 -1
- package/dist/services/internal/assetsService.d.ts +5 -3
- package/dist/services/internal/assetsService.js +22 -377
- package/dist/services/internal/assetsService.js.map +1 -1
- package/dist/services/internal/bitcoinService.d.ts +3 -5
- package/dist/services/internal/bitcoinService.js +9 -1
- package/dist/services/internal/bitcoinService.js.map +1 -1
- package/dist/services/internal/configService.js +10 -2
- package/dist/services/internal/configService.js.map +1 -1
- package/dist/services/internal/cosmosService.d.ts +14 -2
- package/dist/services/internal/cosmosService.js +18 -1
- package/dist/services/internal/cosmosService.js.map +1 -1
- package/dist/services/internal/countryCurrencyMap.d.ts +13 -0
- package/dist/services/internal/countryCurrencyMap.js +1102 -0
- package/dist/services/internal/countryCurrencyMap.js.map +1 -0
- package/dist/services/internal/errorService.d.ts +3 -7
- package/dist/services/internal/errorService.js +26 -2
- package/dist/services/internal/errorService.js.map +1 -1
- package/dist/services/internal/estimateService.js +3 -3
- package/dist/services/internal/estimateService.js.map +1 -1
- package/dist/services/internal/eventService.d.ts +46 -0
- package/dist/services/internal/eventService.js +61 -5
- package/dist/services/internal/eventService.js.map +1 -1
- package/dist/services/internal/evmService.d.ts +2 -2
- package/dist/services/internal/evmService.js.map +1 -1
- package/dist/services/internal/fiatToCryptoService.d.ts +29 -0
- package/dist/services/internal/fiatToCryptoService.js +84 -0
- package/dist/services/internal/fiatToCryptoService.js.map +1 -0
- package/dist/services/internal/fiatToCryptoService.test.d.ts +1 -0
- package/dist/services/internal/fiatToCryptoService.test.js +45 -0
- package/dist/services/internal/fiatToCryptoService.test.js.map +1 -0
- package/dist/services/internal/numberService.d.ts +1 -1
- package/dist/services/internal/numberService.js.map +1 -1
- package/dist/services/internal/searchService.d.ts +1 -1
- package/dist/services/internal/searchService.js +18 -15
- package/dist/services/internal/searchService.js.map +1 -1
- package/dist/services/internal/sendTransaction.d.ts +53 -0
- package/dist/services/internal/sendTransaction.js +194 -0
- package/dist/services/internal/sendTransaction.js.map +1 -0
- package/dist/services/internal/sendTransactionStatus.d.ts +6 -0
- package/dist/services/internal/sendTransactionStatus.js +142 -0
- package/dist/services/internal/sendTransactionStatus.js.map +1 -0
- package/dist/services/internal/solanaService.d.ts +2 -2
- package/dist/services/internal/solanaService.js.map +1 -1
- package/dist/services/internal/stellarService.d.ts +4 -0
- package/dist/services/internal/stellarService.js +20 -0
- package/dist/services/internal/stellarService.js.map +1 -0
- package/dist/services/internal/suiService.d.ts +20 -0
- package/dist/services/internal/suiService.js +119 -0
- package/dist/services/internal/suiService.js.map +1 -0
- package/dist/services/internal/transactionService.d.ts +8 -36
- package/dist/services/internal/transactionService.js +32 -35
- package/dist/services/internal/transactionService.js.map +1 -1
- package/dist/services/internal/transactionStatusService.d.ts +16 -5
- package/dist/services/internal/transactionStatusService.js +82 -5
- package/dist/services/internal/transactionStatusService.js.map +1 -1
- package/dist/services/internal/walletService.d.ts +17 -11
- package/dist/services/internal/walletService.js +70 -21
- package/dist/services/internal/walletService.js.map +1 -1
- package/dist/services/internal/xionService.d.ts +1 -0
- package/dist/services/internal/xionService.js +6 -0
- package/dist/services/internal/xionService.js.map +1 -0
- package/dist/services/internal/xrplService.d.ts +17 -0
- package/dist/services/internal/xrplService.js +50 -0
- package/dist/services/internal/xrplService.js.map +1 -0
- package/dist/tests/assetsService.test.js +13 -26
- package/dist/tests/assetsService.test.js.map +1 -1
- package/dist/tests/searchService.test.js +0 -6
- package/dist/tests/searchService.test.js.map +1 -1
- package/dist/tests/swapConfig.test.js +72 -7
- package/dist/tests/swapConfig.test.js.map +1 -1
- package/dist/tests/transactionService.test.js +18 -18
- package/dist/tests/transactionService.test.js.map +1 -1
- package/package.json +13 -5
- package/dist/core/connectors/xrp/CrossMark.d.ts +0 -26
- package/dist/core/connectors/xrp/CrossMark.js.map +0 -1
- package/dist/core/connectors/xrp/XrpMetamaskSnap.js.map +0 -1
- package/dist/core/its/config.d.ts +0 -200
- package/dist/core/its/config.js +0 -193
- package/dist/core/its/config.js.map +0 -1
- package/dist/core/types/route.d.ts +0 -9
- package/dist/core/types/route.js +0 -4
- package/dist/core/types/route.js.map +0 -1
- package/dist/core/types/xrp.d.ts +0 -51
- package/dist/core/types/xrp.js +0 -2
- package/dist/core/types/xrp.js.map +0 -1
- package/dist/core/xrp/config.d.ts +0 -24
- package/dist/core/xrp/config.js +0 -74
- package/dist/core/xrp/config.js.map +0 -1
- package/dist/hooks/transaction/useSingleTransaction.d.ts +0 -10
- package/dist/hooks/transaction/useSingleTransaction.js.map +0 -1
- package/dist/hooks/xrp/useXrp.d.ts +0 -7
- package/dist/hooks/xrp/useXrp.js +0 -22
- package/dist/hooks/xrp/useXrp.js.map +0 -1
- package/dist/hooks/xrp/useXrpPrice.d.ts +0 -1
- package/dist/hooks/xrp/useXrpPrice.js +0 -12
- package/dist/hooks/xrp/useXrpPrice.js.map +0 -1
- package/dist/hooks/xrp/useXrplTrustLine.d.ts +0 -7
- package/dist/hooks/xrp/useXrplTrustLine.js +0 -127
- package/dist/hooks/xrp/useXrplTrustLine.js.map +0 -1
- package/dist/services/internal/xrpService.d.ts +0 -37
- package/dist/services/internal/xrpService.js +0 -179
- package/dist/services/internal/xrpService.js.map +0 -1
- package/dist/services/internal/xrpStatusService.d.ts +0 -4
- package/dist/services/internal/xrpStatusService.js +0 -102
- package/dist/services/internal/xrpStatusService.js.map +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export class SuiRpcClient {
|
|
2
|
+
/**
|
|
3
|
+
* Native Sui coin object type in long format.
|
|
4
|
+
* This is the format used by the Squid UI and API
|
|
5
|
+
*/
|
|
6
|
+
suiNativeCoinObjectTypeLong = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
7
|
+
/**
|
|
8
|
+
* Native Sui coin object type in short format.
|
|
9
|
+
* This is the format used by RPC providers
|
|
10
|
+
*/
|
|
11
|
+
suiNativeCoinObjectTypeShort = "0x2::sui::SUI";
|
|
12
|
+
rpcUrl;
|
|
13
|
+
constructor(rpcUrl) {
|
|
14
|
+
this.rpcUrl = rpcUrl;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Fetches the balance of a single Sui token for a given address.
|
|
18
|
+
*/
|
|
19
|
+
async getBalance(userAddress, tokenAddress) {
|
|
20
|
+
const response = await this.call("suix_getBalance", [
|
|
21
|
+
userAddress,
|
|
22
|
+
this.toShortCoinObjectType(tokenAddress),
|
|
23
|
+
]);
|
|
24
|
+
return {
|
|
25
|
+
...response,
|
|
26
|
+
coinType: this.toLongCoinObjectType(response.coinType),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Fetches all Sui coin balances for a given address.
|
|
31
|
+
*/
|
|
32
|
+
async getAllBalances(userAddress) {
|
|
33
|
+
const response = await this.call("suix_getAllBalances", [
|
|
34
|
+
userAddress,
|
|
35
|
+
]);
|
|
36
|
+
return response.map((balance) => ({
|
|
37
|
+
...balance,
|
|
38
|
+
coinType: this.toLongCoinObjectType(balance.coinType),
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
async call(method, params) {
|
|
42
|
+
const response = await fetch(this.rpcUrl, {
|
|
43
|
+
method: "POST",
|
|
44
|
+
headers: {
|
|
45
|
+
"Content-Type": "application/json",
|
|
46
|
+
},
|
|
47
|
+
body: JSON.stringify({
|
|
48
|
+
jsonrpc: "2.0",
|
|
49
|
+
id: 1,
|
|
50
|
+
method,
|
|
51
|
+
params,
|
|
52
|
+
}),
|
|
53
|
+
});
|
|
54
|
+
const data = await response.json();
|
|
55
|
+
if (data.error) {
|
|
56
|
+
throw new Error(`RPC Error (${method}): ${data.error.message}`);
|
|
57
|
+
}
|
|
58
|
+
if (!data.result) {
|
|
59
|
+
throw new Error(`Invalid response from RPC (${method})`);
|
|
60
|
+
}
|
|
61
|
+
return data.result;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Parse native coin object type from the long format to the short format.
|
|
65
|
+
*/
|
|
66
|
+
toShortCoinObjectType(coinObjectType) {
|
|
67
|
+
return coinObjectType === this.suiNativeCoinObjectTypeLong
|
|
68
|
+
? this.suiNativeCoinObjectTypeShort
|
|
69
|
+
: coinObjectType;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Parse native coin object type from the short format to the long format.
|
|
73
|
+
*/
|
|
74
|
+
toLongCoinObjectType(coinObjectType) {
|
|
75
|
+
return coinObjectType === this.suiNativeCoinObjectTypeShort
|
|
76
|
+
? this.suiNativeCoinObjectTypeLong
|
|
77
|
+
: coinObjectType;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=suiRpcClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suiRpcClient.js","sourceRoot":"","sources":["../../../src/services/external/suiRpcClient.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,YAAY;IACvB;;;OAGG;IACK,2BAA2B,GACjC,8EAA8E,CAAC;IAEjF;;;OAGG;IACK,4BAA4B,GAAG,eAAe,CAAC;IAE/C,MAAM,CAAS;IAEvB,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CACd,WAAmB,EACnB,YAAoB;QAEpB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAiB,iBAAiB,EAAE;YAClE,WAAW;YACX,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC;SACzC,CAAC,CAAC;QAEH,OAAO;YACL,GAAG,QAAQ;YACX,QAAQ,EAAE,IAAI,CAAC,oBAAoB,CAAC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CAAC;IACrB,CAAC;IAED;;OAEG;IACK,oBAAoB,CAAC,cAAsB;QACjD,OAAO,cAAc,KAAK,IAAI,CAAC,4BAA4B;YACzD,CAAC,CAAC,IAAI,CAAC,2BAA2B;YAClC,CAAC,CAAC,cAAc,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function websocket(url, onMessage) {
|
|
2
|
+
let ws;
|
|
3
|
+
let rejectFn;
|
|
4
|
+
const promise = new Promise((resolve, reject) => {
|
|
5
|
+
ws = new WebSocket(url);
|
|
6
|
+
rejectFn = reject;
|
|
7
|
+
ws.onopen = () => {
|
|
8
|
+
console.debug("WebSocket connected:", url);
|
|
9
|
+
};
|
|
10
|
+
ws.onmessage = (event) => {
|
|
11
|
+
onMessage(event, (value) => {
|
|
12
|
+
ws.close();
|
|
13
|
+
resolve(value);
|
|
14
|
+
}, (error) => {
|
|
15
|
+
ws.close();
|
|
16
|
+
reject(error);
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
ws.onerror = (error) => {
|
|
20
|
+
console.debug("WebSocket error:", error);
|
|
21
|
+
reject(new Error("WebSocket error"));
|
|
22
|
+
};
|
|
23
|
+
ws.onclose = () => {
|
|
24
|
+
console.debug("WebSocket closed");
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
const close = () => {
|
|
28
|
+
console.debug("WebSocket closed manually");
|
|
29
|
+
ws.close();
|
|
30
|
+
rejectFn(new Error("WebSocket closed"));
|
|
31
|
+
};
|
|
32
|
+
return { promise, close };
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=websocket.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../../src/services/external/websocket.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,SAAS,CACvB,GAAW,EACX,SAAuB;IAKvB,IAAI,EAAa,CAAC;IAClB,IAAI,QAAgC,CAAC;IAErC,MAAM,OAAO,G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1
|
+
import { XamanXrplNetwork, XrplNetwork, XrplTransaction } from "../../core/types/xrpl";
|
|
2
|
+
/**
|
|
3
|
+
* Client to interact with the Xaman backend through a Squid proxy.
|
|
4
|
+
* Retrieves the QR code data for the following methods:
|
|
5
|
+
* - sign in
|
|
6
|
+
* - get user session
|
|
7
|
+
* - send tx
|
|
8
|
+
*/
|
|
9
|
+
export declare abstract class XamanClient {
|
|
10
|
+
static baseUrl: string;
|
|
11
|
+
static signIn(signal?: AbortSignal): Promise<{
|
|
12
|
+
qrMatrix: boolean[][];
|
|
13
|
+
wsStatusUrl: string;
|
|
14
|
+
}>;
|
|
15
|
+
static userSession(payload: string, signal?: AbortSignal): Promise<{
|
|
16
|
+
response: {
|
|
17
|
+
account: string;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
static sendTx({ tx, signal, network, }: {
|
|
21
|
+
tx: XrplTransaction;
|
|
22
|
+
signal?: AbortSignal;
|
|
23
|
+
network: XrplNetwork;
|
|
24
|
+
}): Promise<{
|
|
25
|
+
qrMatrix: boolean[][];
|
|
26
|
+
wsStatusUrl: string;
|
|
27
|
+
}>;
|
|
28
|
+
static fetch<T>(endpoint: string, body?: Record<string, any>, signal?: AbortSignal): Promise<T>;
|
|
29
|
+
static getXamanNetwork(network: XrplNetwork): XamanXrplNetwork;
|
|
30
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { internalSquidXamanApiBaseUrl } from "../../core/constants";
|
|
2
|
+
import { XamanXrplNetwork, XrplNetwork, } from "../../core/types/xrpl";
|
|
3
|
+
/**
|
|
4
|
+
* Client to interact with the Xaman backend through a Squid proxy.
|
|
5
|
+
* Retrieves the QR code data for the following methods:
|
|
6
|
+
* - sign in
|
|
7
|
+
* - get user session
|
|
8
|
+
* - send tx
|
|
9
|
+
*/
|
|
10
|
+
export class XamanClient {
|
|
11
|
+
// TODO: use prod url
|
|
12
|
+
static baseUrl = internalSquidXamanApiBaseUrl;
|
|
13
|
+
static async signIn(signal) {
|
|
14
|
+
return this.fetch("sign-in", undefined, signal);
|
|
15
|
+
}
|
|
16
|
+
static async userSession(payload, signal) {
|
|
17
|
+
return this.fetch("user-session", { payload }, signal);
|
|
18
|
+
}
|
|
19
|
+
static async sendTx({ tx, signal, network, }) {
|
|
20
|
+
const xamanNetwork = this.getXamanNetwork(network);
|
|
21
|
+
return this.fetch("send-tx", { tx, network: xamanNetwork }, signal);
|
|
22
|
+
}
|
|
23
|
+
static async fetch(endpoint, body, signal) {
|
|
24
|
+
const url = new URL(endpoint, this.baseUrl);
|
|
25
|
+
const res = await fetch(url.toString(), {
|
|
26
|
+
method: "POST",
|
|
27
|
+
body: body != null ? JSON.stringify(body) : undefined,
|
|
28
|
+
signal,
|
|
29
|
+
});
|
|
30
|
+
if (!res.ok) {
|
|
31
|
+
throw new Error(`Request failed with status ${res.status}`);
|
|
32
|
+
}
|
|
33
|
+
return res.json();
|
|
34
|
+
}
|
|
35
|
+
static getXamanNetwork(network) {
|
|
36
|
+
switch (network) {
|
|
37
|
+
case XrplNetwork.MAINNET:
|
|
38
|
+
return XamanXrplNetwork.MAINNET;
|
|
39
|
+
case XrplNetwork.TESTNET:
|
|
40
|
+
return XamanXrplNetwork.TESTNET;
|
|
41
|
+
default:
|
|
42
|
+
throw new Error(`Network ${network} is not supported`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=xaman.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xaman.js","sourceRoot":"","sources":["../../../src/services/external/xaman.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EACL,gBAAgB,EAChB,WAAW,GAEZ,MAAM,uBAAuB,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,OAAgB,WAAW;IAC/B,qBAAqB;IACrB,MAAM,CAAC,OAAO,GAAG,4BAA4B,CAAC;IAE9C,MAA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AO;gBACtB,OAAO,gBAAgB,CAAC,OAAO,CAAC;YAClC,KAAK,WAAW,CAAC,OAAO;gBACtB,OAAO,gBAAgB,CAAC,OAAO,CAAC;YAClC;gBACE,MAAM,IAAI,KAAK,CAAC,WAAW,OAAO,mBAAmB,CAAC,CAAC;SAC1D;IACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TrustLine, XrplTokenBalance } from "../../core/types/
|
|
1
|
+
import { TrustLine, XrplTokenBalance } from "../../core/types/xrpl";
|
|
2
2
|
type AccountLinesRpcResponse = {
|
|
3
3
|
account: string;
|
|
4
4
|
lines: TrustLine[];
|
|
@@ -6,15 +6,14 @@ type AccountLinesRpcResponse = {
|
|
|
6
6
|
export declare class XrplRpcClient {
|
|
7
7
|
private rpcUrl;
|
|
8
8
|
constructor(rpcUrl: string);
|
|
9
|
-
getBalance(
|
|
10
|
-
getAllBalances(
|
|
11
|
-
getTrustLines(
|
|
12
|
-
getTrustLine(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
9
|
+
getBalance(address: string, tokenAddress: string): Promise<string>;
|
|
10
|
+
getAllBalances(address: string): Promise<XrplTokenBalance[]>;
|
|
11
|
+
getTrustLines(address: string, issuer?: string): Promise<AccountLinesRpcResponse>;
|
|
12
|
+
getTrustLine(address: string, issuer: string, currency: string): Promise<TrustLine | null>;
|
|
13
|
+
accountActivatedInfo(address: string): Promise<{
|
|
14
|
+
isActivated: boolean;
|
|
15
|
+
reserveBaseBn: bigint;
|
|
16
|
+
}>;
|
|
18
17
|
/**
|
|
19
18
|
* Waits for a transaction to be validated and returns its final status.
|
|
20
19
|
* Resolves to 'success' or throws an error with the failed status.
|
|
@@ -23,6 +22,8 @@ export declare class XrplRpcClient {
|
|
|
23
22
|
interval?: number | undefined;
|
|
24
23
|
timeout?: number | undefined;
|
|
25
24
|
}): Promise<string>;
|
|
25
|
+
private getServerState;
|
|
26
|
+
private getAccountInfo;
|
|
26
27
|
/**
|
|
27
28
|
* Returns the balance of the user in the native XRP token
|
|
28
29
|
* formatted as a string
|
|
@@ -34,6 +35,5 @@ export declare class XrplRpcClient {
|
|
|
34
35
|
*/
|
|
35
36
|
private getIssuedCurrencyBalance;
|
|
36
37
|
private call;
|
|
37
|
-
private getSpendableNativeBalance;
|
|
38
38
|
}
|
|
39
39
|
export {};
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { nativeXrplTokenAddress } from "../../core/constants";
|
|
2
|
+
import { XrplTxStatus, } from "../../core/types/xrpl";
|
|
3
|
+
import { formatBNToReadable } from "../internal/numberService";
|
|
3
4
|
export class XrplRpcClient {
|
|
4
5
|
rpcUrl;
|
|
5
6
|
constructor(rpcUrl) {
|
|
6
7
|
this.rpcUrl = rpcUrl;
|
|
7
8
|
}
|
|
8
|
-
async getBalance(
|
|
9
|
-
if (tokenAddress ===
|
|
10
|
-
return this.getNativeBalance(
|
|
9
|
+
async getBalance(address, tokenAddress) {
|
|
10
|
+
if (tokenAddress.toLowerCase() === nativeXrplTokenAddress.toLowerCase()) {
|
|
11
|
+
return this.getNativeBalance(address);
|
|
11
12
|
}
|
|
12
|
-
return this.getIssuedCurrencyBalance(
|
|
13
|
+
return this.getIssuedCurrencyBalance(address, tokenAddress);
|
|
13
14
|
}
|
|
14
|
-
async getAllBalances(
|
|
15
|
-
const nativeBalancePromise = this.getNativeBalance(userAddress);
|
|
16
|
-
const trustLinesPromise = this.getTrustLines(userAddress);
|
|
15
|
+
async getAllBalances(address) {
|
|
17
16
|
const [nativeBalance, trustLineBalances] = await Promise.all([
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
this.getNativeBalance(address),
|
|
18
|
+
this.getTrustLines(address),
|
|
20
19
|
]);
|
|
21
20
|
return [
|
|
22
21
|
{
|
|
23
22
|
balance: nativeBalance,
|
|
24
|
-
address:
|
|
23
|
+
address: nativeXrplTokenAddress,
|
|
25
24
|
},
|
|
26
25
|
...trustLineBalances.lines.map((line) => ({
|
|
27
26
|
balance: line.balance,
|
|
@@ -29,41 +28,38 @@ export class XrplRpcClient {
|
|
|
29
28
|
})),
|
|
30
29
|
];
|
|
31
30
|
}
|
|
32
|
-
async getTrustLines(
|
|
31
|
+
async getTrustLines(address, issuer) {
|
|
33
32
|
return this.call("account_lines", [
|
|
34
33
|
{
|
|
35
|
-
account:
|
|
34
|
+
account: address,
|
|
36
35
|
ledger_index: "validated",
|
|
37
36
|
peer: issuer,
|
|
38
37
|
},
|
|
39
38
|
]);
|
|
40
39
|
}
|
|
41
|
-
async getTrustLine(
|
|
42
|
-
const response = await this.getTrustLines(
|
|
40
|
+
async getTrustLine(address, issuer, currency) {
|
|
41
|
+
const response = await this.getTrustLines(address, issuer);
|
|
43
42
|
const trustLine = response.lines.find((line) => line.currency === currency);
|
|
44
43
|
return trustLine ?? null;
|
|
45
44
|
}
|
|
46
|
-
async
|
|
45
|
+
async accountActivatedInfo(address) {
|
|
46
|
+
const serverState = await this.getServerState();
|
|
47
|
+
const reserveBaseBn = BigInt(serverState.state.validated_ledger.reserve_base);
|
|
47
48
|
try {
|
|
48
|
-
await this.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return true;
|
|
49
|
+
const accountInfo = await this.getAccountInfo(address);
|
|
50
|
+
const balanceBn = BigInt(accountInfo.account_data.Balance);
|
|
51
|
+
return {
|
|
52
|
+
isActivated: balanceBn >= reserveBaseBn,
|
|
53
|
+
reserveBaseBn,
|
|
54
|
+
};
|
|
55
55
|
}
|
|
56
56
|
catch (error) {
|
|
57
57
|
if (error.message?.includes("actNotFound")) {
|
|
58
|
-
return false;
|
|
58
|
+
return { isActivated: false, reserveBaseBn };
|
|
59
59
|
}
|
|
60
60
|
throw error;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
/**
|
|
64
|
-
* Checks the status of a transaction by its hash.
|
|
65
|
-
* Returns 'success', 'failed', or 'pending'.
|
|
66
|
-
*/
|
|
67
63
|
/**
|
|
68
64
|
* Waits for a transaction to be validated and returns its final status.
|
|
69
65
|
* Resolves to 'success' or throws an error with the failed status.
|
|
@@ -86,17 +82,17 @@ export class XrplRpcClient {
|
|
|
86
82
|
await new Promise((res) => setTimeout(res, interval));
|
|
87
83
|
continue;
|
|
88
84
|
}
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
91
|
-
return
|
|
85
|
+
const status = response.meta?.TransactionResult;
|
|
86
|
+
if (status === XrplTxStatus.SUCCESS) {
|
|
87
|
+
return status;
|
|
92
88
|
}
|
|
93
89
|
else {
|
|
94
|
-
throw new Error(`Transaction failed with
|
|
90
|
+
throw new Error(`Transaction failed with status: ${status}`);
|
|
95
91
|
}
|
|
96
92
|
}
|
|
97
93
|
catch (error) {
|
|
98
94
|
// txnNotFound = still pending or non-existent
|
|
99
|
-
if (error
|
|
95
|
+
if (error?.message?.includes("txnNotFound")) {
|
|
100
96
|
if (Date.now() - startTime > timeout) {
|
|
101
97
|
throw new Error(`Transaction ${txHash} not found within timeout`);
|
|
102
98
|
}
|
|
@@ -108,23 +104,25 @@ export class XrplRpcClient {
|
|
|
108
104
|
}
|
|
109
105
|
}
|
|
110
106
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const accountInfoCall = this.call("account_info", [
|
|
107
|
+
async getServerState() {
|
|
108
|
+
return this.call("server_state", [{}]);
|
|
109
|
+
}
|
|
110
|
+
async getAccountInfo(address) {
|
|
111
|
+
return this.call("account_info", [
|
|
117
112
|
{
|
|
118
|
-
account:
|
|
113
|
+
account: address,
|
|
119
114
|
ledger_index: "validated",
|
|
120
115
|
},
|
|
121
116
|
]);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Returns the balance of the user in the native XRP token
|
|
120
|
+
* formatted as a string
|
|
121
|
+
*/
|
|
122
|
+
async getNativeBalance(address) {
|
|
125
123
|
const [accountInfo, serverState] = await Promise.all([
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
this.getAccountInfo(address),
|
|
125
|
+
this.getServerState(),
|
|
128
126
|
]);
|
|
129
127
|
const balance = BigInt(accountInfo.account_data.Balance);
|
|
130
128
|
const ownerCount = BigInt(accountInfo.account_data.OwnerCount);
|
|
@@ -138,8 +136,8 @@ export class XrplRpcClient {
|
|
|
138
136
|
* Returns the balance of the user in the given issued currency (e.g. RLUSD)
|
|
139
137
|
* formatted as a string
|
|
140
138
|
*/
|
|
141
|
-
async getIssuedCurrencyBalance(
|
|
142
|
-
const response = await this.getTrustLines(
|
|
139
|
+
async getIssuedCurrencyBalance(address, tokenAddress) {
|
|
140
|
+
const response = await this.getTrustLines(address);
|
|
143
141
|
const tokenBalance = response.lines.find((line) => `${line.currency}.${line.account}` === tokenAddress);
|
|
144
142
|
return tokenBalance?.balance || "0";
|
|
145
143
|
}
|
|
@@ -165,12 +163,5 @@ export class XrplRpcClient {
|
|
|
165
163
|
}
|
|
166
164
|
return data.result;
|
|
167
165
|
}
|
|
168
|
-
getSpendableNativeBalance(balance) {
|
|
169
|
-
const reserveDrops = parseToBigInt("1", 6);
|
|
170
|
-
const balanceDrops = BigInt(balance);
|
|
171
|
-
return balanceDrops > reserveDrops
|
|
172
|
-
? String(balanceDrops - reserveDrops)
|
|
173
|
-
: "0";
|
|
174
|
-
}
|
|
175
166
|
}
|
|
176
167
|
//# sourceMappingURL=xrplRpcClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xrplRpcClient.js","sourceRoot":"","sources":["../../../src/services/external/xrplRpcClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"xrplRpcClient.js","sourceRoot":"","sources":["../../../src/services/external/xrplRpcClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB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OAAO,YAAY,EAAE,OAAO,IAAI,GAAG,CAAC;IACtC,CAAC;IAEO,KAAK,CAAC,IAAI,CAAI,MAAc,EAAE,MAAa;QACjD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE;YACxC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,OAAO,EAAE,KAAK;gBACd,EAAE,EAAE,CAAC;gBACL,MAAM;gBACN,MAAM;aACP,CAAC;SACH,CAAC,CAAC;QAEH,MAAM,IAAI,GACR,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAExB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,MAAM,GAAG,CAAC,CAAC;SAC1D;QAED,IAAI,OAAO,IAAI,IAAI,CAAC,MAAM,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;SACrE;QAED,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./external/
|
|
1
|
+
export * from "./external/";
|
|
2
2
|
export * from "./internal/apiService";
|
|
3
3
|
export * from "./internal/assetsService";
|
|
4
4
|
export * from "./internal/configService";
|
|
@@ -6,6 +6,7 @@ export * from "./internal/cosmosService";
|
|
|
6
6
|
export * from "./internal/errorService";
|
|
7
7
|
export * from "./internal/eventService";
|
|
8
8
|
export * from "./internal/evmService";
|
|
9
|
+
export * from "./internal/fiatToCryptoService";
|
|
9
10
|
export * from "./internal/numberService";
|
|
10
11
|
export * from "./internal/priceService";
|
|
11
12
|
export * from "./internal/searchService";
|
|
@@ -13,5 +14,5 @@ export * from "./internal/solanaService";
|
|
|
13
14
|
export * from "./internal/transactionService";
|
|
14
15
|
export * from "./internal/transactionStatusService";
|
|
15
16
|
export * from "./internal/walletService";
|
|
16
|
-
export * from "./internal/
|
|
17
|
-
export * from "./
|
|
17
|
+
export * from "./internal/xionService";
|
|
18
|
+
export * from "./internal/xrplService";
|
package/dist/services/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./external/
|
|
1
|
+
export * from "./external/";
|
|
2
2
|
export * from "./internal/apiService";
|
|
3
3
|
export * from "./internal/assetsService";
|
|
4
4
|
export * from "./internal/configService";
|
|
@@ -6,6 +6,7 @@ export * from "./internal/cosmosService";
|
|
|
6
6
|
export * from "./internal/errorService";
|
|
7
7
|
export * from "./internal/eventService";
|
|
8
8
|
export * from "./internal/evmService";
|
|
9
|
+
export * from "./internal/fiatToCryptoService";
|
|
9
10
|
export * from "./internal/numberService";
|
|
10
11
|
export * from "./internal/priceService";
|
|
11
12
|
export * from "./internal/searchService";
|
|
@@ -13,7 +14,6 @@ export * from "./internal/solanaService";
|
|
|
13
14
|
export * from "./internal/transactionService";
|
|
14
15
|
export * from "./internal/transactionStatusService";
|
|
15
16
|
export * from "./internal/walletService";
|
|
16
|
-
export * from "./internal/
|
|
17
|
-
|
|
18
|
-
export * from "./external/xrplRpcClient";
|
|
17
|
+
export * from "./internal/xionService";
|
|
18
|
+
export * from "./internal/xrplService";
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"}
|
|
@@ -25,7 +25,7 @@ export declare const sortTokensBySharedSubgraphIds: ({ a, b, tokenToCheck, }: {
|
|
|
25
25
|
export declare const filterChains: ({ chains, config, direction, }: {
|
|
26
26
|
chains: ChainData[];
|
|
27
27
|
config: Pick<AppConfig, "disabledChains">;
|
|
28
|
-
direction?: "
|
|
28
|
+
direction?: "from" | "to" | undefined;
|
|
29
29
|
}) => ChainData[];
|
|
30
30
|
/**
|
|
31
31
|
* Filter tokens based on provided config
|
|
@@ -34,7 +34,7 @@ export declare const filterChains: ({ chains, config, direction, }: {
|
|
|
34
34
|
export declare const filterTokens: ({ tokens, config, direction, }: {
|
|
35
35
|
tokens: Token[];
|
|
36
36
|
config: Pick<AppConfig, "disabledChains">;
|
|
37
|
-
direction?: "
|
|
37
|
+
direction?: "from" | "to" | undefined;
|
|
38
38
|
}) => Token[];
|
|
39
39
|
/**
|
|
40
40
|
* Get disabled chains based on the provided config
|
|
@@ -104,8 +104,10 @@ export type AssetsColors = {
|
|
|
104
104
|
}>;
|
|
105
105
|
};
|
|
106
106
|
export declare function fetchAssetsColors(): Promise<AssetsColors>;
|
|
107
|
-
export declare function initializeSquidWithAssetsColors(squid: Squid, assetsColors: AssetsColors):
|
|
107
|
+
export declare function initializeSquidWithAssetsColors(squid: Squid, assetsColors: AssetsColors): void;
|
|
108
108
|
export declare function isEmptyObject(obj: Record<string, unknown> | undefined): boolean;
|
|
109
|
+
export declare const normalizeTokenSymbol: (symbol: string) => string;
|
|
110
|
+
export declare const areTokenSymbolsCompatible: (symbol1: string, symbol2: string) => boolean;
|
|
109
111
|
export declare function isEvmosChain(chain: ChainData | undefined): boolean;
|
|
110
112
|
/**
|
|
111
113
|
* Converts an evmos address (erc20/0x123...abc)
|