@cetusprotocol/aggregator-sdk 1.5.3 → 1.5.5
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/bun.lock +263 -263
- package/dist/index.cjs +152 -105
- package/dist/index.d.cts +72 -19
- package/dist/index.d.ts +72 -19
- package/dist/index.js +152 -106
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var transactions = require('@mysten/sui/transactions');
|
|
4
4
|
var JSONbig = require('json-bigint');
|
|
5
5
|
var utils = require('@mysten/sui/utils');
|
|
6
|
-
var
|
|
6
|
+
var grpc = require('@mysten/sui/grpc');
|
|
7
7
|
var hermesClient = require('@pythnetwork/hermes-client');
|
|
8
8
|
var bcs = require('@mysten/sui/bcs');
|
|
9
9
|
|
|
@@ -43,9 +43,9 @@ var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__
|
|
|
43
43
|
mod2
|
|
44
44
|
));
|
|
45
45
|
|
|
46
|
-
// node_modules
|
|
46
|
+
// node_modules/bn.js/lib/bn.js
|
|
47
47
|
var require_bn = __commonJS({
|
|
48
|
-
"node_modules
|
|
48
|
+
"node_modules/bn.js/lib/bn.js"(exports, module) {
|
|
49
49
|
(function(module2, exports2) {
|
|
50
50
|
function assert(val, msg) {
|
|
51
51
|
if (!val) throw new Error(msg || "Assertion failed");
|
|
@@ -351,7 +351,7 @@ var require_bn = __commonJS({
|
|
|
351
351
|
};
|
|
352
352
|
if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") {
|
|
353
353
|
try {
|
|
354
|
-
BN7.prototype[
|
|
354
|
+
BN7.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect;
|
|
355
355
|
} catch (e) {
|
|
356
356
|
BN7.prototype.inspect = inspect;
|
|
357
357
|
}
|
|
@@ -1768,10 +1768,6 @@ var require_bn = __commonJS({
|
|
|
1768
1768
|
var mask = 67108863 ^ 67108863 >>> r << r;
|
|
1769
1769
|
this.words[this.length - 1] &= mask;
|
|
1770
1770
|
}
|
|
1771
|
-
if (this.length === 0) {
|
|
1772
|
-
this.words[0] = 0;
|
|
1773
|
-
this.length = 1;
|
|
1774
|
-
}
|
|
1775
1771
|
return this._strip();
|
|
1776
1772
|
};
|
|
1777
1773
|
BN7.prototype.maskn = function maskn(bits) {
|
|
@@ -2787,7 +2783,7 @@ var require_bn = __commonJS({
|
|
|
2787
2783
|
var res = this.imod(a._invmp(this.m).mul(this.r2));
|
|
2788
2784
|
return res._forceRed(this);
|
|
2789
2785
|
};
|
|
2790
|
-
})(typeof module === "undefined" || module, exports
|
|
2786
|
+
})(typeof module === "undefined" || module, exports);
|
|
2791
2787
|
}
|
|
2792
2788
|
});
|
|
2793
2789
|
|
|
@@ -3420,7 +3416,7 @@ var AGGREGATOR_V3_CONFIG = {
|
|
|
3420
3416
|
};
|
|
3421
3417
|
|
|
3422
3418
|
// src/api.ts
|
|
3423
|
-
var SDK_VERSION =
|
|
3419
|
+
var SDK_VERSION = 1010505;
|
|
3424
3420
|
function parseRouterResponse(data, byAmountIn) {
|
|
3425
3421
|
let packages = /* @__PURE__ */ new Map();
|
|
3426
3422
|
if (data.packages) {
|
|
@@ -3856,7 +3852,7 @@ var AggregatorConfig = class {
|
|
|
3856
3852
|
// src/math.ts
|
|
3857
3853
|
var import_bn3 = __toESM(require_bn());
|
|
3858
3854
|
|
|
3859
|
-
// node_modules
|
|
3855
|
+
// node_modules/decimal.js/decimal.mjs
|
|
3860
3856
|
var EXP_LIMIT = 9e15;
|
|
3861
3857
|
var MAX_DIGITS = 1e9;
|
|
3862
3858
|
var NUMERALS = "0123456789abcdef";
|
|
@@ -6025,7 +6021,7 @@ function tanh(x) {
|
|
|
6025
6021
|
function trunc(x) {
|
|
6026
6022
|
return finalise(x = new this(x), x.e + 1, 1);
|
|
6027
6023
|
}
|
|
6028
|
-
P[
|
|
6024
|
+
P[Symbol.for("nodejs.util.inspect.custom")] = P.toString;
|
|
6029
6025
|
P[Symbol.toStringTag] = "Decimal";
|
|
6030
6026
|
var Decimal = P.constructor = clone(DEFAULTS);
|
|
6031
6027
|
LN10 = new Decimal(LN10);
|
|
@@ -7861,12 +7857,11 @@ var PythAdapter = class {
|
|
|
7861
7857
|
if (this.baseUpdateFee !== void 0) {
|
|
7862
7858
|
return this.baseUpdateFee;
|
|
7863
7859
|
}
|
|
7864
|
-
const
|
|
7865
|
-
|
|
7866
|
-
|
|
7860
|
+
const { object } = await this.client.getObject({
|
|
7861
|
+
objectId: this.pythStateId,
|
|
7862
|
+
include: { json: true }
|
|
7867
7863
|
});
|
|
7868
|
-
const
|
|
7869
|
-
const json = content && "fields" in content ? content.fields : null;
|
|
7864
|
+
const json = object.json;
|
|
7870
7865
|
if (!json) {
|
|
7871
7866
|
throw new Error("Unable to fetch pyth state object");
|
|
7872
7867
|
}
|
|
@@ -7874,21 +7869,16 @@ var PythAdapter = class {
|
|
|
7874
7869
|
return this.baseUpdateFee;
|
|
7875
7870
|
}
|
|
7876
7871
|
async getPackageId(objectId) {
|
|
7877
|
-
const
|
|
7878
|
-
|
|
7879
|
-
|
|
7872
|
+
const { object } = await this.client.getObject({
|
|
7873
|
+
objectId,
|
|
7874
|
+
include: { json: true }
|
|
7880
7875
|
});
|
|
7881
|
-
const
|
|
7882
|
-
const json = content && "fields" in content ? content.fields : null;
|
|
7876
|
+
const json = object.json;
|
|
7883
7877
|
if (!json) {
|
|
7884
7878
|
throw new Error(`Cannot fetch package id for object ${objectId}`);
|
|
7885
7879
|
}
|
|
7886
7880
|
if ("upgrade_cap" in json) {
|
|
7887
|
-
|
|
7888
|
-
const packageId = upgradeCap?.fields?.package;
|
|
7889
|
-
if (typeof packageId === "string") {
|
|
7890
|
-
return packageId;
|
|
7891
|
-
}
|
|
7881
|
+
return json.upgrade_cap.package;
|
|
7892
7882
|
}
|
|
7893
7883
|
throw new Error("upgrade_cap not found");
|
|
7894
7884
|
}
|
|
@@ -7912,19 +7902,20 @@ var PythAdapter = class {
|
|
|
7912
7902
|
const { id: tableId, fieldType } = await this.getPriceTableInfo();
|
|
7913
7903
|
const feedIdBytes = Buffer.from(normalizedFeedId, "hex");
|
|
7914
7904
|
try {
|
|
7915
|
-
const
|
|
7905
|
+
const PriceIdentifier = bcs.bcs.struct("PriceIdentifier", {
|
|
7906
|
+
bytes: bcs.bcs.vector(bcs.bcs.u8())
|
|
7907
|
+
});
|
|
7908
|
+
const bcsBytes = PriceIdentifier.serialize({ bytes: Array.from(feedIdBytes) }).toBytes();
|
|
7909
|
+
const result = await this.client.getDynamicField({
|
|
7916
7910
|
parentId: tableId,
|
|
7917
7911
|
name: {
|
|
7918
|
-
type:
|
|
7919
|
-
|
|
7912
|
+
type: fieldType,
|
|
7913
|
+
bcs: bcsBytes
|
|
7920
7914
|
}
|
|
7921
7915
|
});
|
|
7922
|
-
const
|
|
7923
|
-
const
|
|
7924
|
-
const objectId =
|
|
7925
|
-
if (!objectId) {
|
|
7926
|
-
return void 0;
|
|
7927
|
-
}
|
|
7916
|
+
const valueBcs = result.dynamicField.value.bcs;
|
|
7917
|
+
const valueBytes = valueBcs instanceof Uint8Array ? valueBcs : new Uint8Array(Object.values(valueBcs));
|
|
7918
|
+
const objectId = "0x" + Array.from(valueBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
7928
7919
|
this.priceFeedObjectIdCache.set(normalizedFeedId, objectId);
|
|
7929
7920
|
return objectId;
|
|
7930
7921
|
} catch {
|
|
@@ -7935,27 +7926,40 @@ var PythAdapter = class {
|
|
|
7935
7926
|
if (this.priceTableInfo !== void 0) {
|
|
7936
7927
|
return this.priceTableInfo;
|
|
7937
7928
|
}
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7929
|
+
let cursor = null;
|
|
7930
|
+
let hasNextPage = true;
|
|
7931
|
+
while (hasNextPage) {
|
|
7932
|
+
const dynamicFields = await this.client.listDynamicFields({
|
|
7933
|
+
parentId: this.pythStateId,
|
|
7934
|
+
cursor
|
|
7935
|
+
});
|
|
7936
|
+
for (const field of dynamicFields.dynamicFields) {
|
|
7937
|
+
if (field.name.type === "vector<u8>") {
|
|
7938
|
+
const objectId = field.$kind === "DynamicObject" && field.childId ? field.childId : field.fieldId;
|
|
7939
|
+
const fieldObj = await this.client.getObject({
|
|
7940
|
+
objectId,
|
|
7941
|
+
include: { json: true }
|
|
7942
|
+
});
|
|
7943
|
+
const type = fieldObj.object.type;
|
|
7944
|
+
if (type.includes("table::Table")) {
|
|
7945
|
+
const innerTypes = type.replace(/.*table::Table</, "").replace(/>$/, "");
|
|
7946
|
+
const fieldType = innerTypes.split(",")[0].trim();
|
|
7947
|
+
this.priceTableInfo = { id: fieldObj.object.objectId, fieldType };
|
|
7948
|
+
return this.priceTableInfo;
|
|
7949
|
+
}
|
|
7950
|
+
}
|
|
7943
7951
|
}
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
throw new Error(
|
|
7947
|
-
"Price Table not found, contract may not be initialized"
|
|
7948
|
-
);
|
|
7952
|
+
hasNextPage = dynamicFields.hasNextPage;
|
|
7953
|
+
cursor = dynamicFields.cursor;
|
|
7949
7954
|
}
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
return this.priceTableInfo;
|
|
7955
|
+
throw new Error(
|
|
7956
|
+
"Price Table not found, contract may not be initialized"
|
|
7957
|
+
);
|
|
7954
7958
|
}
|
|
7955
7959
|
extractVaaBytesFromAccumulatorMessage(accumulatorMessage) {
|
|
7956
|
-
const trailingPayloadSize = accumulatorMessage.
|
|
7960
|
+
const trailingPayloadSize = accumulatorMessage.readUInt8(6);
|
|
7957
7961
|
const vaaSizeOffset = 7 + trailingPayloadSize + 1;
|
|
7958
|
-
const vaaSize = accumulatorMessage.
|
|
7962
|
+
const vaaSize = accumulatorMessage.readUInt16BE(vaaSizeOffset);
|
|
7959
7963
|
const vaaOffset = vaaSizeOffset + 2;
|
|
7960
7964
|
return accumulatorMessage.subarray(vaaOffset, vaaOffset + vaaSize);
|
|
7961
7965
|
}
|
|
@@ -8134,21 +8138,21 @@ async function getOrCreateAccountCap(txb, client, owner) {
|
|
|
8134
8138
|
}
|
|
8135
8139
|
async function getAccountCap(client, owner) {
|
|
8136
8140
|
const limit = 50;
|
|
8137
|
-
let cursor =
|
|
8141
|
+
let cursor = null;
|
|
8138
8142
|
while (true) {
|
|
8139
|
-
const ownedObjects = await client.
|
|
8143
|
+
const ownedObjects = await client.listOwnedObjects({
|
|
8140
8144
|
owner,
|
|
8141
8145
|
cursor,
|
|
8142
8146
|
limit,
|
|
8143
|
-
|
|
8147
|
+
type: `${DEEPBOOK_PACKAGE_ID}::${DEEPBOOK_CUSTODIAN_V2_MODULE}::AccountCap`
|
|
8144
8148
|
});
|
|
8145
|
-
if (ownedObjects.
|
|
8146
|
-
return ownedObjects.
|
|
8149
|
+
if (ownedObjects.objects.length !== 0) {
|
|
8150
|
+
return ownedObjects.objects[0].objectId;
|
|
8147
8151
|
}
|
|
8148
8152
|
if (!ownedObjects.hasNextPage) {
|
|
8149
8153
|
break;
|
|
8150
8154
|
}
|
|
8151
|
-
cursor = ownedObjects.
|
|
8155
|
+
cursor = ownedObjects.cursor;
|
|
8152
8156
|
}
|
|
8153
8157
|
return null;
|
|
8154
8158
|
}
|
|
@@ -8176,10 +8180,10 @@ function getAggregatorV2Extend2PublishedAt(publishedAt, packages) {
|
|
|
8176
8180
|
// src/utils/gas.ts
|
|
8177
8181
|
var import_bn4 = __toESM(require_bn());
|
|
8178
8182
|
function extractGasMetrics(result) {
|
|
8179
|
-
const
|
|
8180
|
-
const
|
|
8181
|
-
if (!
|
|
8182
|
-
const errorMsg =
|
|
8183
|
+
const txResult = result.Transaction ?? result.FailedTransaction;
|
|
8184
|
+
const effects = txResult?.effects;
|
|
8185
|
+
if (!effects || !effects.status.success) {
|
|
8186
|
+
const errorMsg = effects?.status.success === false ? effects.status.error.message : "Unknown error";
|
|
8183
8187
|
return {
|
|
8184
8188
|
computationCost: "0",
|
|
8185
8189
|
storageCost: "0",
|
|
@@ -8705,6 +8709,59 @@ var BoltRouter = class {
|
|
|
8705
8709
|
});
|
|
8706
8710
|
}
|
|
8707
8711
|
};
|
|
8712
|
+
var MagmaPropAmmRouter = class {
|
|
8713
|
+
constructor(_env) {
|
|
8714
|
+
}
|
|
8715
|
+
swap(txb, flattenedPath, swapContext, _extends) {
|
|
8716
|
+
const path = flattenedPath.path;
|
|
8717
|
+
if (!path.extendedDetails) {
|
|
8718
|
+
throw new Error("Extended details not found for MAGMAPROPAMM");
|
|
8719
|
+
}
|
|
8720
|
+
this.validateExtendedDetails(path.extendedDetails);
|
|
8721
|
+
const swapData = this.prepareSwapData(flattenedPath);
|
|
8722
|
+
this.executeSwapContract(txb, swapData, swapContext);
|
|
8723
|
+
}
|
|
8724
|
+
validateExtendedDetails(extendedDetails) {
|
|
8725
|
+
if (!extendedDetails.magmapropamm_pool_id) {
|
|
8726
|
+
throw new Error("MAGMAPROPAMM pool id not found in extended details");
|
|
8727
|
+
}
|
|
8728
|
+
}
|
|
8729
|
+
prepareSwapData(flattenedPath) {
|
|
8730
|
+
const path = flattenedPath.path;
|
|
8731
|
+
if (path.publishedAt == null) {
|
|
8732
|
+
throw new Error("MAGMAPROPAMM not set publishedAt");
|
|
8733
|
+
}
|
|
8734
|
+
const extendedDetails = path.extendedDetails;
|
|
8735
|
+
const [coinTType0, coinTType1] = path.direction ? [path.from, path.target] : [path.target, path.from];
|
|
8736
|
+
const amountIn = flattenedPath.isLastUseOfIntermediateToken ? AGGREGATOR_V3_CONFIG.MAX_AMOUNT_IN : path.amountIn;
|
|
8737
|
+
return {
|
|
8738
|
+
coinTType0,
|
|
8739
|
+
coinTType1,
|
|
8740
|
+
a2b: path.direction,
|
|
8741
|
+
amountIn,
|
|
8742
|
+
publishedAt: path.publishedAt,
|
|
8743
|
+
poolId: extendedDetails.magmapropamm_pool_id
|
|
8744
|
+
};
|
|
8745
|
+
}
|
|
8746
|
+
executeSwapContract(txb, swapData, swapContext) {
|
|
8747
|
+
txb.moveCall({
|
|
8748
|
+
target: `${swapData.publishedAt}::magmapropamm::swap`,
|
|
8749
|
+
typeArguments: [swapData.coinTType0, swapData.coinTType1],
|
|
8750
|
+
arguments: [
|
|
8751
|
+
swapContext,
|
|
8752
|
+
// swap_ctx
|
|
8753
|
+
txb.object(swapData.poolId),
|
|
8754
|
+
// pool
|
|
8755
|
+
txb.object(utils.SUI_CLOCK_OBJECT_ID),
|
|
8756
|
+
// clock
|
|
8757
|
+
txb.pure.bool(swapData.a2b),
|
|
8758
|
+
// a2b
|
|
8759
|
+
txb.pure.u64(swapData.amountIn)
|
|
8760
|
+
// amount_in
|
|
8761
|
+
]
|
|
8762
|
+
});
|
|
8763
|
+
}
|
|
8764
|
+
};
|
|
8708
8765
|
|
|
8709
8766
|
// src/client.ts
|
|
8710
8767
|
var CETUS = "CETUS";
|
|
@@ -8741,6 +8798,7 @@ var CETUSDLMM = "CETUSDLMM";
|
|
|
8741
8798
|
var FERRADLMM = "FERRADLMM";
|
|
8742
8799
|
var FERRACLMM = "FERRACLMM";
|
|
8743
8800
|
var BOLT = "BOLT";
|
|
8801
|
+
var MAGMAPROPAMM = "MAGMAPROPAMM";
|
|
8744
8802
|
var DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v3";
|
|
8745
8803
|
var ALL_DEXES = [
|
|
8746
8804
|
CETUS,
|
|
@@ -8775,7 +8833,8 @@ var ALL_DEXES = [
|
|
|
8775
8833
|
CETUSDLMM,
|
|
8776
8834
|
FERRADLMM,
|
|
8777
8835
|
FERRACLMM,
|
|
8778
|
-
BOLT
|
|
8836
|
+
BOLT,
|
|
8837
|
+
MAGMAPROPAMM
|
|
8779
8838
|
];
|
|
8780
8839
|
function getAllProviders() {
|
|
8781
8840
|
return ALL_DEXES;
|
|
@@ -8842,8 +8901,8 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
8842
8901
|
constructor(params) {
|
|
8843
8902
|
this.endpoint = params.endpoint ? processEndpoint(params.endpoint) : DEFAULT_ENDPOINT;
|
|
8844
8903
|
const network = params.env === 1 /* Testnet */ ? "testnet" : "mainnet";
|
|
8845
|
-
const
|
|
8846
|
-
this.client = params.client ?? new
|
|
8904
|
+
const grpcUrl = params.env === 1 /* Testnet */ ? "https://fullnode.testnet.sui.io:443" : "https://fullnode.mainnet.sui.io:443";
|
|
8905
|
+
this.client = params.client ?? new grpc.SuiGrpcClient({ network, baseUrl: grpcUrl });
|
|
8847
8906
|
this.signer = params.signer || "";
|
|
8848
8907
|
this.env = params.env || 0 /* Mainnet */;
|
|
8849
8908
|
const config2 = _AggregatorClient.CONFIG[this.env];
|
|
@@ -8884,13 +8943,13 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
8884
8943
|
}
|
|
8885
8944
|
async getOneCoinUsedToMerge(coinType) {
|
|
8886
8945
|
try {
|
|
8887
|
-
const gotCoin = await this.client.
|
|
8946
|
+
const gotCoin = await this.client.listCoins({
|
|
8888
8947
|
owner: this.signer,
|
|
8889
8948
|
coinType,
|
|
8890
8949
|
limit: 1
|
|
8891
8950
|
});
|
|
8892
|
-
if (gotCoin.
|
|
8893
|
-
return gotCoin.
|
|
8951
|
+
if (gotCoin.objects.length === 1) {
|
|
8952
|
+
return gotCoin.objects[0].objectId;
|
|
8894
8953
|
}
|
|
8895
8954
|
return null;
|
|
8896
8955
|
} catch (error) {
|
|
@@ -8985,6 +9044,8 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
8985
9044
|
return new FerraClmmRouter(this.env);
|
|
8986
9045
|
case BOLT:
|
|
8987
9046
|
return new BoltRouter(this.env);
|
|
9047
|
+
case MAGMAPROPAMM:
|
|
9048
|
+
return new MagmaPropAmmRouter(this.env);
|
|
8988
9049
|
default:
|
|
8989
9050
|
throw new Error(
|
|
8990
9051
|
`${CLIENT_CONFIG.ERRORS.UNSUPPORTED_DEX} ${provider}`
|
|
@@ -9362,15 +9423,7 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
9362
9423
|
* @throws Error if input coin amount exceeds maxAmountIn
|
|
9363
9424
|
*/
|
|
9364
9425
|
async routerSwapWithMaxAmountIn(params) {
|
|
9365
|
-
const {
|
|
9366
|
-
router,
|
|
9367
|
-
inputCoin,
|
|
9368
|
-
slippage,
|
|
9369
|
-
txb,
|
|
9370
|
-
partner,
|
|
9371
|
-
cetusDlmmPartner,
|
|
9372
|
-
maxAmountIn
|
|
9373
|
-
} = params;
|
|
9426
|
+
const { router, inputCoin, slippage, txb, partner, maxAmountIn } = params;
|
|
9374
9427
|
if (slippage > 1 || slippage < 0) {
|
|
9375
9428
|
throw new Error(CLIENT_CONFIG.ERRORS.INVALID_SLIPPAGE);
|
|
9376
9429
|
}
|
|
@@ -9405,8 +9458,7 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
9405
9458
|
amountOut.toString(),
|
|
9406
9459
|
amountLimit.toString(),
|
|
9407
9460
|
priceInfoObjectIds,
|
|
9408
|
-
partner ?? this.partner
|
|
9409
|
-
cetusDlmmPartner ?? this.cetusDlmmPartner
|
|
9461
|
+
partner ?? this.partner
|
|
9410
9462
|
);
|
|
9411
9463
|
} else {
|
|
9412
9464
|
return this.expectOutputSwapV3WithMaxAmountIn(
|
|
@@ -9423,14 +9475,7 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
9423
9475
|
// auto build input coin
|
|
9424
9476
|
// auto merge, transfer or destory target coin.
|
|
9425
9477
|
async fastRouterSwap(params) {
|
|
9426
|
-
const {
|
|
9427
|
-
router,
|
|
9428
|
-
slippage,
|
|
9429
|
-
txb,
|
|
9430
|
-
partner,
|
|
9431
|
-
cetusDlmmPartner,
|
|
9432
|
-
payDeepFeeAmount
|
|
9433
|
-
} = params;
|
|
9478
|
+
const { router, slippage, txb, partner, cetusDlmmPartner, payDeepFeeAmount } = params;
|
|
9434
9479
|
const fromCoinType = router.paths[0].from;
|
|
9435
9480
|
const targetCoinType = router.paths[router.paths.length - 1].target;
|
|
9436
9481
|
const byAmountIn = router.byAmountIn;
|
|
@@ -9587,7 +9632,7 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
9587
9632
|
}
|
|
9588
9633
|
}
|
|
9589
9634
|
async fixableRouterSwapV3(params) {
|
|
9590
|
-
const { router, inputCoin, slippage, txb, partner
|
|
9635
|
+
const { router, inputCoin, slippage, txb, partner } = params;
|
|
9591
9636
|
checkOverlayFeeConfig(this.overlayFeeRate, this.overlayFeeReceiver);
|
|
9592
9637
|
let overlayFee = 0;
|
|
9593
9638
|
if (router.byAmountIn) {
|
|
@@ -9616,8 +9661,7 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
9616
9661
|
expectedAmountOut.toString(),
|
|
9617
9662
|
amountLimit.toString(),
|
|
9618
9663
|
priceInfoObjectIds,
|
|
9619
|
-
partner ?? this.partner
|
|
9620
|
-
cetusDlmmPartner ?? this.cetusDlmmPartner
|
|
9664
|
+
partner ?? this.partner
|
|
9621
9665
|
);
|
|
9622
9666
|
} else {
|
|
9623
9667
|
return this.expectOutputSwapV3(
|
|
@@ -9654,16 +9698,18 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
9654
9698
|
});
|
|
9655
9699
|
}
|
|
9656
9700
|
tx.setSenderIfNotSet(this.signer || "0x0");
|
|
9657
|
-
const simulateRes = await this.client.
|
|
9658
|
-
|
|
9659
|
-
|
|
9701
|
+
const simulateRes = await this.client.simulateTransaction({
|
|
9702
|
+
transaction: tx,
|
|
9703
|
+
include: { events: true, effects: true }
|
|
9660
9704
|
});
|
|
9661
|
-
|
|
9662
|
-
|
|
9705
|
+
const txResult = simulateRes.Transaction ?? simulateRes.FailedTransaction;
|
|
9706
|
+
if (!txResult || simulateRes.$kind === "FailedTransaction") {
|
|
9707
|
+
const errorMsg = txResult?.status.success === false ? txResult.status.error.message : "Unknown error";
|
|
9708
|
+
throw new Error("Simulation error: " + errorMsg);
|
|
9663
9709
|
}
|
|
9664
|
-
const events =
|
|
9710
|
+
const events = txResult.events ?? [];
|
|
9665
9711
|
const valueData = events.filter((item) => {
|
|
9666
|
-
return item.
|
|
9712
|
+
return item.eventType.includes("CalculatedSwapResultEvent");
|
|
9667
9713
|
});
|
|
9668
9714
|
if (valueData.length === 0 || valueData.length !== pools.length) {
|
|
9669
9715
|
throw new Error("Simulate event result error");
|
|
@@ -9671,7 +9717,7 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
9671
9717
|
let tempMaxAmount = byAmountIn ? new import_bn6.default(0) : new import_bn6.default(U64_MAX);
|
|
9672
9718
|
let tempIndex = 0;
|
|
9673
9719
|
for (let i = 0; i < valueData.length; i += 1) {
|
|
9674
|
-
const eventJson2 = valueData[i].
|
|
9720
|
+
const eventJson2 = valueData[i].json;
|
|
9675
9721
|
if (eventJson2?.data?.is_exceed) {
|
|
9676
9722
|
continue;
|
|
9677
9723
|
}
|
|
@@ -9689,11 +9735,11 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
9689
9735
|
}
|
|
9690
9736
|
}
|
|
9691
9737
|
}
|
|
9692
|
-
const eventJson = valueData[tempIndex].
|
|
9738
|
+
const eventJson = valueData[tempIndex].json;
|
|
9693
9739
|
const eventData = eventJson?.data;
|
|
9694
9740
|
const [decimalA, decimalB] = await Promise.all([
|
|
9695
|
-
this.client.getCoinMetadata({ coinType: coinA }).then((res) => res?.decimals ?? null),
|
|
9696
|
-
this.client.getCoinMetadata({ coinType: coinB }).then((res) => res?.decimals ?? null)
|
|
9741
|
+
this.client.getCoinMetadata({ coinType: coinA }).then((res) => res.coinMetadata?.decimals ?? null),
|
|
9742
|
+
this.client.getCoinMetadata({ coinType: coinB }).then((res) => res.coinMetadata?.decimals ?? null)
|
|
9697
9743
|
]);
|
|
9698
9744
|
if (decimalA == null || decimalB == null) {
|
|
9699
9745
|
throw new Error("Cannot get coin decimals");
|
|
@@ -9762,9 +9808,9 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
9762
9808
|
}
|
|
9763
9809
|
async devInspectTransactionBlock(txb) {
|
|
9764
9810
|
txb.setSenderIfNotSet(this.signer || "0x0");
|
|
9765
|
-
const res = await this.client.
|
|
9766
|
-
|
|
9767
|
-
|
|
9811
|
+
const res = await this.client.simulateTransaction({
|
|
9812
|
+
transaction: txb,
|
|
9813
|
+
include: { events: true, effects: true }
|
|
9768
9814
|
});
|
|
9769
9815
|
return res;
|
|
9770
9816
|
}
|
|
@@ -9772,7 +9818,7 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
9772
9818
|
const res = await this.client.signAndExecuteTransaction({
|
|
9773
9819
|
transaction: txb,
|
|
9774
9820
|
signer,
|
|
9775
|
-
|
|
9821
|
+
include: { effects: true, events: true, balanceChanges: true }
|
|
9776
9822
|
});
|
|
9777
9823
|
return res;
|
|
9778
9824
|
}
|
|
@@ -9916,6 +9962,7 @@ exports.KRIYAV3 = KRIYAV3;
|
|
|
9916
9962
|
exports.KRIYA_DEX = KRIYA_DEX;
|
|
9917
9963
|
exports.KRIYA_MODULE = KRIYA_MODULE;
|
|
9918
9964
|
exports.MAGMA = MAGMA;
|
|
9965
|
+
exports.MAGMAPROPAMM = MAGMAPROPAMM;
|
|
9919
9966
|
exports.MAINNET_AFTERMATH_INSURANCE_FUND_ID = MAINNET_AFTERMATH_INSURANCE_FUND_ID;
|
|
9920
9967
|
exports.MAINNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID = MAINNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID;
|
|
9921
9968
|
exports.MAINNET_AFTERMATH_REFERRAL_VAULT_ID = MAINNET_AFTERMATH_REFERRAL_VAULT_ID;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
1
|
+
import * as _mysten_sui_client from '@mysten/sui/client';
|
|
3
2
|
import { TransactionObjectArgument, Transaction, TransactionArgument } from '@mysten/sui/transactions';
|
|
4
3
|
import BN from 'bn.js';
|
|
5
4
|
import Decimal from 'decimal.js';
|
|
5
|
+
import { SuiGrpcClient } from '@mysten/sui/grpc';
|
|
6
6
|
import { Signer } from '@mysten/sui/cryptography';
|
|
7
7
|
|
|
8
8
|
interface FindRouterParams {
|
|
@@ -131,6 +131,7 @@ type ExtendedDetails = {
|
|
|
131
131
|
bolt_pool_id?: string;
|
|
132
132
|
bolt_oracle_id?: string;
|
|
133
133
|
bolt_quote_coin_type?: string;
|
|
134
|
+
magmapropamm_pool_id?: string;
|
|
134
135
|
};
|
|
135
136
|
type Path = {
|
|
136
137
|
id: string;
|
|
@@ -308,7 +309,7 @@ declare class PythAdapter {
|
|
|
308
309
|
private priceTableInfo;
|
|
309
310
|
private priceFeedObjectIdCache;
|
|
310
311
|
private baseUpdateFee;
|
|
311
|
-
constructor(client:
|
|
312
|
+
constructor(client: SuiGrpcClient, pythStateId: ObjectId, wormholeStateId: ObjectId, hermesUrls: string[]);
|
|
312
313
|
getPriceFeedsUpdateData(priceIDs: string[]): Promise<Buffer[]>;
|
|
313
314
|
getBaseUpdateFee(): Promise<number>;
|
|
314
315
|
getPackageId(objectId: ObjectId): Promise<string>;
|
|
@@ -357,6 +358,7 @@ declare const CETUSDLMM = "CETUSDLMM";
|
|
|
357
358
|
declare const FERRADLMM = "FERRADLMM";
|
|
358
359
|
declare const FERRACLMM = "FERRACLMM";
|
|
359
360
|
declare const BOLT = "BOLT";
|
|
361
|
+
declare const MAGMAPROPAMM = "MAGMAPROPAMM";
|
|
360
362
|
declare const DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v3";
|
|
361
363
|
declare const ALL_DEXES: string[];
|
|
362
364
|
type BuildRouterSwapParamsV3 = {
|
|
@@ -405,7 +407,7 @@ declare function getProvidersIncluding(includeProviders: string[]): string[];
|
|
|
405
407
|
type AggregatorClientParams = {
|
|
406
408
|
endpoint?: string;
|
|
407
409
|
signer?: string;
|
|
408
|
-
client?:
|
|
410
|
+
client?: SuiGrpcClient;
|
|
409
411
|
env?: Env;
|
|
410
412
|
pythUrls?: string[];
|
|
411
413
|
apiKey?: string;
|
|
@@ -417,7 +419,7 @@ type AggregatorClientParams = {
|
|
|
417
419
|
declare class AggregatorClient {
|
|
418
420
|
endpoint: string;
|
|
419
421
|
signer: string;
|
|
420
|
-
client:
|
|
422
|
+
client: SuiGrpcClient;
|
|
421
423
|
env: Env;
|
|
422
424
|
apiKey: string;
|
|
423
425
|
protected pythAdapter: PythAdapter;
|
|
@@ -459,8 +461,15 @@ declare class AggregatorClient {
|
|
|
459
461
|
fixableRouterSwapV3(params: BuildRouterSwapParamsV3): Promise<TransactionObjectArgument>;
|
|
460
462
|
swapInPools(params: SwapInPoolsParams): Promise<SwapInPoolsResultV3>;
|
|
461
463
|
updatePythPriceIDs(priceIDs: string[], txb: Transaction): Promise<Map<string, string>>;
|
|
462
|
-
devInspectTransactionBlock(txb: Transaction): Promise<
|
|
463
|
-
|
|
464
|
+
devInspectTransactionBlock(txb: Transaction): Promise<_mysten_sui_client.SuiClientTypes.SimulateTransactionResult<{
|
|
465
|
+
events: true;
|
|
466
|
+
effects: true;
|
|
467
|
+
}>>;
|
|
468
|
+
sendTransaction(txb: Transaction, signer: Signer): Promise<_mysten_sui_client.SuiClientTypes.TransactionResult<{
|
|
469
|
+
effects: true;
|
|
470
|
+
events: true;
|
|
471
|
+
balanceChanges: true;
|
|
472
|
+
}>>;
|
|
464
473
|
}
|
|
465
474
|
|
|
466
475
|
/**
|
|
@@ -493,7 +502,7 @@ type GetOrCreateAccountCapResult = {
|
|
|
493
502
|
accountCap: TransactionObjectArgument;
|
|
494
503
|
isCreate: boolean;
|
|
495
504
|
};
|
|
496
|
-
declare function getOrCreateAccountCap(txb: Transaction, client:
|
|
505
|
+
declare function getOrCreateAccountCap(txb: Transaction, client: SuiGrpcClient, owner: string): Promise<GetOrCreateAccountCapResult>;
|
|
497
506
|
|
|
498
507
|
/**
|
|
499
508
|
* Represents a SUI address, which is a string.
|
|
@@ -643,23 +652,67 @@ interface Dex {
|
|
|
643
652
|
}
|
|
644
653
|
|
|
645
654
|
/**
|
|
646
|
-
* Matches the shape of
|
|
655
|
+
* Matches the shape of SuiClientTypes.SimulateTransactionResult with effects included.
|
|
647
656
|
* Using a local type so gas.ts can be used without importing the full SDK.
|
|
648
657
|
*/
|
|
649
658
|
type SimulateTransactionResult = {
|
|
650
|
-
|
|
659
|
+
$kind: 'Transaction' | 'FailedTransaction';
|
|
660
|
+
Transaction?: {
|
|
651
661
|
status: {
|
|
652
|
-
|
|
653
|
-
error
|
|
662
|
+
success: true;
|
|
663
|
+
error: null;
|
|
664
|
+
} | {
|
|
665
|
+
success: false;
|
|
666
|
+
error: {
|
|
667
|
+
message: string;
|
|
668
|
+
};
|
|
654
669
|
};
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
670
|
+
effects?: {
|
|
671
|
+
status: {
|
|
672
|
+
success: true;
|
|
673
|
+
error: null;
|
|
674
|
+
} | {
|
|
675
|
+
success: false;
|
|
676
|
+
error: {
|
|
677
|
+
message: string;
|
|
678
|
+
};
|
|
679
|
+
};
|
|
680
|
+
gasUsed: {
|
|
681
|
+
computationCost: string;
|
|
682
|
+
storageCost: string;
|
|
683
|
+
storageRebate: string;
|
|
684
|
+
nonRefundableStorageFee: string;
|
|
685
|
+
};
|
|
686
|
+
};
|
|
687
|
+
};
|
|
688
|
+
FailedTransaction?: {
|
|
689
|
+
status: {
|
|
690
|
+
success: true;
|
|
691
|
+
error: null;
|
|
692
|
+
} | {
|
|
693
|
+
success: false;
|
|
694
|
+
error: {
|
|
695
|
+
message: string;
|
|
696
|
+
};
|
|
697
|
+
};
|
|
698
|
+
effects?: {
|
|
699
|
+
status: {
|
|
700
|
+
success: true;
|
|
701
|
+
error: null;
|
|
702
|
+
} | {
|
|
703
|
+
success: false;
|
|
704
|
+
error: {
|
|
705
|
+
message: string;
|
|
706
|
+
};
|
|
707
|
+
};
|
|
708
|
+
gasUsed: {
|
|
709
|
+
computationCost: string;
|
|
710
|
+
storageCost: string;
|
|
711
|
+
storageRebate: string;
|
|
712
|
+
nonRefundableStorageFee: string;
|
|
713
|
+
};
|
|
660
714
|
};
|
|
661
715
|
};
|
|
662
|
-
error?: string | null;
|
|
663
716
|
};
|
|
664
717
|
interface GasMetrics {
|
|
665
718
|
computationCost: string;
|
|
@@ -1074,4 +1127,4 @@ declare class CoinUtils {
|
|
|
1074
1127
|
static calculateTotalBalance(coins: CoinAsset[]): bigint;
|
|
1075
1128
|
}
|
|
1076
1129
|
|
|
1077
|
-
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, AggregatorConfig, AggregatorError, type AggregatorErrorCode, type AggregatorResponse, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, BOLT, type BigNumber, type BuildCoinResult, type BuildFastMergeSwapParams, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildMergeSwapParams, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, CETUS, CETUSDLMM, CETUS_DEX, CETUS_MODULE, CETUS_PUBLISHED_AT, CHECK_COINS_THRESHOLD_FUNC, CLIENT_CONFIG, CLOCK_ADDRESS, type CoinAsset, CoinInfoAddress, CoinStoreAddress, CoinUtils, type ComparisonResult, ConfigErrorCode, DEEPBOOKV2, DEEPBOOKV3, DEEPBOOK_CLOB_V2_MODULE, DEEPBOOK_CUSTODIAN_V2_MODULE, DEEPBOOK_DEX, DEEPBOOK_MODULE, DEEPBOOK_PACKAGE_ID, DEEPBOOK_PUBLISHED_AT, DEEPBOOK_V3_DEEP_FEE_TYPES, DEFAULT_AGG_V2_ENDPOINT, DEFAULT_AGG_V3_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_GAS_BUDGET_FOR_MERGE, DEFAULT_GAS_BUDGET_FOR_SPLIT, DEFAULT_GAS_BUDGET_FOR_STAKE, DEFAULT_GAS_BUDGET_FOR_TRANSFER, DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI, DEFAULT_NFT_TRANSFER_GAS_FEE, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FERRACLMM, FERRADLMM, FLOWXV2, FLOWXV3, FLOWX_AMM, FLOWX_AMM_MODULE, FULLSAIL, type FindRouterParams, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, type FlattenedPath, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, type GasMetrics, type GetOrCreateAccountCapResult, HAEDAL, HAEDALHMMV2, HAEDALPMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAINNET_AFTERMATH_INSURANCE_FUND_ID, MAINNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, MAINNET_AFTERMATH_REFERRAL_VAULT_ID, MAINNET_AFTERMATH_REGISTRY_ID, MAINNET_AFTERMATH_TREASURY_ID, MAINNET_CETUS_V3_PUBLISHED_AT, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type MergeRoute, type MergeSwapFromCoin, type MergeSwapInputCoin, type MergeSwapParams, type MergeSwapRouterData, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, type Package, type Path, type PathV2, type PreSwapLpChangeParams, type ProcessedRouterData, type PythConfig, REPAY_FLASH_SWAP_A2B_FUNC, REPAY_FLASH_SWAP_B2A_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_A2B_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_B2A_FUNC, RepayFalshSwapFunc, RepayFlashSwapWithPartnerFunc, type Router, type RouterData, type RouterDataV2, type RouterDataV3, type RouterError, type RouterV2, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, SUI_SYSTEM_STATE_OBJECT_ID, SWAP_A2B_FUNC, SWAP_B2A_FUNC, type SimulateTransactionResult, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiMoveObject, type SuiObjectIdType, type SuiResource, type SuiStructTag, type SuiTxArg, SuiZeroCoinFn, type SwapGasAnalysis, type SwapInPoolsParams, type SwapInPoolsResultV3, TEN_POW_NINE, TESTNET_AFTERMATH_INSURANCE_FUND_ID, TESTNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, TESTNET_AFTERMATH_REFERRAL_VAULT_ID, TESTNET_AFTERMATH_REGISTRY_ID, TESTNET_AFTERMATH_TREASURY_ID, TESTNET_CETUS_V3_PUBLISHED_AT, TESTNET_FLOWX_AMM_CONTAINER_ID, TRANSFER_ACCOUNT_CAP, TRANSFER_OR_DESTORY_COIN_FUNC, TURBOS, TURBOS_DEX, TURBOS_MODULE, TURBOS_VERSIONED, TWO, TransactionErrorCode, TypesErrorCode, U128, U64_MAX, U64_MAX_BN, UTILS_MODULE, VOLO, ZERO, buildInputCoin, calculateGasEfficiency, calculatePriceImpact, checkInvalidSuiAddress, compareCoins, compareGasMetrics, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getMergeSwapResult, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, isValidDowngradeUuid6, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|
|
1130
|
+
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, AggregatorConfig, AggregatorError, type AggregatorErrorCode, type AggregatorResponse, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, BOLT, type BigNumber, type BuildCoinResult, type BuildFastMergeSwapParams, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildMergeSwapParams, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, CETUS, CETUSDLMM, CETUS_DEX, CETUS_MODULE, CETUS_PUBLISHED_AT, CHECK_COINS_THRESHOLD_FUNC, CLIENT_CONFIG, CLOCK_ADDRESS, type CoinAsset, CoinInfoAddress, CoinStoreAddress, CoinUtils, type ComparisonResult, ConfigErrorCode, DEEPBOOKV2, DEEPBOOKV3, DEEPBOOK_CLOB_V2_MODULE, DEEPBOOK_CUSTODIAN_V2_MODULE, DEEPBOOK_DEX, DEEPBOOK_MODULE, DEEPBOOK_PACKAGE_ID, DEEPBOOK_PUBLISHED_AT, DEEPBOOK_V3_DEEP_FEE_TYPES, DEFAULT_AGG_V2_ENDPOINT, DEFAULT_AGG_V3_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_GAS_BUDGET_FOR_MERGE, DEFAULT_GAS_BUDGET_FOR_SPLIT, DEFAULT_GAS_BUDGET_FOR_STAKE, DEFAULT_GAS_BUDGET_FOR_TRANSFER, DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI, DEFAULT_NFT_TRANSFER_GAS_FEE, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FERRACLMM, FERRADLMM, FLOWXV2, FLOWXV3, FLOWX_AMM, FLOWX_AMM_MODULE, FULLSAIL, type FindRouterParams, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, type FlattenedPath, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, type GasMetrics, type GetOrCreateAccountCapResult, HAEDAL, HAEDALHMMV2, HAEDALPMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAGMAPROPAMM, MAINNET_AFTERMATH_INSURANCE_FUND_ID, MAINNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, MAINNET_AFTERMATH_REFERRAL_VAULT_ID, MAINNET_AFTERMATH_REGISTRY_ID, MAINNET_AFTERMATH_TREASURY_ID, MAINNET_CETUS_V3_PUBLISHED_AT, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type MergeRoute, type MergeSwapFromCoin, type MergeSwapInputCoin, type MergeSwapParams, type MergeSwapRouterData, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, type Package, type Path, type PathV2, type PreSwapLpChangeParams, type ProcessedRouterData, type PythConfig, REPAY_FLASH_SWAP_A2B_FUNC, REPAY_FLASH_SWAP_B2A_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_A2B_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_B2A_FUNC, RepayFalshSwapFunc, RepayFlashSwapWithPartnerFunc, type Router, type RouterData, type RouterDataV2, type RouterDataV3, type RouterError, type RouterV2, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, SUI_SYSTEM_STATE_OBJECT_ID, SWAP_A2B_FUNC, SWAP_B2A_FUNC, type SimulateTransactionResult, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiMoveObject, type SuiObjectIdType, type SuiResource, type SuiStructTag, type SuiTxArg, SuiZeroCoinFn, type SwapGasAnalysis, type SwapInPoolsParams, type SwapInPoolsResultV3, TEN_POW_NINE, TESTNET_AFTERMATH_INSURANCE_FUND_ID, TESTNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, TESTNET_AFTERMATH_REFERRAL_VAULT_ID, TESTNET_AFTERMATH_REGISTRY_ID, TESTNET_AFTERMATH_TREASURY_ID, TESTNET_CETUS_V3_PUBLISHED_AT, TESTNET_FLOWX_AMM_CONTAINER_ID, TRANSFER_ACCOUNT_CAP, TRANSFER_OR_DESTORY_COIN_FUNC, TURBOS, TURBOS_DEX, TURBOS_MODULE, TURBOS_VERSIONED, TWO, TransactionErrorCode, TypesErrorCode, U128, U64_MAX, U64_MAX_BN, UTILS_MODULE, VOLO, ZERO, buildInputCoin, calculateGasEfficiency, calculatePriceImpact, checkInvalidSuiAddress, compareCoins, compareGasMetrics, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getMergeSwapResult, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, isValidDowngradeUuid6, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|