@7kprotocol/sdk-ts 3.4.2-beta.9 → 3.5.0

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.
@@ -54,7 +54,7 @@ class MetaAg {
54
54
  constructor(options) {
55
55
  this.providers = {};
56
56
  this.options = {
57
- providers: options?.providers ?? DEFAULT_PROVIDERS,
57
+ providers: { ...DEFAULT_PROVIDERS, ...options?.providers },
58
58
  slippageBps: options?.slippageBps ?? 100,
59
59
  fullnodeUrl: options?.fullnodeUrl ?? (0, client_1.getFullnodeUrl)("mainnet"),
60
60
  hermesApi: options?.hermesApi ?? HERMES_API,
@@ -73,14 +73,13 @@ class MetaAg {
73
73
  return p;
74
74
  const providerOptions = this.options.providers[provider];
75
75
  (0, condition_1.assert)(!!providerOptions, `Provider not found: ${provider}`);
76
- // eslint-disable-next-line no-case-declarations
77
76
  switch (provider) {
78
77
  case metaAg_1.EProvider.BLUEFIN7K:
79
78
  this.providers[metaAg_1.EProvider.BLUEFIN7K] = new bluefin_1.BluefinProvider(providerOptions, this.options, this.client);
80
79
  break;
81
80
  case metaAg_1.EProvider.FLOWX:
82
81
  const { FlowxProvider } = await Promise.resolve().then(() => __importStar(require("./providers/flowx"))).catch(catchImportError(metaAg_1.EProvider.FLOWX));
83
- this.providers[metaAg_1.EProvider.FLOWX] = new FlowxProvider(providerOptions, this.options, this.client);
82
+ this.providers[metaAg_1.EProvider.FLOWX] = new FlowxProvider(providerOptions, this.client);
84
83
  break;
85
84
  case metaAg_1.EProvider.CETUS:
86
85
  const { CetusProvider } = await Promise.resolve().then(() => __importStar(require("./providers/cetus"))).catch(catchImportError(metaAg_1.EProvider.CETUS));
@@ -127,7 +126,12 @@ class MetaAg {
127
126
  }
128
127
  }
129
128
  async _quote(provider, options, simulation) {
130
- const quote = await timeout(() => provider.quote(options), options.timeout ?? 2000, `quote for ${provider.kind} provider from ${options.coinInType} to ${options.coinOutType}`);
129
+ const quote = await timeout(async () => {
130
+ const quote = await provider.quote(options);
131
+ const { expectedAmount } = (0, buildTx_1.getExpectedReturn)(quote.rawAmountOut, 0, this.options.partnerCommissionBps, this.options.tipBps);
132
+ quote.amountOut = expectedAmount;
133
+ return quote;
134
+ }, options.timeout ?? 2000, `quote for ${provider.kind} provider from ${options.coinInType} to ${options.coinOutType}`);
131
135
  if (simulation) {
132
136
  if (simulation.onSimulated) {
133
137
  this._simulate(provider, quote, simulation).then((payload) => {
@@ -156,7 +160,9 @@ class MetaAg {
156
160
  coinInType: (0, utils_1.normalizeStructTag)(options.coinInType),
157
161
  coinOutType: (0, utils_1.normalizeStructTag)(options.coinOutType),
158
162
  };
159
- const quotes = await Promise.allSettled(Object.keys(this.options.providers).map(async (provider) => {
163
+ const quotes = await Promise.allSettled(Object.entries(this.options.providers)
164
+ .filter(([_k, v]) => !v.disabled)
165
+ .map(async ([provider]) => {
160
166
  const p = await this._getProvider(provider);
161
167
  return this._quote(p, opts, simulation);
162
168
  }));
@@ -223,8 +229,7 @@ exports.MetaAg = MetaAg;
223
229
  */
224
230
  const metaSettle = (quote, coinOut, slippageBps = 100, tipBps = 0, partner, commissionBps = 0) => {
225
231
  return (tx) => {
226
- const { minAmount, expectedAmount } = (0, buildTx_1.getExpectedReturn)(quote.rawAmountOut, slippageBps, commissionBps, // use for calculate expected amount out
227
- tipBps);
232
+ const { minAmount, expectedAmount } = (0, buildTx_1.getExpectedReturn)(quote.rawAmountOut, slippageBps, commissionBps, tipBps);
228
233
  if (tipBps > 0) {
229
234
  tx.moveCall({
230
235
  target: `${_7k_1._7K_META_PUBLISHED_AT}::vault::collect_tip`,
@@ -248,7 +253,7 @@ const metaSettle = (quote, coinOut, slippageBps = 100, tipBps = 0, partner, comm
248
253
  tx.pure.u64(minAmount),
249
254
  tx.pure.u64(expectedAmount),
250
255
  tx.pure.option("address", partner),
251
- tx.pure.u64(0), // commission must be 0 since all integrated aggregators already charge commission fee for partner
256
+ tx.pure.u64(commissionBps),
252
257
  tx.pure.u64(0), // ps
253
258
  ],
254
259
  });
@@ -8,7 +8,6 @@ const apiEndpoints_1 = require("../../../constants/apiEndpoints");
8
8
  const sui_1 = require("../../../constants/sui");
9
9
  const metaAg_1 = require("../../../types/metaAg");
10
10
  const condition_1 = require("../../../utils/condition");
11
- const buildTx_1 = require("../../swap/buildTx");
12
11
  const buildTxV2_1 = require("../../swap/buildTxV2");
13
12
  const getQuote_1 = require("../../swap/getQuote");
14
13
  const WORMHOLE_STATE_ID = "0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c";
@@ -37,14 +36,13 @@ class BluefinProvider {
37
36
  excludedPools: this.options.excludedPools,
38
37
  targetPools: this.options.targetPools,
39
38
  });
40
- const { expectedAmount } = (0, buildTx_1.getExpectedReturn)(quote.returnAmountWithDecimal.toString(), 0, this.metaOptions.partnerCommissionBps ?? 0, this.metaOptions.tipBps ?? 0);
41
39
  return {
42
40
  id: (0, uuid_1.v4)(),
43
41
  provider: metaAg_1.EProvider.BLUEFIN7K,
44
42
  quote,
45
43
  amountIn: quote.swapAmountWithDecimal,
46
44
  rawAmountOut: quote.returnAmountWithDecimal,
47
- amountOut: expectedAmount,
45
+ amountOut: quote.returnAmountWithDecimal,
48
46
  coinTypeIn: options.coinInType,
49
47
  coinTypeOut: options.coinOutType,
50
48
  };
@@ -55,8 +53,8 @@ class BluefinProvider {
55
53
  quoteResponse: quote.quote,
56
54
  accountAddress: signer,
57
55
  commission: {
58
- commissionBps: this.metaOptions.partnerCommissionBps ?? 0,
59
- partner: this.metaOptions.partner ?? sui_1.SUI_ADDRESS_ZERO,
56
+ commissionBps: 0,
57
+ partner: sui_1.SUI_ADDRESS_ZERO,
60
58
  },
61
59
  slippage: 1,
62
60
  extendTx: {
@@ -5,18 +5,12 @@ const aggregator_sdk_1 = require("@cetusprotocol/aggregator-sdk");
5
5
  const uuid_1 = require("uuid");
6
6
  const metaAg_1 = require("../../../types/metaAg");
7
7
  const condition_1 = require("../../../utils/condition");
8
- const buildTx_1 = require("../../swap/buildTx");
9
8
  class CetusProvider {
10
9
  constructor(options, metaOptions, client) {
11
10
  this.options = options;
12
- this.metaOptions = metaOptions;
13
11
  this.kind = metaAg_1.EProvider.CETUS;
14
12
  this.cetusClient = new aggregator_sdk_1.AggregatorClient({
15
13
  apiKey: options.apiKey,
16
- overlayFeeReceiver: metaOptions.partner,
17
- overlayFeeRate: metaOptions.partnerCommissionBps
18
- ? metaOptions.partnerCommissionBps / 10000
19
- : undefined,
20
14
  client,
21
15
  endpoint: options.api,
22
16
  env: aggregator_sdk_1.Env.Mainnet,
@@ -37,18 +31,13 @@ class CetusProvider {
37
31
  liquidityChanges: this.options.liquidityChanges,
38
32
  });
39
33
  (0, condition_1.assert)(!!quote, "No quote found");
40
- const bps = BigInt(this.metaOptions.partnerCommissionBps ?? 0);
41
- // calc amount out before any commission fees
42
- const amountOut = ((BigInt(quote.amountOut.toString()) * 10000n) /
43
- (10000n - bps)).toString();
44
- const { expectedAmount } = (0, buildTx_1.getExpectedReturn)(amountOut, 0, this.metaOptions.partnerCommissionBps ?? 0, this.metaOptions.tipBps ?? 0);
45
34
  return {
46
35
  id: (0, uuid_1.v4)(),
47
36
  provider: metaAg_1.EProvider.CETUS,
48
37
  quote,
49
- amountIn: quote.amountIn.toString(),
50
- rawAmountOut: amountOut,
51
- amountOut: expectedAmount,
38
+ amountIn: quote.amountIn.toString() || "0",
39
+ rawAmountOut: quote.amountOut.toString() || "0",
40
+ amountOut: quote.amountOut.toString() || "0",
52
41
  coinTypeIn: quoteOptions.coinInType,
53
42
  coinTypeOut: quoteOptions.coinOutType,
54
43
  };
@@ -5,11 +5,9 @@ const sdk_1 = require("@flowx-finance/sdk");
5
5
  const uuid_1 = require("uuid");
6
6
  const metaAg_1 = require("../../../types/metaAg");
7
7
  const condition_1 = require("../../../utils/condition");
8
- const buildTx_1 = require("../../swap/buildTx");
9
8
  class FlowxProvider {
10
- constructor(options, metaOptions, client) {
9
+ constructor(options, client) {
11
10
  this.options = options;
12
- this.metaOptions = metaOptions;
13
11
  this.client = client;
14
12
  this.kind = metaAg_1.EProvider.FLOWX;
15
13
  this.quoter = new sdk_1.AggregatorQuoter("mainnet", options.apiKey);
@@ -25,14 +23,13 @@ class FlowxProvider {
25
23
  maxHops: this.options.maxHops,
26
24
  splitDistributionPercent: this.options.splitDistributionPercent,
27
25
  });
28
- const { expectedAmount } = (0, buildTx_1.getExpectedReturn)(quote.amountOut?.toString() ?? "0", 0, this.metaOptions.partnerCommissionBps ?? 0, this.metaOptions.tipBps ?? 0);
29
26
  return {
30
27
  id: (0, uuid_1.v4)(),
31
28
  provider: metaAg_1.EProvider.FLOWX,
32
29
  quote: quote,
33
30
  amountIn: quote.amountIn?.toString() ?? "0",
34
31
  rawAmountOut: quote.amountOut?.toString() ?? "0",
35
- amountOut: expectedAmount,
32
+ amountOut: quote.amountOut?.toString() ?? "0",
36
33
  coinTypeIn: quoteOptions.coinInType,
37
34
  coinTypeOut: quoteOptions.coinOutType,
38
35
  };
@@ -40,9 +37,6 @@ class FlowxProvider {
40
37
  async swap(options) {
41
38
  (0, condition_1.assert)(options.quote.provider === metaAg_1.EProvider.FLOWX, "Invalid quote");
42
39
  const builder = new sdk_1.TradeBuilder("mainnet", options.quote.quote.routes);
43
- if (this.metaOptions.partner) {
44
- builder.commission(new sdk_1.Commission(this.metaOptions.partner, options.quote.quote.coinOut, sdk_1.CommissionType.PERCENTAGE, (this.metaOptions.partnerCommissionBps ?? 0) * 100, true));
45
- }
46
40
  builder.sender(options.signer);
47
41
  builder.slippage(10000 * 100);
48
42
  const res = await builder.build().swap({
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAY,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAGL,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAML,aAAa,EACb,SAAS,EACT,gBAAgB,EA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,CACR,OAAO,EAAE,eAAe,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,yBAAyB,CAAC;IAkBrC;;;OAGG;IACH,mBAAmB,CAAC,OAAO,EAAE,aAAa;CA4B3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"bluefin.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/bluefin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAU/C,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAS/B,qBAAa,eAAgB,YAAW,UAAU;IAG9C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAH9B,IAAI,YAAuB;gBAER,OAAO,EAAE,sBAAsB,EAC/B,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,EACrD,MAAM,EAAE,SAAS;IAeb,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IA4BpD,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,eAAe;CAiB1D"}
1
+ {"version":3,"file":"bluefin.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/bluefin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAU/C,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAQ/B,qBAAa,eAAgB,YAAW,UAAU;IAG9C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAH9B,IAAI,YAAuB;gBAER,OAAO,EAAE,sBAAsB,EAC/B,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,EACrD,MAAM,EAAE,SAAS;IAeb,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAsBpD,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,eAAe;CAiB1D"}
@@ -3,7 +3,6 @@ import { TransactionObjectArgument } from "@mysten/sui/transactions";
3
3
  import { AgProvider, CetusProviderOptions, EProvider, MetaAgOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions } from "../../../types/metaAg";
4
4
  export declare class CetusProvider implements AgProvider {
5
5
  private readonly options;
6
- private readonly metaOptions;
7
6
  kind: EProvider;
8
7
  private readonly cetusClient;
9
8
  constructor(options: CetusProviderOptions, metaOptions: MetaAgOptions, client: SuiClient);
@@ -1 +1 @@
1
- {"version":3,"file":"cetus.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/cetus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAI/B,qBAAa,aAAc,YAAW,UAAU;IAI5C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAJ9B,IAAI,YAAmB;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;gBAE5B,OAAO,EAAE,oBAAoB,EAC7B,WAAW,EAAE,aAAa,EAC3C,MAAM,EAAE,SAAS;IAeb,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAsCzD,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAUzE"}
1
+ {"version":3,"file":"cetus.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/cetus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,aAAc,YAAW,UAAU;IAI5C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAH1B,IAAI,YAAmB;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;gBAE5B,OAAO,EAAE,oBAAoB,EAC9C,WAAW,EAAE,aAAa,EAC1B,MAAM,EAAE,SAAS;IAWb,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IA0BzD,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAUzE"}
@@ -1,13 +1,12 @@
1
1
  import { SuiClient } from "@mysten/sui/client";
2
2
  import { TransactionObjectArgument } from "@mysten/sui/transactions";
3
- import { AgProvider, EProvider, FlowxProviderOptions, MetaAgOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions } from "../../../types/metaAg";
3
+ import { AgProvider, EProvider, FlowxProviderOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions } from "../../../types/metaAg";
4
4
  export declare class FlowxProvider implements AgProvider {
5
5
  private readonly options;
6
- private readonly metaOptions;
7
6
  private readonly client;
8
7
  kind: EProvider;
9
8
  private quoter;
10
- constructor(options: FlowxProviderOptions, metaOptions: MetaAgOptions, client: SuiClient);
9
+ constructor(options: FlowxProviderOptions, client: SuiClient);
11
10
  quote(quoteOptions: MetaQuoteOptions): Promise<MetaQuote>;
12
11
  swap(options: MetaSwapOptions): Promise<TransactionObjectArgument>;
13
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"flowx.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/flowx.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EACL,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAI/B,qBAAa,aAAc,YAAW,UAAU;IAI5C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IALzB,IAAI,YAAmB;IACvB,OAAO,CAAC,MAAM,CAAmB;gBAEd,OAAO,EAAE,oBAAoB,EAC7B,WAAW,EAAE,aAAa,EAC1B,MAAM,EAAE,SAAS;IAK9B,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IA6BzD,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAuBzE"}
1
+ {"version":3,"file":"flowx.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/flowx.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EACL,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,aAAc,YAAW,UAAU;IAI5C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJzB,IAAI,YAAmB;IACvB,OAAO,CAAC,MAAM,CAAmB;gBAEd,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,SAAS;IAK9B,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAuBzD,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAYzE"}
@@ -8,32 +8,31 @@ export declare enum EProvider {
8
8
  CETUS = "cetus",
9
9
  FLOWX = "flowx"
10
10
  }
11
- export type BluefinProviderOptions = {
11
+ type ProviderBaseOptions = {
12
+ api?: string;
13
+ apiKey?: string;
14
+ disabled?: boolean;
15
+ };
16
+ export type BluefinProviderOptions = ProviderBaseOptions & {
12
17
  sources?: SourceDex[];
13
18
  maxPaths?: number;
14
19
  excludedPools?: string[];
15
20
  targetPools?: string[];
16
- api?: string;
17
- apiKey?: string;
18
21
  };
19
- export type FlowxProviderOptions = {
22
+ export type FlowxProviderOptions = ProviderBaseOptions & {
20
23
  sources?: Protocol[];
21
24
  excludePools?: string[];
22
25
  excludeSources?: Protocol[];
23
26
  maxHops?: number;
24
27
  splitDistributionPercent?: number;
25
- api?: string;
26
- apiKey?: string;
27
28
  };
28
- export type CetusProviderOptions = {
29
+ export type CetusProviderOptions = ProviderBaseOptions & {
29
30
  sources?: string[];
30
31
  splitCount?: number;
31
32
  splitAlgorithm?: string;
32
33
  splitFactor?: number;
33
34
  depth?: number;
34
35
  liquidityChanges?: PreSwapLpChangeParams[];
35
- api?: string;
36
- apiKey?: string;
37
36
  };
38
37
  export interface MetaAgOptions {
39
38
  /**If not specified, all providers will be used */
@@ -124,4 +123,5 @@ export declare abstract class AgProvider {
124
123
  abstract quote(quoteOptions: MetaQuoteOptions): Promise<MetaQuote>;
125
124
  abstract swap(options: MetaSwapOptions): Promise<TransactionObjectArgument>;
126
125
  }
126
+ export {};
127
127
  //# sourceMappingURL=metaAg.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metaAg.d.ts","source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,mDAAmD;IACnD,EAAE,EAAE,WAAW,CAAC;IAChB;;iEAE6D;IAC7D,MAAM,EAAE,yBAAyB,CAAC;CACnC;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,CACtC,UAAU,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAC1C,CAAC;AACF,MAAM,MAAM,SAAS,GAAG,CACpB;IACE,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC;IAC9B,KAAK,EAAE,aAAa,CAAC;CACtB,GACD;IACE,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC;IAC1B,KAAK,EAAE,YAAY,CAAC;CACrB,GACD;IACE,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC;IAC1B,KAAK,EAAE,kBAAkB,CAAC;CAC3B,CACJ,GAAG;IACF,6GAA6G;IAC7G,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8DAA8D;IAC9D,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AACF,8BAAsB,UAAU;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAClE,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAC5E"}
@@ -21,7 +21,7 @@ export class MetaAg {
21
21
  options;
22
22
  constructor(options) {
23
23
  this.options = {
24
- providers: options?.providers ?? DEFAULT_PROVIDERS,
24
+ providers: { ...DEFAULT_PROVIDERS, ...options?.providers },
25
25
  slippageBps: options?.slippageBps ?? 100,
26
26
  fullnodeUrl: options?.fullnodeUrl ?? getFullnodeUrl("mainnet"),
27
27
  hermesApi: options?.hermesApi ?? HERMES_API,
@@ -40,14 +40,13 @@ export class MetaAg {
40
40
  return p;
41
41
  const providerOptions = this.options.providers[provider];
42
42
  assert(!!providerOptions, `Provider not found: ${provider}`);
43
- // eslint-disable-next-line no-case-declarations
44
43
  switch (provider) {
45
44
  case EProvider.BLUEFIN7K:
46
45
  this.providers[EProvider.BLUEFIN7K] = new BluefinProvider(providerOptions, this.options, this.client);
47
46
  break;
48
47
  case EProvider.FLOWX:
49
48
  const { FlowxProvider } = await import("./providers/flowx").catch(catchImportError(EProvider.FLOWX));
50
- this.providers[EProvider.FLOWX] = new FlowxProvider(providerOptions, this.options, this.client);
49
+ this.providers[EProvider.FLOWX] = new FlowxProvider(providerOptions, this.client);
51
50
  break;
52
51
  case EProvider.CETUS:
53
52
  const { CetusProvider } = await import("./providers/cetus").catch(catchImportError(EProvider.CETUS));
@@ -94,7 +93,12 @@ export class MetaAg {
94
93
  }
95
94
  }
96
95
  async _quote(provider, options, simulation) {
97
- const quote = await timeout(() => provider.quote(options), options.timeout ?? 2000, `quote for ${provider.kind} provider from ${options.coinInType} to ${options.coinOutType}`);
96
+ const quote = await timeout(async () => {
97
+ const quote = await provider.quote(options);
98
+ const { expectedAmount } = getExpectedReturn(quote.rawAmountOut, 0, this.options.partnerCommissionBps, this.options.tipBps);
99
+ quote.amountOut = expectedAmount;
100
+ return quote;
101
+ }, options.timeout ?? 2000, `quote for ${provider.kind} provider from ${options.coinInType} to ${options.coinOutType}`);
98
102
  if (simulation) {
99
103
  if (simulation.onSimulated) {
100
104
  this._simulate(provider, quote, simulation).then((payload) => {
@@ -123,7 +127,9 @@ export class MetaAg {
123
127
  coinInType: normalizeStructTag(options.coinInType),
124
128
  coinOutType: normalizeStructTag(options.coinOutType),
125
129
  };
126
- const quotes = await Promise.allSettled(Object.keys(this.options.providers).map(async (provider) => {
130
+ const quotes = await Promise.allSettled(Object.entries(this.options.providers)
131
+ .filter(([_k, v]) => !v.disabled)
132
+ .map(async ([provider]) => {
127
133
  const p = await this._getProvider(provider);
128
134
  return this._quote(p, opts, simulation);
129
135
  }));
@@ -189,8 +195,7 @@ export class MetaAg {
189
195
  */
190
196
  const metaSettle = (quote, coinOut, slippageBps = 100, tipBps = 0, partner, commissionBps = 0) => {
191
197
  return (tx) => {
192
- const { minAmount, expectedAmount } = getExpectedReturn(quote.rawAmountOut, slippageBps, commissionBps, // use for calculate expected amount out
193
- tipBps);
198
+ const { minAmount, expectedAmount } = getExpectedReturn(quote.rawAmountOut, slippageBps, commissionBps, tipBps);
194
199
  if (tipBps > 0) {
195
200
  tx.moveCall({
196
201
  target: `${_7K_META_PUBLISHED_AT}::vault::collect_tip`,
@@ -214,7 +219,7 @@ const metaSettle = (quote, coinOut, slippageBps = 100, tipBps = 0, partner, comm
214
219
  tx.pure.u64(minAmount),
215
220
  tx.pure.u64(expectedAmount),
216
221
  tx.pure.option("address", partner),
217
- tx.pure.u64(0), // commission must be 0 since all integrated aggregators already charge commission fee for partner
222
+ tx.pure.u64(commissionBps),
218
223
  tx.pure.u64(0), // ps
219
224
  ],
220
225
  });
@@ -5,7 +5,6 @@ import { API_ENDPOINTS } from "../../../constants/apiEndpoints";
5
5
  import { SUI_ADDRESS_ZERO } from "../../../constants/sui";
6
6
  import { EProvider, } from "../../../types/metaAg";
7
7
  import { assert } from "../../../utils/condition";
8
- import { getExpectedReturn } from "../../swap/buildTx";
9
8
  import { buildTxV2 } from "../../swap/buildTxV2";
10
9
  import { getQuote } from "../../swap/getQuote";
11
10
  const WORMHOLE_STATE_ID = "0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c";
@@ -36,14 +35,13 @@ export class BluefinProvider {
36
35
  excludedPools: this.options.excludedPools,
37
36
  targetPools: this.options.targetPools,
38
37
  });
39
- const { expectedAmount } = getExpectedReturn(quote.returnAmountWithDecimal.toString(), 0, this.metaOptions.partnerCommissionBps ?? 0, this.metaOptions.tipBps ?? 0);
40
38
  return {
41
39
  id: v4(),
42
40
  provider: EProvider.BLUEFIN7K,
43
41
  quote,
44
42
  amountIn: quote.swapAmountWithDecimal,
45
43
  rawAmountOut: quote.returnAmountWithDecimal,
46
- amountOut: expectedAmount,
44
+ amountOut: quote.returnAmountWithDecimal,
47
45
  coinTypeIn: options.coinInType,
48
46
  coinTypeOut: options.coinOutType,
49
47
  };
@@ -54,8 +52,8 @@ export class BluefinProvider {
54
52
  quoteResponse: quote.quote,
55
53
  accountAddress: signer,
56
54
  commission: {
57
- commissionBps: this.metaOptions.partnerCommissionBps ?? 0,
58
- partner: this.metaOptions.partner ?? SUI_ADDRESS_ZERO,
55
+ commissionBps: 0,
56
+ partner: SUI_ADDRESS_ZERO,
59
57
  },
60
58
  slippage: 1,
61
59
  extendTx: {
@@ -2,21 +2,14 @@ import { AggregatorClient, Env } from "@cetusprotocol/aggregator-sdk";
2
2
  import { v4 } from "uuid";
3
3
  import { EProvider, } from "../../../types/metaAg";
4
4
  import { assert } from "../../../utils/condition";
5
- import { getExpectedReturn } from "../../swap/buildTx";
6
5
  export class CetusProvider {
7
6
  options;
8
- metaOptions;
9
7
  kind = EProvider.CETUS;
10
8
  cetusClient;
11
9
  constructor(options, metaOptions, client) {
12
10
  this.options = options;
13
- this.metaOptions = metaOptions;
14
11
  this.cetusClient = new AggregatorClient({
15
12
  apiKey: options.apiKey,
16
- overlayFeeReceiver: metaOptions.partner,
17
- overlayFeeRate: metaOptions.partnerCommissionBps
18
- ? metaOptions.partnerCommissionBps / 10000
19
- : undefined,
20
13
  client,
21
14
  endpoint: options.api,
22
15
  env: Env.Mainnet,
@@ -37,18 +30,13 @@ export class CetusProvider {
37
30
  liquidityChanges: this.options.liquidityChanges,
38
31
  });
39
32
  assert(!!quote, "No quote found");
40
- const bps = BigInt(this.metaOptions.partnerCommissionBps ?? 0);
41
- // calc amount out before any commission fees
42
- const amountOut = ((BigInt(quote.amountOut.toString()) * 10000n) /
43
- (10000n - bps)).toString();
44
- const { expectedAmount } = getExpectedReturn(amountOut, 0, this.metaOptions.partnerCommissionBps ?? 0, this.metaOptions.tipBps ?? 0);
45
33
  return {
46
34
  id: v4(),
47
35
  provider: EProvider.CETUS,
48
36
  quote,
49
- amountIn: quote.amountIn.toString(),
50
- rawAmountOut: amountOut,
51
- amountOut: expectedAmount,
37
+ amountIn: quote.amountIn.toString() || "0",
38
+ rawAmountOut: quote.amountOut.toString() || "0",
39
+ amountOut: quote.amountOut.toString() || "0",
52
40
  coinTypeIn: quoteOptions.coinInType,
53
41
  coinTypeOut: quoteOptions.coinOutType,
54
42
  };
@@ -1,17 +1,14 @@
1
- import { AggregatorQuoter, Commission, CommissionType, TradeBuilder, } from "@flowx-finance/sdk";
1
+ import { AggregatorQuoter, TradeBuilder } from "@flowx-finance/sdk";
2
2
  import { v4 } from "uuid";
3
3
  import { EProvider, } from "../../../types/metaAg";
4
4
  import { assert } from "../../../utils/condition";
5
- import { getExpectedReturn } from "../../swap/buildTx";
6
5
  export class FlowxProvider {
7
6
  options;
8
- metaOptions;
9
7
  client;
10
8
  kind = EProvider.FLOWX;
11
9
  quoter;
12
- constructor(options, metaOptions, client) {
10
+ constructor(options, client) {
13
11
  this.options = options;
14
- this.metaOptions = metaOptions;
15
12
  this.client = client;
16
13
  this.quoter = new AggregatorQuoter("mainnet", options.apiKey);
17
14
  }
@@ -26,14 +23,13 @@ export class FlowxProvider {
26
23
  maxHops: this.options.maxHops,
27
24
  splitDistributionPercent: this.options.splitDistributionPercent,
28
25
  });
29
- const { expectedAmount } = getExpectedReturn(quote.amountOut?.toString() ?? "0", 0, this.metaOptions.partnerCommissionBps ?? 0, this.metaOptions.tipBps ?? 0);
30
26
  return {
31
27
  id: v4(),
32
28
  provider: EProvider.FLOWX,
33
29
  quote: quote,
34
30
  amountIn: quote.amountIn?.toString() ?? "0",
35
31
  rawAmountOut: quote.amountOut?.toString() ?? "0",
36
- amountOut: expectedAmount,
32
+ amountOut: quote.amountOut?.toString() ?? "0",
37
33
  coinTypeIn: quoteOptions.coinInType,
38
34
  coinTypeOut: quoteOptions.coinOutType,
39
35
  };
@@ -41,9 +37,6 @@ export class FlowxProvider {
41
37
  async swap(options) {
42
38
  assert(options.quote.provider === EProvider.FLOWX, "Invalid quote");
43
39
  const builder = new TradeBuilder("mainnet", options.quote.quote.routes);
44
- if (this.metaOptions.partner) {
45
- builder.commission(new Commission(this.metaOptions.partner, options.quote.quote.coinOut, CommissionType.PERCENTAGE, (this.metaOptions.partnerCommissionBps ?? 0) * 100, true));
46
- }
47
40
  builder.sender(options.signer);
48
41
  builder.slippage(10000 * 100);
49
42
  const res = await builder.build().swap({
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAY,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAGL,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAML,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EAChB,MAAM,oBAAoB,CAAC;AAa5B,qBAAa,MAAM;IACjB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,SAAS,CAA8C;IAC/D,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,OAAO,CAA0B;gBAC7B,OAAO,CAAC,EAAE,aAAa;YAkBrB,YAAY;YAyCZ,SAAS;YAqDT,MAAM;IA0BpB;;;;;OAKG;IACG,KAAK,CACT,OAAO,EAAE,gBAAgB,EACzB,UAAU,CAAC,EAAE,qBAAqB,GACjC,OAAO,CAAC,SAAS,EAAE,CAAC;IAqBvB;;;;;OAKG;IACG,IAAI,CACR,OAAO,EAAE,eAAe,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,yBAAyB,CAAC;IAkBrC;;;OAGG;IACH,mBAAmB,CAAC,OAAO,EAAE,aAAa;CA4B3C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAY,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAGL,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAML,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EAChB,MAAM,oBAAoB,CAAC;AAa5B,qBAAa,MAAM;IACjB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,SAAS,CAA8C;IAC/D,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,OAAO,CAA0B;gBAC7B,OAAO,CAAC,EAAE,aAAa;YAkBrB,YAAY;YAuCZ,SAAS;YAqDT,MAAM;IAoCpB;;;;;OAKG;IACG,KAAK,CACT,OAAO,EAAE,gBAAgB,EACzB,UAAU,CAAC,EAAE,qBAAqB,GACjC,OAAO,CAAC,SAAS,EAAE,CAAC;IAuBvB;;;;;OAKG;IACG,IAAI,CACR,OAAO,EAAE,eAAe,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,yBAAyB,CAAC;IAkBrC;;;OAGG;IACH,mBAAmB,CAAC,OAAO,EAAE,aAAa;CA4B3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"bluefin.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/bluefin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAU/C,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAS/B,qBAAa,eAAgB,YAAW,UAAU;IAG9C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAH9B,IAAI,YAAuB;gBAER,OAAO,EAAE,sBAAsB,EAC/B,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,EACrD,MAAM,EAAE,SAAS;IAeb,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IA4BpD,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,eAAe;CAiB1D"}
1
+ {"version":3,"file":"bluefin.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/bluefin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAU/C,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAQ/B,qBAAa,eAAgB,YAAW,UAAU;IAG9C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAH9B,IAAI,YAAuB;gBAER,OAAO,EAAE,sBAAsB,EAC/B,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,EACrD,MAAM,EAAE,SAAS;IAeb,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAsBpD,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,eAAe;CAiB1D"}
@@ -3,7 +3,6 @@ import { TransactionObjectArgument } from "@mysten/sui/transactions";
3
3
  import { AgProvider, CetusProviderOptions, EProvider, MetaAgOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions } from "../../../types/metaAg";
4
4
  export declare class CetusProvider implements AgProvider {
5
5
  private readonly options;
6
- private readonly metaOptions;
7
6
  kind: EProvider;
8
7
  private readonly cetusClient;
9
8
  constructor(options: CetusProviderOptions, metaOptions: MetaAgOptions, client: SuiClient);
@@ -1 +1 @@
1
- {"version":3,"file":"cetus.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/cetus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAI/B,qBAAa,aAAc,YAAW,UAAU;IAI5C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAJ9B,IAAI,YAAmB;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;gBAE5B,OAAO,EAAE,oBAAoB,EAC7B,WAAW,EAAE,aAAa,EAC3C,MAAM,EAAE,SAAS;IAeb,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAsCzD,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAUzE"}
1
+ {"version":3,"file":"cetus.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/cetus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,aAAc,YAAW,UAAU;IAI5C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAH1B,IAAI,YAAmB;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;gBAE5B,OAAO,EAAE,oBAAoB,EAC9C,WAAW,EAAE,aAAa,EAC1B,MAAM,EAAE,SAAS;IAWb,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IA0BzD,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAUzE"}
@@ -1,13 +1,12 @@
1
1
  import { SuiClient } from "@mysten/sui/client";
2
2
  import { TransactionObjectArgument } from "@mysten/sui/transactions";
3
- import { AgProvider, EProvider, FlowxProviderOptions, MetaAgOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions } from "../../../types/metaAg";
3
+ import { AgProvider, EProvider, FlowxProviderOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions } from "../../../types/metaAg";
4
4
  export declare class FlowxProvider implements AgProvider {
5
5
  private readonly options;
6
- private readonly metaOptions;
7
6
  private readonly client;
8
7
  kind: EProvider;
9
8
  private quoter;
10
- constructor(options: FlowxProviderOptions, metaOptions: MetaAgOptions, client: SuiClient);
9
+ constructor(options: FlowxProviderOptions, client: SuiClient);
11
10
  quote(quoteOptions: MetaQuoteOptions): Promise<MetaQuote>;
12
11
  swap(options: MetaSwapOptions): Promise<TransactionObjectArgument>;
13
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"flowx.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/flowx.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EACL,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAI/B,qBAAa,aAAc,YAAW,UAAU;IAI5C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IALzB,IAAI,YAAmB;IACvB,OAAO,CAAC,MAAM,CAAmB;gBAEd,OAAO,EAAE,oBAAoB,EAC7B,WAAW,EAAE,aAAa,EAC1B,MAAM,EAAE,SAAS;IAK9B,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IA6BzD,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAuBzE"}
1
+ {"version":3,"file":"flowx.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/flowx.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EACL,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,aAAc,YAAW,UAAU;IAI5C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJzB,IAAI,YAAmB;IACvB,OAAO,CAAC,MAAM,CAAmB;gBAEd,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,SAAS;IAK9B,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAuBzD,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAYzE"}
@@ -8,32 +8,31 @@ export declare enum EProvider {
8
8
  CETUS = "cetus",
9
9
  FLOWX = "flowx"
10
10
  }
11
- export type BluefinProviderOptions = {
11
+ type ProviderBaseOptions = {
12
+ api?: string;
13
+ apiKey?: string;
14
+ disabled?: boolean;
15
+ };
16
+ export type BluefinProviderOptions = ProviderBaseOptions & {
12
17
  sources?: SourceDex[];
13
18
  maxPaths?: number;
14
19
  excludedPools?: string[];
15
20
  targetPools?: string[];
16
- api?: string;
17
- apiKey?: string;
18
21
  };
19
- export type FlowxProviderOptions = {
22
+ export type FlowxProviderOptions = ProviderBaseOptions & {
20
23
  sources?: Protocol[];
21
24
  excludePools?: string[];
22
25
  excludeSources?: Protocol[];
23
26
  maxHops?: number;
24
27
  splitDistributionPercent?: number;
25
- api?: string;
26
- apiKey?: string;
27
28
  };
28
- export type CetusProviderOptions = {
29
+ export type CetusProviderOptions = ProviderBaseOptions & {
29
30
  sources?: string[];
30
31
  splitCount?: number;
31
32
  splitAlgorithm?: string;
32
33
  splitFactor?: number;
33
34
  depth?: number;
34
35
  liquidityChanges?: PreSwapLpChangeParams[];
35
- api?: string;
36
- apiKey?: string;
37
36
  };
38
37
  export interface MetaAgOptions {
39
38
  /**If not specified, all providers will be used */
@@ -124,4 +123,5 @@ export declare abstract class AgProvider {
124
123
  abstract quote(quoteOptions: MetaQuoteOptions): Promise<MetaQuote>;
125
124
  abstract swap(options: MetaSwapOptions): Promise<TransactionObjectArgument>;
126
125
  }
126
+ export {};
127
127
  //# sourceMappingURL=metaAg.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metaAg.d.ts","sourceRoot":"","sources":["../../../../src/types/metaAg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EACV,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAExD,oBAAY,SAAS;IACnB,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AACD,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,CAA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,6GAA6G;IAC7G,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8DAA8D;IAC9D,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AACF,8BAAsB,UAAU;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAClE,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAC5E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7kprotocol/sdk-ts",
3
- "version": "3.4.2-beta.9",
3
+ "version": "3.5.0",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -71,7 +71,7 @@
71
71
  "typescript-eslint": "^8.34.1"
72
72
  },
73
73
  "peerDependencies": {
74
- "@mysten/sui": "^1.39.0",
74
+ "@mysten/sui": "^1.44.0",
75
75
  "@pythnetwork/pyth-sui-js": "^2.2.0"
76
76
  },
77
77
  "dependencies": {