@suilend/sui-core 0.1.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 +67 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/lib/api.d.ts +5 -0
- package/lib/api.js +76 -0
- package/lib/coinMetadata.d.ts +8 -0
- package/lib/coinMetadata.js +84 -0
- package/lib/coinType.d.ts +196 -0
- package/lib/coinType.js +386 -0
- package/lib/constants.d.ts +34 -0
- package/lib/constants.js +63 -0
- package/lib/format.d.ts +41 -0
- package/lib/format.js +205 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +7 -0
- package/lib/indexedDB.d.ts +4 -0
- package/lib/indexedDB.js +100 -0
- package/lib/transactions.d.ts +31 -0
- package/lib/transactions.js +167 -0
- package/package.json +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @suilend/sui-core
|
|
2
|
+
|
|
3
|
+
The **canonical**, isomorphic Sui core for the Suilend ecosystem. It holds the
|
|
4
|
+
pieces that must be identical everywhere they run — on the frontend, inside the
|
|
5
|
+
protocol SDKs, and in the backend indexer/workflows:
|
|
6
|
+
|
|
7
|
+
- **Coin types** — normalized coin-type constants, grouped sets (stablecoins,
|
|
8
|
+
BTC, ETH, points, mSEND), Pyth price-feed metadata, and the coin-type
|
|
9
|
+
registry (`COINTYPE_LOGO_MAP`, `COINTYPE_SYMBOL_MAP`, …) plus guards
|
|
10
|
+
(`isSui`, `isStablecoin`, `isSendPoints`, `extractCTokenCoinType`, …).
|
|
11
|
+
- **Coin metadata** — `getCoinMetadataMap` and the `Token` type.
|
|
12
|
+
- **Transactions** — spendable-coin construction, coin/object enumeration,
|
|
13
|
+
balance-change helpers.
|
|
14
|
+
- **Pricing** — `getPrice` / `getHistoryPrice`.
|
|
15
|
+
- **Formatting** — number / token / USD / id formatters.
|
|
16
|
+
- **Constants** — `API_URL`, `MAX_U64`, `MS_PER_YEAR`, RPC/explorer config.
|
|
17
|
+
|
|
18
|
+
This package is the source of truth. `@suilend/sui-fe` re-exports it and layers
|
|
19
|
+
the browser/React-only surface on top; the protocol SDKs and the backend depend
|
|
20
|
+
on it directly.
|
|
21
|
+
|
|
22
|
+
## Isomorphic by design
|
|
23
|
+
|
|
24
|
+
Every module runs unchanged in Node and the browser. The only browser-specific
|
|
25
|
+
code path — the IndexedDB metadata cache used by `getCoinMetadataMap` — is
|
|
26
|
+
feature-detected (`typeof indexedDB === "undefined"`) and becomes a no-op
|
|
27
|
+
outside the browser, so metadata still resolves from the API in Node.
|
|
28
|
+
|
|
29
|
+
## Peer dependency
|
|
30
|
+
|
|
31
|
+
`@mysten/sui` is a peer dependency (`>=2.17.0 <3`) — the consumer pins the
|
|
32
|
+
exact version so there is a single copy in the tree.
|
|
33
|
+
|
|
34
|
+
## Build
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
bun run build # tsc -> ./dist, then rewrite relative imports to .js (ESM)
|
|
38
|
+
bun run typecheck # tsc --noEmit
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Releasing
|
|
42
|
+
|
|
43
|
+
Publishing is automated by `.github/workflows/sui_core_publish.yaml` via npm
|
|
44
|
+
**OIDC Trusted Publishing** — there is no npm token to manage or rotate, and
|
|
45
|
+
provenance is attached automatically.
|
|
46
|
+
|
|
47
|
+
To cut a release:
|
|
48
|
+
|
|
49
|
+
1. Bump `version` in `package.json` and merge it.
|
|
50
|
+
2. Push a tag whose version matches:
|
|
51
|
+
- `release-sui-core-v<version>` → published to the `latest` dist-tag.
|
|
52
|
+
- `release-sui-core-prerelease-<version>` → published to the `next` dist-tag.
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
git tag release-sui-core-v0.1.0 && git push origin release-sui-core-v0.1.0
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The workflow fails loudly if the tag version and `package.json` version
|
|
59
|
+
disagree.
|
|
60
|
+
|
|
61
|
+
**One-time bootstrap** (first publish of this package name only): Trusted
|
|
62
|
+
Publishing attaches to a package that already exists on npm, so publish once
|
|
63
|
+
manually — `bun run release` locally (`npm publish` with 2FA), or a short-lived
|
|
64
|
+
90-day granular token — then on npmjs.com set
|
|
65
|
+
**@suilend/sui-core → Settings → Trusted Publisher → GitHub Actions**
|
|
66
|
+
(org `fireflyprotocol`, repo `lending-mono`, workflow `sui_core_publish.yaml`).
|
|
67
|
+
Every release after that is token-free.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./lib";
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./lib/index.js";
|
package/lib/api.d.ts
ADDED
package/lib/api.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { SUI_COINTYPE, isSui } from "./coinType.js";
|
|
11
|
+
import { API_URL } from "./constants.js";
|
|
12
|
+
// Date helper functions
|
|
13
|
+
const getHours = (date) => date.getHours();
|
|
14
|
+
const getMinutes = (date) => date.getMinutes();
|
|
15
|
+
const getSeconds = (date) => date.getSeconds();
|
|
16
|
+
const setHours = (date, hours) => {
|
|
17
|
+
const result = new Date(date);
|
|
18
|
+
result.setHours(hours);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
const setMinutes = (date, minutes) => {
|
|
22
|
+
const result = new Date(date);
|
|
23
|
+
result.setMinutes(minutes);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
const setSeconds = (date, seconds) => {
|
|
27
|
+
const result = new Date(date);
|
|
28
|
+
result.setSeconds(seconds);
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
export const getPrice = (coinType) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
+
try {
|
|
33
|
+
const url = `${API_URL}/proxy/price?${new URLSearchParams({
|
|
34
|
+
address: isSui(coinType) ? SUI_COINTYPE : coinType,
|
|
35
|
+
})}`;
|
|
36
|
+
const res = yield fetch(url);
|
|
37
|
+
const json = yield res.json();
|
|
38
|
+
if (json.data.value === undefined)
|
|
39
|
+
return undefined;
|
|
40
|
+
return +json.data.value;
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
console.error(err);
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
export const getHistoryPrice = (coinType, interval, timeFromS, timeToS) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
+
let timeFrom = new Date(timeFromS * 1000);
|
|
49
|
+
timeFrom = setHours(timeFrom, getHours(timeFrom) - (getHours(timeFrom) % 3));
|
|
50
|
+
timeFrom = setMinutes(timeFrom, 0);
|
|
51
|
+
timeFrom = setSeconds(timeFrom, 0);
|
|
52
|
+
let timeTo = new Date(timeToS * 1000);
|
|
53
|
+
timeTo = setHours(timeTo, getHours(timeTo) - (getHours(timeTo) % 3));
|
|
54
|
+
timeTo = setMinutes(timeTo, 0);
|
|
55
|
+
timeTo = setSeconds(timeTo, 0);
|
|
56
|
+
const processedTimeFromS = Math.floor(timeFrom.getTime() / 1000);
|
|
57
|
+
const processedTimeToS = Math.floor(timeTo.getTime() / 1000);
|
|
58
|
+
try {
|
|
59
|
+
const url = `${API_URL}/proxy/history-price?${new URLSearchParams({
|
|
60
|
+
address: isSui(coinType) ? SUI_COINTYPE : coinType,
|
|
61
|
+
type: interval,
|
|
62
|
+
time_from: `${processedTimeFromS}`,
|
|
63
|
+
time_to: `${processedTimeToS}`,
|
|
64
|
+
})}`;
|
|
65
|
+
const res = yield fetch(url);
|
|
66
|
+
const json = yield res.json();
|
|
67
|
+
return json.data.items.map((item) => ({
|
|
68
|
+
timestampS: +item.unixTime,
|
|
69
|
+
priceUsd: +item.value,
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
console.error(err);
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SuiClientTypes } from "@mysten/sui/client";
|
|
2
|
+
export type Token = SuiClientTypes.CoinMetadata & {
|
|
3
|
+
coinType: string;
|
|
4
|
+
raw?: SuiClientTypes.CoinMetadata;
|
|
5
|
+
};
|
|
6
|
+
export declare const getToken: (coinType: string, coinMetadata: SuiClientTypes.CoinMetadata) => Token;
|
|
7
|
+
export declare const getCoinMetadataMap: (uniqueCoinTypes: string[]) => Promise<Record<string, Token>>;
|
|
8
|
+
export declare const removeCoinMetadataFromIndexedDB: (coinTypes: string[]) => Promise<void>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var _a;
|
|
11
|
+
import chunk from "lodash/chunk.js";
|
|
12
|
+
import pLimit from "p-limit";
|
|
13
|
+
import { COINTYPE_LOGO_MAP, COINTYPE_SYMBOL_MAP, extractCTokenCoinType, extractSymbolFromCoinType, isCTokenCoinType, isCoinType, } from "./coinType.js";
|
|
14
|
+
import { API_URL } from "./constants.js";
|
|
15
|
+
import { getTokenMapByCoinTypeFromIndexedDB, removeTokensFromIndexedDB, setTokenMapToIndexedDB, } from "./indexedDB.js";
|
|
16
|
+
const CHUNK_SIZE = +((_a = process.env.NEXT_PUBLIC_COIN_METADATA_CHUNK_SIZE) !== null && _a !== void 0 ? _a : 50);
|
|
17
|
+
export const getToken = (coinType, coinMetadata) => (Object.assign({ coinType }, coinMetadata));
|
|
18
|
+
export const getCoinMetadataMap = (uniqueCoinTypes) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
var _a, _b, _c;
|
|
20
|
+
const validUniqueCoinTypes = uniqueCoinTypes.filter(isCoinType);
|
|
21
|
+
if (validUniqueCoinTypes.length === 0)
|
|
22
|
+
return {};
|
|
23
|
+
const coinTypesToFetch = Array.from(new Set(validUniqueCoinTypes.map((coinType) => isCTokenCoinType(coinType) ? extractCTokenCoinType(coinType) : coinType))); // May contain duplicates
|
|
24
|
+
try {
|
|
25
|
+
// Get cached tokens
|
|
26
|
+
let cachedTokenMap = {};
|
|
27
|
+
try {
|
|
28
|
+
cachedTokenMap =
|
|
29
|
+
yield getTokenMapByCoinTypeFromIndexedDB(coinTypesToFetch);
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
// Silently fail if IndexedDB is not available
|
|
33
|
+
}
|
|
34
|
+
// Fetch new tokens from API
|
|
35
|
+
const coinTypeChunks = chunk(coinTypesToFetch.filter((coinType) => !cachedTokenMap[coinType]), CHUNK_SIZE);
|
|
36
|
+
const limit = pLimit(5);
|
|
37
|
+
const newTokens = (yield Promise.all(coinTypeChunks.map((coinTypeChunk) => limit(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
const url = `${API_URL}/steamm/coins?${new URLSearchParams({
|
|
39
|
+
coinTypes: coinTypeChunk.join(","),
|
|
40
|
+
})}`;
|
|
41
|
+
const res = yield fetch(url);
|
|
42
|
+
const json = yield res.json();
|
|
43
|
+
return json;
|
|
44
|
+
}))))).flat();
|
|
45
|
+
// Store new tokens in IndexedDB
|
|
46
|
+
const newTokenMap = newTokens.reduce((acc, token) => (Object.assign(Object.assign({}, acc), { [token.coinType]: token })), {});
|
|
47
|
+
try {
|
|
48
|
+
yield setTokenMapToIndexedDB(newTokenMap);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
// Silently fail if IndexedDB is not available
|
|
52
|
+
}
|
|
53
|
+
// Combine cached and new tokens
|
|
54
|
+
const combinedTokenMap = Object.assign(Object.assign({}, cachedTokenMap), newTokenMap);
|
|
55
|
+
//
|
|
56
|
+
const tokenMap = {};
|
|
57
|
+
for (let i = 0; i < validUniqueCoinTypes.length; i++) {
|
|
58
|
+
const coinType = isCTokenCoinType(validUniqueCoinTypes[i])
|
|
59
|
+
? extractCTokenCoinType(validUniqueCoinTypes[i])
|
|
60
|
+
: validUniqueCoinTypes[i];
|
|
61
|
+
const token = combinedTokenMap[coinType];
|
|
62
|
+
if (!token)
|
|
63
|
+
throw new Error(`Missing metadata for ${coinType}`);
|
|
64
|
+
tokenMap[validUniqueCoinTypes[i]] = Object.assign(Object.assign({}, token), { iconUrl: (_a = COINTYPE_LOGO_MAP[isCTokenCoinType(coinType)
|
|
65
|
+
? extractCTokenCoinType(coinType)
|
|
66
|
+
: coinType]) !== null && _a !== void 0 ? _a : token.iconUrl, symbol: (_c = (_b = COINTYPE_SYMBOL_MAP[isCTokenCoinType(coinType)
|
|
67
|
+
? extractCTokenCoinType(coinType)
|
|
68
|
+
: coinType]) !== null && _b !== void 0 ? _b : token.symbol) !== null && _c !== void 0 ? _c : extractSymbolFromCoinType(coinType), raw: token });
|
|
69
|
+
}
|
|
70
|
+
return tokenMap;
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
console.error(err);
|
|
74
|
+
return {};
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
export const removeCoinMetadataFromIndexedDB = (coinTypes) => __awaiter(void 0, void 0, void 0, function* () {
|
|
78
|
+
try {
|
|
79
|
+
yield removeTokensFromIndexedDB(coinTypes);
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
// Silently fail if IndexedDB is not available
|
|
83
|
+
}
|
|
84
|
+
});
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
export declare const SUI_COINTYPE = "0x2::sui::SUI";
|
|
2
|
+
export declare const NORMALIZED_SEND_POINTS_S1_COINTYPE: string;
|
|
3
|
+
export declare const NORMALIZED_SEND_POINTS_S2_COINTYPE: string;
|
|
4
|
+
export declare const NORMALIZED_STEAMM_POINTS_COINTYPE: string;
|
|
5
|
+
export declare const NORMALIZED_mSEND_SERIES_1_COINTYPE: string;
|
|
6
|
+
export declare const NORMALIZED_mSEND_SERIES_2_COINTYPE: string;
|
|
7
|
+
export declare const NORMALIZED_mSEND_SERIES_3_COINTYPE: string;
|
|
8
|
+
export declare const NORMALIZED_mSEND_SERIES_4_COINTYPE: string;
|
|
9
|
+
export declare const NORMALIZED_mSEND_SERIES_5_COINTYPE: string;
|
|
10
|
+
export declare const NORMALIZED_SEND_COINTYPE: string;
|
|
11
|
+
export declare const NORMALIZED_SUI_COINTYPE: string;
|
|
12
|
+
export declare const NORMALIZED_wUSDC_COINTYPE: string;
|
|
13
|
+
export declare const NORMALIZED_wUSDT_COINTYPE: string;
|
|
14
|
+
export declare const NORMALIZED_WETH_COINTYPE: string;
|
|
15
|
+
export declare const NORMALIZED_SOL_COINTYPE: string;
|
|
16
|
+
export declare const NORMALIZED_AUSD_COINTYPE: string;
|
|
17
|
+
export declare const NORMALIZED_FUD_COINTYPE: string;
|
|
18
|
+
export declare const NORMALIZED_USDC_COINTYPE: string;
|
|
19
|
+
export declare const NORMALIZED_DEEP_COINTYPE: string;
|
|
20
|
+
export declare const NORMALIZED_suiETH_COINTYPE: string;
|
|
21
|
+
export declare const NORMALIZED_sSUI_COINTYPE: string;
|
|
22
|
+
export declare const NORMALIZED_mSUI_COINTYPE: string;
|
|
23
|
+
export declare const NORMALIZED_HIPPO_COINTYPE: string;
|
|
24
|
+
export declare const NORMALIZED_NS_COINTYPE: string;
|
|
25
|
+
export declare const NORMALIZED_fudSUI_COINTYPE: string;
|
|
26
|
+
export declare const NORMALIZED_kSUI_COINTYPE: string;
|
|
27
|
+
export declare const NORMALIZED_trevinSUI_COINTYPE: string;
|
|
28
|
+
export declare const NORMALIZED_upSUI_COINTYPE: string;
|
|
29
|
+
export declare const NORMALIZED_suiUSDT_COINTYPE: string;
|
|
30
|
+
export declare const NORMALIZED_BUCK_COINTYPE: string;
|
|
31
|
+
export declare const NORMALIZED_suiWBTC_COINTYPE: string;
|
|
32
|
+
export declare const NORMALIZED_BLUE_COINTYPE: string;
|
|
33
|
+
export declare const NORMALIZED_yapSUI_COINTYPE: string;
|
|
34
|
+
export declare const NORMALIZED_LBTC_COINTYPE: string;
|
|
35
|
+
export declare const NORMALIZED_mUSD_COINTYPE: string;
|
|
36
|
+
export declare const NORMALIZED_iSUI_COINTYPE: string;
|
|
37
|
+
export declare const NORMALIZED_WAL_COINTYPE: string;
|
|
38
|
+
export declare const NORMALIZED_flSUI_COINTYPE: string;
|
|
39
|
+
export declare const NORMALIZED_HAEDAL_COINTYPE: string;
|
|
40
|
+
export declare const NORMALIZED_UP_COINTYPE: string;
|
|
41
|
+
export declare const NORMALIZED_KOBAN_COINTYPE: string;
|
|
42
|
+
export declare const NORMALIZED_oshiSUI_COINTYPE: string;
|
|
43
|
+
export declare const NORMALIZED_jugSUI_COINTYPE: string;
|
|
44
|
+
export declare const NORMALIZED_xBTC_COINTYPE: string;
|
|
45
|
+
export declare const NORMALIZED_DMC_COINTYPE: string;
|
|
46
|
+
export declare const NORMALIZED_IKA_COINTYPE: string;
|
|
47
|
+
export declare const NORMALIZED_stratSUI_COINTYPE: string;
|
|
48
|
+
export declare const NORMALIZED_ALKIMI_COINTYPE: string;
|
|
49
|
+
export declare const NORMALIZED_sdeUSD_COINTYPE: string;
|
|
50
|
+
export declare const NORMALIZED_fpSUI_COINTYPE: string;
|
|
51
|
+
export declare const NORMALIZED_XAUm_COINTYPE: string;
|
|
52
|
+
export declare const NORMALIZED_WBTC_COINTYPE: string;
|
|
53
|
+
export declare const NORMALIZED_USDB_COINTYPE: string;
|
|
54
|
+
export declare const NORMALIZED_eSUI_COINTYPE: string;
|
|
55
|
+
export declare const NORMALIZED_eTHIRD_COINTYPE: string;
|
|
56
|
+
export declare const NORMALIZED_suiUSDe_COINTYPE: string;
|
|
57
|
+
export declare const NORMALIZED_eEARN_COINTYPE: string;
|
|
58
|
+
export declare const NORMALIZED_USDsui_COINTYPE: string;
|
|
59
|
+
export declare const NORMALIZED_SEND_POINTS_COINTYPES: string[];
|
|
60
|
+
export declare const NORMALIZED_mSEND_S1_COINTYPES: string[];
|
|
61
|
+
export declare const NORMALIZED_mSEND_S2_COINTYPES: string[];
|
|
62
|
+
export declare const NORMALIZED_mSEND_COINTYPES: string[];
|
|
63
|
+
export declare const NORMALIZED_STABLECOIN_COINTYPES: string[];
|
|
64
|
+
export declare const NORMALIZED_BTC_COINTYPES: string[];
|
|
65
|
+
export declare const NORMALIZED_ETH_COINTYPES: string[];
|
|
66
|
+
export declare const NON_SPONSORED_PYTH_PRICE_FEED_COINTYPES: string[];
|
|
67
|
+
export declare const TEMPORARY_PYTH_PRICE_FEED_COINTYPES: string[];
|
|
68
|
+
export declare const COINTYPE_LOGO_MAP: {
|
|
69
|
+
[NORMALIZED_SEND_POINTS_S1_COINTYPE]: string;
|
|
70
|
+
[NORMALIZED_SEND_POINTS_S2_COINTYPE]: string;
|
|
71
|
+
[NORMALIZED_STEAMM_POINTS_COINTYPE]: string;
|
|
72
|
+
[NORMALIZED_mSEND_SERIES_1_COINTYPE]: string;
|
|
73
|
+
[NORMALIZED_mSEND_SERIES_2_COINTYPE]: string;
|
|
74
|
+
[NORMALIZED_mSEND_SERIES_3_COINTYPE]: string;
|
|
75
|
+
[NORMALIZED_mSEND_SERIES_4_COINTYPE]: string;
|
|
76
|
+
[NORMALIZED_mSEND_SERIES_5_COINTYPE]: string;
|
|
77
|
+
[NORMALIZED_SEND_COINTYPE]: string;
|
|
78
|
+
[NORMALIZED_SUI_COINTYPE]: string;
|
|
79
|
+
[NORMALIZED_wUSDC_COINTYPE]: string;
|
|
80
|
+
[NORMALIZED_wUSDT_COINTYPE]: string;
|
|
81
|
+
[NORMALIZED_WETH_COINTYPE]: string;
|
|
82
|
+
[NORMALIZED_SOL_COINTYPE]: string;
|
|
83
|
+
[NORMALIZED_AUSD_COINTYPE]: string;
|
|
84
|
+
[NORMALIZED_FUD_COINTYPE]: string;
|
|
85
|
+
[NORMALIZED_USDC_COINTYPE]: string;
|
|
86
|
+
[NORMALIZED_DEEP_COINTYPE]: string;
|
|
87
|
+
[NORMALIZED_suiETH_COINTYPE]: string;
|
|
88
|
+
[NORMALIZED_sSUI_COINTYPE]: string;
|
|
89
|
+
[NORMALIZED_mSUI_COINTYPE]: string;
|
|
90
|
+
[NORMALIZED_HIPPO_COINTYPE]: string;
|
|
91
|
+
[NORMALIZED_NS_COINTYPE]: string;
|
|
92
|
+
[NORMALIZED_fudSUI_COINTYPE]: string;
|
|
93
|
+
[NORMALIZED_kSUI_COINTYPE]: string;
|
|
94
|
+
[NORMALIZED_trevinSUI_COINTYPE]: string;
|
|
95
|
+
[NORMALIZED_upSUI_COINTYPE]: string;
|
|
96
|
+
[NORMALIZED_suiUSDT_COINTYPE]: string;
|
|
97
|
+
[NORMALIZED_BUCK_COINTYPE]: string;
|
|
98
|
+
[NORMALIZED_suiWBTC_COINTYPE]: string;
|
|
99
|
+
[NORMALIZED_BLUE_COINTYPE]: string;
|
|
100
|
+
[NORMALIZED_yapSUI_COINTYPE]: string;
|
|
101
|
+
[NORMALIZED_LBTC_COINTYPE]: string;
|
|
102
|
+
[NORMALIZED_mUSD_COINTYPE]: string;
|
|
103
|
+
[NORMALIZED_iSUI_COINTYPE]: string;
|
|
104
|
+
[NORMALIZED_WAL_COINTYPE]: string;
|
|
105
|
+
[NORMALIZED_flSUI_COINTYPE]: string;
|
|
106
|
+
[NORMALIZED_HAEDAL_COINTYPE]: string;
|
|
107
|
+
[NORMALIZED_UP_COINTYPE]: string;
|
|
108
|
+
[NORMALIZED_KOBAN_COINTYPE]: string;
|
|
109
|
+
[NORMALIZED_oshiSUI_COINTYPE]: string;
|
|
110
|
+
[NORMALIZED_jugSUI_COINTYPE]: string;
|
|
111
|
+
[NORMALIZED_xBTC_COINTYPE]: string;
|
|
112
|
+
[NORMALIZED_DMC_COINTYPE]: string;
|
|
113
|
+
[NORMALIZED_IKA_COINTYPE]: string;
|
|
114
|
+
[NORMALIZED_stratSUI_COINTYPE]: string;
|
|
115
|
+
[NORMALIZED_ALKIMI_COINTYPE]: string;
|
|
116
|
+
[NORMALIZED_sdeUSD_COINTYPE]: string;
|
|
117
|
+
[NORMALIZED_fpSUI_COINTYPE]: string;
|
|
118
|
+
[NORMALIZED_XAUm_COINTYPE]: string;
|
|
119
|
+
[NORMALIZED_WBTC_COINTYPE]: string;
|
|
120
|
+
[NORMALIZED_USDB_COINTYPE]: string;
|
|
121
|
+
[NORMALIZED_eSUI_COINTYPE]: string;
|
|
122
|
+
[NORMALIZED_eTHIRD_COINTYPE]: string;
|
|
123
|
+
[NORMALIZED_suiUSDe_COINTYPE]: string;
|
|
124
|
+
[NORMALIZED_eEARN_COINTYPE]: string;
|
|
125
|
+
[NORMALIZED_USDsui_COINTYPE]: string;
|
|
126
|
+
"0x3bf0aeb7b9698b18ec7937290a5701088fcd5d43ad11a2564b074d022a6d71ec::maya::MAYA": string;
|
|
127
|
+
};
|
|
128
|
+
export declare const COINTYPE_SYMBOL_MAP: Record<string, string>;
|
|
129
|
+
export declare const COINTYPE_COLOR_MAP: {
|
|
130
|
+
[NORMALIZED_SEND_COINTYPE]: string;
|
|
131
|
+
[NORMALIZED_SUI_COINTYPE]: string;
|
|
132
|
+
[NORMALIZED_wUSDC_COINTYPE]: string;
|
|
133
|
+
[NORMALIZED_wUSDT_COINTYPE]: string;
|
|
134
|
+
[NORMALIZED_WETH_COINTYPE]: string;
|
|
135
|
+
[NORMALIZED_SOL_COINTYPE]: string;
|
|
136
|
+
[NORMALIZED_AUSD_COINTYPE]: string;
|
|
137
|
+
[NORMALIZED_FUD_COINTYPE]: string;
|
|
138
|
+
[NORMALIZED_USDC_COINTYPE]: string;
|
|
139
|
+
[NORMALIZED_DEEP_COINTYPE]: string;
|
|
140
|
+
[NORMALIZED_suiETH_COINTYPE]: string;
|
|
141
|
+
[NORMALIZED_sSUI_COINTYPE]: string;
|
|
142
|
+
[NORMALIZED_mSUI_COINTYPE]: string;
|
|
143
|
+
[NORMALIZED_HIPPO_COINTYPE]: string;
|
|
144
|
+
[NORMALIZED_NS_COINTYPE]: string;
|
|
145
|
+
[NORMALIZED_fudSUI_COINTYPE]: string;
|
|
146
|
+
[NORMALIZED_kSUI_COINTYPE]: string;
|
|
147
|
+
[NORMALIZED_trevinSUI_COINTYPE]: string;
|
|
148
|
+
[NORMALIZED_upSUI_COINTYPE]: string;
|
|
149
|
+
[NORMALIZED_suiUSDT_COINTYPE]: string;
|
|
150
|
+
[NORMALIZED_BUCK_COINTYPE]: string;
|
|
151
|
+
[NORMALIZED_suiWBTC_COINTYPE]: string;
|
|
152
|
+
[NORMALIZED_BLUE_COINTYPE]: string;
|
|
153
|
+
[NORMALIZED_yapSUI_COINTYPE]: string;
|
|
154
|
+
[NORMALIZED_LBTC_COINTYPE]: string;
|
|
155
|
+
[NORMALIZED_mUSD_COINTYPE]: string;
|
|
156
|
+
[NORMALIZED_iSUI_COINTYPE]: string;
|
|
157
|
+
[NORMALIZED_WAL_COINTYPE]: string;
|
|
158
|
+
[NORMALIZED_flSUI_COINTYPE]: string;
|
|
159
|
+
[NORMALIZED_HAEDAL_COINTYPE]: string;
|
|
160
|
+
[NORMALIZED_UP_COINTYPE]: string;
|
|
161
|
+
[NORMALIZED_KOBAN_COINTYPE]: string;
|
|
162
|
+
[NORMALIZED_oshiSUI_COINTYPE]: string;
|
|
163
|
+
[NORMALIZED_jugSUI_COINTYPE]: string;
|
|
164
|
+
[NORMALIZED_xBTC_COINTYPE]: string;
|
|
165
|
+
[NORMALIZED_DMC_COINTYPE]: string;
|
|
166
|
+
[NORMALIZED_IKA_COINTYPE]: string;
|
|
167
|
+
[NORMALIZED_stratSUI_COINTYPE]: string;
|
|
168
|
+
[NORMALIZED_ALKIMI_COINTYPE]: string;
|
|
169
|
+
[NORMALIZED_sdeUSD_COINTYPE]: string;
|
|
170
|
+
[NORMALIZED_fpSUI_COINTYPE]: string;
|
|
171
|
+
[NORMALIZED_XAUm_COINTYPE]: string;
|
|
172
|
+
[NORMALIZED_WBTC_COINTYPE]: string;
|
|
173
|
+
[NORMALIZED_USDB_COINTYPE]: string;
|
|
174
|
+
[NORMALIZED_eSUI_COINTYPE]: string;
|
|
175
|
+
[NORMALIZED_eTHIRD_COINTYPE]: string;
|
|
176
|
+
[NORMALIZED_suiUSDe_COINTYPE]: string;
|
|
177
|
+
[NORMALIZED_eEARN_COINTYPE]: string;
|
|
178
|
+
[NORMALIZED_USDsui_COINTYPE]: string;
|
|
179
|
+
};
|
|
180
|
+
export declare const COINTYPE_PYTH_PRICE_FEED_SYMBOL_MAP: Record<string, string>;
|
|
181
|
+
export declare const getPythOracleUrl: (coinType: string) => string | null;
|
|
182
|
+
export declare const extractSymbolFromCoinType: (coinType: string) => string | undefined;
|
|
183
|
+
export declare const isSendPointsS1: (coinType: string) => boolean;
|
|
184
|
+
export declare const isSendPointsS2: (coinType: string) => boolean;
|
|
185
|
+
export declare const isSteammPoints: (coinType: string) => boolean;
|
|
186
|
+
export declare const isSend: (coinType: string) => boolean;
|
|
187
|
+
export declare const isSui: (coinType: string) => boolean;
|
|
188
|
+
export declare const issSui: (coinType: string) => boolean;
|
|
189
|
+
export declare const isSendPoints: (coinType: string) => boolean;
|
|
190
|
+
export declare const isMsend: (coinType: string) => boolean;
|
|
191
|
+
export declare const isStablecoin: (coinType: string) => boolean;
|
|
192
|
+
export declare const isBtc: (coinType: string) => boolean;
|
|
193
|
+
export declare const isEth: (coinType: string) => boolean;
|
|
194
|
+
export declare const isCoinType: (text: string) => boolean;
|
|
195
|
+
export declare const isCTokenCoinType: (coinType: string) => boolean;
|
|
196
|
+
export declare const extractCTokenCoinType: (coinType: string) => string;
|