@skip-go/widget-web-component 0.0.4 → 0.0.5

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 (118) hide show
  1. package/README.md +3 -0
  2. package/package.json +6 -11
  3. package/build/chains/index.d.ts +0 -5
  4. package/build/constants/abis.d.ts +0 -61
  5. package/build/constants/defaults.d.ts +0 -5
  6. package/build/constants/finality.d.ts +0 -2
  7. package/build/constants/gas.d.ts +0 -3
  8. package/build/constants/ledger-warning.d.ts +0 -2
  9. package/build/constants/swap-venues.d.ts +0 -4
  10. package/build/constants/wagmi.d.ts +0 -2
  11. package/build/hooks/use-account.d.ts +0 -46
  12. package/build/hooks/use-assets.d.ts +0 -3
  13. package/build/hooks/use-auto-set-address.d.ts +0 -12
  14. package/build/hooks/use-balances-by-chain.d.ts +0 -16
  15. package/build/hooks/use-bridges.d.ts +0 -8
  16. package/build/hooks/use-broadcasted-txs.d.ts +0 -26
  17. package/build/hooks/use-chains.d.ts +0 -11
  18. package/build/hooks/use-finality-time-estimate.d.ts +0 -2
  19. package/build/hooks/use-inject-fonts-to-document-head.d.ts +0 -1
  20. package/build/hooks/use-make-wallets.d.ts +0 -26
  21. package/build/hooks/use-route.d.ts +0 -21
  22. package/build/hooks/use-skip-client.d.ts +0 -10
  23. package/build/hooks/use-swap-widget.d.ts +0 -81
  24. package/build/hooks/use-usd-value.d.ts +0 -9
  25. package/build/index.d.ts +0 -5
  26. package/build/lib/cosmos-kit.d.ts +0 -3
  27. package/build/lib/react-query.d.ts +0 -2
  28. package/build/lib/solana-adapter.d.ts +0 -2
  29. package/build/lib/viem/chains.d.ts +0 -66
  30. package/build/lib/wagmi.d.ts +0 -2
  31. package/build/provider/assets.d.ts +0 -16
  32. package/build/provider/index.d.ts +0 -29
  33. package/build/provider/skip-provider.d.ts +0 -12
  34. package/build/provider/wallet/cosmos.d.ts +0 -6
  35. package/build/provider/wallet/evm.d.ts +0 -8
  36. package/build/provider/wallet/solana.d.ts +0 -6
  37. package/build/store/callbacks.d.ts +0 -31
  38. package/build/store/disclosures.d.ts +0 -44
  39. package/build/store/settings.d.ts +0 -17
  40. package/build/store/swap-widget.d.ts +0 -98
  41. package/build/store/track-wallet.d.ts +0 -24
  42. package/build/store/tx-history.d.ts +0 -36
  43. package/build/styles/fonts.d.ts +0 -1
  44. package/build/ui/AdaptiveLink.d.ts +0 -5
  45. package/build/ui/AssetInput.d.ts +0 -20
  46. package/build/ui/AssetSelect/AssetSelectContent.d.ts +0 -16
  47. package/build/ui/AssetSelect/index.d.ts +0 -11
  48. package/build/ui/AssetValue.d.ts +0 -7
  49. package/build/ui/Button/HistoryButton.d.ts +0 -2
  50. package/build/ui/Button/SettingsButton.d.ts +0 -2
  51. package/build/ui/Button/ShareButton.d.ts +0 -3
  52. package/build/ui/ChainSelect/ChainSelectContent.d.ts +0 -8
  53. package/build/ui/ChainSelect/ChainSelectTrigger.d.ts +0 -7
  54. package/build/ui/ChainSelect/index.d.ts +0 -9
  55. package/build/ui/ChainSymbol.d.ts +0 -5
  56. package/build/ui/ConnectedWalletButton.d.ts +0 -8
  57. package/build/ui/ConversionRate.d.ts +0 -22
  58. package/build/ui/CraftedBySkip.d.ts +0 -1
  59. package/build/ui/Dialog/Dialog.d.ts +0 -7
  60. package/build/ui/Dialog/DialogContent.d.ts +0 -7
  61. package/build/ui/Dialog/DialogTrigger.d.ts +0 -5
  62. package/build/ui/Dialog/context.d.ts +0 -7
  63. package/build/ui/HistoryDialog/DescriptionList.d.ts +0 -5
  64. package/build/ui/HistoryDialog/HistoryClearButton.d.ts +0 -4
  65. package/build/ui/HistoryDialog/HistoryList.d.ts +0 -14
  66. package/build/ui/HistoryDialog/RenderDate.d.ts +0 -5
  67. package/build/ui/HistoryDialog/SyncState.d.ts +0 -4
  68. package/build/ui/HistoryDialog/index.d.ts +0 -1
  69. package/build/ui/Icon/ExpandArrow.d.ts +0 -2
  70. package/build/ui/Icon/GearIcon.d.ts +0 -1
  71. package/build/ui/Icon/HistoryIcon.d.ts +0 -2
  72. package/build/ui/Icon/ShareIcon.d.ts +0 -1
  73. package/build/ui/Icon/SkipLogo.d.ts +0 -2
  74. package/build/ui/Icon/SpinnerIcon.d.ts +0 -2
  75. package/build/ui/JsonDialog.d.ts +0 -1
  76. package/build/ui/PreviewRoute/AlertCollapse.d.ts +0 -13
  77. package/build/ui/PreviewRoute/ChainStep.d.ts +0 -30
  78. package/build/ui/PreviewRoute/SetAddressDialog.d.ts +0 -12
  79. package/build/ui/PreviewRoute/index.d.ts +0 -25
  80. package/build/ui/PreviewRoute/make-actions.d.ts +0 -29
  81. package/build/ui/PreviewRoute/make-chain-ids-with-actions.d.ts +0 -11
  82. package/build/ui/PreviewRoute/make-step-state.d.ts +0 -17
  83. package/build/ui/PreviewRoute/types.d.ts +0 -21
  84. package/build/ui/PriceImpactWarning.d.ts +0 -7
  85. package/build/ui/SettingsDialog/GasSetting.d.ts +0 -1
  86. package/build/ui/SettingsDialog/PurgeSetting.d.ts +0 -1
  87. package/build/ui/SettingsDialog/SaveIndicator.d.ts +0 -1
  88. package/build/ui/SettingsDialog/SlippageSetting.d.ts +0 -1
  89. package/build/ui/SettingsDialog/index.d.ts +0 -1
  90. package/build/ui/SimpleTooltip.d.ts +0 -11
  91. package/build/ui/StyledComponents/Buttons.d.ts +0 -3
  92. package/build/ui/StyledComponents/Input.d.ts +0 -2
  93. package/build/ui/StyledComponents/Theme.d.ts +0 -8
  94. package/build/ui/SwapDetails.d.ts +0 -11
  95. package/build/ui/TransactionDialog.d.ts +0 -13
  96. package/build/ui/UsdValue.d.ts +0 -27
  97. package/build/ui/WalletModal/PraxWalletIndex.d.ts +0 -4
  98. package/build/ui/WalletModal/WalletListItem.d.ts +0 -9
  99. package/build/ui/WalletModal/WalletModal.d.ts +0 -10
  100. package/build/ui/WalletModal/context.d.ts +0 -13
  101. package/build/ui/WalletModal/index.d.ts +0 -3
  102. package/build/ui/Widget.d.ts +0 -6
  103. package/build/ui/WithStyledShadowDom.d.ts +0 -4
  104. package/build/ui/index.d.ts +0 -12
  105. package/build/ui/theme.d.ts +0 -20
  106. package/build/utils/assert.d.ts +0 -2
  107. package/build/utils/clients.d.ts +0 -4
  108. package/build/utils/error.d.ts +0 -1
  109. package/build/utils/intl.d.ts +0 -4
  110. package/build/utils/ledger-warning.d.ts +0 -3
  111. package/build/utils/link.d.ts +0 -4
  112. package/build/utils/number.d.ts +0 -4
  113. package/build/utils/os.d.ts +0 -3
  114. package/build/utils/random.d.ts +0 -1
  115. package/build/utils/ui.d.ts +0 -2
  116. package/build/utils/usd.d.ts +0 -5
  117. package/build/utils/wallet.d.ts +0 -7
  118. package/build/web-component.d.ts +0 -15
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Skip Go Widget
2
+
3
+ We document everything about Skip Go Widget in [docs.skip.build/go/widget](https://docs.skip.build/go/widget)
package/package.json CHANGED
@@ -1,23 +1,18 @@
1
1
  {
2
2
  "name": "@skip-go/widget-web-component",
3
+ "version": "0.0.5",
3
4
  "description": "Swap widget web component",
4
- "version": "0.0.4",
5
- "repository": "https://github.com/skip-mev/widget",
6
- "type": "module",
7
5
  "exports": {
8
6
  ".": {
9
7
  "import": "./build/index.js"
10
8
  }
11
9
  },
12
- "types": "./build/index.d.ts",
13
- "files": [
14
- "build",
15
- "README.md"
16
- ],
10
+ "types": "./types.d.ts",
17
11
  "scripts": {
18
12
  "publish": "npm publish"
19
13
  },
20
- "publishConfig": {
21
- "access": "public"
22
- }
14
+ "files": [
15
+ "build",
16
+ "README.md"
17
+ ]
23
18
  }
@@ -1,5 +0,0 @@
1
- import { Chain, Asset, AssetList } from '@chain-registry/types';
2
- export declare const chains: Chain[];
3
- export declare const assets: AssetList[];
4
- export declare function chainIdToName(chainId: string): string;
5
- export declare function getAssets(chainId: string): Asset[];
@@ -1,61 +0,0 @@
1
- import { Abi } from 'viem';
2
- export declare const multicall3ABI: Abi;
3
- export declare const seiPrecompileAddrABI: readonly [{
4
- readonly inputs: readonly [{
5
- readonly internalType: "string";
6
- readonly name: "v";
7
- readonly type: "string";
8
- }, {
9
- readonly internalType: "string";
10
- readonly name: "r";
11
- readonly type: "string";
12
- }, {
13
- readonly internalType: "string";
14
- readonly name: "s";
15
- readonly type: "string";
16
- }, {
17
- readonly internalType: "string";
18
- readonly name: "customMessage";
19
- readonly type: "string";
20
- }];
21
- readonly name: "associate";
22
- readonly outputs: readonly [{
23
- readonly internalType: "string";
24
- readonly name: "seiAddr";
25
- readonly type: "string";
26
- }, {
27
- readonly internalType: "address";
28
- readonly name: "evmAddr";
29
- readonly type: "address";
30
- }];
31
- readonly stateMutability: "nonpayable";
32
- readonly type: "function";
33
- }, {
34
- readonly inputs: readonly [{
35
- readonly internalType: "address";
36
- readonly name: "addr";
37
- readonly type: "address";
38
- }];
39
- readonly name: "getSeiAddr";
40
- readonly outputs: readonly [{
41
- readonly internalType: "string";
42
- readonly name: "response";
43
- readonly type: "string";
44
- }];
45
- readonly stateMutability: "view";
46
- readonly type: "function";
47
- }, {
48
- readonly inputs: readonly [{
49
- readonly internalType: "string";
50
- readonly name: "addr";
51
- readonly type: "string";
52
- }];
53
- readonly name: "getEvmAddr";
54
- readonly outputs: readonly [{
55
- readonly internalType: "address";
56
- readonly name: "response";
57
- readonly type: "address";
58
- }];
59
- readonly stateMutability: "view";
60
- readonly type: "function";
61
- }];
@@ -1,5 +0,0 @@
1
- export declare const endpointOptions: {
2
- getRpcEndpointForChain: (chainID: string) => Promise<string>;
3
- getRestEndpointForChain: (chainID: string) => Promise<string>;
4
- };
5
- export declare const apiURL = "https://go.skip.build/api/widget/skip";
@@ -1,2 +0,0 @@
1
- /** @see https://docs.axelar.dev/learn/txduration#common-finality-time-for-interchain-transactions */
2
- export declare function getFinalityTime(id: string | number): string;
@@ -1,3 +0,0 @@
1
- export declare const DEFAULT_GAS_AMOUNT: string;
2
- export declare const EVMOS_GAS_AMOUNT: string;
3
- export declare function isChainIdEvmos(chainID: string): boolean;
@@ -1,2 +0,0 @@
1
- export declare const knownBrokenCCTPLedgerChainIds: string[];
2
- export declare const knownEthermintLedgerChainIds: string[];
@@ -1,4 +0,0 @@
1
- export interface SwapVenueConfig {
2
- prettyName: string;
3
- }
4
- export declare const SWAP_VENUES: Record<string, SwapVenueConfig>;
@@ -1,2 +0,0 @@
1
- import { Chain } from 'wagmi/chains';
2
- export declare const EVM_CHAINS: Chain[];
@@ -1,46 +0,0 @@
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;
@@ -1,3 +0,0 @@
1
- import { Asset, AssetsRequest } from '@skip-go/client';
2
- import { UseQueryResult } from '@tanstack/react-query';
3
- export declare function useAssets(options?: AssetsRequest): UseQueryResult<Record<string, Asset[]>>;
@@ -1,12 +0,0 @@
1
- import { Chain } from '@skip-go/client';
2
- import { UseQueryResult } from '@tanstack/react-query';
3
- import { ChainAddresses, SetChainAddressesParam } from '../ui/PreviewRoute/types';
4
- export declare const useAutoSetAddress: ({ chain, chainID, index, enabled, signRequired, chainAddresses, setChainAddresses, }: {
5
- chain?: Chain | undefined;
6
- chainID: string;
7
- index: number;
8
- enabled?: boolean | undefined;
9
- signRequired?: boolean | undefined;
10
- chainAddresses: ChainAddresses;
11
- setChainAddresses: (v: SetChainAddressesParam) => void;
12
- }) => UseQueryResult;
@@ -1,16 +0,0 @@
1
- import { Asset, SkipClient } from '@skip-go/client';
2
- import { UseQueryResult } from '@tanstack/react-query';
3
- import { PublicClient } from 'viem';
4
- import { Chain } from './use-chains';
5
- interface Args {
6
- address?: string;
7
- chain?: Chain;
8
- assets?: Asset[];
9
- enabled?: boolean;
10
- solanaRpcUrl?: string;
11
- }
12
- export declare function useBalancesByChain({ address, chain, assets, enabled, }: Args): UseQueryResult<Record<string, string> | undefined>;
13
- export declare function getBalancesByChain(rpcURL: string, address: string, chainID: string, assets: Asset[]): Promise<Record<string, string>>;
14
- export declare function getEvmChainBalances(skipClient: SkipClient, publicClient: PublicClient, address: string, chainID: string): Promise<Record<string, string>>;
15
- export declare const getSvmChainBalances: (rpcUrl: string, address: string, chainID: string, assets: Asset[]) => Promise<Record<string, string>>;
16
- export {};
@@ -1,8 +0,0 @@
1
- import { Bridge } from '@skip-go/client';
2
- import { UseQueryResult } from '@tanstack/react-query';
3
- export type UseBridgesQueryArgs<T = Bridge[]> = {
4
- enabled?: boolean;
5
- select?: (arr?: Bridge[]) => T;
6
- };
7
- export declare function useBridges<T = Bridge[]>(args?: UseBridgesQueryArgs<T>): UseQueryResult<T>;
8
- export declare function useBridgeByID(bridgeID?: Bridge['id']): UseQueryResult<Bridge | undefined>;
@@ -1,26 +0,0 @@
1
- import { ChainTransaction, TransferState, StatusState } from '@skip-go/client';
2
- import { UseQueryResult } from '@tanstack/react-query';
3
- interface TransferSequence {
4
- srcChainID: string;
5
- destChainID: string;
6
- txs: {
7
- sendTx: ChainTransaction | null;
8
- receiveTx: ChainTransaction | null;
9
- };
10
- state: TransferState;
11
- }
12
- interface TxsStatus {
13
- isSuccess: boolean;
14
- isSettled: boolean;
15
- transferSequence: TransferSequence[];
16
- states: StatusState[];
17
- }
18
- export declare const useBroadcastedTxsStatus: ({ txs, txsRequired, enabled, }: {
19
- txsRequired: number;
20
- txs: {
21
- chainID: string;
22
- txHash: string;
23
- }[] | undefined;
24
- enabled?: boolean | undefined;
25
- }) => UseQueryResult<TxsStatus>;
26
- export {};
@@ -1,11 +0,0 @@
1
- import { Chain as SkipChain } from '@skip-go/client';
2
- import { UseQueryResult } from '@tanstack/react-query';
3
- export type Chain = SkipChain & {
4
- prettyName: string;
5
- };
6
- export type UseChainsQueryArgs<T = Chain[]> = {
7
- enabled?: boolean;
8
- select?: (arr?: Chain[]) => T;
9
- };
10
- export declare function useChains<T = Chain[]>(args?: UseChainsQueryArgs<T>): UseQueryResult<T>;
11
- export declare function useChainByID(chainID?: string): UseQueryResult<Chain | undefined>;
@@ -1,2 +0,0 @@
1
- import { RouteResponse } from '@skip-go/client';
2
- export declare function useFinalityTimeEstimate(route: RouteResponse): string;
@@ -1 +0,0 @@
1
- export declare const useInjectFontsToDocumentHead: () => void;
@@ -1,26 +0,0 @@
1
- export interface MinimalWallet {
2
- walletName: string;
3
- walletPrettyName: string;
4
- walletChainType: 'evm' | 'cosmos' | 'svm';
5
- walletInfo: {
6
- logo?: string | {
7
- major: string;
8
- minor: string;
9
- };
10
- };
11
- connect: () => Promise<void>;
12
- disconnect: () => Promise<void>;
13
- isWalletConnected: boolean;
14
- isAvailable?: boolean;
15
- getAddress?: (props: {
16
- signRequired?: boolean;
17
- context?: 'recovery' | 'destination';
18
- praxWallet?: {
19
- index?: number;
20
- sourceChainID?: string;
21
- };
22
- }) => Promise<string | undefined>;
23
- }
24
- export declare const useMakeWallets: () => {
25
- makeWallets: (chainID: string) => MinimalWallet[];
26
- };
@@ -1,21 +0,0 @@
1
- import { BridgeType, ExperimentalFeature, RouteResponse, SmartSwapOptions, SwapVenueRequest } from '@skip-go/client';
2
- import { UseQueryResult } from '@tanstack/react-query';
3
- export interface RouteConfig {
4
- experimentalFeatures?: ExperimentalFeature[];
5
- allowMultiTx?: boolean;
6
- allowUnsafe?: boolean;
7
- bridges?: BridgeType[];
8
- swapVenues?: SwapVenueRequest[];
9
- smartSwapOptions?: SmartSwapOptions;
10
- }
11
- interface UseRouteArgs extends RouteConfig {
12
- direction: 'swap-in' | 'swap-out';
13
- amount: string;
14
- sourceAsset?: string;
15
- sourceAssetChainID?: string;
16
- destinationAsset?: string;
17
- destinationAssetChainID?: string;
18
- enabled?: boolean;
19
- }
20
- export declare function useRoute({ direction, amount, sourceAsset, sourceAssetChainID, destinationAsset, destinationAssetChainID, enabled, swapVenues, bridges, experimentalFeatures, allowMultiTx, allowUnsafe, smartSwapOptions, }: UseRouteArgs): UseQueryResult<RouteResponse | undefined>;
21
- export {};
@@ -1,10 +0,0 @@
1
- export declare function useSkipClient(): import("@skip-go/client").SkipClient;
2
- export declare function useSkipConfig(): {
3
- apiURL: string | undefined;
4
- endpointOptions: {
5
- endpoints?: Record<string, import("@skip-go/client").EndpointOptions> | undefined;
6
- getRpcEndpointForChain?: ((chainID: string) => Promise<string>) | undefined;
7
- getRestEndpointForChain?: ((chainID: string) => Promise<string>) | undefined;
8
- } | undefined;
9
- makeDestinationWallets: ((chainID: string) => import("./use-make-wallets").MinimalWallet[]) | undefined;
10
- };
@@ -1,81 +0,0 @@
1
- import { GasPrice } from '@cosmjs/stargate';
2
- import { Asset, BridgeType } from '@skip-go/client';
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(persistSwapWidgetState?: boolean): {
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, globalThis.MouseEvent>) => false | undefined;
31
- onSourceAssetChange: (asset: Asset) => void;
32
- onSourceChainChange: (chain: Chain, injectAsset?: Asset) => Promise<void>;
33
- priceImpactThresholdReached: boolean;
34
- route: import("@skip-go/client/dist/shared-CpfDn0H3").R | 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
- }>;
@@ -1,9 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- export type Args = {
3
- chainId: string;
4
- denom: string;
5
- coingeckoID?: string;
6
- value: string;
7
- };
8
- export declare function useUsdValue(args: Args): UseQueryResult<number>;
9
- export declare function useUsdDiffValue([args1, args2]: [Args, Args]): UseQueryResult<number, Error>;
package/build/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export { SwapWidgetProvider, SwapWidgetProviderProps } from './provider';
2
- export { SwapWidget, SwapWidgetProps, SwapWidgetWithoutProviders, SwapWidgetWithoutProvidersProps, } from './ui';
3
- export { useAssets } from './provider/assets';
4
- export { useChains, useChainByID } from './hooks/use-chains';
5
- export { MinimalWallet } from './hooks/use-make-wallets';
@@ -1,3 +0,0 @@
1
- import { WalletClient } from '@cosmos-kit/core';
2
- export declare const wallets: (import("@cosmos-kit/keplr-extension").KeplrExtensionWallet | import("@cosmos-kit/cosmostation-extension").CosmostationExtensionWallet | import("@cosmos-kit/leap-extension").LeapExtensionWallet | import("@cosmos-kit/okxwallet-extension").OkxwalletExtensionWallet | import("@cosmos-kit/station-extension").StationExtensionWallet | import("@cosmos-kit/vectis-extension").VectisExtensionWallet)[];
3
- export type MergedWalletClient = import('@cosmos-kit/cosmostation-extension/cjs/extension/client').CosmostationClient | import('@cosmos-kit/keplr-extension/cjs/extension/client').KeplrClient | import('@cosmos-kit/leap-extension/cjs/extension/client').LeapClient | import('@cosmos-kit/okxwallet-extension/cjs/extension/client').OkxwalletClient | import('@cosmos-kit/station-extension/cjs/extension/client').StationClient | import('@cosmos-kit/vectis-extension/cjs/extension/client').VectisClient | WalletClient;
@@ -1,2 +0,0 @@
1
- import { QueryClient } from '@tanstack/react-query';
2
- export declare const queryClient: QueryClient;
@@ -1,2 +0,0 @@
1
- import { CoinbaseWalletAdapter, LedgerWalletAdapter, PhantomWalletAdapter, SolflareWalletAdapter, TrustWalletAdapter } from '@solana/wallet-adapter-wallets';
2
- export declare const solanaWallets: (PhantomWalletAdapter | SolflareWalletAdapter | CoinbaseWalletAdapter | TrustWalletAdapter | LedgerWalletAdapter)[];
@@ -1,66 +0,0 @@
1
- export declare const forma: {
2
- blockExplorers: {
3
- readonly default: {
4
- readonly name: "Forma Explorer";
5
- readonly url: "https://explorer.forma.art";
6
- };
7
- };
8
- contracts: {
9
- readonly multicall3: {
10
- readonly address: "0xd53C6FFB123F7349A32980F87faeD8FfDc9ef079";
11
- readonly blockCreated: 252705;
12
- };
13
- };
14
- id: 984122;
15
- name: "Forma";
16
- nativeCurrency: {
17
- readonly name: "TIA";
18
- readonly symbol: "TIA";
19
- readonly decimals: 18;
20
- };
21
- rpcUrls: {
22
- readonly default: {
23
- readonly http: readonly ["https://rpc.forma.art"];
24
- };
25
- };
26
- sourceId?: number | undefined;
27
- testnet: false;
28
- custom?: Record<string, unknown> | undefined;
29
- fees?: import("viem").ChainFees<undefined> | undefined;
30
- formatters?: undefined;
31
- serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
32
- };
33
- export declare const formaTestnet: {
34
- blockExplorers: {
35
- readonly default: {
36
- readonly name: "Forma Explorer";
37
- readonly url: "https://explorer.sketchpad-1.forma.art";
38
- };
39
- };
40
- contracts?: {
41
- [x: string]: import("viem").ChainContract | {
42
- [sourceId: number]: import("viem").ChainContract | undefined;
43
- } | undefined;
44
- ensRegistry?: import("viem").ChainContract | undefined;
45
- ensUniversalResolver?: import("viem").ChainContract | undefined;
46
- multicall3?: import("viem").ChainContract | undefined;
47
- } | undefined;
48
- id: 984123;
49
- name: "Forma Testnet";
50
- nativeCurrency: {
51
- readonly name: "TIA";
52
- readonly symbol: "TIA";
53
- readonly decimals: 18;
54
- };
55
- rpcUrls: {
56
- readonly default: {
57
- readonly http: readonly ["https://rpc.sketchpad-1.forma.art"];
58
- };
59
- };
60
- sourceId?: number | undefined;
61
- testnet: true;
62
- custom?: Record<string, unknown> | undefined;
63
- fees?: import("viem").ChainFees<undefined> | undefined;
64
- formatters?: undefined;
65
- serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
66
- };
@@ -1,2 +0,0 @@
1
- import { Config } from 'wagmi';
2
- export declare const config: Config;
@@ -1,16 +0,0 @@
1
- import { Asset } from '@skip-go/client';
2
- import { ReactNode } from 'react';
3
- interface AssetsContext {
4
- assets: Record<string, Asset[]>;
5
- assetsByChainID: (chainID?: string, filterDenoms?: string[]) => Asset[];
6
- getAsset(denom: string, chainID: string): Asset | undefined;
7
- getFeeAsset(chainID: string): Promise<Asset | undefined>;
8
- getNativeAssets(): Asset[];
9
- isReady: boolean;
10
- }
11
- export declare const AssetsContext: import("react").Context<AssetsContext>;
12
- export declare const AssetsProvider: ({ children }: {
13
- children: ReactNode;
14
- }) => import("react/jsx-runtime").JSX.Element;
15
- export declare function useAssets(): AssetsContext;
16
- export {};
@@ -1,29 +0,0 @@
1
- import React from 'react';
2
- import { ChainAffiliates, SkipClientOptions } from '@skip-go/client';
3
- import { DefaultRouteConfig } from '../hooks/use-swap-widget';
4
- import { RouteConfig } from '../hooks/use-route';
5
- import { MinimalWallet } from '../hooks/use-make-wallets';
6
- import { Config } from 'wagmi';
7
- interface WalletProviderProps {
8
- wagmiConfig?: Config;
9
- children: React.ReactNode;
10
- }
11
- export interface WidgetConfig {
12
- defaultRoute?: DefaultRouteConfig;
13
- routeConfig?: RouteConfig;
14
- }
15
- export interface SwapWidgetProviderProps extends SkipAPIProviderProps {
16
- wagmiConfig?: Config;
17
- children: React.ReactNode;
18
- }
19
- export interface SkipAPIProviderProps {
20
- children: React.ReactNode;
21
- endpointOptions?: SkipClientOptions['endpointOptions'];
22
- apiURL?: string;
23
- makeDestinationWallets?: (chainID: string) => MinimalWallet[];
24
- chainIDsToAffiliates?: Record<string, ChainAffiliates>;
25
- }
26
- export declare const WalletProvider: React.FC<WalletProviderProps>;
27
- export declare const SkipAPIProvider: React.FC<SkipAPIProviderProps>;
28
- export declare const SwapWidgetProvider: React.FC<SwapWidgetProviderProps>;
29
- export {};
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { ChainAffiliates, SkipClient, SkipClientOptions } from '@skip-go/client';
3
- import { MinimalWallet } from '../hooks/use-make-wallets';
4
- import { SkipAPIProviderProps } from './index';
5
- export declare const SkipContext: import("react").Context<{
6
- skipClient: SkipClient;
7
- apiURL?: string | undefined;
8
- endpointOptions?: SkipClientOptions['endpointOptions'];
9
- makeDestinationWallets?: ((chainID: string) => MinimalWallet[]) | undefined;
10
- chainIDsToAffiliates?: Record<string, ChainAffiliates> | undefined;
11
- } | undefined>;
12
- export declare function SkipProvider({ children, apiURL, endpointOptions, makeDestinationWallets, chainIDsToAffiliates, }: SkipAPIProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- interface CosmosProviderProps {
3
- children: React.ReactNode;
4
- }
5
- export declare const CosmosProvider: React.FC<CosmosProviderProps>;
6
- export {};
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { Config } from 'wagmi';
3
- interface EVMProviderProps {
4
- children: React.ReactNode;
5
- wagmiConfig?: Config;
6
- }
7
- export declare const EVMProvider: React.FC<EVMProviderProps>;
8
- export {};
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- interface SolanaProviderProps {
3
- children: React.ReactNode;
4
- }
5
- export declare const SolanaProvider: React.FC<SolanaProviderProps>;
6
- export {};
@@ -1,31 +0,0 @@
1
- type OnWalletConnected = {
2
- walletName: string;
3
- chainId: string;
4
- address?: string;
5
- };
6
- type OnWalletDisconnected = {
7
- chainType?: string;
8
- };
9
- type OnTransactionBroadcasted = {
10
- txHash: string;
11
- chainId: string;
12
- explorerLink: string;
13
- };
14
- type OnTransactionComplete = {
15
- txHash: string;
16
- chainId: string;
17
- explorerLink: string;
18
- };
19
- type OnTransactionFailed = {
20
- error: string;
21
- };
22
- export type CallbackStore = {
23
- onWalletConnected?: (props: OnWalletConnected) => void;
24
- onWalletDisconnected?: (props: OnWalletDisconnected) => void;
25
- onTransactionBroadcasted?: (props: OnTransactionBroadcasted) => void;
26
- onTransactionComplete?: (props: OnTransactionComplete) => void;
27
- onTransactionFailed?: (props: OnTransactionFailed) => void;
28
- };
29
- export declare const defaultValues: CallbackStore;
30
- export declare const useCallbackStore: import("zustand").UseBoundStore<import("zustand").StoreApi<CallbackStore>>;
31
- export {};