@scallop-io/sui-scallop-sdk 1.4.17 → 1.4.19
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/dist/constants/poolAddress.d.ts +17 -10
- package/dist/index.js +186 -100
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +186 -100
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallopQuery.d.ts +7 -0
- package/dist/queries/poolAddressesQuery.d.ts +7 -0
- package/package.json +1 -1
- package/src/constants/poolAddress.ts +239 -144
- package/src/queries/poolAddressesQuery.ts +27 -0
|
@@ -7,12 +7,16 @@ export const getAllAddresses = async (query: ScallopQuery) => {
|
|
|
7
7
|
Record<
|
|
8
8
|
SupportPoolCoins,
|
|
9
9
|
{
|
|
10
|
+
coinName: string;
|
|
11
|
+
symbol: string;
|
|
10
12
|
lendingPoolAddress?: string;
|
|
11
13
|
collateralPoolAddress?: string; // not all pool has collateral
|
|
12
14
|
borrowDynamic?: string;
|
|
13
15
|
spoolReward?: string;
|
|
14
16
|
spool?: string;
|
|
15
17
|
sCoinType?: string;
|
|
18
|
+
sCoinName?: string;
|
|
19
|
+
sCoinSymbol?: string;
|
|
16
20
|
sCoinTreasury?: string;
|
|
17
21
|
interestModel?: string;
|
|
18
22
|
riskModel?: string;
|
|
@@ -23,6 +27,9 @@ export const getAllAddresses = async (query: ScallopQuery) => {
|
|
|
23
27
|
coinMetadataId?: string;
|
|
24
28
|
borrowIncentivePoolId?: string;
|
|
25
29
|
coinType?: string;
|
|
30
|
+
sCoinMetadataId?: string;
|
|
31
|
+
spoolName?: string;
|
|
32
|
+
decimals: number;
|
|
26
33
|
}
|
|
27
34
|
>
|
|
28
35
|
> = {};
|
|
@@ -116,6 +123,12 @@ export const getAllAddresses = async (query: ScallopQuery) => {
|
|
|
116
123
|
);
|
|
117
124
|
// @ts-ignore
|
|
118
125
|
const sCoinType = query.address.get(`scoin.coins.s${coinName}.coinType`);
|
|
126
|
+
const sCoinName = sCoinType
|
|
127
|
+
? query.utils.parseSCoinName(coinName)
|
|
128
|
+
: undefined;
|
|
129
|
+
const sCoinSymbol = sCoinName
|
|
130
|
+
? query.utils.parseSymbol(sCoinName)
|
|
131
|
+
: undefined;
|
|
119
132
|
const sCoinTreasury = query.address.get(
|
|
120
133
|
// @ts-ignore
|
|
121
134
|
`scoin.coins.s${coinName}.treasury`
|
|
@@ -123,7 +136,16 @@ export const getAllAddresses = async (query: ScallopQuery) => {
|
|
|
123
136
|
const coinMetadataId = query.address.get(
|
|
124
137
|
`core.coins.${coinName}.metaData`
|
|
125
138
|
);
|
|
139
|
+
const sCoinMetadataId = query.address.get(
|
|
140
|
+
// @ts-ignore
|
|
141
|
+
`scoin.coins.s${coinName}.metaData`
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
const decimals = query.utils.getCoinDecimal(coinName);
|
|
145
|
+
const spoolName = spool ? `s${coinName}` : undefined;
|
|
126
146
|
results[coinName as SupportPoolCoins] = {
|
|
147
|
+
coinName,
|
|
148
|
+
symbol: query.utils.parseSymbol(coinName),
|
|
127
149
|
lendingPoolAddress: addresses[0],
|
|
128
150
|
collateralPoolAddress: addresses[1],
|
|
129
151
|
borrowDynamic: addresses[2],
|
|
@@ -137,8 +159,13 @@ export const getAllAddresses = async (query: ScallopQuery) => {
|
|
|
137
159
|
spoolReward: rewardPool,
|
|
138
160
|
sCoinTreasury,
|
|
139
161
|
sCoinType,
|
|
162
|
+
sCoinName,
|
|
163
|
+
sCoinSymbol,
|
|
140
164
|
coinMetadataId,
|
|
141
165
|
coinType: `0x${coinType}`,
|
|
166
|
+
sCoinMetadataId,
|
|
167
|
+
spoolName,
|
|
168
|
+
decimals,
|
|
142
169
|
};
|
|
143
170
|
|
|
144
171
|
await new Promise((resolve) => setTimeout(resolve, 500));
|