@dodoex/widgets 2.6.12-beta.0 → 2.6.12-beta.3
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/8de9a184d4ef0a11.svg +6 -0
- package/dist/cjs/8de9a184d4ef0a11.svg +6 -0
- package/dist/cjs/components/Confirm.d.ts +3 -2
- package/dist/cjs/components/ConnectWallet/NeedConnectButton.d.ts +1 -3
- package/dist/cjs/components/Swap/components/Dialog.d.ts +1 -0
- package/dist/cjs/components/Swap/components/TokenCard/TokenLogoCollapse.d.ts +2 -1
- package/dist/cjs/components/Swap/components/TokenCard/index.d.ts +2 -2
- package/dist/cjs/components/Swap/index.d.ts +4 -1
- package/dist/cjs/components/TokenLogo.d.ts +3 -1
- package/dist/cjs/constants/chains.d.ts +1 -0
- package/dist/cjs/{helper-Cto9FLzX.cjs → helper-AUp7J6va.cjs} +1 -1
- package/dist/cjs/hooks/Submission/types.d.ts +2 -0
- package/dist/cjs/hooks/Submission/useExecution.d.ts +2 -1
- package/dist/cjs/hooks/Swap/useExecuteSwap.d.ts +2 -1
- package/dist/cjs/{index-LuoRf91r.cjs → index-BKylx06q.cjs} +1 -1
- package/dist/cjs/{index-BprhI-s9.cjs → index-BVjmGGMM.cjs} +1 -1
- package/dist/cjs/index-CVLls_ja.cjs +53 -0
- package/dist/cjs/index.cjs +7 -7
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/locales/en-US.js +1 -1
- package/dist/cjs/locales/zh-CN.js +1 -1
- package/dist/cjs/{lottie-Cw1tUn46.cjs → lottie-DHOGwVb_.cjs} +1 -1
- package/dist/cjs/providers/GlobalConfigContext.d.ts +6 -2
- package/dist/cjs/src/components/Bridge/BridgeSummaryDialog/index.d.ts +1 -1
- package/dist/cjs/src/components/Bridge/SelectBridgeDialog/RouteCard.d.ts +2 -2
- package/dist/cjs/src/components/Swap/components/ConnectWallet/index.d.ts +2 -1
- package/dist/cjs/src/components/Widget/index.d.ts +3 -0
- package/dist/cjs/src/constants/chains.d.ts +1 -2
- package/dist/cjs/src/constants/tokenList.d.ts +11 -2
- package/dist/cjs/src/hooks/Bridge/createBridgeOrder.d.ts +1 -1
- package/dist/cjs/src/hooks/Bridge/useFetchRoutePriceBridge.d.ts +17 -6
- package/dist/cjs/src/hooks/ConnectWallet/TonConnect/index.d.ts +26 -0
- package/dist/cjs/src/hooks/ConnectWallet/useWalletState.d.ts +24 -0
- package/dist/cjs/src/hooks/Token/type.d.ts +1 -0
- package/dist/cjs/src/hooks/Token/useInitTokenList.d.ts +3 -1
- package/dist/cjs/src/hooks/Widget/useInitPropsToRedux.d.ts +1 -1
- package/dist/cjs/src/hooks/contract/abis/OrbiterV3ABI.d.ts +85 -0
- package/dist/cjs/src/hooks/contract/orbiter/constants.d.ts +3 -0
- package/dist/cjs/src/hooks/contract/orbiter/encodeOrbiterBridge.d.ts +12 -0
- package/dist/cjs/src/hooks/contract/orbiter/useOrbiterContractMap.d.ts +5 -0
- package/dist/cjs/src/hooks/contract/orbiter/useOrbiterRouters.d.ts +21 -0
- package/dist/cjs/src/hooks/contract/useFetchTokens.d.ts +1 -2
- package/dist/components/Confirm.d.ts +3 -2
- package/dist/components/ConnectWallet/NeedConnectButton.d.ts +1 -3
- package/dist/components/Swap/components/Dialog.d.ts +1 -0
- package/dist/components/Swap/components/TokenCard/TokenLogoCollapse.d.ts +2 -1
- package/dist/components/Swap/components/TokenCard/index.d.ts +2 -2
- package/dist/components/Swap/index.d.ts +4 -1
- package/dist/components/TokenLogo.d.ts +3 -1
- package/dist/constants/chains.d.ts +1 -0
- package/dist/{helper-ClCEnCKq.js → helper-CPPmdUet.js} +1 -1
- package/dist/hooks/Submission/types.d.ts +2 -0
- package/dist/hooks/Submission/useExecution.d.ts +2 -1
- package/dist/hooks/Swap/useExecuteSwap.d.ts +2 -1
- package/dist/index-C-UlcYP8.js +53 -0
- package/dist/{index-namICBzO.js → index-C4JHklNK.js} +1 -1
- package/dist/{index-B3zF3CfE.js → index-QEEiFrZ2.js} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -7
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/{lottie-Cs4m17_U.js → lottie-CddNDjvd.js} +1 -1
- package/dist/providers/GlobalConfigContext.d.ts +6 -2
- package/dist/src/components/Bridge/BridgeSummaryDialog/index.d.ts +1 -1
- package/dist/src/components/Bridge/SelectBridgeDialog/RouteCard.d.ts +2 -2
- package/dist/src/components/Swap/components/ConnectWallet/index.d.ts +2 -1
- package/dist/src/components/Widget/index.d.ts +3 -0
- package/dist/src/constants/chains.d.ts +1 -2
- package/dist/src/constants/tokenList.d.ts +11 -2
- package/dist/src/hooks/Bridge/createBridgeOrder.d.ts +1 -1
- package/dist/src/hooks/Bridge/useFetchRoutePriceBridge.d.ts +17 -6
- package/dist/src/hooks/ConnectWallet/TonConnect/index.d.ts +26 -0
- package/dist/src/hooks/ConnectWallet/useWalletState.d.ts +24 -0
- package/dist/src/hooks/Token/type.d.ts +1 -0
- package/dist/src/hooks/Token/useInitTokenList.d.ts +3 -1
- package/dist/src/hooks/Widget/useInitPropsToRedux.d.ts +1 -1
- package/dist/src/hooks/contract/abis/OrbiterV3ABI.d.ts +85 -0
- package/dist/src/hooks/contract/orbiter/constants.d.ts +3 -0
- package/dist/src/hooks/contract/orbiter/encodeOrbiterBridge.d.ts +12 -0
- package/dist/src/hooks/contract/orbiter/useOrbiterContractMap.d.ts +5 -0
- package/dist/src/hooks/contract/orbiter/useOrbiterRouters.d.ts +21 -0
- package/dist/src/hooks/contract/useFetchTokens.d.ts +1 -2
- package/package.json +10 -2
- package/dist/cjs/index-Dyz2QYJX.cjs +0 -53
- package/dist/index-CK3jgZQ5.js +0 -53
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { GraphQLRequests } from '@dodoex/api';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ConfirmProps } from '../components/Confirm';
|
|
4
|
+
import { DialogProps } from '../components/Swap/components/Dialog';
|
|
3
5
|
import { TokenInfo } from '../hooks/Token';
|
|
4
6
|
export interface GlobalFunctionConfig {
|
|
5
7
|
widgetRef?: React.RefObject<HTMLDivElement>;
|
|
@@ -18,9 +20,11 @@ export interface GlobalFunctionConfig {
|
|
|
18
20
|
chainId?: number;
|
|
19
21
|
}) => string;
|
|
20
22
|
graphQLRequests?: GraphQLRequests;
|
|
23
|
+
ConfirmComponent?: React.FunctionComponent<ConfirmProps>;
|
|
24
|
+
DialogComponent?: React.FunctionComponent<DialogProps>;
|
|
21
25
|
}
|
|
22
26
|
export declare const graphQLRequests: GraphQLRequests;
|
|
23
|
-
export declare const GlobalConfigContext:
|
|
27
|
+
export declare const GlobalConfigContext: React.Context<Omit<GlobalFunctionConfig, "graphQLRequests"> & {
|
|
24
28
|
graphQLRequests: GraphQLRequests;
|
|
25
29
|
}>;
|
|
26
30
|
export declare const useGlobalConfig: () => Omit<GlobalFunctionConfig, "graphQLRequests"> & {
|
|
@@ -6,7 +6,7 @@ export interface BridgeTXRequest {
|
|
|
6
6
|
value: string;
|
|
7
7
|
from: string;
|
|
8
8
|
chainId: number;
|
|
9
|
-
encodeId
|
|
9
|
+
encodeId?: string;
|
|
10
10
|
}
|
|
11
11
|
export default function BridgeSummaryDialog({ open, onClose, route, bridgeOrderTxRequest, clearToAmt, clearFromAmt, }: {
|
|
12
12
|
open: boolean;
|
|
@@ -10,12 +10,12 @@ export default function RouteCard({ fromToken, toToken, fromChainId, toChainId,
|
|
|
10
10
|
fromAmount?: BridgeRouteI['fromAmount'];
|
|
11
11
|
fromTokenBalance: BigNumber | null;
|
|
12
12
|
toTokenAmount?: BigNumber | null;
|
|
13
|
-
toolDetails: BridgeRouteI['step']['toolDetails'];
|
|
13
|
+
toolDetails: undefined | Exclude<BridgeRouteI['step'], undefined>['toolDetails'];
|
|
14
14
|
product: BridgeRouteI['product'];
|
|
15
15
|
executionDuration: BridgeRouteI['executionDuration'];
|
|
16
16
|
feeUSD: BridgeRouteI['feeUSD'];
|
|
17
17
|
selected: boolean;
|
|
18
18
|
setSelected: () => void;
|
|
19
|
-
spenderContractAddress: string;
|
|
19
|
+
spenderContractAddress: string | undefined;
|
|
20
20
|
isBestPrice?: boolean;
|
|
21
21
|
}): JSX.Element;
|
|
@@ -4,5 +4,6 @@ export interface ConnectWalletProps {
|
|
|
4
4
|
needSwitchChain?: ChainId;
|
|
5
5
|
/** If true is returned, the default wallet connection logic will not be executed */
|
|
6
6
|
onConnectWalletClick?: () => boolean | Promise<boolean>;
|
|
7
|
+
needConnectTwoWallet?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export default function ConnectWallet({ needSwitchChain, onConnectWalletClick, }: ConnectWalletProps): JSX.Element;
|
|
9
|
+
export default function ConnectWallet({ needSwitchChain, onConnectWalletClick, needConnectTwoWallet, }: ConnectWalletProps): JSX.Element;
|
|
@@ -8,7 +8,9 @@ import { ChainId } from '../../constants/chains';
|
|
|
8
8
|
import { DefaultTokenInfo } from '../../hooks/Token/type';
|
|
9
9
|
import { APIServices } from '../../constants/api';
|
|
10
10
|
import { SwapProps } from '../Swap';
|
|
11
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
11
12
|
export declare const WIDGET_CLASS_NAME = "dodo-widget-container";
|
|
13
|
+
export declare const queryClient: QueryClient;
|
|
12
14
|
export interface WidgetProps extends Web3ConnectorsProps, InitTokenListProps, ExecutionProps, SwapProps {
|
|
13
15
|
apikey?: string;
|
|
14
16
|
theme?: ThemeOptions;
|
|
@@ -26,6 +28,7 @@ export interface WidgetProps extends Web3ConnectorsProps, InitTokenListProps, Ex
|
|
|
26
28
|
apiServices?: Partial<APIServices>;
|
|
27
29
|
crossChain?: boolean;
|
|
28
30
|
noPowerBy?: boolean;
|
|
31
|
+
tonConnect?: boolean;
|
|
29
32
|
onProviderChanged?: (provider?: any) => void;
|
|
30
33
|
}
|
|
31
34
|
export declare function Widget(props: PropsWithChildren<WidgetProps>): JSX.Element;
|
|
@@ -2,7 +2,6 @@ export declare enum ChainId {
|
|
|
2
2
|
MAINNET = 1,
|
|
3
3
|
GOERLI = 5,
|
|
4
4
|
BSC = 56,
|
|
5
|
-
SEPOLIA = 11155111,
|
|
6
5
|
POLYGON = 137,
|
|
7
6
|
ARBITRUM_ONE = 42161,
|
|
8
7
|
AURORA = 1313161554,
|
|
@@ -15,7 +14,7 @@ export declare enum ChainId {
|
|
|
15
14
|
SCROLL = 534352,
|
|
16
15
|
MANTA = 169,
|
|
17
16
|
MANTLE = 5000,
|
|
18
|
-
|
|
17
|
+
TON = -239
|
|
19
18
|
}
|
|
20
19
|
export declare const rpcServerMap: {
|
|
21
20
|
[key in ChainId]: Array<string>;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
declare const _default: {
|
|
1
|
+
declare const _default: ({
|
|
2
2
|
chainId: number;
|
|
3
3
|
address: string;
|
|
4
4
|
name: string;
|
|
5
5
|
decimals: number;
|
|
6
6
|
symbol: string;
|
|
7
7
|
logoURI: string;
|
|
8
|
-
|
|
8
|
+
canBridgeToTon?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
chainId: number;
|
|
11
|
+
address: string;
|
|
12
|
+
name: string;
|
|
13
|
+
decimals: number;
|
|
14
|
+
symbol: string;
|
|
15
|
+
logoURI: string;
|
|
16
|
+
canBridgeToTon: boolean;
|
|
17
|
+
})[];
|
|
9
18
|
export default _default;
|
|
@@ -12,7 +12,7 @@ export interface BridgeOrderCreateParams {
|
|
|
12
12
|
hash: string;
|
|
13
13
|
product: string | null;
|
|
14
14
|
extend: {
|
|
15
|
-
lifiBridge: BridgeRouteI['sourceRoute']['step']['tool'];
|
|
15
|
+
lifiBridge: Exclude<BridgeRouteI['sourceRoute'], undefined>['step']['tool'];
|
|
16
16
|
route: BridgeRouteI['sourceRoute'];
|
|
17
17
|
productParams: BridgeRouteI['productParams'];
|
|
18
18
|
encodeId: string;
|
|
@@ -17,20 +17,28 @@ export interface BridgeRouteI {
|
|
|
17
17
|
toAddress: string;
|
|
18
18
|
/** from parameter */
|
|
19
19
|
product: string | null;
|
|
20
|
-
slippage
|
|
20
|
+
slippage?: number;
|
|
21
21
|
/** in seconds */
|
|
22
22
|
roundedRouteCostTime: number;
|
|
23
23
|
/** approve contract address */
|
|
24
|
-
spenderContractAddress
|
|
24
|
+
spenderContractAddress?: string;
|
|
25
25
|
/** USD */
|
|
26
26
|
feeUSD: string | null;
|
|
27
27
|
/** in seconds */
|
|
28
28
|
executionDuration: number | null;
|
|
29
29
|
/** one-click */
|
|
30
30
|
step: BridgeStep;
|
|
31
|
-
encodeParams
|
|
31
|
+
encodeParams?: any;
|
|
32
|
+
encodeResultData?: {
|
|
33
|
+
data: string;
|
|
34
|
+
to: string;
|
|
35
|
+
value: string;
|
|
36
|
+
from: string;
|
|
37
|
+
chainId: number;
|
|
38
|
+
encodeId?: string;
|
|
39
|
+
};
|
|
32
40
|
productParams: any;
|
|
33
|
-
sourceRoute
|
|
41
|
+
sourceRoute?: {
|
|
34
42
|
toAmount: string;
|
|
35
43
|
feeUSD: string | null;
|
|
36
44
|
executionDuration: number | null;
|
|
@@ -47,6 +55,8 @@ export interface BridgeRouteI {
|
|
|
47
55
|
};
|
|
48
56
|
fee: any;
|
|
49
57
|
};
|
|
58
|
+
minAmt?: string;
|
|
59
|
+
maxAmt?: string;
|
|
50
60
|
}
|
|
51
61
|
export interface BridgeTokenI {
|
|
52
62
|
id: number;
|
|
@@ -73,7 +83,7 @@ export interface BridgeStep {
|
|
|
73
83
|
tool: string;
|
|
74
84
|
toolDetails: BridgeStepTool;
|
|
75
85
|
type: string | null;
|
|
76
|
-
includedSteps
|
|
86
|
+
includedSteps?: Array<{
|
|
77
87
|
id: string;
|
|
78
88
|
/**
|
|
79
89
|
* bridge or swap
|
|
@@ -94,8 +104,9 @@ export interface FetchRoutePrice {
|
|
|
94
104
|
fromToken: TokenInfo | null;
|
|
95
105
|
toToken: TokenInfo | null;
|
|
96
106
|
fromAmount: string;
|
|
107
|
+
fromFiatPrice: string;
|
|
97
108
|
}
|
|
98
|
-
export declare function useFetchRoutePriceBridge({ toToken, fromToken, fromAmount, }: FetchRoutePrice): {
|
|
109
|
+
export declare function useFetchRoutePriceBridge({ toToken, fromToken, fromAmount, fromFiatPrice, }: FetchRoutePrice): {
|
|
99
110
|
status: RoutePriceStatus;
|
|
100
111
|
refetch: () => Promise<void>;
|
|
101
112
|
bridgeRouteList: BridgeRouteI[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TonConnectUI } from '@tonconnect/ui';
|
|
2
|
+
import { TonClient, TonClient4 } from 'ton';
|
|
3
|
+
import BigNumber from 'bignumber.js';
|
|
4
|
+
/**
|
|
5
|
+
* https://ton-community.github.io/ton/modules.html
|
|
6
|
+
* https://ton-org.github.io/ton-core/modules.html
|
|
7
|
+
* https://toncenter.com/api/v2/
|
|
8
|
+
*/
|
|
9
|
+
interface TonConnectState {
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
client?: TonClient;
|
|
12
|
+
clientV4?: TonClient4;
|
|
13
|
+
tonConnectUI?: TonConnectUI;
|
|
14
|
+
connected?: {
|
|
15
|
+
chainId: number;
|
|
16
|
+
account: string;
|
|
17
|
+
};
|
|
18
|
+
initialize: () => void;
|
|
19
|
+
connect: () => Promise<void>;
|
|
20
|
+
getBlockNumber: () => Promise<number>;
|
|
21
|
+
getJettonWallet: (jettonMasterAddress: string) => Promise<string>;
|
|
22
|
+
getBalance: (account: string) => Promise<BigNumber>;
|
|
23
|
+
getTokenBalance: (jettonMasterAddress: string, decimals: number) => Promise<BigNumber>;
|
|
24
|
+
}
|
|
25
|
+
declare const useTonConnectStore: import("zustand").UseBoundStore<import("zustand").StoreApi<TonConnectState>>;
|
|
26
|
+
export default useTonConnectStore;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
export declare function useWalletState({ isTon, }?: {
|
|
3
|
+
isTon?: boolean;
|
|
4
|
+
}): {
|
|
5
|
+
isTon: boolean;
|
|
6
|
+
chainId: number | undefined;
|
|
7
|
+
account: string | undefined;
|
|
8
|
+
isMetamask: boolean;
|
|
9
|
+
autoConnect: (chainId?: number) => Promise<void>;
|
|
10
|
+
connect: () => Promise<void>;
|
|
11
|
+
getLastBlockNumber: () => Promise<number>;
|
|
12
|
+
getBalance: (account: string) => Promise<BigNumber>;
|
|
13
|
+
provider?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
isTon: boolean;
|
|
16
|
+
chainId: number | undefined;
|
|
17
|
+
account: string | undefined;
|
|
18
|
+
isMetamask: boolean | undefined;
|
|
19
|
+
autoConnect: (chainId?: number) => Promise<void>;
|
|
20
|
+
connect: () => void | Promise<void>;
|
|
21
|
+
provider: import("@ethersproject/providers").Web3Provider | undefined;
|
|
22
|
+
getLastBlockNumber: (() => Promise<number>) | undefined;
|
|
23
|
+
getBalance: ((account: string) => Promise<BigNumber | undefined>) | undefined;
|
|
24
|
+
};
|
|
@@ -3,4 +3,6 @@ export interface InitTokenListProps {
|
|
|
3
3
|
tokenList?: TokenList | TokenListType;
|
|
4
4
|
popularTokenList?: TokenList;
|
|
5
5
|
}
|
|
6
|
-
export default function useInitTokenList({ tokenList, popularTokenList, }: InitTokenListProps
|
|
6
|
+
export default function useInitTokenList({ tokenList, popularTokenList, isTon, }: InitTokenListProps & {
|
|
7
|
+
isTon: boolean;
|
|
8
|
+
}): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { WidgetProps } from '../../components/Widget/';
|
|
2
|
-
export declare function useInitPropsToRedux({ width, height, feeRate, rebateTo, colorMode, apikey, defaultChainId, defaultToToken, defaultFromToken, jsonRpcUrlMap, swapSlippage, bridgeSlippage, apiServices, crossChain, noPowerBy, }: WidgetProps): void;
|
|
2
|
+
export declare function useInitPropsToRedux({ width, height, feeRate, rebateTo, colorMode, apikey, defaultChainId, defaultToToken, defaultFromToken, jsonRpcUrlMap, swapSlippage, bridgeSlippage, apiServices, crossChain, noPowerBy, tonConnect, }: WidgetProps): void;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
declare const Orbiter_V3_ABI_EVM: ({
|
|
2
|
+
anonymous: boolean;
|
|
3
|
+
inputs: {
|
|
4
|
+
indexed: boolean;
|
|
5
|
+
internalType: string;
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
}[];
|
|
9
|
+
name: string;
|
|
10
|
+
type: string;
|
|
11
|
+
outputs?: undefined;
|
|
12
|
+
stateMutability?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
inputs: {
|
|
15
|
+
internalType: string;
|
|
16
|
+
name: string;
|
|
17
|
+
type: string;
|
|
18
|
+
}[];
|
|
19
|
+
name: string;
|
|
20
|
+
outputs: never[];
|
|
21
|
+
stateMutability: string;
|
|
22
|
+
type: string;
|
|
23
|
+
anonymous?: undefined;
|
|
24
|
+
})[];
|
|
25
|
+
declare const Orbiter_V3_ABI_STARKNET_GOERLI: ({
|
|
26
|
+
members: {
|
|
27
|
+
name: string;
|
|
28
|
+
offset: number;
|
|
29
|
+
type: string;
|
|
30
|
+
}[];
|
|
31
|
+
name: string;
|
|
32
|
+
size: number;
|
|
33
|
+
type: string;
|
|
34
|
+
inputs?: undefined;
|
|
35
|
+
outputs?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
inputs: {
|
|
38
|
+
name: string;
|
|
39
|
+
type: string;
|
|
40
|
+
}[];
|
|
41
|
+
name: string;
|
|
42
|
+
outputs: never[];
|
|
43
|
+
type: string;
|
|
44
|
+
members?: undefined;
|
|
45
|
+
size?: undefined;
|
|
46
|
+
})[];
|
|
47
|
+
declare const Orbiter_V3_ABI_STARKNET: ({
|
|
48
|
+
members: {
|
|
49
|
+
name: string;
|
|
50
|
+
offset: number;
|
|
51
|
+
type: string;
|
|
52
|
+
}[];
|
|
53
|
+
name: string;
|
|
54
|
+
size: number;
|
|
55
|
+
type: string;
|
|
56
|
+
data?: undefined;
|
|
57
|
+
keys?: undefined;
|
|
58
|
+
inputs?: undefined;
|
|
59
|
+
outputs?: undefined;
|
|
60
|
+
} | {
|
|
61
|
+
data: {
|
|
62
|
+
name: string;
|
|
63
|
+
type: string;
|
|
64
|
+
}[];
|
|
65
|
+
keys: never[];
|
|
66
|
+
name: string;
|
|
67
|
+
type: string;
|
|
68
|
+
members?: undefined;
|
|
69
|
+
size?: undefined;
|
|
70
|
+
inputs?: undefined;
|
|
71
|
+
outputs?: undefined;
|
|
72
|
+
} | {
|
|
73
|
+
inputs: {
|
|
74
|
+
name: string;
|
|
75
|
+
type: string;
|
|
76
|
+
}[];
|
|
77
|
+
name: string;
|
|
78
|
+
outputs: never[];
|
|
79
|
+
type: string;
|
|
80
|
+
members?: undefined;
|
|
81
|
+
size?: undefined;
|
|
82
|
+
data?: undefined;
|
|
83
|
+
keys?: undefined;
|
|
84
|
+
})[];
|
|
85
|
+
export { Orbiter_V3_ABI_EVM, Orbiter_V3_ABI_STARKNET, Orbiter_V3_ABI_STARKNET_GOERLI, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { BridgeRouteI } from '../../Bridge';
|
|
3
|
+
import { TokenInfo } from '../../Token';
|
|
4
|
+
import { useOrbiterRouters } from './useOrbiterRouters';
|
|
5
|
+
export declare function encodeOrbiterBridge({ route, fromAddress, toAddress, fromAmount, fromToken, contractAddress, }: {
|
|
6
|
+
route: Exclude<ReturnType<typeof useOrbiterRouters>['data'], undefined>[0];
|
|
7
|
+
fromAddress: string;
|
|
8
|
+
toAddress: string;
|
|
9
|
+
fromAmount: BigNumber;
|
|
10
|
+
fromToken: TokenInfo;
|
|
11
|
+
contractAddress: string;
|
|
12
|
+
}): Exclude<BridgeRouteI['encodeResultData'], undefined>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChainId } from '../../../constants/chains';
|
|
2
|
+
interface OrbiterRoute {
|
|
3
|
+
key: string;
|
|
4
|
+
id: string;
|
|
5
|
+
fromChainId: ChainId;
|
|
6
|
+
toChainId: ChainId;
|
|
7
|
+
fromTokenAddress: string;
|
|
8
|
+
toTokenAddress: string;
|
|
9
|
+
product: string;
|
|
10
|
+
endpoint: string;
|
|
11
|
+
minAmt: string;
|
|
12
|
+
maxAmt: string;
|
|
13
|
+
withholdingFee: string;
|
|
14
|
+
tradeFee: string;
|
|
15
|
+
spentTime: string;
|
|
16
|
+
vc: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function useOrbiterRouters({ skip }?: {
|
|
19
|
+
skip?: boolean;
|
|
20
|
+
}): import("@tanstack/react-query/build/legacy/types").UseQueryResult<OrbiterRoute[], Error>;
|
|
21
|
+
export {};
|
|
@@ -8,9 +8,8 @@ declare type TokenResult = {
|
|
|
8
8
|
symbol?: string;
|
|
9
9
|
name?: string;
|
|
10
10
|
};
|
|
11
|
-
export default function useFetchTokens({ tokenList,
|
|
11
|
+
export default function useFetchTokens({ tokenList, blockNumber, chainId, skip, }: {
|
|
12
12
|
tokenList?: TokenList;
|
|
13
|
-
addresses?: string[];
|
|
14
13
|
blockNumber?: number;
|
|
15
14
|
chainId?: number;
|
|
16
15
|
skip?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dodoex/widgets",
|
|
3
|
-
"version": "2.6.12-beta.
|
|
3
|
+
"version": "2.6.12-beta.3",
|
|
4
4
|
"description": "DODO Widgets",
|
|
5
5
|
"source": "src/index.tsx",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -66,9 +66,13 @@
|
|
|
66
66
|
"@lingui/core": "^4.3.0",
|
|
67
67
|
"@lingui/macro": "^4.3.0",
|
|
68
68
|
"@lingui/react": "^4.3.0",
|
|
69
|
+
"@orbs-network/ton-access": "^2.3.3",
|
|
69
70
|
"@reduxjs/toolkit": "^1.6.1",
|
|
70
71
|
"@semantic-release/changelog": "^6.0.1",
|
|
71
72
|
"@semantic-release/git": "^10.0.1",
|
|
73
|
+
"@tanstack/react-query": "^5.51.23",
|
|
74
|
+
"@tonconnect/ui": "^2.0.6",
|
|
75
|
+
"@twa-dev/sdk": "^7.8.0",
|
|
72
76
|
"@web3-react/core": "8.2.0",
|
|
73
77
|
"@web3-react/eip1193": "8.2.0",
|
|
74
78
|
"@web3-react/metamask": "8.2.1",
|
|
@@ -80,7 +84,11 @@
|
|
|
80
84
|
"lodash": "^4.17.21",
|
|
81
85
|
"make-plural": "^7.0.0",
|
|
82
86
|
"react-window": "^1.8.8",
|
|
83
|
-
"semantic-release": "^19.0.2"
|
|
87
|
+
"semantic-release": "^19.0.2",
|
|
88
|
+
"ton": "^13.9.0",
|
|
89
|
+
"ton-core": "^0.53.0",
|
|
90
|
+
"ton-crypto": "^3.2.0",
|
|
91
|
+
"zustand": "^4.5.4"
|
|
84
92
|
},
|
|
85
93
|
"peerDependencies": {
|
|
86
94
|
"@babel/runtime": ">=7.17.0",
|