@7kprotocol/sdk-ts 3.5.0 → 3.5.2-beta.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.
Files changed (104) hide show
  1. package/README.md +45 -171
  2. package/lib/cjs/config/index.js +9 -0
  3. package/lib/cjs/constants/_7k.js +2 -1
  4. package/lib/cjs/features/metaAg/common.js +117 -0
  5. package/lib/cjs/features/metaAg/index.js +88 -93
  6. package/lib/cjs/features/metaAg/providers/astro.js +42 -0
  7. package/lib/cjs/features/metaAg/providers/bluefin.js +8 -8
  8. package/lib/cjs/features/metaAg/providers/bluefinx.js +87 -0
  9. package/lib/cjs/features/metaAg/providers/cetus.js +7 -4
  10. package/lib/cjs/features/metaAg/providers/flowx.js +6 -4
  11. package/lib/cjs/features/metaAg/providers/okx.js +181 -0
  12. package/lib/cjs/features/swap/buildTx.js +3 -0
  13. package/lib/cjs/features/swap/buildTxV2.js +10 -6
  14. package/lib/cjs/features/swap/config.js +2 -1
  15. package/lib/cjs/features/swap/getQuote.js +3 -2
  16. package/lib/cjs/libs/protocols/bluefinx/client.js +1 -1
  17. package/lib/cjs/types/config/index.d.ts +4 -0
  18. package/lib/cjs/types/config/index.d.ts.map +1 -1
  19. package/lib/cjs/types/constants/_7k.d.ts +1 -0
  20. package/lib/cjs/types/constants/_7k.d.ts.map +1 -1
  21. package/lib/cjs/types/features/metaAg/common.d.ts +33 -0
  22. package/lib/cjs/types/features/metaAg/common.d.ts.map +1 -0
  23. package/lib/cjs/types/features/metaAg/index.d.ts +11 -2
  24. package/lib/cjs/types/features/metaAg/index.d.ts.map +1 -1
  25. package/lib/cjs/types/features/metaAg/providers/astro.d.ts +9 -0
  26. package/lib/cjs/types/features/metaAg/providers/astro.d.ts.map +1 -0
  27. package/lib/cjs/types/features/metaAg/providers/bluefin.d.ts +3 -3
  28. package/lib/cjs/types/features/metaAg/providers/bluefin.d.ts.map +1 -1
  29. package/lib/cjs/types/features/metaAg/providers/bluefinx.d.ts +10 -0
  30. package/lib/cjs/types/features/metaAg/providers/bluefinx.d.ts.map +1 -0
  31. package/lib/cjs/types/features/metaAg/providers/cetus.d.ts +4 -5
  32. package/lib/cjs/types/features/metaAg/providers/cetus.d.ts.map +1 -1
  33. package/lib/cjs/types/features/metaAg/providers/flowx.d.ts +3 -3
  34. package/lib/cjs/types/features/metaAg/providers/flowx.d.ts.map +1 -1
  35. package/lib/cjs/types/features/metaAg/providers/okx.d.ts +21 -0
  36. package/lib/cjs/types/features/metaAg/providers/okx.d.ts.map +1 -0
  37. package/lib/cjs/types/features/swap/buildTx.d.ts.map +1 -1
  38. package/lib/cjs/types/features/swap/buildTxV2.d.ts +3 -3
  39. package/lib/cjs/types/features/swap/buildTxV2.d.ts.map +1 -1
  40. package/lib/cjs/types/features/swap/config.d.ts.map +1 -1
  41. package/lib/cjs/types/features/swap/getQuote.d.ts +1 -3
  42. package/lib/cjs/types/features/swap/getQuote.d.ts.map +1 -1
  43. package/lib/cjs/types/index.d.ts +3 -1
  44. package/lib/cjs/types/index.d.ts.map +1 -1
  45. package/lib/cjs/types/metaAg.js +11 -4
  46. package/lib/cjs/types/okx.js +6 -0
  47. package/lib/cjs/types/types/metaAg.d.ts +60 -8
  48. package/lib/cjs/types/types/metaAg.d.ts.map +1 -1
  49. package/lib/cjs/types/types/okx.d.ts +193 -0
  50. package/lib/cjs/types/types/okx.d.ts.map +1 -0
  51. package/lib/cjs/types/utils/condition.d.ts +1 -1
  52. package/lib/cjs/types/utils/condition.d.ts.map +1 -1
  53. package/lib/esm/config/index.js +9 -0
  54. package/lib/esm/constants/_7k.js +1 -0
  55. package/lib/esm/features/metaAg/common.js +109 -0
  56. package/lib/esm/features/metaAg/index.js +89 -94
  57. package/lib/esm/features/metaAg/providers/astro.js +39 -0
  58. package/lib/esm/features/metaAg/providers/bluefin.js +8 -8
  59. package/lib/esm/features/metaAg/providers/bluefinx.js +84 -0
  60. package/lib/esm/features/metaAg/providers/cetus.js +7 -4
  61. package/lib/esm/features/metaAg/providers/flowx.js +7 -5
  62. package/lib/esm/features/metaAg/providers/okx.js +146 -0
  63. package/lib/esm/features/swap/buildTx.js +3 -0
  64. package/lib/esm/features/swap/buildTxV2.js +6 -2
  65. package/lib/esm/features/swap/config.js +2 -1
  66. package/lib/esm/features/swap/getQuote.js +3 -2
  67. package/lib/esm/libs/protocols/bluefinx/client.js +1 -1
  68. package/lib/esm/types/config/index.d.ts +4 -0
  69. package/lib/esm/types/config/index.d.ts.map +1 -1
  70. package/lib/esm/types/constants/_7k.d.ts +1 -0
  71. package/lib/esm/types/constants/_7k.d.ts.map +1 -1
  72. package/lib/esm/types/features/metaAg/common.d.ts +33 -0
  73. package/lib/esm/types/features/metaAg/common.d.ts.map +1 -0
  74. package/lib/esm/types/features/metaAg/index.d.ts +11 -2
  75. package/lib/esm/types/features/metaAg/index.d.ts.map +1 -1
  76. package/lib/esm/types/features/metaAg/providers/astro.d.ts +9 -0
  77. package/lib/esm/types/features/metaAg/providers/astro.d.ts.map +1 -0
  78. package/lib/esm/types/features/metaAg/providers/bluefin.d.ts +3 -3
  79. package/lib/esm/types/features/metaAg/providers/bluefin.d.ts.map +1 -1
  80. package/lib/esm/types/features/metaAg/providers/bluefinx.d.ts +10 -0
  81. package/lib/esm/types/features/metaAg/providers/bluefinx.d.ts.map +1 -0
  82. package/lib/esm/types/features/metaAg/providers/cetus.d.ts +4 -5
  83. package/lib/esm/types/features/metaAg/providers/cetus.d.ts.map +1 -1
  84. package/lib/esm/types/features/metaAg/providers/flowx.d.ts +3 -3
  85. package/lib/esm/types/features/metaAg/providers/flowx.d.ts.map +1 -1
  86. package/lib/esm/types/features/metaAg/providers/okx.d.ts +21 -0
  87. package/lib/esm/types/features/metaAg/providers/okx.d.ts.map +1 -0
  88. package/lib/esm/types/features/swap/buildTx.d.ts.map +1 -1
  89. package/lib/esm/types/features/swap/buildTxV2.d.ts +3 -3
  90. package/lib/esm/types/features/swap/buildTxV2.d.ts.map +1 -1
  91. package/lib/esm/types/features/swap/config.d.ts.map +1 -1
  92. package/lib/esm/types/features/swap/getQuote.d.ts +1 -3
  93. package/lib/esm/types/features/swap/getQuote.d.ts.map +1 -1
  94. package/lib/esm/types/index.d.ts +3 -1
  95. package/lib/esm/types/index.d.ts.map +1 -1
  96. package/lib/esm/types/metaAg.js +8 -2
  97. package/lib/esm/types/okx.js +5 -0
  98. package/lib/esm/types/types/metaAg.d.ts +60 -8
  99. package/lib/esm/types/types/metaAg.d.ts.map +1 -1
  100. package/lib/esm/types/types/okx.d.ts +193 -0
  101. package/lib/esm/types/types/okx.d.ts.map +1 -0
  102. package/lib/esm/types/utils/condition.d.ts +1 -1
  103. package/lib/esm/types/utils/condition.d.ts.map +1 -1
  104. package/package.json +3 -2
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AstroProvider = void 0;
4
+ const astros_aggregator_sdk_1 = require("@naviprotocol/astros-aggregator-sdk");
5
+ const uuid_1 = require("uuid");
6
+ const _7k_1 = require("../../../constants/_7k");
7
+ const metaAg_1 = require("../../../types/metaAg");
8
+ const condition_1 = require("../../../utils/condition");
9
+ class AstroProvider {
10
+ constructor(options) {
11
+ this.options = options;
12
+ this.kind = metaAg_1.EProvider.ASTRO;
13
+ }
14
+ async quote({ amountIn, coinTypeIn, coinTypeOut, }) {
15
+ const quote = await (0, astros_aggregator_sdk_1.getQuote)(coinTypeIn, coinTypeOut, amountIn, this.options.api, {
16
+ baseUrl: this.options.api,
17
+ byAmountIn: true,
18
+ depth: this.options.depth,
19
+ dexList: this.options.dexList,
20
+ serviceFee: {
21
+ fee: 0,
22
+ receiverAddress: _7k_1._7K_PARTNER_ADDRESS,
23
+ },
24
+ });
25
+ return {
26
+ id: (0, uuid_1.v4)(),
27
+ provider: this.kind,
28
+ quote,
29
+ amountIn,
30
+ rawAmountOut: quote.amount_out.toString(),
31
+ amountOut: quote.amount_out.toString(),
32
+ coinTypeIn,
33
+ coinTypeOut,
34
+ };
35
+ }
36
+ async swap({ signer, quote, coinIn, tx }) {
37
+ (0, condition_1.assert)(quote.provider === metaAg_1.EProvider.ASTRO, "Invalid quote");
38
+ const coin = await (0, astros_aggregator_sdk_1.buildSwapPTBFromQuote)(signer, tx, 0, coinIn, quote.quote);
39
+ return coin;
40
+ }
41
+ }
42
+ exports.AstroProvider = AstroProvider;
@@ -4,8 +4,7 @@ exports.BluefinProvider = void 0;
4
4
  const pyth_sui_js_1 = require("@pythnetwork/pyth-sui-js");
5
5
  const uuid_1 = require("uuid");
6
6
  const config_1 = require("../../../config");
7
- const apiEndpoints_1 = require("../../../constants/apiEndpoints");
8
- const sui_1 = require("../../../constants/sui");
7
+ const _7k_1 = require("../../../constants/_7k");
9
8
  const metaAg_1 = require("../../../types/metaAg");
10
9
  const condition_1 = require("../../../utils/condition");
11
10
  const buildTxV2_1 = require("../../swap/buildTxV2");
@@ -21,6 +20,8 @@ class BluefinProvider {
21
20
  const pythConnection = new pyth_sui_js_1.SuiPriceServiceConnection(this.metaOptions.hermesApi);
22
21
  if (options.apiKey)
23
22
  config_1.Config.setApiKey(options.apiKey);
23
+ if (options.api)
24
+ config_1.Config.setApi(options.api);
24
25
  config_1.Config.setSuiClient(client);
25
26
  config_1.Config.setPythClient(pythClient);
26
27
  config_1.Config.setPythConnection(pythConnection);
@@ -28,9 +29,8 @@ class BluefinProvider {
28
29
  async quote(options) {
29
30
  const quote = await (0, getQuote_1.getQuote)({
30
31
  amountIn: options.amountIn,
31
- tokenIn: options.coinInType,
32
- tokenOut: options.coinOutType,
33
- api: this.options.api || apiEndpoints_1.API_ENDPOINTS.MAIN,
32
+ tokenIn: options.coinTypeIn,
33
+ tokenOut: options.coinTypeOut,
34
34
  sources: this.options.sources,
35
35
  maxPaths: this.options.maxPaths,
36
36
  excludedPools: this.options.excludedPools,
@@ -43,8 +43,8 @@ class BluefinProvider {
43
43
  amountIn: quote.swapAmountWithDecimal,
44
44
  rawAmountOut: quote.returnAmountWithDecimal,
45
45
  amountOut: quote.returnAmountWithDecimal,
46
- coinTypeIn: options.coinInType,
47
- coinTypeOut: options.coinOutType,
46
+ coinTypeIn: options.coinTypeIn,
47
+ coinTypeOut: options.coinTypeOut,
48
48
  };
49
49
  }
50
50
  async swap({ quote, signer, tx, coinIn }) {
@@ -54,7 +54,7 @@ class BluefinProvider {
54
54
  accountAddress: signer,
55
55
  commission: {
56
56
  commissionBps: 0,
57
- partner: sui_1.SUI_ADDRESS_ZERO,
57
+ partner: _7k_1._7K_PARTNER_ADDRESS,
58
58
  },
59
59
  slippage: 1,
60
60
  extendTx: {
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BluefinXProvider = void 0;
4
+ const transactions_1 = require("@mysten/sui/transactions");
5
+ const utils_1 = require("@mysten/sui/utils");
6
+ const uuid_1 = require("uuid");
7
+ const config_1 = require("../../../config");
8
+ const _7k_1 = require("../../../constants/_7k");
9
+ const client_1 = require("../../../libs/protocols/bluefinx/client");
10
+ const aggregator_1 = require("../../../types/aggregator");
11
+ const metaAg_1 = require("../../../types/metaAg");
12
+ const condition_1 = require("../../../utils/condition");
13
+ const buildTxV2_1 = require("../../swap/buildTxV2");
14
+ const getQuote_1 = require("../../swap/getQuote");
15
+ const common_1 = require("../common");
16
+ const SUPPORT_COINS = [
17
+ "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
18
+ "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
19
+ ];
20
+ class BluefinXProvider {
21
+ constructor(options) {
22
+ this.options = options;
23
+ this.kind = metaAg_1.EProvider.BLUEFINX;
24
+ if (options.apiKey)
25
+ config_1.Config.setApiKey(options.apiKey);
26
+ if (options.api)
27
+ config_1.Config.setApi(options.api);
28
+ }
29
+ async quote(options) {
30
+ if (!this.canQuote(options))
31
+ return null;
32
+ const quote = await (0, getQuote_1.getQuote)({
33
+ amountIn: options.amountIn,
34
+ tokenIn: options.coinTypeIn,
35
+ tokenOut: options.coinTypeOut,
36
+ sources: ["bluefinx"],
37
+ taker: options.signer,
38
+ });
39
+ return {
40
+ id: (0, uuid_1.v4)(),
41
+ provider: this.kind,
42
+ quote,
43
+ amountIn: quote.swapAmountWithDecimal,
44
+ rawAmountOut: quote.returnAmountWithDecimal,
45
+ amountOut: quote.returnAmountWithDecimal,
46
+ coinTypeIn: options.coinTypeIn,
47
+ coinTypeOut: options.coinTypeOut,
48
+ };
49
+ }
50
+ canQuote(options) {
51
+ return (!!options.signer &&
52
+ (0, utils_1.isValidSuiAddress)(options.signer) &&
53
+ SUPPORT_COINS.includes(options.coinTypeIn) &&
54
+ SUPPORT_COINS.includes(options.coinTypeOut));
55
+ }
56
+ async fastSwap(options) {
57
+ (0, condition_1.assert)(options.quote.provider === this.kind, "Invalid BluefinX quote");
58
+ const quote = options.quote.quote;
59
+ const tx = new transactions_1.Transaction();
60
+ const { tx: bluefinTx } = await (0, buildTxV2_1.buildTxV2Int)({
61
+ quoteResponse: quote,
62
+ accountAddress: options.signer,
63
+ commission: { commissionBps: 0, partner: _7k_1._7K_PARTNER_ADDRESS },
64
+ slippage: 0,
65
+ extendTx: {
66
+ tx,
67
+ coinIn: (0, transactions_1.coinWithBalance)({
68
+ type: options.quote.coinTypeIn,
69
+ balance: BigInt(options.quote.amountIn),
70
+ useGasCoin: false,
71
+ }),
72
+ },
73
+ }, (tx, coinOut) => {
74
+ if (coinOut) {
75
+ tx.add((0, common_1.metaSettle)(options.quote, coinOut, 0, 0));
76
+ tx.transferObjects([coinOut], options.signer);
77
+ }
78
+ });
79
+ (0, condition_1.assert)(bluefinTx instanceof aggregator_1.BluefinXTx, "BluefinX transaction not found");
80
+ const { signature } = await options.signTransaction(bluefinTx.txBytes);
81
+ const res = await (0, client_1.executeBluefinTx)(bluefinTx, signature);
82
+ (0, condition_1.assert)(res.approved, "BluefinX transaction not approved");
83
+ (0, condition_1.assert)(res.txDigest, "BluefinX transaction digest not found");
84
+ return res.txDigest;
85
+ }
86
+ }
87
+ exports.BluefinXProvider = BluefinXProvider;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CetusProvider = void 0;
4
4
  const aggregator_sdk_1 = require("@cetusprotocol/aggregator-sdk");
5
5
  const uuid_1 = require("uuid");
6
+ const _7k_1 = require("../../../constants/_7k");
6
7
  const metaAg_1 = require("../../../types/metaAg");
7
8
  const condition_1 = require("../../../utils/condition");
8
9
  class CetusProvider {
@@ -15,14 +16,16 @@ class CetusProvider {
15
16
  endpoint: options.api,
16
17
  env: aggregator_sdk_1.Env.Mainnet,
17
18
  pythUrls: metaOptions.hermesApi ? [metaOptions.hermesApi] : [],
19
+ overlayFeeRate: 0,
20
+ overlayFeeReceiver: _7k_1._7K_PARTNER_ADDRESS,
18
21
  });
19
22
  }
20
23
  async quote(quoteOptions) {
21
24
  const quote = await this.cetusClient.findRouters({
22
25
  amount: quoteOptions.amountIn,
23
26
  byAmountIn: true,
24
- from: quoteOptions.coinInType,
25
- target: quoteOptions.coinOutType,
27
+ from: quoteOptions.coinTypeIn,
28
+ target: quoteOptions.coinTypeOut,
26
29
  providers: this.options.sources,
27
30
  splitCount: this.options.splitCount,
28
31
  splitAlgorithm: this.options.splitAlgorithm,
@@ -38,8 +41,8 @@ class CetusProvider {
38
41
  amountIn: quote.amountIn.toString() || "0",
39
42
  rawAmountOut: quote.amountOut.toString() || "0",
40
43
  amountOut: quote.amountOut.toString() || "0",
41
- coinTypeIn: quoteOptions.coinInType,
42
- coinTypeOut: quoteOptions.coinOutType,
44
+ coinTypeIn: quoteOptions.coinTypeIn,
45
+ coinTypeOut: quoteOptions.coinTypeOut,
43
46
  };
44
47
  }
45
48
  async swap(options) {
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FlowxProvider = void 0;
4
4
  const sdk_1 = require("@flowx-finance/sdk");
5
5
  const uuid_1 = require("uuid");
6
+ const _7k_1 = require("../../../constants/_7k");
6
7
  const metaAg_1 = require("../../../types/metaAg");
7
8
  const condition_1 = require("../../../utils/condition");
8
9
  class FlowxProvider {
@@ -15,8 +16,8 @@ class FlowxProvider {
15
16
  async quote(quoteOptions) {
16
17
  const quote = await this.quoter.getRoutes({
17
18
  amountIn: quoteOptions.amountIn,
18
- tokenIn: quoteOptions.coinInType,
19
- tokenOut: quoteOptions.coinOutType,
19
+ tokenIn: quoteOptions.coinTypeIn,
20
+ tokenOut: quoteOptions.coinTypeOut,
20
21
  includeSources: this.options.sources,
21
22
  excludePools: this.options.excludePools,
22
23
  excludeSources: this.options.excludeSources,
@@ -30,8 +31,8 @@ class FlowxProvider {
30
31
  amountIn: quote.amountIn?.toString() ?? "0",
31
32
  rawAmountOut: quote.amountOut?.toString() ?? "0",
32
33
  amountOut: quote.amountOut?.toString() ?? "0",
33
- coinTypeIn: quoteOptions.coinInType,
34
- coinTypeOut: quoteOptions.coinOutType,
34
+ coinTypeIn: quoteOptions.coinTypeIn,
35
+ coinTypeOut: quoteOptions.coinTypeOut,
35
36
  };
36
37
  }
37
38
  async swap(options) {
@@ -39,6 +40,7 @@ class FlowxProvider {
39
40
  const builder = new sdk_1.TradeBuilder("mainnet", options.quote.quote.routes);
40
41
  builder.sender(options.signer);
41
42
  builder.slippage(10000 * 100);
43
+ builder.commission(new sdk_1.Commission(_7k_1._7K_PARTNER_ADDRESS, options.quote.quote.coinOut, sdk_1.CommissionType.PERCENTAGE, 0, true));
42
44
  const res = await builder.build().swap({
43
45
  tx: options.tx,
44
46
  client: this.client,
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.simulateOKXSwap = exports.OkxProvider = void 0;
37
+ const transactions_1 = require("@mysten/sui/transactions");
38
+ const utils_1 = require("@mysten/sui/utils");
39
+ const uuid_1 = require("uuid");
40
+ const tokens_1 = require("../../../constants/tokens");
41
+ const metaAg_1 = require("../../../types/metaAg");
42
+ const condition_1 = require("../../../utils/condition");
43
+ const common_1 = require("../common");
44
+ const API = "https://web3.okx.com";
45
+ const SWAP_PATH = "/api/v5/dex/aggregator/swap";
46
+ const CHAIN_ID = "784";
47
+ const NORMALIZED_SUI_TYPE = (0, utils_1.normalizeStructTag)(tokens_1.SUI_TYPE);
48
+ class OkxProvider {
49
+ constructor(options, metaOptions, client) {
50
+ this.options = options;
51
+ this.metaOptions = metaOptions;
52
+ this.client = client;
53
+ this.kind = metaAg_1.EProvider.OKX;
54
+ }
55
+ async quote({ amountIn, coinTypeIn, coinTypeOut, signer, }) {
56
+ if (!signer)
57
+ return null;
58
+ const request = {
59
+ chainId: CHAIN_ID,
60
+ amount: amountIn,
61
+ fromTokenAddress: coinTypeIn === NORMALIZED_SUI_TYPE ? tokens_1.SUI_TYPE : coinTypeIn,
62
+ toTokenAddress: coinTypeOut === NORMALIZED_SUI_TYPE ? tokens_1.SUI_TYPE : coinTypeOut,
63
+ slippage: (this.metaOptions.slippageBps / 10000).toString(),
64
+ userWalletAddress: signer,
65
+ };
66
+ const queryString = "?" + new URLSearchParams(request).toString();
67
+ const url = `${this.options.api ?? API}${SWAP_PATH}${queryString}`;
68
+ const response = await fetch(url, {
69
+ headers: await getHeaders(this.options, "GET", SWAP_PATH, queryString),
70
+ });
71
+ const quote = (await response.json());
72
+ (0, condition_1.assert)(quote.code === "0" && quote.data.length > 0, "No quote found");
73
+ return {
74
+ id: (0, uuid_1.v4)(),
75
+ provider: this.kind,
76
+ coinTypeIn,
77
+ coinTypeOut,
78
+ amountIn,
79
+ amountOut: quote.data[0].routerResult.toTokenAmount,
80
+ rawAmountOut: quote.data[0].routerResult.toTokenAmount,
81
+ quote: quote.data[0],
82
+ };
83
+ }
84
+ async fastSwap(options) {
85
+ const { quote, signer, signTransaction } = options;
86
+ (0, condition_1.assert)(quote.provider === metaAg_1.EProvider.OKX, "Invalid quote");
87
+ const { tx, coin } = buildTx({ quote, signer });
88
+ tx.add((0, common_1.metaSettle)(quote, coin, this.metaOptions.slippageBps, this.metaOptions.tipBps, this.metaOptions.partner, this.metaOptions.partnerCommissionBps));
89
+ tx.transferObjects([coin], signer);
90
+ const txBytes = await tx.build({ client: this.client });
91
+ const { bytes, signature } = await signTransaction((0, utils_1.toBase64)(txBytes));
92
+ const res = await this.client.executeTransactionBlock({
93
+ signature,
94
+ transactionBlock: bytes,
95
+ });
96
+ return res.digest;
97
+ }
98
+ }
99
+ exports.OkxProvider = OkxProvider;
100
+ async function generateHmacSha256(message, secretKey) {
101
+ const encoder = new TextEncoder();
102
+ const encodeBase64 = (bytes) => {
103
+ if (typeof Buffer !== "undefined") {
104
+ return Buffer.from(bytes).toString("base64");
105
+ }
106
+ let binary = "";
107
+ for (let i = 0; i < bytes.byteLength; i++) {
108
+ binary += String.fromCharCode(bytes[i]);
109
+ }
110
+ if (typeof btoa !== "undefined") {
111
+ return btoa(binary);
112
+ }
113
+ throw new Error("Base64 encoder not available in this environment");
114
+ };
115
+ if (typeof globalThis !== "undefined" && globalThis.crypto?.subtle) {
116
+ const key = await globalThis.crypto.subtle.importKey("raw", encoder.encode(secretKey), { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
117
+ const signature = await globalThis.crypto.subtle.sign("HMAC", key, encoder.encode(message));
118
+ return encodeBase64(new Uint8Array(signature));
119
+ }
120
+ const { createHmac } = await Promise.resolve().then(() => __importStar(require("node:crypto")));
121
+ return createHmac("sha256", secretKey).update(message).digest("base64");
122
+ }
123
+ async function getHeaders(options, method, requestPath, queryString = "") {
124
+ const { apiKey, secretKey, apiPassphrase, projectId } = options;
125
+ if (!apiKey || !secretKey || !apiPassphrase || !projectId) {
126
+ throw new Error("Missing required environment variables");
127
+ }
128
+ const timestamp = new Date().toISOString();
129
+ const stringToSign = timestamp + method + requestPath + queryString;
130
+ return {
131
+ "Content-Type": "application/json",
132
+ "OK-ACCESS-KEY": apiKey,
133
+ "OK-ACCESS-SIGN": await generateHmacSha256(stringToSign, secretKey),
134
+ "OK-ACCESS-TIMESTAMP": timestamp,
135
+ "OK-ACCESS-PASSPHRASE": apiPassphrase,
136
+ "OK-ACCESS-PROJECT": projectId,
137
+ };
138
+ }
139
+ const replaceFinalizeCommand = (tx, packageId) => {
140
+ const builder = transactions_1.TransactionDataBuilder.restore(tx.getData());
141
+ const i = builder.commands.findIndex((cmd) => cmd.$kind === "MoveCall" &&
142
+ (0, utils_1.normalizeSuiAddress)(cmd.MoveCall.package) ===
143
+ (0, utils_1.normalizeSuiAddress)(packageId) &&
144
+ cmd.MoveCall.module === "router" &&
145
+ cmd.MoveCall.function === "finalize");
146
+ const cmd = builder.commands[i];
147
+ (0, condition_1.assert)(cmd.MoveCall, "OKX: Finalize command not found");
148
+ builder.replaceCommand(i, transactions_1.Commands.MoveCall({
149
+ package: packageId,
150
+ module: "router",
151
+ function: "finalize_without_transfer",
152
+ typeArguments: cmd.MoveCall.typeArguments,
153
+ arguments: [
154
+ cmd.MoveCall.arguments[0],
155
+ cmd.MoveCall.arguments[5],
156
+ cmd.MoveCall.arguments[6],
157
+ ],
158
+ }));
159
+ const tx2 = transactions_1.Transaction.from(builder.build());
160
+ return { tx: tx2, coin: { NestedResult: [i, 0] } };
161
+ };
162
+ const buildTx = (options) => {
163
+ const { quote, signer } = options;
164
+ (0, condition_1.assert)(quote.provider === metaAg_1.EProvider.OKX, "Invalid quote");
165
+ const tx = transactions_1.Transaction.from(quote.quote.tx.data);
166
+ tx.setSenderIfNotSet(signer);
167
+ const { tx: tx2, coin } = replaceFinalizeCommand(tx, quote.quote.tx.to);
168
+ return { tx: tx2, coin };
169
+ };
170
+ const simulateOKXSwap = async (quote, inspector, simulation, metaOptions) => {
171
+ const { tx, coin } = buildTx({ quote, signer: quote.quote.tx.from });
172
+ tx.add((0, common_1.metaSettle)(quote, coin, 10000, metaOptions.tipBps, metaOptions.partner, metaOptions.partnerCommissionBps));
173
+ tx.transferObjects([coin], quote.quote.tx.from);
174
+ const res = await (0, common_1.simulateSwapTx)(tx, inspector, simulation);
175
+ return {
176
+ id: quote.id,
177
+ provider: quote.provider,
178
+ ...res,
179
+ };
180
+ };
181
+ exports.simulateOKXSwap = simulateOKXSwap;
@@ -177,6 +177,9 @@ const buildBluefinXTx = async (tx, accountAddress, quoteResponse) => {
177
177
  if (extra.quoteExpiresAtUtcMillis < Date.now()) {
178
178
  throw new Error("Quote expired");
179
179
  }
180
+ if (extra.taker !== accountAddress) {
181
+ throw new Error("Sender mismatch with quote");
182
+ }
180
183
  tx.setSenderIfNotSet(accountAddress);
181
184
  const bytes = await tx.build({
182
185
  client: config_1.Config.getSuiClient(),
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.multiSwap = exports.optimize = exports.buildTxV2 = void 0;
3
+ exports.multiSwap = exports.buildTxV2Int = exports.buildTxV2 = void 0;
4
4
  const transactions_1 = require("@mysten/sui/transactions");
5
5
  const utils_1 = require("@mysten/sui/utils");
6
6
  const groupSwapRoutes_1 = require("../../libs/groupSwapRoutes");
@@ -15,7 +15,11 @@ const config_1 = require("./config");
15
15
  * 2. Merging redundant swaps to the same pool within each wave
16
16
  * 3. Processing waves sequentially, passing intermediate tokens between waves
17
17
  */
18
- const buildTxV2 = async ({ quoteResponse, accountAddress, slippage, commission: __commission, devInspect, extendTx, isSponsored, }) => {
18
+ const buildTxV2 = async (params) => {
19
+ return (0, exports.buildTxV2Int)(params);
20
+ };
21
+ exports.buildTxV2 = buildTxV2;
22
+ const buildTxV2Int = async ({ quoteResponse, accountAddress, slippage, commission: __commission, devInspect, extendTx, isSponsored, }, beforeBuildBluefinXTx) => {
19
23
  const isBluefinX = (0, aggregator_1.isBluefinXRouting)(quoteResponse);
20
24
  const _commission = {
21
25
  ...__commission,
@@ -49,7 +53,7 @@ const buildTxV2 = async ({ quoteResponse, accountAddress, slippage, commission:
49
53
  sui_1.SuiUtils.transferOrDestroyZeroCoin(tx, quoteResponse.tokenIn, coinIn, accountAddress);
50
54
  const pythMap = await (0, buildTx_1.updatePythPriceFeedsIfAny)(tx, [quoteResponse]);
51
55
  const config = await (0, config_1.getConfig)();
52
- const finalCoins = await (0, exports.optimize)(pythMap, config, routes, coinData, tx, accountAddress);
56
+ const finalCoins = await optimize(pythMap, config, routes, coinData, tx, accountAddress);
53
57
  // Merge all final coins
54
58
  if (finalCoins.length > 0) {
55
59
  const mergeCoin = tx.add((0, buildTx_1.settle)(finalCoins, quoteResponse, Math.floor(+slippage * 10000), _commission));
@@ -61,6 +65,7 @@ const buildTxV2 = async ({ quoteResponse, accountAddress, slippage, commission:
61
65
  }
62
66
  }
63
67
  if (isBluefinX) {
68
+ beforeBuildBluefinXTx?.(tx, coinOut);
64
69
  return {
65
70
  tx: await (0, buildTx_1.buildBluefinXTx)(tx, accountAddress, quoteResponse),
66
71
  coinOut,
@@ -69,7 +74,7 @@ const buildTxV2 = async ({ quoteResponse, accountAddress, slippage, commission:
69
74
  tx.setSenderIfNotSet(accountAddress);
70
75
  return { tx, coinOut };
71
76
  };
72
- exports.buildTxV2 = buildTxV2;
77
+ exports.buildTxV2Int = buildTxV2Int;
73
78
  const optimize = async (pythMap, config, routes, coinData, tx, accountAddress) => {
74
79
  // Initialize route states with split coins
75
80
  const routeStates = routes.map((route, index) => ({
@@ -181,7 +186,6 @@ const optimize = async (pythMap, config, routes, coinData, tx, accountAddress) =
181
186
  }
182
187
  return finalCoins;
183
188
  };
184
- exports.optimize = optimize;
185
189
  /**
186
190
  * execute multiple swap in single transaction
187
191
  *
@@ -203,7 +207,7 @@ const multiSwap = async ({ sender, slippageBps, swaps, tx, commission, }) => {
203
207
  const coinData = splits.length === 1
204
208
  ? [coinIn]
205
209
  : [coinIn, ...tx.splitCoins(coinIn, splits.slice(1))];
206
- const coinObjects = await (0, exports.optimize)(pythMap, config, routes, coinData, tx, sender);
210
+ const coinObjects = await optimize(pythMap, config, routes, coinData, tx, sender);
207
211
  if (coinObjects.length > 0) {
208
212
  const mergeCoin = tx.add((0, buildTx_1.settle)(coinObjects, sorResponse, slippageBps, commission));
209
213
  if (!map[(0, utils_1.normalizeStructTag)(sorResponse.tokenOut)]) {
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_CONFIG = void 0;
4
4
  exports.getConfig = getConfig;
5
+ const config_1 = require("../../config");
5
6
  const fetchClient_1 = require("../../config/fetchClient");
6
7
  const apiEndpoints_1 = require("../../constants/apiEndpoints");
7
8
  exports.DEFAULT_CONFIG = {
@@ -141,7 +142,7 @@ async function getConfig() {
141
142
  return config;
142
143
  }
143
144
  try {
144
- const response = await (0, fetchClient_1.fetchClient)(`${apiEndpoints_1.API_ENDPOINTS.MAIN}/config`);
145
+ const response = await (0, fetchClient_1.fetchClient)(`${config_1.Config.getApi() || apiEndpoints_1.API_ENDPOINTS.MAIN}/config`);
145
146
  const quoteResponse = (await response.json());
146
147
  config = { ...config, ...quoteResponse };
147
148
  configTs = Date.now();
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ORACLE_BASED_SOURCES = exports.DEFAULT_SOURCES = void 0;
4
4
  exports.getQuote = getQuote;
5
5
  const utils_1 = require("@mysten/sui/utils");
6
+ const config_1 = require("../../config");
6
7
  const fetchClient_1 = require("../../config/fetchClient");
7
8
  const apiEndpoints_1 = require("../../constants/apiEndpoints");
8
9
  const aggregator_1 = require("../../types/aggregator");
@@ -40,7 +41,7 @@ exports.ORACLE_BASED_SOURCES = new Set([
40
41
  "steamm_oracle_quoter",
41
42
  "steamm_oracle_quoter_v2",
42
43
  ]);
43
- async function getQuote({ tokenIn, tokenOut, amountIn, sources: _sources = exports.DEFAULT_SOURCES, commissionBps, targetPools, excludedPools, taker, isSponsored, api, maxPaths, }) {
44
+ async function getQuote({ tokenIn, tokenOut, amountIn, sources: _sources = exports.DEFAULT_SOURCES, commissionBps, targetPools, excludedPools, taker, isSponsored, maxPaths, }) {
44
45
  let sources = _sources;
45
46
  if (isSponsored) {
46
47
  sources = _sources.filter((s) => !exports.ORACLE_BASED_SOURCES.has(s));
@@ -63,7 +64,7 @@ async function getQuote({ tokenIn, tokenOut, amountIn, sources: _sources = expor
63
64
  if (maxPaths) {
64
65
  params.append("max_paths", maxPaths.toString());
65
66
  }
66
- const response = await (0, fetchClient_1.fetchClient)(`${api || apiEndpoints_1.API_ENDPOINTS.MAIN}/quote?${params}`);
67
+ const response = await (0, fetchClient_1.fetchClient)(`${config_1.Config.getApi() || apiEndpoints_1.API_ENDPOINTS.MAIN}/quote?${params}`);
67
68
  if (!response.ok) {
68
69
  let responseText;
69
70
  try {
@@ -11,7 +11,7 @@ const request = async (path, body) => {
11
11
  if (bluefinXApiKey) {
12
12
  headers.set("Bluefin-X-API-Key", bluefinXApiKey);
13
13
  }
14
- const res = await fetch(`${apiEndpoints_1.API_ENDPOINTS.MAIN}/${path}`, {
14
+ const res = await fetch(`${config_1.Config.getApi() || apiEndpoints_1.API_ENDPOINTS.MAIN}/${path}`, {
15
15
  method: "POST",
16
16
  body: JSON.stringify(body),
17
17
  headers,
@@ -1,5 +1,7 @@
1
1
  import { SuiClient } from "@mysten/sui/client";
2
2
  import { SuiPriceServiceConnection, SuiPythClient } from "@pythnetwork/pyth-sui-js";
3
+ declare function setApi(url: string): void;
4
+ declare function getApi(): string;
3
5
  declare function setApiKey(key: string): void;
4
6
  declare function getApiKey(): string;
5
7
  declare function setBluefinXApiKey(key: string): void;
@@ -11,6 +13,8 @@ declare function getPythClient(): SuiPythClient;
11
13
  declare function setPythConnection(connection: SuiPriceServiceConnection): void;
12
14
  declare function getPythConnection(): SuiPriceServiceConnection;
13
15
  declare const Config: {
16
+ setApi: typeof setApi;
17
+ getApi: typeof getApi;
14
18
  setApiKey: typeof setApiKey;
15
19
  getApiKey: typeof getApiKey;
16
20
  setBluefinXApiKey: typeof setBluefinXApiKey;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACL,yBAAyB,EACzB,aAAa,EACd,MAAM,0BAA0B,CAAC;AAsBlC,iBAAS,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEpC;AAED,iBAAS,SAAS,IAAI,MAAM,CAE3B;AAED,iBAAS,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE5C;AAED,iBAAS,iBAAiB,IAAI,MAAM,CAEnC;AAED,iBAAS,YAAY,IAAI,SAAS,CAEjC;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAE7C;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAElD;AAED,iBAAS,aAAa,IAAI,aAAa,CAEtC;AAED,iBAAS,iBAAiB,CAAC,UAAU,EAAE,yBAAyB,GAAG,IAAI,CAEtE;AAED,iBAAS,iBAAiB,IAAI,yBAAyB,CAEtD;AAED,QAAA,MAAM,MAAM;;;;;;;;;;;CAWX,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACL,yBAAyB,EACzB,aAAa,EACd,MAAM,0BAA0B,CAAC;AAuBlC,iBAAS,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEjC;AAED,iBAAS,MAAM,IAAI,MAAM,CAExB;AAED,iBAAS,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEpC;AAED,iBAAS,SAAS,IAAI,MAAM,CAE3B;AAED,iBAAS,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE5C;AAED,iBAAS,iBAAiB,IAAI,MAAM,CAEnC;AAED,iBAAS,YAAY,IAAI,SAAS,CAEjC;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAE7C;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAElD;AAED,iBAAS,aAAa,IAAI,aAAa,CAEtC;AAED,iBAAS,iBAAiB,CAAC,UAAU,EAAE,yBAAyB,GAAG,IAAI,CAEtE;AAED,iBAAS,iBAAiB,IAAI,yBAAyB,CAEtD;AAED,QAAA,MAAM,MAAM;;;;;;;;;;;;;CAaX,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -5,4 +5,5 @@ export declare const _7K_META_PUBLISHED_AT = "0x17c0b1f7a6ad73f51268f16b8c06c049
5
5
  export declare const _7K_META_PACKAGE_ID = "0x17c0b1f7a6ad73f51268f16b8c06c049eecc2f28a270cdd29c06e3d2dea23302";
6
6
  export declare const _7K_META_VAULT = "0x9a8abd32fe5721307ce3b697cf982ee84e9ffbd58d667a4a199f1683c1a3d23c";
7
7
  export declare const _7K_META_CONFIG = "0xbbb3a51877ed9b492f26f4e2181811cfb2bd70c532f6f7621263d122d5e96b56";
8
+ export declare const _7K_PARTNER_ADDRESS = "0x93ead46c1e48a9b62e25b6787f2ea6f75caedabb21726f12431acc4381f5f4c5";
8
9
  //# sourceMappingURL=_7k.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"_7k.d.ts","sourceRoot":"","sources":["../../../../src/constants/_7k.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,uEAC2C,CAAC;AAKvE,eAAO,MAAM,UAAU,uEAC+C,CAAC;AAGvE,eAAO,MAAM,SAAS,uEACgD,CAAC;AAEvE,eAAO,MAAM,qBAAqB,uEACoC,CAAC;AACvE,eAAO,MAAM,mBAAmB,uEACsC,CAAC;AACvE,eAAO,MAAM,cAAc,uEAC2C,CAAC;AACvE,eAAO,MAAM,eAAe,uEAC0C,CAAC"}
1
+ {"version":3,"file":"_7k.d.ts","sourceRoot":"","sources":["../../../../src/constants/_7k.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,uEAC2C,CAAC;AAKvE,eAAO,MAAM,UAAU,uEAC+C,CAAC;AAGvE,eAAO,MAAM,SAAS,uEACgD,CAAC;AAEvE,eAAO,MAAM,qBAAqB,uEACoC,CAAC;AACvE,eAAO,MAAM,mBAAmB,uEACsC,CAAC;AACvE,eAAO,MAAM,cAAc,uEAC2C,CAAC;AACvE,eAAO,MAAM,eAAe,uEAC0C,CAAC;AACvE,eAAO,MAAM,mBAAmB,uEACsC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { GasCostSummary } from "@mysten/sui/client";
2
+ import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
3
+ import { AggregatorProvider, EProvider, MetaAgOptions, MetaQuote, MetaSimulationOptions } from "../../types/metaAg";
4
+ import { SuiClientUtils } from "../../utils/SuiClientUtils";
5
+ export declare const simulateBluefinX: <T extends MetaQuote & {
6
+ provider: EProvider.BLUEFINX;
7
+ }>(quote: T) => {
8
+ id: string;
9
+ simulatedAmountOut: string;
10
+ gasUsed: GasCostSummary;
11
+ provider: EProvider.BLUEFINX;
12
+ };
13
+ export declare const simulateSwapTx: (tx: Transaction, inspector: SuiClientUtils, simulation: MetaSimulationOptions) => Promise<{
14
+ simulatedAmountOut: string;
15
+ gasUsed: GasCostSummary;
16
+ }>;
17
+ export declare const simulateAggregator: (provider: AggregatorProvider, quote: MetaQuote, simulation: MetaSimulationOptions, inspector: SuiClientUtils, options: Required<MetaAgOptions>) => Promise<{
18
+ simulatedAmountOut: string;
19
+ gasUsed: GasCostSummary;
20
+ id: string;
21
+ provider: EProvider.BLUEFIN7K | EProvider.CETUS | EProvider.FLOWX | EProvider.ASTRO;
22
+ }>;
23
+ /**
24
+ * this settlement does not charge commission fee for partner, since all integrated aggregators already charge commission fee for partner
25
+ * @param quote Meta Aggregator Quote
26
+ * @param coinOut Coin Out Object
27
+ * @param slippageBps Slippage Bps
28
+ * @param tipBps Tip Bps default = 0
29
+ * @param partner address of partner for analytic default is zero address
30
+ */
31
+ export declare const metaSettle: (quote: MetaQuote, coinOut: TransactionObjectArgument, slippageBps?: number, tipBps?: number, partner?: string, commissionBps?: number) => (tx: Transaction) => void;
32
+ export declare const timeout: <T = any>(fn: () => Promise<T>, timeout: number, msg?: string) => Promise<T>;
33
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAY,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAEL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,SAAS,EACT,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAS5D,eAAO,MAAM,gBAAgB,GAC3B,CAAC,SAAS,SAAS,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAA;CAAE,EAEtD,OAAO,CAAC;;;;;CAQT,CAAC;AACF,eAAO,MAAM,cAAc,GACzB,IAAI,WAAW,EACf,WAAW,cAAc,EACzB,YAAY,qBAAqB;wBAeE,MAAM;;EAG1C,CAAC;AACF,eAAO,MAAM,kBAAkB,GAC7B,UAAU,kBAAkB,EAC5B,OAAO,SAAS,EAChB,YAAY,qBAAqB,EACjC,WAAW,cAAc,EACzB,SAAS,QAAQ,CAAC,aAAa,CAAC;wBATG,MAAM;;;;EAuC1C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,SAAS,EAChB,SAAS,yBAAyB,EAClC,oBAAiB,EACjB,eAAU,EACV,UAAU,MAAM,EAChB,sBAAiB,MAET,IAAI,WAAW,SAqCxB,CAAC;AASF,eAAO,MAAM,OAAO,GAAU,CAAC,GAAG,GAAG,EACnC,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,SAAS,MAAM,EACf,MAAM,MAAM,eAab,CAAC"}