@cetusprotocol/aggregator-sdk 1.5.4 → 1.5.6
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/bun.lock +263 -263
- package/dist/index.cjs +176 -105
- package/dist/index.d.cts +77 -19
- package/dist/index.d.ts +77 -19
- package/dist/index.js +176 -106
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
1
|
+
import * as _mysten_sui_client from '@mysten/sui/client';
|
|
3
2
|
import { TransactionObjectArgument, Transaction, TransactionArgument } from '@mysten/sui/transactions';
|
|
4
3
|
import BN from 'bn.js';
|
|
5
4
|
import Decimal from 'decimal.js';
|
|
5
|
+
import { SuiGrpcClient } from '@mysten/sui/grpc';
|
|
6
6
|
import { Signer } from '@mysten/sui/cryptography';
|
|
7
7
|
|
|
8
8
|
interface FindRouterParams {
|
|
@@ -132,6 +132,12 @@ type ExtendedDetails = {
|
|
|
132
132
|
bolt_oracle_id?: string;
|
|
133
133
|
bolt_quote_coin_type?: string;
|
|
134
134
|
magmapropamm_pool_id?: string;
|
|
135
|
+
tide_pool_id?: string;
|
|
136
|
+
tide_regime_id?: string;
|
|
137
|
+
tide_oracle_mode?: string;
|
|
138
|
+
tide_base_price_info_object?: string;
|
|
139
|
+
tide_quote_price_info_object?: string;
|
|
140
|
+
aux_shared_versions?: Record<string, number>;
|
|
135
141
|
};
|
|
136
142
|
type Path = {
|
|
137
143
|
id: string;
|
|
@@ -309,7 +315,7 @@ declare class PythAdapter {
|
|
|
309
315
|
private priceTableInfo;
|
|
310
316
|
private priceFeedObjectIdCache;
|
|
311
317
|
private baseUpdateFee;
|
|
312
|
-
constructor(client:
|
|
318
|
+
constructor(client: SuiGrpcClient, pythStateId: ObjectId, wormholeStateId: ObjectId, hermesUrls: string[]);
|
|
313
319
|
getPriceFeedsUpdateData(priceIDs: string[]): Promise<Buffer[]>;
|
|
314
320
|
getBaseUpdateFee(): Promise<number>;
|
|
315
321
|
getPackageId(objectId: ObjectId): Promise<string>;
|
|
@@ -359,6 +365,7 @@ declare const FERRADLMM = "FERRADLMM";
|
|
|
359
365
|
declare const FERRACLMM = "FERRACLMM";
|
|
360
366
|
declare const BOLT = "BOLT";
|
|
361
367
|
declare const MAGMAPROPAMM = "MAGMAPROPAMM";
|
|
368
|
+
declare const TIDE = "TIDE";
|
|
362
369
|
declare const DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v3";
|
|
363
370
|
declare const ALL_DEXES: string[];
|
|
364
371
|
type BuildRouterSwapParamsV3 = {
|
|
@@ -407,7 +414,7 @@ declare function getProvidersIncluding(includeProviders: string[]): string[];
|
|
|
407
414
|
type AggregatorClientParams = {
|
|
408
415
|
endpoint?: string;
|
|
409
416
|
signer?: string;
|
|
410
|
-
client?:
|
|
417
|
+
client?: SuiGrpcClient;
|
|
411
418
|
env?: Env;
|
|
412
419
|
pythUrls?: string[];
|
|
413
420
|
apiKey?: string;
|
|
@@ -419,7 +426,7 @@ type AggregatorClientParams = {
|
|
|
419
426
|
declare class AggregatorClient {
|
|
420
427
|
endpoint: string;
|
|
421
428
|
signer: string;
|
|
422
|
-
client:
|
|
429
|
+
client: SuiGrpcClient;
|
|
423
430
|
env: Env;
|
|
424
431
|
apiKey: string;
|
|
425
432
|
protected pythAdapter: PythAdapter;
|
|
@@ -461,8 +468,15 @@ declare class AggregatorClient {
|
|
|
461
468
|
fixableRouterSwapV3(params: BuildRouterSwapParamsV3): Promise<TransactionObjectArgument>;
|
|
462
469
|
swapInPools(params: SwapInPoolsParams): Promise<SwapInPoolsResultV3>;
|
|
463
470
|
updatePythPriceIDs(priceIDs: string[], txb: Transaction): Promise<Map<string, string>>;
|
|
464
|
-
devInspectTransactionBlock(txb: Transaction): Promise<
|
|
465
|
-
|
|
471
|
+
devInspectTransactionBlock(txb: Transaction): Promise<_mysten_sui_client.SuiClientTypes.SimulateTransactionResult<{
|
|
472
|
+
events: true;
|
|
473
|
+
effects: true;
|
|
474
|
+
}>>;
|
|
475
|
+
sendTransaction(txb: Transaction, signer: Signer): Promise<_mysten_sui_client.SuiClientTypes.TransactionResult<{
|
|
476
|
+
effects: true;
|
|
477
|
+
events: true;
|
|
478
|
+
balanceChanges: true;
|
|
479
|
+
}>>;
|
|
466
480
|
}
|
|
467
481
|
|
|
468
482
|
/**
|
|
@@ -495,7 +509,7 @@ type GetOrCreateAccountCapResult = {
|
|
|
495
509
|
accountCap: TransactionObjectArgument;
|
|
496
510
|
isCreate: boolean;
|
|
497
511
|
};
|
|
498
|
-
declare function getOrCreateAccountCap(txb: Transaction, client:
|
|
512
|
+
declare function getOrCreateAccountCap(txb: Transaction, client: SuiGrpcClient, owner: string): Promise<GetOrCreateAccountCapResult>;
|
|
499
513
|
|
|
500
514
|
/**
|
|
501
515
|
* Represents a SUI address, which is a string.
|
|
@@ -645,23 +659,67 @@ interface Dex {
|
|
|
645
659
|
}
|
|
646
660
|
|
|
647
661
|
/**
|
|
648
|
-
* Matches the shape of
|
|
662
|
+
* Matches the shape of SuiClientTypes.SimulateTransactionResult with effects included.
|
|
649
663
|
* Using a local type so gas.ts can be used without importing the full SDK.
|
|
650
664
|
*/
|
|
651
665
|
type SimulateTransactionResult = {
|
|
652
|
-
|
|
666
|
+
$kind: 'Transaction' | 'FailedTransaction';
|
|
667
|
+
Transaction?: {
|
|
653
668
|
status: {
|
|
654
|
-
|
|
655
|
-
error
|
|
669
|
+
success: true;
|
|
670
|
+
error: null;
|
|
671
|
+
} | {
|
|
672
|
+
success: false;
|
|
673
|
+
error: {
|
|
674
|
+
message: string;
|
|
675
|
+
};
|
|
656
676
|
};
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
677
|
+
effects?: {
|
|
678
|
+
status: {
|
|
679
|
+
success: true;
|
|
680
|
+
error: null;
|
|
681
|
+
} | {
|
|
682
|
+
success: false;
|
|
683
|
+
error: {
|
|
684
|
+
message: string;
|
|
685
|
+
};
|
|
686
|
+
};
|
|
687
|
+
gasUsed: {
|
|
688
|
+
computationCost: string;
|
|
689
|
+
storageCost: string;
|
|
690
|
+
storageRebate: string;
|
|
691
|
+
nonRefundableStorageFee: string;
|
|
692
|
+
};
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
FailedTransaction?: {
|
|
696
|
+
status: {
|
|
697
|
+
success: true;
|
|
698
|
+
error: null;
|
|
699
|
+
} | {
|
|
700
|
+
success: false;
|
|
701
|
+
error: {
|
|
702
|
+
message: string;
|
|
703
|
+
};
|
|
704
|
+
};
|
|
705
|
+
effects?: {
|
|
706
|
+
status: {
|
|
707
|
+
success: true;
|
|
708
|
+
error: null;
|
|
709
|
+
} | {
|
|
710
|
+
success: false;
|
|
711
|
+
error: {
|
|
712
|
+
message: string;
|
|
713
|
+
};
|
|
714
|
+
};
|
|
715
|
+
gasUsed: {
|
|
716
|
+
computationCost: string;
|
|
717
|
+
storageCost: string;
|
|
718
|
+
storageRebate: string;
|
|
719
|
+
nonRefundableStorageFee: string;
|
|
720
|
+
};
|
|
662
721
|
};
|
|
663
722
|
};
|
|
664
|
-
error?: string | null;
|
|
665
723
|
};
|
|
666
724
|
interface GasMetrics {
|
|
667
725
|
computationCost: string;
|
|
@@ -1076,4 +1134,4 @@ declare class CoinUtils {
|
|
|
1076
1134
|
static calculateTotalBalance(coins: CoinAsset[]): bigint;
|
|
1077
1135
|
}
|
|
1078
1136
|
|
|
1079
|
-
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, AggregatorConfig, AggregatorError, type AggregatorErrorCode, type AggregatorResponse, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, BOLT, type BigNumber, type BuildCoinResult, type BuildFastMergeSwapParams, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildMergeSwapParams, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, CETUS, CETUSDLMM, CETUS_DEX, CETUS_MODULE, CETUS_PUBLISHED_AT, CHECK_COINS_THRESHOLD_FUNC, CLIENT_CONFIG, CLOCK_ADDRESS, type CoinAsset, CoinInfoAddress, CoinStoreAddress, CoinUtils, type ComparisonResult, ConfigErrorCode, DEEPBOOKV2, DEEPBOOKV3, DEEPBOOK_CLOB_V2_MODULE, DEEPBOOK_CUSTODIAN_V2_MODULE, DEEPBOOK_DEX, DEEPBOOK_MODULE, DEEPBOOK_PACKAGE_ID, DEEPBOOK_PUBLISHED_AT, DEEPBOOK_V3_DEEP_FEE_TYPES, DEFAULT_AGG_V2_ENDPOINT, DEFAULT_AGG_V3_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_GAS_BUDGET_FOR_MERGE, DEFAULT_GAS_BUDGET_FOR_SPLIT, DEFAULT_GAS_BUDGET_FOR_STAKE, DEFAULT_GAS_BUDGET_FOR_TRANSFER, DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI, DEFAULT_NFT_TRANSFER_GAS_FEE, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FERRACLMM, FERRADLMM, FLOWXV2, FLOWXV3, FLOWX_AMM, FLOWX_AMM_MODULE, FULLSAIL, type FindRouterParams, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, type FlattenedPath, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, type GasMetrics, type GetOrCreateAccountCapResult, HAEDAL, HAEDALHMMV2, HAEDALPMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAGMAPROPAMM, MAINNET_AFTERMATH_INSURANCE_FUND_ID, MAINNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, MAINNET_AFTERMATH_REFERRAL_VAULT_ID, MAINNET_AFTERMATH_REGISTRY_ID, MAINNET_AFTERMATH_TREASURY_ID, MAINNET_CETUS_V3_PUBLISHED_AT, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type MergeRoute, type MergeSwapFromCoin, type MergeSwapInputCoin, type MergeSwapParams, type MergeSwapRouterData, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, type Package, type Path, type PathV2, type PreSwapLpChangeParams, type ProcessedRouterData, type PythConfig, REPAY_FLASH_SWAP_A2B_FUNC, REPAY_FLASH_SWAP_B2A_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_A2B_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_B2A_FUNC, RepayFalshSwapFunc, RepayFlashSwapWithPartnerFunc, type Router, type RouterData, type RouterDataV2, type RouterDataV3, type RouterError, type RouterV2, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, SUI_SYSTEM_STATE_OBJECT_ID, SWAP_A2B_FUNC, SWAP_B2A_FUNC, type SimulateTransactionResult, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiMoveObject, type SuiObjectIdType, type SuiResource, type SuiStructTag, type SuiTxArg, SuiZeroCoinFn, type SwapGasAnalysis, type SwapInPoolsParams, type SwapInPoolsResultV3, TEN_POW_NINE, TESTNET_AFTERMATH_INSURANCE_FUND_ID, TESTNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, TESTNET_AFTERMATH_REFERRAL_VAULT_ID, TESTNET_AFTERMATH_REGISTRY_ID, TESTNET_AFTERMATH_TREASURY_ID, TESTNET_CETUS_V3_PUBLISHED_AT, TESTNET_FLOWX_AMM_CONTAINER_ID, TRANSFER_ACCOUNT_CAP, TRANSFER_OR_DESTORY_COIN_FUNC, TURBOS, TURBOS_DEX, TURBOS_MODULE, TURBOS_VERSIONED, TWO, TransactionErrorCode, TypesErrorCode, U128, U64_MAX, U64_MAX_BN, UTILS_MODULE, VOLO, ZERO, buildInputCoin, calculateGasEfficiency, calculatePriceImpact, checkInvalidSuiAddress, compareCoins, compareGasMetrics, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getMergeSwapResult, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, isValidDowngradeUuid6, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|
|
1137
|
+
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, AggregatorConfig, AggregatorError, type AggregatorErrorCode, type AggregatorResponse, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, BOLT, type BigNumber, type BuildCoinResult, type BuildFastMergeSwapParams, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildMergeSwapParams, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, CETUS, CETUSDLMM, CETUS_DEX, CETUS_MODULE, CETUS_PUBLISHED_AT, CHECK_COINS_THRESHOLD_FUNC, CLIENT_CONFIG, CLOCK_ADDRESS, type CoinAsset, CoinInfoAddress, CoinStoreAddress, CoinUtils, type ComparisonResult, ConfigErrorCode, DEEPBOOKV2, DEEPBOOKV3, DEEPBOOK_CLOB_V2_MODULE, DEEPBOOK_CUSTODIAN_V2_MODULE, DEEPBOOK_DEX, DEEPBOOK_MODULE, DEEPBOOK_PACKAGE_ID, DEEPBOOK_PUBLISHED_AT, DEEPBOOK_V3_DEEP_FEE_TYPES, DEFAULT_AGG_V2_ENDPOINT, DEFAULT_AGG_V3_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_GAS_BUDGET_FOR_MERGE, DEFAULT_GAS_BUDGET_FOR_SPLIT, DEFAULT_GAS_BUDGET_FOR_STAKE, DEFAULT_GAS_BUDGET_FOR_TRANSFER, DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI, DEFAULT_NFT_TRANSFER_GAS_FEE, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FERRACLMM, FERRADLMM, FLOWXV2, FLOWXV3, FLOWX_AMM, FLOWX_AMM_MODULE, FULLSAIL, type FindRouterParams, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, type FlattenedPath, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, type GasMetrics, type GetOrCreateAccountCapResult, HAEDAL, HAEDALHMMV2, HAEDALPMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAGMAPROPAMM, MAINNET_AFTERMATH_INSURANCE_FUND_ID, MAINNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, MAINNET_AFTERMATH_REFERRAL_VAULT_ID, MAINNET_AFTERMATH_REGISTRY_ID, MAINNET_AFTERMATH_TREASURY_ID, MAINNET_CETUS_V3_PUBLISHED_AT, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type MergeRoute, type MergeSwapFromCoin, type MergeSwapInputCoin, type MergeSwapParams, type MergeSwapRouterData, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, type Package, type Path, type PathV2, type PreSwapLpChangeParams, type ProcessedRouterData, type PythConfig, REPAY_FLASH_SWAP_A2B_FUNC, REPAY_FLASH_SWAP_B2A_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_A2B_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_B2A_FUNC, RepayFalshSwapFunc, RepayFlashSwapWithPartnerFunc, type Router, type RouterData, type RouterDataV2, type RouterDataV3, type RouterError, type RouterV2, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, SUI_SYSTEM_STATE_OBJECT_ID, SWAP_A2B_FUNC, SWAP_B2A_FUNC, type SimulateTransactionResult, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiMoveObject, type SuiObjectIdType, type SuiResource, type SuiStructTag, type SuiTxArg, SuiZeroCoinFn, type SwapGasAnalysis, type SwapInPoolsParams, type SwapInPoolsResultV3, TEN_POW_NINE, TESTNET_AFTERMATH_INSURANCE_FUND_ID, TESTNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, TESTNET_AFTERMATH_REFERRAL_VAULT_ID, TESTNET_AFTERMATH_REGISTRY_ID, TESTNET_AFTERMATH_TREASURY_ID, TESTNET_CETUS_V3_PUBLISHED_AT, TESTNET_FLOWX_AMM_CONTAINER_ID, TIDE, TRANSFER_ACCOUNT_CAP, TRANSFER_OR_DESTORY_COIN_FUNC, TURBOS, TURBOS_DEX, TURBOS_MODULE, TURBOS_VERSIONED, TWO, TransactionErrorCode, TypesErrorCode, U128, U64_MAX, U64_MAX_BN, UTILS_MODULE, VOLO, ZERO, buildInputCoin, calculateGasEfficiency, calculatePriceImpact, checkInvalidSuiAddress, compareCoins, compareGasMetrics, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getMergeSwapResult, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, isValidDowngradeUuid6, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
1
|
+
import * as _mysten_sui_client from '@mysten/sui/client';
|
|
3
2
|
import { TransactionObjectArgument, Transaction, TransactionArgument } from '@mysten/sui/transactions';
|
|
4
3
|
import BN from 'bn.js';
|
|
5
4
|
import Decimal from 'decimal.js';
|
|
5
|
+
import { SuiGrpcClient } from '@mysten/sui/grpc';
|
|
6
6
|
import { Signer } from '@mysten/sui/cryptography';
|
|
7
7
|
|
|
8
8
|
interface FindRouterParams {
|
|
@@ -132,6 +132,12 @@ type ExtendedDetails = {
|
|
|
132
132
|
bolt_oracle_id?: string;
|
|
133
133
|
bolt_quote_coin_type?: string;
|
|
134
134
|
magmapropamm_pool_id?: string;
|
|
135
|
+
tide_pool_id?: string;
|
|
136
|
+
tide_regime_id?: string;
|
|
137
|
+
tide_oracle_mode?: string;
|
|
138
|
+
tide_base_price_info_object?: string;
|
|
139
|
+
tide_quote_price_info_object?: string;
|
|
140
|
+
aux_shared_versions?: Record<string, number>;
|
|
135
141
|
};
|
|
136
142
|
type Path = {
|
|
137
143
|
id: string;
|
|
@@ -309,7 +315,7 @@ declare class PythAdapter {
|
|
|
309
315
|
private priceTableInfo;
|
|
310
316
|
private priceFeedObjectIdCache;
|
|
311
317
|
private baseUpdateFee;
|
|
312
|
-
constructor(client:
|
|
318
|
+
constructor(client: SuiGrpcClient, pythStateId: ObjectId, wormholeStateId: ObjectId, hermesUrls: string[]);
|
|
313
319
|
getPriceFeedsUpdateData(priceIDs: string[]): Promise<Buffer[]>;
|
|
314
320
|
getBaseUpdateFee(): Promise<number>;
|
|
315
321
|
getPackageId(objectId: ObjectId): Promise<string>;
|
|
@@ -359,6 +365,7 @@ declare const FERRADLMM = "FERRADLMM";
|
|
|
359
365
|
declare const FERRACLMM = "FERRACLMM";
|
|
360
366
|
declare const BOLT = "BOLT";
|
|
361
367
|
declare const MAGMAPROPAMM = "MAGMAPROPAMM";
|
|
368
|
+
declare const TIDE = "TIDE";
|
|
362
369
|
declare const DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v3";
|
|
363
370
|
declare const ALL_DEXES: string[];
|
|
364
371
|
type BuildRouterSwapParamsV3 = {
|
|
@@ -407,7 +414,7 @@ declare function getProvidersIncluding(includeProviders: string[]): string[];
|
|
|
407
414
|
type AggregatorClientParams = {
|
|
408
415
|
endpoint?: string;
|
|
409
416
|
signer?: string;
|
|
410
|
-
client?:
|
|
417
|
+
client?: SuiGrpcClient;
|
|
411
418
|
env?: Env;
|
|
412
419
|
pythUrls?: string[];
|
|
413
420
|
apiKey?: string;
|
|
@@ -419,7 +426,7 @@ type AggregatorClientParams = {
|
|
|
419
426
|
declare class AggregatorClient {
|
|
420
427
|
endpoint: string;
|
|
421
428
|
signer: string;
|
|
422
|
-
client:
|
|
429
|
+
client: SuiGrpcClient;
|
|
423
430
|
env: Env;
|
|
424
431
|
apiKey: string;
|
|
425
432
|
protected pythAdapter: PythAdapter;
|
|
@@ -461,8 +468,15 @@ declare class AggregatorClient {
|
|
|
461
468
|
fixableRouterSwapV3(params: BuildRouterSwapParamsV3): Promise<TransactionObjectArgument>;
|
|
462
469
|
swapInPools(params: SwapInPoolsParams): Promise<SwapInPoolsResultV3>;
|
|
463
470
|
updatePythPriceIDs(priceIDs: string[], txb: Transaction): Promise<Map<string, string>>;
|
|
464
|
-
devInspectTransactionBlock(txb: Transaction): Promise<
|
|
465
|
-
|
|
471
|
+
devInspectTransactionBlock(txb: Transaction): Promise<_mysten_sui_client.SuiClientTypes.SimulateTransactionResult<{
|
|
472
|
+
events: true;
|
|
473
|
+
effects: true;
|
|
474
|
+
}>>;
|
|
475
|
+
sendTransaction(txb: Transaction, signer: Signer): Promise<_mysten_sui_client.SuiClientTypes.TransactionResult<{
|
|
476
|
+
effects: true;
|
|
477
|
+
events: true;
|
|
478
|
+
balanceChanges: true;
|
|
479
|
+
}>>;
|
|
466
480
|
}
|
|
467
481
|
|
|
468
482
|
/**
|
|
@@ -495,7 +509,7 @@ type GetOrCreateAccountCapResult = {
|
|
|
495
509
|
accountCap: TransactionObjectArgument;
|
|
496
510
|
isCreate: boolean;
|
|
497
511
|
};
|
|
498
|
-
declare function getOrCreateAccountCap(txb: Transaction, client:
|
|
512
|
+
declare function getOrCreateAccountCap(txb: Transaction, client: SuiGrpcClient, owner: string): Promise<GetOrCreateAccountCapResult>;
|
|
499
513
|
|
|
500
514
|
/**
|
|
501
515
|
* Represents a SUI address, which is a string.
|
|
@@ -645,23 +659,67 @@ interface Dex {
|
|
|
645
659
|
}
|
|
646
660
|
|
|
647
661
|
/**
|
|
648
|
-
* Matches the shape of
|
|
662
|
+
* Matches the shape of SuiClientTypes.SimulateTransactionResult with effects included.
|
|
649
663
|
* Using a local type so gas.ts can be used without importing the full SDK.
|
|
650
664
|
*/
|
|
651
665
|
type SimulateTransactionResult = {
|
|
652
|
-
|
|
666
|
+
$kind: 'Transaction' | 'FailedTransaction';
|
|
667
|
+
Transaction?: {
|
|
653
668
|
status: {
|
|
654
|
-
|
|
655
|
-
error
|
|
669
|
+
success: true;
|
|
670
|
+
error: null;
|
|
671
|
+
} | {
|
|
672
|
+
success: false;
|
|
673
|
+
error: {
|
|
674
|
+
message: string;
|
|
675
|
+
};
|
|
656
676
|
};
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
677
|
+
effects?: {
|
|
678
|
+
status: {
|
|
679
|
+
success: true;
|
|
680
|
+
error: null;
|
|
681
|
+
} | {
|
|
682
|
+
success: false;
|
|
683
|
+
error: {
|
|
684
|
+
message: string;
|
|
685
|
+
};
|
|
686
|
+
};
|
|
687
|
+
gasUsed: {
|
|
688
|
+
computationCost: string;
|
|
689
|
+
storageCost: string;
|
|
690
|
+
storageRebate: string;
|
|
691
|
+
nonRefundableStorageFee: string;
|
|
692
|
+
};
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
FailedTransaction?: {
|
|
696
|
+
status: {
|
|
697
|
+
success: true;
|
|
698
|
+
error: null;
|
|
699
|
+
} | {
|
|
700
|
+
success: false;
|
|
701
|
+
error: {
|
|
702
|
+
message: string;
|
|
703
|
+
};
|
|
704
|
+
};
|
|
705
|
+
effects?: {
|
|
706
|
+
status: {
|
|
707
|
+
success: true;
|
|
708
|
+
error: null;
|
|
709
|
+
} | {
|
|
710
|
+
success: false;
|
|
711
|
+
error: {
|
|
712
|
+
message: string;
|
|
713
|
+
};
|
|
714
|
+
};
|
|
715
|
+
gasUsed: {
|
|
716
|
+
computationCost: string;
|
|
717
|
+
storageCost: string;
|
|
718
|
+
storageRebate: string;
|
|
719
|
+
nonRefundableStorageFee: string;
|
|
720
|
+
};
|
|
662
721
|
};
|
|
663
722
|
};
|
|
664
|
-
error?: string | null;
|
|
665
723
|
};
|
|
666
724
|
interface GasMetrics {
|
|
667
725
|
computationCost: string;
|
|
@@ -1076,4 +1134,4 @@ declare class CoinUtils {
|
|
|
1076
1134
|
static calculateTotalBalance(coins: CoinAsset[]): bigint;
|
|
1077
1135
|
}
|
|
1078
1136
|
|
|
1079
|
-
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, AggregatorConfig, AggregatorError, type AggregatorErrorCode, type AggregatorResponse, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, BOLT, type BigNumber, type BuildCoinResult, type BuildFastMergeSwapParams, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildMergeSwapParams, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, CETUS, CETUSDLMM, CETUS_DEX, CETUS_MODULE, CETUS_PUBLISHED_AT, CHECK_COINS_THRESHOLD_FUNC, CLIENT_CONFIG, CLOCK_ADDRESS, type CoinAsset, CoinInfoAddress, CoinStoreAddress, CoinUtils, type ComparisonResult, ConfigErrorCode, DEEPBOOKV2, DEEPBOOKV3, DEEPBOOK_CLOB_V2_MODULE, DEEPBOOK_CUSTODIAN_V2_MODULE, DEEPBOOK_DEX, DEEPBOOK_MODULE, DEEPBOOK_PACKAGE_ID, DEEPBOOK_PUBLISHED_AT, DEEPBOOK_V3_DEEP_FEE_TYPES, DEFAULT_AGG_V2_ENDPOINT, DEFAULT_AGG_V3_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_GAS_BUDGET_FOR_MERGE, DEFAULT_GAS_BUDGET_FOR_SPLIT, DEFAULT_GAS_BUDGET_FOR_STAKE, DEFAULT_GAS_BUDGET_FOR_TRANSFER, DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI, DEFAULT_NFT_TRANSFER_GAS_FEE, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FERRACLMM, FERRADLMM, FLOWXV2, FLOWXV3, FLOWX_AMM, FLOWX_AMM_MODULE, FULLSAIL, type FindRouterParams, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, type FlattenedPath, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, type GasMetrics, type GetOrCreateAccountCapResult, HAEDAL, HAEDALHMMV2, HAEDALPMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAGMAPROPAMM, MAINNET_AFTERMATH_INSURANCE_FUND_ID, MAINNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, MAINNET_AFTERMATH_REFERRAL_VAULT_ID, MAINNET_AFTERMATH_REGISTRY_ID, MAINNET_AFTERMATH_TREASURY_ID, MAINNET_CETUS_V3_PUBLISHED_AT, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type MergeRoute, type MergeSwapFromCoin, type MergeSwapInputCoin, type MergeSwapParams, type MergeSwapRouterData, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, type Package, type Path, type PathV2, type PreSwapLpChangeParams, type ProcessedRouterData, type PythConfig, REPAY_FLASH_SWAP_A2B_FUNC, REPAY_FLASH_SWAP_B2A_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_A2B_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_B2A_FUNC, RepayFalshSwapFunc, RepayFlashSwapWithPartnerFunc, type Router, type RouterData, type RouterDataV2, type RouterDataV3, type RouterError, type RouterV2, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, SUI_SYSTEM_STATE_OBJECT_ID, SWAP_A2B_FUNC, SWAP_B2A_FUNC, type SimulateTransactionResult, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiMoveObject, type SuiObjectIdType, type SuiResource, type SuiStructTag, type SuiTxArg, SuiZeroCoinFn, type SwapGasAnalysis, type SwapInPoolsParams, type SwapInPoolsResultV3, TEN_POW_NINE, TESTNET_AFTERMATH_INSURANCE_FUND_ID, TESTNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, TESTNET_AFTERMATH_REFERRAL_VAULT_ID, TESTNET_AFTERMATH_REGISTRY_ID, TESTNET_AFTERMATH_TREASURY_ID, TESTNET_CETUS_V3_PUBLISHED_AT, TESTNET_FLOWX_AMM_CONTAINER_ID, TRANSFER_ACCOUNT_CAP, TRANSFER_OR_DESTORY_COIN_FUNC, TURBOS, TURBOS_DEX, TURBOS_MODULE, TURBOS_VERSIONED, TWO, TransactionErrorCode, TypesErrorCode, U128, U64_MAX, U64_MAX_BN, UTILS_MODULE, VOLO, ZERO, buildInputCoin, calculateGasEfficiency, calculatePriceImpact, checkInvalidSuiAddress, compareCoins, compareGasMetrics, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getMergeSwapResult, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, isValidDowngradeUuid6, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|
|
1137
|
+
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, AggregatorConfig, AggregatorError, type AggregatorErrorCode, type AggregatorResponse, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, BOLT, type BigNumber, type BuildCoinResult, type BuildFastMergeSwapParams, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildMergeSwapParams, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, CETUS, CETUSDLMM, CETUS_DEX, CETUS_MODULE, CETUS_PUBLISHED_AT, CHECK_COINS_THRESHOLD_FUNC, CLIENT_CONFIG, CLOCK_ADDRESS, type CoinAsset, CoinInfoAddress, CoinStoreAddress, CoinUtils, type ComparisonResult, ConfigErrorCode, DEEPBOOKV2, DEEPBOOKV3, DEEPBOOK_CLOB_V2_MODULE, DEEPBOOK_CUSTODIAN_V2_MODULE, DEEPBOOK_DEX, DEEPBOOK_MODULE, DEEPBOOK_PACKAGE_ID, DEEPBOOK_PUBLISHED_AT, DEEPBOOK_V3_DEEP_FEE_TYPES, DEFAULT_AGG_V2_ENDPOINT, DEFAULT_AGG_V3_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_GAS_BUDGET_FOR_MERGE, DEFAULT_GAS_BUDGET_FOR_SPLIT, DEFAULT_GAS_BUDGET_FOR_STAKE, DEFAULT_GAS_BUDGET_FOR_TRANSFER, DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI, DEFAULT_NFT_TRANSFER_GAS_FEE, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FERRACLMM, FERRADLMM, FLOWXV2, FLOWXV3, FLOWX_AMM, FLOWX_AMM_MODULE, FULLSAIL, type FindRouterParams, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, type FlattenedPath, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, type GasMetrics, type GetOrCreateAccountCapResult, HAEDAL, HAEDALHMMV2, HAEDALPMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAGMAPROPAMM, MAINNET_AFTERMATH_INSURANCE_FUND_ID, MAINNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, MAINNET_AFTERMATH_REFERRAL_VAULT_ID, MAINNET_AFTERMATH_REGISTRY_ID, MAINNET_AFTERMATH_TREASURY_ID, MAINNET_CETUS_V3_PUBLISHED_AT, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type MergeRoute, type MergeSwapFromCoin, type MergeSwapInputCoin, type MergeSwapParams, type MergeSwapRouterData, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, type Package, type Path, type PathV2, type PreSwapLpChangeParams, type ProcessedRouterData, type PythConfig, REPAY_FLASH_SWAP_A2B_FUNC, REPAY_FLASH_SWAP_B2A_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_A2B_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_B2A_FUNC, RepayFalshSwapFunc, RepayFlashSwapWithPartnerFunc, type Router, type RouterData, type RouterDataV2, type RouterDataV3, type RouterError, type RouterV2, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, SUI_SYSTEM_STATE_OBJECT_ID, SWAP_A2B_FUNC, SWAP_B2A_FUNC, type SimulateTransactionResult, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiMoveObject, type SuiObjectIdType, type SuiResource, type SuiStructTag, type SuiTxArg, SuiZeroCoinFn, type SwapGasAnalysis, type SwapInPoolsParams, type SwapInPoolsResultV3, TEN_POW_NINE, TESTNET_AFTERMATH_INSURANCE_FUND_ID, TESTNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, TESTNET_AFTERMATH_REFERRAL_VAULT_ID, TESTNET_AFTERMATH_REGISTRY_ID, TESTNET_AFTERMATH_TREASURY_ID, TESTNET_CETUS_V3_PUBLISHED_AT, TESTNET_FLOWX_AMM_CONTAINER_ID, TIDE, TRANSFER_ACCOUNT_CAP, TRANSFER_OR_DESTORY_COIN_FUNC, TURBOS, TURBOS_DEX, TURBOS_MODULE, TURBOS_VERSIONED, TWO, TransactionErrorCode, TypesErrorCode, U128, U64_MAX, U64_MAX_BN, UTILS_MODULE, VOLO, ZERO, buildInputCoin, calculateGasEfficiency, calculatePriceImpact, checkInvalidSuiAddress, compareCoins, compareGasMetrics, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getMergeSwapResult, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, isValidDowngradeUuid6, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|