@7kprotocol/sdk-ts 1.2.3 → 1.2.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/constants/_7k.js +1 -3
- package/lib/cjs/libs/getSplitCoinForTx.js +1 -7
- package/lib/cjs/types/constants/_7k.d.ts +0 -2
- package/lib/cjs/types/constants/_7k.d.ts.map +1 -1
- package/lib/cjs/types/libs/getSplitCoinForTx.d.ts.map +1 -1
- package/lib/esm/constants/_7k.js +0 -2
- package/lib/esm/libs/getSplitCoinForTx.js +1 -4
- package/lib/esm/types/constants/_7k.d.ts +0 -2
- package/lib/esm/types/constants/_7k.d.ts.map +1 -1
- package/lib/esm/types/libs/getSplitCoinForTx.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/cjs/constants/_7k.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports._7K_CONFIG = exports._7K_PACKAGE_ID = void 0;
|
|
4
4
|
exports._7K_PACKAGE_ID = "0xa13447019cd982d6bef91cf7b46ad384a52583b1dfc2bdecf31ef0c4bd787a0f";
|
|
5
5
|
//V1: "0xd48e7cdc9e92bec69ce3baa75578010458a0c5b2733d661a84971e8cef6806bc";
|
|
6
6
|
exports._7K_CONFIG = "0xc31272d90e0c36181b0153776c9d7c1516d4c1eca50fc2eb01f36d3f457ea90d";
|
|
7
|
-
exports._7K_COMMISSION_PARTNER = "0x8bd5bf35fee1343cbb6c11b55f5ae234f96cf630778b53ecbae68b4a33423dbb";
|
|
8
|
-
exports._7K_COMMISSION_BPS = "0";
|
|
@@ -8,22 +8,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.getSplitCoinForTx = void 0;
|
|
16
13
|
const transactions_1 = require("@mysten/sui.js/transactions");
|
|
17
14
|
const getCoinOjectIdsByAmount_1 = require("./getCoinOjectIdsByAmount");
|
|
18
|
-
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
19
15
|
const tokens_1 = require("../constants/tokens");
|
|
20
16
|
const getSplitCoinForTx = (account, amount, splits, coinType, inheritTx, inspecTransaction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
17
|
const tx = inheritTx !== null && inheritTx !== void 0 ? inheritTx : new transactions_1.TransactionBlock();
|
|
22
18
|
const { objectIds } = yield (0, getCoinOjectIdsByAmount_1.getCoinOjectIdsByAmount)(account, amount, coinType);
|
|
23
19
|
const coinObjectId = objectIds[0];
|
|
24
|
-
|
|
25
|
-
if (coinType === tokens_1.SUI_TYPE &&
|
|
26
|
-
new bignumber_js_1.default(amount).lt(new bignumber_js_1.default("950e9"))) {
|
|
20
|
+
if (coinType === tokens_1.SUI_TYPE) {
|
|
27
21
|
const pureAmount = [];
|
|
28
22
|
for (const split of splits) {
|
|
29
23
|
pureAmount.push(tx.pure(split));
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
export declare const _7K_PACKAGE_ID = "0xa13447019cd982d6bef91cf7b46ad384a52583b1dfc2bdecf31ef0c4bd787a0f";
|
|
2
2
|
export declare const _7K_CONFIG = "0xc31272d90e0c36181b0153776c9d7c1516d4c1eca50fc2eb01f36d3f457ea90d";
|
|
3
|
-
export declare const _7K_COMMISSION_PARTNER = "0x8bd5bf35fee1343cbb6c11b55f5ae234f96cf630778b53ecbae68b4a33423dbb";
|
|
4
|
-
export declare const _7K_COMMISSION_BPS = "0";
|
|
5
3
|
//# sourceMappingURL=_7k.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_7k.d.ts","sourceRoot":"","sources":["../../../../src/constants/_7k.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,uEAC2C,CAAC;AAEvE,eAAO,MAAM,UAAU,uEAC+C,CAAC
|
|
1
|
+
{"version":3,"file":"_7k.d.ts","sourceRoot":"","sources":["../../../../src/constants/_7k.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,uEAC2C,CAAC;AAEvE,eAAO,MAAM,UAAU,uEAC+C,CAAC"}
|
|
@@ -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;AAKrC,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;AAKrC,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,CA4CA,CAAC"}
|
package/lib/esm/constants/_7k.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
export const _7K_PACKAGE_ID = "0xa13447019cd982d6bef91cf7b46ad384a52583b1dfc2bdecf31ef0c4bd787a0f";
|
|
2
2
|
//V1: "0xd48e7cdc9e92bec69ce3baa75578010458a0c5b2733d661a84971e8cef6806bc";
|
|
3
3
|
export const _7K_CONFIG = "0xc31272d90e0c36181b0153776c9d7c1516d4c1eca50fc2eb01f36d3f457ea90d";
|
|
4
|
-
export const _7K_COMMISSION_PARTNER = "0x8bd5bf35fee1343cbb6c11b55f5ae234f96cf630778b53ecbae68b4a33423dbb";
|
|
5
|
-
export const _7K_COMMISSION_BPS = "0";
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { TransactionBlock, } from "@mysten/sui.js/transactions";
|
|
2
2
|
import { getCoinOjectIdsByAmount } from "./getCoinOjectIdsByAmount";
|
|
3
|
-
import BigNumber from "bignumber.js";
|
|
4
3
|
import { SUI_TYPE } from "../constants/tokens";
|
|
5
4
|
export const getSplitCoinForTx = async (account, amount, splits, coinType, inheritTx, inspecTransaction) => {
|
|
6
5
|
const tx = inheritTx ?? new TransactionBlock();
|
|
7
6
|
const { objectIds } = await getCoinOjectIdsByAmount(account, amount, coinType);
|
|
8
7
|
const coinObjectId = objectIds[0];
|
|
9
|
-
|
|
10
|
-
if (coinType === SUI_TYPE &&
|
|
11
|
-
new BigNumber(amount).lt(new BigNumber("950e9"))) {
|
|
8
|
+
if (coinType === SUI_TYPE) {
|
|
12
9
|
const pureAmount = [];
|
|
13
10
|
for (const split of splits) {
|
|
14
11
|
pureAmount.push(tx.pure(split));
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
export declare const _7K_PACKAGE_ID = "0xa13447019cd982d6bef91cf7b46ad384a52583b1dfc2bdecf31ef0c4bd787a0f";
|
|
2
2
|
export declare const _7K_CONFIG = "0xc31272d90e0c36181b0153776c9d7c1516d4c1eca50fc2eb01f36d3f457ea90d";
|
|
3
|
-
export declare const _7K_COMMISSION_PARTNER = "0x8bd5bf35fee1343cbb6c11b55f5ae234f96cf630778b53ecbae68b4a33423dbb";
|
|
4
|
-
export declare const _7K_COMMISSION_BPS = "0";
|
|
5
3
|
//# sourceMappingURL=_7k.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_7k.d.ts","sourceRoot":"","sources":["../../../../src/constants/_7k.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,uEAC2C,CAAC;AAEvE,eAAO,MAAM,UAAU,uEAC+C,CAAC
|
|
1
|
+
{"version":3,"file":"_7k.d.ts","sourceRoot":"","sources":["../../../../src/constants/_7k.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,uEAC2C,CAAC;AAEvE,eAAO,MAAM,UAAU,uEAC+C,CAAC"}
|
|
@@ -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;AAKrC,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;AAKrC,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,CA4CA,CAAC"}
|