0xtrails 0.6.6 → 0.7.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/aave.d.ts +10 -2
- package/dist/aave.d.ts.map +1 -1
- package/dist/analytics.d.ts +26 -0
- package/dist/analytics.d.ts.map +1 -1
- package/dist/{ccip-CbJrlK-L.js → ccip-fConRNoG.js} +21 -21
- package/dist/chains.d.ts +23 -8
- package/dist/chains.d.ts.map +1 -1
- package/dist/constants.d.ts +5 -5
- package/dist/constants.d.ts.map +1 -1
- package/dist/customTokens.d.ts +12 -0
- package/dist/customTokens.d.ts.map +1 -0
- package/dist/decoders.d.ts +2 -2
- package/dist/decoders.d.ts.map +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/fees.d.ts +37 -2
- package/dist/fees.d.ts.map +1 -1
- package/dist/gasless.d.ts +15 -36
- package/dist/gasless.d.ts.map +1 -1
- package/dist/{index-w7_dK4c5.js → index-BbajxCG_.js} +59269 -77146
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +828 -359
- package/dist/indexerClient.d.ts.map +1 -1
- package/dist/intentReceiptMonitor.d.ts +1 -1
- package/dist/intentReceiptMonitor.d.ts.map +1 -1
- package/dist/intentReceiptPoller.d.ts +1 -1
- package/dist/intentReceiptPoller.d.ts.map +1 -1
- package/dist/intents.d.ts +3 -2
- package/dist/intents.d.ts.map +1 -1
- package/dist/mode.d.ts +1 -1
- package/dist/mode.d.ts.map +1 -1
- package/dist/mutations.d.ts +2 -2
- package/dist/mutations.d.ts.map +1 -1
- package/dist/prepareSend.d.ts +2 -2
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/prices.d.ts +1 -1
- package/dist/prices.d.ts.map +1 -1
- package/dist/sequenceWallet.d.ts +2 -2
- package/dist/sequenceWallet.d.ts.map +1 -1
- package/dist/time.d.ts +6 -0
- package/dist/time.d.ts.map +1 -1
- package/dist/tokenBalances.d.ts +40 -25
- package/dist/tokenBalances.d.ts.map +1 -1
- package/dist/tokens.d.ts +54 -14
- package/dist/tokens.d.ts.map +1 -1
- package/dist/trailsClient.d.ts +1 -1
- package/dist/trailsClient.d.ts.map +1 -1
- package/dist/trailsRouter.d.ts +2 -1
- package/dist/trailsRouter.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts +3 -2
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts +2 -1
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -1
- package/dist/transactionIntent/execution/transactionState.d.ts +1 -1
- package/dist/transactionIntent/execution/transactionState.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/crossChain.d.ts +5 -3
- package/dist/transactionIntent/handlers/crossChain.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/sameChainSameToken.d.ts +5 -3
- package/dist/transactionIntent/handlers/sameChainSameToken.d.ts.map +1 -1
- package/dist/transactionIntent/quote/feeExtractors.d.ts +1 -6
- package/dist/transactionIntent/quote/feeExtractors.d.ts.map +1 -1
- package/dist/transactionIntent/quote/normalizeQuote.d.ts +4 -2
- package/dist/transactionIntent/quote/normalizeQuote.d.ts.map +1 -1
- package/dist/transactionIntent/quote/quoteHelpers.d.ts +1 -1
- package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +1 -1
- package/dist/transactionIntent/types.d.ts +28 -5
- package/dist/transactionIntent/types.d.ts.map +1 -1
- package/dist/transactionIntent/utils/testnetHelpers.d.ts +0 -1
- package/dist/transactionIntent/utils/testnetHelpers.d.ts.map +1 -1
- package/dist/transactionIntent/validators.d.ts +0 -2
- package/dist/transactionIntent/validators.d.ts.map +1 -1
- package/dist/transactions.d.ts +2 -2
- package/dist/transactions.d.ts.map +1 -1
- package/dist/utils.d.ts +7 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/wallets.d.ts +1 -0
- package/dist/wallets.d.ts.map +1 -1
- package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/components/AddressWalletIcon.d.ts +6 -0
- package/dist/widget/components/AddressWalletIcon.d.ts.map +1 -0
- package/dist/widget/components/ChainFilterDropdown.d.ts +2 -6
- package/dist/widget/components/ChainFilterDropdown.d.ts.map +1 -1
- package/dist/widget/components/ChainImage.d.ts.map +1 -1
- package/dist/widget/components/ChainList.d.ts +0 -5
- package/dist/widget/components/ChainList.d.ts.map +1 -1
- package/dist/widget/components/ClassicSwap.d.ts +6 -6
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
- package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
- package/dist/widget/components/ConnectedWallets.d.ts.map +1 -1
- package/dist/widget/components/DebugMenu.d.ts +1 -1
- package/dist/widget/components/DebugMenu.d.ts.map +1 -1
- package/dist/widget/components/DebugScreensList.d.ts.map +1 -1
- package/dist/widget/components/DepositTracker.d.ts.map +1 -1
- package/dist/widget/components/Earn.d.ts +5 -5
- package/dist/widget/components/Earn.d.ts.map +1 -1
- package/dist/widget/components/FeeOption.d.ts +1 -1
- package/dist/widget/components/FeeOption.d.ts.map +1 -1
- package/dist/widget/components/FeeOptions.d.ts +2 -2
- package/dist/widget/components/FeeOptions.d.ts.map +1 -1
- package/dist/widget/components/Footer.d.ts +1 -1
- package/dist/widget/components/Footer.d.ts.map +1 -1
- package/dist/widget/components/Fund.d.ts +5 -5
- package/dist/widget/components/Fund.d.ts.map +1 -1
- package/dist/widget/components/FundMethods.d.ts +0 -1
- package/dist/widget/components/FundMethods.d.ts.map +1 -1
- package/dist/widget/components/FundSwap.d.ts +6 -6
- package/dist/widget/components/FundSwap.d.ts.map +1 -1
- package/dist/widget/components/HookModalContent.d.ts +8 -0
- package/dist/widget/components/HookModalContent.d.ts.map +1 -0
- package/dist/widget/components/OriginSelectionAmount.d.ts +11 -0
- package/dist/widget/components/OriginSelectionAmount.d.ts.map +1 -0
- package/dist/widget/components/Pay.d.ts +5 -5
- package/dist/widget/components/Pay.d.ts.map +1 -1
- package/dist/widget/components/PoolDeposit.d.ts +5 -5
- package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
- package/dist/widget/components/PoolWithdraw.d.ts +3 -3
- package/dist/widget/components/PoolWithdraw.d.ts.map +1 -1
- package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
- package/dist/widget/components/Receipt.d.ts +2 -1
- package/dist/widget/components/Receipt.d.ts.map +1 -1
- package/dist/widget/components/RecentTokens.d.ts +4 -4
- package/dist/widget/components/RecentTokens.d.ts.map +1 -1
- package/dist/widget/components/RecipientSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/ShadowPortal.d.ts +6 -0
- package/dist/widget/components/ShadowPortal.d.ts.map +1 -0
- package/dist/widget/components/Swap.d.ts +6 -6
- package/dist/widget/components/Swap.d.ts.map +1 -1
- package/dist/widget/components/ThemeProvider.d.ts +1 -1
- package/dist/widget/components/ThemeProvider.d.ts.map +1 -1
- package/dist/widget/components/TokenList.d.ts +3 -4
- package/dist/widget/components/TokenList.d.ts.map +1 -1
- package/dist/widget/components/TokenSelector.d.ts +3 -4
- package/dist/widget/components/TokenSelector.d.ts.map +1 -1
- package/dist/widget/components/Tooltip.d.ts +6 -1
- package/dist/widget/components/Tooltip.d.ts.map +1 -1
- package/dist/widget/components/TrailsHookModal.d.ts +10 -0
- package/dist/widget/components/TrailsHookModal.d.ts.map +1 -0
- package/dist/widget/components/WaasFeeOptions.d.ts +3 -0
- package/dist/widget/components/WaasFeeOptions.d.ts.map +1 -1
- package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
- package/dist/widget/components/WalletConnect.d.ts.map +1 -1
- package/dist/widget/components/WidgetProviders.d.ts +14 -0
- package/dist/widget/components/WidgetProviders.d.ts.map +1 -0
- package/dist/widget/css/compiled.css +1 -1
- package/dist/widget/hooks/useAddressWalletIcon.d.ts +10 -0
- package/dist/widget/hooks/useAddressWalletIcon.d.ts.map +1 -0
- package/dist/widget/hooks/useBalanceVisible.d.ts +1 -1
- package/dist/widget/hooks/useBalanceVisible.d.ts.map +1 -1
- package/dist/widget/hooks/useChainFilter.d.ts +1 -1
- package/dist/widget/hooks/useChainFilter.d.ts.map +1 -1
- package/dist/widget/hooks/useCheckout.d.ts +13 -1
- package/dist/widget/hooks/useCheckout.d.ts.map +1 -1
- package/dist/widget/hooks/useConnector.d.ts +4 -0
- package/dist/widget/hooks/useConnector.d.ts.map +1 -0
- package/dist/widget/hooks/useCurrentScreen.d.ts +1 -1
- package/dist/widget/hooks/useCurrentScreen.d.ts.map +1 -1
- package/dist/widget/hooks/useCustomTokenFetch.d.ts +19 -0
- package/dist/widget/hooks/useCustomTokenFetch.d.ts.map +1 -0
- package/dist/widget/hooks/useCustomTokenSearch.d.ts +20 -0
- package/dist/widget/hooks/useCustomTokenSearch.d.ts.map +1 -0
- package/dist/widget/hooks/useDebounce.d.ts +10 -0
- package/dist/widget/hooks/useDebounce.d.ts.map +1 -0
- package/dist/widget/hooks/useDebugScreens.d.ts +7 -2
- package/dist/widget/hooks/useDebugScreens.d.ts.map +1 -1
- package/dist/widget/hooks/useDefaultTokenSelection.d.ts +3 -19
- package/dist/widget/hooks/useDefaultTokenSelection.d.ts.map +1 -1
- package/dist/widget/hooks/useDestinationSelectedToken.d.ts +1 -14
- package/dist/widget/hooks/useDestinationSelectedToken.d.ts.map +1 -1
- package/dist/widget/hooks/useEarnPool.d.ts +1 -1
- package/dist/widget/hooks/useEarnPool.d.ts.map +1 -1
- package/dist/widget/hooks/useIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/hooks/useIsMobile.d.ts +5 -0
- package/dist/widget/hooks/useIsMobile.d.ts.map +1 -0
- package/dist/widget/hooks/useMode.d.ts +2 -2
- package/dist/widget/hooks/useMode.d.ts.map +1 -1
- package/dist/widget/hooks/useOriginSelectedToken.d.ts +2 -15
- package/dist/widget/hooks/useOriginSelectedToken.d.ts.map +1 -1
- package/dist/widget/hooks/usePayMessage.d.ts.map +1 -1
- package/dist/widget/hooks/usePriceImpactWarning.d.ts +1 -1
- package/dist/widget/hooks/usePriceImpactWarning.d.ts.map +1 -1
- package/dist/widget/hooks/useQuote.d.ts +173 -4
- package/dist/widget/hooks/useQuote.d.ts.map +1 -1
- package/dist/widget/hooks/useRecentTokens.d.ts +3 -3
- package/dist/widget/hooks/useRecentTokens.d.ts.map +1 -1
- package/dist/widget/hooks/useRecipients.d.ts +1 -1
- package/dist/widget/hooks/useRecipients.d.ts.map +1 -1
- package/dist/widget/hooks/useSelectedFeeOption.d.ts +2 -2
- package/dist/widget/hooks/useSelectedFeeOption.d.ts.map +1 -1
- package/dist/widget/hooks/useSelectedFundMethod.d.ts +1 -1
- package/dist/widget/hooks/useSelectedFundMethod.d.ts.map +1 -1
- package/dist/widget/hooks/useSelectedRecipient.d.ts +1 -1
- package/dist/widget/hooks/useSelectedRecipient.d.ts.map +1 -1
- package/dist/widget/hooks/useSendForm.d.ts +9 -31
- package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
- package/dist/widget/hooks/useSwapAmount.d.ts +1 -1
- package/dist/widget/hooks/useSwapAmount.d.ts.map +1 -1
- package/dist/widget/hooks/useTheme.d.ts +1 -1
- package/dist/widget/hooks/useTheme.d.ts.map +1 -1
- package/dist/widget/hooks/useTokenList.d.ts +7 -31
- package/dist/widget/hooks/useTokenList.d.ts.map +1 -1
- package/dist/widget/hooks/useTrailsSendTransaction.d.ts +83 -0
- package/dist/widget/hooks/useTrailsSendTransaction.d.ts.map +1 -0
- package/dist/widget/hooks/useWalletConnectUri.d.ts +11 -0
- package/dist/widget/hooks/useWalletConnectUri.d.ts.map +1 -0
- package/dist/widget/hooks/useWidgetProps.d.ts +5 -0
- package/dist/widget/hooks/useWidgetProps.d.ts.map +1 -1
- package/dist/widget/index.d.ts +2 -0
- package/dist/widget/index.d.ts.map +1 -1
- package/dist/widget/index.js +8 -5
- package/dist/widget/providers/TrailsModalProvider.d.ts +65 -0
- package/dist/widget/providers/TrailsModalProvider.d.ts.map +1 -0
- package/dist/widget/providers/TrailsProvider.d.ts +1 -1
- package/dist/widget/providers/TrailsProvider.d.ts.map +1 -1
- package/dist/widget/types.d.ts +11 -18
- package/dist/widget/types.d.ts.map +1 -1
- package/dist/widget/widget.d.ts +20 -11
- package/dist/widget/widget.d.ts.map +1 -1
- package/package.json +45 -49
- package/src/aave.ts +387 -138
- package/src/analytics.ts +208 -2
- package/src/chains.ts +65 -64
- package/src/constants.ts +18 -14
- package/src/customTokens.ts +151 -0
- package/src/decoders.ts +4 -7
- package/src/error.ts +7 -3
- package/src/fees.ts +239 -125
- package/src/gasless.ts +54 -108
- package/src/index.ts +29 -9
- package/src/indexerClient.ts +2 -0
- package/src/intentReceiptMonitor.ts +1 -4
- package/src/intentReceiptPoller.ts +2 -2
- package/src/intents.ts +16 -5
- package/src/mode.ts +1 -1
- package/src/mutations.ts +7 -3
- package/src/prepareSend.ts +19 -14
- package/src/prices.ts +1 -1
- package/src/sequenceWallet.ts +2 -2
- package/src/time.ts +28 -0
- package/src/tokenBalances.ts +348 -153
- package/src/tokens.ts +393 -142
- package/src/trailsClient.ts +1 -1
- package/src/trailsRouter.ts +4 -5
- package/src/transactionIntent/deposits/depositOrchestrator.ts +6 -2
- package/src/transactionIntent/deposits/gaslessDeposit.ts +13 -7
- package/src/transactionIntent/deposits/standardDeposit.ts +1 -1
- package/src/transactionIntent/execution/transactionState.ts +1 -1
- package/src/transactionIntent/handlers/crossChain.ts +75 -37
- package/src/transactionIntent/handlers/sameChainSameToken.ts +66 -20
- package/src/transactionIntent/quote/feeExtractors.ts +1 -29
- package/src/transactionIntent/quote/normalizeQuote.ts +99 -7
- package/src/transactionIntent/quote/quoteHelpers.ts +1 -1
- package/src/transactionIntent/types.ts +31 -6
- package/src/transactionIntent/utils/testnetHelpers.ts +0 -5
- package/src/transactionIntent/validators.ts +0 -30
- package/src/transactions.ts +3 -3
- package/src/utils.ts +18 -0
- package/src/wallets.ts +32 -10
- package/src/widget/compiled.css +1 -1
- package/src/widget/components/AccountIntentTransactionHistory.tsx +2 -1
- package/src/widget/components/AccountIntentTransactionHistoryButton.tsx +2 -2
- package/src/widget/components/AddressWalletIcon.tsx +29 -0
- package/src/widget/components/ChainFilterDropdown.tsx +2 -8
- package/src/widget/components/ChainImage.tsx +8 -5
- package/src/widget/components/ChainList.tsx +6 -8
- package/src/widget/components/ClassicSwap.tsx +93 -85
- package/src/widget/components/ConnectWallet.tsx +1 -2
- package/src/widget/components/ConnectedWallets.tsx +17 -4
- package/src/widget/components/DebugMenu.tsx +2 -2
- package/src/widget/components/DebugScreensList.tsx +0 -1
- package/src/widget/components/DepositTracker.tsx +20 -34
- package/src/widget/components/Earn.tsx +7 -6
- package/src/widget/components/FeeOption.tsx +4 -4
- package/src/widget/components/FeeOptions.tsx +19 -39
- package/src/widget/components/Footer.tsx +1 -1
- package/src/widget/components/Fund.tsx +23 -119
- package/src/widget/components/FundMethods.tsx +9 -6
- package/src/widget/components/FundSwap.tsx +6 -5
- package/src/widget/components/FundingMethodSelectorButton.tsx +2 -2
- package/src/widget/components/HookModalContent.tsx +306 -0
- package/src/widget/components/Modal.tsx +1 -1
- package/src/widget/components/OriginSelectionAmount.tsx +135 -0
- package/src/widget/components/Pay.tsx +66 -124
- package/src/widget/components/PoolDeposit.tsx +11 -55
- package/src/widget/components/PoolWithdraw.tsx +3 -3
- package/src/widget/components/QuoteDetails.tsx +473 -728
- package/src/widget/components/Receipt.tsx +74 -7
- package/src/widget/components/RecentTokens.tsx +8 -8
- package/src/widget/components/RecipientSelectorButton.tsx +4 -2
- package/src/widget/components/ScreenHeader.tsx +2 -2
- package/src/widget/components/SearchInputField.tsx +1 -1
- package/src/widget/components/ShadowPortal.tsx +58 -0
- package/src/widget/components/Swap.tsx +6 -5
- package/src/widget/components/ThemeProvider.tsx +1 -1
- package/src/widget/components/TokenList.tsx +3 -4
- package/src/widget/components/TokenSelector.tsx +211 -80
- package/src/widget/components/Tooltip.tsx +18 -7
- package/src/widget/components/TrailsHookModal.tsx +118 -0
- package/src/widget/components/WaasFeeOptions.tsx +333 -138
- package/src/widget/components/WalletConfirmation.tsx +7 -2
- package/src/widget/components/WalletConnect.tsx +197 -235
- package/src/widget/components/WidgetProviders.tsx +75 -0
- package/src/widget/hooks/useAddressWalletIcon.ts +53 -0
- package/src/widget/hooks/useBalanceVisible.tsx +1 -1
- package/src/widget/hooks/useChainFilter.tsx +1 -1
- package/src/widget/hooks/useCheckout.ts +13 -1
- package/src/widget/hooks/useConnector.tsx +18 -0
- package/src/widget/hooks/useCurrentScreen.tsx +3 -3
- package/src/widget/hooks/useCustomTokenFetch.tsx +72 -0
- package/src/widget/hooks/useCustomTokenSearch.tsx +402 -0
- package/src/widget/hooks/useDebounce.ts +25 -0
- package/src/widget/hooks/useDebugScreens.ts +26 -10
- package/src/widget/hooks/useDefaultTokenSelection.tsx +99 -143
- package/src/widget/hooks/useDestinationSelectedToken.tsx +1 -14
- package/src/widget/hooks/useEarnPool.tsx +1 -1
- package/src/widget/hooks/useIntentTransactionHistory.ts +20 -11
- package/src/widget/hooks/useIsMobile.tsx +50 -0
- package/src/widget/hooks/useMode.ts +2 -3
- package/src/widget/hooks/useOriginSelectedToken.tsx +2 -15
- package/src/widget/hooks/usePayMessage.tsx +31 -11
- package/src/widget/hooks/usePriceImpactWarning.ts +1 -1
- package/src/widget/hooks/useQuote.ts +189 -6
- package/src/widget/hooks/useRecentTokens.ts +6 -6
- package/src/widget/hooks/useRecipients.ts +1 -1
- package/src/widget/hooks/useSelectedFeeOption.tsx +2 -2
- package/src/widget/hooks/useSelectedFundMethod.tsx +1 -1
- package/src/widget/hooks/useSelectedRecipient.tsx +1 -1
- package/src/widget/hooks/useSendForm.ts +328 -152
- package/src/widget/hooks/useSwapAmount.tsx +1 -1
- package/src/widget/hooks/useTheme.tsx +1 -1
- package/src/widget/hooks/useTokenList.ts +672 -400
- package/src/widget/hooks/useTrailsSendTransaction.ts +949 -0
- package/src/widget/hooks/useWalletConnectUri.tsx +228 -0
- package/src/widget/hooks/useWidgetProps.tsx +3 -1
- package/src/widget/index.tsx +12 -0
- package/src/widget/providers/TrailsModalProvider.tsx +195 -0
- package/src/widget/providers/TrailsProvider.tsx +9 -3
- package/src/widget/types.ts +12 -20
- package/src/widget/widget.tsx +598 -385
- package/dist/cctp.d.ts +0 -3
- package/dist/cctp.d.ts.map +0 -1
- package/dist/lifi.d.ts +0 -4
- package/dist/lifi.d.ts.map +0 -1
- package/dist/meshconnect.d.ts +0 -171
- package/dist/meshconnect.d.ts.map +0 -1
- package/dist/relaySdk.d.ts +0 -87
- package/dist/relaySdk.d.ts.map +0 -1
- package/dist/widget/components/MeshConnectExchanges.d.ts +0 -7
- package/dist/widget/components/MeshConnectExchanges.d.ts.map +0 -1
- package/dist/widget/components/MeshConnectFlow.d.ts +0 -13
- package/dist/widget/components/MeshConnectFlow.d.ts.map +0 -1
- package/dist/widget/components/MeshConnectIframe.d.ts +0 -15
- package/dist/widget/components/MeshConnectIframe.d.ts.map +0 -1
- package/dist/widget/components/Receive.d.ts +0 -12
- package/dist/widget/components/Receive.d.ts.map +0 -1
- package/dist/widget/hooks/useSelectedMeshExchange.d.ts +0 -14
- package/dist/widget/hooks/useSelectedMeshExchange.d.ts.map +0 -1
- package/src/cctp.ts +0 -54
- package/src/lifi.ts +0 -108
- package/src/meshconnect.ts +0 -531
- package/src/relaySdk.ts +0 -703
- package/src/widget/components/MeshConnectExchanges.tsx +0 -290
- package/src/widget/components/MeshConnectFlow.tsx +0 -90
- package/src/widget/components/MeshConnectIframe.tsx +0 -500
- package/src/widget/components/Receive.tsx +0 -175
- package/src/widget/hooks/useSelectedMeshExchange.tsx +0 -46
package/src/meshconnect.ts
DELETED
|
@@ -1,531 +0,0 @@
|
|
|
1
|
-
import { logger } from "./logger.js"
|
|
2
|
-
|
|
3
|
-
// API URLs
|
|
4
|
-
const SANDBOX_API_URL = "https://sandbox-integration-api.meshconnect.com"
|
|
5
|
-
const PRODUCTION_API_URL = "https://integration-api.meshconnect.com"
|
|
6
|
-
|
|
7
|
-
// API Credentials
|
|
8
|
-
const DEFAULT_SANDBOX_API_KEY =
|
|
9
|
-
"c2tfc2FuZF9rcmFrd3d1Zi5qY3d6ZG80bDM2ZGo0bHNtcHduazNkYm9hYmlxb2QyZWoxb2drM2dsaTE0NnphazB1cnhhcHh1MmFvcGVsZGxs"
|
|
10
|
-
const DEFAULT_PRODUCTION_API_KEY =
|
|
11
|
-
"c2tfcHJvZF81MHh0M3BmNC5kYmx6OTdjY3VrdzVuMW92cDNmZ2F6aHNjZGh3a3NscW5zdGR2OGRmdGg4NWc2c2F0bWVvNDh5enF3NGt2bnZn"
|
|
12
|
-
const DEFAULT_CLIENT_ID = "018880d9-425c-49fa-b0e5-08ddce68a08d"
|
|
13
|
-
const DEFAULT_ENVIRONMENT = "production"
|
|
14
|
-
|
|
15
|
-
export function getMeshConnectApiKey(
|
|
16
|
-
environment: "sandbox" | "production" = "sandbox",
|
|
17
|
-
): string {
|
|
18
|
-
return atob(
|
|
19
|
-
environment === "production"
|
|
20
|
-
? DEFAULT_PRODUCTION_API_KEY
|
|
21
|
-
: DEFAULT_SANDBOX_API_KEY,
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function getMeshConnectApiUrl(
|
|
26
|
-
environment: "sandbox" | "production" = "sandbox",
|
|
27
|
-
): string {
|
|
28
|
-
return environment === "production" ? PRODUCTION_API_URL : SANDBOX_API_URL
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Types
|
|
32
|
-
export interface MeshConnectConfig {
|
|
33
|
-
apiKey: string
|
|
34
|
-
clientId: string
|
|
35
|
-
environment?: "sandbox" | "production"
|
|
36
|
-
userId?: string
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface TransferOptions {
|
|
40
|
-
integrationId?: string
|
|
41
|
-
address?: string
|
|
42
|
-
symbol?: string
|
|
43
|
-
networkId?: string
|
|
44
|
-
transactionId?: string
|
|
45
|
-
amount?: string
|
|
46
|
-
amountInFiat?: number
|
|
47
|
-
clientFee?: number
|
|
48
|
-
restrictMultipleAccounts?: boolean
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface LinkTokenRequest {
|
|
52
|
-
userId: string
|
|
53
|
-
integrationId?: string
|
|
54
|
-
restrictMultipleAccounts?: boolean
|
|
55
|
-
transferOptions?: {
|
|
56
|
-
toAddresses: Array<{
|
|
57
|
-
networkId: string
|
|
58
|
-
symbol: string
|
|
59
|
-
address: string
|
|
60
|
-
amount?: string
|
|
61
|
-
}>
|
|
62
|
-
transactionId?: string
|
|
63
|
-
amount?: string
|
|
64
|
-
amountInFiat?: number
|
|
65
|
-
clientFee?: number
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface LinkTokenResponse {
|
|
70
|
-
content: {
|
|
71
|
-
linkToken: string
|
|
72
|
-
}
|
|
73
|
-
success: boolean
|
|
74
|
-
message?: string
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface MeshConnectError extends Error {
|
|
78
|
-
statusCode?: number
|
|
79
|
-
response?: any
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Generate a random user ID with timestamp
|
|
84
|
-
*/
|
|
85
|
-
function generateUserId(): string {
|
|
86
|
-
return `user_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Build the request payload for link token generation
|
|
91
|
-
*/
|
|
92
|
-
function buildPayload(
|
|
93
|
-
config: MeshConnectConfig,
|
|
94
|
-
options: TransferOptions = {},
|
|
95
|
-
): LinkTokenRequest {
|
|
96
|
-
const payload: LinkTokenRequest = {
|
|
97
|
-
userId: config.userId || generateUserId(),
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Add integration ID if provided
|
|
101
|
-
if (options.integrationId) {
|
|
102
|
-
payload.integrationId = options.integrationId
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// Add restrict multiple accounts if specified
|
|
106
|
-
if (options.restrictMultipleAccounts) {
|
|
107
|
-
payload.restrictMultipleAccounts = true
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// Add transfer options if address is provided
|
|
111
|
-
if (options.address) {
|
|
112
|
-
payload.transferOptions = {
|
|
113
|
-
toAddresses: [],
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Build toAddresses array
|
|
117
|
-
if (options.symbol && options.networkId) {
|
|
118
|
-
payload.transferOptions.toAddresses.push({
|
|
119
|
-
networkId: options.networkId,
|
|
120
|
-
symbol: options.symbol,
|
|
121
|
-
address: options.address,
|
|
122
|
-
amount: options.amount,
|
|
123
|
-
})
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// Add transaction ID if provided
|
|
127
|
-
if (options.transactionId) {
|
|
128
|
-
payload.transferOptions.transactionId = options.transactionId
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Add amount in fiat if provided
|
|
132
|
-
if (options.amountInFiat !== undefined) {
|
|
133
|
-
payload.transferOptions.amountInFiat = options.amountInFiat
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (options.amount !== undefined) {
|
|
137
|
-
payload.transferOptions.amount = options.amount
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// Add client fee if provided
|
|
141
|
-
if (options.clientFee !== undefined) {
|
|
142
|
-
payload.transferOptions.clientFee = options.clientFee
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
return payload
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Make API request to generate link token
|
|
151
|
-
*/
|
|
152
|
-
async function makeApiRequest(
|
|
153
|
-
payload: LinkTokenRequest,
|
|
154
|
-
config: MeshConnectConfig,
|
|
155
|
-
): Promise<LinkTokenResponse> {
|
|
156
|
-
const apiUrl = getMeshConnectApiUrl(config.environment)
|
|
157
|
-
const endpoint = `${apiUrl}/api/v1/linktoken`
|
|
158
|
-
|
|
159
|
-
try {
|
|
160
|
-
const response = await fetch(endpoint, {
|
|
161
|
-
method: "POST",
|
|
162
|
-
headers: {
|
|
163
|
-
"Content-Type": "application/json",
|
|
164
|
-
"X-Client-Id": config.clientId,
|
|
165
|
-
"X-Client-Secret": config.apiKey,
|
|
166
|
-
},
|
|
167
|
-
body: JSON.stringify(payload),
|
|
168
|
-
})
|
|
169
|
-
|
|
170
|
-
const responseData = await response.json()
|
|
171
|
-
|
|
172
|
-
if (!response.ok) {
|
|
173
|
-
const error = new Error(
|
|
174
|
-
`API request failed with status ${response.status}`,
|
|
175
|
-
) as MeshConnectError
|
|
176
|
-
error.statusCode = response.status
|
|
177
|
-
error.response = responseData
|
|
178
|
-
throw error
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return responseData as LinkTokenResponse
|
|
182
|
-
} catch (error) {
|
|
183
|
-
if (error instanceof Error && "statusCode" in error) {
|
|
184
|
-
throw error
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
const meshError = new Error(`Network error: ${error}`) as MeshConnectError
|
|
188
|
-
throw meshError
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Check API health status
|
|
194
|
-
*/
|
|
195
|
-
export async function checkApiHealth(
|
|
196
|
-
config: MeshConnectConfig,
|
|
197
|
-
): Promise<boolean> {
|
|
198
|
-
const apiUrl = getMeshConnectApiUrl(config.environment)
|
|
199
|
-
const endpoint = `${apiUrl}/api/v1/health`
|
|
200
|
-
|
|
201
|
-
try {
|
|
202
|
-
const response = await fetch(endpoint, {
|
|
203
|
-
method: "GET",
|
|
204
|
-
headers: {
|
|
205
|
-
"X-Client-Id": config.clientId,
|
|
206
|
-
"X-Client-Secret": config.apiKey,
|
|
207
|
-
},
|
|
208
|
-
})
|
|
209
|
-
|
|
210
|
-
return response.ok
|
|
211
|
-
} catch (error) {
|
|
212
|
-
logger.console.warn("API health check failed:", error)
|
|
213
|
-
return false
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Generate a new link token using default credentials
|
|
219
|
-
* Convenience function that uses the pre-configured API key and client ID
|
|
220
|
-
*/
|
|
221
|
-
export async function createDefaultLinkToken(
|
|
222
|
-
options: Omit<TransferOptions, "userId"> & {
|
|
223
|
-
environment?: "sandbox" | "production"
|
|
224
|
-
} = {
|
|
225
|
-
environment: "sandbox",
|
|
226
|
-
},
|
|
227
|
-
): Promise<LinkTokenResponse> {
|
|
228
|
-
const apiKey = getMeshConnectApiKey(options.environment)
|
|
229
|
-
const clientId = getMeshConnectClientId()
|
|
230
|
-
return createNewLinkToken(apiKey, clientId, options)
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Generate a new link token with random user ID
|
|
235
|
-
* This is the main function equivalent to createLinkNew.sh
|
|
236
|
-
*/
|
|
237
|
-
export async function createNewLinkToken(
|
|
238
|
-
apiKey: string,
|
|
239
|
-
clientId: string,
|
|
240
|
-
options: Omit<TransferOptions, "userId"> & {
|
|
241
|
-
environment?: "sandbox" | "production"
|
|
242
|
-
} = {
|
|
243
|
-
environment: "sandbox",
|
|
244
|
-
},
|
|
245
|
-
): Promise<LinkTokenResponse> {
|
|
246
|
-
const config: MeshConnectConfig = {
|
|
247
|
-
apiKey,
|
|
248
|
-
clientId,
|
|
249
|
-
environment: options.environment,
|
|
250
|
-
userId: generateUserId(),
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// Validate required parameters
|
|
254
|
-
if (!apiKey || apiKey.length < 10) {
|
|
255
|
-
throw new Error("API key (client secret) is required and must be valid")
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
if (!clientId || clientId.length < 10) {
|
|
259
|
-
throw new Error("Client ID is required and must be valid")
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
// Build payload
|
|
263
|
-
const payload = buildPayload(config, options)
|
|
264
|
-
|
|
265
|
-
// Make API request
|
|
266
|
-
return await makeApiRequest(payload, config)
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* Generate a link token with specific user ID and transfer options
|
|
271
|
-
* This provides more control over the link token generation
|
|
272
|
-
*/
|
|
273
|
-
export async function createLinkToken(
|
|
274
|
-
config: MeshConnectConfig,
|
|
275
|
-
options: TransferOptions = {},
|
|
276
|
-
): Promise<LinkTokenResponse> {
|
|
277
|
-
// Validate required parameters
|
|
278
|
-
if (!config.apiKey || config.apiKey.length < 10) {
|
|
279
|
-
throw new Error("API key (client secret) is required and must be valid")
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
if (!config.clientId || config.clientId.length < 10) {
|
|
283
|
-
throw new Error("Client ID is required and must be valid")
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
// Build payload
|
|
287
|
-
const payload = buildPayload(config, options)
|
|
288
|
-
|
|
289
|
-
// Make API request
|
|
290
|
-
return await makeApiRequest(payload, config)
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Common Network IDs (based on Mesh Connect API)
|
|
295
|
-
*/
|
|
296
|
-
export const MESH_NETWORK_IDS = {
|
|
297
|
-
ETHEREUM: "e3c7fdd8-b1fc-4e51-85ae-bb276e075611",
|
|
298
|
-
POLYGON: "7436e9d0-ba42-4d2b-b4c0-8e4e606b2c12",
|
|
299
|
-
ARBITRUM: "a34f2431-0ddd-4de4-bc22-4a8143287aeb",
|
|
300
|
-
BASE: "aa883b03-120d-477c-a588-37c2afd3ca71",
|
|
301
|
-
AVALANCHE: "bad16371-c22a-4bf4-a311-274d046cd760",
|
|
302
|
-
BSC: "3b8c1557-4f06-4f56-8e4e-8c4c8c4c8c4c",
|
|
303
|
-
} as const
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Get Mesh Connect network ID from chain ID by fetching from API
|
|
307
|
-
* @param chainId - The EVM chain ID (e.g., 1 for Ethereum, 8453 for Base)
|
|
308
|
-
* @returns The corresponding Mesh Connect network ID, or undefined if not supported
|
|
309
|
-
*/
|
|
310
|
-
export async function getMeshNetworkIdFromChainId(
|
|
311
|
-
chainId: number | string,
|
|
312
|
-
environment: "sandbox" | "production" = "sandbox",
|
|
313
|
-
): Promise<string | undefined> {
|
|
314
|
-
try {
|
|
315
|
-
const apiUrl = getMeshConnectApiUrl(environment)
|
|
316
|
-
const apiKey = getMeshConnectApiKey(environment)
|
|
317
|
-
const clientId = getMeshConnectClientId()
|
|
318
|
-
const endpoint = `${apiUrl}/api/v1/transfers/managed/networks`
|
|
319
|
-
|
|
320
|
-
const response = await fetch(endpoint, {
|
|
321
|
-
method: "GET",
|
|
322
|
-
headers: {
|
|
323
|
-
"X-Client-Id": clientId,
|
|
324
|
-
"X-Client-Secret": apiKey,
|
|
325
|
-
"Content-Type": "application/json",
|
|
326
|
-
},
|
|
327
|
-
})
|
|
328
|
-
|
|
329
|
-
if (!response.ok) {
|
|
330
|
-
throw new Error(
|
|
331
|
-
`Failed to fetch networks: ${response.status} ${response.statusText}`,
|
|
332
|
-
)
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
const data = await response.json()
|
|
336
|
-
const networks = data.content?.networks || []
|
|
337
|
-
|
|
338
|
-
// Find network by chain ID
|
|
339
|
-
const targetChainId = chainId.toString()
|
|
340
|
-
const network = networks.find((net: any) => net.chainId === targetChainId)
|
|
341
|
-
|
|
342
|
-
return network?.id
|
|
343
|
-
} catch (error) {
|
|
344
|
-
logger.console.error(
|
|
345
|
-
"[meshconnect] Failed to fetch network ID for chain ID:",
|
|
346
|
-
chainId,
|
|
347
|
-
error,
|
|
348
|
-
)
|
|
349
|
-
return undefined
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Get all supported integrations from Mesh Connect API
|
|
355
|
-
* @param environment - The environment to use (sandbox or production)
|
|
356
|
-
* @returns Array of supported integrations
|
|
357
|
-
*/
|
|
358
|
-
export async function getMeshIntegrations(
|
|
359
|
-
environment: "sandbox" | "production" = "sandbox",
|
|
360
|
-
): Promise<MeshIntegration[]> {
|
|
361
|
-
try {
|
|
362
|
-
const apiUrl = getMeshConnectApiUrl(environment)
|
|
363
|
-
const apiKey = getMeshConnectApiKey(environment)
|
|
364
|
-
const clientId = getMeshConnectClientId()
|
|
365
|
-
const endpoint = `${apiUrl}/api/v1/transfers/managed/integrations`
|
|
366
|
-
|
|
367
|
-
const response = await fetch(endpoint, {
|
|
368
|
-
method: "GET",
|
|
369
|
-
headers: {
|
|
370
|
-
"X-Client-Id": clientId,
|
|
371
|
-
"X-Client-Secret": apiKey,
|
|
372
|
-
"Content-Type": "application/json",
|
|
373
|
-
},
|
|
374
|
-
})
|
|
375
|
-
|
|
376
|
-
if (!response.ok) {
|
|
377
|
-
throw new Error(
|
|
378
|
-
`Failed to fetch integrations: ${response.status} ${response.statusText}`,
|
|
379
|
-
)
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
const data: IntegrationsResponse = await response.json()
|
|
383
|
-
return data.content?.integrations || []
|
|
384
|
-
} catch (error) {
|
|
385
|
-
logger.console.error("[meshconnect] Failed to fetch integrations:", error)
|
|
386
|
-
return []
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
// Cache for integrations by environment
|
|
391
|
-
const integrationsCache: Record<string, Promise<MeshIntegration[]>> = {}
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* Get integration ID for a specific exchange type
|
|
395
|
-
* @param exchangeType - The exchange type (e.g., "coinbase", "binance")
|
|
396
|
-
* @param environment - The environment to use (sandbox or production)
|
|
397
|
-
* @returns The integration ID for the specified exchange, or undefined if not found
|
|
398
|
-
*/
|
|
399
|
-
export async function getMeshIntegrationId(
|
|
400
|
-
exchangeType: string,
|
|
401
|
-
environment: "sandbox" | "production" = "sandbox",
|
|
402
|
-
): Promise<string | undefined> {
|
|
403
|
-
try {
|
|
404
|
-
// Use cached integrations or fetch them
|
|
405
|
-
const cacheKey = environment
|
|
406
|
-
if (!integrationsCache[cacheKey]) {
|
|
407
|
-
integrationsCache[cacheKey] = getMeshIntegrations(environment)
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
const integrations = await integrationsCache[cacheKey]
|
|
411
|
-
const integration = integrations.find(
|
|
412
|
-
(integration) =>
|
|
413
|
-
integration.type.toLowerCase() === exchangeType.toLowerCase(),
|
|
414
|
-
)
|
|
415
|
-
return integration?.id
|
|
416
|
-
} catch (error) {
|
|
417
|
-
logger.console.error(
|
|
418
|
-
`[meshconnect] Failed to get integration ID for ${exchangeType}:`,
|
|
419
|
-
error,
|
|
420
|
-
)
|
|
421
|
-
return undefined
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* Get Coinbase integration ID
|
|
427
|
-
* @param environment - The environment to use (sandbox or production)
|
|
428
|
-
* @returns The Coinbase integration ID, or undefined if not found
|
|
429
|
-
*/
|
|
430
|
-
export async function getCoinbaseIntegrationId(
|
|
431
|
-
environment: "sandbox" | "production" = "sandbox",
|
|
432
|
-
): Promise<string | undefined> {
|
|
433
|
-
return getMeshIntegrationId("coinbase", environment)
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
/**
|
|
437
|
-
* Get Binance integration ID
|
|
438
|
-
* @param environment - The environment to use (sandbox or production)
|
|
439
|
-
* @returns The Binance integration ID, or undefined if not found
|
|
440
|
-
*/
|
|
441
|
-
export async function getBinanceIntegrationId(
|
|
442
|
-
environment: "sandbox" | "production" = "sandbox",
|
|
443
|
-
): Promise<string | undefined> {
|
|
444
|
-
return getMeshIntegrationId("binanceInternationalDirect", environment)
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* Get Bitfinex integration ID
|
|
449
|
-
* @param environment - The environment to use (sandbox or production)
|
|
450
|
-
* @returns The Bitfinex integration ID, or undefined if not found
|
|
451
|
-
*/
|
|
452
|
-
export async function getBitfinexIntegrationId(
|
|
453
|
-
environment: "sandbox" | "production" = "sandbox",
|
|
454
|
-
): Promise<string | undefined> {
|
|
455
|
-
return getMeshIntegrationId("bitfinexDirect", environment)
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* Common Integration IDs (based on Mesh Connect API)
|
|
460
|
-
*/
|
|
461
|
-
export const MESH_INTEGRATION_IDS = {
|
|
462
|
-
COINBASE: "9226e5c2-ebc3-4fdd-94f6-ed52cdce1420",
|
|
463
|
-
BINANCE: "34aeb688-decb-485f-9d80-b66466783394",
|
|
464
|
-
METAMASK: "45bfc688-decb-485f-9d80-b66466783395",
|
|
465
|
-
} as const
|
|
466
|
-
|
|
467
|
-
export interface MeshIntegration {
|
|
468
|
-
id: string
|
|
469
|
-
type: string
|
|
470
|
-
networks: Array<{
|
|
471
|
-
supportedDevices: string[]
|
|
472
|
-
supportedTokens: string[]
|
|
473
|
-
nativeSymbol: string
|
|
474
|
-
id: string
|
|
475
|
-
name: string
|
|
476
|
-
chainId: string
|
|
477
|
-
logoUrl: string
|
|
478
|
-
}>
|
|
479
|
-
supportsOutgoingTransfers: boolean
|
|
480
|
-
supportsIncomingTransfers: boolean
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
export interface IntegrationsResponse {
|
|
484
|
-
content: {
|
|
485
|
-
integrations: MeshIntegration[]
|
|
486
|
-
}
|
|
487
|
-
status: string
|
|
488
|
-
message: string
|
|
489
|
-
errorHash: string
|
|
490
|
-
errorType: string
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* Utility function to extract just the link token from the response
|
|
495
|
-
*/
|
|
496
|
-
export function extractLinkToken(response: LinkTokenResponse): string {
|
|
497
|
-
return response.content.linkToken
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
// Default export for convenience
|
|
501
|
-
export default {
|
|
502
|
-
createNewLinkToken,
|
|
503
|
-
createDefaultLinkToken,
|
|
504
|
-
createLinkToken,
|
|
505
|
-
checkApiHealth,
|
|
506
|
-
extractLinkToken,
|
|
507
|
-
getMeshIntegrations,
|
|
508
|
-
getMeshIntegrationId,
|
|
509
|
-
getCoinbaseIntegrationId,
|
|
510
|
-
getBinanceIntegrationId,
|
|
511
|
-
getBitfinexIntegrationId,
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
export function getMeshConnectClientId(): string {
|
|
515
|
-
return DEFAULT_CLIENT_ID
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
export function getMeshConnectEnvironment(): "sandbox" | "production" {
|
|
519
|
-
return DEFAULT_ENVIRONMENT
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
const networkIdMap: Record<string, string> = {
|
|
523
|
-
"1": "e3c7fdd8-b1fc-4e51-85ae-bb276e075611",
|
|
524
|
-
"137": "7436e9d0-ba42-4d2b-b4c0-8e4e606b2c12",
|
|
525
|
-
"42161": "2a9c1557-4f06-4f56-8e4e-8c4c8c4c8c4c",
|
|
526
|
-
"56": "3b8c1557-4f06-4f56-8e4e-8c4c8c4c8c4c",
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
export function getMeshConnectNetworkId(chainId: string): string {
|
|
530
|
-
return networkIdMap[chainId] || "e3c7fdd8-b1fc-4e51-85ae-bb276e075611"
|
|
531
|
-
}
|