@subwallet/extension-inject 1.3.28-1 → 1.3.29-0

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/README.md CHANGED
@@ -4,16 +4,24 @@ This is a basic extension injector that manages access to the global objects ava
4
4
 
5
5
  ## Usage
6
6
 
7
- ```js
7
+ ```ts
8
8
  import { injectExtension } from '@subwallet/extension-inject';
9
9
 
10
- // this a the function that will be exposed to be callable by the dapp. It resolves a promise
10
+ // This a the function that will be exposed to be callable by the dapp. It resolves a promise
11
11
  // with the injected interface, (see `Injected`) when the dapp at `originName` (url) is allowed
12
12
  // to access functionality
13
- function enableFn (originName: string): Promise<Injected> {
13
+ function enable (originName: string, option?: AuthRequestOption ): Promise<Injected> {
14
14
  ...
15
15
  }
16
16
 
17
+ // Additionally, this function provides an options parameter
18
+ // that allows DApps to actively request the desired address type of the unified account,
19
+ // including substrate format, evm format, or both.
20
+ interface AuthRequestOption {
21
+ accountAuthType: 'substrate' | 'both' | 'evm';
22
+ }
23
+
24
+
17
25
  // injects the extension into the page
18
- injectExtension(enableFn, { name: 'myExtension', version: '1.0.1' });
26
+ injectExtension(enable, { name: 'myExtension', version: '1.0.1' });
19
27
  ```
@@ -13,6 +13,6 @@ const packageInfo = {
13
13
  name: '@subwallet/extension-inject',
14
14
  path: typeof __dirname === 'string' ? __dirname : 'auto',
15
15
  type: 'cjs',
16
- version: '1.3.28-1'
16
+ version: '1.3.29-0'
17
17
  };
18
18
  exports.packageInfo = packageInfo;
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "sideEffects": true,
16
16
  "type": "module",
17
- "version": "1.3.28-1",
17
+ "version": "1.3.29-0",
18
18
  "main": "./cjs/index.js",
19
19
  "module": "./index.js",
20
20
  "types": "./index.d.ts",
package/packageInfo.js CHANGED
@@ -7,5 +7,5 @@ export const packageInfo = {
7
7
  name: '@subwallet/extension-inject',
8
8
  path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
9
9
  type: 'esm',
10
- version: '1.3.28-1'
10
+ version: '1.3.29-0'
11
11
  };