@7kprotocol/sdk-ts 2.4.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/features/swap/buildTx.js +2 -2
- package/lib/cjs/libs/getSplitCoinForTx.js +2 -2
- package/lib/cjs/types/features/swap/buildTx.d.ts +1 -1
- package/lib/cjs/types/features/swap/buildTx.d.ts.map +1 -1
- package/lib/cjs/types/index.d.ts +1 -1
- package/lib/cjs/types/libs/getSplitCoinForTx.d.ts +1 -1
- package/lib/cjs/types/libs/getSplitCoinForTx.d.ts.map +1 -1
- package/lib/cjs/types/types/tx.d.ts +35 -0
- package/lib/cjs/types/types/tx.d.ts.map +1 -1
- package/lib/esm/features/swap/buildTx.js +2 -2
- package/lib/esm/libs/getSplitCoinForTx.js +2 -2
- package/lib/esm/types/features/swap/buildTx.d.ts +1 -1
- package/lib/esm/types/features/swap/buildTx.d.ts.map +1 -1
- package/lib/esm/types/index.d.ts +1 -1
- package/lib/esm/types/libs/getSplitCoinForTx.d.ts +1 -1
- package/lib/esm/types/libs/getSplitCoinForTx.d.ts.map +1 -1
- package/lib/esm/types/types/tx.d.ts +35 -0
- package/lib/esm/types/types/tx.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ const sui_1 = require("../../utils/sui");
|
|
|
23
23
|
const _7k_1 = require("../../constants/_7k");
|
|
24
24
|
const utils_1 = require("@mysten/sui/utils");
|
|
25
25
|
const config_1 = require("./config");
|
|
26
|
-
const buildTx = (_a) => __awaiter(void 0, [_a], void 0, function* ({ quoteResponse, accountAddress, slippage, commission: _commission, devInspect, extendTx, }) {
|
|
26
|
+
const buildTx = (_a) => __awaiter(void 0, [_a], void 0, function* ({ quoteResponse, accountAddress, slippage, commission: _commission, devInspect, extendTx, isSponsored }) {
|
|
27
27
|
const { tx: _tx, coinIn } = extendTx || {};
|
|
28
28
|
let coinOut;
|
|
29
29
|
if (!accountAddress) {
|
|
@@ -44,7 +44,7 @@ const buildTx = (_a) => __awaiter(void 0, [_a], void 0, function* ({ quoteRespon
|
|
|
44
44
|
sui_1.SuiUtils.transferOrDestroyZeroCoin(tx, quoteResponse.tokenIn, coinIn, accountAddress);
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
47
|
-
const { coinData: _data } = yield (0, getSplitCoinForTx_1.getSplitCoinForTx)(accountAddress, quoteResponse.swapAmountWithDecimal, splits, (0, token_1.denormalizeTokenType)(quoteResponse.tokenIn), tx, devInspect);
|
|
47
|
+
const { coinData: _data } = yield (0, getSplitCoinForTx_1.getSplitCoinForTx)(accountAddress, quoteResponse.swapAmountWithDecimal, splits, (0, token_1.denormalizeTokenType)(quoteResponse.tokenIn), tx, devInspect, isSponsored);
|
|
48
48
|
coinData = _data;
|
|
49
49
|
}
|
|
50
50
|
const coinObjects = [];
|
|
@@ -13,11 +13,11 @@ exports.getSplitCoinForTx = void 0;
|
|
|
13
13
|
const transactions_1 = require("@mysten/sui/transactions");
|
|
14
14
|
const getCoinOjectIdsByAmount_1 = require("./getCoinOjectIdsByAmount");
|
|
15
15
|
const tokens_1 = require("../constants/tokens");
|
|
16
|
-
const getSplitCoinForTx = (
|
|
16
|
+
const getSplitCoinForTx = (account_1, amount_1, splits_1, coinType_1, inheritTx_1, inspecTransaction_1, ...args_1) => __awaiter(void 0, [account_1, amount_1, splits_1, coinType_1, inheritTx_1, inspecTransaction_1, ...args_1], void 0, function* (account, amount, splits, coinType, inheritTx, inspecTransaction, isSponsored = false) {
|
|
17
17
|
const tx = inheritTx !== null && inheritTx !== void 0 ? inheritTx : new transactions_1.Transaction();
|
|
18
18
|
const { objectIds } = yield (0, getCoinOjectIdsByAmount_1.getCoinOjectIdsByAmount)(account, amount, coinType);
|
|
19
19
|
const coinObjectId = objectIds[0];
|
|
20
|
-
if (coinType === tokens_1.SUI_TYPE) {
|
|
20
|
+
if (coinType === tokens_1.SUI_TYPE && !isSponsored) {
|
|
21
21
|
let coin;
|
|
22
22
|
if (inspecTransaction) {
|
|
23
23
|
if (objectIds.length > 1) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
2
2
|
import { BuildTxParams } from "../../types/tx";
|
|
3
|
-
export declare const buildTx: ({ quoteResponse, accountAddress, slippage, commission: _commission, devInspect, extendTx, }: BuildTxParams) => Promise<{
|
|
3
|
+
export declare const buildTx: ({ quoteResponse, accountAddress, slippage, commission: _commission, devInspect, extendTx, isSponsored }: BuildTxParams) => Promise<{
|
|
4
4
|
tx: Transaction;
|
|
5
5
|
coinOut: TransactionObjectArgument | undefined;
|
|
6
6
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/buildTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAE1B,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/buildTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAE1B,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C,eAAO,MAAM,OAAO,4GAQjB,aAAa;;;EAoGf,CAAC"}
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare const _default: {
|
|
|
20
20
|
getSuiPrice: typeof getSuiPrice;
|
|
21
21
|
getQuote: typeof getQuote;
|
|
22
22
|
estimateGasFee: typeof estimateGasFee;
|
|
23
|
-
buildTx: ({ quoteResponse, accountAddress, slippage, commission: _commission, devInspect, extendTx, }: import("./types/tx").BuildTxParams) => Promise<{
|
|
23
|
+
buildTx: ({ quoteResponse, accountAddress, slippage, commission: _commission, devInspect, extendTx, isSponsored }: import("./types/tx").BuildTxParams) => Promise<{
|
|
24
24
|
tx: import("@mysten/sui/dist/cjs/transactions").Transaction;
|
|
25
25
|
coinOut: import("@mysten/sui/dist/cjs/transactions").TransactionObjectArgument | undefined;
|
|
26
26
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Transaction, TransactionResult } from "@mysten/sui/transactions";
|
|
2
|
-
export declare const getSplitCoinForTx: (account: string, amount: string, splits: string[], coinType: string, inheritTx?: Transaction, inspecTransaction?: boolean) => Promise<{
|
|
2
|
+
export declare const getSplitCoinForTx: (account: string, amount: string, splits: string[], coinType: string, inheritTx?: Transaction, inspecTransaction?: boolean, isSponsored?: boolean) => Promise<{
|
|
3
3
|
tx: Transaction;
|
|
4
4
|
coinData: TransactionResult;
|
|
5
5
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitCoinForTx.d.ts","sourceRoot":"","sources":["../../../../src/libs/getSplitCoinForTx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAI1E,eAAO,MAAM,iBAAiB,YACnB,MAAM,UACP,MAAM,UACN,MAAM,EAAE,YACN,MAAM,cACJ,WAAW,sBACH,OAAO,
|
|
1
|
+
{"version":3,"file":"getSplitCoinForTx.d.ts","sourceRoot":"","sources":["../../../../src/libs/getSplitCoinForTx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAI1E,eAAO,MAAM,iBAAiB,YACnB,MAAM,UACP,MAAM,UACN,MAAM,EAAE,YACN,MAAM,cACJ,WAAW,sBACH,OAAO,4BAE1B,OAAO,CAAC;IACT,EAAE,EAAE,WAAW,CAAC;IAChB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,CAkCA,CAAC"}
|
|
@@ -2,19 +2,54 @@ import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions
|
|
|
2
2
|
import { Commission, QuoteResponse } from "./aggregator";
|
|
3
3
|
import BigNumber from "bignumber.js";
|
|
4
4
|
export interface CommonParams {
|
|
5
|
+
/** Quote response from 7k api */
|
|
5
6
|
quoteResponse: QuoteResponse;
|
|
7
|
+
/** User address */
|
|
6
8
|
accountAddress: string;
|
|
9
|
+
/** Slippage tolerance, ex: 0.01 (1%) */
|
|
7
10
|
slippage: BigNumber.Value;
|
|
11
|
+
/** Commission for partner */
|
|
8
12
|
commission: Commission;
|
|
13
|
+
/**
|
|
14
|
+
* Give Flexibility to insert custom commands before or after swap
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const rawTx = new Transaction();
|
|
18
|
+
* // Add custom commands to rawTx
|
|
19
|
+
* rawTx.moveCall({
|
|
20
|
+
* target: "0x2222222::example::claim",
|
|
21
|
+
* arguments: [],
|
|
22
|
+
* });
|
|
23
|
+
* const { tx, coinOut } = await buildTx({
|
|
24
|
+
* quoteResponse,
|
|
25
|
+
* accountAddress,
|
|
26
|
+
* slippage,
|
|
27
|
+
* commission,
|
|
28
|
+
* extendTx: {
|
|
29
|
+
* tx: rawTx,
|
|
30
|
+
* coinIn: rawTx.object(coinObjectId),
|
|
31
|
+
* },
|
|
32
|
+
* });
|
|
33
|
+
* // add more commands after the swap if needed, and remember to consume the coinOut object
|
|
34
|
+
* tx.transferObjects([coinOut], tx.pure.address(accountAddress));
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
9
37
|
extendTx?: {
|
|
10
38
|
tx: Transaction;
|
|
11
39
|
coinIn?: TransactionObjectArgument;
|
|
12
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* If true, indicates that the transaction is sponsored and its gas object should not be modified.
|
|
43
|
+
* In this case, the gas object is expected to be already set up correctly for the sponsored transaction.
|
|
44
|
+
*/
|
|
45
|
+
isSponsored?: boolean;
|
|
13
46
|
}
|
|
14
47
|
export interface BuildTxParams extends CommonParams {
|
|
48
|
+
/** Developer inspection mode */
|
|
15
49
|
devInspect?: boolean;
|
|
16
50
|
}
|
|
17
51
|
export interface EstimateGasFeeParams extends CommonParams {
|
|
52
|
+
/** Sui price in usd for gas estimation */
|
|
18
53
|
suiPrice?: number;
|
|
19
54
|
}
|
|
20
55
|
//# sourceMappingURL=tx.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../../../src/types/tx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,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,WAAW,CAAC;QAChB,MAAM,CAAC,EAAE,yBAAyB,CAAC;KACpC,CAAC;
|
|
1
|
+
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../../../src/types/tx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,mBAAmB;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC;IAC1B,6BAA6B;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,QAAQ,CAAC,EAAE;QACT,EAAE,EAAE,WAAW,CAAC;QAChB,MAAM,CAAC,EAAE,yBAAyB,CAAC;KACpC,CAAC;IACF;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,gCAAgC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -8,7 +8,7 @@ import { SuiUtils } from "../../utils/sui";
|
|
|
8
8
|
import { _7K_CONFIG, _7K_PACKAGE_ID, _7K_VAULT } from "../../constants/_7k";
|
|
9
9
|
import { isValidSuiAddress } from "@mysten/sui/utils";
|
|
10
10
|
import { getConfig } from "./config";
|
|
11
|
-
export const buildTx = async ({ quoteResponse, accountAddress, slippage, commission: _commission, devInspect, extendTx, }) => {
|
|
11
|
+
export const buildTx = async ({ quoteResponse, accountAddress, slippage, commission: _commission, devInspect, extendTx, isSponsored }) => {
|
|
12
12
|
const { tx: _tx, coinIn } = extendTx || {};
|
|
13
13
|
let coinOut;
|
|
14
14
|
if (!accountAddress) {
|
|
@@ -29,7 +29,7 @@ export const buildTx = async ({ quoteResponse, accountAddress, slippage, commiss
|
|
|
29
29
|
SuiUtils.transferOrDestroyZeroCoin(tx, quoteResponse.tokenIn, coinIn, accountAddress);
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
const { coinData: _data } = await getSplitCoinForTx(accountAddress, quoteResponse.swapAmountWithDecimal, splits, denormalizeTokenType(quoteResponse.tokenIn), tx, devInspect);
|
|
32
|
+
const { coinData: _data } = await getSplitCoinForTx(accountAddress, quoteResponse.swapAmountWithDecimal, splits, denormalizeTokenType(quoteResponse.tokenIn), tx, devInspect, isSponsored);
|
|
33
33
|
coinData = _data;
|
|
34
34
|
}
|
|
35
35
|
const coinObjects = [];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Transaction } from "@mysten/sui/transactions";
|
|
2
2
|
import { getCoinOjectIdsByAmount } from "./getCoinOjectIdsByAmount";
|
|
3
3
|
import { SUI_TYPE } from "../constants/tokens";
|
|
4
|
-
export const getSplitCoinForTx = async (account, amount, splits, coinType, inheritTx, inspecTransaction) => {
|
|
4
|
+
export const getSplitCoinForTx = async (account, amount, splits, coinType, inheritTx, inspecTransaction, isSponsored = false) => {
|
|
5
5
|
const tx = inheritTx ?? new Transaction();
|
|
6
6
|
const { objectIds } = await getCoinOjectIdsByAmount(account, amount, coinType);
|
|
7
7
|
const coinObjectId = objectIds[0];
|
|
8
|
-
if (coinType === SUI_TYPE) {
|
|
8
|
+
if (coinType === SUI_TYPE && !isSponsored) {
|
|
9
9
|
let coin;
|
|
10
10
|
if (inspecTransaction) {
|
|
11
11
|
if (objectIds.length > 1) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
2
2
|
import { BuildTxParams } from "../../types/tx";
|
|
3
|
-
export declare const buildTx: ({ quoteResponse, accountAddress, slippage, commission: _commission, devInspect, extendTx, }: BuildTxParams) => Promise<{
|
|
3
|
+
export declare const buildTx: ({ quoteResponse, accountAddress, slippage, commission: _commission, devInspect, extendTx, isSponsored }: BuildTxParams) => Promise<{
|
|
4
4
|
tx: Transaction;
|
|
5
5
|
coinOut: TransactionObjectArgument | undefined;
|
|
6
6
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/buildTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAE1B,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/buildTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAE1B,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C,eAAO,MAAM,OAAO,4GAQjB,aAAa;;;EAoGf,CAAC"}
|
package/lib/esm/types/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare const _default: {
|
|
|
20
20
|
getSuiPrice: typeof getSuiPrice;
|
|
21
21
|
getQuote: typeof getQuote;
|
|
22
22
|
estimateGasFee: typeof estimateGasFee;
|
|
23
|
-
buildTx: ({ quoteResponse, accountAddress, slippage, commission: _commission, devInspect, extendTx, }: import("./types/tx").BuildTxParams) => Promise<{
|
|
23
|
+
buildTx: ({ quoteResponse, accountAddress, slippage, commission: _commission, devInspect, extendTx, isSponsored }: import("./types/tx").BuildTxParams) => Promise<{
|
|
24
24
|
tx: import("@mysten/sui/dist/cjs/transactions").Transaction;
|
|
25
25
|
coinOut: import("@mysten/sui/dist/cjs/transactions").TransactionObjectArgument | undefined;
|
|
26
26
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Transaction, TransactionResult } from "@mysten/sui/transactions";
|
|
2
|
-
export declare const getSplitCoinForTx: (account: string, amount: string, splits: string[], coinType: string, inheritTx?: Transaction, inspecTransaction?: boolean) => Promise<{
|
|
2
|
+
export declare const getSplitCoinForTx: (account: string, amount: string, splits: string[], coinType: string, inheritTx?: Transaction, inspecTransaction?: boolean, isSponsored?: boolean) => Promise<{
|
|
3
3
|
tx: Transaction;
|
|
4
4
|
coinData: TransactionResult;
|
|
5
5
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitCoinForTx.d.ts","sourceRoot":"","sources":["../../../../src/libs/getSplitCoinForTx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAI1E,eAAO,MAAM,iBAAiB,YACnB,MAAM,UACP,MAAM,UACN,MAAM,EAAE,YACN,MAAM,cACJ,WAAW,sBACH,OAAO,
|
|
1
|
+
{"version":3,"file":"getSplitCoinForTx.d.ts","sourceRoot":"","sources":["../../../../src/libs/getSplitCoinForTx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAI1E,eAAO,MAAM,iBAAiB,YACnB,MAAM,UACP,MAAM,UACN,MAAM,EAAE,YACN,MAAM,cACJ,WAAW,sBACH,OAAO,4BAE1B,OAAO,CAAC;IACT,EAAE,EAAE,WAAW,CAAC;IAChB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,CAkCA,CAAC"}
|
|
@@ -2,19 +2,54 @@ import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions
|
|
|
2
2
|
import { Commission, QuoteResponse } from "./aggregator";
|
|
3
3
|
import BigNumber from "bignumber.js";
|
|
4
4
|
export interface CommonParams {
|
|
5
|
+
/** Quote response from 7k api */
|
|
5
6
|
quoteResponse: QuoteResponse;
|
|
7
|
+
/** User address */
|
|
6
8
|
accountAddress: string;
|
|
9
|
+
/** Slippage tolerance, ex: 0.01 (1%) */
|
|
7
10
|
slippage: BigNumber.Value;
|
|
11
|
+
/** Commission for partner */
|
|
8
12
|
commission: Commission;
|
|
13
|
+
/**
|
|
14
|
+
* Give Flexibility to insert custom commands before or after swap
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const rawTx = new Transaction();
|
|
18
|
+
* // Add custom commands to rawTx
|
|
19
|
+
* rawTx.moveCall({
|
|
20
|
+
* target: "0x2222222::example::claim",
|
|
21
|
+
* arguments: [],
|
|
22
|
+
* });
|
|
23
|
+
* const { tx, coinOut } = await buildTx({
|
|
24
|
+
* quoteResponse,
|
|
25
|
+
* accountAddress,
|
|
26
|
+
* slippage,
|
|
27
|
+
* commission,
|
|
28
|
+
* extendTx: {
|
|
29
|
+
* tx: rawTx,
|
|
30
|
+
* coinIn: rawTx.object(coinObjectId),
|
|
31
|
+
* },
|
|
32
|
+
* });
|
|
33
|
+
* // add more commands after the swap if needed, and remember to consume the coinOut object
|
|
34
|
+
* tx.transferObjects([coinOut], tx.pure.address(accountAddress));
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
9
37
|
extendTx?: {
|
|
10
38
|
tx: Transaction;
|
|
11
39
|
coinIn?: TransactionObjectArgument;
|
|
12
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* If true, indicates that the transaction is sponsored and its gas object should not be modified.
|
|
43
|
+
* In this case, the gas object is expected to be already set up correctly for the sponsored transaction.
|
|
44
|
+
*/
|
|
45
|
+
isSponsored?: boolean;
|
|
13
46
|
}
|
|
14
47
|
export interface BuildTxParams extends CommonParams {
|
|
48
|
+
/** Developer inspection mode */
|
|
15
49
|
devInspect?: boolean;
|
|
16
50
|
}
|
|
17
51
|
export interface EstimateGasFeeParams extends CommonParams {
|
|
52
|
+
/** Sui price in usd for gas estimation */
|
|
18
53
|
suiPrice?: number;
|
|
19
54
|
}
|
|
20
55
|
//# sourceMappingURL=tx.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../../../src/types/tx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,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,WAAW,CAAC;QAChB,MAAM,CAAC,EAAE,yBAAyB,CAAC;KACpC,CAAC;
|
|
1
|
+
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../../../src/types/tx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,mBAAmB;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC;IAC1B,6BAA6B;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,QAAQ,CAAC,EAAE;QACT,EAAE,EAAE,WAAW,CAAC;QAChB,MAAM,CAAC,EAAE,yBAAyB,CAAC;KACpC,CAAC;IACF;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,gCAAgC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|