@dodoex/widgets 3.0.2-zetachain.108.refund.1 → 3.0.2-zetachain.108.ton.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.
Files changed (36) hide show
  1. package/README.md +4 -0
  2. package/dist/cjs/locales/en-US.js +1 -1
  3. package/dist/cjs/locales/zh-CN.js +1 -1
  4. package/dist/{helper-VrdR3uWp.js → helper-BhnlkePU.js} +1 -1
  5. package/dist/{helper-BXvQPmv7.cjs → helper-xbWu0aGJ.cjs} +1 -1
  6. package/dist/{index-HqXiTr51.cjs → index--IQw92GO.cjs} +3 -3
  7. package/dist/index-BNjT4_s4.js +31 -0
  8. package/dist/{index-DcS0uyec.js → index-BXOd9Dl2.js} +2 -2
  9. package/dist/{index-BKgkOSup.js → index-CsrFbHKk.js} +4 -4
  10. package/dist/index-DMfCNiUx.cjs +31 -0
  11. package/dist/{index-DD0_Ss45.cjs → index-gSLR54il.cjs} +2 -2
  12. package/dist/index.cjs +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/locales/en-US.js +1 -1
  15. package/dist/locales/zh-CN.js +1 -1
  16. package/dist/types/components/Swap/SwapOrderHistory/CrossOrderCard.d.ts +1 -2
  17. package/dist/types/constants/address.d.ts +2 -0
  18. package/dist/types/constants/api.d.ts +1 -2
  19. package/dist/types/constants/chainList.d.ts +2 -0
  20. package/dist/types/hooks/Swap/useCrossSwapOrderList.d.ts +12 -24
  21. package/dist/types/hooks/Token/useTokenStatus.d.ts +2 -6
  22. package/dist/types/index.d.ts +2 -1
  23. package/dist/types/tests/1-get-account-state.d.ts +1 -0
  24. package/dist/types/tests/1-send-ton.d.ts +1 -0
  25. package/dist/types/utils/CaipNetworksUtil.d.ts +5 -0
  26. package/dist/types/utils/constants.d.ts +0 -1
  27. package/dist/types/utils/index.d.ts +2 -2
  28. package/dist/types/utils/reown-types.d.ts +28 -0
  29. package/dist/types/utils/ton.d.ts +9 -0
  30. package/dist/types/utils/ton_test.d.ts +1 -0
  31. package/dist/types/utils/wallet.d.ts +1 -1
  32. package/dist/types/widgets/PoolWidget/PoolOperate/hooks/useRemoveLiquidityTokenStatus.d.ts +2 -6
  33. package/package.json +14 -6
  34. package/dist/index-0-iXV94m.cjs +0 -31
  35. package/dist/index-S6xeLliD.js +0 -31
  36. package/dist/types/components/Swap/SwapOrderHistory/RefundModal.d.ts +0 -9
@@ -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
+ };
@@ -1,2 +1 @@
1
1
  export declare const CROSS_CHAIN_TEXT = "Cross Chain";
2
- export declare const CLAIM_REFUND_TEXT = "Claim Refund";
@@ -1,5 +1,5 @@
1
- export * from './formatter';
2
1
  export * from './address';
3
- export * from './wallet';
4
2
  export * from './chains';
3
+ export * from './formatter';
5
4
  export * from './token';
5
+ export * from './wallet';
@@ -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,9 @@
1
+ import { Message, TonClient, Transaction } from '@ton/ton';
2
+ export declare function getNormalizedExtMessageHash(message: Message): any;
3
+ export declare function normalizedExtHashFromBoc(bocBase64: string): string;
4
+ export declare function retry<T>(fn: () => Promise<T>, options: {
5
+ retries: number;
6
+ delay: number;
7
+ }): Promise<T>;
8
+ export declare function getTransactionByInMessage(inMessageBoc: string, client: TonClient): Promise<Transaction | undefined>;
9
+ export declare function waitForTransaction(inMessageBoc: string, client: TonClient, retries?: number, timeout?: number): Promise<Transaction | undefined>;
@@ -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,9 +8,7 @@ export declare function useRemoveLiquidityTokenStatus({ pool, baseAmount, quoteA
8
8
  balanceInfo: ReturnType<typeof usePoolBalanceInfo>;
9
9
  }): {
10
10
  baseTokenStatus: {
11
- token: (Pick<import("../../../..").TokenInfo, "chainId" | "address"> & {
12
- symbol?: string;
13
- }) | null | undefined;
11
+ token: import("../../../..").TokenInfo | null | undefined;
14
12
  isApproving: boolean;
15
13
  isGetApproveLoading: boolean;
16
14
  needApprove: boolean;
@@ -44,9 +42,7 @@ export declare function useRemoveLiquidityTokenStatus({ pool, baseAmount, quoteA
44
42
  } | null, Error>;
45
43
  };
46
44
  quoteTokenStatus: {
47
- token: (Pick<import("../../../..").TokenInfo, "chainId" | "address"> & {
48
- symbol?: string;
49
- }) | null | undefined;
45
+ token: import("../../../..").TokenInfo | null | undefined;
50
46
  isApproving: boolean;
51
47
  isGetApproveLoading: boolean;
52
48
  needApprove: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dodoex/widgets",
3
- "version": "3.0.2-zetachain.108.refund.1",
3
+ "version": "3.0.2-zetachain.108.ton.3",
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.23.1",
63
+ "@dodoex/api": "3.0.3-zetachain.24.ton.2",
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
  }