@dodoex/widgets 3.0.2-zetachain.111 → 3.0.2-zetachain.112.refund.1
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/README.md +2 -0
- package/dist/cjs/locales/en-US.js +1 -1
- package/dist/cjs/locales/zh-CN.js +1 -1
- package/dist/{helper-Ci7geM5m.js → helper-3F5Q-wjG.js} +1 -1
- package/dist/{helper-CCTu9er9.cjs → helper-D2wEKu8h.cjs} +1 -1
- package/dist/index-B3nsVw1q.cjs +34 -0
- package/dist/{index-BfkpRw0P.js → index-B6iAIaNK.js} +4 -4
- package/dist/{index-B6Ej3z_K.cjs → index-B9kWdbL6.cjs} +2 -2
- package/dist/index-BrFzL3nR.js +34 -0
- package/dist/{index-Dm_FEZCG.js → index-CxAMqn9P.js} +2 -2
- package/dist/{index-YMKJjycL.cjs → index-D1J-lne4.cjs} +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/types/components/Swap/SwapOrderHistory/CrossOrderCard.d.ts +2 -1
- package/dist/types/components/Swap/SwapOrderHistory/RefundModal.d.ts +9 -0
- package/dist/types/constants/address.d.ts +2 -0
- package/dist/types/constants/api.d.ts +2 -1
- package/dist/types/constants/chainList.d.ts +2 -0
- package/dist/types/hooks/Swap/useCrossSwapOrderList.d.ts +24 -12
- package/dist/types/hooks/Token/useTokenStatus.d.ts +6 -2
- package/dist/types/index.d.ts +2 -1
- package/dist/types/tests/1-get-account-state.d.ts +1 -0
- package/dist/types/tests/1-send-ton.d.ts +1 -0
- package/dist/types/utils/CaipNetworksUtil.d.ts +5 -0
- package/dist/types/utils/constants.d.ts +1 -0
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/reown-types.d.ts +28 -0
- package/dist/types/utils/sui_test.d.ts +1 -0
- package/dist/types/utils/ton.d.ts +3 -0
- package/dist/types/utils/ton_test.d.ts +1 -0
- package/dist/types/utils/wallet.d.ts +1 -1
- package/dist/types/widgets/PoolWidget/PoolOperate/hooks/useRemoveLiquidityTokenStatus.d.ts +6 -2
- package/package.json +14 -6
- package/dist/index-DF6wZx-Z.cjs +0 -31
- package/dist/index-DrDSLedU.js +0 -31
|
@@ -6,10 +6,12 @@ export declare function useCrossSwapOrderList({ account, limit, type, }: {
|
|
|
6
6
|
}): {
|
|
7
7
|
orderList: {
|
|
8
8
|
hash: string | null | undefined;
|
|
9
|
-
refundHash: string | null | undefined;
|
|
10
9
|
externalId: string | null | undefined;
|
|
11
|
-
|
|
10
|
+
bridgeRefundVault: string | null | undefined;
|
|
11
|
+
bridgeChainId: number | null | undefined;
|
|
12
12
|
refundChainId: number | undefined;
|
|
13
|
+
refundUser: string | null | undefined;
|
|
14
|
+
refundHash: string | null | undefined;
|
|
13
15
|
fromToken: import("../Token").TokenInfo | undefined;
|
|
14
16
|
toToken: import("../Token").TokenInfo | undefined;
|
|
15
17
|
fromAmount: BigNumber | null;
|
|
@@ -67,10 +69,12 @@ export declare function useCrossSwapOrderList({ account, limit, type, }: {
|
|
|
67
69
|
} | {
|
|
68
70
|
orderList: {
|
|
69
71
|
hash: string | null | undefined;
|
|
70
|
-
refundHash: string | null | undefined;
|
|
71
72
|
externalId: string | null | undefined;
|
|
72
|
-
|
|
73
|
+
bridgeRefundVault: string | null | undefined;
|
|
74
|
+
bridgeChainId: number | null | undefined;
|
|
73
75
|
refundChainId: number | undefined;
|
|
76
|
+
refundUser: string | null | undefined;
|
|
77
|
+
refundHash: string | null | undefined;
|
|
74
78
|
fromToken: import("../Token").TokenInfo | undefined;
|
|
75
79
|
toToken: import("../Token").TokenInfo | undefined;
|
|
76
80
|
fromAmount: BigNumber | null;
|
|
@@ -128,10 +132,12 @@ export declare function useCrossSwapOrderList({ account, limit, type, }: {
|
|
|
128
132
|
} | {
|
|
129
133
|
orderList: {
|
|
130
134
|
hash: string | null | undefined;
|
|
131
|
-
refundHash: string | null | undefined;
|
|
132
135
|
externalId: string | null | undefined;
|
|
133
|
-
|
|
136
|
+
bridgeRefundVault: string | null | undefined;
|
|
137
|
+
bridgeChainId: number | null | undefined;
|
|
134
138
|
refundChainId: number | undefined;
|
|
139
|
+
refundUser: string | null | undefined;
|
|
140
|
+
refundHash: string | null | undefined;
|
|
135
141
|
fromToken: import("../Token").TokenInfo | undefined;
|
|
136
142
|
toToken: import("../Token").TokenInfo | undefined;
|
|
137
143
|
fromAmount: BigNumber | null;
|
|
@@ -189,10 +195,12 @@ export declare function useCrossSwapOrderList({ account, limit, type, }: {
|
|
|
189
195
|
} | {
|
|
190
196
|
orderList: {
|
|
191
197
|
hash: string | null | undefined;
|
|
192
|
-
refundHash: string | null | undefined;
|
|
193
198
|
externalId: string | null | undefined;
|
|
194
|
-
|
|
199
|
+
bridgeRefundVault: string | null | undefined;
|
|
200
|
+
bridgeChainId: number | null | undefined;
|
|
195
201
|
refundChainId: number | undefined;
|
|
202
|
+
refundUser: string | null | undefined;
|
|
203
|
+
refundHash: string | null | undefined;
|
|
196
204
|
fromToken: import("../Token").TokenInfo | undefined;
|
|
197
205
|
toToken: import("../Token").TokenInfo | undefined;
|
|
198
206
|
fromAmount: BigNumber | null;
|
|
@@ -250,10 +258,12 @@ export declare function useCrossSwapOrderList({ account, limit, type, }: {
|
|
|
250
258
|
} | {
|
|
251
259
|
orderList: {
|
|
252
260
|
hash: string | null | undefined;
|
|
253
|
-
refundHash: string | null | undefined;
|
|
254
261
|
externalId: string | null | undefined;
|
|
255
|
-
|
|
262
|
+
bridgeRefundVault: string | null | undefined;
|
|
263
|
+
bridgeChainId: number | null | undefined;
|
|
256
264
|
refundChainId: number | undefined;
|
|
265
|
+
refundUser: string | null | undefined;
|
|
266
|
+
refundHash: string | null | undefined;
|
|
257
267
|
fromToken: import("../Token").TokenInfo | undefined;
|
|
258
268
|
toToken: import("../Token").TokenInfo | undefined;
|
|
259
269
|
fromAmount: BigNumber | null;
|
|
@@ -311,10 +321,12 @@ export declare function useCrossSwapOrderList({ account, limit, type, }: {
|
|
|
311
321
|
} | {
|
|
312
322
|
orderList: {
|
|
313
323
|
hash: string | null | undefined;
|
|
314
|
-
refundHash: string | null | undefined;
|
|
315
324
|
externalId: string | null | undefined;
|
|
316
|
-
|
|
325
|
+
bridgeRefundVault: string | null | undefined;
|
|
326
|
+
bridgeChainId: number | null | undefined;
|
|
317
327
|
refundChainId: number | undefined;
|
|
328
|
+
refundUser: string | null | undefined;
|
|
329
|
+
refundHash: string | null | undefined;
|
|
318
330
|
fromToken: import("../Token").TokenInfo | undefined;
|
|
319
331
|
toToken: import("../Token").TokenInfo | undefined;
|
|
320
332
|
fromAmount: BigNumber | null;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import { TokenInfo } from './type';
|
|
3
|
-
export declare function useTokenStatus(token: TokenInfo
|
|
3
|
+
export declare function useTokenStatus(token: (Pick<TokenInfo, 'address' | 'chainId'> & {
|
|
4
|
+
symbol?: string;
|
|
5
|
+
}) | undefined | null, { amount, contractAddress, offset, overrideBalance, skipQuery, account: inputAccount, }?: {
|
|
4
6
|
amount?: string | number | BigNumber;
|
|
5
7
|
contractAddress?: string;
|
|
6
8
|
offset?: BigNumber;
|
|
@@ -8,7 +10,9 @@ export declare function useTokenStatus(token: TokenInfo | undefined | null, { am
|
|
|
8
10
|
skipQuery?: boolean;
|
|
9
11
|
account?: string;
|
|
10
12
|
}): {
|
|
11
|
-
token: TokenInfo |
|
|
13
|
+
token: (Pick<TokenInfo, "chainId" | "address"> & {
|
|
14
|
+
symbol?: string;
|
|
15
|
+
}) | null | undefined;
|
|
12
16
|
isApproving: boolean;
|
|
13
17
|
isGetApproveLoading: boolean;
|
|
14
18
|
needApprove: boolean;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -19,15 +19,16 @@ export { PageType, useRouterStore } from './router';
|
|
|
19
19
|
export type { Page } from './router';
|
|
20
20
|
export { getEtherscanPage } from './utils/address';
|
|
21
21
|
export { formatPercentageNumber, formatReadableNumber, formatShortNumber, formatTokenAmountNumber, } from './utils/formatter';
|
|
22
|
+
export type { AppKitNetworkExtend, CaipAddressExtend, CaipNetworkExtend, CaipNetworkIdExtend, ChainNamespaceExtend, UseAppKitAccountReturnExtend, } from './utils/reown-types';
|
|
22
23
|
export { Pool } from './widgets/PoolWidget';
|
|
23
24
|
export { default as AMMV2Create } from './widgets/PoolWidget/AMMV2Create';
|
|
24
25
|
export { default as AddLiquidityV3 } from './widgets/PoolWidget/AMMV3/AddLiquidityV3';
|
|
25
26
|
export { AMMV3PositionManage } from './widgets/PoolWidget/AMMV3/AMMV3PositionManage';
|
|
26
27
|
export { AMMV3PositionsView } from './widgets/PoolWidget/AMMV3/AMMV3PositionsView';
|
|
28
|
+
export { CurvePoolDetail } from './widgets/PoolWidget/curve/CurvePoolDetail';
|
|
27
29
|
export { usePoolBalanceInfo } from './widgets/PoolWidget/hooks/usePoolBalanceInfo';
|
|
28
30
|
export { default as PoolCreate } from './widgets/PoolWidget/PoolCreate';
|
|
29
31
|
export { default as PoolDetail } from './widgets/PoolWidget/PoolDetail';
|
|
30
|
-
export { CurvePoolDetail } from './widgets/PoolWidget/curve/CurvePoolDetail';
|
|
31
32
|
export { default as PoolList } from './widgets/PoolWidget/PoolList';
|
|
32
33
|
export { default as PoolModify } from './widgets/PoolWidget/PoolModify';
|
|
33
34
|
export { PoolOperate, default as PoolOperateDialog, } from './widgets/PoolWidget/PoolOperate';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AppKitNetworkExtend, type CaipNetworkExtend } from './reown-types';
|
|
2
|
+
export declare const CaipNetworksUtil: {
|
|
3
|
+
isCaipNetwork(network: AppKitNetworkExtend): network is CaipNetworkExtend;
|
|
4
|
+
getChainNamespace(network: AppKitNetworkExtend): import("./reown-types").ChainNamespaceExtend;
|
|
5
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type BaseNetwork, ChainId, ChainNamespace, type CaipNetwork } from '@reown/appkit-common';
|
|
2
|
+
import type { NamespaceTypeMap, UseAppKitAccountReturn } from '@reown/appkit/react';
|
|
3
|
+
export type ChainNamespaceExtend = ChainNamespace | 'ton' | 'sui';
|
|
4
|
+
export type CaipNetworkIdExtend = `${ChainNamespaceExtend}:${ChainId}`;
|
|
5
|
+
export type CaipAddressExtend = `${ChainNamespaceExtend}:${ChainId}:${string}`;
|
|
6
|
+
type NamespaceTypeMapExtend = NamespaceTypeMap & {
|
|
7
|
+
ton: 'eoa';
|
|
8
|
+
sui: 'eoa';
|
|
9
|
+
};
|
|
10
|
+
type AccountTypeMapExtend = {
|
|
11
|
+
[K in ChainNamespaceExtend]: {
|
|
12
|
+
namespace: K;
|
|
13
|
+
address: string;
|
|
14
|
+
type: NamespaceTypeMapExtend[K];
|
|
15
|
+
publicKey?: K extends 'bip122' ? string : never;
|
|
16
|
+
path?: K extends 'bip122' ? string : never;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type AccountTypeExtend = AccountTypeMapExtend[ChainNamespaceExtend];
|
|
20
|
+
export type UseAppKitAccountReturnExtend = {
|
|
21
|
+
allAccounts: AccountTypeExtend[];
|
|
22
|
+
caipAddress: CaipAddressExtend | undefined;
|
|
23
|
+
} & Pick<UseAppKitAccountReturn, 'address' | 'isConnected' | 'embeddedWalletInfo' | 'status'>;
|
|
24
|
+
export type CaipNetworkExtend = Omit<CaipNetwork, 'chainNamespace'> & {
|
|
25
|
+
chainNamespace: ChainNamespaceExtend;
|
|
26
|
+
};
|
|
27
|
+
export type AppKitNetworkExtend = BaseNetwork | CaipNetworkExtend;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -7,4 +7,4 @@ export declare const isETHChain: (chainId?: number) => {
|
|
|
7
7
|
isGor: boolean;
|
|
8
8
|
};
|
|
9
9
|
export declare const reloadWindow: (interval?: number) => void;
|
|
10
|
-
export declare function namespaceToTitle(chainId: ChainId | undefined): "polkadot" | "cosmos" | "Solana" | "Bitcoin" | "" | "a" | "EVM";
|
|
10
|
+
export declare function namespaceToTitle(chainId: ChainId | undefined): "polkadot" | "cosmos" | "Solana" | "Bitcoin" | "Sui" | "TON" | "" | "a" | "EVM";
|
|
@@ -8,7 +8,9 @@ export declare function useRemoveLiquidityTokenStatus({ pool, baseAmount, quoteA
|
|
|
8
8
|
balanceInfo: ReturnType<typeof usePoolBalanceInfo>;
|
|
9
9
|
}): {
|
|
10
10
|
baseTokenStatus: {
|
|
11
|
-
token: import("../../../..").TokenInfo |
|
|
11
|
+
token: (Pick<import("../../../..").TokenInfo, "chainId" | "address"> & {
|
|
12
|
+
symbol?: string;
|
|
13
|
+
}) | null | undefined;
|
|
12
14
|
isApproving: boolean;
|
|
13
15
|
isGetApproveLoading: boolean;
|
|
14
16
|
needApprove: boolean;
|
|
@@ -42,7 +44,9 @@ export declare function useRemoveLiquidityTokenStatus({ pool, baseAmount, quoteA
|
|
|
42
44
|
} | null, Error>;
|
|
43
45
|
};
|
|
44
46
|
quoteTokenStatus: {
|
|
45
|
-
token: import("../../../..").TokenInfo |
|
|
47
|
+
token: (Pick<import("../../../..").TokenInfo, "chainId" | "address"> & {
|
|
48
|
+
symbol?: string;
|
|
49
|
+
}) | null | undefined;
|
|
46
50
|
isApproving: boolean;
|
|
47
51
|
isGetApproveLoading: boolean;
|
|
48
52
|
needApprove: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dodoex/widgets",
|
|
3
|
-
"version": "3.0.2-zetachain.
|
|
3
|
+
"version": "3.0.2-zetachain.112.refund.1",
|
|
4
4
|
"description": "DODO Widgets",
|
|
5
5
|
"source": "src/index.tsx",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"release.npm-publish": "npm publish --access public",
|
|
26
26
|
"release.npm-publish-beta": "yarn run build && npm publish --tag beta",
|
|
27
27
|
"test": "jest src",
|
|
28
|
-
"test:e2e": "jest e2e"
|
|
28
|
+
"test:e2e": "jest e2e",
|
|
29
|
+
"test:ton": "ts-node --transpile-only --compiler-options '{\"module\":\"commonjs\"}' ./src/tests/1-send-ton.ts"
|
|
29
30
|
},
|
|
30
31
|
"author": "",
|
|
31
32
|
"publishConfig": {
|
|
@@ -59,7 +60,7 @@
|
|
|
59
60
|
"dependencies": {
|
|
60
61
|
"@babel/runtime": "^7.17.0",
|
|
61
62
|
"@bitcoinerlab/secp256k1": "1.2.0",
|
|
62
|
-
"@dodoex/api": "3.0.3-zetachain.
|
|
63
|
+
"@dodoex/api": "3.0.3-zetachain.25.1",
|
|
63
64
|
"@dodoex/components": "3.0.3-zetachain.14",
|
|
64
65
|
"@dodoex/contract-request": "^1.3.0",
|
|
65
66
|
"@dodoex/dodo-contract-request": "1.19.0-alpha.4",
|
|
@@ -99,15 +100,21 @@
|
|
|
99
100
|
},
|
|
100
101
|
"peerDependencies": {
|
|
101
102
|
"@babel/runtime": ">=7.17.0",
|
|
103
|
+
"@dodoex/btc-connect-react": "^1.5.10",
|
|
104
|
+
"@ethersproject/providers": "^5.8.0",
|
|
105
|
+
"@mysten/dapp-kit": "^0.18.0",
|
|
106
|
+
"@mysten/sui": "^1.38.0",
|
|
102
107
|
"@reown/appkit": "^1.7.5",
|
|
103
108
|
"@reown/appkit-adapter-solana": "^1.7.5",
|
|
104
|
-
"@reown/appkit-utils": "^1.7.5",
|
|
105
109
|
"@reown/appkit-common": "^1.7.5",
|
|
110
|
+
"@reown/appkit-utils": "^1.7.5",
|
|
106
111
|
"@solana/spl-token": "^0.4.13",
|
|
107
112
|
"@solana/web3.js": "1.98.2",
|
|
113
|
+
"@ton/core": "^0.61.0",
|
|
114
|
+
"@ton/crypto": "^3.3.0",
|
|
115
|
+
"@ton/ton": "^15.3.1",
|
|
116
|
+
"@tonconnect/ui-react": "^2.3.0",
|
|
108
117
|
"bitcoinjs-lib": "6.1.7",
|
|
109
|
-
"@dodoex/btc-connect-react": "^1.5.10",
|
|
110
|
-
"@ethersproject/providers": "^5.8.0",
|
|
111
118
|
"react": "^18.0.0",
|
|
112
119
|
"react-dom": "^18.0.0"
|
|
113
120
|
},
|
|
@@ -151,6 +158,7 @@
|
|
|
151
158
|
"rollup-plugin-import-css": "^3.5.5",
|
|
152
159
|
"svg-jest": "^1.0.1",
|
|
153
160
|
"ts-jest": "^29.0.1",
|
|
161
|
+
"ts-node": "^10.8.1",
|
|
154
162
|
"typescript": "^5.6.3"
|
|
155
163
|
}
|
|
156
164
|
}
|