router-widget-sdk 0.1.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 +180 -0
- package/dist/components/AggregateCallTypeSelector.d.ts +8 -0
- package/dist/components/AggregateCallTypeSelector.d.ts.map +1 -0
- package/dist/components/AppKitProvider.d.ts +5 -0
- package/dist/components/AppKitProvider.d.ts.map +1 -0
- package/dist/components/AppProviders.d.ts +29 -0
- package/dist/components/AppProviders.d.ts.map +1 -0
- package/dist/components/CapsuleControls.d.ts +16 -0
- package/dist/components/CapsuleControls.d.ts.map +1 -0
- package/dist/components/GetTokenPrice.d.ts +20 -0
- package/dist/components/GetTokenPrice.d.ts.map +1 -0
- package/dist/components/Image.d.ts +21 -0
- package/dist/components/Image.d.ts.map +1 -0
- package/dist/components/NodeMultiSelect.d.ts +10 -0
- package/dist/components/NodeMultiSelect.d.ts.map +1 -0
- package/dist/components/PosthogPageView.d.ts +2 -0
- package/dist/components/PosthogPageView.d.ts.map +1 -0
- package/dist/components/PosthogProvider.d.ts +4 -0
- package/dist/components/PosthogProvider.d.ts.map +1 -0
- package/dist/components/QuoteRefreshCountdown.d.ts +10 -0
- package/dist/components/QuoteRefreshCountdown.d.ts.map +1 -0
- package/dist/components/RecipientAddressEditor.d.ts +13 -0
- package/dist/components/RecipientAddressEditor.d.ts.map +1 -0
- package/dist/components/RouterWidget.d.ts +38 -0
- package/dist/components/RouterWidget.d.ts.map +1 -0
- package/dist/components/SlippageConfigurator.d.ts +14 -0
- package/dist/components/SlippageConfigurator.d.ts.map +1 -0
- package/dist/components/SwapInterface.d.ts +123 -0
- package/dist/components/SwapInterface.d.ts.map +1 -0
- package/dist/components/SwapReviewModal/SwapReviewModal.d.ts +29 -0
- package/dist/components/SwapReviewModal/SwapReviewModal.d.ts.map +1 -0
- package/dist/components/SwapReviewModal/TokenExchangeVisualization.d.ts +13 -0
- package/dist/components/SwapReviewModal/TokenExchangeVisualization.d.ts.map +1 -0
- package/dist/components/SwapReviewModal/TransactionDetailsDropdown.d.ts +14 -0
- package/dist/components/SwapReviewModal/TransactionDetailsDropdown.d.ts.map +1 -0
- package/dist/components/SwapReviewModal/TransactionExplorer.d.ts +17 -0
- package/dist/components/SwapReviewModal/TransactionExplorer.d.ts.map +1 -0
- package/dist/components/SwapReviewModal/TransactionStepProgress.d.ts +32 -0
- package/dist/components/SwapReviewModal/TransactionStepProgress.d.ts.map +1 -0
- package/dist/components/SwapReviewModal/index.d.ts +6 -0
- package/dist/components/SwapReviewModal/index.d.ts.map +1 -0
- package/dist/components/SwapSplit.d.ts +26 -0
- package/dist/components/SwapSplit.d.ts.map +1 -0
- package/dist/components/TokenSelector.d.ts +30 -0
- package/dist/components/TokenSelector.d.ts.map +1 -0
- package/dist/components/TokenSelectorV2/ChainPill.d.ts +8 -0
- package/dist/components/TokenSelectorV2/ChainPill.d.ts.map +1 -0
- package/dist/components/TokenSelectorV2/DesktopChainPanel.d.ts +9 -0
- package/dist/components/TokenSelectorV2/DesktopChainPanel.d.ts.map +1 -0
- package/dist/components/TokenSelectorV2/DesktopView.d.ts +22 -0
- package/dist/components/TokenSelectorV2/DesktopView.d.ts.map +1 -0
- package/dist/components/TokenSelectorV2/MobileChainView.d.ts +10 -0
- package/dist/components/TokenSelectorV2/MobileChainView.d.ts.map +1 -0
- package/dist/components/TokenSelectorV2/MobileTokenView.d.ts +20 -0
- package/dist/components/TokenSelectorV2/MobileTokenView.d.ts.map +1 -0
- package/dist/components/TokenSelectorV2/TokenList.d.ts +13 -0
- package/dist/components/TokenSelectorV2/TokenList.d.ts.map +1 -0
- package/dist/components/TokenSelectorV2/TokenPill.d.ts +9 -0
- package/dist/components/TokenSelectorV2/TokenPill.d.ts.map +1 -0
- package/dist/components/TokenSelectorV2/TokenPillGroup.d.ts +7 -0
- package/dist/components/TokenSelectorV2/TokenPillGroup.d.ts.map +1 -0
- package/dist/components/TokenSelectorV2/TriggerButton.d.ts +1 -0
- package/dist/components/TokenSelectorV2/TriggerButton.d.ts.map +1 -0
- package/dist/components/TokenSelectorV2/UserTokenList.d.ts +12 -0
- package/dist/components/TokenSelectorV2/UserTokenList.d.ts.map +1 -0
- package/dist/components/TokenSelectorV2/index.d.ts +15 -0
- package/dist/components/TokenSelectorV2/index.d.ts.map +1 -0
- package/dist/components/TurnkeyHdRejectionProvider.d.ts +16 -0
- package/dist/components/TurnkeyHdRejectionProvider.d.ts.map +1 -0
- package/dist/components/UnifiedWallet/ActivityTab.d.ts +2 -0
- package/dist/components/UnifiedWallet/ActivityTab.d.ts.map +1 -0
- package/dist/components/UnifiedWallet/ComicWalletIcon.d.ts +10 -0
- package/dist/components/UnifiedWallet/ComicWalletIcon.d.ts.map +1 -0
- package/dist/components/UnifiedWallet/ConnectWalletButton.d.ts +11 -0
- package/dist/components/UnifiedWallet/ConnectWalletButton.d.ts.map +1 -0
- package/dist/components/UnifiedWallet/SidebarHeader.d.ts +6 -0
- package/dist/components/UnifiedWallet/SidebarHeader.d.ts.map +1 -0
- package/dist/components/UnifiedWallet/TokenList.d.ts +21 -0
- package/dist/components/UnifiedWallet/TokenList.d.ts.map +1 -0
- package/dist/components/UnifiedWallet/WalletInfo.d.ts +12 -0
- package/dist/components/UnifiedWallet/WalletInfo.d.ts.map +1 -0
- package/dist/components/UnifiedWallet/WalletList.d.ts +12 -0
- package/dist/components/UnifiedWallet/WalletList.d.ts.map +1 -0
- package/dist/components/UnifiedWallet.d.ts +2 -0
- package/dist/components/UnifiedWallet.d.ts.map +1 -0
- package/dist/components/Web3Modal.d.ts +5 -0
- package/dist/components/Web3Modal.d.ts.map +1 -0
- package/dist/components/WidgetProvider.d.ts +29 -0
- package/dist/components/WidgetProvider.d.ts.map +1 -0
- package/dist/components/theme-provider.d.ts +3 -0
- package/dist/components/theme-provider.d.ts.map +1 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/chart.d.ts +63 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/command.d.ts +81 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/dialog.d.ts +20 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/drawer.d.ts +23 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/swap-review-skeleton.d.ts +2 -0
- package/dist/components/ui/swap-review-skeleton.d.ts.map +1 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/toast.d.ts +16 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toaster.d.ts +2 -0
- package/dist/components/ui/toaster.d.ts.map +1 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/contexts/AccountContext.d.ts +5 -0
- package/dist/contexts/AccountContext.d.ts.map +1 -0
- package/dist/contexts/WalletsContext.d.ts +20 -0
- package/dist/contexts/WalletsContext.d.ts.map +1 -0
- package/dist/contexts/WidgetConfigContext.d.ts +8 -0
- package/dist/contexts/WidgetConfigContext.d.ts.map +1 -0
- package/dist/hooks/tokens/list/example-usage.d.ts +1 -0
- package/dist/hooks/tokens/list/example-usage.d.ts.map +1 -0
- package/dist/hooks/tokens/list/index.d.ts +22 -0
- package/dist/hooks/tokens/list/index.d.ts.map +1 -0
- package/dist/hooks/tokens/list/relay.d.ts +17 -0
- package/dist/hooks/tokens/list/relay.d.ts.map +1 -0
- package/dist/hooks/use-toast.d.ts +45 -0
- package/dist/hooks/use-toast.d.ts.map +1 -0
- package/dist/hooks/useBalances.d.ts +116 -0
- package/dist/hooks/useBalances.d.ts.map +1 -0
- package/dist/hooks/useCampaigns.d.ts +34 -0
- package/dist/hooks/useCampaigns.d.ts.map +1 -0
- package/dist/hooks/useClipboard.d.ts +8 -0
- package/dist/hooks/useClipboard.d.ts.map +1 -0
- package/dist/hooks/useCurrencies.d.ts +34 -0
- package/dist/hooks/useCurrencies.d.ts.map +1 -0
- package/dist/hooks/useDynamicWallet.d.ts +18 -0
- package/dist/hooks/useDynamicWallet.d.ts.map +1 -0
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/dist/hooks/useMediaQuery.d.ts +7 -0
- package/dist/hooks/useMediaQuery.d.ts.map +1 -0
- package/dist/hooks/useNativeAmount.d.ts +9 -0
- package/dist/hooks/useNativeAmount.d.ts.map +1 -0
- package/dist/hooks/useNetworkConfig.d.ts +32 -0
- package/dist/hooks/useNetworkConfig.d.ts.map +1 -0
- package/dist/hooks/usePlaygroundConfig.d.ts +12 -0
- package/dist/hooks/usePlaygroundConfig.d.ts.map +1 -0
- package/dist/hooks/useSwapButtonState.d.ts +23 -0
- package/dist/hooks/useSwapButtonState.d.ts.map +1 -0
- package/dist/hooks/useSwapQuote.d.ts +27 -0
- package/dist/hooks/useSwapQuote.d.ts.map +1 -0
- package/dist/hooks/useSwapUrlManager.d.ts +16 -0
- package/dist/hooks/useSwapUrlManager.d.ts.map +1 -0
- package/dist/hooks/useTokenBalances.d.ts +15 -0
- package/dist/hooks/useTokenBalances.d.ts.map +1 -0
- package/dist/hooks/useTokenSearch.d.ts +8 -0
- package/dist/hooks/useTokenSearch.d.ts.map +1 -0
- package/dist/hooks/useTransactionAnalytics.d.ts +27 -0
- package/dist/hooks/useTransactionAnalytics.d.ts.map +1 -0
- package/dist/hooks/useTransactionHistory.d.ts +42 -0
- package/dist/hooks/useTransactionHistory.d.ts.map +1 -0
- package/dist/hooks/useTransactionPolling.d.ts +22 -0
- package/dist/hooks/useTransactionPolling.d.ts.map +1 -0
- package/dist/hooks/useTransactionState.d.ts +16 -0
- package/dist/hooks/useTransactionState.d.ts.map +1 -0
- package/dist/hooks/useWalletManagement.d.ts +14 -0
- package/dist/hooks/useWalletManagement.d.ts.map +1 -0
- package/dist/hooks/useWidgetConfigFromUrl.d.ts +27 -0
- package/dist/hooks/useWidgetConfigFromUrl.d.ts.map +1 -0
- package/dist/hooks/useWidgetTheme.d.ts +22 -0
- package/dist/hooks/useWidgetTheme.d.ts.map +1 -0
- package/dist/index.cjs.js +7122 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +268016 -0
- package/dist/lib/actions/bitcoin/balance.d.ts +4 -0
- package/dist/lib/actions/bitcoin/balance.d.ts.map +1 -0
- package/dist/lib/actions/bitcoin/bitcoinApiConfig.d.ts +12 -0
- package/dist/lib/actions/bitcoin/bitcoinApiConfig.d.ts.map +1 -0
- package/dist/lib/actions/getWalletBalanceUrl.d.ts +6 -0
- package/dist/lib/actions/getWalletBalanceUrl.d.ts.map +1 -0
- package/dist/lib/actions/handleBitcoinTransactions.d.ts +17 -0
- package/dist/lib/actions/handleBitcoinTransactions.d.ts.map +1 -0
- package/dist/lib/actions/handleEvmTransactions.d.ts +37 -0
- package/dist/lib/actions/handleEvmTransactions.d.ts.map +1 -0
- package/dist/lib/actions/handleSolanaTransactions.d.ts +13 -0
- package/dist/lib/actions/handleSolanaTransactions.d.ts.map +1 -0
- package/dist/lib/actions/handleSuiTransactions.d.ts +20 -0
- package/dist/lib/actions/handleSuiTransactions.d.ts.map +1 -0
- package/dist/lib/actions/submitSwapTransaction.d.ts +29 -0
- package/dist/lib/actions/submitSwapTransaction.d.ts.map +1 -0
- package/dist/lib/adapters/chain-adapters.d.ts +100 -0
- package/dist/lib/adapters/chain-adapters.d.ts.map +1 -0
- package/dist/lib/adapters/token-adapters.d.ts +83 -0
- package/dist/lib/adapters/token-adapters.d.ts.map +1 -0
- package/dist/lib/api.d.ts +67 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/chain-pills.d.ts +8 -0
- package/dist/lib/chain-pills.d.ts.map +1 -0
- package/dist/lib/domain/swap/payload.d.ts +26 -0
- package/dist/lib/domain/swap/payload.d.ts.map +1 -0
- package/dist/lib/errorApi.d.ts +13 -0
- package/dist/lib/errorApi.d.ts.map +1 -0
- package/dist/lib/grpc-client.d.ts +48 -0
- package/dist/lib/grpc-client.d.ts.map +1 -0
- package/dist/lib/requestManager.d.ts +15 -0
- package/dist/lib/requestManager.d.ts.map +1 -0
- package/dist/lib/tokens/list.d.ts +37 -0
- package/dist/lib/tokens/list.d.ts.map +1 -0
- package/dist/lib/types/api.d.ts +55 -0
- package/dist/lib/types/api.d.ts.map +1 -0
- package/dist/lib/types/bitcoin.d.ts +159 -0
- package/dist/lib/types/bitcoin.d.ts.map +1 -0
- package/dist/lib/types/proto.d.ts +75 -0
- package/dist/lib/types/proto.d.ts.map +1 -0
- package/dist/lib/types/widget.d.ts +48 -0
- package/dist/lib/types/widget.d.ts.map +1 -0
- package/dist/lib/utils/bigint-polyfill.d.ts +8 -0
- package/dist/lib/utils/bigint-polyfill.d.ts.map +1 -0
- package/dist/lib/utils/chain-helpers.d.ts +4 -0
- package/dist/lib/utils/chain-helpers.d.ts.map +1 -0
- package/dist/lib/utils/color-converter.d.ts +38 -0
- package/dist/lib/utils/color-converter.d.ts.map +1 -0
- package/dist/lib/utils/debounce.d.ts +4 -0
- package/dist/lib/utils/debounce.d.ts.map +1 -0
- package/dist/lib/utils/formatNumber.d.ts +31 -0
- package/dist/lib/utils/formatNumber.d.ts.map +1 -0
- package/dist/lib/utils/index.d.ts +4 -0
- package/dist/lib/utils/index.d.ts.map +1 -0
- package/dist/lib/utils/logger.d.ts +7 -0
- package/dist/lib/utils/logger.d.ts.map +1 -0
- package/dist/lib/utils/networkHelpers.d.ts +6 -0
- package/dist/lib/utils/networkHelpers.d.ts.map +1 -0
- package/dist/lib/utils/performance.d.ts +19 -0
- package/dist/lib/utils/performance.d.ts.map +1 -0
- package/dist/lib/utils/simulateTransaction.d.ts +29 -0
- package/dist/lib/utils/simulateTransaction.d.ts.map +1 -0
- package/dist/lib/utils/validateAddress.d.ts +7 -0
- package/dist/lib/utils/validateAddress.d.ts.map +1 -0
- package/dist/lib/utils/wallet-config.d.ts +4 -0
- package/dist/lib/utils/wallet-config.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +59 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/network/config.d.ts +530 -0
- package/dist/network/config.d.ts.map +1 -0
- package/dist/network/network.client.json.d.ts +18446 -0
- package/dist/styles.css +2 -0
- package/dist/types/Node.d.ts +22 -0
- package/dist/types/Node.d.ts.map +1 -0
- package/dist/types/chain.d.ts +158 -0
- package/dist/types/chain.d.ts.map +1 -0
- package/dist/types/chains.d.ts +7 -0
- package/dist/types/chains.d.ts.map +1 -0
- package/dist/types/index.d.ts +58 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/token.d.ts +134 -0
- package/dist/types/token.d.ts.map +1 -0
- package/package.json +125 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export type SolanaTxnData = {
|
|
2
|
+
solana_data: {
|
|
3
|
+
tx_messages: string[];
|
|
4
|
+
blockhash: string;
|
|
5
|
+
last_valid_block_height: string;
|
|
6
|
+
};
|
|
7
|
+
_solana_data: string;
|
|
8
|
+
};
|
|
9
|
+
export type EvmTxnData = {
|
|
10
|
+
evm_data: {
|
|
11
|
+
contract_address: `0x${string}`;
|
|
12
|
+
calldata: `0x${string}`;
|
|
13
|
+
value: string;
|
|
14
|
+
};
|
|
15
|
+
_evm_data: "evm_data";
|
|
16
|
+
};
|
|
17
|
+
export type BitcoinTxnData = {
|
|
18
|
+
bitcoin_data: {
|
|
19
|
+
from: string;
|
|
20
|
+
calldata: `0x${string}`;
|
|
21
|
+
};
|
|
22
|
+
_bitcoin_data: "bitcoin_data";
|
|
23
|
+
};
|
|
24
|
+
export type ApiResponse<T extends "sol" | "evm" | "btc" = "evm"> = {
|
|
25
|
+
routes: [
|
|
26
|
+
{
|
|
27
|
+
node_id: string;
|
|
28
|
+
input_token: {
|
|
29
|
+
chain_id: string;
|
|
30
|
+
address: string;
|
|
31
|
+
decimals: number;
|
|
32
|
+
_is_native: string;
|
|
33
|
+
};
|
|
34
|
+
output_token: {
|
|
35
|
+
chain_id: string;
|
|
36
|
+
address: string;
|
|
37
|
+
decimals: number;
|
|
38
|
+
_is_native: string;
|
|
39
|
+
};
|
|
40
|
+
amount_in: string;
|
|
41
|
+
amount_out: string;
|
|
42
|
+
transaction_data: T extends "sol" ? SolanaTxnData : T extends "btc" ? BitcoinTxnData : EvmTxnData;
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
amount_in: string;
|
|
46
|
+
amount_in_with_fee: string;
|
|
47
|
+
amount_out: string;
|
|
48
|
+
price_impact: number;
|
|
49
|
+
execution_time: number;
|
|
50
|
+
gas_estimate: string;
|
|
51
|
+
deposit_address: string;
|
|
52
|
+
value: string;
|
|
53
|
+
transaction_data: T extends "sol" ? SolanaTxnData : T extends "btc" ? BitcoinTxnData : EvmTxnData;
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/lib/types/api.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE;QACX,WAAW,EAAE,MAAM,EAAE,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,uBAAuB,EAAE,MAAM,CAAC;KACjC,CAAC;IACF,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,EAAE;QACR,gBAAgB,EAAE,KAAK,MAAM,EAAE,CAAC;QAChC,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;QACxB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;KACzB,CAAC;IACF,aAAa,EAAE,cAAc,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,IAAI;IACjE,MAAM,EAAE;QACN;YACE,OAAO,EAAE,MAAM,CAAC;YAChB,WAAW,EAAE;gBACX,QAAQ,EAAE,MAAM,CAAC;gBACjB,OAAO,EAAE,MAAM,CAAC;gBAChB,QAAQ,EAAE,MAAM,CAAC;gBACjB,UAAU,EAAE,MAAM,CAAC;aACpB,CAAC;YACF,YAAY,EAAE;gBACZ,QAAQ,EAAE,MAAM,CAAC;gBACjB,OAAO,EAAE,MAAM,CAAC;gBAChB,QAAQ,EAAE,MAAM,CAAC;gBACjB,UAAU,EAAE,MAAM,CAAC;aACpB,CAAC;YACF,SAAS,EAAE,MAAM,CAAC;YAClB,UAAU,EAAE,MAAM,CAAC;YACnB,gBAAgB,EAAE,CAAC,SAAS,KAAK,GAAG,aAAa,GAAG,CAAC,SAAS,KAAK,GAAG,cAAc,GAAG,UAAU,CAAC;SACnG;KACF,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,CAAC,SAAS,KAAK,GAAG,aAAa,GAAG,CAAC,SAAS,KAAK,GAAG,cAAc,GAAG,UAAU,CAAC;CACnG,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
export type MempoolSpaceBitcoinGasFeeResponse = {
|
|
2
|
+
fastestFee: number;
|
|
3
|
+
halfHourFee: number;
|
|
4
|
+
hourFee: number;
|
|
5
|
+
economyFee: number;
|
|
6
|
+
minimumFee: number;
|
|
7
|
+
};
|
|
8
|
+
export type BitcoinTransactionStatus = {
|
|
9
|
+
confirmed: boolean;
|
|
10
|
+
block_height: number | null;
|
|
11
|
+
block_hash: string | null;
|
|
12
|
+
block_time: number | null;
|
|
13
|
+
};
|
|
14
|
+
export type BitcoinTransferRequest = {
|
|
15
|
+
feeRate: number;
|
|
16
|
+
from: string;
|
|
17
|
+
recipient: string;
|
|
18
|
+
amount: {
|
|
19
|
+
amount: string;
|
|
20
|
+
decimals: number;
|
|
21
|
+
};
|
|
22
|
+
memo: string;
|
|
23
|
+
};
|
|
24
|
+
export interface BtcScanBalanceResponse {
|
|
25
|
+
address: string;
|
|
26
|
+
chain_stats: {
|
|
27
|
+
funded_txo_count: number;
|
|
28
|
+
funded_txo_sum: number;
|
|
29
|
+
spent_txo_count: number;
|
|
30
|
+
spent_txo_sum: number;
|
|
31
|
+
tx_count: number;
|
|
32
|
+
};
|
|
33
|
+
mempool_stats: {
|
|
34
|
+
funded_txo_count: number;
|
|
35
|
+
funded_txo_sum: number;
|
|
36
|
+
spent_txo_count: number;
|
|
37
|
+
spent_txo_sum: number;
|
|
38
|
+
tx_count: number;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface BlockchainInfoBalanceResponse {
|
|
42
|
+
address: string;
|
|
43
|
+
confirmed: number;
|
|
44
|
+
unconfirmed: number;
|
|
45
|
+
utxo: number;
|
|
46
|
+
txs: number;
|
|
47
|
+
received: number;
|
|
48
|
+
}
|
|
49
|
+
export interface BlockcypherBalanceResponse {
|
|
50
|
+
address: string;
|
|
51
|
+
total_received: number;
|
|
52
|
+
total_sent: number;
|
|
53
|
+
balance: number;
|
|
54
|
+
unconfirmed_balance: number;
|
|
55
|
+
final_balance: number;
|
|
56
|
+
n_tx: number;
|
|
57
|
+
unconfirmed_n_tx: number;
|
|
58
|
+
final_n_tx: number;
|
|
59
|
+
}
|
|
60
|
+
export type BalanceApiResponse = {
|
|
61
|
+
source: "btcscan";
|
|
62
|
+
data: BtcScanBalanceResponse;
|
|
63
|
+
} | {
|
|
64
|
+
source: "blockchain.info";
|
|
65
|
+
data: BlockchainInfoBalanceResponse;
|
|
66
|
+
} | {
|
|
67
|
+
source: "blockcypher";
|
|
68
|
+
data: BlockcypherBalanceResponse;
|
|
69
|
+
};
|
|
70
|
+
export type ApiResponse<T> = {
|
|
71
|
+
source: ApiConfig["name"];
|
|
72
|
+
data: T;
|
|
73
|
+
};
|
|
74
|
+
export interface ApiConfig {
|
|
75
|
+
name: "btcscan" | "blockchain.info" | "blockcypher";
|
|
76
|
+
url: {
|
|
77
|
+
balance: (address: string) => string;
|
|
78
|
+
transaction: (txHash: string) => string;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export type BtcScanTransactionResponse = {
|
|
82
|
+
confirmed: boolean;
|
|
83
|
+
block_height: number;
|
|
84
|
+
block_hash: string;
|
|
85
|
+
block_time: number;
|
|
86
|
+
};
|
|
87
|
+
export type BlockcypherTransactionResponse = {
|
|
88
|
+
block_hash: string;
|
|
89
|
+
block_height: number;
|
|
90
|
+
block_index: number;
|
|
91
|
+
hash: string;
|
|
92
|
+
addresses: string[];
|
|
93
|
+
total: number;
|
|
94
|
+
fees: number;
|
|
95
|
+
size: number;
|
|
96
|
+
vsize: number;
|
|
97
|
+
preference: string;
|
|
98
|
+
relayed_by: string;
|
|
99
|
+
confirmed: string;
|
|
100
|
+
received: string;
|
|
101
|
+
ver: number;
|
|
102
|
+
double_spend: boolean;
|
|
103
|
+
vin_sz: number;
|
|
104
|
+
vout_sz: number;
|
|
105
|
+
data_protocol: string;
|
|
106
|
+
confirmations: number;
|
|
107
|
+
confidence: number;
|
|
108
|
+
inputs: Array<{
|
|
109
|
+
prev_hash: string;
|
|
110
|
+
output_index: number;
|
|
111
|
+
output_value: number;
|
|
112
|
+
sequence: number;
|
|
113
|
+
addresses: string[];
|
|
114
|
+
script_type: string;
|
|
115
|
+
age: number;
|
|
116
|
+
witness: string[];
|
|
117
|
+
}>;
|
|
118
|
+
outputs: Array<{
|
|
119
|
+
value: number;
|
|
120
|
+
script: string;
|
|
121
|
+
addresses: string[] | null;
|
|
122
|
+
script_type: string;
|
|
123
|
+
data_hex?: string;
|
|
124
|
+
}>;
|
|
125
|
+
};
|
|
126
|
+
export type BlockchainInfoTransactionResponse = {
|
|
127
|
+
txid: string;
|
|
128
|
+
size: number;
|
|
129
|
+
version: number;
|
|
130
|
+
locktime: number;
|
|
131
|
+
fee: number;
|
|
132
|
+
inputs: Array<{
|
|
133
|
+
coinbase: boolean;
|
|
134
|
+
txid: string;
|
|
135
|
+
output: number;
|
|
136
|
+
sigscript: string;
|
|
137
|
+
sequence: number;
|
|
138
|
+
pkscript: string;
|
|
139
|
+
value: number;
|
|
140
|
+
address: string;
|
|
141
|
+
witness: string[];
|
|
142
|
+
}>;
|
|
143
|
+
outputs: Array<{
|
|
144
|
+
address: string | null;
|
|
145
|
+
pkscript: string;
|
|
146
|
+
value: number;
|
|
147
|
+
spent: boolean;
|
|
148
|
+
spender: string | null;
|
|
149
|
+
}>;
|
|
150
|
+
block: {
|
|
151
|
+
height: number;
|
|
152
|
+
position: number;
|
|
153
|
+
};
|
|
154
|
+
deleted: boolean;
|
|
155
|
+
time: number;
|
|
156
|
+
rbf: boolean;
|
|
157
|
+
weight: number;
|
|
158
|
+
};
|
|
159
|
+
//# sourceMappingURL=bitcoin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitcoin.d.ts","sourceRoot":"","sources":["../../../src/lib/types/bitcoin.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iCAAiC,GAAG;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;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B,CAAC,CAAC;IACH,KAAK,EAAE;QACL,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export interface ChainToken {
|
|
2
|
+
chain_id: string;
|
|
3
|
+
address: string;
|
|
4
|
+
decimals: number;
|
|
5
|
+
}
|
|
6
|
+
export interface SwapRequest {
|
|
7
|
+
input_token: ChainToken;
|
|
8
|
+
output_token: ChainToken;
|
|
9
|
+
amount_in: string;
|
|
10
|
+
amount_out_min: string;
|
|
11
|
+
slippage_tolerance: number;
|
|
12
|
+
recipient_address: string;
|
|
13
|
+
exact_out: boolean;
|
|
14
|
+
timeout_ms: number;
|
|
15
|
+
generate_deposit_address: boolean;
|
|
16
|
+
sender_address: string;
|
|
17
|
+
selectedNodes: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface SwapResponse {
|
|
20
|
+
uuid: string;
|
|
21
|
+
amount_out: string;
|
|
22
|
+
output_token: ChainToken;
|
|
23
|
+
path_steps: Step[];
|
|
24
|
+
contract_address: string;
|
|
25
|
+
calldata: string;
|
|
26
|
+
deposit_address: string;
|
|
27
|
+
value: string;
|
|
28
|
+
route: Route[];
|
|
29
|
+
expires_at: number;
|
|
30
|
+
}
|
|
31
|
+
export interface Step {
|
|
32
|
+
input_token: ChainToken;
|
|
33
|
+
amount_in: string;
|
|
34
|
+
protocol_name: string;
|
|
35
|
+
output_token: ChainToken;
|
|
36
|
+
amount_out: string;
|
|
37
|
+
protocol_display_name: string;
|
|
38
|
+
protocol_logo_url: string;
|
|
39
|
+
protocol_type: string;
|
|
40
|
+
}
|
|
41
|
+
export interface Route {
|
|
42
|
+
input_token: Token;
|
|
43
|
+
output_token: Token;
|
|
44
|
+
amount_in: string;
|
|
45
|
+
amount_out: string;
|
|
46
|
+
protocol_name: string;
|
|
47
|
+
protocol_display_name: string;
|
|
48
|
+
protocol_logo_url: string;
|
|
49
|
+
protocol_type: string;
|
|
50
|
+
}
|
|
51
|
+
export interface Token {
|
|
52
|
+
chain_id: string;
|
|
53
|
+
address: string;
|
|
54
|
+
symbol: string;
|
|
55
|
+
name: string;
|
|
56
|
+
decimals: number;
|
|
57
|
+
logo_url: string;
|
|
58
|
+
price_usd: string;
|
|
59
|
+
}
|
|
60
|
+
export interface QuoteRequest {
|
|
61
|
+
input_token: ChainToken;
|
|
62
|
+
output_token: ChainToken;
|
|
63
|
+
amount_in: string;
|
|
64
|
+
slippage_tolerance: number;
|
|
65
|
+
recipient_address: string;
|
|
66
|
+
exact_out: boolean;
|
|
67
|
+
allowed_nodes: string[];
|
|
68
|
+
}
|
|
69
|
+
export interface QuoteResponse {
|
|
70
|
+
amount_out: string;
|
|
71
|
+
output_token: ChainToken;
|
|
72
|
+
path_steps: Step[];
|
|
73
|
+
route: Route[];
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=proto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proto.d.ts","sourceRoot":"","sources":["../../../src/lib/types/proto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,UAAU,CAAC;IACxB,YAAY,EAAE,UAAU,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,wBAAwB,EAAE,OAAO,CAAC;I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IAC3B,WAAW,EAAE,UAAU,CAAC;IACxB,YAAY,EAAE,UAAU,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,UAAU,CAAC;IACzB,UAAU,EAAE,IAAI,EAAE,CAAC;IACnB,KAAK,EAAE,KAAK,EAAE,CAAC;CAChB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Widget Configuration Types
|
|
3
|
+
* Defines the configuration interface for the Router Protocol widget
|
|
4
|
+
*/
|
|
5
|
+
export interface WidgetTheme {
|
|
6
|
+
mode?: "light" | "dark" | "auto";
|
|
7
|
+
primaryColor?: string;
|
|
8
|
+
backgroundColor?: string;
|
|
9
|
+
textColorPrimary?: string;
|
|
10
|
+
textColorSecondary?: string;
|
|
11
|
+
mutedColor?: string;
|
|
12
|
+
cardBorderRadius?: string;
|
|
13
|
+
buttonBorderRadius?: string;
|
|
14
|
+
fontFamily?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface WidgetConfig {
|
|
17
|
+
/**
|
|
18
|
+
* Theme configuration
|
|
19
|
+
*/
|
|
20
|
+
theme?: WidgetTheme;
|
|
21
|
+
/**
|
|
22
|
+
* Initial swap state configuration
|
|
23
|
+
*/
|
|
24
|
+
initialState?: {
|
|
25
|
+
fromChainId?: string;
|
|
26
|
+
fromTokenAddress?: string;
|
|
27
|
+
toChainId?: string;
|
|
28
|
+
toTokenAddress?: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Integrator/origin identifier for analytics
|
|
32
|
+
*/
|
|
33
|
+
integrator?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Feature flags
|
|
36
|
+
*/
|
|
37
|
+
features?: {
|
|
38
|
+
showHeader?: boolean;
|
|
39
|
+
isSrcDisabled?: boolean;
|
|
40
|
+
isDestDisabled?: boolean;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Selected nodes/bridges for routing
|
|
44
|
+
*/
|
|
45
|
+
selectedNodes?: string[];
|
|
46
|
+
isWidget?: boolean;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=widget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../src/lib/types/widget.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IAEF;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B,CAAC;IAEF;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file provides a polyfill for bigint operations and silences
|
|
3
|
+
* the "Failed to load bindings" warnings in browser environments.
|
|
4
|
+
*
|
|
5
|
+
* Original warning: "bigint: Failed to load bindings, pure JS will be used"
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=bigint-polyfill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bigint-polyfill.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/bigint-polyfill.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoBH,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain-helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/chain-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAE5C,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,GAAG,GAAG,KAAK,CAyCvD;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,GAAE,MAAW,GAAG,KAAK,CAyE7E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color conversion utilities for Tailwind CSS v4 theme system
|
|
3
|
+
* Tailwind v4 uses HSL format without hsl() wrapper: "327 64% 44%"
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Converts a hex color to HSL format (space-separated, no hsl() wrapper)
|
|
7
|
+
* Compatible with Tailwind CSS v4 theme system
|
|
8
|
+
*
|
|
9
|
+
* @param hex - Hex color string (e.g., "#e4357a" or "e4357a")
|
|
10
|
+
* @returns HSL string in format "H S% L%" (e.g., "327 64% 44%")
|
|
11
|
+
*/
|
|
12
|
+
export declare function hexToHSL(hex: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Converts RGB color to HSL format (space-separated)
|
|
15
|
+
*
|
|
16
|
+
* @param r - Red value (0-255)
|
|
17
|
+
* @param g - Green value (0-255)
|
|
18
|
+
* @param b - Blue value (0-255)
|
|
19
|
+
* @returns HSL string in format "H S% L%"
|
|
20
|
+
*/
|
|
21
|
+
export declare function rgbToHSL(r: number, g: number, b: number): string;
|
|
22
|
+
/**
|
|
23
|
+
* Calculates appropriate foreground color (black or white) based on background brightness
|
|
24
|
+
*
|
|
25
|
+
* @param hex - Hex color string
|
|
26
|
+
* @returns HSL string for white or black foreground
|
|
27
|
+
*/
|
|
28
|
+
export declare function getContrastForeground(hex: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Validates if a string is a valid hex color
|
|
31
|
+
* Accepts both #RRGGBB and RRGGBB formats
|
|
32
|
+
*/
|
|
33
|
+
export declare function isValidHexColor(hex: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Normalizes hex color to always include # prefix
|
|
36
|
+
*/
|
|
37
|
+
export declare function normalizeHexColor(hex: string): string;
|
|
38
|
+
//# sourceMappingURL=color-converter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-converter.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/color-converter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAsC5C;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAiChE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAWzD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAKpD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/debounce.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,KAAK,SAAS,OAAO,EAAE,EAAE,OAAO,EACvD,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,EAC/B,EAAE,EAAE,MAAM,GACT,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAiBrD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Number formatting utilities using native Intl.NumberFormat
|
|
3
|
+
* Replaces numeral.js dependency for bundle size optimization
|
|
4
|
+
*/
|
|
5
|
+
export interface FormatOptions {
|
|
6
|
+
minimumFractionDigits?: number;
|
|
7
|
+
maximumFractionDigits?: number;
|
|
8
|
+
notation?: "standard" | "scientific" | "engineering" | "compact";
|
|
9
|
+
compactDisplay?: "short" | "long";
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Format a number as currency
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatCurrency(value: number | string, currency?: string, locale?: string, options?: FormatOptions): string;
|
|
15
|
+
/**
|
|
16
|
+
* Format a number as percentage
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatPercent(value: number | string, locale?: string, options?: FormatOptions): string;
|
|
19
|
+
/**
|
|
20
|
+
* Format a number with optional compact notation
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatNumber(value: number | string, locale?: string, options?: FormatOptions): string;
|
|
23
|
+
/**
|
|
24
|
+
* Format large numbers with compact notation (e.g., 1.2K, 1.5M)
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatCompactNumber(value: number | string, locale?: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Format crypto amounts with appropriate precision
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatCryptoAmount(value: number | string, symbol?: string, locale?: string): string;
|
|
31
|
+
//# sourceMappingURL=formatNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatNumber.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/formatNumber.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,WAAW,aAAa;IAC5B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,aAAa,GAAG,SAAS,CAAC;IACjE,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,QAAQ,GAAE,MAAc,EACxB,MAAM,GAAE,MAAgB,EACxB,OAAO,CAAC,EAAE,aAAa,GACtB,MAAM,CAUR;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,GAAE,MAAgB,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAS/G;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,GAAE,MAAgB,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAS9G;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,GAAE,MAAgB,GAAG,MAAM,CAM5F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,GAAE,MAAgB,GAAG,MAAM,CAW5G"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY,GAAI,UAAU,MAAM,WAKrC,CAAC;AAEF,QAAA,MAAM,aAAa,GAAI,UAAU,MAAM,EAAE,OAAK,CAAC,MAAM,GAAC,MAAM,CAAC,EAAO,WAInE,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/logger.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;mBACF,OAAO,EAAE;qBAKP,OAAO,EAAE;oBAKV,OAAO,EAAE;oBAKT,OAAO,EAAE;CAK1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networkHelpers.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/networkHelpers.ts"],"names":[],"mappings":"AAIA,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM;;;;GA8BtD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Performance monitoring utility for React components
|
|
4
|
+
* Logs render performance in development mode
|
|
5
|
+
*/
|
|
6
|
+
export declare function useRenderPerformance(componentName: string, enabled?: boolean): void;
|
|
7
|
+
/**
|
|
8
|
+
* Hook to measure expensive computations
|
|
9
|
+
*/
|
|
10
|
+
export declare function useMeasure<T>(fn: () => T, label: string): T;
|
|
11
|
+
/**
|
|
12
|
+
* Performance boundary component to wrap expensive components
|
|
13
|
+
*/
|
|
14
|
+
export declare function PerformanceBoundary({ children, name, enabled }: {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
name: string;
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=performance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/performance.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAEhD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,UAAyC,QAyB3G;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CAU3D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,IAAI,EACJ,OAAgD,EACjD,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,2CAGA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PublicClient, Chain } from "viem";
|
|
2
|
+
import { Connection } from "@solana/web3.js";
|
|
3
|
+
import type { Token } from "@/types";
|
|
4
|
+
export interface SimulationResult {
|
|
5
|
+
success: boolean;
|
|
6
|
+
gasEstimate?: string;
|
|
7
|
+
error?: string;
|
|
8
|
+
details?: {
|
|
9
|
+
gasUsed?: string;
|
|
10
|
+
gasPrice?: string;
|
|
11
|
+
totalCost?: string;
|
|
12
|
+
executionTime?: number;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface SimulationParams {
|
|
16
|
+
chainType: "evm" | "solana" | "bitcoin";
|
|
17
|
+
fromChain: Chain;
|
|
18
|
+
toChain: Chain;
|
|
19
|
+
fromToken: Token;
|
|
20
|
+
toToken: Token;
|
|
21
|
+
amount: string;
|
|
22
|
+
recipientAddress: string;
|
|
23
|
+
slippageTolerance: number;
|
|
24
|
+
route: any;
|
|
25
|
+
}
|
|
26
|
+
export declare function SimulateEvmTransaction(publicClient: PublicClient, params: SimulationParams): Promise<SimulationResult>;
|
|
27
|
+
export declare function simulateTransaction(params: SimulationParams, publicClient?: PublicClient, solanaConnection?: Connection): Promise<SimulationResult>;
|
|
28
|
+
export declare function getChainType(chain: Chain): "evm" | "solana" | "bitcoin";
|
|
29
|
+
//# sourceMappingURL=simulateTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulateTransaction.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/simulateTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAgB,KAAK,EAAE,MAAM,MAAM,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;IACxC,SAAS,EAAE,KAAK,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;IACf,SAAS,EAAE,KAAK,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,GAAG,CAAC;CACZ;AAGD,wBAAsB,sBAAsB,CAC1C,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,gBAAgB,CAAC,CAmD3B;AAoDD,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,gBAAgB,EACxB,YAAY,CAAC,EAAE,YAAY,EAC3B,gBAAgB,CAAC,EAAE,UAAU,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAqC3B;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAUvE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ChainType } from "@/types/chains";
|
|
2
|
+
/**
|
|
3
|
+
* Validates token addresses (EVM format or 'native')
|
|
4
|
+
*/
|
|
5
|
+
export declare function isValidTokenAddress(address: string): boolean;
|
|
6
|
+
export default function validateAddress(address: string, chainType: ChainType | string): boolean;
|
|
7
|
+
//# sourceMappingURL=validateAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateAddress.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/validateAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAQ3C;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,MAAM,WAkCrF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet-config.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/wallet-config.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEvD,wBAAgB,iBAAiB,IAAI,UAAU,EAAE,CAKhD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAE3D"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type ClassValue } from "clsx";
|
|
2
|
+
import { TokenBalance } from "@/types";
|
|
3
|
+
import { ApiConfig as BitcoinApiConfig, ApiResponse as BitcoinApiResponse } from "@/lib/types/bitcoin";
|
|
4
|
+
import { Wallet } from "@dynamic-labs/sdk-react-core";
|
|
5
|
+
export declare const EVM_NATIVE_TOKEN_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
6
|
+
export declare const SUI_NATIVE_TOKEN_ADDRESS = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
7
|
+
export declare const BTC_NATIVE_TOKEN_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
8
|
+
export declare const SOL_NATIVE_TOKEN_ADDRESS = "11111111111111111111111111111111";
|
|
9
|
+
export declare function getTimeDiffInSeconds(epoch: number): {
|
|
10
|
+
diff: number;
|
|
11
|
+
formatted: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function formatSecondsToHumanReadable(seconds: number): string;
|
|
14
|
+
export declare const isNative: (address: string, type: string) => boolean;
|
|
15
|
+
export declare const getNativeTokenAddress: (type: string) => "0x0000000000000000000000000000000000000000" | "11111111111111111111111111111111" | "" | "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
16
|
+
export declare const SUI_ADDRESS_LENGTH = 32;
|
|
17
|
+
export declare function isValidSuiAddress(value: string): value is string;
|
|
18
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
19
|
+
export declare function shortenAddress(address: string | undefined, length?: number): string;
|
|
20
|
+
/**
|
|
21
|
+
* Fetches data from a given URL using the specified API name.
|
|
22
|
+
* @param name - The name of the Bitcoin API.
|
|
23
|
+
* @param url - The URL to fetch data from.
|
|
24
|
+
* @returns A promise that resolves to a BitcoinApiResponse containing the fetched data.
|
|
25
|
+
*/
|
|
26
|
+
export declare const tryAPI: <T>(name: BitcoinApiConfig["name"], url: string) => Promise<BitcoinApiResponse<T>>;
|
|
27
|
+
export declare function parseUnits(value: string, decimals: number): bigint;
|
|
28
|
+
export declare function formatUnits(value: bigint, decimals: number): string;
|
|
29
|
+
export declare const formatNumberWithSubscript: (numStr: string) => string;
|
|
30
|
+
export declare function calculateEpochTimeDiffInSeconds(epoch1: number, epoch2: number): number;
|
|
31
|
+
export declare function isBase58(str: string): boolean;
|
|
32
|
+
export declare function validateAddress(address: string, type: string): boolean;
|
|
33
|
+
export declare function validateAnyAddress(address: string): boolean;
|
|
34
|
+
export declare function formatAddress(address: string): string;
|
|
35
|
+
export declare function isString(value: unknown): boolean;
|
|
36
|
+
export declare function truncateAddress(address: string | null | undefined, chars?: number): string;
|
|
37
|
+
/**
|
|
38
|
+
* Converts all camelCase keys in an object to snake_case recursively
|
|
39
|
+
*
|
|
40
|
+
* @param obj - The object with camelCase keys to convert
|
|
41
|
+
* @returns A new object with all keys converted to snake_case
|
|
42
|
+
*/
|
|
43
|
+
export declare function camelToSnakeCase(obj: any): any;
|
|
44
|
+
export declare function sumTokenBalances(tokenBalances: Record<string, TokenBalance>): number;
|
|
45
|
+
export declare const formatRelativeTime: (dateString: string) => string;
|
|
46
|
+
export declare function getWalletAddress(wallet: Wallet): string;
|
|
47
|
+
/**
|
|
48
|
+
* Check if a wallet is a TurnkeyHD wallet
|
|
49
|
+
* @param wallet - The wallet to check
|
|
50
|
+
* @returns true if the wallet is a TurnkeyHD wallet, false otherwise
|
|
51
|
+
*/
|
|
52
|
+
export declare function isTurnkeyHdWallet(wallet: Wallet | null | undefined): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Filter out TurnkeyHD wallets from a list of wallets
|
|
55
|
+
* @param wallets - Array of wallets to filter
|
|
56
|
+
* @returns Array of wallets excluding TurnkeyHD wallets
|
|
57
|
+
*/
|
|
58
|
+
export declare function filterOutTurnkeyHdWallets(wallets: Wallet[]): Wallet[];
|
|
59
|
+
//# sourceMappingURL=utils.d.ts.map
|