@scallop-io/sui-scallop-sdk 1.3.0 → 1.3.1-alpha.1
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 +6 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/constants/cache.ts +2 -1
- package/src/models/scallopCache.ts +10 -6
package/dist/index.js
CHANGED
|
@@ -473,7 +473,8 @@ var import_sui_kit = require("@scallop-io/sui-kit");
|
|
|
473
473
|
var DEFAULT_CACHE_OPTIONS = {
|
|
474
474
|
defaultOptions: {
|
|
475
475
|
queries: {
|
|
476
|
-
staleTime:
|
|
476
|
+
staleTime: 5e3,
|
|
477
|
+
gcTime: 5e3
|
|
477
478
|
}
|
|
478
479
|
}
|
|
479
480
|
};
|
|
@@ -1124,6 +1125,10 @@ function withIndexerFallback(method) {
|
|
|
1124
1125
|
var ScallopCache = class {
|
|
1125
1126
|
constructor(suiKit, walletAddress, cacheOptions, tokenBucket, queryClient) {
|
|
1126
1127
|
this.queryClient = queryClient ?? new import_query_core.QueryClient(cacheOptions ?? DEFAULT_CACHE_OPTIONS);
|
|
1128
|
+
if (queryClient && cacheOptions) {
|
|
1129
|
+
if (cacheOptions.defaultOptions)
|
|
1130
|
+
this.queryClient.setDefaultOptions(cacheOptions.defaultOptions);
|
|
1131
|
+
}
|
|
1127
1132
|
this._suiKit = suiKit;
|
|
1128
1133
|
this.tokenBucket = tokenBucket ?? new TokenBucket(DEFAULT_TOKENS_PER_INTERVAL, DEFAULT_INTERVAL_IN_MS);
|
|
1129
1134
|
this.walletAddress = walletAddress ?? suiKit.currentAddress();
|