@7kprotocol/sdk-ts 2.3.6 → 2.4.0
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 +31 -3
- package/lib/cjs/config/fetchClient.js +24 -0
- package/lib/cjs/{suiClient.js → config/index.js} +15 -2
- package/lib/cjs/constants/apiEndpoints.js +9 -0
- package/lib/cjs/features/limitDca/constants.js +2 -1
- package/lib/cjs/features/limitDca/getClosedDcaOrders.js +2 -1
- package/lib/cjs/features/limitDca/getClosedLimitOrders.js +2 -1
- package/lib/cjs/features/limitDca/getDcaOrderExecutions.js +2 -1
- package/lib/cjs/features/limitDca/getOpenDcaOrders.js +2 -1
- package/lib/cjs/features/limitDca/getOpenLimitOrders.js +2 -1
- package/lib/cjs/features/prices/index.js +4 -4
- package/lib/cjs/features/swap/config.js +3 -1
- package/lib/cjs/features/swap/estimateGasFee.js +2 -2
- package/lib/cjs/features/swap/getQuote.js +3 -1
- package/lib/cjs/features/swap/getSwapHistory.js +3 -1
- package/lib/cjs/index.js +12 -6
- package/lib/cjs/libs/getCoinOjectIdsByAmount.js +2 -2
- package/lib/cjs/types/config/fetchClient.d.ts +2 -0
- package/lib/cjs/types/config/fetchClient.d.ts.map +1 -0
- package/lib/cjs/types/config/index.d.ts +13 -0
- package/lib/cjs/types/config/index.d.ts.map +1 -0
- package/lib/cjs/types/constants/apiEndpoints.d.ts +7 -0
- package/lib/cjs/types/constants/apiEndpoints.d.ts.map +1 -0
- package/lib/cjs/types/features/limitDca/constants.d.ts +1 -1
- package/lib/cjs/types/features/limitDca/constants.d.ts.map +1 -1
- package/lib/cjs/types/features/limitDca/getClosedDcaOrders.d.ts.map +1 -1
- package/lib/cjs/types/features/limitDca/getClosedLimitOrders.d.ts.map +1 -1
- package/lib/cjs/types/features/limitDca/getDcaOrderExecutions.d.ts.map +1 -1
- package/lib/cjs/types/features/limitDca/getOpenDcaOrders.d.ts.map +1 -1
- package/lib/cjs/types/features/limitDca/getOpenLimitOrders.d.ts.map +1 -1
- package/lib/cjs/types/features/prices/index.d.ts +0 -1
- package/lib/cjs/types/features/prices/index.d.ts.map +1 -1
- package/lib/cjs/types/features/swap/config.d.ts.map +1 -1
- package/lib/cjs/types/features/swap/getQuote.d.ts.map +1 -1
- package/lib/cjs/types/features/swap/getSwapHistory.d.ts.map +1 -1
- package/lib/cjs/types/index.d.ts +12 -4
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/utils/token.d.ts +0 -2
- package/lib/cjs/types/utils/token.d.ts.map +1 -1
- package/lib/cjs/utils/sui.js +3 -3
- package/lib/cjs/utils/token.js +0 -21
- package/lib/esm/config/fetchClient.js +13 -0
- package/lib/esm/config/index.js +24 -0
- package/lib/esm/constants/apiEndpoints.js +6 -0
- package/lib/esm/features/limitDca/constants.js +2 -1
- package/lib/esm/features/limitDca/getClosedDcaOrders.js +2 -1
- package/lib/esm/features/limitDca/getClosedLimitOrders.js +2 -1
- package/lib/esm/features/limitDca/getDcaOrderExecutions.js +2 -1
- package/lib/esm/features/limitDca/getOpenDcaOrders.js +2 -1
- package/lib/esm/features/limitDca/getOpenLimitOrders.js +2 -1
- package/lib/esm/features/prices/index.js +4 -3
- package/lib/esm/features/swap/config.js +3 -1
- package/lib/esm/features/swap/estimateGasFee.js +2 -2
- package/lib/esm/features/swap/getQuote.js +3 -1
- package/lib/esm/features/swap/getSwapHistory.js +3 -1
- package/lib/esm/index.mjs +8 -1
- package/lib/esm/libs/getCoinOjectIdsByAmount.js +2 -2
- package/lib/esm/types/config/fetchClient.d.ts +2 -0
- package/lib/esm/types/config/fetchClient.d.ts.map +1 -0
- package/lib/esm/types/config/index.d.ts +13 -0
- package/lib/esm/types/config/index.d.ts.map +1 -0
- package/lib/esm/types/constants/apiEndpoints.d.ts +7 -0
- package/lib/esm/types/constants/apiEndpoints.d.ts.map +1 -0
- package/lib/esm/types/features/limitDca/constants.d.ts +1 -1
- package/lib/esm/types/features/limitDca/constants.d.ts.map +1 -1
- package/lib/esm/types/features/limitDca/getClosedDcaOrders.d.ts.map +1 -1
- package/lib/esm/types/features/limitDca/getClosedLimitOrders.d.ts.map +1 -1
- package/lib/esm/types/features/limitDca/getDcaOrderExecutions.d.ts.map +1 -1
- package/lib/esm/types/features/limitDca/getOpenDcaOrders.d.ts.map +1 -1
- package/lib/esm/types/features/limitDca/getOpenLimitOrders.d.ts.map +1 -1
- package/lib/esm/types/features/prices/index.d.ts +0 -1
- package/lib/esm/types/features/prices/index.d.ts.map +1 -1
- package/lib/esm/types/features/swap/config.d.ts.map +1 -1
- package/lib/esm/types/features/swap/getQuote.d.ts.map +1 -1
- package/lib/esm/types/features/swap/getSwapHistory.d.ts.map +1 -1
- package/lib/esm/types/index.d.ts +12 -4
- package/lib/esm/types/index.d.ts.map +1 -1
- package/lib/esm/types/utils/token.d.ts +0 -2
- package/lib/esm/types/utils/token.d.ts.map +1 -1
- package/lib/esm/utils/sui.js +3 -3
- package/lib/esm/utils/token.js +0 -9
- package/package.json +1 -1
- package/lib/cjs/constants/explorer.js +0 -6
- package/lib/cjs/types/constants/explorer.d.ts +0 -4
- package/lib/cjs/types/constants/explorer.d.ts.map +0 -1
- package/lib/cjs/types/suiClient.d.ts +0 -4
- package/lib/cjs/types/suiClient.d.ts.map +0 -1
- package/lib/cjs/types/token.js +0 -2
- package/lib/cjs/types/types/token.d.ts +0 -30
- package/lib/cjs/types/types/token.d.ts.map +0 -1
- package/lib/esm/constants/explorer.js +0 -3
- package/lib/esm/suiClient.js +0 -10
- package/lib/esm/types/constants/explorer.d.ts +0 -4
- package/lib/esm/types/constants/explorer.d.ts.map +0 -1
- package/lib/esm/types/suiClient.d.ts +0 -4
- package/lib/esm/types/suiClient.d.ts.map +0 -1
- package/lib/esm/types/token.js +0 -1
- package/lib/esm/types/types/token.d.ts +0 -30
- package/lib/esm/types/types/token.d.ts.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Config } from "./index";
|
|
2
|
+
export async function fetchClient(input, init) {
|
|
3
|
+
const headers = new Headers(init?.headers);
|
|
4
|
+
const apiKey = (Config.getApiKey() || "").trim();
|
|
5
|
+
if (apiKey) {
|
|
6
|
+
headers.set("apiKey", apiKey);
|
|
7
|
+
}
|
|
8
|
+
const modifiedInit = {
|
|
9
|
+
...init,
|
|
10
|
+
headers,
|
|
11
|
+
};
|
|
12
|
+
return fetch(input, modifiedInit);
|
|
13
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SuiClient, getFullnodeUrl } from "@mysten/sui/client";
|
|
2
|
+
let apiKey = "";
|
|
3
|
+
let suiClient = new SuiClient({
|
|
4
|
+
url: getFullnodeUrl("mainnet"),
|
|
5
|
+
});
|
|
6
|
+
function setApiKey(key) {
|
|
7
|
+
apiKey = key;
|
|
8
|
+
}
|
|
9
|
+
function getApiKey() {
|
|
10
|
+
return apiKey;
|
|
11
|
+
}
|
|
12
|
+
function getSuiClient() {
|
|
13
|
+
return suiClient;
|
|
14
|
+
}
|
|
15
|
+
function setSuiClient(client) {
|
|
16
|
+
suiClient = client;
|
|
17
|
+
}
|
|
18
|
+
const Config = {
|
|
19
|
+
setApiKey,
|
|
20
|
+
getApiKey,
|
|
21
|
+
setSuiClient,
|
|
22
|
+
getSuiClient,
|
|
23
|
+
};
|
|
24
|
+
export { Config };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import BigNumber from "bignumber.js";
|
|
2
|
+
import { API_ENDPOINTS } from "../../constants/apiEndpoints";
|
|
2
3
|
export const GLOBAL_CONFIG_ID = "0xffc7f420b481ed7a012b42e125fd7e5716b5673759cf4629e5fcfebce970a72d";
|
|
3
4
|
export const RATE_SCALE = BigInt("1000000000000");
|
|
4
5
|
export const SLIPPAGE_SCALE = BigInt("10000");
|
|
@@ -7,4 +8,4 @@ export const LIMIT_ORDER_MODULE_ID = `${PACKAGE}::limit_order`;
|
|
|
7
8
|
export const DCA_ORDER_MODULE_ID = `${PACKAGE}::dca_order`;
|
|
8
9
|
export const CONFIG_MODULE_ID = `${PACKAGE}::config`;
|
|
9
10
|
export const DCA_MAX_RATE = new BigNumber("18446744073709551615");
|
|
10
|
-
export const LO_DCA_API =
|
|
11
|
+
export const LO_DCA_API = `${API_ENDPOINTS.LO_DCA}/api`;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fetchClient } from "../../config/fetchClient";
|
|
1
2
|
import { formatQueryParams } from "../../libs/url";
|
|
2
3
|
import { LO_DCA_API } from "./constants";
|
|
3
4
|
export async function getClosedDcaOrders({ owner, offset = 0, limit = 10, tokenPair, }) {
|
|
@@ -10,7 +11,7 @@ export async function getClosedDcaOrders({ owner, offset = 0, limit = 10, tokenP
|
|
|
10
11
|
tokenPair,
|
|
11
12
|
};
|
|
12
13
|
const paramsStr = formatQueryParams(queryParams);
|
|
13
|
-
const response = await
|
|
14
|
+
const response = await fetchClient(`${LO_DCA_API}/order-executions?${paramsStr}`);
|
|
14
15
|
if (!response.ok) {
|
|
15
16
|
throw new Error("Failed to fetch closed dca orders");
|
|
16
17
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fetchClient } from "../../config/fetchClient";
|
|
1
2
|
import { formatQueryParams } from "../../libs/url";
|
|
2
3
|
import { LO_DCA_API } from "./constants";
|
|
3
4
|
export async function getClosedLimitOrders({ owner, offset = 0, limit = 10, tokenPair, }) {
|
|
@@ -9,7 +10,7 @@ export async function getClosedLimitOrders({ owner, offset = 0, limit = 10, toke
|
|
|
9
10
|
tokenPair,
|
|
10
11
|
};
|
|
11
12
|
const paramsStr = formatQueryParams(queryParams);
|
|
12
|
-
const response = await
|
|
13
|
+
const response = await fetchClient(`${LO_DCA_API}/limit-orders?${paramsStr}`);
|
|
13
14
|
if (!response.ok) {
|
|
14
15
|
throw new Error("Failed to fetch closed limit orders");
|
|
15
16
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fetchClient } from "../../config/fetchClient";
|
|
1
2
|
import { formatQueryParams } from "../../libs/url";
|
|
2
3
|
import { LO_DCA_API } from "./constants";
|
|
3
4
|
export async function getDcaOrderExecutions({ owner, orderId, offset = 0, limit = 10, }) {
|
|
@@ -10,7 +11,7 @@ export async function getDcaOrderExecutions({ owner, orderId, offset = 0, limit
|
|
|
10
11
|
orderType: "DCA",
|
|
11
12
|
};
|
|
12
13
|
const paramsStr = formatQueryParams(queryParams);
|
|
13
|
-
const response = await
|
|
14
|
+
const response = await fetchClient(`${LO_DCA_API}/order-executions?${paramsStr}`);
|
|
14
15
|
if (!response.ok) {
|
|
15
16
|
throw new Error("Failed to fetch dca order executions");
|
|
16
17
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fetchClient } from "../../config/fetchClient";
|
|
1
2
|
import { formatQueryParams } from "../../libs/url";
|
|
2
3
|
import { LO_DCA_API } from "./constants";
|
|
3
4
|
export async function getOpenDcaOrders({ owner, offset = 0, limit = 10, tokenPair, }) {
|
|
@@ -9,7 +10,7 @@ export async function getOpenDcaOrders({ owner, offset = 0, limit = 10, tokenPai
|
|
|
9
10
|
tokenPair,
|
|
10
11
|
};
|
|
11
12
|
const paramsStr = formatQueryParams(queryParams);
|
|
12
|
-
const response = await
|
|
13
|
+
const response = await fetchClient(`${LO_DCA_API}/dca-orders?${paramsStr}`);
|
|
13
14
|
if (!response.ok) {
|
|
14
15
|
throw new Error("Failed to fetch open dca orders");
|
|
15
16
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fetchClient } from "../../config/fetchClient";
|
|
1
2
|
import { formatQueryParams } from "../../libs/url";
|
|
2
3
|
import { LO_DCA_API } from "./constants";
|
|
3
4
|
export async function getOpenLimitOrders({ owner, offset = 0, limit = 10, tokenPair, }) {
|
|
@@ -9,7 +10,7 @@ export async function getOpenLimitOrders({ owner, offset = 0, limit = 10, tokenP
|
|
|
9
10
|
tokenPair,
|
|
10
11
|
};
|
|
11
12
|
const paramsStr = formatQueryParams(queryParams);
|
|
12
|
-
const response = await
|
|
13
|
+
const response = await fetchClient(`${LO_DCA_API}/limit-orders?${paramsStr}`);
|
|
13
14
|
if (!response.ok) {
|
|
14
15
|
throw new Error("Failed to fetch open limit orders");
|
|
15
16
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { fetchClient } from "../../config/fetchClient";
|
|
2
|
+
import { API_ENDPOINTS } from "../../constants/apiEndpoints";
|
|
1
3
|
import { NATIVE_USDC_TOKEN_TYPE, SUI_FULL_TYPE } from "../../constants/tokens";
|
|
2
4
|
import { normalizeTokenType } from "../../utils/token";
|
|
3
|
-
export const PRICES_API = "https://prices.7k.ag";
|
|
4
5
|
export async function getTokenPrice(id, vsCoin = NATIVE_USDC_TOKEN_TYPE) {
|
|
5
6
|
try {
|
|
6
|
-
const response = await
|
|
7
|
+
const response = await fetchClient(`${API_ENDPOINTS.PRICES}/price?ids=${normalizeTokenType(id)}&vsCoin=${vsCoin}`);
|
|
7
8
|
const pricesRes = (await response.json());
|
|
8
9
|
return Number(pricesRes?.[id]?.price || 0);
|
|
9
10
|
}
|
|
@@ -25,7 +26,7 @@ export async function getTokenPrices(ids, vsCoin = NATIVE_USDC_TOKEN_TYPE) {
|
|
|
25
26
|
const limitedIds = ids.slice(0, MAX_TOTAL_IDS).map(normalizeTokenType);
|
|
26
27
|
const idChunks = chunkArray(limitedIds, MAX_IDS_PER_REQUEST);
|
|
27
28
|
const responses = await Promise.all(idChunks.map(async (chunk) => {
|
|
28
|
-
const response = await
|
|
29
|
+
const response = await fetchClient(`${API_ENDPOINTS.PRICES}/price`, {
|
|
29
30
|
method: "POST",
|
|
30
31
|
headers: {
|
|
31
32
|
"Content-Type": "application/json",
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { fetchClient } from "../../config/fetchClient";
|
|
2
|
+
import { API_ENDPOINTS } from "../../constants/apiEndpoints";
|
|
1
3
|
let config = null;
|
|
2
4
|
let configTs = 0;
|
|
3
5
|
export const DEFAULT_CONFIG = {
|
|
@@ -94,7 +96,7 @@ export async function getConfig() {
|
|
|
94
96
|
return config;
|
|
95
97
|
}
|
|
96
98
|
try {
|
|
97
|
-
const response = await
|
|
99
|
+
const response = await fetchClient(`${API_ENDPOINTS.MAIN}/config`);
|
|
98
100
|
const quoteResponse = (await response.json());
|
|
99
101
|
config = quoteResponse;
|
|
100
102
|
configTs = Date.now();
|
|
@@ -2,8 +2,8 @@ import BigNumber from "bignumber.js";
|
|
|
2
2
|
import { SUI_DECIMALS } from "@mysten/sui/utils";
|
|
3
3
|
import { buildTx } from "./buildTx";
|
|
4
4
|
import { formatBalance } from "../../utils/number";
|
|
5
|
-
import { getSuiClient } from "../../suiClient";
|
|
6
5
|
import { getSuiPrice } from "../prices";
|
|
6
|
+
import { Config } from "../../config";
|
|
7
7
|
export async function estimateGasFee({ quoteResponse, accountAddress, slippage, suiPrice: _suiPrice, extendTx, commission, }) {
|
|
8
8
|
if (!accountAddress)
|
|
9
9
|
return 0;
|
|
@@ -23,7 +23,7 @@ export async function estimateGasFee({ quoteResponse, accountAddress, slippage,
|
|
|
23
23
|
return 0;
|
|
24
24
|
const suiPrice = _suiPrice || (await getSuiPrice());
|
|
25
25
|
const suiDecimals = SUI_DECIMALS;
|
|
26
|
-
const { effects: { gasUsed, status }, } = await getSuiClient().devInspectTransactionBlock({
|
|
26
|
+
const { effects: { gasUsed, status }, } = await Config.getSuiClient().devInspectTransactionBlock({
|
|
27
27
|
sender: accountAddress,
|
|
28
28
|
transactionBlock: tx,
|
|
29
29
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { normalizeStructTag, normalizeSuiObjectId } from "@mysten/sui/utils";
|
|
2
|
+
import { API_ENDPOINTS } from "../../constants/apiEndpoints";
|
|
3
|
+
import { fetchClient } from "../../config/fetchClient";
|
|
2
4
|
export const DEFAULT_SOURCES = [
|
|
3
5
|
"suiswap",
|
|
4
6
|
"turbos",
|
|
@@ -31,7 +33,7 @@ export async function getQuote({ tokenIn, tokenOut, amountIn, sources = DEFAULT_
|
|
|
31
33
|
if (excludedPools?.length) {
|
|
32
34
|
params.append("excluded_pools", excludedPools.map((v) => normalizeSuiObjectId(v)).join(","));
|
|
33
35
|
}
|
|
34
|
-
const response = await
|
|
36
|
+
const response = await fetchClient(`${API_ENDPOINTS.MAIN}/quote?${params}`);
|
|
35
37
|
if (!response.ok) {
|
|
36
38
|
throw new Error("Failed to fetch aggregator quote");
|
|
37
39
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { fetchClient } from "../../config/fetchClient";
|
|
2
|
+
import { API_ENDPOINTS } from "../../constants/apiEndpoints";
|
|
1
3
|
import { formatQueryParams } from "../../libs/url";
|
|
2
4
|
export async function getSwapHistory({ owner, offset = 0, limit = 10, tokenPair, }) {
|
|
3
5
|
const queryParams = {
|
|
@@ -7,7 +9,7 @@ export async function getSwapHistory({ owner, offset = 0, limit = 10, tokenPair,
|
|
|
7
9
|
token_pair: tokenPair,
|
|
8
10
|
};
|
|
9
11
|
const paramsStr = formatQueryParams(queryParams);
|
|
10
|
-
const response = await
|
|
12
|
+
const response = await fetchClient(`${API_ENDPOINTS.STATISTIC}/trading-history?${paramsStr}`);
|
|
11
13
|
if (!response.ok) {
|
|
12
14
|
throw new Error("Failed to fetch open limit orders");
|
|
13
15
|
}
|
package/lib/esm/index.mjs
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
export * from "./types/aggregator";
|
|
2
|
-
import {
|
|
2
|
+
import { Config } from "./config";
|
|
3
3
|
import { getTokenPrice, getTokenPrices, getSuiPrice } from "./features/prices";
|
|
4
4
|
import { buildTx, getQuote, estimateGasFee, getSwapHistory, } from "./features/swap";
|
|
5
5
|
import { placeLimitOrder, getOpenLimitOrders, cancelLimitOrder, claimExpiredLimitOrder, getClosedLimitOrders, placeDcaOrder, getOpenDcaOrders, cancelDcaOrder, getClosedDcaOrders, getDcaOrderExecutions, } from "./features/limitDca";
|
|
6
|
+
// avoid breaking changes
|
|
7
|
+
const getSuiClient = Config.getSuiClient;
|
|
8
|
+
const setSuiClient = Config.setSuiClient;
|
|
6
9
|
export {
|
|
10
|
+
// config
|
|
11
|
+
Config,
|
|
7
12
|
// sui client
|
|
8
13
|
getSuiClient, setSuiClient,
|
|
9
14
|
// prices
|
|
@@ -15,6 +20,8 @@ placeLimitOrder, getOpenLimitOrders, cancelLimitOrder, claimExpiredLimitOrder, g
|
|
|
15
20
|
// dca
|
|
16
21
|
placeDcaOrder, getOpenDcaOrders, cancelDcaOrder, getClosedDcaOrders, getDcaOrderExecutions, };
|
|
17
22
|
export default {
|
|
23
|
+
// config
|
|
24
|
+
Config,
|
|
18
25
|
// sui client
|
|
19
26
|
getSuiClient,
|
|
20
27
|
setSuiClient,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BigNumber from "bignumber.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Config } from "../config";
|
|
3
3
|
const orderByKey = (array, key, sortBy) => {
|
|
4
4
|
if (!array?.length) {
|
|
5
5
|
return;
|
|
@@ -25,7 +25,7 @@ export const getCoinOjectIdsByAmount = async (address, amount, coinType) => {
|
|
|
25
25
|
let nextCursor = undefined;
|
|
26
26
|
while (hasNextPage) {
|
|
27
27
|
try {
|
|
28
|
-
const coins = await getSuiClient().getCoins({
|
|
28
|
+
const coins = await Config.getSuiClient().getCoins({
|
|
29
29
|
owner: address,
|
|
30
30
|
coinType,
|
|
31
31
|
cursor: nextCursor,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchClient.d.ts","sourceRoot":"","sources":["../../../../src/config/fetchClient.ts"],"names":[],"mappings":"AAEA,wBAAsB,WAAW,CAC/B,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,QAAQ,CAAC,CAanB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SuiClient } from "@mysten/sui/client";
|
|
2
|
+
declare function setApiKey(key: string): void;
|
|
3
|
+
declare function getApiKey(): string;
|
|
4
|
+
declare function getSuiClient(): SuiClient;
|
|
5
|
+
declare function setSuiClient(client: SuiClient): void;
|
|
6
|
+
declare const Config: {
|
|
7
|
+
setApiKey: typeof setApiKey;
|
|
8
|
+
getApiKey: typeof getApiKey;
|
|
9
|
+
setSuiClient: typeof setSuiClient;
|
|
10
|
+
getSuiClient: typeof getSuiClient;
|
|
11
|
+
};
|
|
12
|
+
export { Config };
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,oBAAoB,CAAC;AAO/D,iBAAS,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEpC;AAED,iBAAS,SAAS,IAAI,MAAM,CAE3B;AAED,iBAAS,YAAY,IAAI,SAAS,CAEjC;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAE7C;AAED,QAAA,MAAM,MAAM;;;;;CAKX,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiEndpoints.d.ts","sourceRoot":"","sources":["../../../../src/constants/apiEndpoints.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;CAKzB,CAAC"}
|
|
@@ -7,5 +7,5 @@ export declare const LIMIT_ORDER_MODULE_ID = "0x0ef0f805710cf53c10f29c4f73e1144a
|
|
|
7
7
|
export declare const DCA_ORDER_MODULE_ID = "0x0ef0f805710cf53c10f29c4f73e1144a662747e1839689a846e2520cae122adc::dca_order";
|
|
8
8
|
export declare const CONFIG_MODULE_ID = "0x0ef0f805710cf53c10f29c4f73e1144a662747e1839689a846e2520cae122adc::config";
|
|
9
9
|
export declare const DCA_MAX_RATE: BigNumber;
|
|
10
|
-
export declare const LO_DCA_API
|
|
10
|
+
export declare const LO_DCA_API: string;
|
|
11
11
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/limitDca/constants.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/limitDca/constants.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,eAAO,MAAM,gBAAgB,uEACyC,CAAC;AACvE,eAAO,MAAM,UAAU,QAA0B,CAAC;AAClD,eAAO,MAAM,cAAc,QAAkB,CAAC;AAC9C,eAAO,MAAM,OAAO,uEACkD,CAAC;AACvE,eAAO,MAAM,qBAAqB,oFAA4B,CAAC;AAC/D,eAAO,MAAM,mBAAmB,kFAA0B,CAAC;AAC3D,eAAO,MAAM,gBAAgB,+EAAuB,CAAC;AACrD,eAAO,MAAM,YAAY,WAAwC,CAAC;AAClE,eAAO,MAAM,UAAU,QAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getClosedDcaOrders.d.ts","sourceRoot":"","sources":["../../../../../src/features/limitDca/getClosedDcaOrders.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getClosedDcaOrders.d.ts","sourceRoot":"","sources":["../../../../../src/features/limitDca/getClosedDcaOrders.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAoB,MAAM,SAAS,CAAC;AAEhE,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,kBAAkB,CAAC,EACvC,KAAK,EACL,MAAU,EACV,KAAU,EACV,SAAS,GACV,EAAE,MAAM,kCAqBR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getClosedLimitOrders.d.ts","sourceRoot":"","sources":["../../../../../src/features/limitDca/getClosedLimitOrders.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getClosedLimitOrders.d.ts","sourceRoot":"","sources":["../../../../../src/features/limitDca/getClosedLimitOrders.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAoB,MAAM,SAAS,CAAC;AAEvD,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,oBAAoB,CAAC,EACzC,KAAK,EACL,MAAU,EACV,KAAU,EACV,SAAS,GACV,EAAE,MAAM,yBAkBR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDcaOrderExecutions.d.ts","sourceRoot":"","sources":["../../../../../src/features/limitDca/getDcaOrderExecutions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDcaOrderExecutions.d.ts","sourceRoot":"","sources":["../../../../../src/features/limitDca/getDcaOrderExecutions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAoB,MAAM,SAAS,CAAC;AAEhE,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,qBAAqB,CAAC,EAC1C,KAAK,EACL,OAAO,EACP,MAAU,EACV,KAAU,GACX,EAAE,MAAM,kCAqBR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOpenDcaOrders.d.ts","sourceRoot":"","sources":["../../../../../src/features/limitDca/getOpenDcaOrders.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getOpenDcaOrders.d.ts","sourceRoot":"","sources":["../../../../../src/features/limitDca/getOpenDcaOrders.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAoB,MAAM,SAAS,CAAC;AAErD,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,gBAAgB,CAAC,EACrC,KAAK,EACL,MAAU,EACV,KAAU,EACV,SAAS,GACV,EAAE,MAAM,uBAkBR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOpenLimitOrders.d.ts","sourceRoot":"","sources":["../../../../../src/features/limitDca/getOpenLimitOrders.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getOpenLimitOrders.d.ts","sourceRoot":"","sources":["../../../../../src/features/limitDca/getOpenLimitOrders.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAoB,MAAM,SAAS,CAAC;AAEvD,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,kBAAkB,CAAC,EACvC,KAAK,EACL,MAAU,EACV,KAAU,EACV,SAAS,GACV,EAAE,MAAM,yBAkBR"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const PRICES_API = "https://prices.7k.ag";
|
|
2
1
|
export declare function getTokenPrice(id: string, vsCoin?: string): Promise<number>;
|
|
3
2
|
export declare function getTokenPrices(ids: string[], vsCoin?: string): Promise<Record<string, number>>;
|
|
4
3
|
export declare function getSuiPrice(): Promise<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/prices/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/prices/index.ts"],"names":[],"mappings":"AAUA,wBAAsB,aAAa,CACjC,EAAE,EAAE,MAAM,EACV,MAAM,SAAyB,GAC9B,OAAO,CAAC,MAAM,CAAC,CAUjB;AAYD,wBAAsB,cAAc,CAClC,GAAG,EAAE,MAAM,EAAE,EACb,MAAM,SAAyB,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAkDjC;AAED,wBAAsB,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAEnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAIhD,eAAO,MAAM,cAAc,EAAE,MAwH5B,CAAC;AAEF,wBAAsB,SAAS,oBAe9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getQuote.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/getQuote.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"getQuote.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/getQuote.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIlE,UAAU,MAAM;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,EAkBtC,CAAC;AAEF,wBAAsB,QAAQ,CAAC,EAC7B,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAyB,EACzB,WAAW,EACX,aAAa,GACd,EAAE,MAAM,0BA2BR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSwapHistory.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/getSwapHistory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getSwapHistory.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/getSwapHistory.ts"],"names":[],"mappings":"AAIA,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AASD,UAAU,kBAAkB;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B;AAED,wBAAsB,cAAc,CAAC,EACnC,KAAK,EACL,MAAU,EACV,KAAU,EACV,SAAS,GACV,EAAE,MAAM,mCAmBR"}
|
package/lib/esm/types/index.d.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
export * from "./types/aggregator";
|
|
2
|
-
import {
|
|
2
|
+
import { Config } from "./config";
|
|
3
3
|
import { getTokenPrice, getTokenPrices, getSuiPrice } from "./features/prices";
|
|
4
4
|
import { buildTx, getQuote, estimateGasFee, getSwapHistory } from "./features/swap";
|
|
5
5
|
import { placeLimitOrder, getOpenLimitOrders, cancelLimitOrder, claimExpiredLimitOrder, getClosedLimitOrders, placeDcaOrder, getOpenDcaOrders, cancelDcaOrder, getClosedDcaOrders, getDcaOrderExecutions } from "./features/limitDca";
|
|
6
|
-
|
|
6
|
+
declare const getSuiClient: () => import("@mysten/sui/dist/cjs/client").SuiClient;
|
|
7
|
+
declare const setSuiClient: (client: import("@mysten/sui/dist/cjs/client").SuiClient) => void;
|
|
8
|
+
export { Config, getSuiClient, setSuiClient, getTokenPrice, getTokenPrices, getSuiPrice, getQuote, estimateGasFee, buildTx, getSwapHistory, placeLimitOrder, getOpenLimitOrders, cancelLimitOrder, claimExpiredLimitOrder, getClosedLimitOrders, placeDcaOrder, getOpenDcaOrders, cancelDcaOrder, getClosedDcaOrders, getDcaOrderExecutions, };
|
|
7
9
|
declare const _default: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
Config: {
|
|
11
|
+
setApiKey: (key: string) => void;
|
|
12
|
+
getApiKey: () => string;
|
|
13
|
+
setSuiClient: (client: import("@mysten/sui/dist/cjs/client").SuiClient) => void;
|
|
14
|
+
getSuiClient: () => import("@mysten/sui/dist/cjs/client").SuiClient;
|
|
15
|
+
};
|
|
16
|
+
getSuiClient: () => import("@mysten/sui/dist/cjs/client").SuiClient;
|
|
17
|
+
setSuiClient: (client: import("@mysten/sui/dist/cjs/client").SuiClient) => void;
|
|
10
18
|
getTokenPrice: typeof getTokenPrice;
|
|
11
19
|
getTokenPrices: typeof getTokenPrices;
|
|
12
20
|
getSuiPrice: typeof getSuiPrice;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AAEnC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE/E,OAAO,EACL,OAAO,EACP,QAAQ,EACR,cAAc,EACd,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAG7B,QAAA,MAAM,YAAY,uDAAsB,CAAC;AACzC,QAAA,MAAM,YAAY,mEAAsB,CAAC;AAEzC,OAAO,EAEL,MAAM,EAGN,YAAY,EACZ,YAAY,EAGZ,aAAa,EACb,cAAc,EACd,WAAW,EAGX,QAAQ,EACR,cAAc,EACd,OAAO,EACP,cAAc,EAGd,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EAGpB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,qBAAqB,GACtB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,wBAgCE"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { SuiscanToken } from "../types/token";
|
|
2
1
|
export declare function normalizeTokenType(type: string): string;
|
|
3
2
|
export declare function denormalizeTokenType(type: string): string;
|
|
4
3
|
export declare function checkIsSui(type: string): type is "0x2::sui::SUI" | "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
5
|
-
export declare function getSuiscanTokenMetadata(type: string): Promise<SuiscanToken>;
|
|
6
4
|
//# sourceMappingURL=token.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../../src/utils/token.ts"],"names":[],"mappings":"AAEA,
|
|
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"}
|
package/lib/esm/utils/sui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Transaction } from "@mysten/sui/transactions";
|
|
2
2
|
import { parseStructTag } from "@mysten/sui/utils";
|
|
3
3
|
import { checkIsSui } from "./token";
|
|
4
|
-
import {
|
|
4
|
+
import { Config } from "../config";
|
|
5
5
|
export const SuiUtils = {
|
|
6
6
|
getSuiCoin(amount, txb) {
|
|
7
7
|
const [coin] = txb.splitCoins(txb.gas, [amount]);
|
|
@@ -92,7 +92,7 @@ export const SuiUtils = {
|
|
|
92
92
|
let iter = 0;
|
|
93
93
|
do {
|
|
94
94
|
try {
|
|
95
|
-
const res = await getSuiClient().getCoins({
|
|
95
|
+
const res = await Config.getSuiClient().getCoins({
|
|
96
96
|
owner: address,
|
|
97
97
|
coinType: type,
|
|
98
98
|
cursor: cursor,
|
|
@@ -138,7 +138,7 @@ export const SuiUtils = {
|
|
|
138
138
|
const queryAll = paginationArgs === "all";
|
|
139
139
|
let nextCursor = queryAll ? null : paginationArgs.cursor;
|
|
140
140
|
do {
|
|
141
|
-
const res = await getSuiClient().getOwnedObjects({
|
|
141
|
+
const res = await Config.getSuiClient().getOwnedObjects({
|
|
142
142
|
owner,
|
|
143
143
|
...query,
|
|
144
144
|
cursor: nextCursor,
|
package/lib/esm/utils/token.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { EXPLORER } from "../constants/explorer";
|
|
2
1
|
import { SUI_FULL_TYPE, SUI_TYPE } from "../constants/tokens";
|
|
3
2
|
export function normalizeTokenType(type) {
|
|
4
3
|
return type === SUI_TYPE ? SUI_FULL_TYPE : type;
|
|
@@ -9,11 +8,3 @@ export function denormalizeTokenType(type) {
|
|
|
9
8
|
export function checkIsSui(type) {
|
|
10
9
|
return type === SUI_FULL_TYPE || type === SUI_TYPE;
|
|
11
10
|
}
|
|
12
|
-
export async function getSuiscanTokenMetadata(type) {
|
|
13
|
-
const response = await fetch(`${EXPLORER.ADDRESS}/api/sui-backend/mainnet/api/coins/${denormalizeTokenType(type)}`);
|
|
14
|
-
if (!response.ok) {
|
|
15
|
-
throw new Error("Failed to fetch token metadata");
|
|
16
|
-
}
|
|
17
|
-
const data = await response.json();
|
|
18
|
-
return { ...data, type: normalizeTokenType(data.type || "") };
|
|
19
|
-
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"explorer.d.ts","sourceRoot":"","sources":["../../../../src/constants/explorer.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;CAEpB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"suiClient.d.ts","sourceRoot":"","sources":["../../../src/suiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,oBAAoB,CAAC;AAM/D,wBAAgB,YAAY,cAE3B;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,QAE7C"}
|
package/lib/cjs/types/token.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export interface SuiscanToken {
|
|
2
|
-
type: string;
|
|
3
|
-
objectId: string;
|
|
4
|
-
name: string;
|
|
5
|
-
supply: number | null;
|
|
6
|
-
supplyInUsd: number | null;
|
|
7
|
-
tokenPrice: number | null;
|
|
8
|
-
dominance: number | null;
|
|
9
|
-
circulatingSupply: number | null;
|
|
10
|
-
marketCap: number | null;
|
|
11
|
-
totalVolume: number | null;
|
|
12
|
-
maxSupply: number | null;
|
|
13
|
-
fdv: number | null;
|
|
14
|
-
holders: number | null;
|
|
15
|
-
denom: string;
|
|
16
|
-
packageId: string;
|
|
17
|
-
createTimestamp: number;
|
|
18
|
-
creator: string;
|
|
19
|
-
creatorName: string | null;
|
|
20
|
-
creatorImg: string | null;
|
|
21
|
-
creatorScamMessage: string | null;
|
|
22
|
-
scamMessage: string | null;
|
|
23
|
-
decimals: number;
|
|
24
|
-
symbol: string;
|
|
25
|
-
iconUrl: string | null;
|
|
26
|
-
description: string;
|
|
27
|
-
bridge: boolean;
|
|
28
|
-
verified: boolean;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=token.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../../src/types/token.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB"}
|
package/lib/esm/suiClient.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SuiClient, getFullnodeUrl } from "@mysten/sui/client";
|
|
2
|
-
let suiClient = new SuiClient({
|
|
3
|
-
url: getFullnodeUrl("mainnet"),
|
|
4
|
-
});
|
|
5
|
-
export function getSuiClient() {
|
|
6
|
-
return suiClient;
|
|
7
|
-
}
|
|
8
|
-
export function setSuiClient(client) {
|
|
9
|
-
suiClient = client;
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"explorer.d.ts","sourceRoot":"","sources":["../../../../src/constants/explorer.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;CAEpB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"suiClient.d.ts","sourceRoot":"","sources":["../../../src/suiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,oBAAoB,CAAC;AAM/D,wBAAgB,YAAY,cAE3B;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,QAE7C"}
|
package/lib/esm/types/token.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|