@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 +12 -4
- package/cjs/packageInfo.js +1 -1
- package/package.json +1 -1
- package/packageInfo.js +1 -1
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
|
-
```
|
|
7
|
+
```ts
|
|
8
8
|
import { injectExtension } from '@subwallet/extension-inject';
|
|
9
9
|
|
|
10
|
-
//
|
|
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
|
|
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(
|
|
26
|
+
injectExtension(enable, { name: 'myExtension', version: '1.0.1' });
|
|
19
27
|
```
|
package/cjs/packageInfo.js
CHANGED
package/package.json
CHANGED
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.
|
|
10
|
+
version: '1.3.29-0'
|
|
11
11
|
};
|