@cetusprotocol/aggregator-sdk 0.4.1 → 0.4.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 (103) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/index.mjs +1 -1
  3. package/package.json +1 -1
  4. package/.env.example +0 -4
  5. package/bun.lockb +0 -0
  6. package/dist/src/api.d.ts +0 -104
  7. package/dist/src/client.d.ts +0 -118
  8. package/dist/src/const.d.ts +0 -8
  9. package/dist/src/errors.d.ts +0 -40
  10. package/dist/src/index.d.ts +0 -9
  11. package/dist/src/math.d.ts +0 -6
  12. package/dist/src/transaction/afsui.d.ts +0 -10
  13. package/dist/src/transaction/aftermath.d.ts +0 -13
  14. package/dist/src/transaction/alphafi.d.ts +0 -7
  15. package/dist/src/transaction/bluefin.d.ts +0 -7
  16. package/dist/src/transaction/bluemove.d.ts +0 -7
  17. package/dist/src/transaction/cetus.d.ts +0 -15
  18. package/dist/src/transaction/deepbook_v2.d.ts +0 -14
  19. package/dist/src/transaction/deepbook_v3.d.ts +0 -12
  20. package/dist/src/transaction/flowx_v2.d.ts +0 -7
  21. package/dist/src/transaction/flowx_v3.d.ts +0 -8
  22. package/dist/src/transaction/haedal.d.ts +0 -6
  23. package/dist/src/transaction/haedal_pmm.d.ts +0 -7
  24. package/dist/src/transaction/index.d.ts +0 -10
  25. package/dist/src/transaction/kriya_v2.d.ts +0 -6
  26. package/dist/src/transaction/kriya_v3.d.ts +0 -7
  27. package/dist/src/transaction/metastable.d.ts +0 -8
  28. package/dist/src/transaction/obric.d.ts +0 -8
  29. package/dist/src/transaction/scallop.d.ts +0 -8
  30. package/dist/src/transaction/steamm.d.ts +0 -6
  31. package/dist/src/transaction/suilend.d.ts +0 -7
  32. package/dist/src/transaction/swap.d.ts +0 -4
  33. package/dist/src/transaction/turbos.d.ts +0 -7
  34. package/dist/src/transaction/volo.d.ts +0 -8
  35. package/dist/src/types/CoinAssist.d.ts +0 -122
  36. package/dist/src/types/sui.d.ts +0 -112
  37. package/dist/src/utils/api.d.ts +0 -1
  38. package/dist/src/utils/coin.d.ts +0 -11
  39. package/dist/src/utils/contracts.d.ts +0 -16
  40. package/dist/src/utils/index.d.ts +0 -5
  41. package/dist/src/utils/msafe.d.ts +0 -2
  42. package/dist/src/utils/transaction.d.ts +0 -3
  43. package/dist/tests/math.test.d.ts +0 -1
  44. package/dist/tests/router/alphafi.test.d.ts +0 -2
  45. package/dist/tests/router/metastable.test.d.ts +0 -2
  46. package/dist/tests/router/obric.test.d.ts +0 -2
  47. package/dist/tests/router/scallop.test.d.ts +0 -2
  48. package/dist/tests/router/steamm.test.d.ts +0 -2
  49. package/dist/tests/router.test.d.ts +0 -2
  50. package/dist/tests/test_data.test.d.ts +0 -18
  51. package/dist/tests/wallet.test.d.ts +0 -1
  52. package/example/package.json +0 -17
  53. package/example/swap.ts +0 -21
  54. package/example/tsconfig.json +0 -12
  55. package/jest.config.mjs +0 -13
  56. package/src/api.ts +0 -325
  57. package/src/client.ts +0 -1081
  58. package/src/const.ts +0 -15
  59. package/src/errors.ts +0 -77
  60. package/src/index.ts +0 -10
  61. package/src/math.ts +0 -66
  62. package/src/transaction/afsui.ts +0 -62
  63. package/src/transaction/aftermath.ts +0 -88
  64. package/src/transaction/alphafi.ts +0 -50
  65. package/src/transaction/bluefin.ts +0 -46
  66. package/src/transaction/bluemove.ts +0 -42
  67. package/src/transaction/cetus.ts +0 -118
  68. package/src/transaction/deepbook_v2.ts +0 -122
  69. package/src/transaction/deepbook_v3.ts +0 -60
  70. package/src/transaction/flowx_v2.ts +0 -42
  71. package/src/transaction/flowx_v3.ts +0 -52
  72. package/src/transaction/haedal.ts +0 -33
  73. package/src/transaction/haedal_pmm.ts +0 -80
  74. package/src/transaction/index.ts +0 -42
  75. package/src/transaction/kriya_v2.ts +0 -37
  76. package/src/transaction/kriya_v3.ts +0 -47
  77. package/src/transaction/metastable.ts +0 -141
  78. package/src/transaction/obric.ts +0 -90
  79. package/src/transaction/scallop.ts +0 -64
  80. package/src/transaction/steamm.ts +0 -77
  81. package/src/transaction/suilend.ts +0 -48
  82. package/src/transaction/swap.ts +0 -162
  83. package/src/transaction/turbos.ts +0 -56
  84. package/src/transaction/volo.ts +0 -53
  85. package/src/types/CoinAssist.ts +0 -217
  86. package/src/types/sui.ts +0 -148
  87. package/src/utils/api.ts +0 -6
  88. package/src/utils/coin.ts +0 -136
  89. package/src/utils/contracts.ts +0 -136
  90. package/src/utils/index.ts +0 -5
  91. package/src/utils/msafe.ts +0 -40
  92. package/src/utils/transaction.ts +0 -20
  93. package/tests/math.test.ts +0 -21
  94. package/tests/router/alphafi.test.ts +0 -132
  95. package/tests/router/metastable.test.ts +0 -383
  96. package/tests/router/obric.test.ts +0 -203
  97. package/tests/router/scallop.test.ts +0 -133
  98. package/tests/router/steamm.test.ts +0 -130
  99. package/tests/router.test.ts +0 -379
  100. package/tests/test_data.test.ts +0 -28
  101. package/tests/wallet.test.ts +0 -21
  102. package/tsup.config.ts +0 -23
  103. package/version.mjs +0 -28
package/dist/index.js CHANGED
@@ -7319,7 +7319,7 @@ function processEndpoint(endpoint) {
7319
7319
  }
7320
7320
 
7321
7321
  // src/api.ts
7322
- var SDK_VERSION = 1000401;
7322
+ var SDK_VERSION = 1000403;
7323
7323
  function getRouterResult(endpoint, apiKey, params) {
7324
7324
  return __async(this, null, function* () {
7325
7325
  let response;
package/dist/index.mjs CHANGED
@@ -7317,7 +7317,7 @@ function processEndpoint(endpoint) {
7317
7317
  }
7318
7318
 
7319
7319
  // src/api.ts
7320
- var SDK_VERSION = 1000401;
7320
+ var SDK_VERSION = 1000403;
7321
7321
  function getRouterResult(endpoint, apiKey, params) {
7322
7322
  return __async(this, null, function* () {
7323
7323
  let response;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cetusprotocol/aggregator-sdk",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "sideEffects": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/.env.example DELETED
@@ -1,4 +0,0 @@
1
- SUI_PRC=
2
- SUI_WALLET_SECRET=
3
- SUI_WALLET_MNEMONICS=
4
- CETUS_AGGREGATOR=
package/bun.lockb DELETED
Binary file
package/dist/src/api.d.ts DELETED
@@ -1,104 +0,0 @@
1
- import BN from "bn.js";
2
- import Decimal from "decimal.js";
3
- export interface FindRouterParams {
4
- from: string;
5
- target: string;
6
- amount: BN;
7
- byAmountIn: boolean;
8
- depth?: number;
9
- splitAlgorithm?: string;
10
- splitFactor?: number;
11
- splitCount?: number;
12
- providers?: string[];
13
- liquidityChanges?: PreSwapLpChangeParams[];
14
- }
15
- export interface PreSwapLpChangeParams {
16
- poolID: string;
17
- ticklower: number;
18
- tickUpper: number;
19
- deltaLiquidity: number;
20
- }
21
- export type ExtendedDetails = {
22
- aftermathPoolFlatness?: number;
23
- aftermathLpSupplyType?: string;
24
- turbosFeeType?: string;
25
- afterSqrtPrice?: string;
26
- deepbookv3DeepFee?: number;
27
- scallopScoinTreasury?: string;
28
- haedalPmmBasePriceSeed?: string;
29
- haedalPmmQuotePriceSeed?: string;
30
- steammBankA?: string;
31
- steammBankB?: string;
32
- steammLendingMarket?: string;
33
- steammLendingMarketType?: string;
34
- steammBCoinAType?: string;
35
- steammBCoinBType?: string;
36
- steammLPToken?: string;
37
- metastablePriceSeed?: string;
38
- metastableETHPriceSeed?: string;
39
- metastableWhitelistedAppId?: string;
40
- metastableCreateCapPkgId?: string;
41
- metastableCreateCapModule?: string;
42
- metastableCreateCapAllTypeParams?: boolean;
43
- metastableRegistryId?: string;
44
- obricCoinAPriceSeed?: string;
45
- obricCoinBPriceSeed?: string;
46
- obricCoinAPriceId?: string;
47
- obricCoinBPriceId?: string;
48
- };
49
- export type Path = {
50
- id: string;
51
- direction: boolean;
52
- provider: string;
53
- from: string;
54
- target: string;
55
- feeRate: number;
56
- amountIn: string;
57
- amountOut: string;
58
- version?: string;
59
- extendedDetails?: ExtendedDetails;
60
- };
61
- export type Router = {
62
- path: Path[];
63
- amountIn: BN;
64
- amountOut: BN;
65
- initialPrice: Decimal;
66
- };
67
- export type RouterError = {
68
- code: number;
69
- msg: string;
70
- };
71
- export type RouterData = {
72
- amountIn: BN;
73
- amountOut: BN;
74
- byAmountIn: boolean;
75
- routes: Router[];
76
- insufficientLiquidity: boolean;
77
- packages?: Map<string, string>;
78
- totalDeepFee?: number;
79
- error?: RouterError;
80
- };
81
- export type AggregatorResponse = {
82
- code: number;
83
- msg: string;
84
- data: RouterData;
85
- };
86
- export declare function getRouterResult(endpoint: string, apiKey: string, params: FindRouterParams): Promise<RouterData | null>;
87
- export type DeepbookV3Config = {
88
- id: string;
89
- is_alternative_payment: boolean;
90
- alternative_payment_amount: number;
91
- trade_cap: string;
92
- balance_manager: string;
93
- deep_fee_vault: number;
94
- whitelist: number;
95
- package_version: 0;
96
- last_updated_time: number;
97
- whitelist_pools: string[];
98
- };
99
- export type DeepbookV3ConfigResponse = {
100
- code: number;
101
- msg: string;
102
- data: DeepbookV3Config;
103
- };
104
- export declare function getDeepbookV3Config(endpoint: string): Promise<DeepbookV3ConfigResponse | null>;
@@ -1,118 +0,0 @@
1
- import { SuiClient } from "@mysten/sui/client";
2
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
3
- import { Signer } from "@mysten/sui/cryptography";
4
- import BN from "bn.js";
5
- import { Dex, Env, FindRouterParams, Router, RouterData, DeepbookV3Config } from ".";
6
- import { CoinAsset } from "./types/sui";
7
- import { SuiPriceServiceConnection } from "@pythnetwork/pyth-sui-js";
8
- export declare const CETUS = "CETUS";
9
- export declare const DEEPBOOKV2 = "DEEPBOOK";
10
- export declare const KRIYA = "KRIYA";
11
- export declare const FLOWXV2 = "FLOWX";
12
- export declare const FLOWXV3 = "FLOWXV3";
13
- export declare const KRIYAV3 = "KRIYAV3";
14
- export declare const TURBOS = "TURBOS";
15
- export declare const AFTERMATH = "AFTERMATH";
16
- export declare const HAEDAL = "HAEDAL";
17
- export declare const VOLO = "VOLO";
18
- export declare const AFSUI = "AFSUI";
19
- export declare const BLUEMOVE = "BLUEMOVE";
20
- export declare const DEEPBOOKV3 = "DEEPBOOKV3";
21
- export declare const SCALLOP = "SCALLOP";
22
- export declare const SUILEND = "SUILEND";
23
- export declare const BLUEFIN = "BLUEFIN";
24
- export declare const HAEDALPMM = "HAEDALPMM";
25
- export declare const ALPHAFI = "ALPHAFI";
26
- export declare const SPRINGSUI = "SPRINGSUI";
27
- export declare const STEAMM = "STEAMM";
28
- export declare const METASTABLE = "METASTABLE";
29
- export declare const OBRIC = "OBRIC";
30
- export declare const DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v2";
31
- export type BuildRouterSwapParams = {
32
- routers: Router[];
33
- byAmountIn: boolean;
34
- inputCoin: TransactionObjectArgument;
35
- slippage: number;
36
- txb: Transaction;
37
- partner?: string;
38
- deepbookv3DeepFee?: TransactionObjectArgument;
39
- };
40
- export type BuildFastRouterSwapParams = {
41
- routers: Router[];
42
- byAmountIn: boolean;
43
- slippage: number;
44
- txb: Transaction;
45
- partner?: string;
46
- refreshAllCoins?: boolean;
47
- payDeepFeeAmount?: number;
48
- };
49
- export type BuildRouterSwapParamsV2 = {
50
- routers: RouterData;
51
- inputCoin: TransactionObjectArgument;
52
- slippage: number;
53
- txb: Transaction;
54
- partner?: string;
55
- deepbookv3DeepFee?: TransactionObjectArgument;
56
- };
57
- export type BuildFastRouterSwapParamsV2 = {
58
- routers: RouterData;
59
- slippage: number;
60
- txb: Transaction;
61
- partner?: string;
62
- refreshAllCoins?: boolean;
63
- payDeepFeeAmount?: number;
64
- };
65
- export interface SwapInPoolsParams {
66
- from: string;
67
- target: string;
68
- amount: BN;
69
- byAmountIn: boolean;
70
- pools: string[];
71
- }
72
- export interface SwapInPoolsResult {
73
- isExceed: boolean;
74
- routeData?: RouterData;
75
- }
76
- export type AggregatorClientParams = {
77
- endpoint?: string;
78
- signer?: string;
79
- client?: SuiClient;
80
- env?: Env;
81
- pythUrls?: string[];
82
- apiKey?: string;
83
- };
84
- export declare class AggregatorClient {
85
- endpoint: string;
86
- signer: string;
87
- client: SuiClient;
88
- env: Env;
89
- apiKey: string;
90
- private allCoins;
91
- private pythConnections;
92
- private pythClient;
93
- private static readonly CONFIG;
94
- constructor(params: AggregatorClientParams);
95
- newPythClients(pythUrls: string[]): SuiPriceServiceConnection[];
96
- getCoins(coinType: string, refresh?: boolean): Promise<CoinAsset[]>;
97
- findRouters(params: FindRouterParams): Promise<RouterData | null>;
98
- executeFlexibleInputSwap(txb: Transaction, inputCoin: TransactionObjectArgument, routers: Router[], amountOutLimit: BN, pythPriceIDs: Map<string, string>, partner?: string, deepbookv3DeepFee?: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
99
- expectInputSwap(txb: Transaction, inputCoin: TransactionObjectArgument, routers: Router[], amountOutLimit: BN, pythPriceIDs: Map<string, string>, partner?: string, deepbookv3DeepFee?: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
100
- expectOutputSwap(txb: Transaction, inputCoin: TransactionObjectArgument, routers: Router[], partner?: string, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
101
- swapInPools(params: SwapInPoolsParams): Promise<SwapInPoolsResult | null>;
102
- routerSwap(params: BuildRouterSwapParams | BuildRouterSwapParamsV2): Promise<TransactionObjectArgument>;
103
- fixableRouterSwap(params: BuildRouterSwapParamsV2): Promise<TransactionObjectArgument>;
104
- fastRouterSwap(params: BuildFastRouterSwapParams | BuildFastRouterSwapParamsV2): Promise<void>;
105
- publishedAtV2(): string;
106
- publishedAtV2Extend(): string;
107
- deepbookv3DeepFeeType(): string;
108
- transferOrDestoryCoin(txb: Transaction, coin: TransactionObjectArgument, coinType: string, aggregatorV2PublishedAt: string): void;
109
- checkCoinThresholdAndMergeCoin(txb: Transaction, coins: TransactionObjectArgument[], coinType: string, amountLimit: BN, aggregatorV2PublishedAt: string): TransactionObjectArgument;
110
- newDex(provider: string, pythPriceIDs: Map<string, string>, partner?: string): Dex;
111
- signAndExecuteTransaction(txb: Transaction, signer: Signer): Promise<import("@mysten/sui/client").SuiTransactionBlockResponse>;
112
- devInspectTransactionBlock(txb: Transaction): Promise<import("@mysten/sui/client").DevInspectResults>;
113
- sendTransaction(txb: Transaction, signer: Signer): Promise<import("@mysten/sui/client").SuiTransactionBlockResponse>;
114
- getDeepbookV3Config(): Promise<DeepbookV3Config | null>;
115
- updatePythPriceIDs(priceIDs: string[], txb: Transaction): Promise<Map<string, string>>;
116
- }
117
- export declare function findPythPriceIDs(routes: Router[]): string[];
118
- export declare function parseRouterResponse(data: any, byAmountIn: boolean): RouterData;
@@ -1,8 +0,0 @@
1
- import BN from "bn.js";
2
- export declare const ZERO: BN;
3
- export declare const ONE: BN;
4
- export declare const TWO: BN;
5
- export declare const U128: BN;
6
- export declare const U64_MAX_BN: BN;
7
- export declare const U64_MAX = "18446744073709551615";
8
- export declare const TEN_POW_NINE = 1000000000;
@@ -1,40 +0,0 @@
1
- export declare enum TypesErrorCode {
2
- InvalidType = "InvalidType"
3
- }
4
- export declare enum ConfigErrorCode {
5
- MissAggregatorPackage = "MissAggregatorPackage",
6
- MissGlobalConfig = "MissGlobalConfig",
7
- InvalidWallet = "InvalidWallet",
8
- SimulateError = "SimulateError"
9
- }
10
- export declare enum TransactionErrorCode {
11
- InsufficientBalance = "InsufficientBalance",
12
- SimulateEventError = "simulateEventError",
13
- CannotGetDecimals = "CannotGetDecimals",
14
- MissCoinA = "MissCoinA",
15
- MissCoinB = "MissCoinB",
16
- MissTurbosFeeType = "MissTurbosFeeType",
17
- MissAftermathLpSupplyType = "MissAftermathLpSupplyType"
18
- }
19
- export type AggregatorErrorCode = TypesErrorCode | ConfigErrorCode | TransactionErrorCode;
20
- /**
21
- * AggregatorError is a custom error class that extends the built-in Error class. It is used to represent errors that occur during aggregation operations.
22
- * The key functionality of this code includes:
23
- * - Defining the AggregatorError class that represents an error during aggregation. It includes a message property and an optional errorCode property.
24
- * - Providing a static method isAggregatorErrorCode() that checks if a given error instance is an instance of AggregatorError and has a specific error code.
25
- */
26
- export declare class AggregatorError extends Error {
27
- message: string;
28
- errorCode?: AggregatorErrorCode;
29
- constructor(message: string, errorCode?: AggregatorErrorCode);
30
- static isAggregatorErrorCode(e: any, code: AggregatorErrorCode): boolean;
31
- }
32
- export declare enum AggregatorServerErrorCode {
33
- CalculateError = 10000,
34
- NumberTooLarge = 10001,
35
- NoRouter = 10002,
36
- InsufficientLiquidity = 10003,
37
- HoneyPot = 10004,
38
- RateLimitExceeded = 10005
39
- }
40
- export declare function getAggregatorServerErrorMessage(code: AggregatorServerErrorCode): string;
@@ -1,9 +0,0 @@
1
- export * from "./client";
2
- export * from "./transaction";
3
- export * from "./utils";
4
- export * from "./const";
5
- export * from "./api";
6
- export declare enum Env {
7
- Mainnet = 0,
8
- Testnet = 1
9
- }
@@ -1,6 +0,0 @@
1
- import BN from "bn.js";
2
- import Decimal from "decimal.js";
3
- export declare function CalculateAmountLimit(expectAmount: BN, byAmountIn: boolean, slippage: number): number;
4
- export declare function CalculateAmountLimitBN(expectAmount: BN, byAmountIn: boolean, slippage: number): BN;
5
- export declare function GetDefaultSqrtPriceLimit(a2b: boolean): BN;
6
- export declare function sqrtPriceX64ToPrice(sqrtPriceStr: string, decimalsA: number, decimalsB: number): Decimal;
@@ -1,10 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class Afsui implements Dex {
4
- private stakedSuiVault;
5
- private safe;
6
- private referVault;
7
- private validator;
8
- constructor(env: Env);
9
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
10
- }
@@ -1,13 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class Aftermath implements Dex {
4
- private slippage;
5
- private poolRegistry;
6
- private protocolFeeVault;
7
- private treasury;
8
- private insuranceFund;
9
- private referrealVault;
10
- constructor(env: Env);
11
- amountLimit(exportAmountOut: string): string;
12
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
13
- }
@@ -1,7 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class Alphafi implements Dex {
4
- private sui_system_state;
5
- constructor(env: Env);
6
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
7
- }
@@ -1,7 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class Bluefin implements Dex {
4
- private globalConfig;
5
- constructor(env: Env);
6
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
7
- }
@@ -1,7 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class Bluemove implements Dex {
4
- private dexInfo;
5
- constructor(env: Env);
6
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
7
- }
@@ -1,15 +0,0 @@
1
- import { Transaction, TransactionArgument, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export type CetusFlashSwapResult = {
4
- targetCoin: TransactionObjectArgument;
5
- flashReceipt: TransactionObjectArgument;
6
- payAmount: TransactionArgument;
7
- };
8
- export declare class Cetus implements Dex {
9
- private globalConfig;
10
- private partner;
11
- constructor(env: Env, partner?: string);
12
- flash_swap(client: AggregatorClient, txb: Transaction, path: Path, by_amount_in: boolean, packages?: Map<string, string>): CetusFlashSwapResult;
13
- repay_flash_swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, receipt: TransactionArgument, packages?: Map<string, string>): TransactionObjectArgument;
14
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
15
- }
@@ -1,14 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- import { SuiClient } from "@mysten/sui/client";
4
- type GetOrCreateAccountCapResult = {
5
- accountCap: TransactionObjectArgument;
6
- isCreate: boolean;
7
- };
8
- export declare class DeepbookV2 implements Dex {
9
- constructor(env: Env);
10
- getAccountCap(client: SuiClient, owner: string): Promise<string | null>;
11
- getOrCreateAccountCap(txb: Transaction, client: SuiClient, owner: string): Promise<GetOrCreateAccountCapResult>;
12
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
13
- }
14
- export {};
@@ -1,12 +0,0 @@
1
- import { Transaction, TransactionArgument, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export type CetusFlashSwapResult = {
4
- targetCoin: TransactionObjectArgument;
5
- flashReceipt: TransactionObjectArgument;
6
- payAmount: TransactionArgument;
7
- };
8
- export declare class DeepbookV3 implements Dex {
9
- private deepbookV3Config;
10
- constructor(env: Env);
11
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>, deepbookv3DeepFee?: TransactionObjectArgument): Promise<TransactionObjectArgument>;
12
- }
@@ -1,7 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class FlowxV2 implements Dex {
4
- private container;
5
- constructor(env: Env);
6
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
7
- }
@@ -1,8 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class FlowxV3 implements Dex {
4
- private versioned;
5
- private poolRegistry;
6
- constructor(env: Env);
7
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
8
- }
@@ -1,6 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class Haedal implements Dex {
4
- constructor(env: Env);
5
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
6
- }
@@ -1,7 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class HaedalPmm implements Dex {
4
- private pythPriceIDs;
5
- constructor(env: Env, pythPriceIDs: Map<string, string>);
6
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
7
- }
@@ -1,10 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Path } from "..";
3
- export declare const CLOCK_ADDRESS: string;
4
- export declare const AGGREGATOR_V2 = "aggregator_v2";
5
- export declare const AGGREGATOR_V2_EXTEND = "aggregator_v2_extend";
6
- export declare function getAggregatorV2PublishedAt(aggregatorV2PublishedAt: string, packages?: Map<string, string> | Record<string, string>): string;
7
- export declare function getAggregatorV2ExtendPublishedAt(aggregatorV2ExtendPublishedAt: string, packages?: Map<string, string> | Record<string, string>): string;
8
- export interface Dex {
9
- swap(client: AggregatorClient, ptb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>, deepbookv3DeepFee?: TransactionObjectArgument): Promise<TransactionObjectArgument>;
10
- }
@@ -1,6 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class KriyaV2 implements Dex {
4
- constructor(env: Env);
5
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
6
- }
@@ -1,7 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class KriyaV3 implements Dex {
4
- private version;
5
- constructor(env: Env);
6
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
7
- }
@@ -1,8 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class Metastable implements Dex {
4
- private pythPriceIDs;
5
- private versionID;
6
- constructor(env: Env, pythPriceIDs: Map<string, string>);
7
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
8
- }
@@ -1,8 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class Obric implements Dex {
4
- private pythPriceIDs;
5
- private pythStateObjectId;
6
- constructor(env: Env, pythPriceIDs: Map<string, string>);
7
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
8
- }
@@ -1,8 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class Scallop implements Dex {
4
- private version;
5
- private market;
6
- constructor(env: Env);
7
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
8
- }
@@ -1,6 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class Steamm implements Dex {
4
- constructor(env: Env);
5
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
6
- }
@@ -1,7 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class Suilend implements Dex {
4
- private sui_system_state;
5
- constructor(env: Env);
6
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
7
- }
@@ -1,4 +0,0 @@
1
- import { SwapInPoolsParams } from "~/client";
2
- import { Env, SwapInPoolsResult } from "..";
3
- import { SuiClient } from "@mysten/sui/client";
4
- export declare function swapInPools(client: SuiClient, params: SwapInPoolsParams, sender: string, env: Env): Promise<SwapInPoolsResult>;
@@ -1,7 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class Turbos implements Dex {
4
- private versioned;
5
- constructor(env: Env);
6
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
7
- }
@@ -1,8 +0,0 @@
1
- import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- import { AggregatorClient, Dex, Env, Path } from "..";
3
- export declare class Volo implements Dex {
4
- private nativePool;
5
- private metadata;
6
- constructor(env: Env);
7
- swap(client: AggregatorClient, txb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
8
- }