@cetusprotocol/terminal 0.3.2 → 1.0.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.
Files changed (47) hide show
  1. package/dist/cetus-swap.cjs.js +45 -45
  2. package/dist/cetus-swap.cjs.js.gz +0 -0
  3. package/dist/cetus-swap.es.js +20228 -18562
  4. package/dist/cetus-swap.es.js.gz +0 -0
  5. package/dist/cetus-swap.umd.js +45 -45
  6. package/dist/cetus-swap.umd.js.gz +0 -0
  7. package/dist/components/common/CopyButton.d.ts +1 -0
  8. package/dist/components/common/PowerByCetus.d.ts +3 -0
  9. package/dist/components/common/SlippageButton.d.ts +5 -2
  10. package/dist/components/common/TokenImage.d.ts +4 -1
  11. package/dist/components/common/Tooltip.d.ts +4 -1
  12. package/dist/components/common/TooltipV2.d.ts +2 -1
  13. package/dist/components/common/TransactionModeSetting.d.ts +11 -0
  14. package/dist/components/common/wallet/ConnectButton.d.ts +3 -1
  15. package/dist/components/common/wallet/TriggerButton.d.ts +1 -0
  16. package/dist/components/export/ExportModal.d.ts +2 -1
  17. package/dist/components/export/ExportWidgetBtn.d.ts +2 -2
  18. package/dist/components/swap/CurrentPriceBlock.d.ts +2 -1
  19. package/dist/components/swap/SwapHeader.d.ts +2 -1
  20. package/dist/components/swap/SwapWidget.d.ts +2 -1
  21. package/dist/components/swap/ThemeProvider.d.ts +7 -0
  22. package/dist/components/swap/WidgetHeader.d.ts +2 -1
  23. package/dist/components/theme/CustomLogo.d.ts +1 -0
  24. package/dist/components/theme/MenuCustomTheme.d.ts +1 -0
  25. package/dist/config/provider.d.ts +2 -1
  26. package/dist/data/all-pools.json +74058 -0
  27. package/dist/data/all-pools.json.gz +0 -0
  28. package/dist/hooks/common/resolveCoinBalance.d.ts +3 -0
  29. package/dist/hooks/common/useFastModeTransaction.d.ts +7 -0
  30. package/dist/hooks/common/useGetPoolListByCoinType.d.ts +1 -0
  31. package/dist/hooks/common/useTransaction.d.ts +1 -1
  32. package/dist/hooks/swap/usePriceImpact.d.ts +1 -1
  33. package/dist/hooks/useGetPoolList.d.ts +1 -0
  34. package/dist/images/icon_shio@2x.png +0 -0
  35. package/dist/images/logo_light@2x.png +0 -0
  36. package/dist/images/logo_pyth.png +0 -0
  37. package/dist/stores/demo.d.ts +7 -1
  38. package/dist/stores/global.d.ts +13 -0
  39. package/dist/style.css +1 -1
  40. package/dist/style.css.gz +0 -0
  41. package/dist/types/common.d.ts +3 -0
  42. package/dist/types/config.d.ts +24 -0
  43. package/dist/utils/color.d.ts +8 -0
  44. package/dist/utils/common.d.ts +1 -0
  45. package/dist/utils/error.d.ts +2 -0
  46. package/dist/utils/index.d.ts +1 -0
  47. package/package.json +9 -5
package/dist/style.css.gz CHANGED
Binary file
@@ -67,6 +67,9 @@ export type TransactionOption = {
67
67
  useDevInspect?: boolean;
68
68
  useMev?: boolean;
69
69
  txAction?: "signTransactionBlock" | "signAndExecuteTransactionBlock";
70
+ useFastMode?: boolean;
71
+ maxCapForGas?: string;
72
+ customGasPrice?: string;
70
73
  };
71
74
  export type SwapRouterFormat = {
72
75
  router_summery: string;
@@ -11,3 +11,27 @@ export type EnvConfig = {
11
11
  api: string;
12
12
  aggregatorUrl: string;
13
13
  };
14
+ export type InitProps = {
15
+ defaultFromToken?: string;
16
+ defaultToToken?: string;
17
+ defaultSlippage?: string;
18
+ customRpcList?: string[];
19
+ defaultRpc?: string;
20
+ independentWallet?: boolean;
21
+ partner?: string;
22
+ theme?: WidgetTheme;
23
+ themeType?: "Dark" | "Light";
24
+ logo?: string;
25
+ };
26
+ export type WidgetTheme = {
27
+ bg_primary: string;
28
+ primary: string;
29
+ text_primary: string;
30
+ text_secondary: string;
31
+ success: string;
32
+ warning: string;
33
+ error: string;
34
+ btn_text: string;
35
+ [key: string]: string;
36
+ };
37
+ export type ThemeType = "Dark" | "Light";
@@ -0,0 +1,8 @@
1
+ import { RgbaColor } from 'react-colorful';
2
+ export declare const hexToRgba: (value: string) => {
3
+ r: number;
4
+ g: number;
5
+ b: number;
6
+ a: number;
7
+ };
8
+ export declare const rgbaToHex: (value: RgbaColor) => string;
@@ -12,3 +12,4 @@ export declare function getCdnAssets(path: string): string;
12
12
  export declare const textEllipses: (text: string, decimals?: number) => string;
13
13
  export declare const coinTypeEquals: (tokenA?: string, tokenB?: string) => boolean;
14
14
  export declare const isAvailableObject: (obj: unknown) => boolean;
15
+ export declare function normalizeCoinType(coin_type: string): string;
@@ -6,4 +6,6 @@
6
6
  export declare function isUserRejectedError(error: any): any;
7
7
  export declare function isPriceSlippageError(error: any): boolean;
8
8
  export declare function isNotFindTxHashError(error: any): boolean;
9
+ export declare function isMaxCapError(error: any): boolean;
10
+ export declare function isFastModeServiceError(error: any): boolean;
9
11
  export declare function handleErrorMessages(error: any): string;
@@ -1,3 +1,4 @@
1
+ export * from './color';
1
2
  export * from './common';
2
3
  export * from './contract';
3
4
  export * from './decimal';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cetusprotocol/terminal",
3
- "version": "0.3.2",
3
+ "version": "1.0.1",
4
4
  "type": "commonjs",
5
5
  "main": "dist/cetus-swap.cjs.js",
6
6
  "module": "dist/cetus-swap.es.js",
@@ -9,7 +9,8 @@
9
9
  "dist"
10
10
  ],
11
11
  "peerDependencies": {
12
- "@mysten/dapp-kit": ">=0.14.0",
12
+ "@mysten/dapp-kit": ">=0.16.0",
13
+ "@mysten/sui": ">=1.16.0",
13
14
  "react": ">=18.2.0",
14
15
  "react-dom": ">=18.2.0"
15
16
  },
@@ -17,11 +18,11 @@
17
18
  "dev": "vite",
18
19
  "build": "vite build",
19
20
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
20
- "preview": "vite preview"
21
+ "preview": "vite preview",
22
+ "publish:test": "node ./version.mjs && npm publish --tag experimental"
21
23
  },
22
24
  "dependencies": {
23
- "@cetusprotocol/aggregator-sdk": "^0.8.0",
24
- "@mysten/sui": "^1.16.0",
25
+ "@cetusprotocol/aggregator-sdk": "^0.10.0",
25
26
  "@radix-ui/colors": "^3.0.0",
26
27
  "@radix-ui/react-icons": "^1.3.0",
27
28
  "@radix-ui/themes": "^2.0.0",
@@ -35,6 +36,7 @@
35
36
  "react-number-format": "^5.4.2",
36
37
  "react-syntax-highlighter": "^15.6.1",
37
38
  "react-window": "^1.8.11",
39
+ "shio-fast-sdk": "^0.0.6",
38
40
  "shio-sdk": "^1.0.8",
39
41
  "suihoneypot": "^0.0.6",
40
42
  "uuid": "^11.0.2",
@@ -44,6 +46,7 @@
44
46
  },
45
47
  "devDependencies": {
46
48
  "@mysten/dapp-kit": "^0.14.40",
49
+ "@mysten/sui": "^1.16.0",
47
50
  "@rollup/plugin-strip": "^3.0.4",
48
51
  "@types/bn.js": "^5.1.6",
49
52
  "@types/lodash-es": "^4.17.12",
@@ -62,6 +65,7 @@
62
65
  "postcss-nested": "^7.0.2",
63
66
  "prettier": "^3.0.0",
64
67
  "react": "^18.2.0",
68
+ "react-colorful": "^5.6.1",
65
69
  "react-dom": "^18.2.0",
66
70
  "rollup-plugin-terser": "^7.0.2",
67
71
  "rollup-plugin-visualizer": "^5.12.0",