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

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 (125) hide show
  1. package/build/17.index.js +1 -0
  2. package/build/414.index.js +1 -0
  3. package/build/544.index.js +1 -0
  4. package/build/700.index.js +1 -0
  5. package/build/772.index.js +1 -0
  6. package/build/854.index.js +1 -0
  7. package/build/chains/index.d.ts +5 -0
  8. package/build/constants/abis.d.ts +61 -0
  9. package/build/constants/defaults.d.ts +5 -0
  10. package/build/constants/finality.d.ts +2 -0
  11. package/build/constants/gas.d.ts +3 -0
  12. package/build/constants/ledger-warning.d.ts +2 -0
  13. package/build/constants/swap-venues.d.ts +4 -0
  14. package/build/constants/wagmi.d.ts +2 -0
  15. package/build/hooks/use-account.d.ts +46 -0
  16. package/build/hooks/use-assets.d.ts +3 -0
  17. package/build/hooks/use-auto-set-address.d.ts +12 -0
  18. package/build/hooks/use-balances-by-chain.d.ts +16 -0
  19. package/build/hooks/use-bridges.d.ts +8 -0
  20. package/build/hooks/use-broadcasted-txs.d.ts +26 -0
  21. package/build/hooks/use-chains.d.ts +11 -0
  22. package/build/hooks/use-finality-time-estimate.d.ts +2 -0
  23. package/build/hooks/use-inject-fonts-to-document-head.d.ts +1 -0
  24. package/build/hooks/use-make-wallets.d.ts +26 -0
  25. package/build/hooks/use-route.d.ts +21 -0
  26. package/build/hooks/use-skip-client.d.ts +10 -0
  27. package/build/hooks/use-swap-widget.d.ts +81 -0
  28. package/build/hooks/use-usd-value.d.ts +9 -0
  29. package/build/index.d.ts +5 -0
  30. package/build/index.js +278 -0
  31. package/build/index.js.LICENSE.txt +166 -0
  32. package/build/lib/cosmos-kit.d.ts +3 -0
  33. package/build/lib/react-query.d.ts +2 -0
  34. package/build/lib/solana-adapter.d.ts +2 -0
  35. package/build/lib/viem/chains.d.ts +66 -0
  36. package/build/lib/wagmi.d.ts +2 -0
  37. package/build/provider/assets.d.ts +16 -0
  38. package/build/provider/index.d.ts +29 -0
  39. package/build/provider/skip-provider.d.ts +12 -0
  40. package/build/provider/wallet/cosmos.d.ts +6 -0
  41. package/build/provider/wallet/evm.d.ts +8 -0
  42. package/build/provider/wallet/solana.d.ts +6 -0
  43. package/build/store/callbacks.d.ts +31 -0
  44. package/build/store/disclosures.d.ts +44 -0
  45. package/build/store/settings.d.ts +17 -0
  46. package/build/store/swap-widget.d.ts +98 -0
  47. package/build/store/track-wallet.d.ts +24 -0
  48. package/build/store/tx-history.d.ts +36 -0
  49. package/build/styles/fonts.d.ts +1 -0
  50. package/build/ui/AdaptiveLink.d.ts +5 -0
  51. package/build/ui/AssetInput.d.ts +20 -0
  52. package/build/ui/AssetSelect/AssetSelectContent.d.ts +16 -0
  53. package/build/ui/AssetSelect/index.d.ts +11 -0
  54. package/build/ui/AssetValue.d.ts +7 -0
  55. package/build/ui/Button/HistoryButton.d.ts +2 -0
  56. package/build/ui/Button/SettingsButton.d.ts +2 -0
  57. package/build/ui/Button/ShareButton.d.ts +3 -0
  58. package/build/ui/ChainSelect/ChainSelectContent.d.ts +8 -0
  59. package/build/ui/ChainSelect/ChainSelectTrigger.d.ts +7 -0
  60. package/build/ui/ChainSelect/index.d.ts +9 -0
  61. package/build/ui/ChainSymbol.d.ts +5 -0
  62. package/build/ui/ConnectedWalletButton.d.ts +8 -0
  63. package/build/ui/ConversionRate.d.ts +22 -0
  64. package/build/ui/CraftedBySkip.d.ts +1 -0
  65. package/build/ui/Dialog/Dialog.d.ts +7 -0
  66. package/build/ui/Dialog/DialogContent.d.ts +7 -0
  67. package/build/ui/Dialog/DialogTrigger.d.ts +5 -0
  68. package/build/ui/Dialog/context.d.ts +7 -0
  69. package/build/ui/HistoryDialog/DescriptionList.d.ts +5 -0
  70. package/build/ui/HistoryDialog/HistoryClearButton.d.ts +4 -0
  71. package/build/ui/HistoryDialog/HistoryList.d.ts +14 -0
  72. package/build/ui/HistoryDialog/RenderDate.d.ts +5 -0
  73. package/build/ui/HistoryDialog/SyncState.d.ts +4 -0
  74. package/build/ui/HistoryDialog/index.d.ts +1 -0
  75. package/build/ui/Icon/ExpandArrow.d.ts +2 -0
  76. package/build/ui/Icon/GearIcon.d.ts +1 -0
  77. package/build/ui/Icon/HistoryIcon.d.ts +2 -0
  78. package/build/ui/Icon/ShareIcon.d.ts +1 -0
  79. package/build/ui/Icon/SkipLogo.d.ts +2 -0
  80. package/build/ui/Icon/SpinnerIcon.d.ts +2 -0
  81. package/build/ui/JsonDialog.d.ts +1 -0
  82. package/build/ui/PreviewRoute/AlertCollapse.d.ts +13 -0
  83. package/build/ui/PreviewRoute/ChainStep.d.ts +30 -0
  84. package/build/ui/PreviewRoute/SetAddressDialog.d.ts +12 -0
  85. package/build/ui/PreviewRoute/index.d.ts +25 -0
  86. package/build/ui/PreviewRoute/make-actions.d.ts +29 -0
  87. package/build/ui/PreviewRoute/make-chain-ids-with-actions.d.ts +11 -0
  88. package/build/ui/PreviewRoute/make-step-state.d.ts +17 -0
  89. package/build/ui/PreviewRoute/types.d.ts +21 -0
  90. package/build/ui/PriceImpactWarning.d.ts +7 -0
  91. package/build/ui/SettingsDialog/GasSetting.d.ts +1 -0
  92. package/build/ui/SettingsDialog/PurgeSetting.d.ts +1 -0
  93. package/build/ui/SettingsDialog/SaveIndicator.d.ts +1 -0
  94. package/build/ui/SettingsDialog/SlippageSetting.d.ts +1 -0
  95. package/build/ui/SettingsDialog/index.d.ts +1 -0
  96. package/build/ui/SimpleTooltip.d.ts +11 -0
  97. package/build/ui/StyledComponents/Buttons.d.ts +3 -0
  98. package/build/ui/StyledComponents/Input.d.ts +2 -0
  99. package/build/ui/StyledComponents/Theme.d.ts +8 -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/PraxWalletIndex.d.ts +4 -0
  104. package/build/ui/WalletModal/WalletListItem.d.ts +9 -0
  105. package/build/ui/WalletModal/WalletModal.d.ts +10 -0
  106. package/build/ui/WalletModal/context.d.ts +13 -0
  107. package/build/ui/WalletModal/index.d.ts +3 -0
  108. package/build/ui/Widget.d.ts +6 -0
  109. package/build/ui/WithStyledShadowDom.d.ts +4 -0
  110. package/build/ui/index.d.ts +12 -0
  111. package/build/ui/theme.d.ts +20 -0
  112. package/build/utils/assert.d.ts +2 -0
  113. package/build/utils/clients.d.ts +4 -0
  114. package/build/utils/error.d.ts +1 -0
  115. package/build/utils/intl.d.ts +4 -0
  116. package/build/utils/ledger-warning.d.ts +3 -0
  117. package/build/utils/link.d.ts +4 -0
  118. package/build/utils/number.d.ts +4 -0
  119. package/build/utils/os.d.ts +3 -0
  120. package/build/utils/random.d.ts +1 -0
  121. package/build/utils/ui.d.ts +2 -0
  122. package/build/utils/usd.d.ts +5 -0
  123. package/build/utils/wallet.d.ts +7 -0
  124. package/build/web-component.d.ts +15 -0
  125. package/package.json +8 -90
@@ -0,0 +1,166 @@
1
+ /*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
5
+ * @license MIT
6
+ */
7
+
8
+ /*!
9
+ * The buffer module from node.js, for the browser.
10
+ *
11
+ * @author Feross Aboukhadijeh <https://feross.org>
12
+ * @license MIT
13
+ */
14
+
15
+ /*!
16
+ * tabbable 6.2.0
17
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
18
+ */
19
+
20
+ /*! *****************************************************************************
21
+ Copyright (c) Microsoft Corporation.
22
+
23
+ Permission to use, copy, modify, and/or distribute this software for any
24
+ purpose with or without fee is hereby granted.
25
+
26
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
27
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
28
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
29
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
30
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
31
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
32
+ PERFORMANCE OF THIS SOFTWARE.
33
+ ***************************************************************************** */
34
+
35
+ /*! @license MediaQueryParser - MIT License - Tom Golden (github@tbjgolden.com) */
36
+
37
+ /*! https://mths.be/cssesc v3.0.0 by @mathias */
38
+
39
+ /*! https://mths.be/punycode v1.4.1 by @mathias */
40
+
41
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
42
+
43
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
44
+
45
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
46
+
47
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
48
+
49
+ /**
50
+ * @license
51
+ * Copyright 2009 The Closure Library Authors
52
+ * Copyright 2020 Daniel Wirtz / The long.js Authors.
53
+ *
54
+ * Licensed under the Apache License, Version 2.0 (the "License");
55
+ * you may not use this file except in compliance with the License.
56
+ * You may obtain a copy of the License at
57
+ *
58
+ * http://www.apache.org/licenses/LICENSE-2.0
59
+ *
60
+ * Unless required by applicable law or agreed to in writing, software
61
+ * distributed under the License is distributed on an "AS IS" BASIS,
62
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
63
+ * See the License for the specific language governing permissions and
64
+ * limitations under the License.
65
+ *
66
+ * SPDX-License-Identifier: Apache-2.0
67
+ */
68
+
69
+ /**
70
+ * @license QR Code generator library (TypeScript)
71
+ * Copyright (c) Project Nayuki.
72
+ * SPDX-License-Identifier: MIT
73
+ */
74
+
75
+ /**
76
+ * @license React
77
+ * react-dom.production.min.js
78
+ *
79
+ * Copyright (c) Facebook, Inc. and its affiliates.
80
+ *
81
+ * This source code is licensed under the MIT license found in the
82
+ * LICENSE file in the root directory of this source tree.
83
+ */
84
+
85
+ /**
86
+ * @license React
87
+ * react-jsx-runtime.production.min.js
88
+ *
89
+ * Copyright (c) Facebook, Inc. and its affiliates.
90
+ *
91
+ * This source code is licensed under the MIT license found in the
92
+ * LICENSE file in the root directory of this source tree.
93
+ */
94
+
95
+ /**
96
+ * @license React
97
+ * react.production.min.js
98
+ *
99
+ * Copyright (c) Facebook, Inc. and its affiliates.
100
+ *
101
+ * This source code is licensed under the MIT license found in the
102
+ * LICENSE file in the root directory of this source tree.
103
+ */
104
+
105
+ /**
106
+ * @license React
107
+ * scheduler.production.min.js
108
+ *
109
+ * Copyright (c) Facebook, Inc. and its affiliates.
110
+ *
111
+ * This source code is licensed under the MIT license found in the
112
+ * LICENSE file in the root directory of this source tree.
113
+ */
114
+
115
+ /**
116
+ * @license React
117
+ * use-sync-external-store-shim.production.min.js
118
+ *
119
+ * Copyright (c) Facebook, Inc. and its affiliates.
120
+ *
121
+ * This source code is licensed under the MIT license found in the
122
+ * LICENSE file in the root directory of this source tree.
123
+ */
124
+
125
+ /**
126
+ * @license React
127
+ * use-sync-external-store-shim/with-selector.production.min.js
128
+ *
129
+ * Copyright (c) Facebook, Inc. and its affiliates.
130
+ *
131
+ * This source code is licensed under the MIT license found in the
132
+ * LICENSE file in the root directory of this source tree.
133
+ */
134
+
135
+ /**
136
+ * @name match-sorter
137
+ * @license MIT license.
138
+ * @copyright (c) 2020 Kent C. Dodds
139
+ * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
140
+ */
141
+
142
+ /**
143
+ * [js-sha3]{@link https://github.com/emn178/js-sha3}
144
+ *
145
+ * @version 0.8.0
146
+ * @author Chen, Yi-Cyuan [emn178@gmail.com]
147
+ * @copyright Chen, Yi-Cyuan 2015-2018
148
+ * @license MIT
149
+ */
150
+
151
+ /** @preserve
152
+ * Counter block mode compatible with Dr Brian Gladman fileenc.c
153
+ * derived from CryptoJS.mode.CTR
154
+ * Jan Hruby jhruby.web@gmail.com
155
+ */
156
+
157
+ /** @preserve
158
+ (c) 2012 by Cédric Mesnil. All rights reserved.
159
+
160
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
161
+
162
+ - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
163
+ - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
164
+
165
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
166
+ */
@@ -0,0 +1,3 @@
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;
@@ -0,0 +1,2 @@
1
+ import { QueryClient } from '@tanstack/react-query';
2
+ export declare const queryClient: QueryClient;
@@ -0,0 +1,2 @@
1
+ import { CoinbaseWalletAdapter, LedgerWalletAdapter, PhantomWalletAdapter, SolflareWalletAdapter, TrustWalletAdapter } from '@solana/wallet-adapter-wallets';
2
+ export declare const solanaWallets: (PhantomWalletAdapter | SolflareWalletAdapter | CoinbaseWalletAdapter | TrustWalletAdapter | LedgerWalletAdapter)[];
@@ -0,0 +1,66 @@
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
+ };
@@ -0,0 +1,2 @@
1
+ import { Config } from 'wagmi';
2
+ export declare const config: Config;
@@ -0,0 +1,16 @@
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 {};
@@ -0,0 +1,29 @@
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 {};
@@ -0,0 +1,12 @@
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;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface CosmosProviderProps {
3
+ children: React.ReactNode;
4
+ }
5
+ export declare const CosmosProvider: React.FC<CosmosProviderProps>;
6
+ export {};
@@ -0,0 +1,8 @@
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 {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface SolanaProviderProps {
3
+ children: React.ReactNode;
4
+ }
5
+ export declare const SolanaProvider: React.FC<SolanaProviderProps>;
6
+ export {};
@@ -0,0 +1,31 @@
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 {};
@@ -0,0 +1,44 @@
1
+ declare const defaultValues: {
2
+ confirmSwapDialog: boolean;
3
+ historyDialog: boolean;
4
+ priceImpactDialog: boolean;
5
+ settingsDialog: boolean;
6
+ destinationDialog: boolean;
7
+ embedDialog: boolean;
8
+ };
9
+ export type DisclosureStore = typeof defaultValues & {
10
+ json?: {
11
+ title?: string;
12
+ data: unknown;
13
+ };
14
+ };
15
+ export type DisclosureKey = keyof typeof defaultValues;
16
+ export declare const disclosure: {
17
+ open: (key: DisclosureKey, { closeAll }?: {
18
+ closeAll?: boolean | undefined;
19
+ }) => void;
20
+ openJson: (json: NonNullable<DisclosureStore["json"]>) => void;
21
+ close: (key: DisclosureKey) => void;
22
+ closeJson: () => void;
23
+ toggle: (key: DisclosureKey) => void;
24
+ set: (key: DisclosureKey, value: boolean) => void;
25
+ closeAll: () => void;
26
+ rehydrate: () => void | Promise<void>;
27
+ };
28
+ export declare function useDisclosureKey(key: DisclosureKey): readonly [boolean, {
29
+ open: ({ closeAll }?: {
30
+ closeAll?: boolean | undefined;
31
+ }) => void;
32
+ close: () => void;
33
+ toggle: () => void;
34
+ set: (value: boolean) => void;
35
+ }];
36
+ export declare function useJsonDisclosure(): readonly [{
37
+ title?: string | undefined;
38
+ data: unknown;
39
+ } | undefined, {
40
+ open: (json: NonNullable<DisclosureStore["json"]>) => void;
41
+ close: () => void;
42
+ }];
43
+ export declare function useAnyDisclosureOpen(): boolean;
44
+ export {};
@@ -0,0 +1,17 @@
1
+ interface SettingsStore {
2
+ customGasAmount: string;
3
+ slippage: string;
4
+ }
5
+ export declare const defaultValues: SettingsStore;
6
+ export declare const useSettingsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SettingsStore>, "persist"> & {
7
+ persist: {
8
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<SettingsStore, SettingsStore>>) => void;
9
+ clearStorage: () => void;
10
+ rehydrate: () => void | Promise<void>;
11
+ hasHydrated: () => boolean;
12
+ onHydrate: (fn: (state: SettingsStore) => void) => () => void;
13
+ onFinishHydration: (fn: (state: SettingsStore) => void) => () => void;
14
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<SettingsStore, SettingsStore>>;
15
+ };
16
+ }>;
17
+ export {};
@@ -0,0 +1,98 @@
1
+ import { DefaultRouteConfig } from '../hooks/use-swap-widget';
2
+ import { RouteConfig } from '../hooks/use-route';
3
+ import { PersistOptions } from 'zustand/middleware';
4
+ interface SwapWidgetStore {
5
+ onlyTestnet?: boolean;
6
+ defaultRoute?: DefaultRouteConfig;
7
+ routeConfig?: RouteConfig;
8
+ /**
9
+ * Filter chains and assets in selection
10
+ *
11
+ * Record<chainID, assetDenoms>
12
+ * if assetDenoms is undefined, all assets are allowed
13
+ * @example
14
+ * ```ts
15
+ * {
16
+ * source: {
17
+ * 'noble-1': undefined,
18
+ * },
19
+ * destination: {
20
+ * 'cosmoshub-4': [
21
+ * 'uatom',
22
+ * 'ibc/2181AAB0218EAC24BC9F86BD1364FBBFA3E6E3FCC25E88E3E68C15DC6E752D86',
23
+ * ],
24
+ * 'agoric-3': [
25
+ * 'ibc/FE98AAD68F02F03565E9FA39A5E627946699B2B07115889ED812D8BA639576A9',
26
+ * ],
27
+ * 'osmosis-1': undefined,
28
+ * }
29
+ * ```
30
+ */
31
+ filter?: {
32
+ source?: Record<string, string[] | undefined>;
33
+ destination?: Record<string, string[] | undefined>;
34
+ };
35
+ }
36
+ export declare const swapWidgetDefaultValues: SwapWidgetStore;
37
+ export declare const useSwapWidgetUIStore: import("zustand").UseBoundStore<Omit<Omit<import("zustand").StoreApi<SwapWidgetStore>, "subscribe"> & {
38
+ subscribe: {
39
+ (listener: (selectedState: SwapWidgetStore, previousSelectedState: SwapWidgetStore) => void): () => void;
40
+ <U>(selector: (state: SwapWidgetStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
41
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
42
+ fireImmediately?: boolean | undefined;
43
+ } | undefined): () => void;
44
+ };
45
+ }, "persist"> & {
46
+ persist: {
47
+ setOptions: (options: Partial<PersistOptions<SwapWidgetStore, Pick<SwapWidgetStore, "defaultRoute">>>) => void;
48
+ clearStorage: () => void;
49
+ rehydrate: () => void | Promise<void>;
50
+ hasHydrated: () => boolean;
51
+ onHydrate: (fn: (state: SwapWidgetStore) => void) => () => void;
52
+ onFinishHydration: (fn: (state: SwapWidgetStore) => void) => () => void;
53
+ getOptions: () => Partial<PersistOptions<SwapWidgetStore, Pick<SwapWidgetStore, "defaultRoute">>>;
54
+ };
55
+ }>;
56
+ export interface ConfigureSwapWidgetArgs {
57
+ settings?: {
58
+ /**
59
+ * gas amount for validation
60
+ * @default 200_000
61
+ */
62
+ customGasAmount?: number;
63
+ /**
64
+ * percentage of slippage 0-100
65
+ * @default 3
66
+ */
67
+ slippage?: number;
68
+ };
69
+ onlyTestnet?: boolean;
70
+ defaultRoute?: DefaultRouteConfig;
71
+ routeConfig?: RouteConfig;
72
+ /**
73
+ * Filter chains and assets in selection
74
+ *
75
+ * Record<chainID, assetDenoms>
76
+ * if assetDenoms is undefined, all assets are allowed
77
+ * @example
78
+ * ```ts
79
+ * {
80
+ * source: {
81
+ * 'noble-1': undefined,
82
+ * },
83
+ * destination: {
84
+ * 'cosmoshub-4': [
85
+ * 'uatom',
86
+ * 'ibc/2181AAB0218EAC24BC9F86BD1364FBBFA3E6E3FCC25E88E3E68C15DC6E752D86',
87
+ * ],
88
+ * 'agoric-3': [
89
+ * 'ibc/FE98AAD68F02F03565E9FA39A5E627946699B2B07115889ED812D8BA639576A9',
90
+ * ],
91
+ * 'osmosis-1': undefined,
92
+ * }
93
+ * ```
94
+ */
95
+ filter?: SwapWidgetStore['filter'];
96
+ }
97
+ export declare const configureSwapWidget: (args: ConfigureSwapWidgetArgs) => void;
98
+ export {};
@@ -0,0 +1,24 @@
1
+ export type TrackWalletCtx = 'evm' | 'cosmos' | 'svm';
2
+ interface WalletState {
3
+ walletName: string;
4
+ chainType: string;
5
+ }
6
+ interface TrackWalletStore {
7
+ evm?: WalletState;
8
+ cosmos?: WalletState;
9
+ svm?: WalletState;
10
+ }
11
+ export declare const trackWallet: {
12
+ track: (ctx: TrackWalletCtx, walletName: string, chainType: string) => void;
13
+ untrack: (ctx: TrackWalletCtx) => void;
14
+ get: () => TrackWalletStore;
15
+ subscribe: {
16
+ (listener: (selectedState: TrackWalletStore, previousSelectedState: TrackWalletStore) => void): () => void;
17
+ <U>(selector: (state: TrackWalletStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
18
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
19
+ fireImmediately?: boolean | undefined;
20
+ } | undefined): () => void;
21
+ };
22
+ };
23
+ export declare function useTrackWallet(ctx?: TrackWalletCtx): WalletState | undefined;
24
+ export {};
@@ -0,0 +1,36 @@
1
+ import { RouteResponse } from '@skip-go/client';
2
+ export interface TxStatus {
3
+ chainId: string;
4
+ txHash: string;
5
+ explorerLink: string;
6
+ axelarscanLink?: string;
7
+ }
8
+ export interface TxHistoryItem {
9
+ route: RouteResponse;
10
+ txStatus: TxStatus[];
11
+ timestamp: string;
12
+ status: 'pending' | 'success' | 'failed';
13
+ }
14
+ export type TxHistoryItemInput = Pick<TxHistoryItem, 'route'>;
15
+ export type TxHistoryState = Record<string, TxHistoryItem>;
16
+ export declare const useTxHistory: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<TxHistoryState>, "persist"> & {
17
+ persist: {
18
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<TxHistoryState, TxHistoryState>>) => void;
19
+ clearStorage: () => void;
20
+ rehydrate: () => void | Promise<void>;
21
+ hasHydrated: () => boolean;
22
+ onHydrate: (fn: (state: TxHistoryState) => void) => () => void;
23
+ onFinishHydration: (fn: (state: TxHistoryState) => void) => () => void;
24
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<TxHistoryState, TxHistoryState>>;
25
+ };
26
+ }>;
27
+ export declare const txHistory: {
28
+ add: (input: TxHistoryItemInput) => readonly [string, TxHistoryItem];
29
+ update: (id: string, input: Partial<TxHistoryItem>) => void;
30
+ success: (id: string) => void;
31
+ fail: (id: string) => void;
32
+ remove: (id: string) => void;
33
+ addStatus: (id: string, route: RouteResponse, txStatus: TxStatus) => void;
34
+ updateStatus: (id: string, txStatus: TxStatus) => void;
35
+ clear: () => void;
36
+ };
@@ -0,0 +1 @@
1
+ export declare const fonts: string;
@@ -0,0 +1,5 @@
1
+ import { ComponentPropsWithoutRef } from "react";
2
+ export type AdaptiveLinkProps = ComponentPropsWithoutRef<"a"> & {
3
+ isExternal?: boolean;
4
+ };
5
+ export declare function AdaptiveLink({ href, isExternal, rel, target, ...props }: AdaptiveLinkProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { Asset } from '@skip-go/client';
2
+ import { MouseEventHandler } from 'react';
3
+ import { Chain } from '../hooks/use-chains';
4
+ interface Props {
5
+ amount: string;
6
+ amountUSD?: string;
7
+ diffPercentage?: number;
8
+ onAmountChange?: (amount: string) => void;
9
+ onAmountMax?: MouseEventHandler<HTMLButtonElement>;
10
+ asset?: Asset;
11
+ onAssetChange?: (asset: Asset) => void;
12
+ chain?: Chain;
13
+ onChainChange?: (chain: Chain) => void;
14
+ chains: Chain[];
15
+ context: 'source' | 'destination';
16
+ isError?: string | boolean;
17
+ isLoading?: boolean;
18
+ }
19
+ declare function AssetInput({ amount, amountUSD, diffPercentage, onAmountChange, onAmountMax, asset, onAssetChange, chain, chains, onChainChange, context, isError, isLoading, }: Props): import("react/jsx-runtime").JSX.Element;
20
+ export default AssetInput;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import * as ScrollArea from '@radix-ui/react-scroll-area';
3
+ import { Asset } from '@skip-go/client';
4
+ interface Props {
5
+ assets?: Asset[];
6
+ balances: Record<string, string>;
7
+ onChange?: (asset: Asset) => void;
8
+ onClose: () => void;
9
+ showChainInfo?: boolean;
10
+ isBalancesLoading?: boolean;
11
+ }
12
+ declare function AssetSelectContent({ assets, balances, onChange, onClose, showChainInfo, isBalancesLoading, }: Props): import("react/jsx-runtime").JSX.Element;
13
+ export default AssetSelectContent;
14
+ export declare const StyledScrollAreaRoot: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<ScrollArea.ScrollAreaProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
15
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
16
+ }, never>> & string & Omit<import("react").ForwardRefExoticComponent<ScrollArea.ScrollAreaProps & import("react").RefAttributes<HTMLDivElement>>, keyof import("react").Component<any, {}, any>>;
@@ -0,0 +1,11 @@
1
+ import { Asset } from '@skip-go/client';
2
+ interface Props {
3
+ asset?: Asset;
4
+ assets?: Asset[];
5
+ balances?: Record<string, string>;
6
+ onChange?: (asset: Asset) => void;
7
+ showChainInfo?: boolean;
8
+ isBalancesLoading?: boolean;
9
+ }
10
+ declare function AssetSelect({ asset, assets, balances, onChange, showChainInfo, isBalancesLoading, }: Props): import("react/jsx-runtime").JSX.Element;
11
+ export default AssetSelect;
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ chainId: string;
3
+ denom: string;
4
+ value: string;
5
+ }
6
+ export declare function AssetValue({ chainId, denom, value }: Props): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ComponentProps } from 'react';
2
+ export declare const HistoryButton: ({ className, ...props }: ComponentProps<'button'>) => import("react/jsx-runtime").JSX.Element;