@scallop-io/sui-scallop-sdk 0.47.0-alpha.1 → 0.47.0-alpha.2
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/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/dist/index.mjs.map +1 -1
- package/dist/queries/coreQuery.d.ts +2 -2
- package/package.json +1 -1
- package/src/models/scallopClient.ts +1 -1
- package/src/models/scallopIndexer.ts +3 -3
- package/src/queries/coreQuery.ts +14 -9
|
@@ -101,10 +101,10 @@ export declare const getObligations: ({ address, }: {
|
|
|
101
101
|
* Query obligation locked status.
|
|
102
102
|
*
|
|
103
103
|
* @param query - The Scallop query instance.
|
|
104
|
-
* @param
|
|
104
|
+
* @param obligation - The obligation id or the obligation object.
|
|
105
105
|
* @return Obligation locked status.
|
|
106
106
|
*/
|
|
107
|
-
export declare const getObligationLocked: (cache: ScallopCache,
|
|
107
|
+
export declare const getObligationLocked: (cache: ScallopCache, obligation: string | SuiObjectData) => Promise<boolean>;
|
|
108
108
|
/**
|
|
109
109
|
* Query obligation data.
|
|
110
110
|
*
|
package/package.json
CHANGED
|
@@ -72,7 +72,7 @@ export class ScallopIndexer {
|
|
|
72
72
|
return await this._requestClient.get<{
|
|
73
73
|
pools: MarketPool[];
|
|
74
74
|
collaterals: MarketCollateral[];
|
|
75
|
-
}>(`/api/market`);
|
|
75
|
+
}>(`/api/market/migrate`);
|
|
76
76
|
},
|
|
77
77
|
});
|
|
78
78
|
|
|
@@ -149,7 +149,7 @@ export class ScallopIndexer {
|
|
|
149
149
|
queryFn: async () => {
|
|
150
150
|
return await this._requestClient.get<{
|
|
151
151
|
spools: Spool[];
|
|
152
|
-
}>(`/api/spools`);
|
|
152
|
+
}>(`/api/spools/migrate`);
|
|
153
153
|
},
|
|
154
154
|
});
|
|
155
155
|
|
|
@@ -187,7 +187,7 @@ export class ScallopIndexer {
|
|
|
187
187
|
queryFn: async () => {
|
|
188
188
|
return await this._requestClient.get<{
|
|
189
189
|
borrowIncentivePools: BorrowIncentivePool[];
|
|
190
|
-
}>(`/api/borrowIncentivePools`);
|
|
190
|
+
}>(`/api/borrowIncentivePools/migrate`);
|
|
191
191
|
},
|
|
192
192
|
});
|
|
193
193
|
|
package/src/queries/coreQuery.ts
CHANGED
|
@@ -768,24 +768,29 @@ export const getObligations = async (
|
|
|
768
768
|
* Query obligation locked status.
|
|
769
769
|
*
|
|
770
770
|
* @param query - The Scallop query instance.
|
|
771
|
-
* @param
|
|
771
|
+
* @param obligation - The obligation id or the obligation object.
|
|
772
772
|
* @return Obligation locked status.
|
|
773
773
|
*/
|
|
774
774
|
export const getObligationLocked = async (
|
|
775
775
|
cache: ScallopCache,
|
|
776
|
-
|
|
776
|
+
obligation: string | SuiObjectData
|
|
777
777
|
) => {
|
|
778
|
-
const obligationObjectResponse =
|
|
779
|
-
|
|
780
|
-
|
|
778
|
+
const obligationObjectResponse =
|
|
779
|
+
typeof obligation === 'string'
|
|
780
|
+
? (
|
|
781
|
+
await cache.queryGetObject(obligation, {
|
|
782
|
+
showContent: true,
|
|
783
|
+
})
|
|
784
|
+
)?.data
|
|
785
|
+
: obligation;
|
|
781
786
|
let obligationLocked = false;
|
|
782
787
|
if (
|
|
783
|
-
obligationObjectResponse
|
|
784
|
-
obligationObjectResponse?.
|
|
785
|
-
'lock_key' in obligationObjectResponse.
|
|
788
|
+
obligationObjectResponse &&
|
|
789
|
+
obligationObjectResponse?.content?.dataType === 'moveObject' &&
|
|
790
|
+
'lock_key' in obligationObjectResponse.content.fields
|
|
786
791
|
) {
|
|
787
792
|
obligationLocked = Boolean(
|
|
788
|
-
obligationObjectResponse.
|
|
793
|
+
obligationObjectResponse.content.fields.lock_key
|
|
789
794
|
);
|
|
790
795
|
}
|
|
791
796
|
|