@dodoex/widgets 2.6.12-beta.6 → 2.6.12-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/src/components/Swap/index.d.ts +2 -1
- package/dist/cjs/src/components/Widget/BridgeTonSummaryDialog/index.d.ts +11 -0
- package/dist/cjs/src/hooks/Bridge/useFetchRoutePriceBridge.d.ts +3 -1
- package/dist/cjs/src/hooks/ConnectWallet/useWalletState.d.ts +1 -1
- package/dist/cjs/src/hooks/Swap/useFetchFiatPrice.d.ts +1 -1
- package/dist/cjs/src/hooks/contract/layerswap/data.d.ts +4 -2
- package/dist/cjs/src/hooks/contract/layerswap/useLayerswapRouters.d.ts +3 -3
- package/dist/cjs/src/index.d.ts +2 -0
- package/dist/cjs/src/utils/device.d.ts +3 -0
- package/dist/index.js +4 -4
- package/dist/src/components/Swap/index.d.ts +2 -1
- package/dist/src/components/Widget/BridgeTonSummaryDialog/index.d.ts +11 -0
- package/dist/src/hooks/Bridge/useFetchRoutePriceBridge.d.ts +3 -1
- package/dist/src/hooks/ConnectWallet/useWalletState.d.ts +1 -1
- package/dist/src/hooks/Swap/useFetchFiatPrice.d.ts +1 -1
- package/dist/src/hooks/contract/layerswap/data.d.ts +4 -2
- package/dist/src/hooks/contract/layerswap/useLayerswapRouters.d.ts +3 -3
- package/dist/src/index.d.ts +2 -0
- package/dist/src/utils/device.d.ts +3 -0
- package/package.json +1 -1
|
@@ -5,5 +5,6 @@ export interface SwapProps {
|
|
|
5
5
|
/** Higher priority setting slippage */
|
|
6
6
|
getAutoSlippage?: GetAutoSlippage;
|
|
7
7
|
onConnectWalletClick?: ConnectWalletProps['onConnectWalletClick'];
|
|
8
|
+
bridgeToTonUrl?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare function Swap({ getAutoSlippage, onConnectWalletClick, }?: SwapProps): JSX.Element;
|
|
10
|
+
export declare function Swap({ getAutoSlippage, onConnectWalletClick, bridgeToTonUrl, }?: SwapProps): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export default function BridgeTonSummaryDialog({ tonAccount, fromTokenAddress, fromChainId, toTokenAddress, toChainId, fromAmt, slippage, redirectLink, }: {
|
|
3
|
+
tonAccount: string;
|
|
4
|
+
fromTokenAddress: string;
|
|
5
|
+
fromChainId: number;
|
|
6
|
+
toTokenAddress: string;
|
|
7
|
+
toChainId: number;
|
|
8
|
+
fromAmt: string;
|
|
9
|
+
slippage?: number;
|
|
10
|
+
redirectLink: string;
|
|
11
|
+
}): JSX.Element;
|
|
@@ -107,8 +107,10 @@ export interface FetchRoutePrice {
|
|
|
107
107
|
toToken: TokenInfo | null;
|
|
108
108
|
fromAmount: string;
|
|
109
109
|
fromFiatPrice: string;
|
|
110
|
+
fromAddress?: string;
|
|
111
|
+
toAddress?: string;
|
|
110
112
|
}
|
|
111
|
-
export declare function useFetchRoutePriceBridge({ toToken, fromToken, fromAmount, fromFiatPrice, }: FetchRoutePrice): {
|
|
113
|
+
export declare function useFetchRoutePriceBridge({ toToken, fromToken, fromAmount, fromFiatPrice, fromAddress: fromAddressProps, toAddress: toAddressProps, }: FetchRoutePrice): {
|
|
112
114
|
status: RoutePriceStatus;
|
|
113
115
|
refetch: () => Promise<void>;
|
|
114
116
|
bridgeRouteList: BridgeRouteI[];
|
|
@@ -23,6 +23,6 @@ export declare function useWalletState({ isTon, }?: {
|
|
|
23
23
|
autoConnect: (chainId?: number) => Promise<void>;
|
|
24
24
|
connect: () => void | Promise<void>;
|
|
25
25
|
provider: import("@ethersproject/providers").Web3Provider | undefined;
|
|
26
|
-
getLastBlockNumber: (
|
|
26
|
+
getLastBlockNumber: () => Promise<number | undefined>;
|
|
27
27
|
getBalance: ((account: string) => Promise<BigNumber | undefined>) | undefined;
|
|
28
28
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Web3Provider } from '@ethersproject/providers';
|
|
1
2
|
import { TokenInfo } from '../../Token';
|
|
2
3
|
import { Network, Quote } from './types';
|
|
3
4
|
export declare function getLayerSwapData<T>(url: string): Promise<T>;
|
|
@@ -24,7 +25,7 @@ export declare function getQuote({ fromToken, toToken, fromNetworkName, toNetwor
|
|
|
24
25
|
/**
|
|
25
26
|
* @see https://github.com/layerswap/layerswapapp/blob/dev/components/Swap/Withdraw/Wallet/TonWalletWithdraw.tsx
|
|
26
27
|
*/
|
|
27
|
-
export declare function submitTonWalletWithdraw({ fromAddress, toAddress, fromToken, toToken, fromNetworkName, toNetworkName, fromAmount, slippage, params, }: {
|
|
28
|
+
export declare function submitTonWalletWithdraw({ fromAddress, toAddress, fromToken, toToken, fromNetworkName, toNetworkName, fromAmount, slippage, provider, params, }: {
|
|
28
29
|
fromAddress: string | undefined;
|
|
29
30
|
toAddress: string | undefined;
|
|
30
31
|
fromToken: TokenInfo | null;
|
|
@@ -33,9 +34,10 @@ export declare function submitTonWalletWithdraw({ fromAddress, toAddress, fromTo
|
|
|
33
34
|
toNetworkName: string | undefined | null;
|
|
34
35
|
fromAmount: string;
|
|
35
36
|
slippage?: number;
|
|
37
|
+
provider?: Web3Provider;
|
|
36
38
|
params: {
|
|
37
39
|
onSubmit?: (tx: string, reportInfo?: Record<string, any>) => void;
|
|
38
40
|
onSuccess?: (tx: string, reportInfo?: Record<string, any>) => Promise<void>;
|
|
39
41
|
onError?: (e: any) => void;
|
|
40
42
|
};
|
|
41
|
-
}): Promise<import("ton").Transaction | null | undefined>;
|
|
43
|
+
}): Promise<import("ton").Transaction | import("@ethersproject/abstract-provider").TransactionReceipt | null | undefined>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BridgeRouteI, RoutePriceStatus } from '../../Bridge/useFetchRoutePriceBridge';
|
|
2
2
|
import { TokenInfo } from '../../Token';
|
|
3
|
-
export declare function useLayerswapRouters({ skip, data: { fromToken, toToken, fromAmount,
|
|
3
|
+
export declare function useLayerswapRouters({ skip, data: { fromToken, toToken, fromAmount, fromAddress, toAddress, slippage }, }: {
|
|
4
4
|
skip?: boolean;
|
|
5
5
|
data: {
|
|
6
6
|
fromToken: TokenInfo | null;
|
|
7
7
|
toToken: TokenInfo | null;
|
|
8
8
|
fromAmount: string;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
fromAddress: string | undefined;
|
|
10
|
+
toAddress: string | undefined;
|
|
11
11
|
slippage?: number;
|
|
12
12
|
};
|
|
13
13
|
}): {
|
package/dist/cjs/src/index.d.ts
CHANGED
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
import { WidgetProps } from './components/Widget';
|
|
3
3
|
export declare type SwapWidgetProps = WidgetProps;
|
|
4
4
|
export type { TokenInfo } from './hooks/Token/type';
|
|
5
|
+
export { default as BridgeTonSummaryDialog } from './components/Widget/BridgeTonSummaryDialog';
|
|
6
|
+
export { Widget } from './components/Widget';
|
|
5
7
|
export declare function SwapWidget(props: SwapWidgetProps): JSX.Element;
|
|
6
8
|
export declare function InitSwapWidget(props: SwapWidgetProps): void;
|