@scallop-io/sui-scallop-sdk 1.4.17 → 1.4.18
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 +16 -10
- package/dist/index.js +154 -88
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +154 -88
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallopQuery.d.ts +6 -0
- package/dist/queries/poolAddressesQuery.d.ts +6 -0
- package/package.json +1 -1
- package/src/constants/poolAddress.ts +197 -121
- package/src/queries/poolAddressesQuery.ts +23 -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,8 @@ export const getAllAddresses = async (query: ScallopQuery) => {
|
|
|
23
27
|
coinMetadataId?: string;
|
|
24
28
|
borrowIncentivePoolId?: string;
|
|
25
29
|
coinType?: string;
|
|
30
|
+
sCoinMetadataId?: string;
|
|
31
|
+
spoolName?: string;
|
|
26
32
|
}
|
|
27
33
|
>
|
|
28
34
|
> = {};
|
|
@@ -116,6 +122,12 @@ export const getAllAddresses = async (query: ScallopQuery) => {
|
|
|
116
122
|
);
|
|
117
123
|
// @ts-ignore
|
|
118
124
|
const sCoinType = query.address.get(`scoin.coins.s${coinName}.coinType`);
|
|
125
|
+
const sCoinName = sCoinType
|
|
126
|
+
? query.utils.parseSCoinName(coinName)
|
|
127
|
+
: undefined;
|
|
128
|
+
const sCoinSymbol = sCoinName
|
|
129
|
+
? query.utils.parseSymbol(sCoinName)
|
|
130
|
+
: undefined;
|
|
119
131
|
const sCoinTreasury = query.address.get(
|
|
120
132
|
// @ts-ignore
|
|
121
133
|
`scoin.coins.s${coinName}.treasury`
|
|
@@ -123,7 +135,14 @@ export const getAllAddresses = async (query: ScallopQuery) => {
|
|
|
123
135
|
const coinMetadataId = query.address.get(
|
|
124
136
|
`core.coins.${coinName}.metaData`
|
|
125
137
|
);
|
|
138
|
+
const sCoinMetadataId = query.address.get(
|
|
139
|
+
// @ts-ignore
|
|
140
|
+
`scoin.coins.s${coinName}.metaData`
|
|
141
|
+
);
|
|
142
|
+
const spoolName = spool ? `s${coinName}` : undefined;
|
|
126
143
|
results[coinName as SupportPoolCoins] = {
|
|
144
|
+
coinName,
|
|
145
|
+
symbol: query.utils.parseSymbol(coinName),
|
|
127
146
|
lendingPoolAddress: addresses[0],
|
|
128
147
|
collateralPoolAddress: addresses[1],
|
|
129
148
|
borrowDynamic: addresses[2],
|
|
@@ -137,8 +156,12 @@ export const getAllAddresses = async (query: ScallopQuery) => {
|
|
|
137
156
|
spoolReward: rewardPool,
|
|
138
157
|
sCoinTreasury,
|
|
139
158
|
sCoinType,
|
|
159
|
+
sCoinName,
|
|
160
|
+
sCoinSymbol,
|
|
140
161
|
coinMetadataId,
|
|
141
162
|
coinType: `0x${coinType}`,
|
|
163
|
+
sCoinMetadataId,
|
|
164
|
+
spoolName,
|
|
142
165
|
};
|
|
143
166
|
|
|
144
167
|
await new Promise((resolve) => setTimeout(resolve, 500));
|