@yeying-community/web3-bs 1.0.10 → 1.0.11

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.
@@ -300,6 +300,25 @@
300
300
  requestAccountsInFlight.delete(provider);
301
301
  }
302
302
  }
303
+ async function focusPendingApproval(provider) {
304
+ const p = provider || (await requireProvider());
305
+ const result = await p.request({
306
+ method: 'wallet_focusPendingApproval',
307
+ });
308
+ if (!result || typeof result !== 'object') {
309
+ return { focused: false, type: null };
310
+ }
311
+ const payload = result;
312
+ return {
313
+ focused: Boolean(payload.focused),
314
+ type: typeof payload.type === 'string' ? payload.type : null,
315
+ requestId: typeof payload.requestId === 'string' ? payload.requestId : null,
316
+ origin: typeof payload.origin === 'string' ? payload.origin : '',
317
+ tabId: typeof payload.tabId === 'number' && Number.isFinite(payload.tabId)
318
+ ? payload.tabId
319
+ : null,
320
+ };
321
+ }
303
322
  async function getAccounts(provider) {
304
323
  const p = provider || (await requireProvider());
305
324
  const accounts = (await p.request({ method: 'eth_accounts' }));
@@ -2189,6 +2208,7 @@
2189
2208
  exports.createWebDavClient = createWebDavClient;
2190
2209
  exports.deriveAppIdFromHost = deriveAppIdFromHost;
2191
2210
  exports.deriveAppIdFromLocation = deriveAppIdFromLocation;
2211
+ exports.focusPendingApproval = focusPendingApproval;
2192
2212
  exports.getAccessToken = getAccessToken;
2193
2213
  exports.getAccounts = getAccounts;
2194
2214
  exports.getBalance = getBalance;