@7kprotocol/sdk-ts 1.3.3 → 1.3.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/buildTx.js +10 -2
- package/lib/cjs/estimateGasFee.js +2 -2
- package/lib/cjs/libs/getSplitCoinForTx.js +2 -10
- package/lib/cjs/types/buildTx.d.ts +1 -1
- package/lib/cjs/types/buildTx.d.ts.map +1 -1
- package/lib/cjs/types/estimateGasFee.d.ts +1 -1
- package/lib/cjs/types/estimateGasFee.d.ts.map +1 -1
- package/lib/cjs/types/index.d.ts +1 -1
- package/lib/cjs/types/libs/getSplitCoinForTx.d.ts.map +1 -1
- package/lib/cjs/types/types/tx.d.ts +5 -2
- package/lib/cjs/types/types/tx.d.ts.map +1 -1
- package/lib/esm/buildTx.js +10 -2
- package/lib/esm/estimateGasFee.js +2 -2
- package/lib/esm/libs/getSplitCoinForTx.js +2 -10
- package/lib/esm/types/buildTx.d.ts +1 -1
- package/lib/esm/types/buildTx.d.ts.map +1 -1
- package/lib/esm/types/estimateGasFee.d.ts +1 -1
- package/lib/esm/types/estimateGasFee.d.ts.map +1 -1
- package/lib/esm/types/index.d.ts +1 -1
- package/lib/esm/types/libs/getSplitCoinForTx.d.ts.map +1 -1
- package/lib/esm/types/types/tx.d.ts +5 -2
- package/lib/esm/types/types/tx.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/cjs/buildTx.js
CHANGED
|
@@ -22,7 +22,8 @@ const token_1 = require("./utils/token");
|
|
|
22
22
|
const sui_1 = require("./utils/sui");
|
|
23
23
|
const _7k_1 = require("./constants/_7k");
|
|
24
24
|
const utils_1 = require("@mysten/sui.js/utils");
|
|
25
|
-
const buildTx = (_a) => __awaiter(void 0, [_a], void 0, function* ({ quoteResponse, accountAddress, slippage,
|
|
25
|
+
const buildTx = (_a) => __awaiter(void 0, [_a], void 0, function* ({ quoteResponse, accountAddress, slippage, commission: _commission, isGasEstimate, extendTx, }) {
|
|
26
|
+
const { tx: _tx, coinIn } = extendTx || {};
|
|
26
27
|
if (!accountAddress) {
|
|
27
28
|
throw new Error("Sender address is required");
|
|
28
29
|
}
|
|
@@ -35,7 +36,14 @@ const buildTx = (_a) => __awaiter(void 0, [_a], void 0, function* ({ quoteRespon
|
|
|
35
36
|
const tx = _tx || new transactions_1.TransactionBlock();
|
|
36
37
|
const routes = (0, groupSwapRoutes_1.groupSwapRoutes)(quoteResponse);
|
|
37
38
|
const splits = routes.map((group) => { var _a, _b; return (_b = (_a = group[0]) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : "0"; });
|
|
38
|
-
|
|
39
|
+
let coinData;
|
|
40
|
+
if (coinIn) {
|
|
41
|
+
coinData = tx.splitCoins(coinIn, splits.map((split) => tx.pure(split)));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
const { coinData: _data } = yield (0, getSplitCoinForTx_1.getSplitCoinForTx)(accountAddress, quoteResponse.swapAmountWithDecimal, splits, (0, token_1.denormalizeTokenType)(quoteResponse.tokenIn), tx, isGasEstimate);
|
|
45
|
+
coinData = _data;
|
|
46
|
+
}
|
|
39
47
|
const coinObjects = [];
|
|
40
48
|
yield Promise.all(routes.map((route, index) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
49
|
const inputCoinObject = coinData[index];
|
|
@@ -20,11 +20,11 @@ const number_1 = require("./utils/number");
|
|
|
20
20
|
const suiClient_1 = require("./suiClient");
|
|
21
21
|
const getSuiPrice_1 = require("./getSuiPrice");
|
|
22
22
|
function estimateGasFee(_a) {
|
|
23
|
-
return __awaiter(this, arguments, void 0, function* ({ quoteResponse, accountAddress, slippage, suiPrice: _suiPrice,
|
|
23
|
+
return __awaiter(this, arguments, void 0, function* ({ quoteResponse, accountAddress, slippage, suiPrice: _suiPrice, extendTx, commission, }) {
|
|
24
24
|
if (!accountAddress)
|
|
25
25
|
return 0;
|
|
26
26
|
const tx = yield (0, buildTx_1.buildTx)({
|
|
27
|
-
|
|
27
|
+
extendTx,
|
|
28
28
|
quoteResponse,
|
|
29
29
|
accountAddress,
|
|
30
30
|
slippage,
|
|
@@ -18,10 +18,7 @@ const getSplitCoinForTx = (account, amount, splits, coinType, inheritTx, inspecT
|
|
|
18
18
|
const { objectIds } = yield (0, getCoinOjectIdsByAmount_1.getCoinOjectIdsByAmount)(account, amount, coinType);
|
|
19
19
|
const coinObjectId = objectIds[0];
|
|
20
20
|
if (coinType === tokens_1.SUI_TYPE) {
|
|
21
|
-
const pureAmount =
|
|
22
|
-
for (const split of splits) {
|
|
23
|
-
pureAmount.push(tx.pure(split));
|
|
24
|
-
}
|
|
21
|
+
const pureAmount = splits.map((split) => tx.pure(split));
|
|
25
22
|
let coin;
|
|
26
23
|
if (inspecTransaction) {
|
|
27
24
|
if (objectIds.length > 1) {
|
|
@@ -37,13 +34,8 @@ const getSplitCoinForTx = (account, amount, splits, coinType, inheritTx, inspecT
|
|
|
37
34
|
if (objectIds.length > 1) {
|
|
38
35
|
tx.mergeCoins(tx.object(coinObjectId), objectIds.slice(1).map((item) => tx.object(item)));
|
|
39
36
|
}
|
|
40
|
-
//handle split coin
|
|
41
|
-
const pureAmount = [];
|
|
42
|
-
for (const split of splits) {
|
|
43
|
-
pureAmount.push(tx.pure(split));
|
|
44
|
-
}
|
|
45
37
|
// split correct amount to swap
|
|
46
|
-
const coinData = tx.splitCoins(tx.object(coinObjectId),
|
|
38
|
+
const coinData = tx.splitCoins(tx.object(coinObjectId), splits.map((split) => tx.pure(split)));
|
|
47
39
|
return { tx, coinData };
|
|
48
40
|
});
|
|
49
41
|
exports.getSplitCoinForTx = getSplitCoinForTx;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
2
2
|
import { BuildTxParams } from "./types/tx";
|
|
3
|
-
export declare const buildTx: ({ quoteResponse, accountAddress, slippage,
|
|
3
|
+
export declare const buildTx: ({ quoteResponse, accountAddress, slippage, commission: _commission, isGasEstimate, extendTx, }: BuildTxParams) => Promise<TransactionBlock>;
|
|
4
4
|
//# sourceMappingURL=buildTx.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../src/buildTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,
|
|
1
|
+
{"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../src/buildTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAGjB,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI3C,eAAO,MAAM,OAAO,mGAOjB,aAAa,8BAiFf,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EstimateGasFeeParams } from "./types/tx";
|
|
2
|
-
export declare function estimateGasFee({ quoteResponse, accountAddress, slippage, suiPrice: _suiPrice,
|
|
2
|
+
export declare function estimateGasFee({ quoteResponse, accountAddress, slippage, suiPrice: _suiPrice, extendTx, commission, }: EstimateGasFeeParams): Promise<number>;
|
|
3
3
|
//# sourceMappingURL=estimateGasFee.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"estimateGasFee.d.ts","sourceRoot":"","sources":["../../../src/estimateGasFee.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAIlD,wBAAsB,cAAc,CAAC,EACnC,aAAa,EACb,cAAc,EACd,QAAQ,EACR,QAAQ,EAAE,SAAS,EACnB,
|
|
1
|
+
{"version":3,"file":"estimateGasFee.d.ts","sourceRoot":"","sources":["../../../src/estimateGasFee.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAIlD,wBAAsB,cAAc,CAAC,EACnC,aAAa,EACb,cAAc,EACd,QAAQ,EACR,QAAQ,EAAE,SAAS,EACnB,QAAQ,EACR,UAAU,GACX,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqCxC"}
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare const _default: {
|
|
|
11
11
|
getQuote: typeof getQuote;
|
|
12
12
|
getSuiPrice: typeof getSuiPrice;
|
|
13
13
|
estimateGasFee: typeof estimateGasFee;
|
|
14
|
-
buildTx: ({ quoteResponse, accountAddress, slippage,
|
|
14
|
+
buildTx: ({ quoteResponse, accountAddress, slippage, commission: _commission, isGasEstimate, extendTx, }: import("./types/tx").BuildTxParams) => Promise<import("@mysten/sui.js/dist/cjs/transactions").TransactionBlock>;
|
|
15
15
|
};
|
|
16
16
|
export default _default;
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitCoinForTx.d.ts","sourceRoot":"","sources":["../../../../src/libs/getSplitCoinForTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAIrC,eAAO,MAAM,iBAAiB,YACnB,MAAM,UACP,MAAM,UACN,MAAM,EAAE,YACN,MAAM,cACJ,gBAAgB,sBACR,OAAO,KAC1B,OAAO,CAAC;IACT,EAAE,EAAE,gBAAgB,CAAC;IACrB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,
|
|
1
|
+
{"version":3,"file":"getSplitCoinForTx.d.ts","sourceRoot":"","sources":["../../../../src/libs/getSplitCoinForTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAIrC,eAAO,MAAM,iBAAiB,YACnB,MAAM,UACP,MAAM,UACN,MAAM,EAAE,YACN,MAAM,cACJ,gBAAgB,sBACR,OAAO,KAC1B,OAAO,CAAC;IACT,EAAE,EAAE,gBAAgB,CAAC;IACrB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,CAsCA,CAAC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
1
|
+
import { TransactionBlock, TransactionObjectArgument } from "@mysten/sui.js/transactions";
|
|
2
2
|
import { Commission, QuoteResponse } from "./aggregator";
|
|
3
3
|
import BigNumber from "bignumber.js";
|
|
4
4
|
export interface CommonParams {
|
|
5
|
-
tx?: TransactionBlock;
|
|
6
5
|
quoteResponse: QuoteResponse;
|
|
7
6
|
accountAddress: string;
|
|
8
7
|
slippage: BigNumber.Value;
|
|
9
8
|
commission: Commission;
|
|
9
|
+
extendTx?: {
|
|
10
|
+
tx: TransactionBlock;
|
|
11
|
+
coinIn?: TransactionObjectArgument;
|
|
12
|
+
};
|
|
10
13
|
}
|
|
11
14
|
export interface BuildTxParams extends CommonParams {
|
|
12
15
|
isGasEstimate?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../../../src/types/tx.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../../../src/types/tx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC;IAC1B,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,CAAC,EAAE;QACT,EAAE,EAAE,gBAAgB,CAAC;QACrB,MAAM,CAAC,EAAE,yBAAyB,CAAC;KACpC,CAAC;CACH;AAED,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
package/lib/esm/buildTx.js
CHANGED
|
@@ -7,7 +7,8 @@ import { denormalizeTokenType } from "./utils/token";
|
|
|
7
7
|
import { SuiUtils } from "./utils/sui";
|
|
8
8
|
import { _7K_CONFIG, _7K_PACKAGE_ID } from "./constants/_7k";
|
|
9
9
|
import { isValidSuiAddress } from "@mysten/sui.js/utils";
|
|
10
|
-
export const buildTx = async ({ quoteResponse, accountAddress, slippage,
|
|
10
|
+
export const buildTx = async ({ quoteResponse, accountAddress, slippage, commission: _commission, isGasEstimate, extendTx, }) => {
|
|
11
|
+
const { tx: _tx, coinIn } = extendTx || {};
|
|
11
12
|
if (!accountAddress) {
|
|
12
13
|
throw new Error("Sender address is required");
|
|
13
14
|
}
|
|
@@ -20,7 +21,14 @@ export const buildTx = async ({ quoteResponse, accountAddress, slippage, tx: _tx
|
|
|
20
21
|
const tx = _tx || new TransactionBlock();
|
|
21
22
|
const routes = groupSwapRoutes(quoteResponse);
|
|
22
23
|
const splits = routes.map((group) => group[0]?.amount ?? "0");
|
|
23
|
-
|
|
24
|
+
let coinData;
|
|
25
|
+
if (coinIn) {
|
|
26
|
+
coinData = tx.splitCoins(coinIn, splits.map((split) => tx.pure(split)));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const { coinData: _data } = await getSplitCoinForTx(accountAddress, quoteResponse.swapAmountWithDecimal, splits, denormalizeTokenType(quoteResponse.tokenIn), tx, isGasEstimate);
|
|
30
|
+
coinData = _data;
|
|
31
|
+
}
|
|
24
32
|
const coinObjects = [];
|
|
25
33
|
await Promise.all(routes.map(async (route, index) => {
|
|
26
34
|
const inputCoinObject = coinData[index];
|
|
@@ -4,11 +4,11 @@ import { buildTx } from "./buildTx";
|
|
|
4
4
|
import { formatBalance } from "./utils/number";
|
|
5
5
|
import { getSuiClient } from "./suiClient";
|
|
6
6
|
import { getSuiPrice } from "./getSuiPrice";
|
|
7
|
-
export async function estimateGasFee({ quoteResponse, accountAddress, slippage, suiPrice: _suiPrice,
|
|
7
|
+
export async function estimateGasFee({ quoteResponse, accountAddress, slippage, suiPrice: _suiPrice, extendTx, commission, }) {
|
|
8
8
|
if (!accountAddress)
|
|
9
9
|
return 0;
|
|
10
10
|
const tx = await buildTx({
|
|
11
|
-
|
|
11
|
+
extendTx,
|
|
12
12
|
quoteResponse,
|
|
13
13
|
accountAddress,
|
|
14
14
|
slippage,
|
|
@@ -6,10 +6,7 @@ export const getSplitCoinForTx = async (account, amount, splits, coinType, inher
|
|
|
6
6
|
const { objectIds } = await getCoinOjectIdsByAmount(account, amount, coinType);
|
|
7
7
|
const coinObjectId = objectIds[0];
|
|
8
8
|
if (coinType === SUI_TYPE) {
|
|
9
|
-
const pureAmount =
|
|
10
|
-
for (const split of splits) {
|
|
11
|
-
pureAmount.push(tx.pure(split));
|
|
12
|
-
}
|
|
9
|
+
const pureAmount = splits.map((split) => tx.pure(split));
|
|
13
10
|
let coin;
|
|
14
11
|
if (inspecTransaction) {
|
|
15
12
|
if (objectIds.length > 1) {
|
|
@@ -25,12 +22,7 @@ export const getSplitCoinForTx = async (account, amount, splits, coinType, inher
|
|
|
25
22
|
if (objectIds.length > 1) {
|
|
26
23
|
tx.mergeCoins(tx.object(coinObjectId), objectIds.slice(1).map((item) => tx.object(item)));
|
|
27
24
|
}
|
|
28
|
-
//handle split coin
|
|
29
|
-
const pureAmount = [];
|
|
30
|
-
for (const split of splits) {
|
|
31
|
-
pureAmount.push(tx.pure(split));
|
|
32
|
-
}
|
|
33
25
|
// split correct amount to swap
|
|
34
|
-
const coinData = tx.splitCoins(tx.object(coinObjectId),
|
|
26
|
+
const coinData = tx.splitCoins(tx.object(coinObjectId), splits.map((split) => tx.pure(split)));
|
|
35
27
|
return { tx, coinData };
|
|
36
28
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
2
2
|
import { BuildTxParams } from "./types/tx";
|
|
3
|
-
export declare const buildTx: ({ quoteResponse, accountAddress, slippage,
|
|
3
|
+
export declare const buildTx: ({ quoteResponse, accountAddress, slippage, commission: _commission, isGasEstimate, extendTx, }: BuildTxParams) => Promise<TransactionBlock>;
|
|
4
4
|
//# sourceMappingURL=buildTx.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../src/buildTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,
|
|
1
|
+
{"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../src/buildTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAGjB,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI3C,eAAO,MAAM,OAAO,mGAOjB,aAAa,8BAiFf,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EstimateGasFeeParams } from "./types/tx";
|
|
2
|
-
export declare function estimateGasFee({ quoteResponse, accountAddress, slippage, suiPrice: _suiPrice,
|
|
2
|
+
export declare function estimateGasFee({ quoteResponse, accountAddress, slippage, suiPrice: _suiPrice, extendTx, commission, }: EstimateGasFeeParams): Promise<number>;
|
|
3
3
|
//# sourceMappingURL=estimateGasFee.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"estimateGasFee.d.ts","sourceRoot":"","sources":["../../../src/estimateGasFee.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAIlD,wBAAsB,cAAc,CAAC,EACnC,aAAa,EACb,cAAc,EACd,QAAQ,EACR,QAAQ,EAAE,SAAS,EACnB,
|
|
1
|
+
{"version":3,"file":"estimateGasFee.d.ts","sourceRoot":"","sources":["../../../src/estimateGasFee.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAIlD,wBAAsB,cAAc,CAAC,EACnC,aAAa,EACb,cAAc,EACd,QAAQ,EACR,QAAQ,EAAE,SAAS,EACnB,QAAQ,EACR,UAAU,GACX,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqCxC"}
|
package/lib/esm/types/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare const _default: {
|
|
|
11
11
|
getQuote: typeof getQuote;
|
|
12
12
|
getSuiPrice: typeof getSuiPrice;
|
|
13
13
|
estimateGasFee: typeof estimateGasFee;
|
|
14
|
-
buildTx: ({ quoteResponse, accountAddress, slippage,
|
|
14
|
+
buildTx: ({ quoteResponse, accountAddress, slippage, commission: _commission, isGasEstimate, extendTx, }: import("./types/tx").BuildTxParams) => Promise<import("@mysten/sui.js/dist/cjs/transactions").TransactionBlock>;
|
|
15
15
|
};
|
|
16
16
|
export default _default;
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitCoinForTx.d.ts","sourceRoot":"","sources":["../../../../src/libs/getSplitCoinForTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAIrC,eAAO,MAAM,iBAAiB,YACnB,MAAM,UACP,MAAM,UACN,MAAM,EAAE,YACN,MAAM,cACJ,gBAAgB,sBACR,OAAO,KAC1B,OAAO,CAAC;IACT,EAAE,EAAE,gBAAgB,CAAC;IACrB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,
|
|
1
|
+
{"version":3,"file":"getSplitCoinForTx.d.ts","sourceRoot":"","sources":["../../../../src/libs/getSplitCoinForTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAIrC,eAAO,MAAM,iBAAiB,YACnB,MAAM,UACP,MAAM,UACN,MAAM,EAAE,YACN,MAAM,cACJ,gBAAgB,sBACR,OAAO,KAC1B,OAAO,CAAC;IACT,EAAE,EAAE,gBAAgB,CAAC;IACrB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,CAsCA,CAAC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
1
|
+
import { TransactionBlock, TransactionObjectArgument } from "@mysten/sui.js/transactions";
|
|
2
2
|
import { Commission, QuoteResponse } from "./aggregator";
|
|
3
3
|
import BigNumber from "bignumber.js";
|
|
4
4
|
export interface CommonParams {
|
|
5
|
-
tx?: TransactionBlock;
|
|
6
5
|
quoteResponse: QuoteResponse;
|
|
7
6
|
accountAddress: string;
|
|
8
7
|
slippage: BigNumber.Value;
|
|
9
8
|
commission: Commission;
|
|
9
|
+
extendTx?: {
|
|
10
|
+
tx: TransactionBlock;
|
|
11
|
+
coinIn?: TransactionObjectArgument;
|
|
12
|
+
};
|
|
10
13
|
}
|
|
11
14
|
export interface BuildTxParams extends CommonParams {
|
|
12
15
|
isGasEstimate?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../../../src/types/tx.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../../../src/types/tx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC;IAC1B,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,CAAC,EAAE;QACT,EAAE,EAAE,gBAAgB,CAAC;QACrB,MAAM,CAAC,EAAE,yBAAyB,CAAC;KACpC,CAAC;CACH;AAED,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|