@7kprotocol/sdk-ts 3.5.2 → 3.6.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.
- package/lib/cjs/config/index.js +9 -0
- package/lib/cjs/constants/apiEndpoints.js +1 -1
- package/lib/cjs/features/metaAg/common.js +103 -0
- package/lib/cjs/features/metaAg/error.js +35 -0
- package/lib/cjs/features/metaAg/index.js +99 -115
- package/lib/cjs/features/metaAg/providers/bluefin7k.js +57 -0
- package/lib/cjs/features/metaAg/providers/{bluefin.js → bluefin7kLegacy.js} +13 -13
- package/lib/cjs/features/metaAg/providers/cetus.js +7 -7
- package/lib/cjs/features/metaAg/providers/flowx.js +6 -6
- package/lib/cjs/features/metaAg/providers/okx.js +182 -0
- package/lib/cjs/features/swap/buildTx.js +3 -0
- package/lib/cjs/features/swap/buildTxV2.js +10 -6
- package/lib/cjs/features/swap/config.js +2 -1
- package/lib/cjs/features/swap/getQuote.js +3 -2
- package/lib/cjs/libs/protocols/bluefinx/client.js +1 -1
- package/lib/cjs/types/config/index.d.ts +4 -0
- package/lib/cjs/types/config/index.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/common.d.ts +24 -0
- package/lib/cjs/types/features/metaAg/common.d.ts.map +1 -0
- package/lib/cjs/types/features/metaAg/error.d.ts +60 -0
- package/lib/cjs/types/features/metaAg/error.d.ts.map +1 -0
- package/lib/cjs/types/features/metaAg/index.d.ts +11 -2
- package/lib/cjs/types/features/metaAg/index.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/providers/bluefin7k.d.ts +11 -0
- package/lib/cjs/types/features/metaAg/providers/bluefin7k.d.ts.map +1 -0
- package/lib/cjs/types/features/metaAg/providers/bluefin7kLegacy.d.ts +11 -0
- package/lib/cjs/types/features/metaAg/providers/bluefin7kLegacy.d.ts.map +1 -0
- package/lib/cjs/types/features/metaAg/providers/cetus.d.ts +4 -5
- package/lib/cjs/types/features/metaAg/providers/cetus.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/providers/flowx.d.ts +3 -3
- package/lib/cjs/types/features/metaAg/providers/flowx.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/providers/okx.d.ts +21 -0
- package/lib/cjs/types/features/metaAg/providers/okx.d.ts.map +1 -0
- package/lib/cjs/types/features/swap/buildTx.d.ts.map +1 -1
- package/lib/cjs/types/features/swap/buildTxV2.d.ts +3 -3
- package/lib/cjs/types/features/swap/buildTxV2.d.ts.map +1 -1
- package/lib/cjs/types/features/swap/config.d.ts.map +1 -1
- package/lib/cjs/types/features/swap/getQuote.d.ts +1 -3
- package/lib/cjs/types/features/swap/getQuote.d.ts.map +1 -1
- package/lib/cjs/types/index.d.ts +3 -1
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/metaAg.js +10 -4
- package/lib/cjs/types/okx.js +6 -0
- package/lib/cjs/types/types/metaAg.d.ts +62 -12
- package/lib/cjs/types/types/metaAg.d.ts.map +1 -1
- package/lib/cjs/types/types/okx.d.ts +206 -0
- package/lib/cjs/types/types/okx.d.ts.map +1 -0
- package/lib/cjs/types/utils/sui.d.ts +1 -0
- package/lib/cjs/types/utils/sui.d.ts.map +1 -1
- package/lib/cjs/utils/sui.js +17 -1
- package/lib/esm/config/index.js +9 -0
- package/lib/esm/constants/apiEndpoints.js +1 -1
- package/lib/esm/features/metaAg/common.js +96 -0
- package/lib/esm/features/metaAg/error.js +33 -0
- package/lib/esm/features/metaAg/index.js +100 -116
- package/lib/esm/features/metaAg/providers/bluefin7k.js +55 -0
- package/lib/esm/features/metaAg/providers/{bluefin.js → bluefin7kLegacy.js} +11 -11
- package/lib/esm/features/metaAg/providers/cetus.js +7 -7
- package/lib/esm/features/metaAg/providers/flowx.js +6 -6
- package/lib/esm/features/metaAg/providers/okx.js +147 -0
- package/lib/esm/features/swap/buildTx.js +3 -0
- package/lib/esm/features/swap/buildTxV2.js +6 -2
- package/lib/esm/features/swap/config.js +2 -1
- package/lib/esm/features/swap/getQuote.js +3 -2
- package/lib/esm/libs/protocols/bluefinx/client.js +1 -1
- package/lib/esm/types/config/index.d.ts +4 -0
- package/lib/esm/types/config/index.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/common.d.ts +24 -0
- package/lib/esm/types/features/metaAg/common.d.ts.map +1 -0
- package/lib/esm/types/features/metaAg/error.d.ts +60 -0
- package/lib/esm/types/features/metaAg/error.d.ts.map +1 -0
- package/lib/esm/types/features/metaAg/index.d.ts +11 -2
- package/lib/esm/types/features/metaAg/index.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/providers/bluefin7k.d.ts +11 -0
- package/lib/esm/types/features/metaAg/providers/bluefin7k.d.ts.map +1 -0
- package/lib/esm/types/features/metaAg/providers/bluefin7kLegacy.d.ts +11 -0
- package/lib/esm/types/features/metaAg/providers/bluefin7kLegacy.d.ts.map +1 -0
- package/lib/esm/types/features/metaAg/providers/cetus.d.ts +4 -5
- package/lib/esm/types/features/metaAg/providers/cetus.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/providers/flowx.d.ts +3 -3
- package/lib/esm/types/features/metaAg/providers/flowx.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/providers/okx.d.ts +21 -0
- package/lib/esm/types/features/metaAg/providers/okx.d.ts.map +1 -0
- package/lib/esm/types/features/swap/buildTx.d.ts.map +1 -1
- package/lib/esm/types/features/swap/buildTxV2.d.ts +3 -3
- package/lib/esm/types/features/swap/buildTxV2.d.ts.map +1 -1
- package/lib/esm/types/features/swap/config.d.ts.map +1 -1
- package/lib/esm/types/features/swap/getQuote.d.ts +1 -3
- package/lib/esm/types/features/swap/getQuote.d.ts.map +1 -1
- package/lib/esm/types/index.d.ts +3 -1
- package/lib/esm/types/index.d.ts.map +1 -1
- package/lib/esm/types/metaAg.js +7 -2
- package/lib/esm/types/okx.js +5 -0
- package/lib/esm/types/types/metaAg.d.ts +62 -12
- package/lib/esm/types/types/metaAg.d.ts.map +1 -1
- package/lib/esm/types/types/okx.d.ts +206 -0
- package/lib/esm/types/types/okx.d.ts.map +1 -0
- package/lib/esm/types/utils/sui.d.ts +1 -0
- package/lib/esm/types/utils/sui.d.ts.map +1 -1
- package/lib/esm/utils/sui.js +16 -1
- package/package.json +3 -1
- package/lib/cjs/types/features/metaAg/providers/bluefin.d.ts +0 -11
- package/lib/cjs/types/features/metaAg/providers/bluefin.d.ts.map +0 -1
- package/lib/cjs/types/utils/condition.d.ts +0 -2
- package/lib/cjs/types/utils/condition.d.ts.map +0 -1
- package/lib/cjs/utils/condition.js +0 -8
- package/lib/esm/types/features/metaAg/providers/bluefin.d.ts +0 -11
- package/lib/esm/types/features/metaAg/providers/bluefin.d.ts.map +0 -1
- package/lib/esm/types/utils/condition.d.ts +0 -2
- package/lib/esm/types/utils/condition.d.ts.map +0 -1
- package/lib/esm/utils/condition.js +0 -5
|
@@ -5,7 +5,7 @@ const sdk_1 = require("@flowx-finance/sdk");
|
|
|
5
5
|
const uuid_1 = require("uuid");
|
|
6
6
|
const _7k_1 = require("../../../constants/_7k");
|
|
7
7
|
const metaAg_1 = require("../../../types/metaAg");
|
|
8
|
-
const
|
|
8
|
+
const error_1 = require("../error");
|
|
9
9
|
class FlowxProvider {
|
|
10
10
|
constructor(options, client) {
|
|
11
11
|
this.options = options;
|
|
@@ -16,8 +16,8 @@ class FlowxProvider {
|
|
|
16
16
|
async quote(quoteOptions) {
|
|
17
17
|
const quote = await this.quoter.getRoutes({
|
|
18
18
|
amountIn: quoteOptions.amountIn,
|
|
19
|
-
tokenIn: quoteOptions.
|
|
20
|
-
tokenOut: quoteOptions.
|
|
19
|
+
tokenIn: quoteOptions.coinTypeIn,
|
|
20
|
+
tokenOut: quoteOptions.coinTypeOut,
|
|
21
21
|
includeSources: this.options.sources,
|
|
22
22
|
excludePools: this.options.excludePools,
|
|
23
23
|
excludeSources: this.options.excludeSources,
|
|
@@ -31,12 +31,12 @@ class FlowxProvider {
|
|
|
31
31
|
amountIn: quote.amountIn?.toString() ?? "0",
|
|
32
32
|
rawAmountOut: quote.amountOut?.toString() ?? "0",
|
|
33
33
|
amountOut: quote.amountOut?.toString() ?? "0",
|
|
34
|
-
coinTypeIn: quoteOptions.
|
|
35
|
-
coinTypeOut: quoteOptions.
|
|
34
|
+
coinTypeIn: quoteOptions.coinTypeIn,
|
|
35
|
+
coinTypeOut: quoteOptions.coinTypeOut,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
async swap(options) {
|
|
39
|
-
|
|
39
|
+
error_1.MetaAgError.assert(options.quote.provider === metaAg_1.EProvider.FLOWX, "Invalid quote", error_1.MetaAgErrorCode.INVALID_QUOTE, { quote: options.quote, expectedProvider: metaAg_1.EProvider.FLOWX });
|
|
40
40
|
const builder = new sdk_1.TradeBuilder("mainnet", options.quote.quote.routes);
|
|
41
41
|
builder.sender(options.signer);
|
|
42
42
|
builder.slippage(10000 * 100);
|
|
@@ -0,0 +1,182 @@
|
|
|
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 sui_1 = require("../../../utils/sui");
|
|
43
|
+
const common_1 = require("../common");
|
|
44
|
+
const error_1 = require("../error");
|
|
45
|
+
const API = "https://web3.okx.com";
|
|
46
|
+
const SWAP_PATH = "/api/v6/dex/aggregator/swap";
|
|
47
|
+
const CHAIN_ID = "784";
|
|
48
|
+
const NORMALIZED_SUI_TYPE = (0, utils_1.normalizeStructTag)(tokens_1.SUI_TYPE);
|
|
49
|
+
class OkxProvider {
|
|
50
|
+
constructor(options, metaOptions, client) {
|
|
51
|
+
this.options = options;
|
|
52
|
+
this.metaOptions = metaOptions;
|
|
53
|
+
this.client = client;
|
|
54
|
+
this.kind = metaAg_1.EProvider.OKX;
|
|
55
|
+
}
|
|
56
|
+
async quote({ amountIn, coinTypeIn, coinTypeOut, signer, }) {
|
|
57
|
+
if (!signer || (0, sui_1.isSystemAddress)(signer))
|
|
58
|
+
return null;
|
|
59
|
+
const request = {
|
|
60
|
+
chainIndex: CHAIN_ID,
|
|
61
|
+
amount: amountIn,
|
|
62
|
+
fromTokenAddress: coinTypeIn === NORMALIZED_SUI_TYPE ? tokens_1.SUI_TYPE : coinTypeIn,
|
|
63
|
+
toTokenAddress: coinTypeOut === NORMALIZED_SUI_TYPE ? tokens_1.SUI_TYPE : coinTypeOut,
|
|
64
|
+
slippagePercent: (this.metaOptions.slippageBps / 100).toString(),
|
|
65
|
+
userWalletAddress: signer,
|
|
66
|
+
};
|
|
67
|
+
const queryString = "?" + new URLSearchParams(request).toString();
|
|
68
|
+
const url = `${this.options.api ?? API}${SWAP_PATH}${queryString}`;
|
|
69
|
+
const response = await fetch(url, {
|
|
70
|
+
headers: await getHeaders(this.options, "GET", SWAP_PATH, queryString),
|
|
71
|
+
});
|
|
72
|
+
const quote = (await response.json());
|
|
73
|
+
error_1.MetaAgError.assert(quote.code === "0" && quote.data.length > 0, "No quote found", error_1.MetaAgErrorCode.QUOTE_NOT_FOUND, { provider: this.kind });
|
|
74
|
+
return {
|
|
75
|
+
id: (0, uuid_1.v4)(),
|
|
76
|
+
provider: this.kind,
|
|
77
|
+
coinTypeIn,
|
|
78
|
+
coinTypeOut,
|
|
79
|
+
amountIn,
|
|
80
|
+
amountOut: quote.data[0].routerResult.toTokenAmount,
|
|
81
|
+
rawAmountOut: quote.data[0].routerResult.toTokenAmount,
|
|
82
|
+
quote: quote.data[0],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
async fastSwap(options) {
|
|
86
|
+
const { quote, signer, signTransaction } = options;
|
|
87
|
+
error_1.MetaAgError.assert(quote.provider === metaAg_1.EProvider.OKX, "Invalid quote", error_1.MetaAgErrorCode.INVALID_QUOTE, { quote, expectedProvider: metaAg_1.EProvider.OKX });
|
|
88
|
+
const { tx, coin } = buildTx({ quote, signer });
|
|
89
|
+
tx.add((0, common_1.metaSettle)(quote, coin, this.metaOptions.slippageBps, this.metaOptions.tipBps, this.metaOptions.partner, this.metaOptions.partnerCommissionBps));
|
|
90
|
+
tx.transferObjects([coin], signer);
|
|
91
|
+
const txBytes = await tx.build({ client: this.client });
|
|
92
|
+
const { bytes, signature } = await signTransaction((0, utils_1.toBase64)(txBytes));
|
|
93
|
+
const res = await this.client.executeTransactionBlock({
|
|
94
|
+
signature,
|
|
95
|
+
transactionBlock: bytes,
|
|
96
|
+
});
|
|
97
|
+
return res.digest;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.OkxProvider = OkxProvider;
|
|
101
|
+
async function generateHmacSha256(message, secretKey) {
|
|
102
|
+
const encoder = new TextEncoder();
|
|
103
|
+
const encodeBase64 = (bytes) => {
|
|
104
|
+
if (typeof Buffer !== "undefined") {
|
|
105
|
+
return Buffer.from(bytes).toString("base64");
|
|
106
|
+
}
|
|
107
|
+
let binary = "";
|
|
108
|
+
for (let i = 0; i < bytes.byteLength; i++) {
|
|
109
|
+
binary += String.fromCharCode(bytes[i]);
|
|
110
|
+
}
|
|
111
|
+
if (typeof btoa !== "undefined") {
|
|
112
|
+
return btoa(binary);
|
|
113
|
+
}
|
|
114
|
+
throw new error_1.MetaAgError("Base64 encoder not available in this environment");
|
|
115
|
+
};
|
|
116
|
+
if (typeof globalThis !== "undefined" && globalThis.crypto?.subtle) {
|
|
117
|
+
const key = await globalThis.crypto.subtle.importKey("raw", encoder.encode(secretKey), { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
118
|
+
const signature = await globalThis.crypto.subtle.sign("HMAC", key, encoder.encode(message));
|
|
119
|
+
return encodeBase64(new Uint8Array(signature));
|
|
120
|
+
}
|
|
121
|
+
const { createHmac } = await Promise.resolve().then(() => __importStar(require("node:crypto")));
|
|
122
|
+
return createHmac("sha256", secretKey).update(message).digest("base64");
|
|
123
|
+
}
|
|
124
|
+
async function getHeaders(options, method, requestPath, queryString = "") {
|
|
125
|
+
const { apiKey, secretKey, apiPassphrase, projectId } = options;
|
|
126
|
+
if (!apiKey || !secretKey || !apiPassphrase || !projectId) {
|
|
127
|
+
throw new error_1.MetaAgError("Missing required environment variables");
|
|
128
|
+
}
|
|
129
|
+
const timestamp = new Date().toISOString();
|
|
130
|
+
const stringToSign = timestamp + method + requestPath + queryString;
|
|
131
|
+
return {
|
|
132
|
+
"Content-Type": "application/json",
|
|
133
|
+
"OK-ACCESS-KEY": apiKey,
|
|
134
|
+
"OK-ACCESS-SIGN": await generateHmacSha256(stringToSign, secretKey),
|
|
135
|
+
"OK-ACCESS-TIMESTAMP": timestamp,
|
|
136
|
+
"OK-ACCESS-PASSPHRASE": apiPassphrase,
|
|
137
|
+
"OK-ACCESS-PROJECT": projectId,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
const replaceFinalizeCommand = (tx, packageId) => {
|
|
141
|
+
const builder = transactions_1.TransactionDataBuilder.restore(tx.getData());
|
|
142
|
+
const i = builder.commands.findIndex((cmd) => cmd.$kind === "MoveCall" &&
|
|
143
|
+
(0, utils_1.normalizeSuiAddress)(cmd.MoveCall.package) ===
|
|
144
|
+
(0, utils_1.normalizeSuiAddress)(packageId) &&
|
|
145
|
+
cmd.MoveCall.module === "router" &&
|
|
146
|
+
cmd.MoveCall.function === "finalize");
|
|
147
|
+
const cmd = builder.commands[i];
|
|
148
|
+
error_1.MetaAgError.assert(cmd.MoveCall, "OKX: Finalize command not found", error_1.MetaAgErrorCode.OKX_FINALIZE_COMMAND_NOT_FOUND, { packageId });
|
|
149
|
+
builder.replaceCommand(i, transactions_1.Commands.MoveCall({
|
|
150
|
+
package: packageId,
|
|
151
|
+
module: "router",
|
|
152
|
+
function: "finalize_without_transfer",
|
|
153
|
+
typeArguments: cmd.MoveCall.typeArguments,
|
|
154
|
+
arguments: [
|
|
155
|
+
cmd.MoveCall.arguments[0],
|
|
156
|
+
cmd.MoveCall.arguments[5],
|
|
157
|
+
cmd.MoveCall.arguments[6],
|
|
158
|
+
],
|
|
159
|
+
}));
|
|
160
|
+
const tx2 = transactions_1.Transaction.from(builder.build());
|
|
161
|
+
return { tx: tx2, coin: { NestedResult: [i, 0] } };
|
|
162
|
+
};
|
|
163
|
+
const buildTx = (options) => {
|
|
164
|
+
const { quote, signer } = options;
|
|
165
|
+
error_1.MetaAgError.assert(quote.provider === metaAg_1.EProvider.OKX, "Invalid quote", error_1.MetaAgErrorCode.INVALID_QUOTE, { quote, expectedProvider: metaAg_1.EProvider.OKX });
|
|
166
|
+
const tx = transactions_1.Transaction.from(quote.quote.tx.data);
|
|
167
|
+
tx.setSenderIfNotSet(signer);
|
|
168
|
+
const { tx: tx2, coin } = replaceFinalizeCommand(tx, quote.quote.tx.to);
|
|
169
|
+
return { tx: tx2, coin };
|
|
170
|
+
};
|
|
171
|
+
const simulateOKXSwap = async (quote, inspector, simulation, metaOptions) => {
|
|
172
|
+
const { tx, coin } = buildTx({ quote, signer: quote.quote.tx.from });
|
|
173
|
+
tx.add((0, common_1.metaSettle)(quote, coin, 10000, metaOptions.tipBps, metaOptions.partner, metaOptions.partnerCommissionBps));
|
|
174
|
+
tx.transferObjects([coin], quote.quote.tx.from);
|
|
175
|
+
const res = await (0, common_1.simulateSwapTx)(tx, inspector, simulation);
|
|
176
|
+
return {
|
|
177
|
+
id: quote.id,
|
|
178
|
+
provider: quote.provider,
|
|
179
|
+
...res,
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
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.
|
|
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 (
|
|
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
|
|
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.
|
|
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
|
|
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,
|
|
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)(`${
|
|
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;
|
|
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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
2
|
+
import { AggregatorProvider, MetaAgOptions, MetaQuote, MetaSimulationOptions } from "../../types/metaAg";
|
|
3
|
+
import { SuiClientUtils } from "../../utils/SuiClientUtils";
|
|
4
|
+
export declare const simulateSwapTx: (tx: Transaction, inspector: SuiClientUtils, simulation: MetaSimulationOptions) => Promise<{
|
|
5
|
+
simulatedAmountOut: string;
|
|
6
|
+
gasUsed: import("@mysten/sui/client").GasCostSummary;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const simulateAggregator: (provider: AggregatorProvider, quote: MetaQuote, simulation: MetaSimulationOptions, inspector: SuiClientUtils, options: Required<MetaAgOptions>) => Promise<{
|
|
9
|
+
simulatedAmountOut: string;
|
|
10
|
+
gasUsed: import("@mysten/sui/client").GasCostSummary;
|
|
11
|
+
id: string;
|
|
12
|
+
provider: import("../../types/metaAg").EProvider.BLUEFIN7K_LEGACY | import("../../types/metaAg").EProvider.BLUEFIN7K | import("../../types/metaAg").EProvider.CETUS | import("../../types/metaAg").EProvider.FLOWX;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* this settlement does not charge commission fee for partner, since all integrated aggregators already charge commission fee for partner
|
|
16
|
+
* @param quote Meta Aggregator Quote
|
|
17
|
+
* @param coinOut Coin Out Object
|
|
18
|
+
* @param slippageBps Slippage Bps
|
|
19
|
+
* @param tipBps Tip Bps default = 0
|
|
20
|
+
* @param partner address of partner for analytic default is zero address
|
|
21
|
+
*/
|
|
22
|
+
export declare const metaSettle: (quote: MetaQuote, coinOut: TransactionObjectArgument, slippageBps?: number, tipBps?: number, partner?: string, commissionBps?: number) => (tx: Transaction) => void;
|
|
23
|
+
export declare const timeout: <T = any>(fn: () => Promise<T>, timeout: number, msg?: string) => Promise<T>;
|
|
24
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/common.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAI5D,eAAO,MAAM,cAAc,GACzB,IAAI,WAAW,EACf,WAAW,cAAc,EACzB,YAAY,qBAAqB;wBAmBE,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,eAoBb,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { DevInspectResults } from "@mysten/sui/client";
|
|
2
|
+
import { EProvider, MetaQuote, MetaQuoteOptions } from "../../types/metaAg";
|
|
3
|
+
export declare enum MetaAgErrorCode {
|
|
4
|
+
UNKNOWN = 1000,
|
|
5
|
+
TIMEOUT = 1001,
|
|
6
|
+
PROVIDER_NOT_FOUND = 1002,
|
|
7
|
+
PROVIDER_NOT_SUPPORTED = 1003,
|
|
8
|
+
INVALID_QUOTE = 1004,
|
|
9
|
+
QUOTE_NOT_FOUND = 1005,
|
|
10
|
+
INVALID_SIGNER_ADDRESS = 1006,
|
|
11
|
+
PROVIDER_NOT_SUPPORT_SWAP = 1007,
|
|
12
|
+
SIMULATION_FAILED = 1008,
|
|
13
|
+
OKX_FINALIZE_COMMAND_NOT_FOUND = 1100,
|
|
14
|
+
BLUEFINX_TRANSACTION_NOT_FOUND = 1200,
|
|
15
|
+
BLUEFINX_TRANSACTION_NOT_APPROVED = 1201,
|
|
16
|
+
BLUEFINX_TRANSACTION_DIGEST_NOT_FOUND = 1202
|
|
17
|
+
}
|
|
18
|
+
export type MetaAgErrorDetailsMap = {
|
|
19
|
+
[MetaAgErrorCode.UNKNOWN]: any;
|
|
20
|
+
[MetaAgErrorCode.TIMEOUT]: {
|
|
21
|
+
timeout: number;
|
|
22
|
+
};
|
|
23
|
+
[MetaAgErrorCode.PROVIDER_NOT_FOUND]: {
|
|
24
|
+
provider: EProvider;
|
|
25
|
+
};
|
|
26
|
+
[MetaAgErrorCode.PROVIDER_NOT_SUPPORTED]: {
|
|
27
|
+
provider: EProvider;
|
|
28
|
+
};
|
|
29
|
+
[MetaAgErrorCode.INVALID_QUOTE]: {
|
|
30
|
+
quote: MetaQuote;
|
|
31
|
+
expectedProvider: EProvider;
|
|
32
|
+
};
|
|
33
|
+
[MetaAgErrorCode.QUOTE_NOT_FOUND]: {
|
|
34
|
+
provider: EProvider;
|
|
35
|
+
quoteOptions?: MetaQuoteOptions;
|
|
36
|
+
};
|
|
37
|
+
[MetaAgErrorCode.INVALID_SIGNER_ADDRESS]: {
|
|
38
|
+
signer: string;
|
|
39
|
+
};
|
|
40
|
+
[MetaAgErrorCode.PROVIDER_NOT_SUPPORT_SWAP]: {
|
|
41
|
+
provider: EProvider;
|
|
42
|
+
};
|
|
43
|
+
[MetaAgErrorCode.SIMULATION_FAILED]: {
|
|
44
|
+
error: DevInspectResults["error"];
|
|
45
|
+
};
|
|
46
|
+
[MetaAgErrorCode.OKX_FINALIZE_COMMAND_NOT_FOUND]: {
|
|
47
|
+
packageId: string;
|
|
48
|
+
};
|
|
49
|
+
[MetaAgErrorCode.BLUEFINX_TRANSACTION_NOT_FOUND]: Record<string, never>;
|
|
50
|
+
[MetaAgErrorCode.BLUEFINX_TRANSACTION_NOT_APPROVED]: Record<string, never>;
|
|
51
|
+
[MetaAgErrorCode.BLUEFINX_TRANSACTION_DIGEST_NOT_FOUND]: Record<string, never>;
|
|
52
|
+
};
|
|
53
|
+
export type MetaAgErrorDetails<T extends MetaAgErrorCode> = T extends keyof MetaAgErrorDetailsMap ? MetaAgErrorDetailsMap[T] : never;
|
|
54
|
+
export declare class MetaAgError<T extends MetaAgErrorCode> extends Error {
|
|
55
|
+
code: T;
|
|
56
|
+
details?: MetaAgErrorDetails<T>;
|
|
57
|
+
constructor(message: string, code?: T, details?: MetaAgErrorDetails<T>);
|
|
58
|
+
static assert<T extends MetaAgErrorCode>(condition: any, message?: string | null, code?: T, details?: MetaAgErrorDetails<T>): asserts condition;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE5E,oBAAY,eAAe;IACzB,OAAO,OAAO;IACd,OAAO,OAAO;IACd,kBAAkB,OAAO;IACzB,sBAAsB,OAAO;IAC7B,aAAa,OAAO;IACpB,eAAe,OAAO;IACtB,sBAAsB,OAAO;IAC7B,yBAAyB,OAAO;IAChC,iBAAiB,OAAO;IAExB,8BAA8B,OAAO;IAErC,8BAA8B,OAAO;IACrC,iCAAiC,OAAO;IACxC,qCAAqC,OAAO;CAC7C;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,CAAC,eAAe,C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ACtD,CAAC,SAAS,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAE3E,qBAAa,WAAW,CAAC,CAAC,SAAS,eAAe,CAAE,SAAQ,KAAK;IAC/D,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;gBACpB,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAOtE,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,eAAe,EACrC,SAAS,EAAE,GAAG,EACd,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,EACvB,IAAI,CAAC,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC9B,OAAO,CAAC,SAAS;CAKrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SuiClient } from "@mysten/sui/client";
|
|
1
|
+
import { GetTransactionBlockParams, SuiClient, SuiTransactionBlockResponse } from "@mysten/sui/client";
|
|
2
2
|
import { TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
3
|
-
import { MetaAgOptions, MetaQuote, MetaQuoteOptions, MetaSimulationOptions, MetaSwapOptions } from "../../types/metaAg";
|
|
3
|
+
import { MetaAgOptions, MetaFastSwapOptions, MetaQuote, MetaQuoteOptions, MetaSimulationOptions, MetaSwapOptions } from "../../types/metaAg";
|
|
4
4
|
export declare class MetaAg {
|
|
5
5
|
client: SuiClient;
|
|
6
6
|
private providers;
|
|
@@ -10,6 +10,7 @@ export declare class MetaAg {
|
|
|
10
10
|
private _getProvider;
|
|
11
11
|
private _simulate;
|
|
12
12
|
private _quote;
|
|
13
|
+
private _fastSwap;
|
|
13
14
|
/**
|
|
14
15
|
* Get quotes from all providers
|
|
15
16
|
* @param options - quote options
|
|
@@ -19,11 +20,19 @@ export declare class MetaAg {
|
|
|
19
20
|
quote(options: MetaQuoteOptions, simulation?: MetaSimulationOptions): Promise<MetaQuote[]>;
|
|
20
21
|
/**
|
|
21
22
|
* Build transaction from quote
|
|
23
|
+
* @info Use this function to build composable transaction (ie: add more commands after the swap, consume the coin out object)
|
|
24
|
+
* @warning Providers that build transaction on the fly (typically RFQ, Swap-API providers ie: BluefinX, Okx, ...) are not supported, please use `fastSwap` instead
|
|
22
25
|
* @param options - build tx options
|
|
23
26
|
* @param slippageBps - slippage bps if not specified, fallback to global slippage bps, if none of them specified, default to 100
|
|
24
27
|
* @returns coin out object, you must consume it by transferObjects, or other sub sequence commands
|
|
25
28
|
*/
|
|
26
29
|
swap(options: MetaSwapOptions, slippageBps?: number): Promise<TransactionObjectArgument>;
|
|
30
|
+
/**
|
|
31
|
+
* Build, Sign, and Execute transaction in one step
|
|
32
|
+
* @param options - fast swap options
|
|
33
|
+
* @returns - txDigest of the transaction
|
|
34
|
+
*/
|
|
35
|
+
fastSwap(options: MetaFastSwapOptions, getTransactionBlockParams?: Omit<GetTransactionBlockParams, "digest">): Promise<SuiTransactionBlockResponse>;
|
|
27
36
|
/**
|
|
28
37
|
* Update meta aggregator options
|
|
29
38
|
* @param options - update options payload
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,EACzB,SAAS,EACT,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAQL,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EAGhB,MAAM,oBAAoB,CAAC;AAiB5B,qBAAa,MAAM;IACjB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,SAAS,CAAiD;IAClE,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,OAAO,CAA0B;gBAC7B,OAAO,CAAC,EAAE,aAAa;YAkBrB,YAAY;YAiEZ,SAAS;YAoCT,MAAM;YAqBN,SAAS;IA2BvB;;;;;OAKG;IACG,KAAK,CACT,OAAO,EAAE,gBAAgB,EACzB,UAAU,CAAC,EAAE,qBAAqB,GACjC,OAAO,CAAC,SAAS,EAAE,CAAC;IAsCvB;;;;;;;OAOG;IACG,IAAI,CACR,OAAO,EAAE,eAAe,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,yBAAyB,CAAC;IAmCrC;;;;OAIG;IACG,QAAQ,CACZ,OAAO,EAAE,mBAAmB,EAC5B,yBAAyB,CAAC,EAAE,IAAI,CAAC,yBAAyB,EAAE,QAAQ,CAAC,GACpE,OAAO,CAAC,2BAA2B,CAAC;IAwBvC;;;OAGG;IACH,mBAAmB,CAAC,OAAO,EAAE,aAAa;CA4B3C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SuiClient } from "@mysten/sui/client";
|
|
2
|
+
import { AggregatorProvider, Bluefin7kProviderOptions, EProvider, MetaAgOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions, QuoteProvider } from "../../../types/metaAg";
|
|
3
|
+
export declare class Bluefin7kProvider implements QuoteProvider, AggregatorProvider {
|
|
4
|
+
private readonly options;
|
|
5
|
+
private readonly metaOptions;
|
|
6
|
+
readonly kind = EProvider.BLUEFIN7K;
|
|
7
|
+
constructor(options: Bluefin7kProviderOptions, metaOptions: Required<MetaAgOptions>, client: SuiClient);
|
|
8
|
+
quote(quoteOptions: MetaQuoteOptions): Promise<MetaQuote>;
|
|
9
|
+
swap({ quote, signer, tx, coinIn }: MetaSwapOptions): Promise<import("@mysten/sui/dist/cjs/transactions").TransactionObjectArgument>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=bluefin7k.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bluefin7k.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/bluefin7k.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACd,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,iBAAkB,YAAW,aAAa,EAAE,kBAAkB;IAGvE,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAH9B,QAAQ,CAAC,IAAI,uBAAuB;gBAEjB,OAAO,EAAE,wBAAwB,EACjC,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,EACrD,MAAM,EAAE,SAAS;IAMb,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IA2BzD,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,eAAe;CAsB1D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SuiClient } from "@mysten/sui/client";
|
|
2
|
+
import { AggregatorProvider, BluefinLegacyProviderOptions, EProvider, MetaAgOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions, QuoteProvider } from "../../../types/metaAg";
|
|
3
|
+
export declare class BluefinLegacyProvider implements QuoteProvider, AggregatorProvider {
|
|
4
|
+
private readonly options;
|
|
5
|
+
private readonly metaOptions;
|
|
6
|
+
readonly kind = EProvider.BLUEFIN7K_LEGACY;
|
|
7
|
+
constructor(options: BluefinLegacyProviderOptions, metaOptions: Required<MetaAgOptions>, client: SuiClient);
|
|
8
|
+
quote(options: MetaQuoteOptions): Promise<MetaQuote>;
|
|
9
|
+
swap({ quote, signer, tx, coinIn }: MetaSwapOptions): Promise<import("@mysten/sui/dist/cjs/transactions").TransactionObjectArgument>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=bluefin7kLegacy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bluefin7kLegacy.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/bluefin7kLegacy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAS/C,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACd,MAAM,uBAAuB,CAAC;AAQ/B,qBAAa,qBACX,YAAW,aAAa,EAAE,kBAAkB;IAI1C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAH9B,QAAQ,CAAC,IAAI,8BAA8B;gBAExB,OAAO,EAAE,4BAA4B,EACrC,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,EACrD,MAAM,EAAE,SAAS;IAgBb,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAqBpD,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,eAAe;CAsB1D"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { SuiClient } from "@mysten/sui/client";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare class CetusProvider implements AgProvider {
|
|
2
|
+
import { AggregatorProvider, CetusProviderOptions, EProvider, MetaAgOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions, QuoteProvider } from "../../../types/metaAg";
|
|
3
|
+
export declare class CetusProvider implements QuoteProvider, AggregatorProvider {
|
|
5
4
|
private readonly options;
|
|
6
|
-
kind
|
|
5
|
+
readonly kind = EProvider.CETUS;
|
|
7
6
|
private readonly cetusClient;
|
|
8
7
|
constructor(options: CetusProviderOptions, metaOptions: MetaAgOptions, client: SuiClient);
|
|
9
8
|
quote(quoteOptions: MetaQuoteOptions): Promise<MetaQuote>;
|
|
10
|
-
swap(options: MetaSwapOptions): Promise<TransactionObjectArgument>;
|
|
9
|
+
swap(options: MetaSwapOptions): Promise<import("@mysten/sui/dist/cjs/transactions").TransactionObjectArgument>;
|
|
11
10
|
}
|
|
12
11
|
//# sourceMappingURL=cetus.d.ts.map
|
|
@@ -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;
|
|
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;AAG/C,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACd,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,aAAc,YAAW,aAAa,EAAE,kBAAkB;IAInE,OAAO,CAAC,QAAQ,CAAC,OAAO;IAH1B,QAAQ,CAAC,IAAI,mBAAmB;IAChC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;gBAE5B,OAAO,EAAE,oBAAoB,EAC9C,WAAW,EAAE,aAAa,EAC1B,MAAM,EAAE,SAAS;IAab,KAAK,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IA+BzD,IAAI,CAAC,OAAO,EAAE,eAAe;CAepC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SuiClient } from "@mysten/sui/client";
|
|
2
2
|
import { TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
3
|
-
import {
|
|
4
|
-
export declare class FlowxProvider implements
|
|
3
|
+
import { AggregatorProvider, EProvider, FlowxProviderOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions, QuoteProvider } from "../../../types/metaAg";
|
|
4
|
+
export declare class FlowxProvider implements QuoteProvider, AggregatorProvider {
|
|
5
5
|
private readonly options;
|
|
6
6
|
private readonly client;
|
|
7
|
-
kind
|
|
7
|
+
readonly kind = EProvider.FLOWX;
|
|
8
8
|
private quoter;
|
|
9
9
|
constructor(options: FlowxProviderOptions, client: SuiClient);
|
|
10
10
|
quote(quoteOptions: MetaQuoteOptions): Promise<MetaQuote>;
|
|
@@ -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;AAGrE,OAAO,EACL,
|
|
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;AAGrE,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACd,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,aAAc,YAAW,aAAa,EAAE,kBAAkB;IAInE,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJzB,QAAQ,CAAC,IAAI,mBAAmB;IAChC,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;CA0BzE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SuiClient } from "@mysten/sui/client";
|
|
2
|
+
import { EProvider, MetaAgOptions, MetaFastSwapOptions, MetaQuote, MetaQuoteOptions, MetaSimulationOptions, OkxProviderOptions, QuoteProvider, SwapAPIProvider } from "../../../types/metaAg";
|
|
3
|
+
import { SuiClientUtils } from "../../../utils/SuiClientUtils";
|
|
4
|
+
export declare class OkxProvider implements QuoteProvider, SwapAPIProvider {
|
|
5
|
+
private readonly options;
|
|
6
|
+
private readonly metaOptions;
|
|
7
|
+
private readonly client;
|
|
8
|
+
readonly kind = EProvider.OKX;
|
|
9
|
+
constructor(options: OkxProviderOptions, metaOptions: Required<MetaAgOptions>, client: SuiClient);
|
|
10
|
+
quote({ amountIn, coinTypeIn, coinTypeOut, signer, }: MetaQuoteOptions): Promise<MetaQuote | null>;
|
|
11
|
+
fastSwap(options: MetaFastSwapOptions): Promise<string>;
|
|
12
|
+
}
|
|
13
|
+
export declare const simulateOKXSwap: <T extends MetaQuote & {
|
|
14
|
+
provider: EProvider.OKX;
|
|
15
|
+
}>(quote: T, inspector: SuiClientUtils, simulation: MetaSimulationOptions, metaOptions: Required<MetaAgOptions>) => Promise<{
|
|
16
|
+
simulatedAmountOut: string;
|
|
17
|
+
gasUsed: import("@mysten/sui/client").GasCostSummary;
|
|
18
|
+
id: string;
|
|
19
|
+
provider: EProvider.OKX;
|
|
20
|
+
}>;
|
|
21
|
+
//# sourceMappingURL=okx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"okx.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/okx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAc/C,OAAO,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