@cetusprotocol/terminal 0.3.1 → 1.0.0

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 (51) 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 +20226 -18530
  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 +3 -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/useGetPoolList.d.ts +1 -0
  33. package/dist/images/aggregator-source/metastable.png +0 -0
  34. package/dist/images/aggregator-source/momentum.png +0 -0
  35. package/dist/images/aggregator-source/obric.png +0 -0
  36. package/dist/images/aggregator-source/stSui.png +0 -0
  37. package/dist/images/aggregator-source/steamm.png +0 -0
  38. package/dist/images/icon_shio@2x.png +0 -0
  39. package/dist/images/logo_light@2x.png +0 -0
  40. package/dist/images/logo_pyth.png +0 -0
  41. package/dist/stores/demo.d.ts +7 -1
  42. package/dist/stores/global.d.ts +13 -0
  43. package/dist/style.css +1 -1
  44. package/dist/style.css.gz +0 -0
  45. package/dist/types/common.d.ts +3 -0
  46. package/dist/types/config.d.ts +24 -0
  47. package/dist/utils/color.d.ts +8 -0
  48. package/dist/utils/common.d.ts +1 -0
  49. package/dist/utils/error.d.ts +2 -0
  50. package/dist/utils/index.d.ts +1 -0
  51. package/package.json +13 -9
Binary file
@@ -0,0 +1,3 @@
1
+ import { BuildTransactionOptions, TransactionDataBuilder } from '@mysten/sui/transactions';
2
+ export declare const COIN_WITH_BALANCE = "CoinWithBalance";
3
+ export declare function resolveCoinBalance(transactionData: TransactionDataBuilder, buildOptions: BuildTransactionOptions, next: () => Promise<void>): Promise<void>;
@@ -0,0 +1,7 @@
1
+ export default function useFastModeTransaction(): {
2
+ getFastModeTx: (tx: any, maxCapForGas: string, customGasPrice: string) => Promise<{
3
+ result: import('@mysten/sui/client').SuiTransactionBlockResponse;
4
+ startExecuteTime: number;
5
+ transactionBlockBytes: string;
6
+ }>;
7
+ };
@@ -1,3 +1,4 @@
1
1
  export declare function useGetPoolListByCoinType(useLocal?: boolean): {
2
2
  getPoolListByCoinType: (fromCoin: string, toCoin: string) => Promise<any[]>;
3
+ getPoolAddressByCoinType: (fromCoin: string, toCoin: string) => Promise<any[]>;
3
4
  };
@@ -1,5 +1,5 @@
1
1
  import { ToastType, TransactionOption } from '../../types';
2
2
  import { Transaction } from '@mysten/sui/transactions';
3
3
  export default function useTransaction(): {
4
- signAndExecuteTransaction: (tx: Transaction, toastType: ToastType, option?: TransactionOption) => Promise<any>;
4
+ signAndExecuteTransaction: (tx: Transaction | (() => Promise<Transaction>), toastType: ToastType, option?: TransactionOption) => Promise<any>;
5
5
  };
@@ -19,4 +19,5 @@ export default function useGetPoolList(): {
19
19
  list: any[];
20
20
  total: number;
21
21
  }>;
22
+ getLocalJsonPoolAddress: (from_type: string, to_type: string) => Promise<string[]>;
22
23
  };
Binary file
Binary file
Binary file
@@ -1,4 +1,4 @@
1
- import { DefaultPairType, DefaultSlippageType, DisplayMode, WidgetBtnSize, WidgetDirection } from '../types';
1
+ import { DefaultPairType, DefaultSlippageType, DisplayMode, ThemeType, WidgetBtnSize, WidgetDirection, WidgetTheme } from '../types';
2
2
  interface DemoState {
3
3
  defaultPairType: DefaultPairType;
4
4
  setDefaultPairType: (value: DefaultPairType) => void;
@@ -22,6 +22,12 @@ interface DemoState {
22
22
  setWidgetBtnSize: (value: WidgetBtnSize) => void;
23
23
  isOpenSwapWidgetModal: boolean;
24
24
  setIsOpenSwapWidgetModal: (value: boolean) => void;
25
+ currentTheme: ThemeType;
26
+ setCurrentTheme: (value: ThemeType) => void;
27
+ customColor: WidgetTheme;
28
+ setCustomColor: (value: WidgetTheme) => void;
29
+ logoUrl: string;
30
+ setLogoUrl: (value: string) => void;
25
31
  }
26
32
  declare const useDemoStore: import('zustand').UseBoundStore<import('zustand').StoreApi<DemoState>>;
27
33
  export default useDemoStore;
@@ -1,5 +1,6 @@
1
1
  import { AggregatorProvider } from '../config/provider';
2
2
  import { ConfigLinkItem } from '../types';
3
+ export type TransactionMode = "Default" | "Fast Mode";
3
4
  interface GlobalState {
4
5
  currentExplorer: string;
5
6
  setCurrentExplorer: (value: string) => void;
@@ -19,6 +20,12 @@ interface GlobalState {
19
20
  setPoolApiMap: (key: string, poolAddress: any[]) => void;
20
21
  mevProtect: boolean;
21
22
  setMevProtect: (value: boolean) => void;
23
+ transactionMode: TransactionMode;
24
+ setTransctionMode: (value: TransactionMode) => void;
25
+ maxCapForGas: string;
26
+ setMaxCapForGas: (value: string) => void;
27
+ customGasPrice: string;
28
+ setCustomGasPrice: (value: string) => void;
22
29
  ignoreWarnTokenMap: Record<string, boolean>;
23
30
  setIgnoreWarnToken: (coin_type: string) => void;
24
31
  }
@@ -32,6 +39,9 @@ declare const useGlobalStore: import('zustand').UseBoundStore<Omit<import('zusta
32
39
  providers: AggregatorProvider[];
33
40
  mevProtect: boolean;
34
41
  ignoreWarnTokenMap: Record<string, boolean>;
42
+ transactionMode: TransactionMode;
43
+ maxCapForGas: string;
44
+ customGasPrice: string;
35
45
  }>>) => void;
36
46
  clearStorage: () => void;
37
47
  rehydrate: () => Promise<void> | void;
@@ -46,6 +56,9 @@ declare const useGlobalStore: import('zustand').UseBoundStore<Omit<import('zusta
46
56
  providers: AggregatorProvider[];
47
57
  mevProtect: boolean;
48
58
  ignoreWarnTokenMap: Record<string, boolean>;
59
+ transactionMode: TransactionMode;
60
+ maxCapForGas: string;
61
+ customGasPrice: string;
49
62
  }>>;
50
63
  };
51
64
  }>;