@7kprotocol/sdk-ts 3.5.2-beta.2 → 3.5.2-beta.4
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/features/metaAg/common.js +3 -2
- package/lib/cjs/features/metaAg/error.js +35 -0
- package/lib/cjs/features/metaAg/index.js +10 -7
- package/lib/cjs/features/metaAg/providers/astro.js +2 -2
- package/lib/cjs/features/metaAg/providers/bluefin7k.js +3 -8
- package/lib/cjs/features/metaAg/providers/bluefin7kLegacy.js +2 -2
- package/lib/cjs/features/metaAg/providers/bluefinx.js +5 -5
- package/lib/cjs/features/metaAg/providers/cetus.js +3 -3
- package/lib/cjs/features/metaAg/providers/flowx.js +2 -2
- package/lib/cjs/features/metaAg/providers/okx.js +12 -11
- package/lib/cjs/types/features/metaAg/common.d.ts.map +1 -1
- 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.map +1 -1
- package/lib/cjs/types/features/metaAg/providers/astro.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/providers/bluefin7k.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/providers/bluefin7kLegacy.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/providers/bluefinx.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/providers/cetus.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/providers/flowx.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/providers/okx.d.ts.map +1 -1
- package/lib/cjs/types/okx.js +1 -1
- package/lib/cjs/types/types/okx.d.ts +61 -48
- package/lib/cjs/types/types/okx.d.ts.map +1 -1
- 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/features/metaAg/common.js +3 -2
- package/lib/esm/features/metaAg/error.js +33 -0
- package/lib/esm/features/metaAg/index.js +10 -7
- package/lib/esm/features/metaAg/providers/astro.js +2 -2
- package/lib/esm/features/metaAg/providers/bluefin7k.js +4 -9
- package/lib/esm/features/metaAg/providers/bluefin7kLegacy.js +2 -2
- package/lib/esm/features/metaAg/providers/bluefinx.js +5 -5
- package/lib/esm/features/metaAg/providers/cetus.js +3 -3
- package/lib/esm/features/metaAg/providers/flowx.js +2 -2
- package/lib/esm/features/metaAg/providers/okx.js +12 -11
- package/lib/esm/types/features/metaAg/common.d.ts.map +1 -1
- 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.map +1 -1
- package/lib/esm/types/features/metaAg/providers/astro.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/providers/bluefin7k.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/providers/bluefin7kLegacy.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/providers/bluefinx.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/providers/cetus.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/providers/flowx.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/providers/okx.d.ts.map +1 -1
- package/lib/esm/types/okx.js +1 -1
- package/lib/esm/types/types/okx.d.ts +61 -48
- package/lib/esm/types/types/okx.d.ts.map +1 -1
- 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 +1 -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/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
|
@@ -4,6 +4,7 @@ exports.timeout = exports.metaSettle = exports.simulateAggregator = exports.simu
|
|
|
4
4
|
const transactions_1 = require("@mysten/sui/transactions");
|
|
5
5
|
const _7k_1 = require("../../constants/_7k");
|
|
6
6
|
const buildTx_1 = require("../swap/buildTx");
|
|
7
|
+
const error_1 = require("./error");
|
|
7
8
|
const DEFAULT_GAS_USED = {
|
|
8
9
|
computationCost: "0",
|
|
9
10
|
nonRefundableStorageFee: "0",
|
|
@@ -25,7 +26,7 @@ const simulateSwapTx = async (tx, inspector, simulation) => {
|
|
|
25
26
|
transactionBlock: tx,
|
|
26
27
|
}), simulation.timeout ?? 2000);
|
|
27
28
|
if (res.effects.status.status === "failure") {
|
|
28
|
-
throw new
|
|
29
|
+
throw new error_1.MetaAgError(res.error ?? "Simulation failed", error_1.MetaAgErrorCode.SIMULATION_FAILED, { error: res.error });
|
|
29
30
|
}
|
|
30
31
|
const amountOut = extractAmountOutWrapper(res.events);
|
|
31
32
|
return {
|
|
@@ -107,7 +108,7 @@ const timeout = async (fn, timeout, msg) => {
|
|
|
107
108
|
if (timeout <= 0)
|
|
108
109
|
return fn();
|
|
109
110
|
return new Promise((resolve, reject) => {
|
|
110
|
-
const timer = setTimeout(() => reject(new
|
|
111
|
+
const timer = setTimeout(() => reject(new error_1.MetaAgError(`Timeout ${msg ?? "operation"}`, error_1.MetaAgErrorCode.TIMEOUT, { timeout })), timeout);
|
|
111
112
|
fn()
|
|
112
113
|
.then(resolve)
|
|
113
114
|
.catch(reject)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MetaAgError = exports.MetaAgErrorCode = void 0;
|
|
4
|
+
var MetaAgErrorCode;
|
|
5
|
+
(function (MetaAgErrorCode) {
|
|
6
|
+
MetaAgErrorCode[MetaAgErrorCode["UNKNOWN"] = 1000] = "UNKNOWN";
|
|
7
|
+
MetaAgErrorCode[MetaAgErrorCode["TIMEOUT"] = 1001] = "TIMEOUT";
|
|
8
|
+
MetaAgErrorCode[MetaAgErrorCode["PROVIDER_NOT_FOUND"] = 1002] = "PROVIDER_NOT_FOUND";
|
|
9
|
+
MetaAgErrorCode[MetaAgErrorCode["PROVIDER_NOT_SUPPORTED"] = 1003] = "PROVIDER_NOT_SUPPORTED";
|
|
10
|
+
MetaAgErrorCode[MetaAgErrorCode["INVALID_QUOTE"] = 1004] = "INVALID_QUOTE";
|
|
11
|
+
MetaAgErrorCode[MetaAgErrorCode["QUOTE_NOT_FOUND"] = 1005] = "QUOTE_NOT_FOUND";
|
|
12
|
+
MetaAgErrorCode[MetaAgErrorCode["INVALID_SIGNER_ADDRESS"] = 1006] = "INVALID_SIGNER_ADDRESS";
|
|
13
|
+
MetaAgErrorCode[MetaAgErrorCode["PROVIDER_NOT_SUPPORT_SWAP"] = 1007] = "PROVIDER_NOT_SUPPORT_SWAP";
|
|
14
|
+
MetaAgErrorCode[MetaAgErrorCode["SIMULATION_FAILED"] = 1008] = "SIMULATION_FAILED";
|
|
15
|
+
// OKX error
|
|
16
|
+
MetaAgErrorCode[MetaAgErrorCode["OKX_FINALIZE_COMMAND_NOT_FOUND"] = 1100] = "OKX_FINALIZE_COMMAND_NOT_FOUND";
|
|
17
|
+
// BluefinX error
|
|
18
|
+
MetaAgErrorCode[MetaAgErrorCode["BLUEFINX_TRANSACTION_NOT_FOUND"] = 1200] = "BLUEFINX_TRANSACTION_NOT_FOUND";
|
|
19
|
+
MetaAgErrorCode[MetaAgErrorCode["BLUEFINX_TRANSACTION_NOT_APPROVED"] = 1201] = "BLUEFINX_TRANSACTION_NOT_APPROVED";
|
|
20
|
+
MetaAgErrorCode[MetaAgErrorCode["BLUEFINX_TRANSACTION_DIGEST_NOT_FOUND"] = 1202] = "BLUEFINX_TRANSACTION_DIGEST_NOT_FOUND";
|
|
21
|
+
})(MetaAgErrorCode || (exports.MetaAgErrorCode = MetaAgErrorCode = {}));
|
|
22
|
+
class MetaAgError extends Error {
|
|
23
|
+
constructor(message, code, details) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.name = "MetaAgError";
|
|
26
|
+
this.code = code ?? MetaAgErrorCode.UNKNOWN;
|
|
27
|
+
this.details = details;
|
|
28
|
+
}
|
|
29
|
+
static assert(condition, message, code, details) {
|
|
30
|
+
if (!condition) {
|
|
31
|
+
throw new MetaAgError(message ?? "Assertion failed", code, details);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.MetaAgError = MetaAgError;
|
|
@@ -39,10 +39,11 @@ const transactions_1 = require("@mysten/sui/transactions");
|
|
|
39
39
|
const utils_1 = require("@mysten/sui/utils");
|
|
40
40
|
const sui_1 = require("../../constants/sui");
|
|
41
41
|
const metaAg_1 = require("../../types/metaAg");
|
|
42
|
-
const
|
|
42
|
+
const sui_2 = require("../../utils/sui");
|
|
43
43
|
const SuiClientUtils_1 = require("../../utils/SuiClientUtils");
|
|
44
44
|
const buildTx_1 = require("../swap/buildTx");
|
|
45
45
|
const common_1 = require("./common");
|
|
46
|
+
const error_1 = require("./error");
|
|
46
47
|
const bluefin7kLegacy_1 = require("./providers/bluefin7kLegacy");
|
|
47
48
|
const bluefinx_1 = require("./providers/bluefinx");
|
|
48
49
|
const okx_1 = require("./providers/okx");
|
|
@@ -76,7 +77,7 @@ class MetaAg {
|
|
|
76
77
|
if (p)
|
|
77
78
|
return p;
|
|
78
79
|
const providerOptions = this.options.providers[provider];
|
|
79
|
-
|
|
80
|
+
error_1.MetaAgError.assert(!!providerOptions, `Provider not found: ${provider}`, error_1.MetaAgErrorCode.PROVIDER_NOT_FOUND, { provider });
|
|
80
81
|
switch (provider) {
|
|
81
82
|
case metaAg_1.EProvider.BLUEFIN7K_LEGACY:
|
|
82
83
|
this.providers[metaAg_1.EProvider.BLUEFIN7K_LEGACY] = new bluefin7kLegacy_1.BluefinLegacyProvider(providerOptions, this.options, this.client);
|
|
@@ -104,7 +105,7 @@ class MetaAg {
|
|
|
104
105
|
this.providers[metaAg_1.EProvider.ASTRO] = new AstroProvider(providerOptions);
|
|
105
106
|
break;
|
|
106
107
|
default:
|
|
107
|
-
throw new
|
|
108
|
+
throw new error_1.MetaAgError(`Provider not supported: ${provider}`, error_1.MetaAgErrorCode.PROVIDER_NOT_SUPPORTED, { provider });
|
|
108
109
|
}
|
|
109
110
|
return this.providers[provider];
|
|
110
111
|
}
|
|
@@ -119,7 +120,7 @@ class MetaAg {
|
|
|
119
120
|
case metaAg_1.EProvider.OKX:
|
|
120
121
|
return (0, okx_1.simulateOKXSwap)(quote, this.inspector, simulation, this.options);
|
|
121
122
|
default:
|
|
122
|
-
throw new
|
|
123
|
+
throw new error_1.MetaAgError(`Provider not supported: ${provider.kind}`, error_1.MetaAgErrorCode.PROVIDER_NOT_SUPPORTED, { provider: provider.kind });
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
126
|
catch (error) {
|
|
@@ -207,8 +208,9 @@ class MetaAg {
|
|
|
207
208
|
*/
|
|
208
209
|
async swap(options, slippageBps) {
|
|
209
210
|
const provider = await this._getProvider(options.quote.provider);
|
|
210
|
-
|
|
211
|
-
|
|
211
|
+
error_1.MetaAgError.assert(!!provider, `Provider not found: ${options.quote.provider}`, error_1.MetaAgErrorCode.PROVIDER_NOT_FOUND, { provider: options.quote.provider });
|
|
212
|
+
error_1.MetaAgError.assert((0, metaAg_1.isAggregatorProvider)(provider), `Provider does not support swap: ${provider.kind}, use fastSwap instead`, error_1.MetaAgErrorCode.PROVIDER_NOT_SUPPORT_SWAP, { provider: provider.kind });
|
|
213
|
+
error_1.MetaAgError.assert(!(0, sui_2.isSystemAddress)(options.signer), "Invalid signer address", error_1.MetaAgErrorCode.INVALID_SIGNER_ADDRESS, { signer: options.signer });
|
|
212
214
|
const coinOut = await provider.swap(options);
|
|
213
215
|
options.tx.add((0, common_1.metaSettle)(options.quote, coinOut, slippageBps ?? this.options.slippageBps ?? 100, this.options.tipBps, this.options.partner, this.options.partnerCommissionBps));
|
|
214
216
|
options.tx.setSenderIfNotSet(options.signer);
|
|
@@ -220,6 +222,7 @@ class MetaAg {
|
|
|
220
222
|
* @returns - txDigest of the transaction
|
|
221
223
|
*/
|
|
222
224
|
async fastSwap(options, getTransactionBlockParams) {
|
|
225
|
+
error_1.MetaAgError.assert(!(0, sui_2.isSystemAddress)(options.signer), "Invalid signer address", error_1.MetaAgErrorCode.INVALID_SIGNER_ADDRESS, { signer: options.signer });
|
|
223
226
|
const provider = await this._getProvider(options.quote.provider);
|
|
224
227
|
if ((0, metaAg_1.isAggregatorProvider)(provider)) {
|
|
225
228
|
return this._fastSwap(options, getTransactionBlockParams);
|
|
@@ -231,7 +234,7 @@ class MetaAg {
|
|
|
231
234
|
});
|
|
232
235
|
}
|
|
233
236
|
else {
|
|
234
|
-
throw new
|
|
237
|
+
throw new error_1.MetaAgError(`Provider not supported: ${provider.kind}`, error_1.MetaAgErrorCode.PROVIDER_NOT_SUPPORTED, { provider: provider.kind });
|
|
235
238
|
}
|
|
236
239
|
}
|
|
237
240
|
/**
|
|
@@ -5,7 +5,7 @@ const astros_aggregator_sdk_1 = require("@naviprotocol/astros-aggregator-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 AstroProvider {
|
|
10
10
|
constructor(options) {
|
|
11
11
|
this.options = options;
|
|
@@ -35,7 +35,7 @@ class AstroProvider {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
async swap({ signer, quote, coinIn, tx }) {
|
|
38
|
-
|
|
38
|
+
error_1.MetaAgError.assert(quote.provider === metaAg_1.EProvider.ASTRO, "Invalid quote", error_1.MetaAgErrorCode.INVALID_QUOTE, { quote, expectedProvider: metaAg_1.EProvider.ASTRO });
|
|
39
39
|
const coin = await (0, astros_aggregator_sdk_1.buildSwapPTBFromQuote)(signer, tx, 0, coinIn, quote.quote);
|
|
40
40
|
return coin;
|
|
41
41
|
}
|
|
@@ -5,7 +5,7 @@ const bluefin7k_aggregator_sdk_1 = require("@bluefin-exchange/bluefin7k-aggregat
|
|
|
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 Bluefin7kProvider {
|
|
10
10
|
constructor(options, metaOptions, client) {
|
|
11
11
|
this.options = options;
|
|
@@ -13,11 +13,6 @@ class Bluefin7kProvider {
|
|
|
13
13
|
this.kind = metaAg_1.EProvider.BLUEFIN7K;
|
|
14
14
|
if (options.apiKey)
|
|
15
15
|
bluefin7k_aggregator_sdk_1.Config.setApiKey(options.apiKey);
|
|
16
|
-
if (options.api &&
|
|
17
|
-
"setApi" in bluefin7k_aggregator_sdk_1.Config &&
|
|
18
|
-
typeof bluefin7k_aggregator_sdk_1.Config.setApi === "function") {
|
|
19
|
-
bluefin7k_aggregator_sdk_1.Config.setApi(options.api);
|
|
20
|
-
}
|
|
21
16
|
bluefin7k_aggregator_sdk_1.Config.setSuiClient(client);
|
|
22
17
|
}
|
|
23
18
|
async quote(quoteOptions) {
|
|
@@ -29,7 +24,7 @@ class Bluefin7kProvider {
|
|
|
29
24
|
excludedPools: this.options.excludedPools,
|
|
30
25
|
targetPools: this.options.targetPools,
|
|
31
26
|
});
|
|
32
|
-
|
|
27
|
+
error_1.MetaAgError.assert(!!quote, "No quote found", error_1.MetaAgErrorCode.QUOTE_NOT_FOUND, { provider: this.kind });
|
|
33
28
|
return {
|
|
34
29
|
id: (0, uuid_1.v4)(),
|
|
35
30
|
provider: metaAg_1.EProvider.BLUEFIN7K,
|
|
@@ -42,7 +37,7 @@ class Bluefin7kProvider {
|
|
|
42
37
|
};
|
|
43
38
|
}
|
|
44
39
|
async swap({ quote, signer, tx, coinIn }) {
|
|
45
|
-
|
|
40
|
+
error_1.MetaAgError.assert(quote.provider === metaAg_1.EProvider.BLUEFIN7K, "Invalid quote", error_1.MetaAgErrorCode.INVALID_QUOTE, { quote, expectedProvider: metaAg_1.EProvider.BLUEFIN7K });
|
|
46
41
|
const { coinOut } = await (0, bluefin7k_aggregator_sdk_1.buildTx)({
|
|
47
42
|
quoteResponse: quote.quote,
|
|
48
43
|
accountAddress: signer,
|
|
@@ -6,9 +6,9 @@ const uuid_1 = require("uuid");
|
|
|
6
6
|
const config_1 = require("../../../config");
|
|
7
7
|
const _7k_1 = require("../../../constants/_7k");
|
|
8
8
|
const metaAg_1 = require("../../../types/metaAg");
|
|
9
|
-
const condition_1 = require("../../../utils/condition");
|
|
10
9
|
const buildTxV2_1 = require("../../swap/buildTxV2");
|
|
11
10
|
const getQuote_1 = require("../../swap/getQuote");
|
|
11
|
+
const error_1 = require("../error");
|
|
12
12
|
const WORMHOLE_STATE_ID = "0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c";
|
|
13
13
|
const PYTH_STATE_ID = "0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8";
|
|
14
14
|
class BluefinLegacyProvider {
|
|
@@ -48,7 +48,7 @@ class BluefinLegacyProvider {
|
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
async swap({ quote, signer, tx, coinIn }) {
|
|
51
|
-
|
|
51
|
+
error_1.MetaAgError.assert(quote.provider === metaAg_1.EProvider.BLUEFIN7K_LEGACY, "Invalid quote", error_1.MetaAgErrorCode.INVALID_QUOTE, { quote, expectedProvider: metaAg_1.EProvider.BLUEFIN7K_LEGACY });
|
|
52
52
|
const { coinOut } = await (0, buildTxV2_1.buildTxV2)({
|
|
53
53
|
quoteResponse: quote.quote,
|
|
54
54
|
accountAddress: signer,
|
|
@@ -9,10 +9,10 @@ const _7k_1 = require("../../../constants/_7k");
|
|
|
9
9
|
const client_1 = require("../../../libs/protocols/bluefinx/client");
|
|
10
10
|
const aggregator_1 = require("../../../types/aggregator");
|
|
11
11
|
const metaAg_1 = require("../../../types/metaAg");
|
|
12
|
-
const condition_1 = require("../../../utils/condition");
|
|
13
12
|
const buildTxV2_1 = require("../../swap/buildTxV2");
|
|
14
13
|
const getQuote_1 = require("../../swap/getQuote");
|
|
15
14
|
const common_1 = require("../common");
|
|
15
|
+
const error_1 = require("../error");
|
|
16
16
|
const SUPPORT_COINS = [
|
|
17
17
|
"0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
|
|
18
18
|
"0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
|
|
@@ -54,7 +54,7 @@ class BluefinXProvider {
|
|
|
54
54
|
SUPPORT_COINS.includes(options.coinTypeOut));
|
|
55
55
|
}
|
|
56
56
|
async fastSwap(options) {
|
|
57
|
-
|
|
57
|
+
error_1.MetaAgError.assert(options.quote.provider === this.kind, "Invalid BluefinX quote", error_1.MetaAgErrorCode.INVALID_QUOTE, { quote: options.quote, expectedProvider: this.kind });
|
|
58
58
|
const quote = options.quote.quote;
|
|
59
59
|
const tx = new transactions_1.Transaction();
|
|
60
60
|
const { tx: bluefinTx } = await (0, buildTxV2_1.buildTxV2Int)({
|
|
@@ -76,11 +76,11 @@ class BluefinXProvider {
|
|
|
76
76
|
tx.transferObjects([coinOut], options.signer);
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
|
-
|
|
79
|
+
error_1.MetaAgError.assert(bluefinTx instanceof aggregator_1.BluefinXTx, "BluefinX transaction not found", error_1.MetaAgErrorCode.BLUEFINX_TRANSACTION_NOT_FOUND, {});
|
|
80
80
|
const { signature } = await options.signTransaction(bluefinTx.txBytes);
|
|
81
81
|
const res = await (0, client_1.executeBluefinTx)(bluefinTx, signature);
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
error_1.MetaAgError.assert(res.approved, "BluefinX transaction not approved", error_1.MetaAgErrorCode.BLUEFINX_TRANSACTION_NOT_APPROVED, {});
|
|
83
|
+
error_1.MetaAgError.assert(res.txDigest, "BluefinX transaction digest not found", error_1.MetaAgErrorCode.BLUEFINX_TRANSACTION_DIGEST_NOT_FOUND, {});
|
|
84
84
|
return res.txDigest;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -5,7 +5,7 @@ const aggregator_sdk_1 = require("@cetusprotocol/aggregator-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 CetusProvider {
|
|
10
10
|
constructor(options, metaOptions, client) {
|
|
11
11
|
this.options = options;
|
|
@@ -33,7 +33,7 @@ class CetusProvider {
|
|
|
33
33
|
depth: this.options.depth,
|
|
34
34
|
liquidityChanges: this.options.liquidityChanges,
|
|
35
35
|
});
|
|
36
|
-
|
|
36
|
+
error_1.MetaAgError.assert(!!quote, "No quote found", error_1.MetaAgErrorCode.QUOTE_NOT_FOUND, { provider: this.kind });
|
|
37
37
|
return {
|
|
38
38
|
id: (0, uuid_1.v4)(),
|
|
39
39
|
provider: metaAg_1.EProvider.CETUS,
|
|
@@ -46,7 +46,7 @@ class CetusProvider {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
async swap(options) {
|
|
49
|
-
|
|
49
|
+
error_1.MetaAgError.assert(options.quote.provider === metaAg_1.EProvider.CETUS, "Expect Cetus quote", error_1.MetaAgErrorCode.INVALID_QUOTE, { quote: options.quote, expectedProvider: metaAg_1.EProvider.CETUS });
|
|
50
50
|
const coinOut = await this.cetusClient.routerSwap({
|
|
51
51
|
inputCoin: options.coinIn,
|
|
52
52
|
router: options.quote.quote,
|
|
@@ -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;
|
|
@@ -36,7 +36,7 @@ class FlowxProvider {
|
|
|
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);
|
|
@@ -39,10 +39,11 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
39
39
|
const uuid_1 = require("uuid");
|
|
40
40
|
const tokens_1 = require("../../../constants/tokens");
|
|
41
41
|
const metaAg_1 = require("../../../types/metaAg");
|
|
42
|
-
const
|
|
42
|
+
const sui_1 = require("../../../utils/sui");
|
|
43
43
|
const common_1 = require("../common");
|
|
44
|
+
const error_1 = require("../error");
|
|
44
45
|
const API = "https://web3.okx.com";
|
|
45
|
-
const SWAP_PATH = "/api/
|
|
46
|
+
const SWAP_PATH = "/api/v6/dex/aggregator/swap";
|
|
46
47
|
const CHAIN_ID = "784";
|
|
47
48
|
const NORMALIZED_SUI_TYPE = (0, utils_1.normalizeStructTag)(tokens_1.SUI_TYPE);
|
|
48
49
|
class OkxProvider {
|
|
@@ -53,14 +54,14 @@ class OkxProvider {
|
|
|
53
54
|
this.kind = metaAg_1.EProvider.OKX;
|
|
54
55
|
}
|
|
55
56
|
async quote({ amountIn, coinTypeIn, coinTypeOut, signer, }) {
|
|
56
|
-
if (!signer)
|
|
57
|
+
if (!signer || (0, sui_1.isSystemAddress)(signer))
|
|
57
58
|
return null;
|
|
58
59
|
const request = {
|
|
59
|
-
|
|
60
|
+
chainIndex: CHAIN_ID,
|
|
60
61
|
amount: amountIn,
|
|
61
62
|
fromTokenAddress: coinTypeIn === NORMALIZED_SUI_TYPE ? tokens_1.SUI_TYPE : coinTypeIn,
|
|
62
63
|
toTokenAddress: coinTypeOut === NORMALIZED_SUI_TYPE ? tokens_1.SUI_TYPE : coinTypeOut,
|
|
63
|
-
|
|
64
|
+
slippagePercent: (this.metaOptions.slippageBps / 100).toString(),
|
|
64
65
|
userWalletAddress: signer,
|
|
65
66
|
};
|
|
66
67
|
const queryString = "?" + new URLSearchParams(request).toString();
|
|
@@ -69,7 +70,7 @@ class OkxProvider {
|
|
|
69
70
|
headers: await getHeaders(this.options, "GET", SWAP_PATH, queryString),
|
|
70
71
|
});
|
|
71
72
|
const quote = (await response.json());
|
|
72
|
-
|
|
73
|
+
error_1.MetaAgError.assert(quote.code === "0" && quote.data.length > 0, "No quote found", error_1.MetaAgErrorCode.QUOTE_NOT_FOUND, { provider: this.kind });
|
|
73
74
|
return {
|
|
74
75
|
id: (0, uuid_1.v4)(),
|
|
75
76
|
provider: this.kind,
|
|
@@ -83,7 +84,7 @@ class OkxProvider {
|
|
|
83
84
|
}
|
|
84
85
|
async fastSwap(options) {
|
|
85
86
|
const { quote, signer, signTransaction } = options;
|
|
86
|
-
|
|
87
|
+
error_1.MetaAgError.assert(quote.provider === metaAg_1.EProvider.OKX, "Invalid quote", error_1.MetaAgErrorCode.INVALID_QUOTE, { quote, expectedProvider: metaAg_1.EProvider.OKX });
|
|
87
88
|
const { tx, coin } = buildTx({ quote, signer });
|
|
88
89
|
tx.add((0, common_1.metaSettle)(quote, coin, this.metaOptions.slippageBps, this.metaOptions.tipBps, this.metaOptions.partner, this.metaOptions.partnerCommissionBps));
|
|
89
90
|
tx.transferObjects([coin], signer);
|
|
@@ -110,7 +111,7 @@ async function generateHmacSha256(message, secretKey) {
|
|
|
110
111
|
if (typeof btoa !== "undefined") {
|
|
111
112
|
return btoa(binary);
|
|
112
113
|
}
|
|
113
|
-
throw new
|
|
114
|
+
throw new error_1.MetaAgError("Base64 encoder not available in this environment");
|
|
114
115
|
};
|
|
115
116
|
if (typeof globalThis !== "undefined" && globalThis.crypto?.subtle) {
|
|
116
117
|
const key = await globalThis.crypto.subtle.importKey("raw", encoder.encode(secretKey), { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
@@ -123,7 +124,7 @@ async function generateHmacSha256(message, secretKey) {
|
|
|
123
124
|
async function getHeaders(options, method, requestPath, queryString = "") {
|
|
124
125
|
const { apiKey, secretKey, apiPassphrase, projectId } = options;
|
|
125
126
|
if (!apiKey || !secretKey || !apiPassphrase || !projectId) {
|
|
126
|
-
throw new
|
|
127
|
+
throw new error_1.MetaAgError("Missing required environment variables");
|
|
127
128
|
}
|
|
128
129
|
const timestamp = new Date().toISOString();
|
|
129
130
|
const stringToSign = timestamp + method + requestPath + queryString;
|
|
@@ -144,7 +145,7 @@ const replaceFinalizeCommand = (tx, packageId) => {
|
|
|
144
145
|
cmd.MoveCall.module === "router" &&
|
|
145
146
|
cmd.MoveCall.function === "finalize");
|
|
146
147
|
const cmd = builder.commands[i];
|
|
147
|
-
|
|
148
|
+
error_1.MetaAgError.assert(cmd.MoveCall, "OKX: Finalize command not found", error_1.MetaAgErrorCode.OKX_FINALIZE_COMMAND_NOT_FOUND, { packageId });
|
|
148
149
|
builder.replaceCommand(i, transactions_1.Commands.MoveCall({
|
|
149
150
|
package: packageId,
|
|
150
151
|
module: "router",
|
|
@@ -161,7 +162,7 @@ const replaceFinalizeCommand = (tx, packageId) => {
|
|
|
161
162
|
};
|
|
162
163
|
const buildTx = (options) => {
|
|
163
164
|
const { quote, signer } = options;
|
|
164
|
-
|
|
165
|
+
error_1.MetaAgError.assert(quote.provider === metaAg_1.EProvider.OKX, "Invalid quote", error_1.MetaAgErrorCode.INVALID_QUOTE, { quote, expectedProvider: metaAg_1.EProvider.OKX });
|
|
165
166
|
const tx = transactions_1.Transaction.from(quote.quote.tx.data);
|
|
166
167
|
tx.setSenderIfNotSet(signer);
|
|
167
168
|
const { tx: tx2, coin } = replaceFinalizeCommand(tx, quote.quote.tx.to);
|
|
@@ -1 +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;
|
|
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;AAU5D,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;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,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IAC/B,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC;IAC9D,CAAC,eAAe,CAAC,sBAAsB,CAAC,EAAE;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC;IAClE,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE;QAC/B,KAAK,EAAE,SAAS,CAAC;QACjB,gBAAgB,EAAE,SAAS,CAAC;KAC7B,CAAC;IACF,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE;QACjC,QAAQ,EAAE,SAAS,CAAC;QACpB,YAAY,CAAC,EAAE,gBAAgB,CAAC;KACjC,CAAC;IACF,CAAC,eAAe,CAAC,sBAAsB,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7D,CAAC,eAAe,CAAC,yBAAyB,CAAC,EAAE;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC;IACrE,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE;QAAE,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAA;KAAE,CAAC;IAE3E,CAAC,eAAe,CAAC,8BAA8B,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAExE,CAAC,eAAe,CAAC,8BAA8B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACxE,CAAC,eAAe,CAAC,iCAAiC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC,eAAe,CAAC,qCAAqC,CAAC,EAAE,MAAM,CAC7D,MAAM,EACN,KAAK,CACN,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,eAAe,IACtD,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 +1 @@
|
|
|
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,EAUL,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EAGhB,MAAM,oBAAoB,CAAC;
|
|
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,EAUL,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EAGhB,MAAM,oBAAoB,CAAC;AAyB5B,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;YA8EZ,SAAS;YAsCT,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/astro.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACd,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,aAAc,YAAW,aAAa,EAAE,kBAAkB;IAEzD,OAAO,CAAC,QAAQ,CAAC,OAAO;IADpC,QAAQ,CAAC,IAAI,mBAAmB;gBACH,OAAO,EAAE,oBAAoB;IAEpD,KAAK,CAAC,EACV,QAAQ,EACR,UAAU,EACV,WAAW,GACZ,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IA8BzC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,eAAe;
|
|
1
|
+
{"version":3,"file":"astro.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/astro.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACd,MAAM,uBAAuB,CAAC;AAG/B,qBAAa,aAAc,YAAW,aAAa,EAAE,kBAAkB;IAEzD,OAAO,CAAC,QAAQ,CAAC,OAAO;IADpC,QAAQ,CAAC,IAAI,mBAAmB;gBACH,OAAO,EAAE,oBAAoB;IAEpD,KAAK,CAAC,EACV,QAAQ,EACR,UAAU,EACV,WAAW,GACZ,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IA8BzC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,eAAe;CAgB1D"}
|
|
@@ -1 +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;
|
|
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"}
|
|
@@ -1 +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;
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bluefinx.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/bluefinx.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAU/B,qBAAa,gBAAiB,YAAW,aAAa,EAAE,eAAe;IAEzD,OAAO,CAAC,QAAQ,CAAC,OAAO;IADpC,QAAQ,CAAC,IAAI,sBAAsB;gBACN,OAAO,EAAE,uBAAuB;IAKvD,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAqBjE,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;IAStC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"bluefinx.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/bluefinx.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAU/B,qBAAa,gBAAiB,YAAW,aAAa,EAAE,eAAe;IAEzD,OAAO,CAAC,QAAQ,CAAC,OAAO;IADpC,QAAQ,CAAC,IAAI,sBAAsB;gBACN,OAAO,EAAE,uBAAuB;IAKvD,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAqBjE,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;IAStC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;CAqD9D"}
|
|
@@ -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;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;
|
|
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 +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,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;
|
|
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"}
|
|
@@ -1 +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,EACL,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EAErB,kBAAkB,EAClB,aAAa,EACb,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;
|
|
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,EACL,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EAErB,kBAAkB,EAClB,aAAa,EACb,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAQ/D,qBAAa,WAAY,YAAW,aAAa,EAAE,eAAe;IAG9D,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJzB,QAAQ,CAAC,IAAI,iBAAiB;gBAEX,OAAO,EAAE,kBAAkB,EAC3B,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,EACpC,MAAM,EAAE,SAAS;IAG9B,KAAK,CAAC,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,MAAM,GACP,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAoCzC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;CA4B9D;AAmHD,eAAO,MAAM,eAAe,GAC1B,CAAC,SAAS,SAAS,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAC,GAAG,CAAA;CAAE,EAEjD,OAAO,CAAC,EACR,WAAW,cAAc,EACzB,YAAY,qBAAqB,EACjC,aAAa,QAAQ,CAAC,aAAa,CAAC;;;;;EAoBrC,CAAC"}
|
package/lib/cjs/types/okx.js
CHANGED