@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.mjs CHANGED
@@ -394,7 +394,8 @@ import {
394
394
  var DEFAULT_CACHE_OPTIONS = {
395
395
  defaultOptions: {
396
396
  queries: {
397
- staleTime: 2e3
397
+ staleTime: 5e3,
398
+ gcTime: 5e3
398
399
  }
399
400
  }
400
401
  };
@@ -1045,6 +1046,10 @@ function withIndexerFallback(method) {
1045
1046
  var ScallopCache = class {
1046
1047
  constructor(suiKit, walletAddress, cacheOptions, tokenBucket, queryClient) {
1047
1048
  this.queryClient = queryClient ?? new QueryClient(cacheOptions ?? DEFAULT_CACHE_OPTIONS);
1049
+ if (queryClient && cacheOptions) {
1050
+ if (cacheOptions.defaultOptions)
1051
+ this.queryClient.setDefaultOptions(cacheOptions.defaultOptions);
1052
+ }
1048
1053
  this._suiKit = suiKit;
1049
1054
  this.tokenBucket = tokenBucket ?? new TokenBucket(DEFAULT_TOKENS_PER_INTERVAL, DEFAULT_INTERVAL_IN_MS);
1050
1055
  this.walletAddress = walletAddress ?? suiKit.currentAddress();