@skip-go/widget 0.0.1-alpha.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.
Files changed (123) hide show
  1. package/README.md +89 -0
  2. package/build/ast/_constants.d.ts +1 -0
  3. package/build/ast/_types.d.ts +14 -0
  4. package/build/ast/get-chains-paths.d.ts +6 -0
  5. package/build/ast/parse-asset-list-json.d.ts +7 -0
  6. package/build/ast/parse-chain-json.d.ts +7 -0
  7. package/build/ast/parse-chain-paths.d.ts +9 -0
  8. package/build/ast/validate-chains-paths.d.ts +6 -0
  9. package/build/ast/write-entrypoints.d.ts +7 -0
  10. package/build/chains/assets.d.ts +3 -0
  11. package/build/chains/chain-infos.d.ts +3 -0
  12. package/build/chains/chains.d.ts +3 -0
  13. package/build/chains/explorers.d.ts +3 -0
  14. package/build/chains/index.d.ts +7 -0
  15. package/build/chains/pretty.d.ts +2 -0
  16. package/build/chains/types.d.ts +6 -0
  17. package/build/constants/abis.d.ts +2 -0
  18. package/build/constants/defaults.d.ts +5 -0
  19. package/build/constants/finality.d.ts +2 -0
  20. package/build/constants/gas.d.ts +3 -0
  21. package/build/constants/ledger-warning.d.ts +2 -0
  22. package/build/constants/wagmi.d.ts +2 -0
  23. package/build/hooks/use-account.d.ts +46 -0
  24. package/build/hooks/use-assets.d.ts +4 -0
  25. package/build/hooks/use-auto-set-address.d.ts +11 -0
  26. package/build/hooks/use-balances-by-chain.d.ts +15 -0
  27. package/build/hooks/use-bridges.d.ts +7 -0
  28. package/build/hooks/use-broadcasted-txs.d.ts +24 -0
  29. package/build/hooks/use-chains.d.ts +10 -0
  30. package/build/hooks/use-finality-time-estimate.d.ts +2 -0
  31. package/build/hooks/use-make-wallets.d.ts +21 -0
  32. package/build/hooks/use-route.d.ts +19 -0
  33. package/build/hooks/use-skip-client.d.ts +11 -0
  34. package/build/hooks/use-swap-widget.d.ts +81 -0
  35. package/build/hooks/use-usd-value.d.ts +8 -0
  36. package/build/index.d.ts +3 -0
  37. package/build/index.es.js +4877 -0
  38. package/build/index.es.js.map +1 -0
  39. package/build/lib/cosmos-kit.d.ts +3 -0
  40. package/build/lib/react-query.d.ts +2 -0
  41. package/build/lib/solana-adapter.d.ts +2 -0
  42. package/build/lib/viem/chains.d.ts +66 -0
  43. package/build/lib/wagmi.d.ts +8922 -0
  44. package/build/provider/assets.d.ts +16 -0
  45. package/build/provider/index.d.ts +25 -0
  46. package/build/provider/skip-provider.d.ts +13 -0
  47. package/build/provider/wallet/cosmos.d.ts +6 -0
  48. package/build/provider/wallet/evm.d.ts +6 -0
  49. package/build/provider/wallet/solana.d.ts +6 -0
  50. package/build/scripts/codegen.d.ts +1 -0
  51. package/build/store/disclosures.d.ts +44 -0
  52. package/build/store/settings.d.ts +17 -0
  53. package/build/store/swap-widget.d.ts +14 -0
  54. package/build/store/track-wallet.d.ts +24 -0
  55. package/build/store/tx-history.d.ts +36 -0
  56. package/build/ui/AdaptiveLink.d.ts +5 -0
  57. package/build/ui/AssetInput.d.ts +20 -0
  58. package/build/ui/AssetSelect/AssetSelectContent.d.ts +11 -0
  59. package/build/ui/AssetSelect/index.d.ts +11 -0
  60. package/build/ui/AssetValue.d.ts +7 -0
  61. package/build/ui/Button/HistoryButton.d.ts +2 -0
  62. package/build/ui/Button/SettingsButton.d.ts +2 -0
  63. package/build/ui/Button/ShareButton.d.ts +3 -0
  64. package/build/ui/ChainSelect/ChainSelectContent.d.ts +8 -0
  65. package/build/ui/ChainSelect/ChainSelectTrigger.d.ts +7 -0
  66. package/build/ui/ChainSelect/index.d.ts +9 -0
  67. package/build/ui/ChainSymbol.d.ts +5 -0
  68. package/build/ui/ConnectedWalletButton.d.ts +8 -0
  69. package/build/ui/ConversionRate.d.ts +22 -0
  70. package/build/ui/Dialog/Dialog.d.ts +7 -0
  71. package/build/ui/Dialog/DialogContent.d.ts +7 -0
  72. package/build/ui/Dialog/DialogTrigger.d.ts +5 -0
  73. package/build/ui/Dialog/context.d.ts +7 -0
  74. package/build/ui/HistoryDialog/DescriptionList.d.ts +5 -0
  75. package/build/ui/HistoryDialog/HistoryClearButton.d.ts +4 -0
  76. package/build/ui/HistoryDialog/HistoryList.d.ts +14 -0
  77. package/build/ui/HistoryDialog/RenderDate.d.ts +5 -0
  78. package/build/ui/HistoryDialog/SyncState.d.ts +4 -0
  79. package/build/ui/HistoryDialog/index.d.ts +1 -0
  80. package/build/ui/Icon/ExpandArrow.d.ts +2 -0
  81. package/build/ui/Icon/HistoryIcon.d.ts +2 -0
  82. package/build/ui/Icon/SkipLogo.d.ts +2 -0
  83. package/build/ui/Icon/SpinnerIcon.d.ts +2 -0
  84. package/build/ui/JsonDialog.d.ts +1 -0
  85. package/build/ui/PreviewRoute/AlertCollapse.d.ts +13 -0
  86. package/build/ui/PreviewRoute/ChainStep.d.ts +30 -0
  87. package/build/ui/PreviewRoute/SetAddressDialog.d.ts +12 -0
  88. package/build/ui/PreviewRoute/index.d.ts +18 -0
  89. package/build/ui/PreviewRoute/make-actions.d.ts +29 -0
  90. package/build/ui/PreviewRoute/make-chain-ids-with-actions.d.ts +11 -0
  91. package/build/ui/PreviewRoute/make-step-state.d.ts +17 -0
  92. package/build/ui/PreviewRoute/types.d.ts +21 -0
  93. package/build/ui/PriceImpactWarning.d.ts +7 -0
  94. package/build/ui/SettingsDialog/GasSetting.d.ts +1 -0
  95. package/build/ui/SettingsDialog/PurgeSetting.d.ts +1 -0
  96. package/build/ui/SettingsDialog/SaveIndicator.d.ts +1 -0
  97. package/build/ui/SettingsDialog/SlippageSetting.d.ts +1 -0
  98. package/build/ui/SettingsDialog/index.d.ts +1 -0
  99. package/build/ui/SimpleTooltip.d.ts +11 -0
  100. package/build/ui/SwapDetails.d.ts +11 -0
  101. package/build/ui/TransactionDialog.d.ts +13 -0
  102. package/build/ui/UsdValue.d.ts +27 -0
  103. package/build/ui/WalletModal/WalletListItem.d.ts +8 -0
  104. package/build/ui/WalletModal/WalletModal.d.ts +10 -0
  105. package/build/ui/WalletModal/context.d.ts +13 -0
  106. package/build/ui/WalletModal/index.d.ts +3 -0
  107. package/build/ui/Widget.d.ts +1 -0
  108. package/build/ui/index.d.ts +9 -0
  109. package/build/utils/assert.d.ts +2 -0
  110. package/build/utils/chain.d.ts +9 -0
  111. package/build/utils/clients.d.ts +4 -0
  112. package/build/utils/error.d.ts +1 -0
  113. package/build/utils/explorer.d.ts +5 -0
  114. package/build/utils/intl.d.ts +4 -0
  115. package/build/utils/ledger-warning.d.ts +3 -0
  116. package/build/utils/link.d.ts +4 -0
  117. package/build/utils/number.d.ts +4 -0
  118. package/build/utils/os.d.ts +3 -0
  119. package/build/utils/random.d.ts +1 -0
  120. package/build/utils/ui.d.ts +2 -0
  121. package/build/utils/usd.d.ts +5 -0
  122. package/build/utils/wallet.d.ts +7 -0
  123. package/package.json +96 -0
package/README.md ADDED
@@ -0,0 +1,89 @@
1
+ # SKIP GO WIDGET
2
+
3
+ The `@skip-go/widget` package is an npm package of react component that provide a full swap interface using [Skip API](https://skip.money/).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @skip-go/widget
9
+ ```
10
+
11
+ ## Quick Start Guide
12
+
13
+ 1. Wrap your app or page with the `SwapWidgetProvider` component.
14
+
15
+ ```tsx
16
+ import { SwapWidgetProvider } from '@skip-go/widget';
17
+
18
+ function App() {
19
+ return (
20
+ <SwapWidgetProvider>
21
+ <YourApp />
22
+ </SwapWidgetProvider>
23
+ );
24
+ }
25
+ ```
26
+
27
+ 2. Use the `SwapWidget` component to render the swap interface.
28
+
29
+ ```tsx
30
+ import { SwapWidget } from '@skip-go/widget';
31
+
32
+ const SwapPage = () => {
33
+ return (
34
+ <div
35
+ style={{
36
+ width: '450px',
37
+ height: '820px',
38
+ }}
39
+ >
40
+ <SwapWidget
41
+ colors={{
42
+ primary: '#FF4FFF',
43
+ }}
44
+ />
45
+ </div>
46
+ );
47
+ };
48
+ ```
49
+
50
+ ## Props
51
+
52
+ ### SwapWidget
53
+
54
+ ```tsx
55
+ interface SwapWidgetProps {
56
+ colors?:{
57
+ primary?: string; // Custom colors for the widget. Defaults to `#FF486E`.
58
+ }
59
+ defaultRoute?: { // Default route for the widget.
60
+ amountIn?: number;
61
+ amountOut?: number;
62
+ srcChainID?: string;
63
+ srcAssetDenom?: string;
64
+ destChainID?: string;
65
+ destAssetDenom?: string;
66
+ };
67
+ endpointOptions?: { // Endpoint options to override rpc/rest endpoints. Defaults to Skip proxied endpoints. Please reach out to us first if you want to be whitelisted.
68
+ endpoints?: Record<string, EndpointOptions>;
69
+ getRpcEndpointForChain?: (chainID: string) => Promise<string>;
70
+ getRestEndpointForChain?: (chainID: string) => Promise<string>;
71
+ };
72
+ apiURL?: string // Custom API URL to override Skip API endpoint. Defaults to Skip proxied endpoints. Please reach out to us first if you want to be whitelisted.
73
+ routeConfig?: {
74
+ experimentalFeatures?: ["hyperlane"];
75
+ allowMultiTx?: boolean;
76
+ allowUnsafe?: boolean;
77
+ bridges?: ("IBC" | "AXELAR" | "CCTP" | "HYPERLANE")[];
78
+ swapVenues?: {
79
+ name: string;
80
+ chainID: string;
81
+ }[];
82
+ className?: string;
83
+ style?: React.CSSProperties;
84
+ }
85
+ ```
86
+
87
+ ### SwapWidgetProvider
88
+
89
+ - `toasterProps` (Optional) - Props for the toaster component. [ToasterProps](https://react-hot-toast.com/docs/toast-options). Defaults to `{ position: 'top-right' }`.
@@ -0,0 +1 @@
1
+ export declare const concurrency: number;
@@ -0,0 +1,14 @@
1
+ import { Asset, AssetList, Chain, ChainInfo, Explorer } from "@graz-sh/types";
2
+ export interface Variables {
3
+ assetlists: AssetList[];
4
+ chains: Chain[];
5
+ chainIds: string[];
6
+ chainNames: string[];
7
+ chainIdToName: Record<string, string>;
8
+ chainIdToPrettyName: Record<string, string>;
9
+ chainNameToId: Record<string, string>;
10
+ chainRecord: Record<string, Chain>;
11
+ assetsRecord: Record<string, Asset[]>;
12
+ explorersRecord: Record<string, Explorer[]>;
13
+ chainInfosRecord: Record<string, ChainInfo>;
14
+ }
@@ -0,0 +1,6 @@
1
+ interface Args {
2
+ registryPath: string;
3
+ }
4
+ export declare function getChainsPaths({ registryPath }: Args): Promise<string[]>;
5
+ export declare function getInitiaChainsPaths({ registryPath }: Args): Promise<string[]>;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ import { AssetList } from "@graz-sh/types";
2
+ interface Args {
3
+ registryPath: string;
4
+ chainPath: string;
5
+ }
6
+ export declare function parseAssetListJson({ registryPath, chainPath }: Args): Promise<AssetList>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import { Chain } from "@graz-sh/types";
2
+ interface Args {
3
+ registryPath: string;
4
+ chainPath: string;
5
+ }
6
+ export declare function parseChainJson({ registryPath, chainPath }: Args): Promise<Chain>;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import { Variables } from "./_types";
2
+ interface Args {
3
+ registryPath: string;
4
+ chainPaths: string[];
5
+ initiaRegistryPath: string;
6
+ initiaChainPaths: string[];
7
+ }
8
+ export declare function parseChainPaths({ registryPath, chainPaths, initiaChainPaths, initiaRegistryPath, }: Args): Promise<Variables>;
9
+ export {};
@@ -0,0 +1,6 @@
1
+ interface Args {
2
+ registryPath: string;
3
+ chainPaths: string[];
4
+ }
5
+ export declare function validateChainsPaths({ registryPath, chainPaths }: Args): Promise<string[]>;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ import { Variables } from "./_types";
2
+ interface Args {
3
+ variables: Variables;
4
+ destPath: string;
5
+ }
6
+ export declare function writeEntrypoints({ variables: v, destPath }: Args): Promise<void>;
7
+ export {};
@@ -0,0 +1,3 @@
1
+ import { Asset } from "@graz-sh/types";
2
+ import { ChainId } from "./types";
3
+ export declare const assetsRecord: Record<ChainId, Asset[]>;
@@ -0,0 +1,3 @@
1
+ import { ChainInfo } from "@graz-sh/types";
2
+ import { ChainId } from "./types";
3
+ export declare const chainInfosRecord: Record<ChainId, ChainInfo>;
@@ -0,0 +1,3 @@
1
+ import { Chain } from "@graz-sh/types";
2
+ import { ChainId } from "./types";
3
+ export declare const chainRecord: Record<ChainId, Chain>;
@@ -0,0 +1,3 @@
1
+ import { Explorer } from "@graz-sh/types";
2
+ import { ChainId } from "./types";
3
+ export declare const explorersRecord: Record<ChainId, Explorer[]>;
@@ -0,0 +1,7 @@
1
+ import { Asset, AssetList, Chain } from "@graz-sh/types";
2
+ import { ChainId } from "./types";
3
+ export declare function getChain(chainId: ChainId): Chain;
4
+ export declare function getAssets(chainId: ChainId): Asset[];
5
+ export declare function getChains(): Chain[];
6
+ export declare function getAssetLists(): AssetList[];
7
+ export * from "./types";
@@ -0,0 +1,2 @@
1
+ import { ChainId } from "./types";
2
+ export declare const chainIdToPrettyName: Record<ChainId, string>;
@@ -0,0 +1,6 @@
1
+ export declare const chainIds: readonly ["eightball-1", "acre_9052-1", "agoric-3", "aioz_168-1", "akashnet-2", "akiro-1", "althea_258432-1", "andromeda-1", "andromeda-1", "arkh", "archway-1", "mantle-1", "aura_6322-2", "xstaxy-1", "axelar-dojo-1", "laozi-mainnet", "beezee-1", "bitsong-2b", "bluzelle-9", "bostrom", "bitcanna-1", "canto_7700-1", "cerberus-chain-1", "carbon-1", "celestia", "perun-1", "chimba", "morocco-1", "cheqd-mainnet-1", "cifer-2", "cifer-1", "chihuahua-1", "comdex-1", "commercio-3", "cvn_2032-1", "coreum-mainnet-1", "coss-1", "centauri-1", "cosmoshub-4", "crescent-1", "cronosmainnet_25-1", "crypto-org-chain-mainnet-1", "cudos-1", "mainnet-3", "dhealth", "desmos-mainnet", "dig-1", "vota-ash", "dydx-mainnet-1", "dymension_1100-1", "dyson-mainnet-01", "echelon_3000-3", "emoney-3", "empowerchain-1", "ethos_7003-1", "evmos_9001-2", "fetchhub-4", "finschia-2", "furya-1", "colosseum-1", "galaxy-1", "fxcore", "wormchain", "genesis_29-2", "govgen-1", "gitopia", "gravity-bridge-3", "highbury_710-1", "haqq_11235-1", "humans_1089-1", "Antora", "imversed_5555555-1", "ixo-5", "irishub-1", "injective-1", "jackal-1", "joltify_1729-1", "kava_2222-10", "juno-1", "darchub", "kichain-2", "kaiyo-1", "lambda_92000-1", "kyve-1", "lava-mainnet-1", "likecoin-mainnet-2", "logos_7002-1", "loop-1", "loyal-main-02", "LumenX", "lum-network-1", "mayachain-mainnet-v1", "medasdigital-1", "mars-1", "microtick-1", "mainnet", "meme-1", "migaloo-1", "mun-1", "mythos_7001-1", "neura_266-1", "Neutaro-1", "neutron-1", "nim_1122-1", "cataclysm-1", "noble-1", "nois-1", "nomic-stakenet-3", "pirin-1", "nyx", "octa", "odin-mainnet-freya", "odin-mainnet-freya", "exchain-66", "onex-mainnet-1", "omniflixhub-1", "onomy-mainnet-1", "Oraichain", "panacea-3", "passage-2", "passage-1", "core-1", "planq_7070-2", "osmosis-1", "point_10687-1", "pio-mainnet-1", "pryzm-1", "PUNDIX", "pylons-mainnet-1", "quasar-1", "quicksilver-2", "qwoyn-1", "realionetwork_3301-1", "regen-1", "reb_1111-1", "titan-1", "ssc-1", "scorum-1", "seda-1", "secret-4", "pacific-1", "sentinelhub-2", "sgenet-1", "ShareRing-VoyagerNet", "shentu-2.2", "shido_9008-1", "sifchain-1", "sixnet", "sommelier-3", "source-1", "stafihub-1", "stargaze-1", "iov-mainnet-ibc", "stratos-1", "sunrise-1", "stride-1", "tenet_1559-1", "teritori-1", "morocco-1", "phoenix-1", "columbus-5", "tgrade-mainnet-1", "thorchain-mainnet-v1", "titan_18888-1", "umee-1", "FUND-MainNet-2", "ununifi-beta-v1", "uptick_117-1", "vidulum-1", "dimension_37-1", "zetachain_7000-1", "sandbox-01", "constantine-3", "arkeo", "artela_11820-1", "aura_6321-3", "bbn-test1", "bbn-test3", "axelar-testnet-lisbon-3", "bitcanna-dev-1", "bitcanna-dev-6", "blockx_190-1", "cascadia_6102-1", "blockspacerace-0", "arabica-11", "mocha-4", "babajaga-1", "cheqd-testnet-6", "chimba-testnet", "banksy-testnet-3", "kitten-04", "malaga-420", "coss-testnet-1", "cudos-testnet-public-3", "coreum-testnet-1", "theta-testnet-001", "deardoge-testnet", "morpheus-apollo-3", "vota-testnet", "vota-vk", "elystestnet-1", "dydx-testnet-4", "circulus-1", "entrypoint-pubtest-2", "evmos_9000-4", "dorado-1", "ebony-2", "galactica_9302-1", "gitopia-janus-testnet-2", "berberis-1", "testnet-1", "prajna-1", "devnet-1", "pandora-8", "imversed-test-1", "injective-888", "canine-1", "mesomelas-1", "uni-6", "kichain-t-4", "harpoon-4", "korellia-2", "kaon-1", "lava-testnet-2", "lava-testnet-1", "likecoin-public-testnet-5", "lumenx-test", "mantra-hongbai-1", "ares-1", "narwhal-2", "neura_268-1", "neura_267-1", "pion-1", "nibiru-devnet-2", "nibiru-testnet-1", "nibiru-testnet-2", "grand-1", "nibiru-devnet-1", "nois-testnet-005", "rila-1", "sandbox", "okp4-nemeton-1", "osmo-test-4", "osmo-test-5", "INVALID-ID-permtestnet-testnet-1", "test-core-1", "test-core-2", "planq_7077-1", "indigo-1", "quasar-test-1", "rhye-2", "earendel-1", "provider", "ssc-testnet-1", "pulsar-3", "pulsar-2", "atlantic-1", "sei-devnet-3", "atlantic-2", "self-dev-1", "sge-network-3", "sge-network-4", "fivenet", "soarchaintestnet", "sourcetest-1", "elgafar-1", "stateset-1-testnet", "stride-testnet-1", "temporal-test-2", "swisstronik_1291-1", "90u-4", "90u-2", "pisco-1", "titan_18889-1", "ulas", "union-testnet-8", "uptick_7000-2", "vince_1903-1", "buenavista-1", "INVALID-ID-wavehashtestnet-testnet-1", "xion-testnet-1", "athens_7001-1", "tomcat-1", "landlord-1", "init-ai-1", "initiation-1", "minimove-1", "miniwasm-1", "birdee-1", "burrito-1"];
2
+ export type ChainId = (typeof chainIds)[number] | (string & {});
3
+ export declare const chainNames: readonly ["8ball", "acrechain", "agoric", "aioz", "akash", "akiro", "althea", "andromeda1", "andromeda", "arkh", "archway", "assetmantle", "aura", "aura1", "axelar", "bandchain", "beezee", "bitsong", "bluzelle", "bostrom", "bitcanna", "canto", "cerberus", "carbon", "celestia", "chain4energy", "chimba", "chronicnetwork", "cheqd", "cifer", "cifer1", "chihuahua", "comdex", "commercionetwork", "conscious", "coreum", "coss", "composable", "cosmoshub", "crescent", "cronos", "cryptoorgchain", "cudos", "decentr", "dhealth", "desmos", "dig", "doravota", "dydx", "dymension", "dyson", "echelon", "emoney", "empowerchain", "ethos", "evmos", "fetchhub", "finschia", "furya", "firmachain", "galaxy", "fxcore", "gateway", "genesisl1", "govgen", "gitopia", "gravitybridge", "highbury", "haqq", "humans", "idep", "imversed", "impacthub", "irisnet", "injective", "jackal", "joltify", "kava", "juno", "konstellation", "kichain", "kujira", "lambda", "kyve", "lava", "likecoin", "logos", "loop", "loyal", "lumenx", "lumnetwork", "mayachain", "medasdigital", "mars", "microtick", "mises", "meme", "migaloo", "mun", "mythos", "neura", "neutaro", "neutron", "nim", "nibiru", "noble", "nois", "nomic", "nolus", "nyx", "octa", "odin", "odin", "okexchain", "onex", "omniflixhub", "onomy", "oraichain", "panacea", "passage", "passage1", "persistence", "planq", "osmosis", "point", "provenance", "pryzm", "pundix", "pylons", "quasar", "quicksilver", "qwoyn", "realio", "regen", "rebus", "rizon", "saga", "scorum", "seda", "secretnetwork", "sei", "sentinel", "sge", "shareledger", "shentu", "shido", "sifchain", "six", "sommelier", "source", "stafihub", "stargaze", "starname", "stratos", "sunrise", "stride", "tenet", "teritori", "terpnetwork", "terra2", "terra", "tgrade", "thorchain", "titan", "umee", "unification", "ununifi", "uptick", "vidulum", "xpla", "zetachain", "akashtestnet", "archwaytestnet", "arkeonetworktestnet", "artelatestnet", "auratestnet", "babylontestnet1", "babylontestnet", "axelartestnet", "bitcannadevnet", "bitcannadevnet2", "blockxtestnet", "cascadiatestnet", "celestiatestnet", "celestiatestnet2", "celestiatestnet3", "chain4energytestnet", "cheqdtestnet", "chimbatestnet", "composabletestnet", "coolcattestnet", "cosmwasmtestnet", "cosstestnet", "cudostestnet", "coreumtestnet", "cosmoshubtestnet", "deardogetestnet", "desmostestnet", "doravotatestnet", "doravotatestnet2", "elystestnet", "dydxtestnet", "empowertestnet", "entrypointtestnet", "evmostestnet", "fetchhubtestnet", "finschiatestnet", "galacticatestnet", "gitopiatestnet", "hedgetestnet", "humanstestnet", "hypersigntestnet", "impacthubdevnet", "impacthubtestnet", "imversedtestnet", "injectivetestnet", "jackaltestnet", "jackaltestnet2", "junotestnet", "kichaintestnet", "kujiratestnet", "kyvedevnet", "kyvetestnet", "lavatestnet", "lavatestnet1", "likecointestnet", "lumenxtestnet", "mantrachaintestnet", "marstestnet", "migalootestnet", "neuradevnet", "neuratestnet", "neutrontestnet", "nibirudevnet2", "nibirutestnet", "nibirutestnet2", "nobletestnet", "nibirudevnet", "noistestnet", "nolustestnet", "nyxtestnet", "okp4testnet", "osmosistestnet4", "osmosistestnet", "permtestnet", "persistencetestnet", "persistencetestnet2", "planqtestnet", "pryzmtestnet", "quasartestnet", "quicksilvertestnet", "qwoyntestnet", "rsprovidertestnet", "sagatestnet", "secretnetworktestnet", "secretnetworktestnet2", "seitestnet", "seidevnet3", "seitestnet2", "selfchaindevnet", "sgetestnet", "sgetestnet4", "sixtestnet", "soarchaintestnet", "sourcetestnet", "stargazetestnet", "statesettestnet", "stridetestnet", "temporaltestnet", "swisstroniktestnet", "terpnettestnet", "terpnettestnet2", "terra2testnet", "titantestnet", "ulastestnet", "uniontestnet", "upticktestnet", "vincechaintestnet", "wardenprotocoltestnet", "wavehashtestnet", "xiontestnet", "zetachaintestnet", "blackwing", "civitia", "init_ai", "initia", "minimove", "miniwasm", "tucana", "noon"];
4
+ export type ChainName = (typeof chainNames)[number] | (string & {});
5
+ export declare const chainIdToName: Record<ChainId, ChainName>;
6
+ export declare const chainNameToId: Record<ChainName, ChainId>;
@@ -0,0 +1,2 @@
1
+ import { Abi } from "viem";
2
+ export declare const multicall3ABI: Abi;
@@ -0,0 +1,5 @@
1
+ export declare const endpointOptions: {
2
+ getRpcEndpointForChain: (chainID: string) => Promise<string>;
3
+ getRestEndpointForChain: (chainID: string) => Promise<string>;
4
+ };
5
+ export declare const apiURL = "https://ibc-dot-fun-git-enable-cors-skip-protocol.vercel.app/api/skip";
@@ -0,0 +1,2 @@
1
+ /** @see https://docs.axelar.dev/learn/txduration#common-finality-time-for-interchain-transactions */
2
+ export declare function getFinalityTime(id: string | number): string;
@@ -0,0 +1,3 @@
1
+ export declare const DEFAULT_GAS_AMOUNT: string;
2
+ export declare const EVMOS_GAS_AMOUNT: string;
3
+ export declare function isChainIdEvmos(chainID: string): boolean;
@@ -0,0 +1,2 @@
1
+ export declare const knownBrokenCCTPLedgerChainIds: string[];
2
+ export declare const knownEthermintLedgerChainIds: string[];
@@ -0,0 +1,2 @@
1
+ import { Chain } from 'wagmi/chains';
2
+ export declare const EVM_CHAINS: Chain[];
@@ -0,0 +1,46 @@
1
+ export declare function useAccount(chainID?: string): {
2
+ address: string | undefined;
3
+ isWalletConnected: boolean;
4
+ wallet: {
5
+ walletName: string;
6
+ walletPrettyName: string;
7
+ walletInfo: {
8
+ logo: string | {
9
+ major: string;
10
+ minor: string;
11
+ } | undefined;
12
+ };
13
+ isLedger: boolean | null | undefined;
14
+ } | undefined;
15
+ chainType: string;
16
+ connect: () => Promise<void>;
17
+ disconnect: () => Promise<void>;
18
+ } | {
19
+ address: `0x${string}` | undefined;
20
+ isWalletConnected: boolean;
21
+ wallet: {
22
+ walletName: string;
23
+ walletPrettyName: string;
24
+ walletInfo: {
25
+ logo: string | undefined;
26
+ };
27
+ isLedger?: undefined;
28
+ } | undefined;
29
+ chainType: string;
30
+ connect: () => Promise<void> | undefined;
31
+ disconnect: () => Promise<void> | undefined;
32
+ } | {
33
+ address: string | undefined;
34
+ isWalletConnected: boolean | undefined;
35
+ wallet: {
36
+ walletName: import("@solana/wallet-adapter-base").WalletName<string>;
37
+ walletPrettyName: import("@solana/wallet-adapter-base").WalletName<string>;
38
+ walletInfo: {
39
+ logo: string;
40
+ };
41
+ isLedger?: undefined;
42
+ } | undefined;
43
+ chainType: string;
44
+ connect: () => Promise<void> | undefined;
45
+ disconnect: () => Promise<void> | undefined;
46
+ } | undefined;
@@ -0,0 +1,4 @@
1
+ import { AssetsRequest } from '@skip-router/core';
2
+ export declare function useAssets(options?: AssetsRequest): import("@tanstack/react-query").UseQueryResult<{
3
+ [k: string]: import("@skip-router/core").Asset[];
4
+ }, Error>;
@@ -0,0 +1,11 @@
1
+ import { Chain } from '@skip-router/core';
2
+ import { ChainAddresses, SetChainAddressesParam } from '../ui/PreviewRoute/types';
3
+ export declare const useAutoSetAddress: ({ chain, chainID, index, enabled, signRequired, chainAddresses, setChainAddresses, }: {
4
+ chain?: Chain;
5
+ chainID: string;
6
+ index: number;
7
+ enabled?: boolean;
8
+ signRequired?: boolean;
9
+ chainAddresses: ChainAddresses;
10
+ setChainAddresses: (v: SetChainAddressesParam) => void;
11
+ }) => import("@tanstack/react-query").UseQueryResult<null, Error>;
@@ -0,0 +1,15 @@
1
+ import { Asset, SkipRouter } from '@skip-router/core';
2
+ import { PublicClient } from 'viem';
3
+ import { Chain } from './use-chains';
4
+ interface Args {
5
+ address?: string;
6
+ chain?: Chain;
7
+ assets?: Asset[];
8
+ enabled?: boolean;
9
+ solanaRpcUrl?: string;
10
+ }
11
+ export declare function useBalancesByChain({ address, chain, assets, enabled, }: Args): import("@tanstack/react-query").UseQueryResult<Record<string, string> | undefined, Error>;
12
+ export declare function getBalancesByChain(rpcURL: string, address: string, chainID: string, assets: Asset[]): Promise<Record<string, string>>;
13
+ export declare function getEvmChainBalances(skipClient: SkipRouter, publicClient: PublicClient, address: string, chainID: string): Promise<Record<string, string>>;
14
+ export declare const getSvmChainBalances: (rpcUrl: string, address: string, chainID: string, assets: Asset[]) => Promise<Record<string, string>>;
15
+ export {};
@@ -0,0 +1,7 @@
1
+ import { Bridge } from '@skip-router/core';
2
+ export type UseBridgesQueryArgs<T = Bridge[]> = {
3
+ enabled?: boolean;
4
+ select?: (arr?: Bridge[]) => T;
5
+ };
6
+ export declare function useBridges<T = Bridge[]>(args?: UseBridgesQueryArgs<T>): import("@tanstack/react-query").UseQueryResult<T, Error>;
7
+ export declare function useBridgeByID(bridgeID?: Bridge['id']): import("@tanstack/react-query").UseQueryResult<Bridge | undefined, Error>;
@@ -0,0 +1,24 @@
1
+ import { ChainTransaction, TransferState, StatusState } from '@skip-router/core';
2
+ interface TransferSequence {
3
+ srcChainID: string;
4
+ destChainID: string;
5
+ txs: {
6
+ sendTx: ChainTransaction | null;
7
+ receiveTx: ChainTransaction | null;
8
+ };
9
+ state: TransferState;
10
+ }
11
+ export declare const useBroadcastedTxsStatus: ({ txs, txsRequired, enabled, }: {
12
+ txsRequired: number;
13
+ txs: {
14
+ chainID: string;
15
+ txHash: string;
16
+ }[] | undefined;
17
+ enabled?: boolean;
18
+ }) => import("@tanstack/react-query").UseQueryResult<{
19
+ isSuccess: boolean;
20
+ isSettled: boolean;
21
+ transferSequence: TransferSequence[];
22
+ states: StatusState[];
23
+ } | undefined, Error>;
24
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Chain as SkipChain } from '@skip-router/core';
2
+ export type Chain = SkipChain & {
3
+ prettyName: string;
4
+ };
5
+ export type UseChainsQueryArgs<T = Chain[]> = {
6
+ enabled?: boolean;
7
+ select?: (arr?: Chain[]) => T;
8
+ };
9
+ export declare function useChains<T = Chain[]>(args?: UseChainsQueryArgs<T>): import("@tanstack/react-query").UseQueryResult<T, Error>;
10
+ export declare function useChainByID(chainID?: string): import("@tanstack/react-query").UseQueryResult<Chain | undefined, Error>;
@@ -0,0 +1,2 @@
1
+ import { RouteResponse } from '@skip-router/core';
2
+ export declare function useFinalityTimeEstimate(route: RouteResponse): string;
@@ -0,0 +1,21 @@
1
+ export interface MinimalWallet {
2
+ walletName: string;
3
+ walletPrettyName: string;
4
+ walletInfo: {
5
+ logo?: string | {
6
+ major: string;
7
+ minor: string;
8
+ };
9
+ };
10
+ connect: () => Promise<void>;
11
+ disconnect: () => Promise<void>;
12
+ isWalletConnected: boolean;
13
+ isAvailable?: boolean;
14
+ getAddress?: (props: {
15
+ signRequired?: boolean;
16
+ context?: 'recovery' | 'destination';
17
+ }) => Promise<string | undefined>;
18
+ }
19
+ export declare const useMakeWallets: () => {
20
+ makeWallets: (chainID: string) => MinimalWallet[];
21
+ };
@@ -0,0 +1,19 @@
1
+ import { BridgeType, ExperimentalFeature, SwapVenueRequest } from '@skip-router/core';
2
+ export interface RouteConfig {
3
+ experimentalFeatures?: ExperimentalFeature[];
4
+ allowMultiTx?: boolean;
5
+ allowUnsafe?: boolean;
6
+ bridges?: BridgeType[];
7
+ swapVenues?: SwapVenueRequest[];
8
+ }
9
+ interface UseRouteArgs extends RouteConfig {
10
+ direction: 'swap-in' | 'swap-out';
11
+ amount: string;
12
+ sourceAsset?: string;
13
+ sourceAssetChainID?: string;
14
+ destinationAsset?: string;
15
+ destinationAssetChainID?: string;
16
+ enabled?: boolean;
17
+ }
18
+ export declare function useRoute({ direction, amount, sourceAsset, sourceAssetChainID, destinationAsset, destinationAssetChainID, enabled, swapVenues, bridges, experimentalFeatures, allowMultiTx, allowUnsafe, }: UseRouteArgs): import("@tanstack/react-query").UseQueryResult<import("@skip-router/core").RouteResponse | undefined, Error>;
19
+ export {};
@@ -0,0 +1,11 @@
1
+ export declare function useSkipClient(): import("@skip-router/core").SkipRouter;
2
+ export declare function useSkipConfig(): {
3
+ apiURL: string | undefined;
4
+ endpointOptions: {
5
+ endpoints?: Record<string, import("@skip-router/core").EndpointOptions> | undefined;
6
+ getRpcEndpointForChain?: ((chainID: string) => Promise<string>) | undefined;
7
+ getRestEndpointForChain?: ((chainID: string) => Promise<string>) | undefined;
8
+ } | undefined;
9
+ defaultRoute: import("./use-swap-widget").DefaultRouteConfig | undefined;
10
+ routeConfig: import("./use-route").RouteConfig | undefined;
11
+ };
@@ -0,0 +1,81 @@
1
+ import { GasPrice } from '@cosmjs/stargate';
2
+ import { Asset, BridgeType } from '@skip-router/core';
3
+ import { MouseEvent } from 'react';
4
+ import { Chain } from './use-chains';
5
+ export interface DefaultRouteConfig {
6
+ amountIn?: number;
7
+ amountOut?: number;
8
+ srcChainID?: string;
9
+ srcAssetDenom?: string;
10
+ destChainID?: string;
11
+ destAssetDenom?: string;
12
+ }
13
+ export declare function useSwapWidget(): {
14
+ amountIn: string;
15
+ amountOut: string;
16
+ bridges: BridgeType[];
17
+ destinationAsset: Asset | undefined;
18
+ destinationChain: Chain | undefined;
19
+ direction: "swap-in" | "swap-out";
20
+ isAmountError: string | boolean;
21
+ noRouteFound: boolean;
22
+ numberOfTransactions: number;
23
+ onAllTransactionComplete: () => void;
24
+ onBridgeChange: (bridges: BridgeType[]) => void;
25
+ onDestinationAmountChange: (amount: string) => void;
26
+ onDestinationAssetChange: (asset: Asset) => void;
27
+ onDestinationChainChange: (chain: Chain, injectAsset?: Asset) => Promise<void>;
28
+ onInvertDirection: () => Promise<void>;
29
+ onSourceAmountChange: (amount: string) => void;
30
+ onSourceAmountMax: <T extends HTMLElement>(event: MouseEvent<T>) => false | undefined;
31
+ onSourceAssetChange: (asset: Asset) => void;
32
+ onSourceChainChange: (chain: Chain) => Promise<void>;
33
+ priceImpactThresholdReached: boolean;
34
+ route: import("@skip-router/core").RouteResponse | undefined;
35
+ routeError: string;
36
+ routeLoading: boolean;
37
+ routeWarningMessage: string | undefined;
38
+ routeWarningTitle: string | undefined;
39
+ sourceAsset: Asset | undefined;
40
+ sourceChain: Chain | undefined;
41
+ sourceFeeAmount: string | undefined;
42
+ sourceFeeAsset: Asset | undefined;
43
+ swapPriceImpactPercent: number | undefined;
44
+ usdDiffPercent: number | undefined;
45
+ shareable: {
46
+ link: string;
47
+ };
48
+ };
49
+ export interface SwapWidgetStore {
50
+ amountIn: string;
51
+ amountOut: string;
52
+ sourceChain?: Chain;
53
+ sourceAsset?: Asset;
54
+ sourceFeeAsset?: Asset;
55
+ sourceGasPrice?: GasPrice;
56
+ destinationChain?: Chain;
57
+ destinationAsset?: Asset;
58
+ direction: 'swap-in' | 'swap-out';
59
+ gasRequired?: string;
60
+ bridges: BridgeType[];
61
+ }
62
+ export declare const defaultValues: SwapWidgetStore;
63
+ export declare const useSwapWidgetStore: import("zustand/traditional").UseBoundStoreWithEqualityFn<Omit<Omit<import("zustand").StoreApi<SwapWidgetStore>, "subscribe"> & {
64
+ subscribe: {
65
+ (listener: (selectedState: SwapWidgetStore, previousSelectedState: SwapWidgetStore) => void): () => void;
66
+ <U>(selector: (state: SwapWidgetStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
67
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
68
+ fireImmediately?: boolean | undefined;
69
+ } | undefined): () => void;
70
+ };
71
+ }, "persist"> & {
72
+ persist: {
73
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<SwapWidgetStore, unknown>>) => void;
74
+ clearStorage: () => void;
75
+ rehydrate: () => void | Promise<void>;
76
+ hasHydrated: () => boolean;
77
+ onHydrate: (fn: (state: SwapWidgetStore) => void) => () => void;
78
+ onFinishHydration: (fn: (state: SwapWidgetStore) => void) => () => void;
79
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<SwapWidgetStore, unknown>>;
80
+ };
81
+ }>;
@@ -0,0 +1,8 @@
1
+ export type Args = {
2
+ chainId: string;
3
+ denom: string;
4
+ coingeckoID?: string;
5
+ value: string;
6
+ };
7
+ export declare function useUsdValue(args: Args): import("@tanstack/react-query").UseQueryResult<number, Error>;
8
+ export declare function useUsdDiffValue([args1, args2]: [Args, Args]): import("@tanstack/react-query").UseQueryResult<number, Error>;
@@ -0,0 +1,3 @@
1
+ import './styles/global.css';
2
+ export { SwapWidgetProvider } from './provider';
3
+ export { SwapWidget } from './ui';