MCPcopy Create free account
hub / github.com/bitpay/bitcore / clearCache

Method clearCache

packages/bitcore-wallet-client/src/lib/api.ts:928–951  ·  view source on GitHub ↗
(
    opts?: {
      tokenAddress?: string;
    },
    /** @deprecated */
    cb?: (err?: Error, res?: any) => void
  )

Source from the content-addressed store, hash-verified

926 }
927
928 async clearCache(
929 opts?: {
930 tokenAddress?: string;
931 },
932 /** @deprecated */
933 cb?: (err?: Error, res?: any) => void
934 ) {
935 if (typeof opts === 'function') {
936 cb = opts;
937 opts = {};
938 }
939 if (cb) {
940 log.warn('DEPRECATED: clearCache will remove callback support in the future.');
941 }
942 try {
943 const qs = opts.tokenAddress ? `tokenAddress=${opts.tokenAddress}` : null;
944 const { body: result } = await this.request.post('/v1/clearcache/' + (qs ? '?' + qs : ''), {});
945 if (cb) { cb(null, result); }
946 return result;
947 } catch (err) {
948 if (cb) cb(err);
949 else throw err;
950 }
951 }
952
953 /**
954 * Get service version

Callers 2

cli.tsFile · 0.80
clearCacheFunction · 0.80

Calls 2

warnMethod · 0.80
postMethod · 0.80

Tested by

no test coverage detected