(
opts?: {
tokenAddress?: string;
},
/** @deprecated */
cb?: (err?: Error, res?: any) => void
)
| 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 |
no test coverage detected