@scallop-io/scallop-swap-sdk 1.2.0 → 1.2.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.d.mts +10 -7
- package/dist/index.d.ts +10 -7
- package/dist/index.js +15 -15
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
- package/src/class/aggregator.ts +3 -1
- package/src/class/base.ts +3 -2
- package/src/example/index.ts +37 -37
- package/src/interface/base.ts +3 -3
- package/src/sdk/7k.ts +10 -7
- package/src/sdk/aftermath.ts +10 -7
- package/src/sdk/cetus.ts +10 -7
- package/src/sdk/flowx.ts +10 -7
package/dist/index.d.mts
CHANGED
|
@@ -75,7 +75,8 @@ type FetchRouteParams = {
|
|
|
75
75
|
coinOutType: string;
|
|
76
76
|
swapAmount: bigint;
|
|
77
77
|
};
|
|
78
|
-
type SwapParams = {
|
|
78
|
+
type SwapParams<T> = {
|
|
79
|
+
route?: FetchRouteResult<T>;
|
|
79
80
|
slippage: number;
|
|
80
81
|
minAmountOut?: bigint;
|
|
81
82
|
txExtensionParams?: {
|
|
@@ -142,7 +143,7 @@ interface SwapSdkBaseInterface<PoolType = string, RawRouteResultType = any, Fetc
|
|
|
142
143
|
* @returns Promise<TransactionObjectArgument>
|
|
143
144
|
*/
|
|
144
145
|
selectCoinInForSwap: (tx: Transaction, amount: bigint, coinType: string) => Promise<TransactionObjectArgument>;
|
|
145
|
-
buildSwapTransaction: (params: SwapParams) => Promise<{
|
|
146
|
+
buildSwapTransaction: (params: SwapParams<RawRouteResultType>) => Promise<{
|
|
146
147
|
tx: Transaction;
|
|
147
148
|
coinOut: TransactionObjectArgument;
|
|
148
149
|
}>;
|
|
@@ -192,6 +193,7 @@ declare class TypedEventEmitter<Events extends Record<string, any>> extends Even
|
|
|
192
193
|
}
|
|
193
194
|
|
|
194
195
|
declare abstract class SwapSdkBase<PoolType = string, RawRouteResultType = any, FetchRouteSettings = any> implements SwapSdkBaseInterface<PoolType, RawRouteResultType, FetchRouteSettings> {
|
|
196
|
+
BASIS_POINT_DIVISOR: number;
|
|
195
197
|
protected rawRouteResult?: RawRouteResultType;
|
|
196
198
|
readonly name: string;
|
|
197
199
|
readonly events: TypedEventEmitter<SwapSdkEvents<PoolType>>;
|
|
@@ -227,7 +229,7 @@ declare abstract class SwapSdkBase<PoolType = string, RawRouteResultType = any,
|
|
|
227
229
|
protected selectCoins(coinType: string, amount: string): Promise<_mysten_sui_dist_cjs_client.CoinStruct[]>;
|
|
228
230
|
abstract setFetchRouteSettings(settings: FetchRouteSettings): void;
|
|
229
231
|
abstract fetchRoute(params: FetchRouteParams, abortSignal?: AbortSignal): Promise<FetchRouteResult<RawRouteResultType>>;
|
|
230
|
-
abstract buildSwapTransaction(params: SwapParams): Promise<{
|
|
232
|
+
abstract buildSwapTransaction(params: SwapParams<RawRouteResultType>): Promise<{
|
|
231
233
|
tx: Transaction;
|
|
232
234
|
coinOut: TransactionObjectArgument;
|
|
233
235
|
}>;
|
|
@@ -248,6 +250,7 @@ type TxExt = {
|
|
|
248
250
|
coinIn: TransactionObjectArgument;
|
|
249
251
|
};
|
|
250
252
|
type BuildOptionsBase = {
|
|
253
|
+
slippage?: number;
|
|
251
254
|
txExtensionParams?: TxExt;
|
|
252
255
|
};
|
|
253
256
|
declare class Aggregator {
|
|
@@ -339,7 +342,7 @@ declare class CetusSwap extends SwapSdkBase<string, RouterDataV3, FetchRouteSett
|
|
|
339
342
|
};
|
|
340
343
|
rawRouteResult: RouterDataV3;
|
|
341
344
|
}>;
|
|
342
|
-
buildSwapTransaction(params: SwapParams): Promise<{
|
|
345
|
+
buildSwapTransaction(params: SwapParams<RouterDataV3>): Promise<{
|
|
343
346
|
tx: Transaction;
|
|
344
347
|
coinOut: _mysten_sui_dist_cjs_transactions.TransactionObjectArgument;
|
|
345
348
|
}>;
|
|
@@ -356,7 +359,7 @@ declare class AftermathSwap extends SwapSdkBase<RouterProtocolName, RouterComple
|
|
|
356
359
|
setFetchRouteSettings(settings: FetchRouteSettings$2): void;
|
|
357
360
|
private parseRawRouteToFormattedResult;
|
|
358
361
|
fetchRoute(params: FetchRouteParams, abortSignal?: AbortSignal): Promise<FetchRouteResult<RouterCompleteTradeRoute>>;
|
|
359
|
-
buildSwapTransaction(params: SwapParams): Promise<{
|
|
362
|
+
buildSwapTransaction(params: SwapParams<RouterCompleteTradeRoute>): Promise<{
|
|
360
363
|
tx: Transaction$1;
|
|
361
364
|
coinOut: _scallop_io_sui_kit.TransactionObjectArgument;
|
|
362
365
|
}>;
|
|
@@ -391,7 +394,7 @@ declare class _7kSwap extends SwapSdkBase<SourceDex, QuoteResponse, FetchRouteSe
|
|
|
391
394
|
private createRoute;
|
|
392
395
|
private parseRawRouteToFormattedResult;
|
|
393
396
|
fetchRoute(params: FetchRouteParams, abortSignal?: AbortSignal): Promise<FetchRouteResult<QuoteResponse>>;
|
|
394
|
-
buildSwapTransaction(params: SwapParams): Promise<{
|
|
397
|
+
buildSwapTransaction(params: SwapParams<QuoteResponse>): Promise<{
|
|
395
398
|
tx: Transaction$1;
|
|
396
399
|
coinOut: TransactionObjectArgument$1;
|
|
397
400
|
}>;
|
|
@@ -408,7 +411,7 @@ declare class FlowXSwap extends SwapSdkBase<Protocol, GetRoutesResult<Coin$1, Co
|
|
|
408
411
|
calcSlippage(slippageInBps: number): number;
|
|
409
412
|
protected parseRawRouteToFormattedResult(rawRouteResult: GetRoutesResult<Coin$1, Coin$1>): FormattedRouteResult;
|
|
410
413
|
fetchRoute(params: FetchRouteParams, abortSignal?: AbortSignal): Promise<FetchRouteResult<GetRoutesResult<Coin$1, Coin$1>>>;
|
|
411
|
-
buildSwapTransaction(params: SwapParams): Promise<{
|
|
414
|
+
buildSwapTransaction(params: SwapParams<GetRoutesResult<Coin$1, Coin$1>>): Promise<{
|
|
412
415
|
tx: Transaction;
|
|
413
416
|
coinOut: TransactionObjectArgument;
|
|
414
417
|
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -75,7 +75,8 @@ type FetchRouteParams = {
|
|
|
75
75
|
coinOutType: string;
|
|
76
76
|
swapAmount: bigint;
|
|
77
77
|
};
|
|
78
|
-
type SwapParams = {
|
|
78
|
+
type SwapParams<T> = {
|
|
79
|
+
route?: FetchRouteResult<T>;
|
|
79
80
|
slippage: number;
|
|
80
81
|
minAmountOut?: bigint;
|
|
81
82
|
txExtensionParams?: {
|
|
@@ -142,7 +143,7 @@ interface SwapSdkBaseInterface<PoolType = string, RawRouteResultType = any, Fetc
|
|
|
142
143
|
* @returns Promise<TransactionObjectArgument>
|
|
143
144
|
*/
|
|
144
145
|
selectCoinInForSwap: (tx: Transaction, amount: bigint, coinType: string) => Promise<TransactionObjectArgument>;
|
|
145
|
-
buildSwapTransaction: (params: SwapParams) => Promise<{
|
|
146
|
+
buildSwapTransaction: (params: SwapParams<RawRouteResultType>) => Promise<{
|
|
146
147
|
tx: Transaction;
|
|
147
148
|
coinOut: TransactionObjectArgument;
|
|
148
149
|
}>;
|
|
@@ -192,6 +193,7 @@ declare class TypedEventEmitter<Events extends Record<string, any>> extends Even
|
|
|
192
193
|
}
|
|
193
194
|
|
|
194
195
|
declare abstract class SwapSdkBase<PoolType = string, RawRouteResultType = any, FetchRouteSettings = any> implements SwapSdkBaseInterface<PoolType, RawRouteResultType, FetchRouteSettings> {
|
|
196
|
+
BASIS_POINT_DIVISOR: number;
|
|
195
197
|
protected rawRouteResult?: RawRouteResultType;
|
|
196
198
|
readonly name: string;
|
|
197
199
|
readonly events: TypedEventEmitter<SwapSdkEvents<PoolType>>;
|
|
@@ -227,7 +229,7 @@ declare abstract class SwapSdkBase<PoolType = string, RawRouteResultType = any,
|
|
|
227
229
|
protected selectCoins(coinType: string, amount: string): Promise<_mysten_sui_dist_cjs_client.CoinStruct[]>;
|
|
228
230
|
abstract setFetchRouteSettings(settings: FetchRouteSettings): void;
|
|
229
231
|
abstract fetchRoute(params: FetchRouteParams, abortSignal?: AbortSignal): Promise<FetchRouteResult<RawRouteResultType>>;
|
|
230
|
-
abstract buildSwapTransaction(params: SwapParams): Promise<{
|
|
232
|
+
abstract buildSwapTransaction(params: SwapParams<RawRouteResultType>): Promise<{
|
|
231
233
|
tx: Transaction;
|
|
232
234
|
coinOut: TransactionObjectArgument;
|
|
233
235
|
}>;
|
|
@@ -248,6 +250,7 @@ type TxExt = {
|
|
|
248
250
|
coinIn: TransactionObjectArgument;
|
|
249
251
|
};
|
|
250
252
|
type BuildOptionsBase = {
|
|
253
|
+
slippage?: number;
|
|
251
254
|
txExtensionParams?: TxExt;
|
|
252
255
|
};
|
|
253
256
|
declare class Aggregator {
|
|
@@ -339,7 +342,7 @@ declare class CetusSwap extends SwapSdkBase<string, RouterDataV3, FetchRouteSett
|
|
|
339
342
|
};
|
|
340
343
|
rawRouteResult: RouterDataV3;
|
|
341
344
|
}>;
|
|
342
|
-
buildSwapTransaction(params: SwapParams): Promise<{
|
|
345
|
+
buildSwapTransaction(params: SwapParams<RouterDataV3>): Promise<{
|
|
343
346
|
tx: Transaction;
|
|
344
347
|
coinOut: _mysten_sui_dist_cjs_transactions.TransactionObjectArgument;
|
|
345
348
|
}>;
|
|
@@ -356,7 +359,7 @@ declare class AftermathSwap extends SwapSdkBase<RouterProtocolName, RouterComple
|
|
|
356
359
|
setFetchRouteSettings(settings: FetchRouteSettings$2): void;
|
|
357
360
|
private parseRawRouteToFormattedResult;
|
|
358
361
|
fetchRoute(params: FetchRouteParams, abortSignal?: AbortSignal): Promise<FetchRouteResult<RouterCompleteTradeRoute>>;
|
|
359
|
-
buildSwapTransaction(params: SwapParams): Promise<{
|
|
362
|
+
buildSwapTransaction(params: SwapParams<RouterCompleteTradeRoute>): Promise<{
|
|
360
363
|
tx: Transaction$1;
|
|
361
364
|
coinOut: _scallop_io_sui_kit.TransactionObjectArgument;
|
|
362
365
|
}>;
|
|
@@ -391,7 +394,7 @@ declare class _7kSwap extends SwapSdkBase<SourceDex, QuoteResponse, FetchRouteSe
|
|
|
391
394
|
private createRoute;
|
|
392
395
|
private parseRawRouteToFormattedResult;
|
|
393
396
|
fetchRoute(params: FetchRouteParams, abortSignal?: AbortSignal): Promise<FetchRouteResult<QuoteResponse>>;
|
|
394
|
-
buildSwapTransaction(params: SwapParams): Promise<{
|
|
397
|
+
buildSwapTransaction(params: SwapParams<QuoteResponse>): Promise<{
|
|
395
398
|
tx: Transaction$1;
|
|
396
399
|
coinOut: TransactionObjectArgument$1;
|
|
397
400
|
}>;
|
|
@@ -408,7 +411,7 @@ declare class FlowXSwap extends SwapSdkBase<Protocol, GetRoutesResult<Coin$1, Co
|
|
|
408
411
|
calcSlippage(slippageInBps: number): number;
|
|
409
412
|
protected parseRawRouteToFormattedResult(rawRouteResult: GetRoutesResult<Coin$1, Coin$1>): FormattedRouteResult;
|
|
410
413
|
fetchRoute(params: FetchRouteParams, abortSignal?: AbortSignal): Promise<FetchRouteResult<GetRoutesResult<Coin$1, Coin$1>>>;
|
|
411
|
-
buildSwapTransaction(params: SwapParams): Promise<{
|
|
414
|
+
buildSwapTransaction(params: SwapParams<GetRoutesResult<Coin$1, Coin$1>>): Promise<{
|
|
412
415
|
tx: Transaction;
|
|
413
416
|
coinOut: TransactionObjectArgument;
|
|
414
417
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -7,26 +7,26 @@ var bignumber_js = require('bignumber.js');
|
|
|
7
7
|
var events = require('events');
|
|
8
8
|
var transactions = require('@mysten/sui/transactions');
|
|
9
9
|
var aggregatorSdk = require('@cetusprotocol/aggregator-sdk');
|
|
10
|
-
var
|
|
10
|
+
var _ = require('bn.js');
|
|
11
11
|
var aftermathTsSdk = require('aftermath-ts-sdk');
|
|
12
12
|
var sdkTs = require('@7kprotocol/sdk-ts');
|
|
13
13
|
var sdk = require('@flowx-finance/sdk');
|
|
14
14
|
|
|
15
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var ___default = /*#__PURE__*/_interopDefault(_);
|
|
18
18
|
|
|
19
|
-
var X=utils.normalizeStructTag(utils.SUI_TYPE_ARG),h=r=>utils.normalizeStructTag(r)===X,R=async(r,e,A,t)=>{let a=[],c=bignumber_js.BigNumber(A);try{let s=null;do{let{data:o,hasNextPage:n,nextCursor:i}=await r.getCoins({coinType:e,owner:t,limit:50});if(a.push(...o),c=c.minus(o.reduce((k,Y)=>k.plus(bignumber_js.BigNumber(Y.balance)),bignumber_js.BigNumber(0))),c.lte(0)||(s=i,!n))break}while(s)}catch(s){console.error(s);}if(a.length===0)throw new Error(`No available coin for type ${e} found in wallet ${t}`);if(c.gt(0))throw new Error(`Insufficient balance for coin type ${e} in wallet ${t}`);return a},C=async(r,e,A,t,a)=>{try{if(h(t))r.mergeCoins(r.gas,[e]);else {let{data:c}=await A.getCoins({coinType:t,owner:a,limit:1});if(!c.length)throw new Error(`No existing ${t} coin found to merge with`);let s=r.objectRef({objectId:c[0].coinObjectId,version:c[0].version,digest:c[0].digest});c.length===1?r.mergeCoins(s,[e]):r.mergeCoins(s,[e,...c.slice(1).map(o=>r.objectRef({objectId:o.coinObjectId,version:o.version,digest:o.digest}))]);}}catch(c){console.warn(c.message),r.transferObjects([e],r.pure.address(a));}},Z=r=>r[0].toUpperCase()+r.slice(1),b=r=>r.split("_").map(Z).join(" ");var u=class extends events.EventEmitter{on(e,A){return super.on(e,A)}once(e,A){return super.once(e,A)}off(e,A){return super.off(e,A)}emit(e,A){return super.emit(e,A)}};var d=class{rawRouteResult;name="";events=new u;client;fetchTimeoutInMs;walletAddress;fetchSettings;poolsMap=new Map;constructor(e,A){this.client=A.client??new client.SuiClient({url:client.getFullnodeUrl("mainnet")}),this.fetchTimeoutInMs=A.fetchTimeoutInMs??4e3,this.walletAddress=A.walletAddress,this.name=e.toLowerCase(),A.fetchSettings&&this.setFetchRouteSettings(A.fetchSettings);}get pools(){return Array.from(this.poolsMap.keys())}validateWalletAddress(){if(!this.walletAddress||this.walletAddress.length===0)throw new Error("Wallet address is not set")}validateRawRouteResult(){if(!this.rawRouteResult)throw new Error("Raw route result is not set. Please fetch route first.")}setWalletAddress(e){this.walletAddress=e;}setSuiClient(e){this.client=e;}calcSlippage(e){return e/1e4}togglePoolStatus(e,A){let t=A??!(this.poolsMap.get(e)??true);this.poolsMap.set(e,t),this.events.emit("poolStatusChanged",{name:this.name,pool:e,enabled:t});}toggleAllPoolStatus(e){this.pools.forEach(A=>{this.poolsMap.set(A,e);}),this.events.emit("allPoolStatusChanged",{name:this.name,enabled:e});}getEnabledPools(){return Array.from(this.poolsMap.entries()).filter(([e,A])=>A).map(([e,A])=>e)}normalizeFetchRouteParams(e){return {...e,coinInType:suiKit.normalizeStructTag(e.coinInType),coinOutType:suiKit.normalizeStructTag(e.coinOutType)}}async withTimeout(e,A){let t=[e,new Promise((c,s)=>{setTimeout(()=>{s(new Error(`${this.name} fetch route timeout`));},this.fetchTimeoutInMs);})];return A&&t.push(new Promise((c,s)=>{if(A.aborted){s(A.reason??new Error(`${this.name} fetch route aborted`));return}A.addEventListener("abort",()=>s(A.reason??new Error(`${this.name} fetch route aborted`)),{once:true});})),await Promise.race(t)}async selectCoinInForSwap(e,A,t){let a=bignumber_js.BigNumber(A.toString());if(h(t)){let[c]=e.splitCoins(e.gas,[a.toString()]);return c}else {let c=await this.selectCoins(t,a.toString()),s=c.reduce((n,i)=>n.plus(bignumber_js.BigNumber(i.balance)),bignumber_js.BigNumber(0)),o=e.objectRef({objectId:c[0].coinObjectId,version:c[0].version,digest:c[0].digest});if(c.length>1&&e.mergeCoins(o,c.slice(1).map(n=>e.objectRef({objectId:n.coinObjectId,version:n.version,digest:n.digest}))),s.gt(a)){let[n]=e.splitCoins(o,[a.toString()]);return n}else return o}}async selectCoins(e,A){return this.validateWalletAddress(),await R(this.client,e,A,this.walletAddress)}};var m=class{constructor(e,A){this.client=e;A&&A.forEach(t=>this.cache.set(t.coinType,t));}cache=new Map;setClient(e){this.client=e;}async getCoinMetadata(e){let A=utils.normalizeStructTag(e);if(this.cache.has(A))return this.cache.get(A);let t=await this.client.getCoinMetadata({coinType:A});if(!t)throw new Error(`Coin metadata not found for coin type: ${A}`);return this.cache.set(A,t),t}};var S=class{coinMetadata;suiKit;events=new u;_slippage=30;signerMode=false;aggregatorMap=new Map;activeAggregator=new Map;_fetchingStatus=new Map;poolStatusForwarders=new Map;walletAddress;client;constructor(e){if(this.client=e.client??new client.SuiClient({url:e.fullnodeUrl||"https://fullnode.mainnet.sui.io:443"}),this.coinMetadata=new m(this.client),this.signerMode=!!(e.secretKey||e.mnemonics),e.secretKey||e.mnemonics)this.suiKit=new suiKit.SuiKit({...e,suiClients:[this.client]}),this.walletAddress=this.suiKit.currentAddress;else if(e.walletAddress!==void 0)this.walletAddress=e.walletAddress;else throw new Error("One of secretKey, mnemonics or walletAddress must be provided")}forwardPoolStatusChangeEvent(e){this.events.emit("poolStatusChanged",e);}addAggregator(e){for(let A of e)if(!this.aggregatorMap.has(A.name)){this.aggregatorMap.set(A.name,A),this.activeAggregator.set(A.name,true),this._fetchingStatus.set(A.name,false);let t=a=>this.forwardPoolStatusChangeEvent(a);this.poolStatusForwarders.set(A.name,t),A.events.on("poolStatusChanged",t),this.events.emit("aggregatorAdded",{name:A.name});}}getActiveAggregators(){return Array.from(this.activeAggregator.entries()).filter(([e,A])=>A).map(([e,A])=>e)}getAggregator(e){return this.aggregatorMap.get(e)}toggleAggregator(e,A){if(!this.activeAggregator.has(e))throw new Error(`Aggregator ${e} not found`);this.activeAggregator.set(e,A),this.events.emit("aggregatorStatusChanged",{name:e,enabled:A});}removeAggregator(e){let A=this.aggregatorMap.get(e);if(!A)throw new Error(`Aggregator ${e} not found`);let t=this.poolStatusForwarders.get(e);t&&A.events.off("poolStatusChanged",t),this.poolStatusForwarders.delete(e),this.aggregatorMap.delete(e),this.activeAggregator.delete(e),this._fetchingStatus.delete(e),this.events.emit("aggregatorRemoved",{name:e});}get aggregators(){return Array.from(this.aggregatorMap.values())}get fetchingStatus(){return Object.fromEntries(this._fetchingStatus)}get slippage(){return this._slippage}setSlippage(e){this._slippage=e,this.events.emit("aggregatorSlippageChanged",{slippageInBps:e});}setFetchTimeoutInMs(e){this.aggregators.forEach(A=>{A.fetchTimeoutInMs=e;});}#e(){if(!this.suiKit)throw new Error("SuiKit is not initialized.")}setSuiClient(e){this.aggregators.forEach(A=>{A.setSuiClient(e);}),this.coinMetadata.setClient(e),this.client=e;}setWalletAddress(e){if(this.signerMode)throw new Error("Cannot change wallet address when SuiKit is initialized with secretKey or mnemonics.");if(!utils.isValidSuiAddress(e))throw new Error("Invalid Sui wallet address");this.walletAddress=e,this.aggregators.forEach(A=>{A.setWalletAddress(e);});}async getCoinMetadata(e){return this.coinMetadata.getCoinMetadata(e)}async fetchRoutes(e,A){let t=this.aggregators.filter(({name:o})=>this.activeAggregator.get(o)===true);console.log("Available aggregators:",t.map(o=>o.name).join(", ")),console.log(`Fetching routes for ${e.coinInType} -> ${e.coinOutType}...`);let a=[],c=[],s=t.map(async o=>{this._fetchingStatus.set(o.name,true),this.events.emit("aggregatorFetchStart",{name:o.name});try{let n=await o.fetchRoute(e,A?.abortSignal);a.push(n),A?.onRouteFound?.(n);}catch(n){let i={name:o.name,reason:n};c.push(i),A?.onError?.(i);}finally{this._fetchingStatus.set(o.name,false),this.events.emit("aggregatorFetchEnd",{name:o.name});}});return await Promise.all(s),{routes:a.sort((o,n)=>bignumber_js.BigNumber(n.formattedResult.coinOut.amount).comparedTo(o.formattedResult.coinOut.amount)??0),errors:c}}async buildRouteTransaction(e,A={}){let{mergeResult:t=true,txExtensionParams:a}=A,c=this.aggregatorMap.get(e.formattedResult.name);if(!c)throw new Error(`Aggregator ${e.formattedResult.name} not found in the aggregator list`);console.log(`Using ${c.name} to build transaction... (in: ${utils.normalizeStructTag(e.formattedResult.coinIn.type)}, out: ${e.formattedResult.coinOut.type}, amountOut: ${e.formattedResult.coinOut.amount})`);let{tx:s,coinOut:o}=await c.buildSwapTransaction({slippage:this.slippage,txExtensionParams:a}),n=e.formattedResult.coinOut.type;return t?(await C(s,o,this.client,n,this.walletAddress),{tx:s,coinOutType:n}):{tx:s,coinOut:o,coinOutType:n}}async executeSwapTransaction(e,A=false){return this.#e(),A?this.suiKit.dryRunTxn(e):this.suiKit.signAndSendTxn(e)}};var F=class extends d{cetusClient;constructor(e){super("cetus",e),this.cetusClient=new aggregatorSdk.AggregatorClient({...e,endpoint:e.endpoint??"https://api-sui.cetus.zone/router_v3/find_routes",signer:e.signer??this.walletAddress,client:e.client??this.client}),this.cetusClient=new aggregatorSdk.AggregatorClient({endpoint:"https://api-sui.cetus.zone/router_v3/find_routes",signer:this.walletAddress,client:this.client,env:aggregatorSdk.Env.Mainnet}),this.poolsMap=new Map(aggregatorSdk.ALL_DEXES.map(A=>[A,true]));}createRoute(e,A,t){let a=[],c=null,s=0;for(let n of e)n.from===A?(a.push({paths:[],coinIn:{type:n.from,amount:BigInt(n.amountIn)},coinOut:{type:n.target,amount:BigInt(n.amountOut)}}),c=n.target):n.from===c?a[s].paths.push({protocolName:n.provider,coinIn:{type:n.from,amount:BigInt(n.amountIn)},coinOut:{type:n.target,amount:BigInt(n.amountOut)}}):n.target===t&&(s++,c=null);let o=a.reduce((n,i)=>n+i.coinIn.amount,BigInt(0)).toString();return a.forEach(n=>{n.splitPercentage=bignumber_js.BigNumber(n.coinIn.amount.toString()).div(o).times(100).toNumber();}),a}parseRawToFormattedResult({routerData:e,coinInType:A,coinOutType:t}){return {coinIn:{type:A,amount:BigInt(e.amountIn.toString()??"0")},coinOut:{type:t,amount:BigInt(e.amountOut.toString()??"0")},routes:this.createRoute(e.paths,A,t)}}setFetchRouteSettings(e){this.fetchSettings=e;}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:a,coinOutType:c,swapAmount:s}=t,o=await this.withTimeout(this.cetusClient.findRouters({...this.fetchSettings,from:utils.normalizeStructTag(a),target:utils.normalizeStructTag(c),amount:new G__default.default(s.toString()),byAmountIn:true,providers:this.getEnabledPools()}),A);if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:{...this.parseRawToFormattedResult({routerData:o,coinInType:a,coinOutType:c}),name:this.name},rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let A=null,t=null;if(e.txExtensionParams){let{initTx:c,coinIn:s}=e.txExtensionParams;A=c,t=s;}else A=new transactions.Transaction,A.setSender(this.walletAddress),t=await this.selectCoinInForSwap(A,BigInt(this.rawRouteResult.amountIn.toString()),utils.normalizeStructTag(this.rawRouteResult.paths[0].from));let a=await this.cetusClient.routerSwap({router:this.rawRouteResult,txb:A,slippage:this.calcSlippage(e.slippage),inputCoin:t});return {tx:A,coinOut:a}}};var y={faucet:{packages:{faucet:"",suiFrensGenesisWrapper:""},objects:{faucet:"",suiFrensMint:""}},staking:{packages:{events:"0x7f6ce7ade63857c4fd16ef7783fed2dfc4d7fb7e40615abdb653030b76aef0c6",lsd:"0x1575034d2729907aefca1ac757d6ccfcd3fc7e9e77927523c06007d8353ad836",afsui:"0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc"},objects:{stakedSuiVault:"0x2f8f6d5da7f13ea37daa397724280483ed062769813b6f31e9788e59cc88994d",stakedSuiVaultState:"0x55486449e41d89cfbdb20e005c1c5c1007858ad5b4d5d7c047d2b3b592fe8791",safe:"0xeb685899830dd5837b47007809c76d91a098d52aabbf61e8ac467c59e5cc4610",treasury:"0xd2b95022244757b0ab9f74e2ee2fb2c3bf29dce5590fa6993a85d64bd219d7e8",referralVault:"0x4ce9a19b594599536c53edb25d22532f82f18038dc8ef618afd00fbbfb9845ef",validatorConfigsTable:"0x8536350cfb8a8efdd133a1e087b55416d431f7e8b894f77b55b20c4b799ebad9",aftermathValidator:"0xd30018ec3f5ff1a3c75656abf927a87d7f0529e6dc89c7ddd1bd27ecb05e3db2"}},pools:{packages:{amm:"0xc4049b2d1cc0f6e017fda8260e4377cecd236bd7f56a54fee120816e72e2e0dd",ammInterface:"0x8d8bba50c626753589aa5abbc006c9fa07736f55f4e6fb57481682997c0b0d52",events:"0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c",eventsV2:"0xc4049b2d1cc0f6e017fda8260e4377cecd236bd7f56a54fee120816e72e2e0dd"},objects:{poolRegistry:"0xfcc774493db2c45c79f688f88d28023a3e7d98e4ee9f48bbf5c7990f651577ae",protocolFeeVault:"0xf194d9b1bcad972e45a7dd67dd49b3ee1e3357a00a50850c52cd51bb450e13b4",treasury:"0x28e499dff5e864a2eafe476269a4f5035f1c16f338da7be18b103499abf271ce",insuranceFund:"0xf0c40d67b078000e18032334c3325c47b9ec9f3d9ae4128be820d54663d14e3b",lpCoinsTable:"0x7f3bb65251feccacc7f48461239be1008233b85594114f7bf304e5e5b340bf59"},other:{createLpCoinPackageCompilations:{0:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEAAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[167,102,246,194,32,223,3,45,134,147,18,9,59,94,154,58,126,34,119,96,13,193,175,198,63,222,118,4,234,110,46,214]}',1:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEBAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[68,93,25,253,95,37,116,117,115,245,79,81,250,68,193,193,125,175,148,139,217,235,215,33,240,45,78,14,3,86,156,253]}',2:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgECAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[226,124,21,102,7,55,200,164,249,68,13,253,43,195,52,31,88,207,26,30,152,251,208,57,135,126,235,45,23,164,119,82]}',3:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEDAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[1,144,16,189,84,90,47,167,188,222,48,174,25,190,46,185,6,221,67,91,132,40,116,30,179,102,100,127,83,12,109,13]}',4:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEEAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[188,181,24,0,200,201,56,67,47,157,254,230,47,200,183,173,203,125,184,180,21,175,170,42,167,82,194,112,35,226,84,160]}',5:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEFAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[139,229,11,229,58,97,20,164,146,173,45,172,225,131,71,62,84,106,77,218,122,249,243,255,146,34,28,60,77,35,55,138]}',6:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEGAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[57,76,77,44,68,157,60,123,68,75,189,64,53,35,82,187,207,42,126,62,112,57,251,96,190,255,39,160,152,130,157,52]}',7:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEHAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[123,60,245,235,196,138,131,187,192,81,41,5,55,144,176,99,178,245,228,90,186,155,175,11,175,182,127,251,112,69,207,36]}',8:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEIAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[62,140,187,2,13,226,252,216,57,79,25,215,73,0,30,117,240,181,17,67,90,160,116,93,0,185,100,177,98,158,120,249]}',9:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEJAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[224,168,250,132,113,73,22,162,90,31,20,5,146,218,102,211,9,26,235,144,153,60,68,242,99,43,182,103,163,123,70,243]}',10:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEKAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[230,2,103,229,53,229,25,139,165,170,103,184,37,95,22,138,144,54,70,94,84,1,166,69,226,228,2,111,190,177,88,67]}',11:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgELAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[47,22,229,32,128,229,189,95,254,208,76,7,63,57,67,181,242,47,139,87,115,116,187,69,186,231,157,193,217,175,119,251]}',12:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEMAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[84,220,49,85,231,231,205,206,223,231,112,68,34,157,61,115,234,156,6,203,2,158,212,203,215,170,136,228,68,193,188,13]}',13:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgENAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[237,140,135,226,69,221,118,110,149,250,210,127,140,11,253,163,73,64,189,152,115,51,234,40,195,87,188,107,171,233,96,99]}',14:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEOAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[178,202,9,164,149,122,241,165,109,17,64,83,161,86,55,194,230,149,60,174,236,221,205,150,98,176,28,228,122,182,83,85]}',15:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEPAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[162,91,42,1,93,167,63,154,173,142,135,15,249,131,197,24,69,164,212,169,231,169,19,38,42,86,25,84,219,229,233,20]}',16:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEQAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[79,121,127,12,72,247,127,165,243,18,184,175,76,20,119,251,245,47,31,190,247,87,15,198,47,204,130,99,18,94,161,74]}',17:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgERAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[40,28,55,168,44,135,53,11,9,113,97,54,212,21,163,15,203,241,151,5,117,250,3,22,135,69,113,175,166,166,111,19]}',18:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgESAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[173,252,173,67,1,192,123,156,242,232,253,247,12,147,190,24,152,41,3,166,219,90,110,43,48,139,30,235,10,219,209,58]}'}}},daoFeePools:{packages:{amm:"0x5ad6890968efcf3d20899e0cec735214f1067b96e77e77d86408989998468bb2",events:"0x6f60a091637054e23915b8745c0c0d47b1d49618ee3435b5f68eccf6a44fb53d"},objects:{version:"0xb4bfb0f917f12ad2a772bea9b4f22431f6f5f9653162c3ae6fae5b99b21392b7"}},farms:{packages:{vaults:"0x7ce31301b506b4ed327523061fe95d9c347082fa60da39733f74ffad9a53f8f5",vaultsInitial:"0x4f0a1a923dd063757fd37e04a9c2cee8980008e94433c9075c390065f98e9e4b",vaultsV2:"0x2d6755e10132fc1eab5e8a4a3e7ddfdacc31884621592d95fce48ecf1e157db9",eventsV2:"0x79ee374b9e3c60c00a19fdbeaea25731bbea8f2cab9bb61bb712543e0ba55b7a"},objects:{version:"0xdc372fa9b6a538382efc560478a786fcf04e6e34850100020056c98c5c387193"}},dca:{packages:{dca:"0x409e2ace51cc5821be41a667e4cb9afa64cde49a7f940c68109db24b39ca93b8",events:"0x002134246a32eec18e68f1f5aadb8edd34856298ae6d32c145d28f3ca46c7fd1",eventsV2:"0x409e2ace51cc5821be41a667e4cb9afa64cde49a7f940c68109db24b39ca93b8"},objects:{config:"0x1b26465e9c688e3a3d2301f26e25091bc0f91708d953dc220f5697faa8ba9bd6"}},limitOrders:{packages:{limitOrders:"0xe57ee3613b7dece546f8a2d8a53145cbab41d32b86037b94f9ebfcbcfa66885a",events:"0xe57ee3613b7dece546f8a2d8a53145cbab41d32b86037b94f9ebfcbcfa66885a"}},sharedCustody:{address:"0xafe2fafac0b048c9c70a61cc1798400a85173df96b30118c40af6f3382b5a777",publicKey:"AMylYwVSuJQmTmDm6KuPlNwLnTtkk63HqOByubxxsVeC"},referralVault:{packages:{referralVault:"0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf"},objects:{referralVault:"0x35d35b0e5b177593d8c3a801462485572fc30861e6ce96a55af6dc4730709278"}},suiFrens:{packages:{suiFrens:"",suiFrensBullshark:"",accessories:"",suiFrensVault:"",suiFrensVaultCapyLabsExtension:""},objects:{capyLabsApp:"",suiFrensVault:"",suiFrensVaultStateV1:"",suiFrensVaultStateV1MetadataTable:"",suiFrensVaultCapyLabsExtension:""}},router:{packages:{utils:"0xdc15721baa82ba64822d585a7349a1508f76d94ae80e899b06e48369c257750e"}},dynamicGas:{sponsorAddress:"0xae4ba5f592e695a46d58a0579aa5d4f6ebead46be0f2d5bd229d5c292290548c"},perpetuals:{packages:{events:"0x21d001e8b07da2e3facb3e2d636bbaef43ba3c978bd84810368840b7d57c5068"},objects:{registry:"0xd0b3ea6b7a2f5887543a5a493aa70bcd0ec1a2d9c03d830504234df3e8c6a609"}},perpetualsVaults:{other:{createLpCoinPackageCompilation:'{"modules":["oRzrCwYAAAAKAQAOAg4eAywsBFgIBWBZB7kB4gEImwOAAQabBGcKggUFDIcFLAASAwcBDQIGAhMCFAIVAAICAAIBBwEAAAMADAEAAQMDDAEAAQUEAgAGBQcAAAoAAQABCwEDAAIRBgcBAAMICQoBAgQOBgEBDAQPDwEBDAUQDA0ABgwEBQACBQMIBAsFDgIIAAcIBAACCwIBCAALAwEIAAECAQoCAQgFAQkAAQsBAQkAAQgABwkAAgoCCgIKAgsBAQgFBwgEAgsDAQkACwIBCQABCwIBCAABBggEAQUBCwMBCAACCQAFDENvaW5NZXRhZGF0YQZPcHRpb24IVEVNUExBVEULVHJlYXN1cnlDYXAJVHhDb250ZXh0A1VybARjb2luCWNvbnN0YW50cw9jcmVhdGVfY3VycmVuY3kLZHVtbXlfZmllbGQEaW5pdAtscF9kZWNpbWFscxVuZXdfdW5zYWZlX2Zyb21fYnl0ZXMGb3B0aW9uFHB1YmxpY19mcmVlemVfb2JqZWN0D3B1YmxpY190cmFuc2ZlcgZzZW5kZXIEc29tZQh0ZW1wbGF0ZQh0cmFuc2Zlcgp0eF9jb250ZXh0A3VybAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAp4geY2XwRD2s2t7PYVDqpJGMi7y/Y2DrXnvMyXUc7wvCgIJCFRFTVBMQVRFCgIKCUNPSU4gTkFNRQoCERBDT0lOIERFU0NSSVBUSU9OCgI3Nmh0dHBzOi8vYWZ0ZXJtYXRoLmZpbmFuY2UvY29pbnMvcGVycGV0dWFscy9kZWZhdWx0LnN2ZwACAQkBAAAAAAIUCwARAQcABwEHAgcDEQc4AAoBOAEMAgwDCwI4AgsDCwEuEQY4AwIA"],"dependencies":["0x46234ba81f3a5ba6571383233df0f9ea5fe60a3a327537be1f5fec447bced693","0x9e20798d97c110f6b36b7b3d8543aa9246322ef2fd8d83ad79ef3325d473bc2f","0xa8172ed2a6f14cd0ee55124326685713d6f765039e7c5339f7a0b57be06fddb5","0x21d001e8b07da2e3facb3e2d636bbaef43ba3c978bd84810368840b7d57c5068","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000002"],"digest":[197,20,191,110,212,210,250,216,46,69,171,178,75,240,176,17,254,237,222,251,192,94,195,175,10,216,89,18,238,154,114,144]}'}},leveragedStaking:{packages:{leveragedAfSui:"",leveragedAfSuiInitial:""},objects:{leveragedAfSuiState:"",afSuiSuiPoolId:""}},scallop:{objects:{version:"",afSuiMarket:"",coinDecimalsRegistry:"",xOracle:""}},nftAmm:{packages:{nftAmm:""},objects:{protocolFeeVault:"",treasury:"",insuranceFund:"",referralVault:""}},nfts:{packages:{mystenTransferPolicy:"0x0cb4bcc0560340eb1a1b929cabe56b33fc6449820ec8c1980d69bb98b649b802"}}};var g=()=>(...r)=>r;var a0=g()("Aftermath","Bolt","Bluefin","BlueMove","Cetus","DeepBook","DeepBookV3","DoubleUpPump","FlowX","FlowXClmm","FullSail","HopFun","Kriya","KriyaClmm","Magma","Metastable","Momentum","MovePump","Obric","SpringSui","Steamm","SuiAi","SuiSwap","Turbos","TurbosFun","BlastFun"),Q=class extends d{afClient;afApi;constructor(e){super("aftermath",e),this.afApi=new aftermathTsSdk.AftermathApi(this.client,e.addresses??y),this.afClient=new aftermathTsSdk.Aftermath("MAINNET",this.afApi),this.poolsMap=new Map(a0.map(A=>[A,true]));}get router(){return this.afClient.Router()}setFetchRouteSettings(e){this.fetchSettings=e;}parseRawRouteToFormattedResult(e){let A=e.coinIn.amount,t={...e,name:this.name};return t.routes.forEach(a=>{let c=a.paths[0].coinIn.amount;a.splitPercentage=bignumber_js.BigNumber(c.toString()).div(A.toString()).times(100).toNumber();}),t}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:a,coinOutType:c,swapAmount:s}=t,o=await this.withTimeout(this.router.getCompleteTradeRouteGivenAmountIn({...this.fetchSettings,protocolWhitelist:this.getEnabledPools(),coinInType:a,coinOutType:c,coinInAmount:s},A));if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:this.parseRawRouteToFormattedResult(o),rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let A=null,t=null;if(e.txExtensionParams){let{initTx:s,coinIn:o}=e.txExtensionParams;A=s,t=o;}else A=new suiKit.Transaction,A.setSender(this.walletAddress),t=await this.selectCoinInForSwap(A,this.rawRouteResult.coinIn.amount,suiKit.normalizeStructTag(this.rawRouteResult.coinIn.type));let{tx:a,coinOutId:c}=await this.router.addTransactionForCompleteTradeRoute({walletAddress:this.walletAddress,completeRoute:this.rawRouteResult,slippage:this.calcSlippage(e.slippage),tx:A,coinInId:t});if(!c)throw new Error(`${this.name} build swap transaction failed`);return {tx:a,coinOut:c}}};var r0=g()("aftermath","bluefin","bluemove","cetus","cetus_dlmm","deepbook_v3","ferra_clmm","ferra_dlmm","flowx","flowx_v3","fullsail","kriya","kriya_v3","magma","obric","springsui","steamm","stsui","suiswap","turbos","bluefinx","steamm_oracle_quoter","haedal_pmm","momentum","steamm_oracle_quoter_v2","sevenk_v1"),P=class extends d{commission;constructor(e){super("7k",e),this.commission=e.commission??{partner:this.walletAddress,commissionBps:0},sdkTs.setSuiClient(this.client),this.poolsMap=new Map(r0.map(A=>[A,true]));}setFetchRouteSettings(e){this.fetchSettings=e;}createRoute(e,A,t){let a=[];e.forEach((s,o)=>{a.push({paths:[],coinIn:{type:s.tokenIn,amount:BigInt(bignumber_js.BigNumber(s.tokenInAmount).multipliedBy(A).integerValue().toString())},coinOut:{type:s.tokenOut,amount:BigInt(bignumber_js.BigNumber(s.tokenOutAmount).multipliedBy(t).integerValue().toString())}}),s.hops.forEach(n=>{a[o].paths.push({protocolName:b(n.pool.type.toLowerCase()),coinIn:{type:n.tokenIn,amount:BigInt(bignumber_js.BigNumber(n.tokenInAmount).multipliedBy(A).integerValue().toString())},coinOut:{type:n.tokenOut,amount:BigInt(bignumber_js.BigNumber(n.tokenOutAmount).multipliedBy(t).integerValue().toString())}});});});let c=a.reduce((s,o)=>s+o.coinIn.amount,BigInt(0)).toString();return a.forEach(s=>{s.splitPercentage=bignumber_js.BigNumber(s.coinIn.amount.toString()).div(c).times(100).toNumber();}),a}parseRawRouteToFormattedResult(e){if(!e.routes)throw new Error(`${this.name} fetch route returned empty sorRoute`);return {routes:this.createRoute(e.routes,bignumber_js.BigNumber(e.swapAmountWithDecimal).dividedBy(e.swapAmount).toNumber(),bignumber_js.BigNumber(e.returnAmountAfterCommissionWithDecimal).dividedBy(e.returnAmount).toNumber()),coinIn:{type:e.tokenIn,amount:BigInt(e.swapAmountWithDecimal)},coinOut:{type:e.tokenOut,amount:BigInt(e.returnAmountAfterCommissionWithDecimal)},name:this.name}}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:a,coinOutType:c,swapAmount:s}=t,o=await this.withTimeout(sdkTs.getQuote({...this.fetchSettings,tokenIn:a,tokenOut:c,amountIn:s.toString(),sources:this.getEnabledPools()}),A);if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:this.parseRawRouteToFormattedResult(o),rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let A=null,t=null;if(e.txExtensionParams){let{initTx:s,coinIn:o}=e.txExtensionParams;A=s,t=o;}else A=new suiKit.Transaction,A.setSender(this.walletAddress),t=await this.selectCoinInForSwap(A,BigInt(this.rawRouteResult.swapAmountWithDecimal),suiKit.normalizeStructTag(this.rawRouteResult.tokenIn));let{tx:a,coinOut:c}=await sdkTs.buildTx({quoteResponse:this.rawRouteResult,slippage:this.calcSlippage(e.slippage),commission:this.commission,accountAddress:this.walletAddress,extendTx:{tx:A,coinIn:t}});if(!c)throw new Error(`${this.name} build swap transaction failed`);return {tx:"txBytes"in a?suiKit.Transaction.from(a.txBytes):a,coinOut:c}}};var v=class extends d{quoter=new sdk.AggregatorQuoter("mainnet");commission;constructor(e){super("flowx",e),this.commission=e.commission,this.poolsMap=new Map(Object.values(sdk.Protocol).map(A=>[A,true]));}setFetchRouteSettings(e){this.fetchSettings=e;}calcSlippage(e){return e*100}parseRawRouteToFormattedResult(e){let A=[];for(let t of e.routes)A.push({paths:t.paths.map(a=>({protocolName:b(a.protocol()?.toLowerCase()??""),coinIn:{amount:BigInt((a.amountIn??0).toString()),type:a.input.coinType},coinOut:{amount:BigInt((a.amountOut??0).toString()),type:a.output.coinType}})),splitPercentage:Number(t.amountIn??0)/Number(this.rawRouteResult?.amountIn??1)*100,coinIn:{amount:BigInt(t.amountIn.toString()),type:utils.normalizeStructTag(t.input.coinType)},coinOut:{amount:BigInt(t.amountOut.toString()),type:utils.normalizeStructTag(t.output.coinType)}});return {routes:A,coinIn:{type:utils.normalizeStructTag(e.coinIn.coinType),amount:BigInt(e.amountIn.toString())},coinOut:{type:utils.normalizeStructTag(e.coinOut.coinType),amount:BigInt(e.amountOut.toString())},name:this.name}}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:a,coinOutType:c,swapAmount:s}=t,o=await this.withTimeout(this.quoter.getRoutes({...this.fetchSettings,tokenIn:a,tokenOut:c,amountIn:s.toString(),commission:this.commission,includeSources:this.getEnabledPools()}),A);if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:this.parseRawRouteToFormattedResult(o),rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let A=null,t=null;if(e.txExtensionParams){let{initTx:o,coinIn:n}=e.txExtensionParams;A=o,t=n;}else A=new transactions.Transaction,A.setSender(this.walletAddress),t=await this.selectCoinInForSwap(A,BigInt(this.rawRouteResult.amountIn.toString()),utils.normalizeStructTag(this.rawRouteResult.coinIn.coinType));let a=new sdk.TradeBuilder("mainnet",this.rawRouteResult.routes).sender(this.walletAddress).slippage(this.calcSlippage(e.slippage)).deadline(Date.now()+60*60*1e3),s=await(this.commission?a.commission(this.commission).build():a.build()).swap({client:this.client,tx:A,coinIn:t});if(!s)throw new Error(`${this.name} build swap transaction failed`);return {tx:A,coinOut:s}}};
|
|
19
|
+
var Z=utils.normalizeStructTag(utils.SUI_TYPE_ARG),B=r=>utils.normalizeStructTag(r)===Z,E=async(r,e,A,t)=>{let s=[],c=bignumber_js.BigNumber(A);try{let a=null;do{let{data:o,hasNextPage:n,nextCursor:i}=await r.getCoins({coinType:e,owner:t,limit:50});if(s.push(...o),c=c.minus(o.reduce((d,u)=>d.plus(bignumber_js.BigNumber(u.balance)),bignumber_js.BigNumber(0))),c.lte(0)||(a=i,!n))break}while(a)}catch(a){console.error(a);}if(s.length===0)throw new Error(`No available coin for type ${e} found in wallet ${t}`);if(c.gt(0))throw new Error(`Insufficient balance for coin type ${e} in wallet ${t}`);return s},S=async(r,e,A,t,s)=>{try{if(B(t))r.mergeCoins(r.gas,[e]);else {let{data:c}=await A.getCoins({coinType:t,owner:s,limit:1});if(!c.length)throw new Error(`No existing ${t} coin found to merge with`);let a=r.objectRef({objectId:c[0].coinObjectId,version:c[0].version,digest:c[0].digest});c.length===1?r.mergeCoins(a,[e]):r.mergeCoins(a,[e,...c.slice(1).map(o=>r.objectRef({objectId:o.coinObjectId,version:o.version,digest:o.digest}))]);}}catch(c){console.warn(c.message),r.transferObjects([e],r.pure.address(s));}},U=r=>r[0].toUpperCase()+r.slice(1),g=r=>r.split("_").map(U).join(" ");var b=class extends events.EventEmitter{on(e,A){return super.on(e,A)}once(e,A){return super.once(e,A)}off(e,A){return super.off(e,A)}emit(e,A){return super.emit(e,A)}};var f=class{BASIS_POINT_DIVISOR=1e4;rawRouteResult;name="";events=new b;client;fetchTimeoutInMs;walletAddress;fetchSettings;poolsMap=new Map;constructor(e,A){this.client=A.client??new client.SuiClient({url:client.getFullnodeUrl("mainnet")}),this.fetchTimeoutInMs=A.fetchTimeoutInMs??4e3,this.walletAddress=A.walletAddress,this.name=e.toLowerCase(),A.fetchSettings&&this.setFetchRouteSettings(A.fetchSettings);}get pools(){return Array.from(this.poolsMap.keys())}validateWalletAddress(){if(!this.walletAddress||this.walletAddress.length===0)throw new Error("Wallet address is not set")}validateRawRouteResult(){if(!this.rawRouteResult)throw new Error("Raw route result is not set. Please fetch route first.")}setWalletAddress(e){this.walletAddress=e;}setSuiClient(e){this.client=e;}calcSlippage(e){return e/this.BASIS_POINT_DIVISOR}togglePoolStatus(e,A){let t=A??!(this.poolsMap.get(e)??true);this.poolsMap.set(e,t),this.events.emit("poolStatusChanged",{name:this.name,pool:e,enabled:t});}toggleAllPoolStatus(e){this.pools.forEach(A=>{this.poolsMap.set(A,e);}),this.events.emit("allPoolStatusChanged",{name:this.name,enabled:e});}getEnabledPools(){return Array.from(this.poolsMap.entries()).filter(([e,A])=>A).map(([e,A])=>e)}normalizeFetchRouteParams(e){return {...e,coinInType:suiKit.normalizeStructTag(e.coinInType),coinOutType:suiKit.normalizeStructTag(e.coinOutType)}}async withTimeout(e,A){let t=[e,new Promise((c,a)=>{setTimeout(()=>{a(new Error(`${this.name} fetch route timeout`));},this.fetchTimeoutInMs);})];return A&&t.push(new Promise((c,a)=>{if(A.aborted){a(A.reason??new Error(`${this.name} fetch route aborted`));return}A.addEventListener("abort",()=>a(A.reason??new Error(`${this.name} fetch route aborted`)),{once:true});})),await Promise.race(t)}async selectCoinInForSwap(e,A,t){let s=bignumber_js.BigNumber(A.toString());if(B(t)){let[c]=e.splitCoins(e.gas,[s.toString()]);return c}else {let c=await this.selectCoins(t,s.toString()),a=c.reduce((n,i)=>n.plus(bignumber_js.BigNumber(i.balance)),bignumber_js.BigNumber(0)),o=e.objectRef({objectId:c[0].coinObjectId,version:c[0].version,digest:c[0].digest});if(c.length>1&&e.mergeCoins(o,c.slice(1).map(n=>e.objectRef({objectId:n.coinObjectId,version:n.version,digest:n.digest}))),a.gt(s)){let[n]=e.splitCoins(o,[s.toString()]);return n}else return o}}async selectCoins(e,A){return this.validateWalletAddress(),await E(this.client,e,A,this.walletAddress)}};var p=class{constructor(e,A){this.client=e;A&&A.forEach(t=>this.cache.set(t.coinType,t));}cache=new Map;setClient(e){this.client=e;}async getCoinMetadata(e){let A=utils.normalizeStructTag(e);if(this.cache.has(A))return this.cache.get(A);let t=await this.client.getCoinMetadata({coinType:A});if(!t)throw new Error(`Coin metadata not found for coin type: ${A}`);return this.cache.set(A,t),t}};var F=class{coinMetadata;suiKit;events=new b;_slippage=30;signerMode=false;aggregatorMap=new Map;activeAggregator=new Map;_fetchingStatus=new Map;poolStatusForwarders=new Map;walletAddress;client;constructor(e){if(this.client=e.client??new client.SuiClient({url:e.fullnodeUrl||"https://fullnode.mainnet.sui.io:443"}),this.coinMetadata=new p(this.client),this.signerMode=!!(e.secretKey||e.mnemonics),e.secretKey||e.mnemonics)this.suiKit=new suiKit.SuiKit({...e,suiClients:[this.client]}),this.walletAddress=this.suiKit.currentAddress;else if(e.walletAddress!==void 0)this.walletAddress=e.walletAddress;else throw new Error("One of secretKey, mnemonics or walletAddress must be provided")}forwardPoolStatusChangeEvent(e){this.events.emit("poolStatusChanged",e);}addAggregator(e){for(let A of e)if(!this.aggregatorMap.has(A.name)){this.aggregatorMap.set(A.name,A),this.activeAggregator.set(A.name,true),this._fetchingStatus.set(A.name,false);let t=s=>this.forwardPoolStatusChangeEvent(s);this.poolStatusForwarders.set(A.name,t),A.events.on("poolStatusChanged",t),this.events.emit("aggregatorAdded",{name:A.name});}}getActiveAggregators(){return Array.from(this.activeAggregator.entries()).filter(([e,A])=>A).map(([e,A])=>e)}getAggregator(e){return this.aggregatorMap.get(e)}toggleAggregator(e,A){if(!this.activeAggregator.has(e))throw new Error(`Aggregator ${e} not found`);this.activeAggregator.set(e,A),this.events.emit("aggregatorStatusChanged",{name:e,enabled:A});}removeAggregator(e){let A=this.aggregatorMap.get(e);if(!A)throw new Error(`Aggregator ${e} not found`);let t=this.poolStatusForwarders.get(e);t&&A.events.off("poolStatusChanged",t),this.poolStatusForwarders.delete(e),this.aggregatorMap.delete(e),this.activeAggregator.delete(e),this._fetchingStatus.delete(e),this.events.emit("aggregatorRemoved",{name:e});}get aggregators(){return Array.from(this.aggregatorMap.values())}get fetchingStatus(){return Object.fromEntries(this._fetchingStatus)}get slippage(){return this._slippage}setSlippage(e){this._slippage=e,this.events.emit("aggregatorSlippageChanged",{slippageInBps:e});}setFetchTimeoutInMs(e){this.aggregators.forEach(A=>{A.fetchTimeoutInMs=e;});}#e(){if(!this.suiKit)throw new Error("SuiKit is not initialized.")}setSuiClient(e){this.aggregators.forEach(A=>{A.setSuiClient(e);}),this.coinMetadata.setClient(e),this.client=e;}setWalletAddress(e){if(this.signerMode)throw new Error("Cannot change wallet address when SuiKit is initialized with secretKey or mnemonics.");if(!utils.isValidSuiAddress(e))throw new Error("Invalid Sui wallet address");this.walletAddress=e,this.aggregators.forEach(A=>{A.setWalletAddress(e);});}async getCoinMetadata(e){return this.coinMetadata.getCoinMetadata(e)}async fetchRoutes(e,A){let t=this.aggregators.filter(({name:o})=>this.activeAggregator.get(o)===true);console.log("Available aggregators:",t.map(o=>o.name).join(", ")),console.log(`Fetching routes for ${e.coinInType} -> ${e.coinOutType}...`);let s=[],c=[],a=t.map(async o=>{this._fetchingStatus.set(o.name,true),this.events.emit("aggregatorFetchStart",{name:o.name});try{let n=await o.fetchRoute(e,A?.abortSignal);s.push(n),A?.onRouteFound?.(n);}catch(n){let i={name:o.name,reason:n};c.push(i),A?.onError?.(i);}finally{this._fetchingStatus.set(o.name,false),this.events.emit("aggregatorFetchEnd",{name:o.name});}});return await Promise.all(a),{routes:s.sort((o,n)=>bignumber_js.BigNumber(n.formattedResult.coinOut.amount).comparedTo(o.formattedResult.coinOut.amount)??0),errors:c}}async buildRouteTransaction(e,A={}){let{mergeResult:t=true,txExtensionParams:s}=A,c=this.aggregatorMap.get(e.formattedResult.name);if(!c)throw new Error(`Aggregator ${e.formattedResult.name} not found in the aggregator list`);console.log(`Using ${c.name} to build transaction... (in: ${utils.normalizeStructTag(e.formattedResult.coinIn.type)}, out: ${e.formattedResult.coinOut.type}, amountOut: ${e.formattedResult.coinOut.amount})`);let{tx:a,coinOut:o}=await c.buildSwapTransaction({route:e,slippage:A.slippage??this.slippage,txExtensionParams:s}),n=e.formattedResult.coinOut.type;return t?(await S(a,o,this.client,n,this.walletAddress),{tx:a,coinOutType:n}):{tx:a,coinOut:o,coinOutType:n}}async executeSwapTransaction(e,A=false){return this.#e(),A?this.suiKit.dryRunTxn(e):this.suiKit.signAndSendTxn(e)}};var Q=class extends f{cetusClient;constructor(e){super("cetus",e),this.cetusClient=new aggregatorSdk.AggregatorClient({...e,endpoint:e.endpoint??"https://api-sui.cetus.zone/router_v3/find_routes",signer:e.signer??this.walletAddress,client:e.client??this.client}),this.cetusClient=new aggregatorSdk.AggregatorClient({endpoint:"https://api-sui.cetus.zone/router_v3/find_routes",signer:this.walletAddress,client:this.client,env:aggregatorSdk.Env.Mainnet}),this.poolsMap=new Map(aggregatorSdk.ALL_DEXES.map(A=>[A,true]));}createRoute(e,A,t){let s=[],c=null,a=0;for(let n of e)n.from===A?(s.push({paths:[],coinIn:{type:n.from,amount:BigInt(n.amountIn)},coinOut:{type:n.target,amount:BigInt(n.amountOut)}}),c=n.target):n.from===c?s[a].paths.push({protocolName:n.provider,coinIn:{type:n.from,amount:BigInt(n.amountIn)},coinOut:{type:n.target,amount:BigInt(n.amountOut)}}):n.target===t&&(a++,c=null);let o=s.reduce((n,i)=>n+i.coinIn.amount,BigInt(0)).toString();return s.forEach(n=>{n.splitPercentage=bignumber_js.BigNumber(n.coinIn.amount.toString()).div(o).times(100).toNumber();}),s}parseRawToFormattedResult({routerData:e,coinInType:A,coinOutType:t}){return {coinIn:{type:A,amount:BigInt(e.amountIn.toString()??"0")},coinOut:{type:t,amount:BigInt(e.amountOut.toString()??"0")},routes:this.createRoute(e.paths,A,t)}}setFetchRouteSettings(e){this.fetchSettings=e;}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:s,coinOutType:c,swapAmount:a}=t,o=await this.withTimeout(this.cetusClient.findRouters({...this.fetchSettings,from:utils.normalizeStructTag(s),target:utils.normalizeStructTag(c),amount:new ___default.default(a.toString()),byAmountIn:true,providers:this.getEnabledPools()}),A);if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:{...this.parseRawToFormattedResult({routerData:o,coinInType:s,coinOutType:c}),name:this.name},rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let{txExtensionParams:A,slippage:t,route:s}=e,c=s?.rawRouteResult??this.rawRouteResult,a=null,o=null;if(A){let{initTx:i,coinIn:d}=A;a=i,o=d;}else a=new transactions.Transaction,a.setSender(this.walletAddress),o=await this.selectCoinInForSwap(a,BigInt(c.amountIn.toString()),utils.normalizeStructTag(c.paths[0].from));let n=await this.cetusClient.routerSwap({router:c,txb:a,slippage:this.calcSlippage(t),inputCoin:o});return {tx:a,coinOut:n}}};var T={faucet:{packages:{faucet:"",suiFrensGenesisWrapper:""},objects:{faucet:"",suiFrensMint:""}},staking:{packages:{events:"0x7f6ce7ade63857c4fd16ef7783fed2dfc4d7fb7e40615abdb653030b76aef0c6",lsd:"0x1575034d2729907aefca1ac757d6ccfcd3fc7e9e77927523c06007d8353ad836",afsui:"0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc"},objects:{stakedSuiVault:"0x2f8f6d5da7f13ea37daa397724280483ed062769813b6f31e9788e59cc88994d",stakedSuiVaultState:"0x55486449e41d89cfbdb20e005c1c5c1007858ad5b4d5d7c047d2b3b592fe8791",safe:"0xeb685899830dd5837b47007809c76d91a098d52aabbf61e8ac467c59e5cc4610",treasury:"0xd2b95022244757b0ab9f74e2ee2fb2c3bf29dce5590fa6993a85d64bd219d7e8",referralVault:"0x4ce9a19b594599536c53edb25d22532f82f18038dc8ef618afd00fbbfb9845ef",validatorConfigsTable:"0x8536350cfb8a8efdd133a1e087b55416d431f7e8b894f77b55b20c4b799ebad9",aftermathValidator:"0xd30018ec3f5ff1a3c75656abf927a87d7f0529e6dc89c7ddd1bd27ecb05e3db2"}},pools:{packages:{amm:"0xc4049b2d1cc0f6e017fda8260e4377cecd236bd7f56a54fee120816e72e2e0dd",ammInterface:"0x8d8bba50c626753589aa5abbc006c9fa07736f55f4e6fb57481682997c0b0d52",events:"0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c",eventsV2:"0xc4049b2d1cc0f6e017fda8260e4377cecd236bd7f56a54fee120816e72e2e0dd"},objects:{poolRegistry:"0xfcc774493db2c45c79f688f88d28023a3e7d98e4ee9f48bbf5c7990f651577ae",protocolFeeVault:"0xf194d9b1bcad972e45a7dd67dd49b3ee1e3357a00a50850c52cd51bb450e13b4",treasury:"0x28e499dff5e864a2eafe476269a4f5035f1c16f338da7be18b103499abf271ce",insuranceFund:"0xf0c40d67b078000e18032334c3325c47b9ec9f3d9ae4128be820d54663d14e3b",lpCoinsTable:"0x7f3bb65251feccacc7f48461239be1008233b85594114f7bf304e5e5b340bf59"},other:{createLpCoinPackageCompilations:{0:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEAAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[167,102,246,194,32,223,3,45,134,147,18,9,59,94,154,58,126,34,119,96,13,193,175,198,63,222,118,4,234,110,46,214]}',1:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEBAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[68,93,25,253,95,37,116,117,115,245,79,81,250,68,193,193,125,175,148,139,217,235,215,33,240,45,78,14,3,86,156,253]}',2:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgECAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[226,124,21,102,7,55,200,164,249,68,13,253,43,195,52,31,88,207,26,30,152,251,208,57,135,126,235,45,23,164,119,82]}',3:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEDAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[1,144,16,189,84,90,47,167,188,222,48,174,25,190,46,185,6,221,67,91,132,40,116,30,179,102,100,127,83,12,109,13]}',4:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEEAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[188,181,24,0,200,201,56,67,47,157,254,230,47,200,183,173,203,125,184,180,21,175,170,42,167,82,194,112,35,226,84,160]}',5:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEFAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[139,229,11,229,58,97,20,164,146,173,45,172,225,131,71,62,84,106,77,218,122,249,243,255,146,34,28,60,77,35,55,138]}',6:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEGAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[57,76,77,44,68,157,60,123,68,75,189,64,53,35,82,187,207,42,126,62,112,57,251,96,190,255,39,160,152,130,157,52]}',7:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEHAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[123,60,245,235,196,138,131,187,192,81,41,5,55,144,176,99,178,245,228,90,186,155,175,11,175,182,127,251,112,69,207,36]}',8:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEIAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[62,140,187,2,13,226,252,216,57,79,25,215,73,0,30,117,240,181,17,67,90,160,116,93,0,185,100,177,98,158,120,249]}',9:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEJAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[224,168,250,132,113,73,22,162,90,31,20,5,146,218,102,211,9,26,235,144,153,60,68,242,99,43,182,103,163,123,70,243]}',10:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEKAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[230,2,103,229,53,229,25,139,165,170,103,184,37,95,22,138,144,54,70,94,84,1,166,69,226,228,2,111,190,177,88,67]}',11:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgELAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[47,22,229,32,128,229,189,95,254,208,76,7,63,57,67,181,242,47,139,87,115,116,187,69,186,231,157,193,217,175,119,251]}',12:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEMAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[84,220,49,85,231,231,205,206,223,231,112,68,34,157,61,115,234,156,6,203,2,158,212,203,215,170,136,228,68,193,188,13]}',13:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgENAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[237,140,135,226,69,221,118,110,149,250,210,127,140,11,253,163,73,64,189,152,115,51,234,40,195,87,188,107,171,233,96,99]}',14:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEOAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[178,202,9,164,149,122,241,165,109,17,64,83,161,86,55,194,230,149,60,174,236,221,205,150,98,176,28,228,122,182,83,85]}',15:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEPAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[162,91,42,1,93,167,63,154,173,142,135,15,249,131,197,24,69,164,212,169,231,169,19,38,42,86,25,84,219,229,233,20]}',16:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEQAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[79,121,127,12,72,247,127,165,243,18,184,175,76,20,119,251,245,47,31,190,247,87,15,198,47,204,130,99,18,94,161,74]}',17:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgERAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[40,28,55,168,44,135,53,11,9,113,97,54,212,21,163,15,203,241,151,5,117,250,3,22,135,69,113,175,166,166,111,19]}',18:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgESAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[173,252,173,67,1,192,123,156,242,232,253,247,12,147,190,24,152,41,3,166,219,90,110,43,48,139,30,235,10,219,209,58]}'}}},daoFeePools:{packages:{amm:"0x5ad6890968efcf3d20899e0cec735214f1067b96e77e77d86408989998468bb2",events:"0x6f60a091637054e23915b8745c0c0d47b1d49618ee3435b5f68eccf6a44fb53d"},objects:{version:"0xb4bfb0f917f12ad2a772bea9b4f22431f6f5f9653162c3ae6fae5b99b21392b7"}},farms:{packages:{vaults:"0x7ce31301b506b4ed327523061fe95d9c347082fa60da39733f74ffad9a53f8f5",vaultsInitial:"0x4f0a1a923dd063757fd37e04a9c2cee8980008e94433c9075c390065f98e9e4b",vaultsV2:"0x2d6755e10132fc1eab5e8a4a3e7ddfdacc31884621592d95fce48ecf1e157db9",eventsV2:"0x79ee374b9e3c60c00a19fdbeaea25731bbea8f2cab9bb61bb712543e0ba55b7a"},objects:{version:"0xdc372fa9b6a538382efc560478a786fcf04e6e34850100020056c98c5c387193"}},dca:{packages:{dca:"0x409e2ace51cc5821be41a667e4cb9afa64cde49a7f940c68109db24b39ca93b8",events:"0x002134246a32eec18e68f1f5aadb8edd34856298ae6d32c145d28f3ca46c7fd1",eventsV2:"0x409e2ace51cc5821be41a667e4cb9afa64cde49a7f940c68109db24b39ca93b8"},objects:{config:"0x1b26465e9c688e3a3d2301f26e25091bc0f91708d953dc220f5697faa8ba9bd6"}},limitOrders:{packages:{limitOrders:"0xe57ee3613b7dece546f8a2d8a53145cbab41d32b86037b94f9ebfcbcfa66885a",events:"0xe57ee3613b7dece546f8a2d8a53145cbab41d32b86037b94f9ebfcbcfa66885a"}},sharedCustody:{address:"0xafe2fafac0b048c9c70a61cc1798400a85173df96b30118c40af6f3382b5a777",publicKey:"AMylYwVSuJQmTmDm6KuPlNwLnTtkk63HqOByubxxsVeC"},referralVault:{packages:{referralVault:"0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf"},objects:{referralVault:"0x35d35b0e5b177593d8c3a801462485572fc30861e6ce96a55af6dc4730709278"}},suiFrens:{packages:{suiFrens:"",suiFrensBullshark:"",accessories:"",suiFrensVault:"",suiFrensVaultCapyLabsExtension:""},objects:{capyLabsApp:"",suiFrensVault:"",suiFrensVaultStateV1:"",suiFrensVaultStateV1MetadataTable:"",suiFrensVaultCapyLabsExtension:""}},router:{packages:{utils:"0xdc15721baa82ba64822d585a7349a1508f76d94ae80e899b06e48369c257750e"}},dynamicGas:{sponsorAddress:"0xae4ba5f592e695a46d58a0579aa5d4f6ebead46be0f2d5bd229d5c292290548c"},perpetuals:{packages:{events:"0x21d001e8b07da2e3facb3e2d636bbaef43ba3c978bd84810368840b7d57c5068"},objects:{registry:"0xd0b3ea6b7a2f5887543a5a493aa70bcd0ec1a2d9c03d830504234df3e8c6a609"}},perpetualsVaults:{other:{createLpCoinPackageCompilation:'{"modules":["oRzrCwYAAAAKAQAOAg4eAywsBFgIBWBZB7kB4gEImwOAAQabBGcKggUFDIcFLAASAwcBDQIGAhMCFAIVAAICAAIBBwEAAAMADAEAAQMDDAEAAQUEAgAGBQcAAAoAAQABCwEDAAIRBgcBAAMICQoBAgQOBgEBDAQPDwEBDAUQDA0ABgwEBQACBQMIBAsFDgIIAAcIBAACCwIBCAALAwEIAAECAQoCAQgFAQkAAQsBAQkAAQgABwkAAgoCCgIKAgsBAQgFBwgEAgsDAQkACwIBCQABCwIBCAABBggEAQUBCwMBCAACCQAFDENvaW5NZXRhZGF0YQZPcHRpb24IVEVNUExBVEULVHJlYXN1cnlDYXAJVHhDb250ZXh0A1VybARjb2luCWNvbnN0YW50cw9jcmVhdGVfY3VycmVuY3kLZHVtbXlfZmllbGQEaW5pdAtscF9kZWNpbWFscxVuZXdfdW5zYWZlX2Zyb21fYnl0ZXMGb3B0aW9uFHB1YmxpY19mcmVlemVfb2JqZWN0D3B1YmxpY190cmFuc2ZlcgZzZW5kZXIEc29tZQh0ZW1wbGF0ZQh0cmFuc2Zlcgp0eF9jb250ZXh0A3VybAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAp4geY2XwRD2s2t7PYVDqpJGMi7y/Y2DrXnvMyXUc7wvCgIJCFRFTVBMQVRFCgIKCUNPSU4gTkFNRQoCERBDT0lOIERFU0NSSVBUSU9OCgI3Nmh0dHBzOi8vYWZ0ZXJtYXRoLmZpbmFuY2UvY29pbnMvcGVycGV0dWFscy9kZWZhdWx0LnN2ZwACAQkBAAAAAAIUCwARAQcABwEHAgcDEQc4AAoBOAEMAgwDCwI4AgsDCwEuEQY4AwIA"],"dependencies":["0x46234ba81f3a5ba6571383233df0f9ea5fe60a3a327537be1f5fec447bced693","0x9e20798d97c110f6b36b7b3d8543aa9246322ef2fd8d83ad79ef3325d473bc2f","0xa8172ed2a6f14cd0ee55124326685713d6f765039e7c5339f7a0b57be06fddb5","0x21d001e8b07da2e3facb3e2d636bbaef43ba3c978bd84810368840b7d57c5068","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000002"],"digest":[197,20,191,110,212,210,250,216,46,69,171,178,75,240,176,17,254,237,222,251,192,94,195,175,10,216,89,18,238,154,114,144]}'}},leveragedStaking:{packages:{leveragedAfSui:"",leveragedAfSuiInitial:""},objects:{leveragedAfSuiState:"",afSuiSuiPoolId:""}},scallop:{objects:{version:"",afSuiMarket:"",coinDecimalsRegistry:"",xOracle:""}},nftAmm:{packages:{nftAmm:""},objects:{protocolFeeVault:"",treasury:"",insuranceFund:"",referralVault:""}},nfts:{packages:{mystenTransferPolicy:"0x0cb4bcc0560340eb1a1b929cabe56b33fc6449820ec8c1980d69bb98b649b802"}}};var h=()=>(...r)=>r;var o0=h()("Aftermath","Bolt","Bluefin","BlueMove","Cetus","DeepBook","DeepBookV3","DoubleUpPump","FlowX","FlowXClmm","FullSail","HopFun","Kriya","KriyaClmm","Magma","Metastable","Momentum","MovePump","Obric","SpringSui","Steamm","SuiAi","SuiSwap","Turbos","TurbosFun","BlastFun"),P=class extends f{afClient;afApi;constructor(e){super("aftermath",e),this.afApi=new aftermathTsSdk.AftermathApi(this.client,e.addresses??T),this.afClient=new aftermathTsSdk.Aftermath("MAINNET",this.afApi),this.poolsMap=new Map(o0.map(A=>[A,true]));}get router(){return this.afClient.Router()}setFetchRouteSettings(e){this.fetchSettings=e;}parseRawRouteToFormattedResult(e){let A=e.coinIn.amount,t={...e,name:this.name};return t.routes.forEach(s=>{let c=s.paths[0].coinIn.amount;s.splitPercentage=bignumber_js.BigNumber(c.toString()).div(A.toString()).times(100).toNumber();}),t}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:s,coinOutType:c,swapAmount:a}=t,o=await this.withTimeout(this.router.getCompleteTradeRouteGivenAmountIn({...this.fetchSettings,protocolWhitelist:this.getEnabledPools(),coinInType:s,coinOutType:c,coinInAmount:a},A));if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:this.parseRawRouteToFormattedResult(o),rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let{txExtensionParams:A,slippage:t,route:s}=e,c=s?.rawRouteResult??this.rawRouteResult,a=null,o=null;if(A){let{initTx:d,coinIn:u}=A;a=d,o=u;}else a=new suiKit.Transaction,a.setSender(this.walletAddress),o=await this.selectCoinInForSwap(a,BigInt(c.coinIn.amount.toString()),suiKit.normalizeStructTag(c.coinIn.type));let{tx:n,coinOutId:i}=await this.router.addTransactionForCompleteTradeRoute({walletAddress:this.walletAddress,completeRoute:c,slippage:this.calcSlippage(t),tx:a,coinInId:o});if(!i)throw new Error(`${this.name} build swap transaction failed`);return {tx:n,coinOut:i}}};var i0=h()("aftermath","bluefin","bluemove","cetus","cetus_dlmm","deepbook_v3","ferra_clmm","ferra_dlmm","flowx","flowx_v3","fullsail","kriya","kriya_v3","magma","obric","springsui","steamm","stsui","suiswap","turbos","bluefinx","steamm_oracle_quoter","haedal_pmm","momentum","steamm_oracle_quoter_v2","sevenk_v1"),k=class extends f{commission;constructor(e){super("7k",e),this.commission=e.commission??{partner:this.walletAddress,commissionBps:0},sdkTs.setSuiClient(this.client),this.poolsMap=new Map(i0.map(A=>[A,true]));}setFetchRouteSettings(e){this.fetchSettings=e;}createRoute(e,A,t){let s=[];e.forEach((a,o)=>{s.push({paths:[],coinIn:{type:a.tokenIn,amount:BigInt(bignumber_js.BigNumber(a.tokenInAmount).multipliedBy(A).integerValue().toString())},coinOut:{type:a.tokenOut,amount:BigInt(bignumber_js.BigNumber(a.tokenOutAmount).multipliedBy(t).integerValue().toString())}}),a.hops.forEach(n=>{s[o].paths.push({protocolName:g(n.pool.type.toLowerCase()),coinIn:{type:n.tokenIn,amount:BigInt(bignumber_js.BigNumber(n.tokenInAmount).multipliedBy(A).integerValue().toString())},coinOut:{type:n.tokenOut,amount:BigInt(bignumber_js.BigNumber(n.tokenOutAmount).multipliedBy(t).integerValue().toString())}});});});let c=s.reduce((a,o)=>a+o.coinIn.amount,BigInt(0)).toString();return s.forEach(a=>{a.splitPercentage=bignumber_js.BigNumber(a.coinIn.amount.toString()).div(c).times(100).toNumber();}),s}parseRawRouteToFormattedResult(e){if(!e.routes)throw new Error(`${this.name} fetch route returned empty sorRoute`);return {routes:this.createRoute(e.routes,bignumber_js.BigNumber(e.swapAmountWithDecimal).dividedBy(e.swapAmount).toNumber(),bignumber_js.BigNumber(e.returnAmountAfterCommissionWithDecimal).dividedBy(e.returnAmount).toNumber()),coinIn:{type:e.tokenIn,amount:BigInt(e.swapAmountWithDecimal)},coinOut:{type:e.tokenOut,amount:BigInt(e.returnAmountAfterCommissionWithDecimal)},name:this.name}}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:s,coinOutType:c,swapAmount:a}=t,o=await this.withTimeout(sdkTs.getQuote({...this.fetchSettings,tokenIn:s,tokenOut:c,amountIn:a.toString(),sources:this.getEnabledPools()}),A);if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:this.parseRawRouteToFormattedResult(o),rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let{txExtensionParams:A,slippage:t,route:s}=e,c=s?.rawRouteResult??this.rawRouteResult,a=null,o=null;if(A){let{initTx:d,coinIn:u}=A;a=d,o=u;}else a=new suiKit.Transaction,a.setSender(this.walletAddress),o=await this.selectCoinInForSwap(a,BigInt(c.swapAmountWithDecimal),suiKit.normalizeStructTag(c.tokenIn));let{tx:n,coinOut:i}=await sdkTs.buildTx({quoteResponse:c,slippage:this.calcSlippage(t),commission:this.commission,accountAddress:this.walletAddress,extendTx:{tx:a,coinIn:o}});if(!i)throw new Error(`${this.name} build swap transaction failed`);return {tx:"txBytes"in n?suiKit.Transaction.from(n.txBytes):n,coinOut:i}}};var Y=class extends f{quoter=new sdk.AggregatorQuoter("mainnet");commission;constructor(e){super("flowx",e),this.commission=e.commission,this.poolsMap=new Map(Object.values(sdk.Protocol).map(A=>[A,true]));}setFetchRouteSettings(e){this.fetchSettings=e;}calcSlippage(e){return e*100}parseRawRouteToFormattedResult(e){let A=[];for(let t of e.routes)A.push({paths:t.paths.map(s=>({protocolName:g(s.protocol()?.toLowerCase()??""),coinIn:{amount:BigInt((s.amountIn??0).toString()),type:s.input.coinType},coinOut:{amount:BigInt((s.amountOut??0).toString()),type:s.output.coinType}})),splitPercentage:Number(t.amountIn??0)/Number(this.rawRouteResult?.amountIn??1)*100,coinIn:{amount:BigInt(t.amountIn.toString()),type:utils.normalizeStructTag(t.input.coinType)},coinOut:{amount:BigInt(t.amountOut.toString()),type:utils.normalizeStructTag(t.output.coinType)}});return {routes:A,coinIn:{type:utils.normalizeStructTag(e.coinIn.coinType),amount:BigInt(e.amountIn.toString())},coinOut:{type:utils.normalizeStructTag(e.coinOut.coinType),amount:BigInt(e.amountOut.toString())},name:this.name}}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:s,coinOutType:c,swapAmount:a}=t,o=await this.withTimeout(this.quoter.getRoutes({...this.fetchSettings,tokenIn:s,tokenOut:c,amountIn:a.toString(),commission:this.commission,includeSources:this.getEnabledPools()}),A);if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:this.parseRawRouteToFormattedResult(o),rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let{txExtensionParams:A,slippage:t,route:s}=e,c=s?.rawRouteResult??this.rawRouteResult,a=null,o=null;if(A){let{initTx:u,coinIn:V}=A;a=u,o=V;}else a=new transactions.Transaction,a.setSender(this.walletAddress),o=await this.selectCoinInForSwap(a,BigInt(c.amountIn.toString()),utils.normalizeStructTag(c.coinIn.coinType));let n=new sdk.TradeBuilder("mainnet",c.routes).sender(this.walletAddress).slippage(this.calcSlippage(t)).deadline(Date.now()+60*60*1e3),d=await(this.commission?n.commission(this.commission).build():n.build()).swap({client:this.client,tx:a,coinIn:o});if(!d)throw new Error(`${this.name} build swap transaction failed`);return {tx:a,coinOut:d}}};
|
|
20
20
|
|
|
21
|
-
exports.AftermathSwap =
|
|
22
|
-
exports.Aggregator =
|
|
23
|
-
exports.CetusSwap =
|
|
24
|
-
exports.CoinMetadataRegistry =
|
|
25
|
-
exports.FlowXSwap =
|
|
26
|
-
exports.SwapSdkBase =
|
|
27
|
-
exports.TypedEventEmitter =
|
|
28
|
-
exports._7kSwap =
|
|
29
|
-
exports.isSuiType =
|
|
30
|
-
exports.mergeWithExistingOrTransfer =
|
|
31
|
-
exports.selectCoins =
|
|
32
|
-
exports.transformProperCase =
|
|
21
|
+
exports.AftermathSwap = P;
|
|
22
|
+
exports.Aggregator = F;
|
|
23
|
+
exports.CetusSwap = Q;
|
|
24
|
+
exports.CoinMetadataRegistry = p;
|
|
25
|
+
exports.FlowXSwap = Y;
|
|
26
|
+
exports.SwapSdkBase = f;
|
|
27
|
+
exports.TypedEventEmitter = b;
|
|
28
|
+
exports._7kSwap = k;
|
|
29
|
+
exports.isSuiType = B;
|
|
30
|
+
exports.mergeWithExistingOrTransfer = S;
|
|
31
|
+
exports.selectCoins = E;
|
|
32
|
+
exports.transformProperCase = g;
|
package/dist/index.mjs
CHANGED
|
@@ -5,11 +5,11 @@ import { BigNumber } from 'bignumber.js';
|
|
|
5
5
|
import { EventEmitter } from 'events';
|
|
6
6
|
import { Transaction } from '@mysten/sui/transactions';
|
|
7
7
|
import { AggregatorClient, Env, ALL_DEXES } from '@cetusprotocol/aggregator-sdk';
|
|
8
|
-
import
|
|
8
|
+
import _ from 'bn.js';
|
|
9
9
|
import { AftermathApi, Aftermath } from 'aftermath-ts-sdk';
|
|
10
10
|
import { setSuiClient, getQuote, buildTx } from '@7kprotocol/sdk-ts';
|
|
11
11
|
import { AggregatorQuoter, Protocol, TradeBuilder } from '@flowx-finance/sdk';
|
|
12
12
|
|
|
13
|
-
var X=normalizeStructTag(SUI_TYPE_ARG),h=r=>normalizeStructTag(r)===X,R=async(r,e,A,t)=>{let a=[],c=BigNumber(A);try{let s=null;do{let{data:o,hasNextPage:n,nextCursor:i}=await r.getCoins({coinType:e,owner:t,limit:50});if(a.push(...o),c=c.minus(o.reduce((k,Y)=>k.plus(BigNumber(Y.balance)),BigNumber(0))),c.lte(0)||(s=i,!n))break}while(s)}catch(s){console.error(s);}if(a.length===0)throw new Error(`No available coin for type ${e} found in wallet ${t}`);if(c.gt(0))throw new Error(`Insufficient balance for coin type ${e} in wallet ${t}`);return a},C=async(r,e,A,t,a)=>{try{if(h(t))r.mergeCoins(r.gas,[e]);else {let{data:c}=await A.getCoins({coinType:t,owner:a,limit:1});if(!c.length)throw new Error(`No existing ${t} coin found to merge with`);let s=r.objectRef({objectId:c[0].coinObjectId,version:c[0].version,digest:c[0].digest});c.length===1?r.mergeCoins(s,[e]):r.mergeCoins(s,[e,...c.slice(1).map(o=>r.objectRef({objectId:o.coinObjectId,version:o.version,digest:o.digest}))]);}}catch(c){console.warn(c.message),r.transferObjects([e],r.pure.address(a));}},Z=r=>r[0].toUpperCase()+r.slice(1),b=r=>r.split("_").map(Z).join(" ");var u=class extends EventEmitter{on(e,A){return super.on(e,A)}once(e,A){return super.once(e,A)}off(e,A){return super.off(e,A)}emit(e,A){return super.emit(e,A)}};var d=class{rawRouteResult;name="";events=new u;client;fetchTimeoutInMs;walletAddress;fetchSettings;poolsMap=new Map;constructor(e,A){this.client=A.client??new SuiClient({url:getFullnodeUrl("mainnet")}),this.fetchTimeoutInMs=A.fetchTimeoutInMs??4e3,this.walletAddress=A.walletAddress,this.name=e.toLowerCase(),A.fetchSettings&&this.setFetchRouteSettings(A.fetchSettings);}get pools(){return Array.from(this.poolsMap.keys())}validateWalletAddress(){if(!this.walletAddress||this.walletAddress.length===0)throw new Error("Wallet address is not set")}validateRawRouteResult(){if(!this.rawRouteResult)throw new Error("Raw route result is not set. Please fetch route first.")}setWalletAddress(e){this.walletAddress=e;}setSuiClient(e){this.client=e;}calcSlippage(e){return e/1e4}togglePoolStatus(e,A){let t=A??!(this.poolsMap.get(e)??true);this.poolsMap.set(e,t),this.events.emit("poolStatusChanged",{name:this.name,pool:e,enabled:t});}toggleAllPoolStatus(e){this.pools.forEach(A=>{this.poolsMap.set(A,e);}),this.events.emit("allPoolStatusChanged",{name:this.name,enabled:e});}getEnabledPools(){return Array.from(this.poolsMap.entries()).filter(([e,A])=>A).map(([e,A])=>e)}normalizeFetchRouteParams(e){return {...e,coinInType:normalizeStructTag$1(e.coinInType),coinOutType:normalizeStructTag$1(e.coinOutType)}}async withTimeout(e,A){let t=[e,new Promise((c,s)=>{setTimeout(()=>{s(new Error(`${this.name} fetch route timeout`));},this.fetchTimeoutInMs);})];return A&&t.push(new Promise((c,s)=>{if(A.aborted){s(A.reason??new Error(`${this.name} fetch route aborted`));return}A.addEventListener("abort",()=>s(A.reason??new Error(`${this.name} fetch route aborted`)),{once:true});})),await Promise.race(t)}async selectCoinInForSwap(e,A,t){let a=BigNumber(A.toString());if(h(t)){let[c]=e.splitCoins(e.gas,[a.toString()]);return c}else {let c=await this.selectCoins(t,a.toString()),s=c.reduce((n,i)=>n.plus(BigNumber(i.balance)),BigNumber(0)),o=e.objectRef({objectId:c[0].coinObjectId,version:c[0].version,digest:c[0].digest});if(c.length>1&&e.mergeCoins(o,c.slice(1).map(n=>e.objectRef({objectId:n.coinObjectId,version:n.version,digest:n.digest}))),s.gt(a)){let[n]=e.splitCoins(o,[a.toString()]);return n}else return o}}async selectCoins(e,A){return this.validateWalletAddress(),await R(this.client,e,A,this.walletAddress)}};var m=class{constructor(e,A){this.client=e;A&&A.forEach(t=>this.cache.set(t.coinType,t));}cache=new Map;setClient(e){this.client=e;}async getCoinMetadata(e){let A=normalizeStructTag(e);if(this.cache.has(A))return this.cache.get(A);let t=await this.client.getCoinMetadata({coinType:A});if(!t)throw new Error(`Coin metadata not found for coin type: ${A}`);return this.cache.set(A,t),t}};var S=class{coinMetadata;suiKit;events=new u;_slippage=30;signerMode=false;aggregatorMap=new Map;activeAggregator=new Map;_fetchingStatus=new Map;poolStatusForwarders=new Map;walletAddress;client;constructor(e){if(this.client=e.client??new SuiClient({url:e.fullnodeUrl||"https://fullnode.mainnet.sui.io:443"}),this.coinMetadata=new m(this.client),this.signerMode=!!(e.secretKey||e.mnemonics),e.secretKey||e.mnemonics)this.suiKit=new SuiKit({...e,suiClients:[this.client]}),this.walletAddress=this.suiKit.currentAddress;else if(e.walletAddress!==void 0)this.walletAddress=e.walletAddress;else throw new Error("One of secretKey, mnemonics or walletAddress must be provided")}forwardPoolStatusChangeEvent(e){this.events.emit("poolStatusChanged",e);}addAggregator(e){for(let A of e)if(!this.aggregatorMap.has(A.name)){this.aggregatorMap.set(A.name,A),this.activeAggregator.set(A.name,true),this._fetchingStatus.set(A.name,false);let t=a=>this.forwardPoolStatusChangeEvent(a);this.poolStatusForwarders.set(A.name,t),A.events.on("poolStatusChanged",t),this.events.emit("aggregatorAdded",{name:A.name});}}getActiveAggregators(){return Array.from(this.activeAggregator.entries()).filter(([e,A])=>A).map(([e,A])=>e)}getAggregator(e){return this.aggregatorMap.get(e)}toggleAggregator(e,A){if(!this.activeAggregator.has(e))throw new Error(`Aggregator ${e} not found`);this.activeAggregator.set(e,A),this.events.emit("aggregatorStatusChanged",{name:e,enabled:A});}removeAggregator(e){let A=this.aggregatorMap.get(e);if(!A)throw new Error(`Aggregator ${e} not found`);let t=this.poolStatusForwarders.get(e);t&&A.events.off("poolStatusChanged",t),this.poolStatusForwarders.delete(e),this.aggregatorMap.delete(e),this.activeAggregator.delete(e),this._fetchingStatus.delete(e),this.events.emit("aggregatorRemoved",{name:e});}get aggregators(){return Array.from(this.aggregatorMap.values())}get fetchingStatus(){return Object.fromEntries(this._fetchingStatus)}get slippage(){return this._slippage}setSlippage(e){this._slippage=e,this.events.emit("aggregatorSlippageChanged",{slippageInBps:e});}setFetchTimeoutInMs(e){this.aggregators.forEach(A=>{A.fetchTimeoutInMs=e;});}#e(){if(!this.suiKit)throw new Error("SuiKit is not initialized.")}setSuiClient(e){this.aggregators.forEach(A=>{A.setSuiClient(e);}),this.coinMetadata.setClient(e),this.client=e;}setWalletAddress(e){if(this.signerMode)throw new Error("Cannot change wallet address when SuiKit is initialized with secretKey or mnemonics.");if(!isValidSuiAddress(e))throw new Error("Invalid Sui wallet address");this.walletAddress=e,this.aggregators.forEach(A=>{A.setWalletAddress(e);});}async getCoinMetadata(e){return this.coinMetadata.getCoinMetadata(e)}async fetchRoutes(e,A){let t=this.aggregators.filter(({name:o})=>this.activeAggregator.get(o)===true);console.log("Available aggregators:",t.map(o=>o.name).join(", ")),console.log(`Fetching routes for ${e.coinInType} -> ${e.coinOutType}...`);let a=[],c=[],s=t.map(async o=>{this._fetchingStatus.set(o.name,true),this.events.emit("aggregatorFetchStart",{name:o.name});try{let n=await o.fetchRoute(e,A?.abortSignal);a.push(n),A?.onRouteFound?.(n);}catch(n){let i={name:o.name,reason:n};c.push(i),A?.onError?.(i);}finally{this._fetchingStatus.set(o.name,false),this.events.emit("aggregatorFetchEnd",{name:o.name});}});return await Promise.all(s),{routes:a.sort((o,n)=>BigNumber(n.formattedResult.coinOut.amount).comparedTo(o.formattedResult.coinOut.amount)??0),errors:c}}async buildRouteTransaction(e,A={}){let{mergeResult:t=true,txExtensionParams:a}=A,c=this.aggregatorMap.get(e.formattedResult.name);if(!c)throw new Error(`Aggregator ${e.formattedResult.name} not found in the aggregator list`);console.log(`Using ${c.name} to build transaction... (in: ${normalizeStructTag(e.formattedResult.coinIn.type)}, out: ${e.formattedResult.coinOut.type}, amountOut: ${e.formattedResult.coinOut.amount})`);let{tx:s,coinOut:o}=await c.buildSwapTransaction({slippage:this.slippage,txExtensionParams:a}),n=e.formattedResult.coinOut.type;return t?(await C(s,o,this.client,n,this.walletAddress),{tx:s,coinOutType:n}):{tx:s,coinOut:o,coinOutType:n}}async executeSwapTransaction(e,A=false){return this.#e(),A?this.suiKit.dryRunTxn(e):this.suiKit.signAndSendTxn(e)}};var F=class extends d{cetusClient;constructor(e){super("cetus",e),this.cetusClient=new AggregatorClient({...e,endpoint:e.endpoint??"https://api-sui.cetus.zone/router_v3/find_routes",signer:e.signer??this.walletAddress,client:e.client??this.client}),this.cetusClient=new AggregatorClient({endpoint:"https://api-sui.cetus.zone/router_v3/find_routes",signer:this.walletAddress,client:this.client,env:Env.Mainnet}),this.poolsMap=new Map(ALL_DEXES.map(A=>[A,true]));}createRoute(e,A,t){let a=[],c=null,s=0;for(let n of e)n.from===A?(a.push({paths:[],coinIn:{type:n.from,amount:BigInt(n.amountIn)},coinOut:{type:n.target,amount:BigInt(n.amountOut)}}),c=n.target):n.from===c?a[s].paths.push({protocolName:n.provider,coinIn:{type:n.from,amount:BigInt(n.amountIn)},coinOut:{type:n.target,amount:BigInt(n.amountOut)}}):n.target===t&&(s++,c=null);let o=a.reduce((n,i)=>n+i.coinIn.amount,BigInt(0)).toString();return a.forEach(n=>{n.splitPercentage=BigNumber(n.coinIn.amount.toString()).div(o).times(100).toNumber();}),a}parseRawToFormattedResult({routerData:e,coinInType:A,coinOutType:t}){return {coinIn:{type:A,amount:BigInt(e.amountIn.toString()??"0")},coinOut:{type:t,amount:BigInt(e.amountOut.toString()??"0")},routes:this.createRoute(e.paths,A,t)}}setFetchRouteSettings(e){this.fetchSettings=e;}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:a,coinOutType:c,swapAmount:s}=t,o=await this.withTimeout(this.cetusClient.findRouters({...this.fetchSettings,from:normalizeStructTag(a),target:normalizeStructTag(c),amount:new G(s.toString()),byAmountIn:true,providers:this.getEnabledPools()}),A);if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:{...this.parseRawToFormattedResult({routerData:o,coinInType:a,coinOutType:c}),name:this.name},rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let A=null,t=null;if(e.txExtensionParams){let{initTx:c,coinIn:s}=e.txExtensionParams;A=c,t=s;}else A=new Transaction,A.setSender(this.walletAddress),t=await this.selectCoinInForSwap(A,BigInt(this.rawRouteResult.amountIn.toString()),normalizeStructTag(this.rawRouteResult.paths[0].from));let a=await this.cetusClient.routerSwap({router:this.rawRouteResult,txb:A,slippage:this.calcSlippage(e.slippage),inputCoin:t});return {tx:A,coinOut:a}}};var y={faucet:{packages:{faucet:"",suiFrensGenesisWrapper:""},objects:{faucet:"",suiFrensMint:""}},staking:{packages:{events:"0x7f6ce7ade63857c4fd16ef7783fed2dfc4d7fb7e40615abdb653030b76aef0c6",lsd:"0x1575034d2729907aefca1ac757d6ccfcd3fc7e9e77927523c06007d8353ad836",afsui:"0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc"},objects:{stakedSuiVault:"0x2f8f6d5da7f13ea37daa397724280483ed062769813b6f31e9788e59cc88994d",stakedSuiVaultState:"0x55486449e41d89cfbdb20e005c1c5c1007858ad5b4d5d7c047d2b3b592fe8791",safe:"0xeb685899830dd5837b47007809c76d91a098d52aabbf61e8ac467c59e5cc4610",treasury:"0xd2b95022244757b0ab9f74e2ee2fb2c3bf29dce5590fa6993a85d64bd219d7e8",referralVault:"0x4ce9a19b594599536c53edb25d22532f82f18038dc8ef618afd00fbbfb9845ef",validatorConfigsTable:"0x8536350cfb8a8efdd133a1e087b55416d431f7e8b894f77b55b20c4b799ebad9",aftermathValidator:"0xd30018ec3f5ff1a3c75656abf927a87d7f0529e6dc89c7ddd1bd27ecb05e3db2"}},pools:{packages:{amm:"0xc4049b2d1cc0f6e017fda8260e4377cecd236bd7f56a54fee120816e72e2e0dd",ammInterface:"0x8d8bba50c626753589aa5abbc006c9fa07736f55f4e6fb57481682997c0b0d52",events:"0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c",eventsV2:"0xc4049b2d1cc0f6e017fda8260e4377cecd236bd7f56a54fee120816e72e2e0dd"},objects:{poolRegistry:"0xfcc774493db2c45c79f688f88d28023a3e7d98e4ee9f48bbf5c7990f651577ae",protocolFeeVault:"0xf194d9b1bcad972e45a7dd67dd49b3ee1e3357a00a50850c52cd51bb450e13b4",treasury:"0x28e499dff5e864a2eafe476269a4f5035f1c16f338da7be18b103499abf271ce",insuranceFund:"0xf0c40d67b078000e18032334c3325c47b9ec9f3d9ae4128be820d54663d14e3b",lpCoinsTable:"0x7f3bb65251feccacc7f48461239be1008233b85594114f7bf304e5e5b340bf59"},other:{createLpCoinPackageCompilations:{0:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEAAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[167,102,246,194,32,223,3,45,134,147,18,9,59,94,154,58,126,34,119,96,13,193,175,198,63,222,118,4,234,110,46,214]}',1:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEBAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[68,93,25,253,95,37,116,117,115,245,79,81,250,68,193,193,125,175,148,139,217,235,215,33,240,45,78,14,3,86,156,253]}',2:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgECAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[226,124,21,102,7,55,200,164,249,68,13,253,43,195,52,31,88,207,26,30,152,251,208,57,135,126,235,45,23,164,119,82]}',3:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEDAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[1,144,16,189,84,90,47,167,188,222,48,174,25,190,46,185,6,221,67,91,132,40,116,30,179,102,100,127,83,12,109,13]}',4:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEEAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[188,181,24,0,200,201,56,67,47,157,254,230,47,200,183,173,203,125,184,180,21,175,170,42,167,82,194,112,35,226,84,160]}',5:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEFAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[139,229,11,229,58,97,20,164,146,173,45,172,225,131,71,62,84,106,77,218,122,249,243,255,146,34,28,60,77,35,55,138]}',6:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEGAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[57,76,77,44,68,157,60,123,68,75,189,64,53,35,82,187,207,42,126,62,112,57,251,96,190,255,39,160,152,130,157,52]}',7:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEHAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[123,60,245,235,196,138,131,187,192,81,41,5,55,144,176,99,178,245,228,90,186,155,175,11,175,182,127,251,112,69,207,36]}',8:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEIAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[62,140,187,2,13,226,252,216,57,79,25,215,73,0,30,117,240,181,17,67,90,160,116,93,0,185,100,177,98,158,120,249]}',9:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEJAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[224,168,250,132,113,73,22,162,90,31,20,5,146,218,102,211,9,26,235,144,153,60,68,242,99,43,182,103,163,123,70,243]}',10:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEKAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[230,2,103,229,53,229,25,139,165,170,103,184,37,95,22,138,144,54,70,94,84,1,166,69,226,228,2,111,190,177,88,67]}',11:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgELAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[47,22,229,32,128,229,189,95,254,208,76,7,63,57,67,181,242,47,139,87,115,116,187,69,186,231,157,193,217,175,119,251]}',12:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEMAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[84,220,49,85,231,231,205,206,223,231,112,68,34,157,61,115,234,156,6,203,2,158,212,203,215,170,136,228,68,193,188,13]}',13:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgENAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[237,140,135,226,69,221,118,110,149,250,210,127,140,11,253,163,73,64,189,152,115,51,234,40,195,87,188,107,171,233,96,99]}',14:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEOAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[178,202,9,164,149,122,241,165,109,17,64,83,161,86,55,194,230,149,60,174,236,221,205,150,98,176,28,228,122,182,83,85]}',15:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEPAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[162,91,42,1,93,167,63,154,173,142,135,15,249,131,197,24,69,164,212,169,231,169,19,38,42,86,25,84,219,229,233,20]}',16:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEQAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[79,121,127,12,72,247,127,165,243,18,184,175,76,20,119,251,245,47,31,190,247,87,15,198,47,204,130,99,18,94,161,74]}',17:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgERAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[40,28,55,168,44,135,53,11,9,113,97,54,212,21,163,15,203,241,151,5,117,250,3,22,135,69,113,175,166,166,111,19]}',18:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgESAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[173,252,173,67,1,192,123,156,242,232,253,247,12,147,190,24,152,41,3,166,219,90,110,43,48,139,30,235,10,219,209,58]}'}}},daoFeePools:{packages:{amm:"0x5ad6890968efcf3d20899e0cec735214f1067b96e77e77d86408989998468bb2",events:"0x6f60a091637054e23915b8745c0c0d47b1d49618ee3435b5f68eccf6a44fb53d"},objects:{version:"0xb4bfb0f917f12ad2a772bea9b4f22431f6f5f9653162c3ae6fae5b99b21392b7"}},farms:{packages:{vaults:"0x7ce31301b506b4ed327523061fe95d9c347082fa60da39733f74ffad9a53f8f5",vaultsInitial:"0x4f0a1a923dd063757fd37e04a9c2cee8980008e94433c9075c390065f98e9e4b",vaultsV2:"0x2d6755e10132fc1eab5e8a4a3e7ddfdacc31884621592d95fce48ecf1e157db9",eventsV2:"0x79ee374b9e3c60c00a19fdbeaea25731bbea8f2cab9bb61bb712543e0ba55b7a"},objects:{version:"0xdc372fa9b6a538382efc560478a786fcf04e6e34850100020056c98c5c387193"}},dca:{packages:{dca:"0x409e2ace51cc5821be41a667e4cb9afa64cde49a7f940c68109db24b39ca93b8",events:"0x002134246a32eec18e68f1f5aadb8edd34856298ae6d32c145d28f3ca46c7fd1",eventsV2:"0x409e2ace51cc5821be41a667e4cb9afa64cde49a7f940c68109db24b39ca93b8"},objects:{config:"0x1b26465e9c688e3a3d2301f26e25091bc0f91708d953dc220f5697faa8ba9bd6"}},limitOrders:{packages:{limitOrders:"0xe57ee3613b7dece546f8a2d8a53145cbab41d32b86037b94f9ebfcbcfa66885a",events:"0xe57ee3613b7dece546f8a2d8a53145cbab41d32b86037b94f9ebfcbcfa66885a"}},sharedCustody:{address:"0xafe2fafac0b048c9c70a61cc1798400a85173df96b30118c40af6f3382b5a777",publicKey:"AMylYwVSuJQmTmDm6KuPlNwLnTtkk63HqOByubxxsVeC"},referralVault:{packages:{referralVault:"0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf"},objects:{referralVault:"0x35d35b0e5b177593d8c3a801462485572fc30861e6ce96a55af6dc4730709278"}},suiFrens:{packages:{suiFrens:"",suiFrensBullshark:"",accessories:"",suiFrensVault:"",suiFrensVaultCapyLabsExtension:""},objects:{capyLabsApp:"",suiFrensVault:"",suiFrensVaultStateV1:"",suiFrensVaultStateV1MetadataTable:"",suiFrensVaultCapyLabsExtension:""}},router:{packages:{utils:"0xdc15721baa82ba64822d585a7349a1508f76d94ae80e899b06e48369c257750e"}},dynamicGas:{sponsorAddress:"0xae4ba5f592e695a46d58a0579aa5d4f6ebead46be0f2d5bd229d5c292290548c"},perpetuals:{packages:{events:"0x21d001e8b07da2e3facb3e2d636bbaef43ba3c978bd84810368840b7d57c5068"},objects:{registry:"0xd0b3ea6b7a2f5887543a5a493aa70bcd0ec1a2d9c03d830504234df3e8c6a609"}},perpetualsVaults:{other:{createLpCoinPackageCompilation:'{"modules":["oRzrCwYAAAAKAQAOAg4eAywsBFgIBWBZB7kB4gEImwOAAQabBGcKggUFDIcFLAASAwcBDQIGAhMCFAIVAAICAAIBBwEAAAMADAEAAQMDDAEAAQUEAgAGBQcAAAoAAQABCwEDAAIRBgcBAAMICQoBAgQOBgEBDAQPDwEBDAUQDA0ABgwEBQACBQMIBAsFDgIIAAcIBAACCwIBCAALAwEIAAECAQoCAQgFAQkAAQsBAQkAAQgABwkAAgoCCgIKAgsBAQgFBwgEAgsDAQkACwIBCQABCwIBCAABBggEAQUBCwMBCAACCQAFDENvaW5NZXRhZGF0YQZPcHRpb24IVEVNUExBVEULVHJlYXN1cnlDYXAJVHhDb250ZXh0A1VybARjb2luCWNvbnN0YW50cw9jcmVhdGVfY3VycmVuY3kLZHVtbXlfZmllbGQEaW5pdAtscF9kZWNpbWFscxVuZXdfdW5zYWZlX2Zyb21fYnl0ZXMGb3B0aW9uFHB1YmxpY19mcmVlemVfb2JqZWN0D3B1YmxpY190cmFuc2ZlcgZzZW5kZXIEc29tZQh0ZW1wbGF0ZQh0cmFuc2Zlcgp0eF9jb250ZXh0A3VybAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAp4geY2XwRD2s2t7PYVDqpJGMi7y/Y2DrXnvMyXUc7wvCgIJCFRFTVBMQVRFCgIKCUNPSU4gTkFNRQoCERBDT0lOIERFU0NSSVBUSU9OCgI3Nmh0dHBzOi8vYWZ0ZXJtYXRoLmZpbmFuY2UvY29pbnMvcGVycGV0dWFscy9kZWZhdWx0LnN2ZwACAQkBAAAAAAIUCwARAQcABwEHAgcDEQc4AAoBOAEMAgwDCwI4AgsDCwEuEQY4AwIA"],"dependencies":["0x46234ba81f3a5ba6571383233df0f9ea5fe60a3a327537be1f5fec447bced693","0x9e20798d97c110f6b36b7b3d8543aa9246322ef2fd8d83ad79ef3325d473bc2f","0xa8172ed2a6f14cd0ee55124326685713d6f765039e7c5339f7a0b57be06fddb5","0x21d001e8b07da2e3facb3e2d636bbaef43ba3c978bd84810368840b7d57c5068","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000002"],"digest":[197,20,191,110,212,210,250,216,46,69,171,178,75,240,176,17,254,237,222,251,192,94,195,175,10,216,89,18,238,154,114,144]}'}},leveragedStaking:{packages:{leveragedAfSui:"",leveragedAfSuiInitial:""},objects:{leveragedAfSuiState:"",afSuiSuiPoolId:""}},scallop:{objects:{version:"",afSuiMarket:"",coinDecimalsRegistry:"",xOracle:""}},nftAmm:{packages:{nftAmm:""},objects:{protocolFeeVault:"",treasury:"",insuranceFund:"",referralVault:""}},nfts:{packages:{mystenTransferPolicy:"0x0cb4bcc0560340eb1a1b929cabe56b33fc6449820ec8c1980d69bb98b649b802"}}};var g=()=>(...r)=>r;var a0=g()("Aftermath","Bolt","Bluefin","BlueMove","Cetus","DeepBook","DeepBookV3","DoubleUpPump","FlowX","FlowXClmm","FullSail","HopFun","Kriya","KriyaClmm","Magma","Metastable","Momentum","MovePump","Obric","SpringSui","Steamm","SuiAi","SuiSwap","Turbos","TurbosFun","BlastFun"),Q=class extends d{afClient;afApi;constructor(e){super("aftermath",e),this.afApi=new AftermathApi(this.client,e.addresses??y),this.afClient=new Aftermath("MAINNET",this.afApi),this.poolsMap=new Map(a0.map(A=>[A,true]));}get router(){return this.afClient.Router()}setFetchRouteSettings(e){this.fetchSettings=e;}parseRawRouteToFormattedResult(e){let A=e.coinIn.amount,t={...e,name:this.name};return t.routes.forEach(a=>{let c=a.paths[0].coinIn.amount;a.splitPercentage=BigNumber(c.toString()).div(A.toString()).times(100).toNumber();}),t}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:a,coinOutType:c,swapAmount:s}=t,o=await this.withTimeout(this.router.getCompleteTradeRouteGivenAmountIn({...this.fetchSettings,protocolWhitelist:this.getEnabledPools(),coinInType:a,coinOutType:c,coinInAmount:s},A));if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:this.parseRawRouteToFormattedResult(o),rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let A=null,t=null;if(e.txExtensionParams){let{initTx:s,coinIn:o}=e.txExtensionParams;A=s,t=o;}else A=new Transaction$1,A.setSender(this.walletAddress),t=await this.selectCoinInForSwap(A,this.rawRouteResult.coinIn.amount,normalizeStructTag$1(this.rawRouteResult.coinIn.type));let{tx:a,coinOutId:c}=await this.router.addTransactionForCompleteTradeRoute({walletAddress:this.walletAddress,completeRoute:this.rawRouteResult,slippage:this.calcSlippage(e.slippage),tx:A,coinInId:t});if(!c)throw new Error(`${this.name} build swap transaction failed`);return {tx:a,coinOut:c}}};var r0=g()("aftermath","bluefin","bluemove","cetus","cetus_dlmm","deepbook_v3","ferra_clmm","ferra_dlmm","flowx","flowx_v3","fullsail","kriya","kriya_v3","magma","obric","springsui","steamm","stsui","suiswap","turbos","bluefinx","steamm_oracle_quoter","haedal_pmm","momentum","steamm_oracle_quoter_v2","sevenk_v1"),P=class extends d{commission;constructor(e){super("7k",e),this.commission=e.commission??{partner:this.walletAddress,commissionBps:0},setSuiClient(this.client),this.poolsMap=new Map(r0.map(A=>[A,true]));}setFetchRouteSettings(e){this.fetchSettings=e;}createRoute(e,A,t){let a=[];e.forEach((s,o)=>{a.push({paths:[],coinIn:{type:s.tokenIn,amount:BigInt(BigNumber(s.tokenInAmount).multipliedBy(A).integerValue().toString())},coinOut:{type:s.tokenOut,amount:BigInt(BigNumber(s.tokenOutAmount).multipliedBy(t).integerValue().toString())}}),s.hops.forEach(n=>{a[o].paths.push({protocolName:b(n.pool.type.toLowerCase()),coinIn:{type:n.tokenIn,amount:BigInt(BigNumber(n.tokenInAmount).multipliedBy(A).integerValue().toString())},coinOut:{type:n.tokenOut,amount:BigInt(BigNumber(n.tokenOutAmount).multipliedBy(t).integerValue().toString())}});});});let c=a.reduce((s,o)=>s+o.coinIn.amount,BigInt(0)).toString();return a.forEach(s=>{s.splitPercentage=BigNumber(s.coinIn.amount.toString()).div(c).times(100).toNumber();}),a}parseRawRouteToFormattedResult(e){if(!e.routes)throw new Error(`${this.name} fetch route returned empty sorRoute`);return {routes:this.createRoute(e.routes,BigNumber(e.swapAmountWithDecimal).dividedBy(e.swapAmount).toNumber(),BigNumber(e.returnAmountAfterCommissionWithDecimal).dividedBy(e.returnAmount).toNumber()),coinIn:{type:e.tokenIn,amount:BigInt(e.swapAmountWithDecimal)},coinOut:{type:e.tokenOut,amount:BigInt(e.returnAmountAfterCommissionWithDecimal)},name:this.name}}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:a,coinOutType:c,swapAmount:s}=t,o=await this.withTimeout(getQuote({...this.fetchSettings,tokenIn:a,tokenOut:c,amountIn:s.toString(),sources:this.getEnabledPools()}),A);if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:this.parseRawRouteToFormattedResult(o),rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let A=null,t=null;if(e.txExtensionParams){let{initTx:s,coinIn:o}=e.txExtensionParams;A=s,t=o;}else A=new Transaction$1,A.setSender(this.walletAddress),t=await this.selectCoinInForSwap(A,BigInt(this.rawRouteResult.swapAmountWithDecimal),normalizeStructTag$1(this.rawRouteResult.tokenIn));let{tx:a,coinOut:c}=await buildTx({quoteResponse:this.rawRouteResult,slippage:this.calcSlippage(e.slippage),commission:this.commission,accountAddress:this.walletAddress,extendTx:{tx:A,coinIn:t}});if(!c)throw new Error(`${this.name} build swap transaction failed`);return {tx:"txBytes"in a?Transaction$1.from(a.txBytes):a,coinOut:c}}};var v=class extends d{quoter=new AggregatorQuoter("mainnet");commission;constructor(e){super("flowx",e),this.commission=e.commission,this.poolsMap=new Map(Object.values(Protocol).map(A=>[A,true]));}setFetchRouteSettings(e){this.fetchSettings=e;}calcSlippage(e){return e*100}parseRawRouteToFormattedResult(e){let A=[];for(let t of e.routes)A.push({paths:t.paths.map(a=>({protocolName:b(a.protocol()?.toLowerCase()??""),coinIn:{amount:BigInt((a.amountIn??0).toString()),type:a.input.coinType},coinOut:{amount:BigInt((a.amountOut??0).toString()),type:a.output.coinType}})),splitPercentage:Number(t.amountIn??0)/Number(this.rawRouteResult?.amountIn??1)*100,coinIn:{amount:BigInt(t.amountIn.toString()),type:normalizeStructTag(t.input.coinType)},coinOut:{amount:BigInt(t.amountOut.toString()),type:normalizeStructTag(t.output.coinType)}});return {routes:A,coinIn:{type:normalizeStructTag(e.coinIn.coinType),amount:BigInt(e.amountIn.toString())},coinOut:{type:normalizeStructTag(e.coinOut.coinType),amount:BigInt(e.amountOut.toString())},name:this.name}}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:a,coinOutType:c,swapAmount:s}=t,o=await this.withTimeout(this.quoter.getRoutes({...this.fetchSettings,tokenIn:a,tokenOut:c,amountIn:s.toString(),commission:this.commission,includeSources:this.getEnabledPools()}),A);if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:this.parseRawRouteToFormattedResult(o),rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let A=null,t=null;if(e.txExtensionParams){let{initTx:o,coinIn:n}=e.txExtensionParams;A=o,t=n;}else A=new Transaction,A.setSender(this.walletAddress),t=await this.selectCoinInForSwap(A,BigInt(this.rawRouteResult.amountIn.toString()),normalizeStructTag(this.rawRouteResult.coinIn.coinType));let a=new TradeBuilder("mainnet",this.rawRouteResult.routes).sender(this.walletAddress).slippage(this.calcSlippage(e.slippage)).deadline(Date.now()+60*60*1e3),s=await(this.commission?a.commission(this.commission).build():a.build()).swap({client:this.client,tx:A,coinIn:t});if(!s)throw new Error(`${this.name} build swap transaction failed`);return {tx:A,coinOut:s}}};
|
|
13
|
+
var Z=normalizeStructTag(SUI_TYPE_ARG),B=r=>normalizeStructTag(r)===Z,E=async(r,e,A,t)=>{let s=[],c=BigNumber(A);try{let a=null;do{let{data:o,hasNextPage:n,nextCursor:i}=await r.getCoins({coinType:e,owner:t,limit:50});if(s.push(...o),c=c.minus(o.reduce((d,u)=>d.plus(BigNumber(u.balance)),BigNumber(0))),c.lte(0)||(a=i,!n))break}while(a)}catch(a){console.error(a);}if(s.length===0)throw new Error(`No available coin for type ${e} found in wallet ${t}`);if(c.gt(0))throw new Error(`Insufficient balance for coin type ${e} in wallet ${t}`);return s},S=async(r,e,A,t,s)=>{try{if(B(t))r.mergeCoins(r.gas,[e]);else {let{data:c}=await A.getCoins({coinType:t,owner:s,limit:1});if(!c.length)throw new Error(`No existing ${t} coin found to merge with`);let a=r.objectRef({objectId:c[0].coinObjectId,version:c[0].version,digest:c[0].digest});c.length===1?r.mergeCoins(a,[e]):r.mergeCoins(a,[e,...c.slice(1).map(o=>r.objectRef({objectId:o.coinObjectId,version:o.version,digest:o.digest}))]);}}catch(c){console.warn(c.message),r.transferObjects([e],r.pure.address(s));}},U=r=>r[0].toUpperCase()+r.slice(1),g=r=>r.split("_").map(U).join(" ");var b=class extends EventEmitter{on(e,A){return super.on(e,A)}once(e,A){return super.once(e,A)}off(e,A){return super.off(e,A)}emit(e,A){return super.emit(e,A)}};var f=class{BASIS_POINT_DIVISOR=1e4;rawRouteResult;name="";events=new b;client;fetchTimeoutInMs;walletAddress;fetchSettings;poolsMap=new Map;constructor(e,A){this.client=A.client??new SuiClient({url:getFullnodeUrl("mainnet")}),this.fetchTimeoutInMs=A.fetchTimeoutInMs??4e3,this.walletAddress=A.walletAddress,this.name=e.toLowerCase(),A.fetchSettings&&this.setFetchRouteSettings(A.fetchSettings);}get pools(){return Array.from(this.poolsMap.keys())}validateWalletAddress(){if(!this.walletAddress||this.walletAddress.length===0)throw new Error("Wallet address is not set")}validateRawRouteResult(){if(!this.rawRouteResult)throw new Error("Raw route result is not set. Please fetch route first.")}setWalletAddress(e){this.walletAddress=e;}setSuiClient(e){this.client=e;}calcSlippage(e){return e/this.BASIS_POINT_DIVISOR}togglePoolStatus(e,A){let t=A??!(this.poolsMap.get(e)??true);this.poolsMap.set(e,t),this.events.emit("poolStatusChanged",{name:this.name,pool:e,enabled:t});}toggleAllPoolStatus(e){this.pools.forEach(A=>{this.poolsMap.set(A,e);}),this.events.emit("allPoolStatusChanged",{name:this.name,enabled:e});}getEnabledPools(){return Array.from(this.poolsMap.entries()).filter(([e,A])=>A).map(([e,A])=>e)}normalizeFetchRouteParams(e){return {...e,coinInType:normalizeStructTag$1(e.coinInType),coinOutType:normalizeStructTag$1(e.coinOutType)}}async withTimeout(e,A){let t=[e,new Promise((c,a)=>{setTimeout(()=>{a(new Error(`${this.name} fetch route timeout`));},this.fetchTimeoutInMs);})];return A&&t.push(new Promise((c,a)=>{if(A.aborted){a(A.reason??new Error(`${this.name} fetch route aborted`));return}A.addEventListener("abort",()=>a(A.reason??new Error(`${this.name} fetch route aborted`)),{once:true});})),await Promise.race(t)}async selectCoinInForSwap(e,A,t){let s=BigNumber(A.toString());if(B(t)){let[c]=e.splitCoins(e.gas,[s.toString()]);return c}else {let c=await this.selectCoins(t,s.toString()),a=c.reduce((n,i)=>n.plus(BigNumber(i.balance)),BigNumber(0)),o=e.objectRef({objectId:c[0].coinObjectId,version:c[0].version,digest:c[0].digest});if(c.length>1&&e.mergeCoins(o,c.slice(1).map(n=>e.objectRef({objectId:n.coinObjectId,version:n.version,digest:n.digest}))),a.gt(s)){let[n]=e.splitCoins(o,[s.toString()]);return n}else return o}}async selectCoins(e,A){return this.validateWalletAddress(),await E(this.client,e,A,this.walletAddress)}};var p=class{constructor(e,A){this.client=e;A&&A.forEach(t=>this.cache.set(t.coinType,t));}cache=new Map;setClient(e){this.client=e;}async getCoinMetadata(e){let A=normalizeStructTag(e);if(this.cache.has(A))return this.cache.get(A);let t=await this.client.getCoinMetadata({coinType:A});if(!t)throw new Error(`Coin metadata not found for coin type: ${A}`);return this.cache.set(A,t),t}};var F=class{coinMetadata;suiKit;events=new b;_slippage=30;signerMode=false;aggregatorMap=new Map;activeAggregator=new Map;_fetchingStatus=new Map;poolStatusForwarders=new Map;walletAddress;client;constructor(e){if(this.client=e.client??new SuiClient({url:e.fullnodeUrl||"https://fullnode.mainnet.sui.io:443"}),this.coinMetadata=new p(this.client),this.signerMode=!!(e.secretKey||e.mnemonics),e.secretKey||e.mnemonics)this.suiKit=new SuiKit({...e,suiClients:[this.client]}),this.walletAddress=this.suiKit.currentAddress;else if(e.walletAddress!==void 0)this.walletAddress=e.walletAddress;else throw new Error("One of secretKey, mnemonics or walletAddress must be provided")}forwardPoolStatusChangeEvent(e){this.events.emit("poolStatusChanged",e);}addAggregator(e){for(let A of e)if(!this.aggregatorMap.has(A.name)){this.aggregatorMap.set(A.name,A),this.activeAggregator.set(A.name,true),this._fetchingStatus.set(A.name,false);let t=s=>this.forwardPoolStatusChangeEvent(s);this.poolStatusForwarders.set(A.name,t),A.events.on("poolStatusChanged",t),this.events.emit("aggregatorAdded",{name:A.name});}}getActiveAggregators(){return Array.from(this.activeAggregator.entries()).filter(([e,A])=>A).map(([e,A])=>e)}getAggregator(e){return this.aggregatorMap.get(e)}toggleAggregator(e,A){if(!this.activeAggregator.has(e))throw new Error(`Aggregator ${e} not found`);this.activeAggregator.set(e,A),this.events.emit("aggregatorStatusChanged",{name:e,enabled:A});}removeAggregator(e){let A=this.aggregatorMap.get(e);if(!A)throw new Error(`Aggregator ${e} not found`);let t=this.poolStatusForwarders.get(e);t&&A.events.off("poolStatusChanged",t),this.poolStatusForwarders.delete(e),this.aggregatorMap.delete(e),this.activeAggregator.delete(e),this._fetchingStatus.delete(e),this.events.emit("aggregatorRemoved",{name:e});}get aggregators(){return Array.from(this.aggregatorMap.values())}get fetchingStatus(){return Object.fromEntries(this._fetchingStatus)}get slippage(){return this._slippage}setSlippage(e){this._slippage=e,this.events.emit("aggregatorSlippageChanged",{slippageInBps:e});}setFetchTimeoutInMs(e){this.aggregators.forEach(A=>{A.fetchTimeoutInMs=e;});}#e(){if(!this.suiKit)throw new Error("SuiKit is not initialized.")}setSuiClient(e){this.aggregators.forEach(A=>{A.setSuiClient(e);}),this.coinMetadata.setClient(e),this.client=e;}setWalletAddress(e){if(this.signerMode)throw new Error("Cannot change wallet address when SuiKit is initialized with secretKey or mnemonics.");if(!isValidSuiAddress(e))throw new Error("Invalid Sui wallet address");this.walletAddress=e,this.aggregators.forEach(A=>{A.setWalletAddress(e);});}async getCoinMetadata(e){return this.coinMetadata.getCoinMetadata(e)}async fetchRoutes(e,A){let t=this.aggregators.filter(({name:o})=>this.activeAggregator.get(o)===true);console.log("Available aggregators:",t.map(o=>o.name).join(", ")),console.log(`Fetching routes for ${e.coinInType} -> ${e.coinOutType}...`);let s=[],c=[],a=t.map(async o=>{this._fetchingStatus.set(o.name,true),this.events.emit("aggregatorFetchStart",{name:o.name});try{let n=await o.fetchRoute(e,A?.abortSignal);s.push(n),A?.onRouteFound?.(n);}catch(n){let i={name:o.name,reason:n};c.push(i),A?.onError?.(i);}finally{this._fetchingStatus.set(o.name,false),this.events.emit("aggregatorFetchEnd",{name:o.name});}});return await Promise.all(a),{routes:s.sort((o,n)=>BigNumber(n.formattedResult.coinOut.amount).comparedTo(o.formattedResult.coinOut.amount)??0),errors:c}}async buildRouteTransaction(e,A={}){let{mergeResult:t=true,txExtensionParams:s}=A,c=this.aggregatorMap.get(e.formattedResult.name);if(!c)throw new Error(`Aggregator ${e.formattedResult.name} not found in the aggregator list`);console.log(`Using ${c.name} to build transaction... (in: ${normalizeStructTag(e.formattedResult.coinIn.type)}, out: ${e.formattedResult.coinOut.type}, amountOut: ${e.formattedResult.coinOut.amount})`);let{tx:a,coinOut:o}=await c.buildSwapTransaction({route:e,slippage:A.slippage??this.slippage,txExtensionParams:s}),n=e.formattedResult.coinOut.type;return t?(await S(a,o,this.client,n,this.walletAddress),{tx:a,coinOutType:n}):{tx:a,coinOut:o,coinOutType:n}}async executeSwapTransaction(e,A=false){return this.#e(),A?this.suiKit.dryRunTxn(e):this.suiKit.signAndSendTxn(e)}};var Q=class extends f{cetusClient;constructor(e){super("cetus",e),this.cetusClient=new AggregatorClient({...e,endpoint:e.endpoint??"https://api-sui.cetus.zone/router_v3/find_routes",signer:e.signer??this.walletAddress,client:e.client??this.client}),this.cetusClient=new AggregatorClient({endpoint:"https://api-sui.cetus.zone/router_v3/find_routes",signer:this.walletAddress,client:this.client,env:Env.Mainnet}),this.poolsMap=new Map(ALL_DEXES.map(A=>[A,true]));}createRoute(e,A,t){let s=[],c=null,a=0;for(let n of e)n.from===A?(s.push({paths:[],coinIn:{type:n.from,amount:BigInt(n.amountIn)},coinOut:{type:n.target,amount:BigInt(n.amountOut)}}),c=n.target):n.from===c?s[a].paths.push({protocolName:n.provider,coinIn:{type:n.from,amount:BigInt(n.amountIn)},coinOut:{type:n.target,amount:BigInt(n.amountOut)}}):n.target===t&&(a++,c=null);let o=s.reduce((n,i)=>n+i.coinIn.amount,BigInt(0)).toString();return s.forEach(n=>{n.splitPercentage=BigNumber(n.coinIn.amount.toString()).div(o).times(100).toNumber();}),s}parseRawToFormattedResult({routerData:e,coinInType:A,coinOutType:t}){return {coinIn:{type:A,amount:BigInt(e.amountIn.toString()??"0")},coinOut:{type:t,amount:BigInt(e.amountOut.toString()??"0")},routes:this.createRoute(e.paths,A,t)}}setFetchRouteSettings(e){this.fetchSettings=e;}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:s,coinOutType:c,swapAmount:a}=t,o=await this.withTimeout(this.cetusClient.findRouters({...this.fetchSettings,from:normalizeStructTag(s),target:normalizeStructTag(c),amount:new _(a.toString()),byAmountIn:true,providers:this.getEnabledPools()}),A);if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:{...this.parseRawToFormattedResult({routerData:o,coinInType:s,coinOutType:c}),name:this.name},rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let{txExtensionParams:A,slippage:t,route:s}=e,c=s?.rawRouteResult??this.rawRouteResult,a=null,o=null;if(A){let{initTx:i,coinIn:d}=A;a=i,o=d;}else a=new Transaction,a.setSender(this.walletAddress),o=await this.selectCoinInForSwap(a,BigInt(c.amountIn.toString()),normalizeStructTag(c.paths[0].from));let n=await this.cetusClient.routerSwap({router:c,txb:a,slippage:this.calcSlippage(t),inputCoin:o});return {tx:a,coinOut:n}}};var T={faucet:{packages:{faucet:"",suiFrensGenesisWrapper:""},objects:{faucet:"",suiFrensMint:""}},staking:{packages:{events:"0x7f6ce7ade63857c4fd16ef7783fed2dfc4d7fb7e40615abdb653030b76aef0c6",lsd:"0x1575034d2729907aefca1ac757d6ccfcd3fc7e9e77927523c06007d8353ad836",afsui:"0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc"},objects:{stakedSuiVault:"0x2f8f6d5da7f13ea37daa397724280483ed062769813b6f31e9788e59cc88994d",stakedSuiVaultState:"0x55486449e41d89cfbdb20e005c1c5c1007858ad5b4d5d7c047d2b3b592fe8791",safe:"0xeb685899830dd5837b47007809c76d91a098d52aabbf61e8ac467c59e5cc4610",treasury:"0xd2b95022244757b0ab9f74e2ee2fb2c3bf29dce5590fa6993a85d64bd219d7e8",referralVault:"0x4ce9a19b594599536c53edb25d22532f82f18038dc8ef618afd00fbbfb9845ef",validatorConfigsTable:"0x8536350cfb8a8efdd133a1e087b55416d431f7e8b894f77b55b20c4b799ebad9",aftermathValidator:"0xd30018ec3f5ff1a3c75656abf927a87d7f0529e6dc89c7ddd1bd27ecb05e3db2"}},pools:{packages:{amm:"0xc4049b2d1cc0f6e017fda8260e4377cecd236bd7f56a54fee120816e72e2e0dd",ammInterface:"0x8d8bba50c626753589aa5abbc006c9fa07736f55f4e6fb57481682997c0b0d52",events:"0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c",eventsV2:"0xc4049b2d1cc0f6e017fda8260e4377cecd236bd7f56a54fee120816e72e2e0dd"},objects:{poolRegistry:"0xfcc774493db2c45c79f688f88d28023a3e7d98e4ee9f48bbf5c7990f651577ae",protocolFeeVault:"0xf194d9b1bcad972e45a7dd67dd49b3ee1e3357a00a50850c52cd51bb450e13b4",treasury:"0x28e499dff5e864a2eafe476269a4f5035f1c16f338da7be18b103499abf271ce",insuranceFund:"0xf0c40d67b078000e18032334c3325c47b9ec9f3d9ae4128be820d54663d14e3b",lpCoinsTable:"0x7f3bb65251feccacc7f48461239be1008233b85594114f7bf304e5e5b340bf59"},other:{createLpCoinPackageCompilations:{0:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEAAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[167,102,246,194,32,223,3,45,134,147,18,9,59,94,154,58,126,34,119,96,13,193,175,198,63,222,118,4,234,110,46,214]}',1:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEBAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[68,93,25,253,95,37,116,117,115,245,79,81,250,68,193,193,125,175,148,139,217,235,215,33,240,45,78,14,3,86,156,253]}',2:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgECAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[226,124,21,102,7,55,200,164,249,68,13,253,43,195,52,31,88,207,26,30,152,251,208,57,135,126,235,45,23,164,119,82]}',3:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEDAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[1,144,16,189,84,90,47,167,188,222,48,174,25,190,46,185,6,221,67,91,132,40,116,30,179,102,100,127,83,12,109,13]}',4:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEEAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[188,181,24,0,200,201,56,67,47,157,254,230,47,200,183,173,203,125,184,180,21,175,170,42,167,82,194,112,35,226,84,160]}',5:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEFAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[139,229,11,229,58,97,20,164,146,173,45,172,225,131,71,62,84,106,77,218,122,249,243,255,146,34,28,60,77,35,55,138]}',6:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEGAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[57,76,77,44,68,157,60,123,68,75,189,64,53,35,82,187,207,42,126,62,112,57,251,96,190,255,39,160,152,130,157,52]}',7:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEHAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[123,60,245,235,196,138,131,187,192,81,41,5,55,144,176,99,178,245,228,90,186,155,175,11,175,182,127,251,112,69,207,36]}',8:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEIAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[62,140,187,2,13,226,252,216,57,79,25,215,73,0,30,117,240,181,17,67,90,160,116,93,0,185,100,177,98,158,120,249]}',9:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEJAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[224,168,250,132,113,73,22,162,90,31,20,5,146,218,102,211,9,26,235,144,153,60,68,242,99,43,182,103,163,123,70,243]}',10:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEKAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[230,2,103,229,53,229,25,139,165,170,103,184,37,95,22,138,144,54,70,94,84,1,166,69,226,228,2,111,190,177,88,67]}',11:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgELAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[47,22,229,32,128,229,189,95,254,208,76,7,63,57,67,181,242,47,139,87,115,116,187,69,186,231,157,193,217,175,119,251]}',12:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEMAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[84,220,49,85,231,231,205,206,223,231,112,68,34,157,61,115,234,156,6,203,2,158,212,203,215,170,136,228,68,193,188,13]}',13:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgENAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[237,140,135,226,69,221,118,110,149,250,210,127,140,11,253,163,73,64,189,152,115,51,234,40,195,87,188,107,171,233,96,99]}',14:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEOAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[178,202,9,164,149,122,241,165,109,17,64,83,161,86,55,194,230,149,60,174,236,221,205,150,98,176,28,228,122,182,83,85]}',15:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEPAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[162,91,42,1,93,167,63,154,173,142,135,15,249,131,197,24,69,164,212,169,231,169,19,38,42,86,25,84,219,229,233,20]}',16:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgEQAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[79,121,127,12,72,247,127,165,243,18,184,175,76,20,119,251,245,47,31,190,247,87,15,198,47,204,130,99,18,94,161,74]}',17:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgERAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[40,28,55,168,44,135,53,11,9,113,97,54,212,21,163,15,203,241,151,5,117,250,3,22,135,69,113,175,166,166,111,19]}',18:'{"modules":["oRzrCwYAAAAKAQAGAgYIAw4LBBkCBRsRByxPCHtgBtsBAwreAQUM4wEPAAICAwEHAAACAAIBAgAABgABAAEEAwEBAgECAggABwgBAAEIAAMJAAIHCAEFQUZfTFAJVHhDb250ZXh0BWFmX2xwDWFtbV9pbnRlcmZhY2UOY3JlYXRlX2xwX2NvaW4LZHVtbXlfZmllbGQEaW5pdAp0eF9jb250ZXh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYl3CzUCu45mKHWYg3oiSlkwVBm4KKF2LVzkQ7Ux11QAgESAAIBBQEAAAAAAQULAAcACwE4AAIA"],"dependencies":["0xefe170ec0be4d762196bedecd7a065816576198a6527c99282a2551aaa7da38c","0x0625dc2cd40aee3998a1d6620de8892964c15066e0a285d8b573910ed4c75d50","0x712579292f80c11a0c9de4ff553d6e5c4757105e83a8a3129823d2b39e65d062","0xa6baab1e668c7868991c1c3c11e144100f5734c407d020f72a01b9d1a8bcb97f","0x0000000000000000000000000000000000000000000000000000000000000001","0x2d9316f1f1a95f6d7c85a4e690ef7c359e6649773ef2c37ad7d9857adb6bef06","0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf","0x0000000000000000000000000000000000000000000000000000000000000002","0x64213b0e4a52bac468d4ac3f140242f70714381653a1919a6d57cd49c628207a","0x73baa782c55003b3a359dec04b189312565d18e7309d4a51f5f112f891e3b2ab"],"digest":[173,252,173,67,1,192,123,156,242,232,253,247,12,147,190,24,152,41,3,166,219,90,110,43,48,139,30,235,10,219,209,58]}'}}},daoFeePools:{packages:{amm:"0x5ad6890968efcf3d20899e0cec735214f1067b96e77e77d86408989998468bb2",events:"0x6f60a091637054e23915b8745c0c0d47b1d49618ee3435b5f68eccf6a44fb53d"},objects:{version:"0xb4bfb0f917f12ad2a772bea9b4f22431f6f5f9653162c3ae6fae5b99b21392b7"}},farms:{packages:{vaults:"0x7ce31301b506b4ed327523061fe95d9c347082fa60da39733f74ffad9a53f8f5",vaultsInitial:"0x4f0a1a923dd063757fd37e04a9c2cee8980008e94433c9075c390065f98e9e4b",vaultsV2:"0x2d6755e10132fc1eab5e8a4a3e7ddfdacc31884621592d95fce48ecf1e157db9",eventsV2:"0x79ee374b9e3c60c00a19fdbeaea25731bbea8f2cab9bb61bb712543e0ba55b7a"},objects:{version:"0xdc372fa9b6a538382efc560478a786fcf04e6e34850100020056c98c5c387193"}},dca:{packages:{dca:"0x409e2ace51cc5821be41a667e4cb9afa64cde49a7f940c68109db24b39ca93b8",events:"0x002134246a32eec18e68f1f5aadb8edd34856298ae6d32c145d28f3ca46c7fd1",eventsV2:"0x409e2ace51cc5821be41a667e4cb9afa64cde49a7f940c68109db24b39ca93b8"},objects:{config:"0x1b26465e9c688e3a3d2301f26e25091bc0f91708d953dc220f5697faa8ba9bd6"}},limitOrders:{packages:{limitOrders:"0xe57ee3613b7dece546f8a2d8a53145cbab41d32b86037b94f9ebfcbcfa66885a",events:"0xe57ee3613b7dece546f8a2d8a53145cbab41d32b86037b94f9ebfcbcfa66885a"}},sharedCustody:{address:"0xafe2fafac0b048c9c70a61cc1798400a85173df96b30118c40af6f3382b5a777",publicKey:"AMylYwVSuJQmTmDm6KuPlNwLnTtkk63HqOByubxxsVeC"},referralVault:{packages:{referralVault:"0xc66fabf1a9253e43c70f1cc02d40a1d18db183140ecaae2a3f58fa6b66c55acf"},objects:{referralVault:"0x35d35b0e5b177593d8c3a801462485572fc30861e6ce96a55af6dc4730709278"}},suiFrens:{packages:{suiFrens:"",suiFrensBullshark:"",accessories:"",suiFrensVault:"",suiFrensVaultCapyLabsExtension:""},objects:{capyLabsApp:"",suiFrensVault:"",suiFrensVaultStateV1:"",suiFrensVaultStateV1MetadataTable:"",suiFrensVaultCapyLabsExtension:""}},router:{packages:{utils:"0xdc15721baa82ba64822d585a7349a1508f76d94ae80e899b06e48369c257750e"}},dynamicGas:{sponsorAddress:"0xae4ba5f592e695a46d58a0579aa5d4f6ebead46be0f2d5bd229d5c292290548c"},perpetuals:{packages:{events:"0x21d001e8b07da2e3facb3e2d636bbaef43ba3c978bd84810368840b7d57c5068"},objects:{registry:"0xd0b3ea6b7a2f5887543a5a493aa70bcd0ec1a2d9c03d830504234df3e8c6a609"}},perpetualsVaults:{other:{createLpCoinPackageCompilation:'{"modules":["oRzrCwYAAAAKAQAOAg4eAywsBFgIBWBZB7kB4gEImwOAAQabBGcKggUFDIcFLAASAwcBDQIGAhMCFAIVAAICAAIBBwEAAAMADAEAAQMDDAEAAQUEAgAGBQcAAAoAAQABCwEDAAIRBgcBAAMICQoBAgQOBgEBDAQPDwEBDAUQDA0ABgwEBQACBQMIBAsFDgIIAAcIBAACCwIBCAALAwEIAAECAQoCAQgFAQkAAQsBAQkAAQgABwkAAgoCCgIKAgsBAQgFBwgEAgsDAQkACwIBCQABCwIBCAABBggEAQUBCwMBCAACCQAFDENvaW5NZXRhZGF0YQZPcHRpb24IVEVNUExBVEULVHJlYXN1cnlDYXAJVHhDb250ZXh0A1VybARjb2luCWNvbnN0YW50cw9jcmVhdGVfY3VycmVuY3kLZHVtbXlfZmllbGQEaW5pdAtscF9kZWNpbWFscxVuZXdfdW5zYWZlX2Zyb21fYnl0ZXMGb3B0aW9uFHB1YmxpY19mcmVlemVfb2JqZWN0D3B1YmxpY190cmFuc2ZlcgZzZW5kZXIEc29tZQh0ZW1wbGF0ZQh0cmFuc2Zlcgp0eF9jb250ZXh0A3VybAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAp4geY2XwRD2s2t7PYVDqpJGMi7y/Y2DrXnvMyXUc7wvCgIJCFRFTVBMQVRFCgIKCUNPSU4gTkFNRQoCERBDT0lOIERFU0NSSVBUSU9OCgI3Nmh0dHBzOi8vYWZ0ZXJtYXRoLmZpbmFuY2UvY29pbnMvcGVycGV0dWFscy9kZWZhdWx0LnN2ZwACAQkBAAAAAAIUCwARAQcABwEHAgcDEQc4AAoBOAEMAgwDCwI4AgsDCwEuEQY4AwIA"],"dependencies":["0x46234ba81f3a5ba6571383233df0f9ea5fe60a3a327537be1f5fec447bced693","0x9e20798d97c110f6b36b7b3d8543aa9246322ef2fd8d83ad79ef3325d473bc2f","0xa8172ed2a6f14cd0ee55124326685713d6f765039e7c5339f7a0b57be06fddb5","0x21d001e8b07da2e3facb3e2d636bbaef43ba3c978bd84810368840b7d57c5068","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000002"],"digest":[197,20,191,110,212,210,250,216,46,69,171,178,75,240,176,17,254,237,222,251,192,94,195,175,10,216,89,18,238,154,114,144]}'}},leveragedStaking:{packages:{leveragedAfSui:"",leveragedAfSuiInitial:""},objects:{leveragedAfSuiState:"",afSuiSuiPoolId:""}},scallop:{objects:{version:"",afSuiMarket:"",coinDecimalsRegistry:"",xOracle:""}},nftAmm:{packages:{nftAmm:""},objects:{protocolFeeVault:"",treasury:"",insuranceFund:"",referralVault:""}},nfts:{packages:{mystenTransferPolicy:"0x0cb4bcc0560340eb1a1b929cabe56b33fc6449820ec8c1980d69bb98b649b802"}}};var h=()=>(...r)=>r;var o0=h()("Aftermath","Bolt","Bluefin","BlueMove","Cetus","DeepBook","DeepBookV3","DoubleUpPump","FlowX","FlowXClmm","FullSail","HopFun","Kriya","KriyaClmm","Magma","Metastable","Momentum","MovePump","Obric","SpringSui","Steamm","SuiAi","SuiSwap","Turbos","TurbosFun","BlastFun"),P=class extends f{afClient;afApi;constructor(e){super("aftermath",e),this.afApi=new AftermathApi(this.client,e.addresses??T),this.afClient=new Aftermath("MAINNET",this.afApi),this.poolsMap=new Map(o0.map(A=>[A,true]));}get router(){return this.afClient.Router()}setFetchRouteSettings(e){this.fetchSettings=e;}parseRawRouteToFormattedResult(e){let A=e.coinIn.amount,t={...e,name:this.name};return t.routes.forEach(s=>{let c=s.paths[0].coinIn.amount;s.splitPercentage=BigNumber(c.toString()).div(A.toString()).times(100).toNumber();}),t}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:s,coinOutType:c,swapAmount:a}=t,o=await this.withTimeout(this.router.getCompleteTradeRouteGivenAmountIn({...this.fetchSettings,protocolWhitelist:this.getEnabledPools(),coinInType:s,coinOutType:c,coinInAmount:a},A));if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:this.parseRawRouteToFormattedResult(o),rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let{txExtensionParams:A,slippage:t,route:s}=e,c=s?.rawRouteResult??this.rawRouteResult,a=null,o=null;if(A){let{initTx:d,coinIn:u}=A;a=d,o=u;}else a=new Transaction$1,a.setSender(this.walletAddress),o=await this.selectCoinInForSwap(a,BigInt(c.coinIn.amount.toString()),normalizeStructTag$1(c.coinIn.type));let{tx:n,coinOutId:i}=await this.router.addTransactionForCompleteTradeRoute({walletAddress:this.walletAddress,completeRoute:c,slippage:this.calcSlippage(t),tx:a,coinInId:o});if(!i)throw new Error(`${this.name} build swap transaction failed`);return {tx:n,coinOut:i}}};var i0=h()("aftermath","bluefin","bluemove","cetus","cetus_dlmm","deepbook_v3","ferra_clmm","ferra_dlmm","flowx","flowx_v3","fullsail","kriya","kriya_v3","magma","obric","springsui","steamm","stsui","suiswap","turbos","bluefinx","steamm_oracle_quoter","haedal_pmm","momentum","steamm_oracle_quoter_v2","sevenk_v1"),k=class extends f{commission;constructor(e){super("7k",e),this.commission=e.commission??{partner:this.walletAddress,commissionBps:0},setSuiClient(this.client),this.poolsMap=new Map(i0.map(A=>[A,true]));}setFetchRouteSettings(e){this.fetchSettings=e;}createRoute(e,A,t){let s=[];e.forEach((a,o)=>{s.push({paths:[],coinIn:{type:a.tokenIn,amount:BigInt(BigNumber(a.tokenInAmount).multipliedBy(A).integerValue().toString())},coinOut:{type:a.tokenOut,amount:BigInt(BigNumber(a.tokenOutAmount).multipliedBy(t).integerValue().toString())}}),a.hops.forEach(n=>{s[o].paths.push({protocolName:g(n.pool.type.toLowerCase()),coinIn:{type:n.tokenIn,amount:BigInt(BigNumber(n.tokenInAmount).multipliedBy(A).integerValue().toString())},coinOut:{type:n.tokenOut,amount:BigInt(BigNumber(n.tokenOutAmount).multipliedBy(t).integerValue().toString())}});});});let c=s.reduce((a,o)=>a+o.coinIn.amount,BigInt(0)).toString();return s.forEach(a=>{a.splitPercentage=BigNumber(a.coinIn.amount.toString()).div(c).times(100).toNumber();}),s}parseRawRouteToFormattedResult(e){if(!e.routes)throw new Error(`${this.name} fetch route returned empty sorRoute`);return {routes:this.createRoute(e.routes,BigNumber(e.swapAmountWithDecimal).dividedBy(e.swapAmount).toNumber(),BigNumber(e.returnAmountAfterCommissionWithDecimal).dividedBy(e.returnAmount).toNumber()),coinIn:{type:e.tokenIn,amount:BigInt(e.swapAmountWithDecimal)},coinOut:{type:e.tokenOut,amount:BigInt(e.returnAmountAfterCommissionWithDecimal)},name:this.name}}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:s,coinOutType:c,swapAmount:a}=t,o=await this.withTimeout(getQuote({...this.fetchSettings,tokenIn:s,tokenOut:c,amountIn:a.toString(),sources:this.getEnabledPools()}),A);if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:this.parseRawRouteToFormattedResult(o),rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let{txExtensionParams:A,slippage:t,route:s}=e,c=s?.rawRouteResult??this.rawRouteResult,a=null,o=null;if(A){let{initTx:d,coinIn:u}=A;a=d,o=u;}else a=new Transaction$1,a.setSender(this.walletAddress),o=await this.selectCoinInForSwap(a,BigInt(c.swapAmountWithDecimal),normalizeStructTag$1(c.tokenIn));let{tx:n,coinOut:i}=await buildTx({quoteResponse:c,slippage:this.calcSlippage(t),commission:this.commission,accountAddress:this.walletAddress,extendTx:{tx:a,coinIn:o}});if(!i)throw new Error(`${this.name} build swap transaction failed`);return {tx:"txBytes"in n?Transaction$1.from(n.txBytes):n,coinOut:i}}};var Y=class extends f{quoter=new AggregatorQuoter("mainnet");commission;constructor(e){super("flowx",e),this.commission=e.commission,this.poolsMap=new Map(Object.values(Protocol).map(A=>[A,true]));}setFetchRouteSettings(e){this.fetchSettings=e;}calcSlippage(e){return e*100}parseRawRouteToFormattedResult(e){let A=[];for(let t of e.routes)A.push({paths:t.paths.map(s=>({protocolName:g(s.protocol()?.toLowerCase()??""),coinIn:{amount:BigInt((s.amountIn??0).toString()),type:s.input.coinType},coinOut:{amount:BigInt((s.amountOut??0).toString()),type:s.output.coinType}})),splitPercentage:Number(t.amountIn??0)/Number(this.rawRouteResult?.amountIn??1)*100,coinIn:{amount:BigInt(t.amountIn.toString()),type:normalizeStructTag(t.input.coinType)},coinOut:{amount:BigInt(t.amountOut.toString()),type:normalizeStructTag(t.output.coinType)}});return {routes:A,coinIn:{type:normalizeStructTag(e.coinIn.coinType),amount:BigInt(e.amountIn.toString())},coinOut:{type:normalizeStructTag(e.coinOut.coinType),amount:BigInt(e.amountOut.toString())},name:this.name}}async fetchRoute(e,A){let t=this.normalizeFetchRouteParams(e),{coinInType:s,coinOutType:c,swapAmount:a}=t,o=await this.withTimeout(this.quoter.getRoutes({...this.fetchSettings,tokenIn:s,tokenOut:c,amountIn:a.toString(),commission:this.commission,includeSources:this.getEnabledPools()}),A);if(!o)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=o,{formattedResult:this.parseRawRouteToFormattedResult(o),rawRouteResult:o}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateRawRouteResult();let{txExtensionParams:A,slippage:t,route:s}=e,c=s?.rawRouteResult??this.rawRouteResult,a=null,o=null;if(A){let{initTx:u,coinIn:V}=A;a=u,o=V;}else a=new Transaction,a.setSender(this.walletAddress),o=await this.selectCoinInForSwap(a,BigInt(c.amountIn.toString()),normalizeStructTag(c.coinIn.coinType));let n=new TradeBuilder("mainnet",c.routes).sender(this.walletAddress).slippage(this.calcSlippage(t)).deadline(Date.now()+60*60*1e3),d=await(this.commission?n.commission(this.commission).build():n.build()).swap({client:this.client,tx:a,coinIn:o});if(!d)throw new Error(`${this.name} build swap transaction failed`);return {tx:a,coinOut:d}}};
|
|
14
14
|
|
|
15
|
-
export {
|
|
15
|
+
export { P as AftermathSwap, F as Aggregator, Q as CetusSwap, p as CoinMetadataRegistry, Y as FlowXSwap, f as SwapSdkBase, b as TypedEventEmitter, k as _7kSwap, B as isSuiType, S as mergeWithExistingOrTransfer, E as selectCoins, g as transformProperCase };
|
package/package.json
CHANGED
package/src/class/aggregator.ts
CHANGED
|
@@ -29,6 +29,7 @@ type TxExt = {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
type BuildOptionsBase = {
|
|
32
|
+
slippage?: number; // in bps, 1bps = 0.01% = 0.0001
|
|
32
33
|
txExtensionParams?: TxExt;
|
|
33
34
|
};
|
|
34
35
|
|
|
@@ -300,7 +301,8 @@ export class Aggregator {
|
|
|
300
301
|
);
|
|
301
302
|
|
|
302
303
|
const { tx, coinOut } = await aggregator.buildSwapTransaction({
|
|
303
|
-
|
|
304
|
+
route,
|
|
305
|
+
slippage: options.slippage ?? this.slippage,
|
|
304
306
|
txExtensionParams,
|
|
305
307
|
});
|
|
306
308
|
|
package/src/class/base.ts
CHANGED
|
@@ -25,6 +25,7 @@ export abstract class SwapSdkBase<
|
|
|
25
25
|
RawRouteResultType,
|
|
26
26
|
FetchRouteSettings
|
|
27
27
|
> {
|
|
28
|
+
BASIS_POINT_DIVISOR = 10_000;
|
|
28
29
|
protected rawRouteResult?: RawRouteResultType;
|
|
29
30
|
readonly name: string = '';
|
|
30
31
|
readonly events = new TypedEventEmitter<SwapSdkEvents<PoolType>>();
|
|
@@ -81,7 +82,7 @@ export abstract class SwapSdkBase<
|
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
calcSlippage(slippageInBps: number): number {
|
|
84
|
-
return slippageInBps /
|
|
85
|
+
return slippageInBps / this.BASIS_POINT_DIVISOR; // Convert basis points to decimal (e.g., 50 bps = 0.005 = 0.5%)
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
togglePoolStatus(pool: PoolType, enabled?: boolean) {
|
|
@@ -210,6 +211,6 @@ export abstract class SwapSdkBase<
|
|
|
210
211
|
abortSignal?: AbortSignal
|
|
211
212
|
): Promise<FetchRouteResult<RawRouteResultType>>;
|
|
212
213
|
abstract buildSwapTransaction(
|
|
213
|
-
params: SwapParams
|
|
214
|
+
params: SwapParams<RawRouteResultType>
|
|
214
215
|
): Promise<{ tx: Transaction; coinOut: TransactionObjectArgument }>;
|
|
215
216
|
}
|
package/src/example/index.ts
CHANGED
|
@@ -28,50 +28,50 @@ const main = async () => {
|
|
|
28
28
|
const coinOutType =
|
|
29
29
|
'0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA';
|
|
30
30
|
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
// Fetch routes and sort by best output amount
|
|
32
|
+
const { routes } = await aggregator.fetchRoutes({
|
|
33
|
+
coinInType,
|
|
34
|
+
coinOutType,
|
|
35
|
+
swapAmount: BigInt(1e8), // 0.1 SUI
|
|
36
|
+
});
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
if (routes.length === 0) {
|
|
39
|
+
throw new Error('All routes failed to fetch');
|
|
40
|
+
}
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
const { tx } = await aggregator.buildRouteTransaction(routes[0]);
|
|
43
|
+
const { effects } = await aggregator.executeSwapTransaction(tx, true);
|
|
44
|
+
console.log(`${effects?.status.status}`);
|
|
45
45
|
// // const { effects, digest } = await aggregator.executeBestRoute();
|
|
46
46
|
// // console.log(`${effects?.status.status}: ${digest}`);
|
|
47
47
|
|
|
48
|
-
// Fetch and use the fastest route
|
|
49
|
-
const abortController = new AbortController();
|
|
50
|
-
let fastestRouteUsed = false;
|
|
51
|
-
await aggregator.fetchRoutes(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
48
|
+
// // Fetch and use the fastest route
|
|
49
|
+
// const abortController = new AbortController();
|
|
50
|
+
// let fastestRouteUsed = false;
|
|
51
|
+
// await aggregator.fetchRoutes(
|
|
52
|
+
// {
|
|
53
|
+
// coinInType,
|
|
54
|
+
// coinOutType,
|
|
55
|
+
// swapAmount: BigInt(1e8),
|
|
56
|
+
// },
|
|
57
|
+
// {
|
|
58
|
+
// abortSignal: abortController.signal,
|
|
59
|
+
// onRouteFound: async (route) => {
|
|
60
|
+
// if (fastestRouteUsed) return;
|
|
61
|
+
// fastestRouteUsed = true;
|
|
62
|
+
// abortController.abort();
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
// console.log(`Fastest route: ${route.formattedResult.name}`);
|
|
65
|
+
// console.log(
|
|
66
|
+
// `Expected output: ${route.formattedResult.coinOut.amount}`
|
|
67
|
+
// );
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
);
|
|
69
|
+
// const { tx } = await aggregator.buildRouteTransaction(route);
|
|
70
|
+
// const { effects } = await aggregator.executeSwapTransaction(tx, true);
|
|
71
|
+
// console.log(`Fastest route status: ${effects?.status.status}`);
|
|
72
|
+
// },
|
|
73
|
+
// }
|
|
74
|
+
// );
|
|
75
75
|
} catch (e) {
|
|
76
76
|
console.error(e);
|
|
77
77
|
} finally {
|
package/src/interface/base.ts
CHANGED
|
@@ -11,10 +11,10 @@ export type FetchRouteParams = {
|
|
|
11
11
|
swapAmount: bigint;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
export type SwapParams = {
|
|
14
|
+
export type SwapParams<T> = {
|
|
15
|
+
route?: FetchRouteResult<T>;
|
|
15
16
|
slippage: number; // in bps, 1bps = 0.01% = 0.0001
|
|
16
17
|
minAmountOut?: bigint; // For slippage calculation
|
|
17
|
-
// swapFee?: number;
|
|
18
18
|
txExtensionParams?: {
|
|
19
19
|
initTx: Transaction;
|
|
20
20
|
coinIn: TransactionObjectArgument;
|
|
@@ -95,7 +95,7 @@ export interface SwapSdkBaseInterface<
|
|
|
95
95
|
amount: bigint,
|
|
96
96
|
coinType: string
|
|
97
97
|
) => Promise<TransactionObjectArgument>;
|
|
98
|
-
buildSwapTransaction: (params: SwapParams) => Promise<{
|
|
98
|
+
buildSwapTransaction: (params: SwapParams<RawRouteResultType>) => Promise<{
|
|
99
99
|
tx: Transaction;
|
|
100
100
|
coinOut: TransactionObjectArgument;
|
|
101
101
|
}>;
|
package/src/sdk/7k.ts
CHANGED
|
@@ -229,15 +229,18 @@ export class _7kSwap extends SwapSdkBase<
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
async buildSwapTransaction(
|
|
232
|
-
params: SwapParams
|
|
232
|
+
params: SwapParams<QuoteResponse>
|
|
233
233
|
): Promise<{ tx: Transaction; coinOut: TransactionObjectArgument }> {
|
|
234
234
|
this.validateWalletAddress();
|
|
235
235
|
this.validateRawRouteResult();
|
|
236
236
|
|
|
237
|
+
const { txExtensionParams, slippage, route } = params;
|
|
238
|
+
const quoteResponse = route?.rawRouteResult ?? this.rawRouteResult;
|
|
239
|
+
|
|
237
240
|
let tx: Transaction | null = null;
|
|
238
241
|
let inputCoin = null;
|
|
239
|
-
if (
|
|
240
|
-
const { initTx, coinIn } =
|
|
242
|
+
if (txExtensionParams) {
|
|
243
|
+
const { initTx, coinIn } = txExtensionParams;
|
|
241
244
|
tx = initTx;
|
|
242
245
|
inputCoin = coinIn;
|
|
243
246
|
} else {
|
|
@@ -246,14 +249,14 @@ export class _7kSwap extends SwapSdkBase<
|
|
|
246
249
|
|
|
247
250
|
inputCoin = await this.selectCoinInForSwap(
|
|
248
251
|
tx,
|
|
249
|
-
BigInt(
|
|
250
|
-
normalizeStructTag(
|
|
252
|
+
BigInt(quoteResponse.swapAmountWithDecimal),
|
|
253
|
+
normalizeStructTag(quoteResponse.tokenIn)
|
|
251
254
|
);
|
|
252
255
|
}
|
|
253
256
|
|
|
254
257
|
const { tx: nextTx, coinOut } = await buildTx({
|
|
255
|
-
quoteResponse
|
|
256
|
-
slippage: this.calcSlippage(
|
|
258
|
+
quoteResponse,
|
|
259
|
+
slippage: this.calcSlippage(slippage),
|
|
257
260
|
commission: this.commission,
|
|
258
261
|
accountAddress: this.walletAddress,
|
|
259
262
|
extendTx: {
|
package/src/sdk/aftermath.ts
CHANGED
|
@@ -132,14 +132,17 @@ export class AftermathSwap extends SwapSdkBase<
|
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
async buildSwapTransaction(params: SwapParams) {
|
|
135
|
+
async buildSwapTransaction(params: SwapParams<RouterCompleteTradeRoute>) {
|
|
136
136
|
this.validateWalletAddress();
|
|
137
137
|
this.validateRawRouteResult();
|
|
138
138
|
|
|
139
|
+
const { txExtensionParams, slippage, route } = params;
|
|
140
|
+
const completeRoute = route?.rawRouteResult ?? this.rawRouteResult;
|
|
141
|
+
|
|
139
142
|
let tx: Transaction | null = null;
|
|
140
143
|
let inputCoin = null;
|
|
141
|
-
if (
|
|
142
|
-
const { initTx, coinIn } =
|
|
144
|
+
if (txExtensionParams) {
|
|
145
|
+
const { initTx, coinIn } = txExtensionParams;
|
|
143
146
|
tx = initTx;
|
|
144
147
|
inputCoin = coinIn;
|
|
145
148
|
} else {
|
|
@@ -148,16 +151,16 @@ export class AftermathSwap extends SwapSdkBase<
|
|
|
148
151
|
|
|
149
152
|
inputCoin = await this.selectCoinInForSwap(
|
|
150
153
|
tx,
|
|
151
|
-
|
|
152
|
-
normalizeStructTag(
|
|
154
|
+
BigInt(completeRoute.coinIn.amount.toString()),
|
|
155
|
+
normalizeStructTag(completeRoute.coinIn.type)
|
|
153
156
|
);
|
|
154
157
|
}
|
|
155
158
|
|
|
156
159
|
const { tx: nextTx, coinOutId: outputCoin } =
|
|
157
160
|
await this.router.addTransactionForCompleteTradeRoute({
|
|
158
161
|
walletAddress: this.walletAddress,
|
|
159
|
-
completeRoute
|
|
160
|
-
slippage: this.calcSlippage(
|
|
162
|
+
completeRoute,
|
|
163
|
+
slippage: this.calcSlippage(slippage),
|
|
161
164
|
tx,
|
|
162
165
|
coinInId: inputCoin,
|
|
163
166
|
});
|
package/src/sdk/cetus.ts
CHANGED
|
@@ -171,14 +171,17 @@ export class CetusSwap extends SwapSdkBase<
|
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
async buildSwapTransaction(params: SwapParams) {
|
|
174
|
+
async buildSwapTransaction(params: SwapParams<RouterDataV3>) {
|
|
175
175
|
this.validateWalletAddress();
|
|
176
176
|
this.validateRawRouteResult();
|
|
177
177
|
|
|
178
|
+
const { txExtensionParams, slippage, route } = params;
|
|
179
|
+
const router = route?.rawRouteResult ?? this.rawRouteResult;
|
|
180
|
+
|
|
178
181
|
let tx: Transaction | null = null;
|
|
179
182
|
let inputCoin = null;
|
|
180
|
-
if (
|
|
181
|
-
const { initTx, coinIn } =
|
|
183
|
+
if (txExtensionParams) {
|
|
184
|
+
const { initTx, coinIn } = txExtensionParams;
|
|
182
185
|
tx = initTx;
|
|
183
186
|
inputCoin = coinIn;
|
|
184
187
|
} else {
|
|
@@ -186,15 +189,15 @@ export class CetusSwap extends SwapSdkBase<
|
|
|
186
189
|
tx.setSender(this.walletAddress);
|
|
187
190
|
inputCoin = await this.selectCoinInForSwap(
|
|
188
191
|
tx,
|
|
189
|
-
BigInt(
|
|
190
|
-
normalizeStructTag(
|
|
192
|
+
BigInt(router.amountIn.toString()),
|
|
193
|
+
normalizeStructTag(router.paths[0].from)
|
|
191
194
|
);
|
|
192
195
|
}
|
|
193
196
|
|
|
194
197
|
const outputCoin = await this.cetusClient.routerSwap({
|
|
195
|
-
router
|
|
198
|
+
router,
|
|
196
199
|
txb: tx,
|
|
197
|
-
slippage: this.calcSlippage(
|
|
200
|
+
slippage: this.calcSlippage(slippage),
|
|
198
201
|
inputCoin,
|
|
199
202
|
});
|
|
200
203
|
|
package/src/sdk/flowx.ts
CHANGED
|
@@ -133,15 +133,18 @@ export class FlowXSwap extends SwapSdkBase<
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
async buildSwapTransaction(
|
|
136
|
-
params: SwapParams
|
|
136
|
+
params: SwapParams<GetRoutesResult<Coin, Coin>>
|
|
137
137
|
): Promise<{ tx: Transaction; coinOut: TransactionObjectArgument }> {
|
|
138
138
|
this.validateWalletAddress();
|
|
139
139
|
this.validateRawRouteResult();
|
|
140
140
|
|
|
141
|
+
const { txExtensionParams, slippage, route } = params;
|
|
142
|
+
const rawRoute = route?.rawRouteResult ?? this.rawRouteResult;
|
|
143
|
+
|
|
141
144
|
let tx: Transaction | null = null;
|
|
142
145
|
let inputCoin = null;
|
|
143
|
-
if (
|
|
144
|
-
const { initTx, coinIn } =
|
|
146
|
+
if (txExtensionParams) {
|
|
147
|
+
const { initTx, coinIn } = txExtensionParams;
|
|
145
148
|
tx = initTx;
|
|
146
149
|
inputCoin = coinIn;
|
|
147
150
|
} else {
|
|
@@ -150,14 +153,14 @@ export class FlowXSwap extends SwapSdkBase<
|
|
|
150
153
|
|
|
151
154
|
inputCoin = await this.selectCoinInForSwap(
|
|
152
155
|
tx,
|
|
153
|
-
BigInt(
|
|
154
|
-
normalizeStructTag(
|
|
156
|
+
BigInt(rawRoute.amountIn.toString()),
|
|
157
|
+
normalizeStructTag(rawRoute.coinIn.coinType)
|
|
155
158
|
);
|
|
156
159
|
}
|
|
157
160
|
|
|
158
|
-
const tradeBuilder = new TradeBuilder('mainnet',
|
|
161
|
+
const tradeBuilder = new TradeBuilder('mainnet', rawRoute.routes)
|
|
159
162
|
.sender(this.walletAddress)
|
|
160
|
-
.slippage(this.calcSlippage(
|
|
163
|
+
.slippage(this.calcSlippage(slippage))
|
|
161
164
|
.deadline(Date.now() + 60 * 60 * 1000); // one minute;
|
|
162
165
|
|
|
163
166
|
const trade = this.commission
|