@7kprotocol/sdk-ts 3.6.1-beta.0 → 3.6.1-beta.2
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/README.md +13 -10
- package/dist/bluefin7k-I6ZCDWDN.js +2 -0
- package/dist/bluefin7k-I6ZCDWDN.js.map +1 -0
- package/dist/bluefin7k-TERLUCNL.mjs +2 -0
- package/dist/bluefin7k-TERLUCNL.mjs.map +1 -0
- package/dist/cetus-AU3OMWOY.mjs +2 -0
- package/dist/cetus-AU3OMWOY.mjs.map +1 -0
- package/dist/cetus-SIPX6FYL.js +2 -0
- package/dist/cetus-SIPX6FYL.js.map +1 -0
- package/dist/chunk-ETQEI4QC.mjs +2 -0
- package/dist/chunk-ETQEI4QC.mjs.map +1 -0
- package/dist/chunk-KVGSSW22.js +2 -0
- package/dist/chunk-KVGSSW22.js.map +1 -0
- package/dist/flowx-6M54WFWO.js +2 -0
- package/dist/flowx-6M54WFWO.js.map +1 -0
- package/dist/flowx-OXZZX5FD.mjs +2 -0
- package/dist/flowx-OXZZX5FD.mjs.map +1 -0
- package/dist/index.d.mts +536 -0
- package/dist/index.d.ts +536 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +12 -20
- package/lib/cjs/config/fetchClient.js +0 -12
- package/lib/cjs/constants/_7k.js +0 -20
- package/lib/cjs/constants/apiEndpoints.js +0 -9
- package/lib/cjs/constants/sui.js +0 -4
- package/lib/cjs/constants/tokens.js +0 -7
- package/lib/cjs/features/limitDca/cancelDcaOrder.js +0 -14
- package/lib/cjs/features/limitDca/cancelLimitOrder.js +0 -14
- package/lib/cjs/features/limitDca/claimExpiredLimitOrder.js +0 -14
- package/lib/cjs/features/limitDca/constants.js +0 -13
- package/lib/cjs/features/limitDca/getClosedDcaOrders.js +0 -23
- package/lib/cjs/features/limitDca/getClosedLimitOrders.js +0 -22
- package/lib/cjs/features/limitDca/getDcaOrderExecutions.js +0 -23
- package/lib/cjs/features/limitDca/getOpenDcaOrders.js +0 -22
- package/lib/cjs/features/limitDca/getOpenLimitOrders.js +0 -22
- package/lib/cjs/features/limitDca/index.js +0 -26
- package/lib/cjs/features/limitDca/placeDcaOrder.js +0 -33
- package/lib/cjs/features/limitDca/placeLimitOrder.js +0 -27
- package/lib/cjs/features/limitDca/types.js +0 -16
- package/lib/cjs/features/metaAg/common.js +0 -103
- package/lib/cjs/features/metaAg/error.js +0 -31
- package/lib/cjs/features/metaAg/index.js +0 -268
- package/lib/cjs/features/metaAg/providers/bluefin7k.js +0 -57
- package/lib/cjs/features/metaAg/providers/cetus.js +0 -59
- package/lib/cjs/features/metaAg/providers/flowx.js +0 -52
- package/lib/cjs/features/metaAg/providers/okx.js +0 -182
- package/lib/cjs/features/prices/index.js +0 -99
- package/lib/cjs/index.js +0 -55
- package/lib/cjs/libs/url.js +0 -17
- package/lib/cjs/types/config/fetchClient.d.ts +0 -2
- package/lib/cjs/types/config/fetchClient.d.ts.map +0 -1
- package/lib/cjs/types/constants/_7k.d.ts +0 -6
- package/lib/cjs/types/constants/_7k.d.ts.map +0 -1
- package/lib/cjs/types/constants/apiEndpoints.d.ts +0 -7
- package/lib/cjs/types/constants/apiEndpoints.d.ts.map +0 -1
- package/lib/cjs/types/constants/sui.d.ts +0 -2
- package/lib/cjs/types/constants/sui.d.ts.map +0 -1
- package/lib/cjs/types/constants/tokens.d.ts +0 -5
- package/lib/cjs/types/constants/tokens.d.ts.map +0 -1
- package/lib/cjs/types/features/limitDca/cancelDcaOrder.d.ts +0 -9
- package/lib/cjs/types/features/limitDca/cancelDcaOrder.d.ts.map +0 -1
- package/lib/cjs/types/features/limitDca/cancelLimitOrder.d.ts +0 -9
- package/lib/cjs/types/features/limitDca/cancelLimitOrder.d.ts.map +0 -1
- package/lib/cjs/types/features/limitDca/claimExpiredLimitOrder.d.ts +0 -9
- package/lib/cjs/types/features/limitDca/claimExpiredLimitOrder.d.ts.map +0 -1
- package/lib/cjs/types/features/limitDca/constants.d.ts +0 -10
- package/lib/cjs/types/features/limitDca/constants.d.ts.map +0 -1
- package/lib/cjs/types/features/limitDca/getClosedDcaOrders.d.ts +0 -10
- package/lib/cjs/types/features/limitDca/getClosedDcaOrders.d.ts.map +0 -1
- package/lib/cjs/types/features/limitDca/getClosedLimitOrders.d.ts +0 -10
- package/lib/cjs/types/features/limitDca/getClosedLimitOrders.d.ts.map +0 -1
- package/lib/cjs/types/features/limitDca/getDcaOrderExecutions.d.ts +0 -10
- package/lib/cjs/types/features/limitDca/getDcaOrderExecutions.d.ts.map +0 -1
- package/lib/cjs/types/features/limitDca/getOpenDcaOrders.d.ts +0 -10
- package/lib/cjs/types/features/limitDca/getOpenDcaOrders.d.ts.map +0 -1
- package/lib/cjs/types/features/limitDca/getOpenLimitOrders.d.ts +0 -10
- package/lib/cjs/types/features/limitDca/getOpenLimitOrders.d.ts.map +0 -1
- package/lib/cjs/types/features/limitDca/index.d.ts +0 -11
- package/lib/cjs/types/features/limitDca/index.d.ts.map +0 -1
- package/lib/cjs/types/features/limitDca/placeDcaOrder.d.ts +0 -14
- package/lib/cjs/types/features/limitDca/placeDcaOrder.d.ts.map +0 -1
- package/lib/cjs/types/features/limitDca/placeLimitOrder.d.ts +0 -13
- package/lib/cjs/types/features/limitDca/placeLimitOrder.d.ts.map +0 -1
- package/lib/cjs/types/features/limitDca/types.d.ts +0 -98
- package/lib/cjs/types/features/limitDca/types.d.ts.map +0 -1
- package/lib/cjs/types/features/metaAg/common.d.ts +0 -24
- package/lib/cjs/types/features/metaAg/common.d.ts.map +0 -1
- package/lib/cjs/types/features/metaAg/error.d.ts +0 -54
- package/lib/cjs/types/features/metaAg/error.d.ts.map +0 -1
- package/lib/cjs/types/features/metaAg/index.d.ts +0 -42
- package/lib/cjs/types/features/metaAg/index.d.ts.map +0 -1
- package/lib/cjs/types/features/metaAg/providers/bluefin7k.d.ts +0 -11
- package/lib/cjs/types/features/metaAg/providers/bluefin7k.d.ts.map +0 -1
- package/lib/cjs/types/features/metaAg/providers/cetus.d.ts +0 -11
- package/lib/cjs/types/features/metaAg/providers/cetus.d.ts.map +0 -1
- package/lib/cjs/types/features/metaAg/providers/flowx.d.ts +0 -13
- package/lib/cjs/types/features/metaAg/providers/flowx.d.ts.map +0 -1
- package/lib/cjs/types/features/metaAg/providers/okx.d.ts +0 -21
- package/lib/cjs/types/features/metaAg/providers/okx.d.ts.map +0 -1
- package/lib/cjs/types/features/prices/index.d.ts +0 -18
- package/lib/cjs/types/features/prices/index.d.ts.map +0 -1
- package/lib/cjs/types/index.d.ts +0 -23
- package/lib/cjs/types/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/url.d.ts +0 -2
- package/lib/cjs/types/libs/url.d.ts.map +0 -1
- package/lib/cjs/types/metaAg.js +0 -16
- package/lib/cjs/types/okx.js +0 -6
- package/lib/cjs/types/types/metaAg.d.ts +0 -165
- package/lib/cjs/types/types/metaAg.d.ts.map +0 -1
- package/lib/cjs/types/types/okx.d.ts +0 -206
- package/lib/cjs/types/types/okx.d.ts.map +0 -1
- package/lib/cjs/types/utils/ObjectCache.d.ts +0 -87
- package/lib/cjs/types/utils/ObjectCache.d.ts.map +0 -1
- package/lib/cjs/types/utils/SuiClientUtils.d.ts +0 -15
- package/lib/cjs/types/utils/SuiClientUtils.d.ts.map +0 -1
- package/lib/cjs/types/utils/sui.d.ts +0 -27
- package/lib/cjs/types/utils/sui.d.ts.map +0 -1
- package/lib/cjs/types/utils/swap.d.ts +0 -15
- package/lib/cjs/types/utils/swap.d.ts.map +0 -1
- package/lib/cjs/types/utils/token.d.ts +0 -4
- package/lib/cjs/types/utils/token.d.ts.map +0 -1
- package/lib/cjs/utils/ObjectCache.js +0 -273
- package/lib/cjs/utils/SuiClientUtils.js +0 -50
- package/lib/cjs/utils/sui.js +0 -92
- package/lib/cjs/utils/swap.js +0 -37
- package/lib/cjs/utils/token.js +0 -15
- package/lib/esm/config/fetchClient.js +0 -9
- package/lib/esm/constants/_7k.js +0 -17
- package/lib/esm/constants/apiEndpoints.js +0 -6
- package/lib/esm/constants/sui.js +0 -1
- package/lib/esm/constants/tokens.js +0 -4
- package/lib/esm/features/limitDca/cancelDcaOrder.js +0 -11
- package/lib/esm/features/limitDca/cancelLimitOrder.js +0 -11
- package/lib/esm/features/limitDca/claimExpiredLimitOrder.js +0 -11
- package/lib/esm/features/limitDca/constants.js +0 -10
- package/lib/esm/features/limitDca/getClosedDcaOrders.js +0 -20
- package/lib/esm/features/limitDca/getClosedLimitOrders.js +0 -19
- package/lib/esm/features/limitDca/getDcaOrderExecutions.js +0 -20
- package/lib/esm/features/limitDca/getOpenDcaOrders.js +0 -19
- package/lib/esm/features/limitDca/getOpenLimitOrders.js +0 -19
- package/lib/esm/features/limitDca/index.js +0 -10
- package/lib/esm/features/limitDca/placeDcaOrder.js +0 -30
- package/lib/esm/features/limitDca/placeLimitOrder.js +0 -24
- package/lib/esm/features/limitDca/types.js +0 -13
- package/lib/esm/features/metaAg/common.js +0 -96
- package/lib/esm/features/metaAg/error.js +0 -29
- package/lib/esm/features/metaAg/index.js +0 -234
- package/lib/esm/features/metaAg/providers/bluefin7k.js +0 -55
- package/lib/esm/features/metaAg/providers/cetus.js +0 -57
- package/lib/esm/features/metaAg/providers/flowx.js +0 -51
- package/lib/esm/features/metaAg/providers/okx.js +0 -147
- package/lib/esm/features/prices/index.js +0 -94
- package/lib/esm/index.mjs +0 -31
- package/lib/esm/libs/url.js +0 -14
- package/lib/esm/types/config/fetchClient.d.ts +0 -2
- package/lib/esm/types/config/fetchClient.d.ts.map +0 -1
- package/lib/esm/types/constants/_7k.d.ts +0 -6
- package/lib/esm/types/constants/_7k.d.ts.map +0 -1
- package/lib/esm/types/constants/apiEndpoints.d.ts +0 -7
- package/lib/esm/types/constants/apiEndpoints.d.ts.map +0 -1
- package/lib/esm/types/constants/sui.d.ts +0 -2
- package/lib/esm/types/constants/sui.d.ts.map +0 -1
- package/lib/esm/types/constants/tokens.d.ts +0 -5
- package/lib/esm/types/constants/tokens.d.ts.map +0 -1
- package/lib/esm/types/features/limitDca/cancelDcaOrder.d.ts +0 -9
- package/lib/esm/types/features/limitDca/cancelDcaOrder.d.ts.map +0 -1
- package/lib/esm/types/features/limitDca/cancelLimitOrder.d.ts +0 -9
- package/lib/esm/types/features/limitDca/cancelLimitOrder.d.ts.map +0 -1
- package/lib/esm/types/features/limitDca/claimExpiredLimitOrder.d.ts +0 -9
- package/lib/esm/types/features/limitDca/claimExpiredLimitOrder.d.ts.map +0 -1
- package/lib/esm/types/features/limitDca/constants.d.ts +0 -10
- package/lib/esm/types/features/limitDca/constants.d.ts.map +0 -1
- package/lib/esm/types/features/limitDca/getClosedDcaOrders.d.ts +0 -10
- package/lib/esm/types/features/limitDca/getClosedDcaOrders.d.ts.map +0 -1
- package/lib/esm/types/features/limitDca/getClosedLimitOrders.d.ts +0 -10
- package/lib/esm/types/features/limitDca/getClosedLimitOrders.d.ts.map +0 -1
- package/lib/esm/types/features/limitDca/getDcaOrderExecutions.d.ts +0 -10
- package/lib/esm/types/features/limitDca/getDcaOrderExecutions.d.ts.map +0 -1
- package/lib/esm/types/features/limitDca/getOpenDcaOrders.d.ts +0 -10
- package/lib/esm/types/features/limitDca/getOpenDcaOrders.d.ts.map +0 -1
- package/lib/esm/types/features/limitDca/getOpenLimitOrders.d.ts +0 -10
- package/lib/esm/types/features/limitDca/getOpenLimitOrders.d.ts.map +0 -1
- package/lib/esm/types/features/limitDca/index.d.ts +0 -11
- package/lib/esm/types/features/limitDca/index.d.ts.map +0 -1
- package/lib/esm/types/features/limitDca/placeDcaOrder.d.ts +0 -14
- package/lib/esm/types/features/limitDca/placeDcaOrder.d.ts.map +0 -1
- package/lib/esm/types/features/limitDca/placeLimitOrder.d.ts +0 -13
- package/lib/esm/types/features/limitDca/placeLimitOrder.d.ts.map +0 -1
- package/lib/esm/types/features/limitDca/types.d.ts +0 -98
- package/lib/esm/types/features/limitDca/types.d.ts.map +0 -1
- package/lib/esm/types/features/metaAg/common.d.ts +0 -24
- package/lib/esm/types/features/metaAg/common.d.ts.map +0 -1
- package/lib/esm/types/features/metaAg/error.d.ts +0 -54
- package/lib/esm/types/features/metaAg/error.d.ts.map +0 -1
- package/lib/esm/types/features/metaAg/index.d.ts +0 -42
- package/lib/esm/types/features/metaAg/index.d.ts.map +0 -1
- package/lib/esm/types/features/metaAg/providers/bluefin7k.d.ts +0 -11
- package/lib/esm/types/features/metaAg/providers/bluefin7k.d.ts.map +0 -1
- package/lib/esm/types/features/metaAg/providers/cetus.d.ts +0 -11
- package/lib/esm/types/features/metaAg/providers/cetus.d.ts.map +0 -1
- package/lib/esm/types/features/metaAg/providers/flowx.d.ts +0 -13
- package/lib/esm/types/features/metaAg/providers/flowx.d.ts.map +0 -1
- package/lib/esm/types/features/metaAg/providers/okx.d.ts +0 -21
- package/lib/esm/types/features/metaAg/providers/okx.d.ts.map +0 -1
- package/lib/esm/types/features/prices/index.d.ts +0 -18
- package/lib/esm/types/features/prices/index.d.ts.map +0 -1
- package/lib/esm/types/index.d.ts +0 -23
- package/lib/esm/types/index.d.ts.map +0 -1
- package/lib/esm/types/libs/url.d.ts +0 -2
- package/lib/esm/types/libs/url.d.ts.map +0 -1
- package/lib/esm/types/metaAg.js +0 -11
- package/lib/esm/types/okx.js +0 -5
- package/lib/esm/types/types/metaAg.d.ts +0 -165
- package/lib/esm/types/types/metaAg.d.ts.map +0 -1
- package/lib/esm/types/types/okx.d.ts +0 -206
- package/lib/esm/types/types/okx.d.ts.map +0 -1
- package/lib/esm/types/utils/ObjectCache.d.ts +0 -87
- package/lib/esm/types/utils/ObjectCache.d.ts.map +0 -1
- package/lib/esm/types/utils/SuiClientUtils.d.ts +0 -15
- package/lib/esm/types/utils/SuiClientUtils.d.ts.map +0 -1
- package/lib/esm/types/utils/sui.d.ts +0 -27
- package/lib/esm/types/utils/sui.d.ts.map +0 -1
- package/lib/esm/types/utils/swap.d.ts +0 -15
- package/lib/esm/types/utils/swap.d.ts.map +0 -1
- package/lib/esm/types/utils/token.d.ts +0 -4
- package/lib/esm/types/utils/token.d.ts.map +0 -1
- package/lib/esm/utils/ObjectCache.js +0 -250
- package/lib/esm/utils/SuiClientUtils.js +0 -34
- package/lib/esm/utils/sui.js +0 -88
- package/lib/esm/utils/swap.js +0 -33
- package/lib/esm/utils/token.js +0 -10
package/lib/esm/types/index.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export * from "./types/metaAg";
|
|
2
|
-
import { MetaAg } from "./features/metaAg";
|
|
3
|
-
import { getSuiPrice, getTokenPrice, getTokenPrices } from "./features/prices";
|
|
4
|
-
import { cancelDcaOrder, cancelLimitOrder, claimExpiredLimitOrder, getClosedDcaOrders, getClosedLimitOrders, getDcaOrderExecutions, getOpenDcaOrders, getOpenLimitOrders, placeDcaOrder, placeLimitOrder } from "./features/limitDca";
|
|
5
|
-
export { MetaAg, cancelDcaOrder, cancelLimitOrder, claimExpiredLimitOrder, getClosedDcaOrders, getClosedLimitOrders, getDcaOrderExecutions, getOpenDcaOrders, getOpenLimitOrders, getSuiPrice, getTokenPrice, getTokenPrices, placeDcaOrder, placeLimitOrder, };
|
|
6
|
-
declare const _default: {
|
|
7
|
-
getTokenPrice: typeof getTokenPrice;
|
|
8
|
-
getTokenPrices: typeof getTokenPrices;
|
|
9
|
-
getSuiPrice: typeof getSuiPrice;
|
|
10
|
-
placeLimitOrder: typeof placeLimitOrder;
|
|
11
|
-
getOpenLimitOrders: typeof getOpenLimitOrders;
|
|
12
|
-
cancelLimitOrder: typeof cancelLimitOrder;
|
|
13
|
-
claimExpiredLimitOrder: typeof claimExpiredLimitOrder;
|
|
14
|
-
getClosedLimitOrders: typeof getClosedLimitOrders;
|
|
15
|
-
placeDcaOrder: typeof placeDcaOrder;
|
|
16
|
-
getOpenDcaOrders: typeof getOpenDcaOrders;
|
|
17
|
-
cancelDcaOrder: typeof cancelDcaOrder;
|
|
18
|
-
getClosedDcaOrders: typeof getClosedDcaOrders;
|
|
19
|
-
getDcaOrderExecutions: typeof getDcaOrderExecutions;
|
|
20
|
-
MetaAg: typeof MetaAg;
|
|
21
|
-
};
|
|
22
|
-
export default _default;
|
|
23
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE/E,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,MAAM,EACN,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAElB,WAAW,EACX,aAAa,EACb,cAAc,EAEd,aAAa,EAEb,eAAe,GAChB,CAAC;;;;;;;;;;;;;;;;;AAEF,wBAsBE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../src/libs/url.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,UAY5D"}
|
package/lib/esm/types/metaAg.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export var EProvider;
|
|
2
|
-
(function (EProvider) {
|
|
3
|
-
EProvider["BLUEFIN7K"] = "bluefin7k";
|
|
4
|
-
EProvider["CETUS"] = "cetus";
|
|
5
|
-
EProvider["FLOWX"] = "flowx";
|
|
6
|
-
EProvider["OKX"] = "okx";
|
|
7
|
-
})(EProvider || (EProvider = {}));
|
|
8
|
-
export const isAggregatorProvider = (provider) => provider.kind === EProvider.BLUEFIN7K ||
|
|
9
|
-
provider.kind === EProvider.CETUS ||
|
|
10
|
-
provider.kind === EProvider.FLOWX;
|
|
11
|
-
export const isSwapAPIProvider = (provider) => provider.kind === EProvider.OKX;
|
package/lib/esm/types/okx.js
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import type { QuoteResponse, SourceDex } from "@bluefin-exchange/bluefin7k-aggregator-sdk";
|
|
2
|
-
import type { PreSwapLpChangeParams, RouterDataV3 } from "@cetusprotocol/aggregator-sdk";
|
|
3
|
-
import type { AggregatorQuoter, Protocol } from "@flowx-finance/sdk";
|
|
4
|
-
import type { GasCostSummary } from "@mysten/sui/client";
|
|
5
|
-
import { SignatureWithBytes } from "@mysten/sui/cryptography";
|
|
6
|
-
import type { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
7
|
-
import { OkxSwapResponseData } from "./okx";
|
|
8
|
-
export declare enum EProvider {
|
|
9
|
-
BLUEFIN7K = "bluefin7k",
|
|
10
|
-
CETUS = "cetus",
|
|
11
|
-
FLOWX = "flowx",
|
|
12
|
-
OKX = "okx"
|
|
13
|
-
}
|
|
14
|
-
type ProviderBaseOptions = {
|
|
15
|
-
api?: string;
|
|
16
|
-
apiKey?: string;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
};
|
|
19
|
-
export type Bluefin7kProviderOptions = ProviderBaseOptions & {
|
|
20
|
-
sources?: SourceDex[];
|
|
21
|
-
excludedPools?: string[];
|
|
22
|
-
targetPools?: string[];
|
|
23
|
-
};
|
|
24
|
-
export type FlowxProviderOptions = ProviderBaseOptions & {
|
|
25
|
-
sources?: Protocol[];
|
|
26
|
-
excludePools?: string[];
|
|
27
|
-
excludeSources?: Protocol[];
|
|
28
|
-
maxHops?: number;
|
|
29
|
-
splitDistributionPercent?: number;
|
|
30
|
-
};
|
|
31
|
-
export type CetusProviderOptions = ProviderBaseOptions & {
|
|
32
|
-
sources?: string[];
|
|
33
|
-
splitCount?: number;
|
|
34
|
-
splitAlgorithm?: string;
|
|
35
|
-
splitFactor?: number;
|
|
36
|
-
depth?: number;
|
|
37
|
-
liquidityChanges?: PreSwapLpChangeParams[];
|
|
38
|
-
};
|
|
39
|
-
export type OkxProviderOptions = Required<Omit<ProviderBaseOptions, "api">> & {
|
|
40
|
-
api?: string;
|
|
41
|
-
secretKey: string;
|
|
42
|
-
apiPassphrase: string;
|
|
43
|
-
projectId: string;
|
|
44
|
-
};
|
|
45
|
-
export interface MetaAgOptions {
|
|
46
|
-
/**If not specified, all providers will be used */
|
|
47
|
-
providers?: {
|
|
48
|
-
[EProvider.BLUEFIN7K]?: Bluefin7kProviderOptions;
|
|
49
|
-
[EProvider.FLOWX]?: FlowxProviderOptions;
|
|
50
|
-
[EProvider.CETUS]?: CetusProviderOptions;
|
|
51
|
-
[EProvider.OKX]?: OkxProviderOptions;
|
|
52
|
-
};
|
|
53
|
-
/**Mainnet Json Rpc url, if not specified, the default mainnet url will be used */
|
|
54
|
-
fullnodeUrl?: string;
|
|
55
|
-
/**Hermes Api url, if not specified, the default hermes api url will be used */
|
|
56
|
-
hermesApi?: string;
|
|
57
|
-
/**Address to receive commission, if not specified, the commission will not be used */
|
|
58
|
-
partner?: string;
|
|
59
|
-
/**@default 0 */
|
|
60
|
-
partnerCommissionBps?: number;
|
|
61
|
-
/**@default 100 */
|
|
62
|
-
slippageBps?: number;
|
|
63
|
-
/**
|
|
64
|
-
* Tip to support 7k
|
|
65
|
-
* @default 0 */
|
|
66
|
-
tipBps?: number;
|
|
67
|
-
}
|
|
68
|
-
export interface MetaQuoteOptions {
|
|
69
|
-
coinTypeIn: string;
|
|
70
|
-
coinTypeOut: string;
|
|
71
|
-
amountIn: string;
|
|
72
|
-
/** Required for api-tx providers (ie: Okx) */
|
|
73
|
-
signer?: string;
|
|
74
|
-
/**
|
|
75
|
-
* Timeout for quote operation in milliseconds
|
|
76
|
-
* @default 2000ms
|
|
77
|
-
*/
|
|
78
|
-
timeout?: number;
|
|
79
|
-
}
|
|
80
|
-
export interface MetaSimulationOptions {
|
|
81
|
-
sender: string;
|
|
82
|
-
/**
|
|
83
|
-
* Timeout for simulation operation in milliseconds
|
|
84
|
-
* @default 2000ms
|
|
85
|
-
*/
|
|
86
|
-
timeout?: number;
|
|
87
|
-
/** If specify, defer the simulation that could reduce the time to display quote result, you must update the quote via the id on callback
|
|
88
|
-
* else await all quote and simulation before return
|
|
89
|
-
*/
|
|
90
|
-
onSimulated?: (payload: MetaQuote) => void;
|
|
91
|
-
}
|
|
92
|
-
export interface MetaFastSwapOptions {
|
|
93
|
-
/** Quote object from the quote operation */
|
|
94
|
-
quote: MetaQuote;
|
|
95
|
-
/** Signer address (owner of `coinIn`) */
|
|
96
|
-
signer: string;
|
|
97
|
-
/** If true, use the gas coin for the swap
|
|
98
|
-
* @default true */
|
|
99
|
-
useGasCoin?: boolean;
|
|
100
|
-
/**
|
|
101
|
-
* Sign the transaction bytes
|
|
102
|
-
* @param txBytes - base64 transaction bytes
|
|
103
|
-
* @returns - signature with bytes
|
|
104
|
-
*/
|
|
105
|
-
signTransaction: (txBytes: string) => Promise<SignatureWithBytes>;
|
|
106
|
-
}
|
|
107
|
-
export interface MetaSwapOptions {
|
|
108
|
-
/** Quote object from the quote operation */
|
|
109
|
-
quote: MetaQuote;
|
|
110
|
-
/** Signer address (owner of `coinIn`) */
|
|
111
|
-
signer: string;
|
|
112
|
-
/** Transaction object to add the swap operation */
|
|
113
|
-
tx: Transaction;
|
|
114
|
-
/**
|
|
115
|
-
* Coin object used for the swap, must be consumed completely, no `coinIn` left, user must pass the coinIn object with the balance required for the swap - ie in quote `amountIn`
|
|
116
|
-
* @warning `coinIn` value must match the quote `amountIn` */
|
|
117
|
-
coinIn: TransactionObjectArgument;
|
|
118
|
-
}
|
|
119
|
-
export type FlowxQuoteResponse = Awaited<ReturnType<AggregatorQuoter["getRoutes"]>>;
|
|
120
|
-
export type MetaQuote = ({
|
|
121
|
-
provider: EProvider.BLUEFIN7K;
|
|
122
|
-
quote: QuoteResponse;
|
|
123
|
-
} | {
|
|
124
|
-
provider: EProvider.CETUS;
|
|
125
|
-
quote: RouterDataV3;
|
|
126
|
-
} | {
|
|
127
|
-
provider: EProvider.FLOWX;
|
|
128
|
-
quote: FlowxQuoteResponse;
|
|
129
|
-
} | {
|
|
130
|
-
provider: EProvider.OKX;
|
|
131
|
-
quote: OkxSwapResponseData;
|
|
132
|
-
}) & {
|
|
133
|
-
/** uuid to keep track the quote result, used to apply simulation result on quote on callback `onSimulated`*/
|
|
134
|
-
id: string;
|
|
135
|
-
/** coin type: ie 0x2::sui::SUI */
|
|
136
|
-
coinTypeIn: string;
|
|
137
|
-
/** coin type: ie 0x2::sui::SUI */
|
|
138
|
-
coinTypeOut: string;
|
|
139
|
-
/** Amount in as u64 */
|
|
140
|
-
amountIn: string;
|
|
141
|
-
/** Amount out as u64 if there're no commission be applied to the amount out */
|
|
142
|
-
rawAmountOut: string;
|
|
143
|
-
/** Amount as u64 after minus any commission kind */
|
|
144
|
-
amountOut: string;
|
|
145
|
-
/** Simulated amount out if the transaction is executed */
|
|
146
|
-
simulatedAmountOut?: string;
|
|
147
|
-
/** Estimate gas consumption if the transaction is executed */
|
|
148
|
-
gasUsed?: GasCostSummary;
|
|
149
|
-
};
|
|
150
|
-
export interface QuoteProvider {
|
|
151
|
-
readonly kind: EProvider;
|
|
152
|
-
quote(_quoteOptions: MetaQuoteOptions): Promise<MetaQuote | null>;
|
|
153
|
-
}
|
|
154
|
-
export interface SwapAPIProvider extends QuoteProvider {
|
|
155
|
-
readonly kind: EProvider.OKX;
|
|
156
|
-
fastSwap(options: MetaFastSwapOptions): Promise<string>;
|
|
157
|
-
}
|
|
158
|
-
export interface AggregatorProvider extends QuoteProvider {
|
|
159
|
-
readonly kind: EProvider.BLUEFIN7K | EProvider.CETUS | EProvider.FLOWX;
|
|
160
|
-
swap(options: MetaSwapOptions): Promise<TransactionObjectArgument>;
|
|
161
|
-
}
|
|
162
|
-
export declare const isAggregatorProvider: (provider: QuoteProvider) => provider is AggregatorProvider;
|
|
163
|
-
export declare const isSwapAPIProvider: (provider: QuoteProvider) => provider is SwapAPIProvider;
|
|
164
|
-
export {};
|
|
165
|
-
//# sourceMappingURL=metaAg.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metaAg.d.ts","sourceRoot":"","sources":["../../../../src/types/metaAg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACV,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EACV,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAE5C,oBAAY,SAAS;IACnB,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,GAAG,QAAQ;CACZ;AACD,KAAK,mBAAmB,GAAG;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,GAAG;IAC3D,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AACF,M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e,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACpE;AAED,eAAO,MAAM,oBAAoB,GAC/B,UAAU,aAAa,KACtB,QAAQ,IAAI,kBAGoB,CAAC;AAEpC,eAAO,MAAM,iBAAiB,GAC5B,UAAU,aAAa,KACtB,QAAQ,IAAI,eAAkD,CAAC"}
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OKX DEX Swap API Types
|
|
3
|
-
* Documentation: https://web3.okx.com/vi/build/dev-docs/wallet-api/dex-swap
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Gas level options for swap transactions
|
|
7
|
-
*/
|
|
8
|
-
export type GasLevel = "average" | "fast" | "slow";
|
|
9
|
-
/**
|
|
10
|
-
* Swap mode options
|
|
11
|
-
*/
|
|
12
|
-
export type SwapMode = "exactIn" | "exactOut";
|
|
13
|
-
/**
|
|
14
|
-
* Swap API Request Parameters (v6)
|
|
15
|
-
*/
|
|
16
|
-
export interface OkxSwapRequest {
|
|
17
|
-
/** Unique identifier for the chain */
|
|
18
|
-
chainIndex?: string;
|
|
19
|
-
/** The input amount of a token to be sold (set in minimal divisible units, e.g., 1.00 USDT set as 1000000) */
|
|
20
|
-
amount: string;
|
|
21
|
-
/** Swap mode: "exactIn" or "exactOut" (default: "exactIn"). exactOut only supports Ethereum, Base, BSC, Arbitrum chains and Uni v3 protocols */
|
|
22
|
-
swapMode?: SwapMode;
|
|
23
|
-
/** The contract address of a token you want to send (e.g., 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee for native token) */
|
|
24
|
-
fromTokenAddress: string;
|
|
25
|
-
/** The contract address of a token you want to receive */
|
|
26
|
-
toTokenAddress: string;
|
|
27
|
-
/** Slippage limit. For EVM: 0-100. For Solana: 0-less than 100 (e.g., 0.5 means 0.5%) */
|
|
28
|
-
slippagePercent: string;
|
|
29
|
-
/** User's wallet address */
|
|
30
|
-
userWalletAddress: string;
|
|
31
|
-
/** Recipient address of a purchased token (if not set, userWalletAddress will receive the token) */
|
|
32
|
-
swapReceiverAddress?: string;
|
|
33
|
-
/** The percentage of fromTokenAmount sent to referrer. Min > 0, max 10 for Solana, 3 for all other chains. Maximum of nine decimal places */
|
|
34
|
-
feePercent?: string;
|
|
35
|
-
/** Wallet address to receive commission fee for fromToken. Must set feePercent together. Can only choose either fromToken or toToken commission per transaction */
|
|
36
|
-
fromTokenReferrerWalletAddress?: string;
|
|
37
|
-
/** Wallet address to receive commission fee for toToken. Must set feePercent together. Can only choose either fromToken or toToken commission per transaction */
|
|
38
|
-
toTokenReferrerWalletAddress?: string;
|
|
39
|
-
/** Positive slippage percentage (0-10, max 1 decimal point). Solana only, whitelist/enterprise clients only */
|
|
40
|
-
positiveSlippagePercent?: string;
|
|
41
|
-
/** Wallet address that receives positive slippage. Must set positiveSlippagePercent together. Solana only, whitelist/enterprise clients only */
|
|
42
|
-
positiveSlippageFeeAddress?: string;
|
|
43
|
-
/** The gas (in wei) for the swap transaction. EVM only. If too low, an error will be returned */
|
|
44
|
-
gasLimit?: string;
|
|
45
|
-
/** Target gas price level (defaults to "average"). EVM only */
|
|
46
|
-
gasLevel?: GasLevel;
|
|
47
|
-
/** Used for Solana transactions, similar to gasPrice on Ethereum. Determines transaction priority */
|
|
48
|
-
computeUnitPrice?: string;
|
|
49
|
-
/** Used for Solana transactions, similar to gasLimit on Ethereum. If tips is not 0, computeUnitPrice should be set to 0 */
|
|
50
|
-
computeUnitLimit?: string;
|
|
51
|
-
/** Jito tips in SOL. Maximum is "2", minimum is "0.0000000001". Used for MEV protection. Solana only */
|
|
52
|
-
tips?: string;
|
|
53
|
-
/** DexId of liquidity pool for limited quotes, multiple separated by comma (e.g., "1,50,180") */
|
|
54
|
-
dexIds?: string;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Token information
|
|
58
|
-
*/
|
|
59
|
-
export interface OkxTokenInfo {
|
|
60
|
-
/** Token contract address */
|
|
61
|
-
tokenContractAddress: string;
|
|
62
|
-
/** Token symbol (e.g., "USDC") */
|
|
63
|
-
tokenSymbol: string;
|
|
64
|
-
/** Token unit price in USD (may be null for special cases) */
|
|
65
|
-
tokenUnitPrice: string | null;
|
|
66
|
-
/** Decimal number defining smallest unit */
|
|
67
|
-
decimal: string;
|
|
68
|
-
/** Whether the token is a honeypot token */
|
|
69
|
-
isHoneyPot: boolean;
|
|
70
|
-
/** Token tax rate (0-1, where 0.01 = 1%) */
|
|
71
|
-
taxRate: string;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* DEX Protocol information
|
|
75
|
-
*/
|
|
76
|
-
export interface OkxDexProtocol {
|
|
77
|
-
/** Name of the liquidity protocol (e.g., "Uniswap V3") */
|
|
78
|
-
dexName: string;
|
|
79
|
-
/** Percentage of assets handled by the protocol */
|
|
80
|
-
percent: string;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Sub-router information
|
|
84
|
-
*/
|
|
85
|
-
export interface OkxSubRouter {
|
|
86
|
-
/** Liquidity protocol used on the path */
|
|
87
|
-
dexProtocol: OkxDexProtocol;
|
|
88
|
-
/** Index of the from token */
|
|
89
|
-
fromTokenIndex: string;
|
|
90
|
-
/** Index of the to token */
|
|
91
|
-
toTokenIndex: string;
|
|
92
|
-
/** Information of token to be sold */
|
|
93
|
-
fromToken: OkxTokenInfo;
|
|
94
|
-
/** Information of token to be bought */
|
|
95
|
-
toToken: OkxTokenInfo;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Main router information (deprecated in v6, kept for backward compatibility)
|
|
99
|
-
* In v6, dexRouterList is an array of OkxSubRouter directly
|
|
100
|
-
*/
|
|
101
|
-
export interface OkxRouter {
|
|
102
|
-
/** One of the main paths for the token swap */
|
|
103
|
-
router: string;
|
|
104
|
-
/** Percentage of assets handled by the main path */
|
|
105
|
-
routerPercent: string;
|
|
106
|
-
/** Quote path sub data set */
|
|
107
|
-
subRouterList: OkxSubRouter[];
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Quote comparison information
|
|
111
|
-
*/
|
|
112
|
-
export interface OkxQuoteCompare {
|
|
113
|
-
/** DEX name of the quote route */
|
|
114
|
-
dexName: string;
|
|
115
|
-
/** DEX logo of the quote route */
|
|
116
|
-
dexLogo: string;
|
|
117
|
-
/** Estimated network fee (USD) of the quote route */
|
|
118
|
-
tradeFee: string;
|
|
119
|
-
/** Received amount of the quote route */
|
|
120
|
-
amountOut: string;
|
|
121
|
-
/** Price impact percentage */
|
|
122
|
-
priceImpactPercentage: string;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Transaction data model
|
|
126
|
-
*/
|
|
127
|
-
export interface OkxTransactionData {
|
|
128
|
-
/** Additional signing data (if required). When tips is specified, represents calldata of jito tips transfer */
|
|
129
|
-
signatureData?: string[];
|
|
130
|
-
/** User's wallet address */
|
|
131
|
-
from: string;
|
|
132
|
-
/** Estimated amount of the gas limit (increase by 50% for accurate data) */
|
|
133
|
-
gas: string;
|
|
134
|
-
/** Gas price in wei */
|
|
135
|
-
gasPrice?: string;
|
|
136
|
-
/** EIP-1559: Recommended priority cost of gas per unit */
|
|
137
|
-
maxPriorityFeePerGas?: string;
|
|
138
|
-
/** The contract address of OKX DEX router */
|
|
139
|
-
to: string;
|
|
140
|
-
/** The amount of native tokens (in wei) to be sent to the contract */
|
|
141
|
-
value: string;
|
|
142
|
-
/** The maximum amount of a token to spend when price reaches upper limit of slippage (applies to exactOut mode) */
|
|
143
|
-
maxSpendAmount?: string;
|
|
144
|
-
/** The minimum amount of a token to buy when price reaches upper limit of slippage */
|
|
145
|
-
minReceiveAmount: string;
|
|
146
|
-
/** Call data */
|
|
147
|
-
data: string;
|
|
148
|
-
/** Current transaction slippage value */
|
|
149
|
-
slippagePercent: string;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Router result data
|
|
153
|
-
*/
|
|
154
|
-
export interface OkxRouterResult {
|
|
155
|
-
/** Unique identifier for the chain */
|
|
156
|
-
chainIndex: string;
|
|
157
|
-
/** Context slot (for Solana) */
|
|
158
|
-
contextSlot?: number;
|
|
159
|
-
/** Quote path data set - array of sub-routers */
|
|
160
|
-
dexRouterList: OkxSubRouter[];
|
|
161
|
-
/** Estimated gas consumption in smallest units (e.g., wei) */
|
|
162
|
-
estimateGasFee: string;
|
|
163
|
-
/** Information of token to be sold */
|
|
164
|
-
fromToken: OkxTokenInfo;
|
|
165
|
-
/** The input amount of a token to be sold */
|
|
166
|
-
fromTokenAmount: string;
|
|
167
|
-
/** Price impact percentage = (Received value – Paid value) / Paid value. Can be positive if received value exceeds paid value */
|
|
168
|
-
priceImpactPercent: string;
|
|
169
|
-
/** Router identifier */
|
|
170
|
-
router: string;
|
|
171
|
-
/** Swap mode: "exactIn" or "exactOut" */
|
|
172
|
-
swapMode: SwapMode;
|
|
173
|
-
/** Information of token to be bought */
|
|
174
|
-
toToken: OkxTokenInfo;
|
|
175
|
-
/** The resulting amount of a token to be bought */
|
|
176
|
-
toTokenAmount: string;
|
|
177
|
-
/** Estimated network fee (USD) of the quote route */
|
|
178
|
-
tradeFee: string;
|
|
179
|
-
/** Comparison of quote routes */
|
|
180
|
-
quoteCompareList?: OkxQuoteCompare[];
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Swap API Response Data
|
|
184
|
-
*/
|
|
185
|
-
export interface OkxSwapResponseData {
|
|
186
|
-
/** Quote path data */
|
|
187
|
-
routerResult: OkxRouterResult;
|
|
188
|
-
/** Contract data model */
|
|
189
|
-
tx: OkxTransactionData;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* OKX API Standard Response Wrapper
|
|
193
|
-
*/
|
|
194
|
-
export interface OkxApiResponse<T> {
|
|
195
|
-
/** Response code ("0" indicates success) */
|
|
196
|
-
code: string;
|
|
197
|
-
/** Response data array */
|
|
198
|
-
data: T[];
|
|
199
|
-
/** Response message */
|
|
200
|
-
msg: string;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Complete Swap API Response
|
|
204
|
-
*/
|
|
205
|
-
export type OkxSwapResponse = OkxApiResponse<OkxSwapResponseData>;
|
|
206
|
-
//# sourceMappingURL=okx.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"okx.d.ts","sourceRoot":"","sources":["../../../../src/types/okx.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,sCAAsC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8GAA8G;IAC9G,MAAM,EAAE,MAAM,CAAC;IACf,gJAAgJ;IAChJ,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,2HAA2H;IAC3H,gBAAgB,EAAE,MAAM,CAAC;IACzB,0DAA0D;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,eAAe,EAAE,MAAM,CAAC;IACxB,4BAA4B;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oGAAoG;IACpG,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6IAA6I;IAC7I,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mKAAmK;IACnK,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,iKAAiK;IACjK,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,+GAA+G;IAC/G,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,gJAAgJ;IAChJ,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,iGAAiG;IACjG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,qGAAqG;IACrG,gBA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mD;IACnD,aAAa,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,sBAAsB;IACtB,YAAY,EAAE,eAAe,CAAC;IAC9B,0BAA0B;IAC1B,EAAE,EAAE,kBAAkB,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { bcs } from "@mysten/sui/bcs";
|
|
2
|
-
import { SuiClient } from "@mysten/sui/client";
|
|
3
|
-
import { OpenMoveTypeSignature, TransactionPlugin } from "@mysten/sui/transactions";
|
|
4
|
-
export interface ObjectCacheEntry {
|
|
5
|
-
objectId: string;
|
|
6
|
-
version: string;
|
|
7
|
-
digest: string;
|
|
8
|
-
owner: string | null;
|
|
9
|
-
initialSharedVersion: string | null;
|
|
10
|
-
}
|
|
11
|
-
export interface MoveFunctionCacheEntry {
|
|
12
|
-
package: string;
|
|
13
|
-
module: string;
|
|
14
|
-
function: string;
|
|
15
|
-
parameters: OpenMoveTypeSignature[];
|
|
16
|
-
}
|
|
17
|
-
export interface CacheEntryTypes {
|
|
18
|
-
OwnedObject: ObjectCacheEntry;
|
|
19
|
-
SharedOrImmutableObject: ObjectCacheEntry;
|
|
20
|
-
MoveFunction: MoveFunctionCacheEntry;
|
|
21
|
-
Custom: unknown;
|
|
22
|
-
}
|
|
23
|
-
export declare abstract class AsyncCache {
|
|
24
|
-
protected abstract get<T extends keyof CacheEntryTypes>(type: T, key: string): Promise<CacheEntryTypes[T] | null>;
|
|
25
|
-
protected abstract set<T extends keyof CacheEntryTypes>(type: T, key: string, value: CacheEntryTypes[T]): Promise<void>;
|
|
26
|
-
protected abstract delete<T extends keyof CacheEntryTypes>(type: T, key: string): Promise<void>;
|
|
27
|
-
abstract clear<T extends keyof CacheEntryTypes>(type?: T): Promise<void>;
|
|
28
|
-
getObject(id: string): Promise<ObjectCacheEntry | null>;
|
|
29
|
-
getObjects(ids: string[]): Promise<(ObjectCacheEntry | null)[]>;
|
|
30
|
-
addObject(object: ObjectCacheEntry): Promise<ObjectCacheEntry>;
|
|
31
|
-
addObjects(objects: ObjectCacheEntry[]): Promise<void>;
|
|
32
|
-
deleteObject(id: string): Promise<void>;
|
|
33
|
-
deleteObjects(ids: string[]): Promise<void>;
|
|
34
|
-
getMoveFunctionDefinition(ref: {
|
|
35
|
-
package: string;
|
|
36
|
-
module: string;
|
|
37
|
-
function: string;
|
|
38
|
-
}): Promise<MoveFunctionCacheEntry | null>;
|
|
39
|
-
addMoveFunctionDefinition(functionEntry: MoveFunctionCacheEntry): Promise<{
|
|
40
|
-
package: string;
|
|
41
|
-
module: string;
|
|
42
|
-
function: string;
|
|
43
|
-
parameters: OpenMoveTypeSignature[];
|
|
44
|
-
}>;
|
|
45
|
-
deleteMoveFunctionDefinition(ref: {
|
|
46
|
-
package: string;
|
|
47
|
-
module: string;
|
|
48
|
-
function: string;
|
|
49
|
-
}): Promise<void>;
|
|
50
|
-
getCustom<T>(key: string): Promise<T | null>;
|
|
51
|
-
setCustom<T>(key: string, value: T): Promise<void>;
|
|
52
|
-
deleteCustom(key: string): Promise<void>;
|
|
53
|
-
}
|
|
54
|
-
export declare class InMemoryObjectCache extends AsyncCache {
|
|
55
|
-
#private;
|
|
56
|
-
protected get<T extends keyof CacheEntryTypes>(type: T, key: string): Promise<NonNullable<CacheEntryTypes[T]> | null>;
|
|
57
|
-
protected set<T extends keyof CacheEntryTypes>(type: T, key: string, value: CacheEntryTypes[T]): Promise<void>;
|
|
58
|
-
protected delete<T extends keyof CacheEntryTypes>(type: T, key: string): Promise<void>;
|
|
59
|
-
clear<T extends keyof CacheEntryTypes>(type?: T): Promise<void>;
|
|
60
|
-
}
|
|
61
|
-
export interface ObjectCacheOptions {
|
|
62
|
-
cache?: AsyncCache;
|
|
63
|
-
client: SuiClient;
|
|
64
|
-
onEffects?: (effects: typeof bcs.TransactionEffects.$inferType) => Promise<void>;
|
|
65
|
-
}
|
|
66
|
-
export declare class CustomObjectCache {
|
|
67
|
-
#private;
|
|
68
|
-
constructor({ cache, onEffects, client, }: ObjectCacheOptions);
|
|
69
|
-
private applyCache;
|
|
70
|
-
private resolveObjects;
|
|
71
|
-
asPlugin(): TransactionPlugin;
|
|
72
|
-
clear(): Promise<void>;
|
|
73
|
-
getMoveFunctionDefinition(ref: {
|
|
74
|
-
package: string;
|
|
75
|
-
module: string;
|
|
76
|
-
function: string;
|
|
77
|
-
}): Promise<MoveFunctionCacheEntry | null>;
|
|
78
|
-
getObjects(ids: string[]): Promise<(ObjectCacheEntry | null)[]>;
|
|
79
|
-
deleteObjects(ids: string[]): Promise<void>;
|
|
80
|
-
clearOwnedObjects(): Promise<void>;
|
|
81
|
-
clearCustom(): Promise<void>;
|
|
82
|
-
getCustom<T>(key: string): Promise<T | null>;
|
|
83
|
-
setCustom<T>(key: string, value: T): Promise<void>;
|
|
84
|
-
deleteCustom(key: string): Promise<void>;
|
|
85
|
-
applyEffects(effects: typeof bcs.TransactionEffects.$inferType): Promise<void>;
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=ObjectCache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectCache.d.ts","sourceRoot":"","sources":["../../../../src/utils/ObjectCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB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C,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,CACV,OAAO,EAAE,OAAO,GAAG,CAAC,kBAAkB,CAAC,UAAU,KAC9C,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED,qBAAa,iBAAiB;;gBAOhB,EACV,KAAiC,EACjC,SAAS,EACT,MAAM,GACP,EAAE,kBAAkB;YAMP,UAAU;YAyCV,cAAc;IA8C5B,QAAQ,IAAI,iBAAiB;IA0CvB,KAAK;IAIL,yBAAyB,CAAC,GAAG,EAAE;QACnC,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB;IAIK,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE;IAIxB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE;IAI3B,iBAAiB;IAIjB,WAAW;IAIX,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM;IAIxB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAIlC,YAAY,CAAC,GAAG,EAAE,MAAM;IAIxB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,CAAC,kBAAkB,CAAC,UAAU;CAkCrE"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DevInspectTransactionBlockParams, SuiClient } from "@mysten/sui/client";
|
|
2
|
-
/**
|
|
3
|
-
* Utility class for interacting with Sui blockchain coins
|
|
4
|
-
*/
|
|
5
|
-
export declare class SuiClientUtils {
|
|
6
|
-
#private;
|
|
7
|
-
private client;
|
|
8
|
-
/**
|
|
9
|
-
* Creates a new instance of SuiClientUtils
|
|
10
|
-
* @param client - The Sui client instance to use for blockchain interactions
|
|
11
|
-
*/
|
|
12
|
-
constructor(client: SuiClient);
|
|
13
|
-
devInspectTransactionBlock: (params: DevInspectTransactionBlockParams) => Promise<import("@mysten/sui/client").DevInspectResults>;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=SuiClientUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SuiClientUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/SuiClientUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,SAAS,EACV,MAAM,oBAAoB,CAAC;AAI5B;;GAEG;AACH,qBAAa,cAAc;;IAMb,OAAO,CAAC,MAAM;IAJ1B;;;OAGG;gBACiB,MAAM,EAAE,SAAS;IAIrC,0BAA0B,GACxB,QAAQ,gCAAgC,6DAexC;CACH"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
2
|
-
export declare const SuiUtils: {
|
|
3
|
-
getSuiCoin(amount: bigint | TransactionArgument, txb: Transaction): TransactionArgument;
|
|
4
|
-
getCoinValue(coinType: string, coinObject: string | TransactionArgument, txb: Transaction): TransactionArgument;
|
|
5
|
-
isValidStructTag(value: string): boolean;
|
|
6
|
-
zeroBalance(tx: Transaction, coinType: string): {
|
|
7
|
-
$kind: "NestedResult";
|
|
8
|
-
NestedResult: [number, number];
|
|
9
|
-
};
|
|
10
|
-
zeroCoin(tx: Transaction, coinType: string): {
|
|
11
|
-
$kind: "NestedResult";
|
|
12
|
-
NestedResult: [number, number];
|
|
13
|
-
};
|
|
14
|
-
coinIntoBalance(tx: Transaction, coinType: string, coinObject: TransactionArgument): {
|
|
15
|
-
$kind: "NestedResult";
|
|
16
|
-
NestedResult: [number, number];
|
|
17
|
-
};
|
|
18
|
-
coinFromBalance(tx: Transaction, coinType: string, balance: TransactionArgument): {
|
|
19
|
-
$kind: "NestedResult";
|
|
20
|
-
NestedResult: [number, number];
|
|
21
|
-
};
|
|
22
|
-
balanceDestroyZero(tx: Transaction, coinType: string, balance: TransactionArgument): void;
|
|
23
|
-
collectDust(tx: Transaction, coinType: string, coin: TransactionArgument): void;
|
|
24
|
-
transferOrDestroyZeroCoin(tx: Transaction, coinType: string, coin: TransactionArgument, address: string): void;
|
|
25
|
-
};
|
|
26
|
-
export declare const isSystemAddress: (address: string) => boolean;
|
|
27
|
-
//# sourceMappingURL=sui.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sui.d.ts","sourceRoot":"","sources":["../../../../src/utils/sui.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AA6B5E,eAAO,MAAM,QAAQ;uBAET,MAAM,GAAG,mBAAmB,OAC/B,WAAW,GACf,mBAAmB;2BAMV,MAAM,cACJ,MAAM,GAAG,mBAAmB,OACnC,WAAW,GACf,mBAAmB;4BAWE,MAAM;oBAQd,WAAW,YAAY,MAAM;;;;iBAQhC,WAAW,YAAY,MAAM;;;;wBASpC,WAAW,YACL,MAAM,cACJ,mBAAmB;;;;wBAU3B,WAAW,YACL,MAAM,WACP,mBAAmB;;;;2BAUxB,WAAW,YACL,MAAM,WACP,mBAAmB;oBASd,WAAW,YAAY,MAAM,QAAQ,mBAAmB;kCASlE,WAAW,YACL,MAAM,QACV,mBAAmB,WAChB,MAAM;CAQlB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,YAY9C,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calculate expected return amount after applying slippage, commission, and tip
|
|
3
|
-
* @param returnAmount - The raw return amount (with decimals)
|
|
4
|
-
* @param slippageBps - Slippage in basis points (1 bps = 0.01%)
|
|
5
|
-
* @param commissionBps - Commission in basis points
|
|
6
|
-
* @param tipBps - Tip in basis points (default: 0)
|
|
7
|
-
* @returns Object containing tipAmount, minAmount, commissionAmount, and expectedAmount
|
|
8
|
-
*/
|
|
9
|
-
export declare const getExpectedReturn: (returnAmount: string, slippageBps: number, commissionBps: number, tipBps?: number) => {
|
|
10
|
-
tipAmount: bigint;
|
|
11
|
-
minAmount: bigint;
|
|
12
|
-
commissionAmount: bigint;
|
|
13
|
-
expectedAmount: string;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=swap.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../../../src/utils/swap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAC5B,cAAc,MAAM,EACpB,aAAa,MAAM,EACnB,eAAe,MAAM,EACrB,SAAQ,MAAU;;;;;CA8BnB,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare function normalizeTokenType(type: string): string;
|
|
2
|
-
export declare function denormalizeTokenType(type: string): string;
|
|
3
|
-
export declare function checkIsSui(type: string): type is "0x2::sui::SUI" | "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
4
|
-
//# sourceMappingURL=token.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../../src/utils/token.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,UAE9C;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,UAEhD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,4GAEtC"}
|