@scallop-io/sui-scallop-sdk 1.4.8 → 1.4.9
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/common.d.ts +6 -6
- package/dist/constants/enum.d.ts +2 -2
- package/dist/constants/poolAddress.d.ts +1 -1
- package/dist/index.js +84 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +84 -38
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallopQuery.d.ts +13 -7
- package/dist/models/scallopUtils.d.ts +2 -2
- package/dist/queries/borrowIncentiveQuery.d.ts +2 -0
- package/dist/queries/coreQuery.d.ts +1 -0
- package/dist/queries/poolAddressesQuery.d.ts +2 -2
- package/dist/queries/portfolioQuery.d.ts +4 -3
- package/dist/queries/priceQuery.d.ts +2 -0
- package/dist/queries/sCoinQuery.d.ts +1 -1
- package/package.json +1 -1
- package/src/constants/coinGecko.ts +1 -0
- package/src/constants/common.ts +4 -1
- package/src/constants/enum.ts +38 -20
- package/src/constants/poolAddress.ts +47 -18
- package/src/constants/pyth.ts +1 -0
- package/src/constants/testAddress.ts +3 -0
- package/src/models/scallop.ts +1 -0
- package/src/models/scallopCache.ts +1 -1
- package/src/queries/poolAddressesQuery.ts +6 -5
package/src/models/scallop.ts
CHANGED
|
@@ -325,7 +325,7 @@ export class ScallopCache {
|
|
|
325
325
|
* @returns Promise<PaginatedObjectsResponse>
|
|
326
326
|
*/
|
|
327
327
|
public async queryGetOwnedObjects(input: GetOwnedObjectsParams) {
|
|
328
|
-
// TODO: This query need its own separate rate limiter (as owned objects can theoretically be infinite), need a better way to handle this
|
|
328
|
+
// @TODO: This query need its own separate rate limiter (as owned objects can theoretically be infinite), need a better way to handle this
|
|
329
329
|
return this.queryClient.fetchQuery({
|
|
330
330
|
retry: this.retryFn,
|
|
331
331
|
retryDelay: 1000,
|
|
@@ -20,7 +20,7 @@ export const getAllAddresses = async (query: ScallopQuery) => {
|
|
|
20
20
|
supplyLimitKey?: string;
|
|
21
21
|
borrowLimitKey?: string;
|
|
22
22
|
isolatedAssetKey?: string;
|
|
23
|
-
|
|
23
|
+
coinMetadataId?: string;
|
|
24
24
|
borrowIncentivePoolId?: string;
|
|
25
25
|
coinType?: string;
|
|
26
26
|
}
|
|
@@ -80,7 +80,8 @@ export const getAllAddresses = async (query: ScallopQuery) => {
|
|
|
80
80
|
},
|
|
81
81
|
})
|
|
82
82
|
)?.data?.objectId;
|
|
83
|
-
} catch (
|
|
83
|
+
} catch (e: any) {
|
|
84
|
+
console.error(e.message);
|
|
84
85
|
return undefined;
|
|
85
86
|
}
|
|
86
87
|
};
|
|
@@ -123,7 +124,7 @@ export const getAllAddresses = async (query: ScallopQuery) => {
|
|
|
123
124
|
// @ts-ignore
|
|
124
125
|
`scoin.coins.s${coinName}.treasury`
|
|
125
126
|
);
|
|
126
|
-
const
|
|
127
|
+
const coinMetadataId = query.address.get(
|
|
127
128
|
`core.coins.${coinName}.metaData`
|
|
128
129
|
);
|
|
129
130
|
results[coinName as SupportPoolCoins] = {
|
|
@@ -140,11 +141,11 @@ export const getAllAddresses = async (query: ScallopQuery) => {
|
|
|
140
141
|
spoolReward: rewardPool,
|
|
141
142
|
sCoinTreasury,
|
|
142
143
|
sCoinType,
|
|
143
|
-
|
|
144
|
+
coinMetadataId,
|
|
144
145
|
coinType: `0x${coinType}`,
|
|
145
146
|
};
|
|
146
147
|
|
|
147
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
148
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
148
149
|
})
|
|
149
150
|
);
|
|
150
151
|
|