@scallop-io/scallop-swap-sdk 2.2.0 → 3.0.0-rc.1

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.cjs ADDED
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ var grpc = require('@mysten/sui/grpc');
4
+ var suiKit = require('@scallop-io/sui-kit');
5
+ var utils = require('@mysten/sui/utils');
6
+ var bignumber_js = require('bignumber.js');
7
+ var events = require('events');
8
+ var transactions = require('@mysten/sui/transactions');
9
+ var aggregatorSdk = require('@cetusprotocol/aggregator-sdk');
10
+ var $ = require('bn.js');
11
+ var jsonRpc = require('@mysten/sui/jsonRpc');
12
+ var aftermathTsSdk = require('aftermath-ts-sdk');
13
+ var sdkTs = require('@7kprotocol/sdk-ts');
14
+ var sdk = require('@flowx-finance/sdk');
15
+
16
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
17
+
18
+ var $__default = /*#__PURE__*/_interopDefault($);
19
+
20
+ var W=utils.normalizeStructTag(utils.SUI_TYPE_ARG),B=r=>utils.normalizeStructTag(r)===W,S=async(r,e,A,o)=>{let s=[],a=bignumber_js.BigNumber(A),c=null;try{do{let{objects:t,hasNextPage:n,cursor:i}=await r.core.listCoins({coinType:e,owner:o,limit:50,cursor:c});if(s.push(...t),a=a.minus(t.reduce((d,u)=>d.plus(bignumber_js.BigNumber(u.balance)),bignumber_js.BigNumber(0))),a.lte(0)||(c=i??null,!n))break}while(c)}catch(t){throw new Error(t?.message??"Failed to fetch coins")}if(s.length===0)throw new Error(`No available coin for type ${e} found in wallet ${o}`);if(a.gt(0))throw new Error(`Insufficient balance for coin type ${e} in wallet ${o}`);return s},E=async(r,e,A,o,s)=>{try{if(B(o))r.mergeCoins(r.gas,[e]);else {let{objects:a}=await A.core.listCoins({coinType:o,owner:s,limit:1});if(!a.length)throw new Error(`No existing ${o} coin found to merge with`);let c=r.objectRef({objectId:a[0].objectId,version:a[0].version,digest:a[0].digest});a.length===1?r.mergeCoins(c,[e]):r.mergeCoins(c,[e,...a.slice(1).map(t=>r.objectRef({objectId:t.objectId,version:t.version,digest:t.digest}))]);}}catch{r.transferObjects([e],r.pure.address(s));}},H=r=>r[0].toUpperCase()+r.slice(1),g=r=>r.split("_").map(H).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{rawRouteResult;name="";events=new b;client;suiClient;fetchTimeoutInMs;walletAddress;fetchSettings;poolsMap=new Map;constructor(e,A){this.suiClient=A.suiClient??new grpc.SuiGrpcClient({baseUrl:"https://fullnode.mainnet.sui.io:443",network:"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")}validateClient(){if(!this.client)throw new Error("SDK client is not set")}setWalletAddress(e){this.walletAddress=e;}setSuiClient(e){this.suiClient=e;}togglePoolStatus(e,A){let o=A??!(this.poolsMap.get(e)??true);this.poolsMap.set(e,o),this.events.emit("poolStatusChanged",{name:this.name,pool:e,enabled:o});}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 o,s,a=[e,new Promise((c,t)=>{o=setTimeout(()=>{t(new Error(`${this.name} fetch route timeout`));},this.fetchTimeoutInMs);})];A&&a.push(new Promise((c,t)=>{if(A.aborted){t(A.reason??new Error(`${this.name} fetch route aborted`));return}s=()=>t(A.reason??new Error(`${this.name} fetch route aborted`)),A.addEventListener("abort",s,{once:true});}));try{return await Promise.race(a)}finally{o&&clearTimeout(o),A&&s&&A.removeEventListener("abort",s);}}async selectCoinInForSwap(e,A,o){let s=bignumber_js.BigNumber(A.toString());if(B(o)){let[a]=e.splitCoins(e.gas,[s.toString()]);return a}else {let a=await this.selectCoins(o,s.toString()),c=a.reduce((n,i)=>n.plus(bignumber_js.BigNumber(i.balance)),bignumber_js.BigNumber(0)),t=e.objectRef({objectId:a[0].objectId,version:a[0].version,digest:a[0].digest});if(a.length>1&&e.mergeCoins(t,a.slice(1).map(n=>e.objectRef({objectId:n.objectId,version:n.version,digest:n.digest}))),c.gt(s)){let[n]=e.splitCoins(t,[s.toString()]);return n}else return t}}async selectCoins(e,A){return this.validateWalletAddress(),await S(this.suiClient,e,A,this.walletAddress)}};var p=class{constructor(e,A){this.client=e;A&&A.forEach(o=>this.cache.set(o.coinType,o));}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{response:o}=await this.client.stateService.getCoinInfo({coinType:A}),s=o.metadata;if(!s)throw new Error(`Coin metadata not found for coin type: ${A}`);return this.cache.set(A,s),s}};var F=class{coinMetadata;suiKit;events=new b;_slippage=.003;signerMode=false;aggregatorMap=new Map;activeAggregator=new Map;_fetchingStatus=new Map;poolStatusForwarders=new Map;allPoolStatusForwarders=new Map;walletAddress;client;constructor(e){if(this.client=e.client??new grpc.SuiGrpcClient({baseUrl:e.fullnodeUrl||"https://fullnode.mainnet.sui.io:443",network:"mainnet"}),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 o=a=>this.forwardPoolStatusChangeEvent(a);this.poolStatusForwarders.set(A.name,o),A.events.on("poolStatusChanged",o);let s=a=>this.events.emit("allPoolStatusChanged",a);this.allPoolStatusForwarders.set(A.name,s),A.events.on("allPoolStatusChanged",s),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 o=this.poolStatusForwarders.get(e);o&&A.events.off("poolStatusChanged",o),this.poolStatusForwarders.delete(e);let s=this.allPoolStatusForwarders.get(e);s&&A.events.off("allPoolStatusChanged",s),this.allPoolStatusForwarders.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",{slippageInDecimal: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 o=this.aggregators.filter(({name:t})=>this.activeAggregator.get(t)===true),s=[],a=[],c=o.map(async t=>{this._fetchingStatus.set(t.name,true),this.events.emit("aggregatorFetchStart",{name:t.name});try{let n=await t.fetchRoute(e,A?.abortSignal);s.push(n),A?.onRouteFound?.(n);}catch(n){let i={name:t.name,reason:n};a.push(i),A?.onError?.(i);}finally{this._fetchingStatus.set(t.name,false),this.events.emit("aggregatorFetchEnd",{name:t.name});}});return await Promise.all(c),{routes:s.sort((t,n)=>bignumber_js.BigNumber(n.formattedResult.coinOut.amount).comparedTo(t.formattedResult.coinOut.amount)??0),errors:a}}async buildRouteTransaction(e,A={}){let{mergeResult:o=true,txExtensionParams:s}=A,a=this.aggregatorMap.get(e.formattedResult.name);if(!a)throw new Error(`Aggregator ${e.formattedResult.name} not found in the aggregator list`);let{tx:c,coinOut:t}=await a.buildSwapTransaction({route:e,slippage:A.slippage??this.slippage,txExtensionParams:s}),n=e.formattedResult.coinOut.type;return o?(await E(c,t,this.client,n,this.walletAddress),{tx:c,coinOutType:n}):{tx:c,coinOut:t,coinOutType:n}}async executeSwapTransaction(e,A=false){return this.#e(),A?(e.setSender(this.walletAddress),this.suiKit.dryRunTxn(e)):this.suiKit.signAndSendTxn(e)}};var y=class extends f{constructor(e){super("cetus",e);let A=this.suiClient.network;this.client=new aggregatorSdk.AggregatorClient({endpoint:"https://api-sui.cetus.zone/router_v3/find_routes",signer:this.walletAddress,client:new jsonRpc.SuiJsonRpcClient({url:jsonRpc.getJsonRpcFullnodeUrl(A),network:A}),env:aggregatorSdk.Env.Mainnet}),this.poolsMap=new Map(aggregatorSdk.ALL_DEXES.map(o=>[o,true]));}createRoute(e,A,o){let s=[],a=null;for(let t of e)t.from===A&&(a={paths:[],coinIn:{type:t.from,amount:BigInt(t.amountIn)},coinOut:{type:t.target,amount:BigInt(t.amountOut)}},s.push(a)),a&&(a.paths.push({protocolName:t.provider,coinIn:{type:t.from,amount:BigInt(t.amountIn)},coinOut:{type:t.target,amount:BigInt(t.amountOut)}}),a.coinOut={type:t.target,amount:BigInt(t.amountOut)},t.target===o&&(a=null));let c=s.reduce((t,n)=>t+n.coinIn.amount,BigInt(0)).toString();return c!=="0"&&s.forEach(t=>{t.splitPercentage=bignumber_js.BigNumber(t.coinIn.amount.toString()).div(c).times(100).toNumber();}),s}parseRawToFormattedResult({routerData:e,coinInType:A,coinOutType:o}){return {coinIn:{type:A,amount:BigInt(e.amountIn.toString()??"0")},coinOut:{type:o,amount:BigInt(e.amountOut.toString()??"0")},routes:this.createRoute(e.paths,A,o)}}setFetchRouteSettings(e){this.fetchSettings=e;}calcSlippage(e){return e}async fetchRoute(e,A){this.validateClient();let o=this.normalizeFetchRouteParams(e),{coinInType:s,coinOutType:a,swapAmount:c}=o;this.rawRouteResult=void 0;let t=await this.withTimeout(this.client.findRouters({...this.fetchSettings,from:utils.normalizeStructTag(s),target:utils.normalizeStructTag(a),amount:new $__default.default(c.toString()),byAmountIn:true,providers:this.getEnabledPools()}),A);if(!t)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=t,{formattedResult:{...this.parseRawToFormattedResult({routerData:t,coinInType:s,coinOutType:a}),name:this.name},rawRouteResult:t}}async buildSwapTransaction(e){this.validateWalletAddress(),this.validateClient();let{txExtensionParams:A,slippage:o,route:s}=e,a=s?.rawRouteResult??this.rawRouteResult;if(!a)throw new Error(`${this.name} buildSwapTransaction requires a route, but none was provided or fetched.`);let c=null,t=null;if(A){let{initTx:i,coinIn:d}=A;c=i,t=d;}else c=new transactions.Transaction,c.setSender(this.walletAddress),t=await this.selectCoinInForSwap(c,BigInt(a.amountIn.toString()),utils.normalizeStructTag(a.paths[0].from));let n=await this.client.routerSwap({router:a,txb:c,slippage:this.calcSlippage(o),inputCoin:t});return {tx:c,coinOut:n}}};var Q={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]}'}},scallop:{objects:{version:"",afSuiMarket:"",coinDecimalsRegistry:"",xOracle:""}},nftAmm:{packages:{nftAmm:""},objects:{protocolFeeVault:"",treasury:"",insuranceFund:"",referralVault:""}},nfts:{packages:{mystenTransferPolicy:"0x0cb4bcc0560340eb1a1b929cabe56b33fc6449820ec8c1980d69bb98b649b802"}}};var w=()=>(...r)=>r;var i0=w()("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"),T=class extends f{afApi;constructor(e){super("aftermath",e);let A=this.suiClient.network;this.afApi=new aftermathTsSdk.AftermathApi(new jsonRpc.SuiJsonRpcClient({url:jsonRpc.getJsonRpcFullnodeUrl(A),network:A}),e.addresses??Q),this.client=new aftermathTsSdk.Aftermath("MAINNET",this.afApi),this.poolsMap=new Map(i0.map(o=>[o,true]));}get router(){return this.validateClient(),this.client.Router()}setFetchRouteSettings(e){this.fetchSettings=e;}calcSlippage(e){return e}parseRawRouteToFormattedResult(e){let A=e.coinIn.amount,o={...e,name:this.name};return o.routes.forEach(s=>{let a=s.paths[0].coinIn.amount;s.splitPercentage=bignumber_js.BigNumber(a.toString()).div(A.toString()).times(100).toNumber();}),o}async fetchRoute(e,A){let o=this.normalizeFetchRouteParams(e),{coinInType:s,coinOutType:a,swapAmount:c}=o;this.rawRouteResult=void 0;let t=await this.withTimeout(this.router.getCompleteTradeRouteGivenAmountIn({...this.fetchSettings,protocolWhitelist:this.getEnabledPools(),coinInType:s,coinOutType:a,coinInAmount:c},A));if(!t)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=t,{formattedResult:this.parseRawRouteToFormattedResult(t),rawRouteResult:t}}async buildSwapTransaction(e){this.validateWalletAddress();let{txExtensionParams:A,slippage:o,route:s}=e,a=s?.rawRouteResult??this.rawRouteResult;if(!a)throw new Error(`${this.name} build swap transaction failed: no route available`);let c=null,t=null;if(A){let{initTx:d,coinIn:u}=A;c=d,t=u;}else c=new suiKit.Transaction,c.setSender(this.walletAddress),t=await this.selectCoinInForSwap(c,BigInt(a.coinIn.amount.toString()),suiKit.normalizeStructTag(a.coinIn.type));let{tx:n,coinOutId:i}=await this.router.addTransactionForCompleteTradeRoute({walletAddress:this.walletAddress,completeRoute:a,slippage:this.calcSlippage(o),tx:c,coinInId:t});if(!i)throw new Error(`${this.name} build swap transaction failed`);return {tx:n,coinOut:i}}};var l0=w()("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"),V=class extends f{commission;constructor(e){super("7k",e),this.commission=e.commission??{partner:this.walletAddress,commissionBps:0};let A=this.suiClient.network;sdkTs.setSuiClient(new jsonRpc.SuiJsonRpcClient({url:jsonRpc.getJsonRpcFullnodeUrl(A),network:A})),this.poolsMap=new Map(l0.map(o=>[o,true]));}setSuiClient(e){super.setSuiClient(e);let A=e.network;sdkTs.setSuiClient(new jsonRpc.SuiJsonRpcClient({url:jsonRpc.getJsonRpcFullnodeUrl(A),network:A}));}setFetchRouteSettings(e){this.fetchSettings=e;}calcSlippage(e){return e}createRoute(e,A,o){let s=[];e.forEach((c,t)=>{s.push({paths:[],coinIn:{type:c.tokenIn,amount:BigInt(bignumber_js.BigNumber(c.tokenInAmount).multipliedBy(A).integerValue().toString())},coinOut:{type:c.tokenOut,amount:BigInt(bignumber_js.BigNumber(c.tokenOutAmount).multipliedBy(o).integerValue().toString())}}),c.hops.forEach(n=>{s[t].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(o).integerValue().toString())}});});});let a=s.reduce((c,t)=>c+t.coinIn.amount,BigInt(0)).toString();return s.forEach(c=>{c.splitPercentage=bignumber_js.BigNumber(c.coinIn.amount.toString()).div(a).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 o=this.normalizeFetchRouteParams(e),{coinInType:s,coinOutType:a,swapAmount:c}=o;this.rawRouteResult=void 0;let t=await this.withTimeout(sdkTs.getQuote({...this.fetchSettings,tokenIn:s,tokenOut:a,amountIn:c.toString(),sources:this.getEnabledPools()}),A);if(!t)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=t,{formattedResult:this.parseRawRouteToFormattedResult(t),rawRouteResult:t}}async buildSwapTransaction(e){this.validateWalletAddress();let{txExtensionParams:A,slippage:o,route:s}=e,a=s?.rawRouteResult??this.rawRouteResult;if(!a)throw new Error(`${this.name} build swap transaction failed: no route available`);let c=null,t=null;if(A){let{initTx:d,coinIn:u}=A;c=d,t=u;}else c=new suiKit.Transaction,c.setSender(this.walletAddress),t=await this.selectCoinInForSwap(c,BigInt(a.swapAmountWithDecimal),suiKit.normalizeStructTag(a.tokenIn));let{tx:n,coinOut:i}=await sdkTs.buildTx({quoteResponse:a,slippage:this.calcSlippage(o),commission:this.commission,accountAddress:this.walletAddress,extendTx:{tx:c,coinIn:t}});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 X=class extends f{client=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 bignumber_js.BigNumber(e).multipliedBy(1e6).integerValue().toNumber()}parseRawRouteToFormattedResult(e){let A=[];for(let o of e.routes)A.push({paths:o.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(o.amountIn??0)/Number(this.rawRouteResult?.amountIn??1)*100,coinIn:{amount:BigInt(o.amountIn.toString()),type:utils.normalizeStructTag(o.input.coinType)},coinOut:{amount:BigInt(o.amountOut.toString()),type:utils.normalizeStructTag(o.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){this.validateClient();let o=this.normalizeFetchRouteParams(e);this.rawRouteResult=void 0;let{coinInType:s,coinOutType:a,swapAmount:c}=o,t=await this.withTimeout(this.client.getRoutes({...this.fetchSettings,tokenIn:s,tokenOut:a,amountIn:c.toString(),commission:this.commission,includeSources:this.getEnabledPools()}),A);if(!t)throw new Error(`${this.name} fetch route returned empty response`);return this.rawRouteResult=t,{formattedResult:this.parseRawRouteToFormattedResult(t),rawRouteResult:t}}async buildSwapTransaction(e){this.validateWalletAddress();let{txExtensionParams:A,slippage:o,route:s}=e,a=s?.rawRouteResult??this.rawRouteResult;if(!a)throw new Error(`${this.name} build swap transaction failed: no route available`);let c=null,t=null;if(A){let{initTx:u,coinIn:U}=A;c=u,t=U;}else c=new transactions.Transaction,c.setSender(this.walletAddress),t=await this.selectCoinInForSwap(c,BigInt(a.amountIn.toString()),utils.normalizeStructTag(a.coinIn.coinType));let n=new sdk.TradeBuilder("mainnet",a.routes).sender(this.walletAddress).slippage(this.calcSlippage(o)).deadline(Date.now()+60*60*1e3),d=await(this.commission?n.commission(this.commission).build():n.build()).swap({client:new jsonRpc.SuiJsonRpcClient({network:this.suiClient.network,url:suiKit.getFullnodeUrl(this.suiClient.network)}),tx:c,coinIn:t});if(!d)throw new Error(`${this.name} build swap transaction failed`);return {tx:c,coinOut:d}}};
21
+
22
+ exports.AftermathSwap = T;
23
+ exports.Aggregator = F;
24
+ exports.CetusSwap = y;
25
+ exports.CoinMetadataRegistry = p;
26
+ exports.FlowXSwap = X;
27
+ exports.SwapSdkBase = f;
28
+ exports.TypedEventEmitter = b;
29
+ exports._7kSwap = V;
30
+ exports.isSuiType = B;
31
+ exports.mergeWithExistingOrTransfer = E;
32
+ exports.selectCoins = S;
33
+ exports.transformProperCase = g;
@@ -1,10 +1,11 @@
1
- import * as _mysten_sui_dist_cjs_client from '@mysten/sui/dist/cjs/client';
2
- import { SuiClient, CoinMetadata, SuiTransactionBlockResponse, DryRunTransactionBlockResponse, CoinStruct } from '@mysten/sui/client';
1
+ import * as _mysten_sui_client from '@mysten/sui/client';
2
+ import { BaseClient, SuiClientTypes } from '@mysten/sui/client';
3
3
  import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
4
+ import { SuiGrpcClient, GrpcTypes } from '@mysten/sui/grpc';
4
5
  import { EventEmitter } from 'events';
6
+ import * as node_modules__mysten_sui_dist_grpc_proto_sui_rpc_v2_state_service_mjs from 'node_modules/@mysten/sui/dist/grpc/proto/sui/rpc/v2/state_service.mjs';
5
7
  import * as _scallop_io_sui_kit from '@scallop-io/sui-kit';
6
- import { SuiKitParams, AccountManagerParams, Transaction as Transaction$1, TransactionObjectArgument as TransactionObjectArgument$1, SuiKit } from '@scallop-io/sui-kit';
7
- import * as _mysten_sui_dist_cjs_transactions from '@mysten/sui/dist/cjs/transactions';
8
+ import { SuiKitParams, AccountManagerParams, Transaction as Transaction$1, TransactionObjectArgument as TransactionObjectArgument$1, SuiKit, SuiTransactionBlockResponse, SimulateTransactionResponse } from '@scallop-io/sui-kit';
8
9
  import { RouterDataV3, FindRouterParams, AggregatorClient, AggregatorClientParams } from '@cetusprotocol/aggregator-sdk';
9
10
  export { AggregatorClient, RouterDataV3 } from '@cetusprotocol/aggregator-sdk';
10
11
  import * as aftermath_ts_sdk from 'aftermath-ts-sdk';
@@ -29,7 +30,7 @@ type SecretKeyOrMnemonicsOrWalletAddress = {
29
30
  secretKey?: never;
30
31
  };
31
32
  type SuiClientOrFullnodeUrl = {
32
- client?: SuiClient;
33
+ client?: SuiGrpcClient;
33
34
  fullnodeUrl?: never;
34
35
  } | {
35
36
  fullnodeUrl?: string;
@@ -100,7 +101,7 @@ type SwapBuildResult<MergeResult extends boolean> = MergeResult extends true ? {
100
101
  coinOut: TransactionObjectArgument;
101
102
  };
102
103
  interface SwapSdkConstructorParams<T> {
103
- suiClient?: SuiClient;
104
+ suiClient?: BaseClient;
104
105
  fetchTimeoutInMs?: number;
105
106
  walletAddress: string;
106
107
  fetchSettings?: T;
@@ -108,7 +109,7 @@ interface SwapSdkConstructorParams<T> {
108
109
  /**
109
110
  * Base interface for Swap SDK
110
111
  */
111
- interface SwapSdkBaseInterface<PoolType = string, RawRouteResultType = any, FetchRouteSettings = any, SdkClient = SuiClient> {
112
+ interface SwapSdkBaseInterface<PoolType = string, RawRouteResultType = any, FetchRouteSettings = any, SdkClient = BaseClient> {
112
113
  /**
113
114
  * SDK specific client
114
115
  */
@@ -137,7 +138,7 @@ interface SwapSdkBaseInterface<PoolType = string, RawRouteResultType = any, Fetc
137
138
  setFetchRouteSettings: (settings: FetchRouteSettings) => void;
138
139
  togglePoolStatus: (pool: PoolType, enabled?: boolean) => void;
139
140
  toggleAllPoolStatus: (enabled: boolean) => void;
140
- setSuiClient: (client: SuiClient) => void;
141
+ setSuiClient: (client: SuiGrpcClient) => void;
141
142
  setWalletAddress: (address: string) => void;
142
143
  /**
143
144
  * Calculate slippage for the specific protocol.
@@ -208,7 +209,7 @@ declare abstract class SwapSdkBase<PoolType = string, RawRouteResultType = any,
208
209
  readonly name: string;
209
210
  readonly events: TypedEventEmitter<SwapSdkEvents<PoolType>>;
210
211
  client?: SdkClient;
211
- suiClient: SuiClient;
212
+ suiClient: BaseClient;
212
213
  fetchTimeoutInMs?: number;
213
214
  walletAddress: string;
214
215
  fetchSettings?: FetchRouteSettings;
@@ -222,7 +223,7 @@ declare abstract class SwapSdkBase<PoolType = string, RawRouteResultType = any,
222
223
  client: SdkClient;
223
224
  };
224
225
  setWalletAddress(address: string): void;
225
- setSuiClient(client: SuiClient): void;
226
+ setSuiClient(client: BaseClient): void;
226
227
  abstract calcSlippage(slippageInDecimal: number): number;
227
228
  togglePoolStatus(pool: PoolType, enabled?: boolean): void;
228
229
  toggleAllPoolStatus(enabled: boolean): void;
@@ -230,14 +231,14 @@ declare abstract class SwapSdkBase<PoolType = string, RawRouteResultType = any,
230
231
  protected normalizeFetchRouteParams(params: FetchRouteParams): FetchRouteParams;
231
232
  protected withTimeout<T>(fn: Promise<T>, abortSignal?: AbortSignal): Promise<T>;
232
233
  selectCoinInForSwap(tx: Transaction, amount: bigint, coinType: string): Promise<{
233
- $kind: "NestedResult";
234
234
  NestedResult: [number, number];
235
+ $kind: "NestedResult";
235
236
  } | {
236
237
  $kind: "Input";
237
238
  Input: number;
238
239
  type?: "object";
239
240
  }>;
240
- protected selectCoins(coinType: string, amount: string): Promise<_mysten_sui_dist_cjs_client.CoinStruct[]>;
241
+ protected selectCoins(coinType: string, amount: string): Promise<_mysten_sui_client.SuiClientTypes.Coin[]>;
241
242
  abstract setFetchRouteSettings(settings: FetchRouteSettings): void;
242
243
  abstract fetchRoute(params: FetchRouteParams, abortSignal?: AbortSignal): Promise<FetchRouteResult<RawRouteResultType>>;
243
244
  abstract buildSwapTransaction(params: SwapParams<RawRouteResultType>): Promise<{
@@ -273,7 +274,7 @@ declare class CetusSwap extends SwapSdkBase<string, RouterDataV3, FetchRouteSett
273
274
  }>;
274
275
  buildSwapTransaction(params: SwapParams<RouterDataV3>): Promise<{
275
276
  tx: Transaction;
276
- coinOut: _mysten_sui_dist_cjs_transactions.TransactionObjectArgument;
277
+ coinOut: TransactionObjectArgument;
277
278
  }>;
278
279
  }
279
280
 
@@ -321,7 +322,7 @@ declare class _7kSwap extends SwapSdkBase<SourceDex, QuoteResponse, FetchRouteSe
321
322
  constructor(params: SwapSdkConstructorParams<FetchRouteSettings$1> & {
322
323
  commission?: Commission;
323
324
  });
324
- setSuiClient(client: SuiClient): void;
325
+ setSuiClient(client: BaseClient): void;
325
326
  setFetchRouteSettings(settings: FetchRouteSettings$1): void;
326
327
  calcSlippage(slippageInDecimal: number): number;
327
328
  private createRoute;
@@ -365,13 +366,13 @@ interface SdkRegistry {
365
366
  type SdkName = keyof SdkRegistry;
366
367
 
367
368
  declare class CoinMetadataRegistry {
368
- client: SuiClient;
369
+ client: SuiGrpcClient;
369
370
  private cache;
370
- constructor(client: SuiClient, initialData?: (CoinMetadata & {
371
+ constructor(client: SuiGrpcClient, initialData?: (GrpcTypes.CoinMetadata & {
371
372
  coinType: string;
372
373
  })[]);
373
- setClient(client: SuiClient): void;
374
- getCoinMetadata(coinType: string): Promise<CoinMetadata>;
374
+ setClient(client: SuiGrpcClient): void;
375
+ getCoinMetadata(coinType: string): Promise<GrpcTypes.CoinMetadata>;
375
376
  }
376
377
 
377
378
  type TxExt = {
@@ -395,7 +396,7 @@ declare class Aggregator {
395
396
  private poolStatusForwarders;
396
397
  private allPoolStatusForwarders;
397
398
  walletAddress: string;
398
- client: SuiClient;
399
+ client: SuiGrpcClient;
399
400
  constructor(params: AggregatorConstructorParams);
400
401
  private forwardPoolStatusChangeEvent;
401
402
  addAggregator(aggregator: SwapSdkBase[]): void;
@@ -423,9 +424,9 @@ declare class Aggregator {
423
424
  * @param timeoutInMs
424
425
  */
425
426
  setFetchTimeoutInMs(timeoutInMs: number): void;
426
- setSuiClient(client: SuiClient): void;
427
+ setSuiClient(client: SuiGrpcClient): void;
427
428
  setWalletAddress(address: string): void;
428
- getCoinMetadata(coinType: string): Promise<_mysten_sui_dist_cjs_client.CoinMetadata>;
429
+ getCoinMetadata(coinType: string): Promise<node_modules__mysten_sui_dist_grpc_proto_sui_rpc_v2_state_service_mjs.CoinMetadata>;
429
430
  /**
430
431
  * Fetch swap routes from all aggregators, and sort them by best output amount
431
432
  * @param params FetchRouteParams
@@ -449,13 +450,13 @@ declare class Aggregator {
449
450
  mergeResult: false;
450
451
  }): Promise<SwapBuildResult<false>>;
451
452
  executeSwapTransaction(tx: Transaction): Promise<SuiTransactionBlockResponse>;
452
- executeSwapTransaction(tx: Transaction, dryRun: true): Promise<DryRunTransactionBlockResponse>;
453
+ executeSwapTransaction(tx: Transaction, dryRun: true): Promise<SimulateTransactionResponse>;
453
454
  executeSwapTransaction(tx: Transaction, dryRun: false): Promise<SuiTransactionBlockResponse>;
454
455
  }
455
456
 
456
457
  declare const isSuiType: (coinType: string) => boolean;
457
- declare const selectCoins: (client: SuiClient, coinType: string, amount: string, owner: string) => Promise<CoinStruct[]>;
458
- declare const mergeWithExistingOrTransfer: (tx: Transaction, coin: TransactionObjectArgument, client: SuiClient, coinType: string, sender: string) => Promise<void>;
458
+ declare const selectCoins: (client: BaseClient, coinType: string, amount: string, owner: string) => Promise<SuiClientTypes.Coin[]>;
459
+ declare const mergeWithExistingOrTransfer: (tx: Transaction, coin: TransactionObjectArgument, client: SuiGrpcClient, coinType: string, sender: string) => Promise<void>;
459
460
  declare const transformProperCase: (provider: string) => string;
460
461
 
461
462
  export { type FetchRouteSettings$2 as AftermathFetchRouteSettings, AftermathSwap, Aggregator, type AggregatorConstructorParams, type AggregatorEvent, type AggregatorEvents, type AggregatorStatusEvent, type AllSwapSdkPoolStatusEvent, type FetchRouteSettings$3 as CetusFetchRouteSettings, CetusSwap, type Coin, CoinMetadataRegistry, type FetchRouteParams, type FetchRouteResult, type FetchRoutesOptions, type FetchRouteSettings as FlowXFetchRouteSettings, FlowXSwap, type FormattedRouteResult, type SdkName, type SdkRegistry, type SecretKeyOrMnemonicsOrWalletAddress, type SlippageChangedEvent, type SuiClientOrFullnodeUrl, type SwapBuildResult, type SwapCoinInfo, type SwapParams, type SwapPath, type SwapRoute, SwapSdkBase, type SwapSdkBaseInterface, type SwapSdkConstructorParams, type SwapSdkEvents, type SwapSdkPoolStatusEvent, TypedEventEmitter, type FetchRouteSettings$1 as _7kFetchRouteSettings, _7kSwap, isSuiType, mergeWithExistingOrTransfer, selectCoins, transformProperCase };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- import * as _mysten_sui_dist_cjs_client from '@mysten/sui/dist/cjs/client';
2
- import { SuiClient, CoinMetadata, SuiTransactionBlockResponse, DryRunTransactionBlockResponse, CoinStruct } from '@mysten/sui/client';
1
+ import * as _mysten_sui_client from '@mysten/sui/client';
2
+ import { BaseClient, SuiClientTypes } from '@mysten/sui/client';
3
3
  import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
4
+ import { SuiGrpcClient, GrpcTypes } from '@mysten/sui/grpc';
4
5
  import { EventEmitter } from 'events';
6
+ import * as node_modules__mysten_sui_dist_grpc_proto_sui_rpc_v2_state_service_mjs from 'node_modules/@mysten/sui/dist/grpc/proto/sui/rpc/v2/state_service.mjs';
5
7
  import * as _scallop_io_sui_kit from '@scallop-io/sui-kit';
6
- import { SuiKitParams, AccountManagerParams, Transaction as Transaction$1, TransactionObjectArgument as TransactionObjectArgument$1, SuiKit } from '@scallop-io/sui-kit';
7
- import * as _mysten_sui_dist_cjs_transactions from '@mysten/sui/dist/cjs/transactions';
8
+ import { SuiKitParams, AccountManagerParams, Transaction as Transaction$1, TransactionObjectArgument as TransactionObjectArgument$1, SuiKit, SuiTransactionBlockResponse, SimulateTransactionResponse } from '@scallop-io/sui-kit';
8
9
  import { RouterDataV3, FindRouterParams, AggregatorClient, AggregatorClientParams } from '@cetusprotocol/aggregator-sdk';
9
10
  export { AggregatorClient, RouterDataV3 } from '@cetusprotocol/aggregator-sdk';
10
11
  import * as aftermath_ts_sdk from 'aftermath-ts-sdk';
@@ -29,7 +30,7 @@ type SecretKeyOrMnemonicsOrWalletAddress = {
29
30
  secretKey?: never;
30
31
  };
31
32
  type SuiClientOrFullnodeUrl = {
32
- client?: SuiClient;
33
+ client?: SuiGrpcClient;
33
34
  fullnodeUrl?: never;
34
35
  } | {
35
36
  fullnodeUrl?: string;
@@ -100,7 +101,7 @@ type SwapBuildResult<MergeResult extends boolean> = MergeResult extends true ? {
100
101
  coinOut: TransactionObjectArgument;
101
102
  };
102
103
  interface SwapSdkConstructorParams<T> {
103
- suiClient?: SuiClient;
104
+ suiClient?: BaseClient;
104
105
  fetchTimeoutInMs?: number;
105
106
  walletAddress: string;
106
107
  fetchSettings?: T;
@@ -108,7 +109,7 @@ interface SwapSdkConstructorParams<T> {
108
109
  /**
109
110
  * Base interface for Swap SDK
110
111
  */
111
- interface SwapSdkBaseInterface<PoolType = string, RawRouteResultType = any, FetchRouteSettings = any, SdkClient = SuiClient> {
112
+ interface SwapSdkBaseInterface<PoolType = string, RawRouteResultType = any, FetchRouteSettings = any, SdkClient = BaseClient> {
112
113
  /**
113
114
  * SDK specific client
114
115
  */
@@ -137,7 +138,7 @@ interface SwapSdkBaseInterface<PoolType = string, RawRouteResultType = any, Fetc
137
138
  setFetchRouteSettings: (settings: FetchRouteSettings) => void;
138
139
  togglePoolStatus: (pool: PoolType, enabled?: boolean) => void;
139
140
  toggleAllPoolStatus: (enabled: boolean) => void;
140
- setSuiClient: (client: SuiClient) => void;
141
+ setSuiClient: (client: SuiGrpcClient) => void;
141
142
  setWalletAddress: (address: string) => void;
142
143
  /**
143
144
  * Calculate slippage for the specific protocol.
@@ -208,7 +209,7 @@ declare abstract class SwapSdkBase<PoolType = string, RawRouteResultType = any,
208
209
  readonly name: string;
209
210
  readonly events: TypedEventEmitter<SwapSdkEvents<PoolType>>;
210
211
  client?: SdkClient;
211
- suiClient: SuiClient;
212
+ suiClient: BaseClient;
212
213
  fetchTimeoutInMs?: number;
213
214
  walletAddress: string;
214
215
  fetchSettings?: FetchRouteSettings;
@@ -222,7 +223,7 @@ declare abstract class SwapSdkBase<PoolType = string, RawRouteResultType = any,
222
223
  client: SdkClient;
223
224
  };
224
225
  setWalletAddress(address: string): void;
225
- setSuiClient(client: SuiClient): void;
226
+ setSuiClient(client: BaseClient): void;
226
227
  abstract calcSlippage(slippageInDecimal: number): number;
227
228
  togglePoolStatus(pool: PoolType, enabled?: boolean): void;
228
229
  toggleAllPoolStatus(enabled: boolean): void;
@@ -230,14 +231,14 @@ declare abstract class SwapSdkBase<PoolType = string, RawRouteResultType = any,
230
231
  protected normalizeFetchRouteParams(params: FetchRouteParams): FetchRouteParams;
231
232
  protected withTimeout<T>(fn: Promise<T>, abortSignal?: AbortSignal): Promise<T>;
232
233
  selectCoinInForSwap(tx: Transaction, amount: bigint, coinType: string): Promise<{
233
- $kind: "NestedResult";
234
234
  NestedResult: [number, number];
235
+ $kind: "NestedResult";
235
236
  } | {
236
237
  $kind: "Input";
237
238
  Input: number;
238
239
  type?: "object";
239
240
  }>;
240
- protected selectCoins(coinType: string, amount: string): Promise<_mysten_sui_dist_cjs_client.CoinStruct[]>;
241
+ protected selectCoins(coinType: string, amount: string): Promise<_mysten_sui_client.SuiClientTypes.Coin[]>;
241
242
  abstract setFetchRouteSettings(settings: FetchRouteSettings): void;
242
243
  abstract fetchRoute(params: FetchRouteParams, abortSignal?: AbortSignal): Promise<FetchRouteResult<RawRouteResultType>>;
243
244
  abstract buildSwapTransaction(params: SwapParams<RawRouteResultType>): Promise<{
@@ -273,7 +274,7 @@ declare class CetusSwap extends SwapSdkBase<string, RouterDataV3, FetchRouteSett
273
274
  }>;
274
275
  buildSwapTransaction(params: SwapParams<RouterDataV3>): Promise<{
275
276
  tx: Transaction;
276
- coinOut: _mysten_sui_dist_cjs_transactions.TransactionObjectArgument;
277
+ coinOut: TransactionObjectArgument;
277
278
  }>;
278
279
  }
279
280
 
@@ -321,7 +322,7 @@ declare class _7kSwap extends SwapSdkBase<SourceDex, QuoteResponse, FetchRouteSe
321
322
  constructor(params: SwapSdkConstructorParams<FetchRouteSettings$1> & {
322
323
  commission?: Commission;
323
324
  });
324
- setSuiClient(client: SuiClient): void;
325
+ setSuiClient(client: BaseClient): void;
325
326
  setFetchRouteSettings(settings: FetchRouteSettings$1): void;
326
327
  calcSlippage(slippageInDecimal: number): number;
327
328
  private createRoute;
@@ -365,13 +366,13 @@ interface SdkRegistry {
365
366
  type SdkName = keyof SdkRegistry;
366
367
 
367
368
  declare class CoinMetadataRegistry {
368
- client: SuiClient;
369
+ client: SuiGrpcClient;
369
370
  private cache;
370
- constructor(client: SuiClient, initialData?: (CoinMetadata & {
371
+ constructor(client: SuiGrpcClient, initialData?: (GrpcTypes.CoinMetadata & {
371
372
  coinType: string;
372
373
  })[]);
373
- setClient(client: SuiClient): void;
374
- getCoinMetadata(coinType: string): Promise<CoinMetadata>;
374
+ setClient(client: SuiGrpcClient): void;
375
+ getCoinMetadata(coinType: string): Promise<GrpcTypes.CoinMetadata>;
375
376
  }
376
377
 
377
378
  type TxExt = {
@@ -395,7 +396,7 @@ declare class Aggregator {
395
396
  private poolStatusForwarders;
396
397
  private allPoolStatusForwarders;
397
398
  walletAddress: string;
398
- client: SuiClient;
399
+ client: SuiGrpcClient;
399
400
  constructor(params: AggregatorConstructorParams);
400
401
  private forwardPoolStatusChangeEvent;
401
402
  addAggregator(aggregator: SwapSdkBase[]): void;
@@ -423,9 +424,9 @@ declare class Aggregator {
423
424
  * @param timeoutInMs
424
425
  */
425
426
  setFetchTimeoutInMs(timeoutInMs: number): void;
426
- setSuiClient(client: SuiClient): void;
427
+ setSuiClient(client: SuiGrpcClient): void;
427
428
  setWalletAddress(address: string): void;
428
- getCoinMetadata(coinType: string): Promise<_mysten_sui_dist_cjs_client.CoinMetadata>;
429
+ getCoinMetadata(coinType: string): Promise<node_modules__mysten_sui_dist_grpc_proto_sui_rpc_v2_state_service_mjs.CoinMetadata>;
429
430
  /**
430
431
  * Fetch swap routes from all aggregators, and sort them by best output amount
431
432
  * @param params FetchRouteParams
@@ -449,13 +450,13 @@ declare class Aggregator {
449
450
  mergeResult: false;
450
451
  }): Promise<SwapBuildResult<false>>;
451
452
  executeSwapTransaction(tx: Transaction): Promise<SuiTransactionBlockResponse>;
452
- executeSwapTransaction(tx: Transaction, dryRun: true): Promise<DryRunTransactionBlockResponse>;
453
+ executeSwapTransaction(tx: Transaction, dryRun: true): Promise<SimulateTransactionResponse>;
453
454
  executeSwapTransaction(tx: Transaction, dryRun: false): Promise<SuiTransactionBlockResponse>;
454
455
  }
455
456
 
456
457
  declare const isSuiType: (coinType: string) => boolean;
457
- declare const selectCoins: (client: SuiClient, coinType: string, amount: string, owner: string) => Promise<CoinStruct[]>;
458
- declare const mergeWithExistingOrTransfer: (tx: Transaction, coin: TransactionObjectArgument, client: SuiClient, coinType: string, sender: string) => Promise<void>;
458
+ declare const selectCoins: (client: BaseClient, coinType: string, amount: string, owner: string) => Promise<SuiClientTypes.Coin[]>;
459
+ declare const mergeWithExistingOrTransfer: (tx: Transaction, coin: TransactionObjectArgument, client: SuiGrpcClient, coinType: string, sender: string) => Promise<void>;
459
460
  declare const transformProperCase: (provider: string) => string;
460
461
 
461
462
  export { type FetchRouteSettings$2 as AftermathFetchRouteSettings, AftermathSwap, Aggregator, type AggregatorConstructorParams, type AggregatorEvent, type AggregatorEvents, type AggregatorStatusEvent, type AllSwapSdkPoolStatusEvent, type FetchRouteSettings$3 as CetusFetchRouteSettings, CetusSwap, type Coin, CoinMetadataRegistry, type FetchRouteParams, type FetchRouteResult, type FetchRoutesOptions, type FetchRouteSettings as FlowXFetchRouteSettings, FlowXSwap, type FormattedRouteResult, type SdkName, type SdkRegistry, type SecretKeyOrMnemonicsOrWalletAddress, type SlippageChangedEvent, type SuiClientOrFullnodeUrl, type SwapBuildResult, type SwapCoinInfo, type SwapParams, type SwapPath, type SwapRoute, SwapSdkBase, type SwapSdkBaseInterface, type SwapSdkConstructorParams, type SwapSdkEvents, type SwapSdkPoolStatusEvent, TypedEventEmitter, type FetchRouteSettings$1 as _7kFetchRouteSettings, _7kSwap, isSuiType, mergeWithExistingOrTransfer, selectCoins, transformProperCase };