@cetusprotocol/aggregator-sdk 0.4.1 → 0.4.2
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/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/src/api.d.ts +0 -104
- package/dist/src/client.d.ts +0 -118
- package/dist/src/const.d.ts +0 -8
- package/dist/src/errors.d.ts +0 -40
- package/dist/src/index.d.ts +0 -9
- package/dist/src/math.d.ts +0 -6
- package/dist/src/transaction/afsui.d.ts +0 -10
- package/dist/src/transaction/aftermath.d.ts +0 -13
- package/dist/src/transaction/alphafi.d.ts +0 -7
- package/dist/src/transaction/bluefin.d.ts +0 -7
- package/dist/src/transaction/bluemove.d.ts +0 -7
- package/dist/src/transaction/cetus.d.ts +0 -15
- package/dist/src/transaction/deepbook_v2.d.ts +0 -14
- package/dist/src/transaction/deepbook_v3.d.ts +0 -12
- package/dist/src/transaction/flowx_v2.d.ts +0 -7
- package/dist/src/transaction/flowx_v3.d.ts +0 -8
- package/dist/src/transaction/haedal.d.ts +0 -6
- package/dist/src/transaction/haedal_pmm.d.ts +0 -7
- package/dist/src/transaction/index.d.ts +0 -10
- package/dist/src/transaction/kriya_v2.d.ts +0 -6
- package/dist/src/transaction/kriya_v3.d.ts +0 -7
- package/dist/src/transaction/metastable.d.ts +0 -8
- package/dist/src/transaction/obric.d.ts +0 -8
- package/dist/src/transaction/scallop.d.ts +0 -8
- package/dist/src/transaction/steamm.d.ts +0 -6
- package/dist/src/transaction/suilend.d.ts +0 -7
- package/dist/src/transaction/swap.d.ts +0 -4
- package/dist/src/transaction/turbos.d.ts +0 -7
- package/dist/src/transaction/volo.d.ts +0 -8
- package/dist/src/types/CoinAssist.d.ts +0 -122
- package/dist/src/types/sui.d.ts +0 -112
- package/dist/src/utils/api.d.ts +0 -1
- package/dist/src/utils/coin.d.ts +0 -11
- package/dist/src/utils/contracts.d.ts +0 -16
- package/dist/src/utils/index.d.ts +0 -5
- package/dist/src/utils/msafe.d.ts +0 -2
- package/dist/src/utils/transaction.d.ts +0 -3
- package/dist/tests/math.test.d.ts +0 -1
- package/dist/tests/router/alphafi.test.d.ts +0 -2
- package/dist/tests/router/metastable.test.d.ts +0 -2
- package/dist/tests/router/obric.test.d.ts +0 -2
- package/dist/tests/router/scallop.test.d.ts +0 -2
- package/dist/tests/router/steamm.test.d.ts +0 -2
- package/dist/tests/router.test.d.ts +0 -2
- package/dist/tests/test_data.test.d.ts +0 -18
- package/dist/tests/wallet.test.d.ts +0 -1
- package/example/package.json +0 -17
- package/example/swap.ts +0 -21
- package/example/tsconfig.json +0 -12
- package/jest.config.mjs +0 -13
- package/src/api.ts +0 -325
- package/src/client.ts +0 -1081
- package/src/const.ts +0 -15
- package/src/errors.ts +0 -77
- package/src/index.ts +0 -10
- package/src/math.ts +0 -66
- package/src/transaction/afsui.ts +0 -62
- package/src/transaction/aftermath.ts +0 -88
- package/src/transaction/alphafi.ts +0 -50
- package/src/transaction/bluefin.ts +0 -46
- package/src/transaction/bluemove.ts +0 -42
- package/src/transaction/cetus.ts +0 -118
- package/src/transaction/deepbook_v2.ts +0 -122
- package/src/transaction/deepbook_v3.ts +0 -60
- package/src/transaction/flowx_v2.ts +0 -42
- package/src/transaction/flowx_v3.ts +0 -52
- package/src/transaction/haedal.ts +0 -33
- package/src/transaction/haedal_pmm.ts +0 -80
- package/src/transaction/index.ts +0 -42
- package/src/transaction/kriya_v2.ts +0 -37
- package/src/transaction/kriya_v3.ts +0 -47
- package/src/transaction/metastable.ts +0 -141
- package/src/transaction/obric.ts +0 -90
- package/src/transaction/scallop.ts +0 -64
- package/src/transaction/steamm.ts +0 -77
- package/src/transaction/suilend.ts +0 -48
- package/src/transaction/swap.ts +0 -162
- package/src/transaction/turbos.ts +0 -56
- package/src/transaction/volo.ts +0 -53
- package/src/types/CoinAssist.ts +0 -217
- package/src/types/sui.ts +0 -148
- package/src/utils/api.ts +0 -6
- package/src/utils/coin.ts +0 -136
- package/src/utils/contracts.ts +0 -136
- package/src/utils/index.ts +0 -5
- package/src/utils/msafe.ts +0 -40
- package/src/utils/transaction.ts +0 -20
- package/tests/math.test.ts +0 -21
- package/tests/router/alphafi.test.ts +0 -132
- package/tests/router/metastable.test.ts +0 -383
- package/tests/router/obric.test.ts +0 -203
- package/tests/router/scallop.test.ts +0 -133
- package/tests/router/steamm.test.ts +0 -130
- package/tests/router.test.ts +0 -379
- package/tests/test_data.test.ts +0 -28
- package/tests/wallet.test.ts +0 -21
- package/tsup.config.ts +0 -23
- package/version.mjs +0 -28
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import type { SuiMoveObject } from '@mysten/sui/client';
|
|
2
|
-
import type { CoinAsset, SuiAddress } from './sui';
|
|
3
|
-
export declare const DEFAULT_GAS_BUDGET_FOR_SPLIT = 1000;
|
|
4
|
-
export declare const DEFAULT_GAS_BUDGET_FOR_MERGE = 500;
|
|
5
|
-
export declare const DEFAULT_GAS_BUDGET_FOR_TRANSFER = 100;
|
|
6
|
-
export declare const DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI = 100;
|
|
7
|
-
export declare const DEFAULT_GAS_BUDGET_FOR_STAKE = 1000;
|
|
8
|
-
export declare const GAS_TYPE_ARG = "0x2::sui::SUI";
|
|
9
|
-
export declare const GAS_TYPE_ARG_LONG = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
10
|
-
export declare const GAS_SYMBOL = "SUI";
|
|
11
|
-
export declare const DEFAULT_NFT_TRANSFER_GAS_FEE = 450;
|
|
12
|
-
export declare const SUI_SYSTEM_STATE_OBJECT_ID = "0x0000000000000000000000000000000000000005";
|
|
13
|
-
/**
|
|
14
|
-
* This class provides helper methods for working with coins.
|
|
15
|
-
*/
|
|
16
|
-
export declare class CoinUtils {
|
|
17
|
-
/**
|
|
18
|
-
* Get the coin type argument from a SuiMoveObject.
|
|
19
|
-
*
|
|
20
|
-
* @param obj The SuiMoveObject to get the coin type argument from.
|
|
21
|
-
* @returns The coin type argument, or null if it is not found.
|
|
22
|
-
*/
|
|
23
|
-
static getCoinTypeArg(obj: SuiMoveObject): string | null;
|
|
24
|
-
/**
|
|
25
|
-
* Get whether a SuiMoveObject is a SUI coin.
|
|
26
|
-
*
|
|
27
|
-
* @param obj The SuiMoveObject to check.
|
|
28
|
-
* @returns Whether the SuiMoveObject is a SUI coin.
|
|
29
|
-
*/
|
|
30
|
-
static isSUI(obj: SuiMoveObject): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Get the coin symbol from a coin type argument.
|
|
33
|
-
*
|
|
34
|
-
* @param coinTypeArg The coin type argument to get the symbol from.
|
|
35
|
-
* @returns The coin symbol.
|
|
36
|
-
*/
|
|
37
|
-
static getCoinSymbol(coinTypeArg: string): string;
|
|
38
|
-
/**
|
|
39
|
-
* Get the balance of a SuiMoveObject.
|
|
40
|
-
*
|
|
41
|
-
* @param obj The SuiMoveObject to get the balance from.
|
|
42
|
-
* @returns The balance of the SuiMoveObject.
|
|
43
|
-
*/
|
|
44
|
-
static getBalance(obj: SuiMoveObject): bigint;
|
|
45
|
-
/**
|
|
46
|
-
* Get the total balance of a list of CoinAsset objects for a given coin address.
|
|
47
|
-
*
|
|
48
|
-
* @param objs The list of CoinAsset objects to get the total balance for.
|
|
49
|
-
* @param coinAddress The coin address to get the total balance for.
|
|
50
|
-
* @returns The total balance of the CoinAsset objects for the given coin address.
|
|
51
|
-
*/
|
|
52
|
-
static totalBalance(objs: CoinAsset[], coinAddress: SuiAddress): bigint;
|
|
53
|
-
/**
|
|
54
|
-
* Get the ID of a SuiMoveObject.
|
|
55
|
-
*
|
|
56
|
-
* @param obj The SuiMoveObject to get the ID from.
|
|
57
|
-
* @returns The ID of the SuiMoveObject.
|
|
58
|
-
*/
|
|
59
|
-
static getID(obj: SuiMoveObject): string;
|
|
60
|
-
/**
|
|
61
|
-
* Get the coin type from a coin type argument.
|
|
62
|
-
*
|
|
63
|
-
* @param coinTypeArg The coin type argument to get the coin type from.
|
|
64
|
-
* @returns The coin type.
|
|
65
|
-
*/
|
|
66
|
-
static getCoinTypeFromArg(coinTypeArg: string): string;
|
|
67
|
-
/**
|
|
68
|
-
* Get the CoinAsset objects for a given coin type.
|
|
69
|
-
*
|
|
70
|
-
* @param coinType The coin type to get the CoinAsset objects for.
|
|
71
|
-
* @param allSuiObjects The list of all SuiMoveObjects.
|
|
72
|
-
* @returns The CoinAsset objects for the given coin type.
|
|
73
|
-
*/
|
|
74
|
-
static getCoinAssets(coinType: string, allSuiObjects: CoinAsset[]): CoinAsset[];
|
|
75
|
-
/**
|
|
76
|
-
* Get whether a coin address is a SUI coin.
|
|
77
|
-
*
|
|
78
|
-
* @param coinAddress The coin address to check.
|
|
79
|
-
* @returns Whether the coin address is a SUI coin.
|
|
80
|
-
*/
|
|
81
|
-
static isSuiCoin(coinAddress: SuiAddress): boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Select the CoinAsset objects from a list of CoinAsset objects that have a balance greater than or equal to a given amount.
|
|
84
|
-
*
|
|
85
|
-
* @param coins The list of CoinAsset objects to select from.
|
|
86
|
-
* @param amount The amount to select CoinAsset objects with a balance greater than or equal to.
|
|
87
|
-
* @param exclude A list of CoinAsset objects to exclude from the selection.
|
|
88
|
-
* @returns The CoinAsset objects that have a balance greater than or equal to the given amount.
|
|
89
|
-
*/
|
|
90
|
-
static selectCoinObjectIdGreaterThanOrEqual(coins: CoinAsset[], amount: bigint, exclude?: string[]): {
|
|
91
|
-
objectArray: string[];
|
|
92
|
-
remainCoins: CoinAsset[];
|
|
93
|
-
amountArray: string[];
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Select the CoinAsset objects from a list of CoinAsset objects that have a balance greater than or equal to a given amount.
|
|
97
|
-
*
|
|
98
|
-
* @param coins The list of CoinAsset objects to select from.
|
|
99
|
-
* @param amount The amount to select CoinAsset objects with a balance greater than or equal to.
|
|
100
|
-
* @param exclude A list of CoinAsset objects to exclude from the selection.
|
|
101
|
-
* @returns The CoinAsset objects that have a balance greater than or equal to the given amount.
|
|
102
|
-
*/
|
|
103
|
-
static selectCoinAssetGreaterThanOrEqual(coins: CoinAsset[], amount: bigint, exclude?: string[]): {
|
|
104
|
-
selectedCoins: CoinAsset[];
|
|
105
|
-
remainingCoins: CoinAsset[];
|
|
106
|
-
};
|
|
107
|
-
/**
|
|
108
|
-
* Sort the CoinAsset objects by their balance.
|
|
109
|
-
*
|
|
110
|
-
* @param coins The CoinAsset objects to sort.
|
|
111
|
-
* @returns The sorted CoinAsset objects.
|
|
112
|
-
*/
|
|
113
|
-
static sortByBalance(coins: CoinAsset[]): CoinAsset[];
|
|
114
|
-
static sortByBalanceDes(coins: CoinAsset[]): CoinAsset[];
|
|
115
|
-
/**
|
|
116
|
-
* Calculate the total balance of a list of CoinAsset objects.
|
|
117
|
-
*
|
|
118
|
-
* @param coins The list of CoinAsset objects to calculate the total balance for.
|
|
119
|
-
* @returns The total balance of the CoinAsset objects.
|
|
120
|
-
*/
|
|
121
|
-
static calculateTotalBalance(coins: CoinAsset[]): bigint;
|
|
122
|
-
}
|
package/dist/src/types/sui.d.ts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import type { TransactionArgument } from '@mysten/sui/transactions';
|
|
2
|
-
import Decimal from 'decimal.js';
|
|
3
|
-
/**
|
|
4
|
-
* Represents a SUI address, which is a string.
|
|
5
|
-
*/
|
|
6
|
-
export type SuiAddress = string;
|
|
7
|
-
/**
|
|
8
|
-
* Represents a SUI object identifier, which is a string.
|
|
9
|
-
*/
|
|
10
|
-
export type SuiObjectIdType = string;
|
|
11
|
-
/**
|
|
12
|
-
* Represents a BigNumber, which can be a Decimal.Value, number, or string.
|
|
13
|
-
*/
|
|
14
|
-
export type BigNumber = Decimal.Value | number | string;
|
|
15
|
-
/**
|
|
16
|
-
* Represents a SUI resource, which can be of any type.
|
|
17
|
-
*/
|
|
18
|
-
export type SuiResource = any;
|
|
19
|
-
/**
|
|
20
|
-
* Represents a Non-Fungible Token (NFT) with associated metadata.
|
|
21
|
-
*/
|
|
22
|
-
export type NFT = {
|
|
23
|
-
/**
|
|
24
|
-
* The address or identifier of the creator of the NFT.
|
|
25
|
-
*/
|
|
26
|
-
creator: string;
|
|
27
|
-
/**
|
|
28
|
-
* A description providing additional information about the NFT.
|
|
29
|
-
*/
|
|
30
|
-
description: string;
|
|
31
|
-
/**
|
|
32
|
-
* The URL to the image representing the NFT visually.
|
|
33
|
-
*/
|
|
34
|
-
image_url: string;
|
|
35
|
-
/**
|
|
36
|
-
* A link associated with the NFT, providing more details or interactions.
|
|
37
|
-
*/
|
|
38
|
-
link: string;
|
|
39
|
-
/**
|
|
40
|
-
* The name or title of the NFT.
|
|
41
|
-
*/
|
|
42
|
-
name: string;
|
|
43
|
-
/**
|
|
44
|
-
* The URL to the project or collection associated with the NFT.
|
|
45
|
-
*/
|
|
46
|
-
project_url: string;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Represents a SUI struct tag.
|
|
50
|
-
*/
|
|
51
|
-
export type SuiStructTag = {
|
|
52
|
-
/**
|
|
53
|
-
* The full address of the struct.
|
|
54
|
-
*/
|
|
55
|
-
full_address: string;
|
|
56
|
-
/**
|
|
57
|
-
* The source address of the struct.
|
|
58
|
-
*/
|
|
59
|
-
source_address: string;
|
|
60
|
-
/**
|
|
61
|
-
* The address of the struct.
|
|
62
|
-
*/
|
|
63
|
-
address: SuiAddress;
|
|
64
|
-
/**
|
|
65
|
-
* The module to which the struct belongs.
|
|
66
|
-
*/
|
|
67
|
-
module: string;
|
|
68
|
-
/**
|
|
69
|
-
* The name of the struct.
|
|
70
|
-
*/
|
|
71
|
-
name: string;
|
|
72
|
-
/**
|
|
73
|
-
* An array of type arguments (SUI addresses) for the struct.
|
|
74
|
-
*/
|
|
75
|
-
type_arguments: SuiAddress[];
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Represents basic SUI data types.
|
|
79
|
-
*/
|
|
80
|
-
export type SuiBasicTypes = 'address' | 'bool' | 'u8' | 'u16' | 'u32' | 'u64' | 'u128' | 'u256';
|
|
81
|
-
/**
|
|
82
|
-
* Represents a SUI transaction argument, which can be of various types.
|
|
83
|
-
*/
|
|
84
|
-
export type SuiTxArg = TransactionArgument | string | number | bigint | boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Represents input types for SUI data.
|
|
87
|
-
*/
|
|
88
|
-
export type SuiInputTypes = 'object' | SuiBasicTypes;
|
|
89
|
-
/**
|
|
90
|
-
* Gets the default SUI input type based on the provided value.
|
|
91
|
-
* @param value - The value to determine the default input type for.
|
|
92
|
-
* @returns The default SUI input type.
|
|
93
|
-
* @throws Error if the type of the value is unknown.
|
|
94
|
-
*/
|
|
95
|
-
export declare const getDefaultSuiInputType: (value: any) => SuiInputTypes;
|
|
96
|
-
/**
|
|
97
|
-
* Represents a coin asset with address, object ID, and balance information.
|
|
98
|
-
*/
|
|
99
|
-
export type CoinAsset = {
|
|
100
|
-
/**
|
|
101
|
-
* The address type of the coin asset.
|
|
102
|
-
*/
|
|
103
|
-
coinAddress: SuiAddress;
|
|
104
|
-
/**
|
|
105
|
-
* The object identifier of the coin asset.
|
|
106
|
-
*/
|
|
107
|
-
coinObjectId: SuiObjectIdType;
|
|
108
|
-
/**
|
|
109
|
-
* The balance amount of the coin asset.
|
|
110
|
-
*/
|
|
111
|
-
balance: bigint;
|
|
112
|
-
};
|
package/dist/src/utils/api.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function processEndpoint(endpoint: string): string;
|
package/dist/src/utils/coin.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CoinAsset } from "../types/sui";
|
|
2
|
-
import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
3
|
-
export declare function completionCoin(s: string): string;
|
|
4
|
-
export declare function compareCoins(coinA: string, coinB: string): boolean;
|
|
5
|
-
export declare function mintZeroCoin(txb: Transaction, coinType: string): TransactionObjectArgument;
|
|
6
|
-
export type BuildCoinResult = {
|
|
7
|
-
targetCoin: TransactionObjectArgument;
|
|
8
|
-
isMintZeroCoin: boolean;
|
|
9
|
-
targetCoinAmount: number;
|
|
10
|
-
};
|
|
11
|
-
export declare function buildInputCoin(txb: Transaction, allCoins: CoinAsset[], amount: bigint, coinType: string): BuildCoinResult;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { SuiAddress, SuiStructTag } from '../types/sui';
|
|
2
|
-
export declare function isSortedSymbols(symbolX: string, symbolY: string): boolean;
|
|
3
|
-
export declare function composeType(address: string, generics: SuiAddress[]): SuiAddress;
|
|
4
|
-
export declare function composeType(address: string, struct: string, generics?: SuiAddress[]): SuiAddress;
|
|
5
|
-
export declare function composeType(address: string, module: string, struct: string, generics?: SuiAddress[]): SuiAddress;
|
|
6
|
-
export declare function extractAddressFromType(type: string): string;
|
|
7
|
-
export declare function extractStructTagFromType(type: string): SuiStructTag;
|
|
8
|
-
export declare function normalizeCoinType(coinType: string): string;
|
|
9
|
-
export declare function fixSuiObjectId(value: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Recursively traverses the given data object and patches any string values that represent Sui object IDs.
|
|
12
|
-
*
|
|
13
|
-
* @param {any} data - The data object to be patched.
|
|
14
|
-
*/
|
|
15
|
-
export declare function patchFixSuiObjectId(data: any): void;
|
|
16
|
-
export declare function createTarget(packageName: string, moduleName: string, functionName: string): `${string}::${string}::${string}`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const T_USDC = "0x26b3bc67befc214058ca78ea9a2690298d731a2d4309485ec3d40198063c4abc::usdc::USDC";
|
|
2
|
-
export declare const T_USDT = "0x26b3bc67befc214058ca78ea9a2690298d731a2d4309485ec3d40198063c4abc::usdt::USDT";
|
|
3
|
-
export declare const T_DEEP = "0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP";
|
|
4
|
-
export declare const T_DBUSDC = "0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC";
|
|
5
|
-
export declare const T_DBUSDT = "0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDT::DBUSDT";
|
|
6
|
-
export declare const M_USDC = "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC";
|
|
7
|
-
export declare const M_wUSDC = "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN";
|
|
8
|
-
export declare const M_CETUS = "0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS";
|
|
9
|
-
export declare const M_NAVI = "0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX";
|
|
10
|
-
export declare const M_SUI = "0x2::sui::SUI";
|
|
11
|
-
export declare const M_VSUI = "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT";
|
|
12
|
-
export declare const M_VAPOR = "0xa1f2c11169f32165ad4efb4468ec5bdfc880cd66b22094024b32ab7b76d14d30::vapor::VAPOR";
|
|
13
|
-
export declare const M_HASUI = "0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::hasui::HASUI";
|
|
14
|
-
export declare const M_SSWP = "0x361dd589b98e8fcda9a7ee53b85efabef3569d00416640d2faa516e3801d7ffc::TOKEN::TOKEN";
|
|
15
|
-
export declare const M_MICHI = "0x50d796fde5709a97883e29e00bf511d66f2656de958ea0c2ce4c1147cdd20a23::MICHI::MICHI";
|
|
16
|
-
export declare const M_SSUI = "0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI";
|
|
17
|
-
export declare const M_SHaSUI = "0x9a2376943f7d22f88087c259c5889925f332ca4347e669dc37d54c2bf651af3c::scallop_ha_sui::SCALLOP_HA_SUI";
|
|
18
|
-
export declare const M_ETH = "0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/example/package.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "aggregator-example",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "Cetus Aggregator SDK usage example",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"swap": "ts-node swap.ts"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@cetusprotocol/aggregator-sdk": "^0.3.18",
|
|
11
|
-
"@mysten/sui.js": "^0.49.1"
|
|
12
|
-
},
|
|
13
|
-
"devDependencies": {
|
|
14
|
-
"typescript": "^5.0.0",
|
|
15
|
-
"ts-node": "^10.9.1"
|
|
16
|
-
}
|
|
17
|
-
}
|
package/example/swap.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AggregatorClient } from "@cetusprotocol/aggregator-sdk"
|
|
2
|
-
import BN from "bn.js"
|
|
3
|
-
|
|
4
|
-
async function main() {
|
|
5
|
-
// default to mainnet
|
|
6
|
-
const client = new AggregatorClient()
|
|
7
|
-
|
|
8
|
-
const from = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"
|
|
9
|
-
const target = "0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS"
|
|
10
|
-
|
|
11
|
-
const routers = await client.findRouters({
|
|
12
|
-
from,
|
|
13
|
-
target,
|
|
14
|
-
amount: new BN(1000000000),
|
|
15
|
-
byAmountIn: true,
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
console.log(routers)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
main()
|
package/example/tsconfig.json
DELETED
package/jest.config.mjs
DELETED