You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A very simple scaffolding browser extension that injects a [@polkadot/api](https://github.com/polkadot-js/api) Signer into a page, along with any associated accounts, allowing for use by any dapp. This is an extensible POC implementation of a Polkadot/Substrate browser signer. To support both
8
8
9
9
As it stands, it does one thing: it _only_ manages accounts and allows the signing of transactions with those accounts. It does not inject providers for use by dapps at this early point, nor does it perform wallet functions where it constructs and submits txs to the network.
10
10
11
11
## Installation
12
12
13
-
- On Chrome, install via [Chrome web store](https://chrome.google.com/webstore/detail/reefjs-extension/mjgkpalnahacmhkikiommfiomhjipgjn)
14
-
- On Firefox, install via [Firefox add-ons](https://addons.mozilla.org/en-US/firefox/addon/reef-js-extension/)
13
+
- On Chrome, install via [Chrome web store](https://chrome.google.com/webstore/detail/dustjs-extension/mjgkpalnahacmhkikiommfiomhjipgjn)
14
+
- On Firefox, install via [Firefox add-ons](https://addons.mozilla.org/en-US/firefox/addon/dust-js-extension/)
15
15
16
16
## Usage
17
-
To install the component, do `yarn add @reef-defi/extension-dapp`.
17
+
To install the component, do `yarn add @dust-defi/extension-dapp`.
A single file example (React) on how to use the extension can be seen in [ui-examples repo](https://github.com/reef-defi/ui-examples/blob/master/packages/example-react/src/index.tsx#L165).
60
+
A single file example (React) on how to use the extension can be seen in [ui-examples repo](https://github.com/dust-defi/ui-examples/blob/master/packages/example-react/src/index.tsx#L165).
61
61
62
62
To find out more about how to use the extension as a Dapp developer, cookbook, as well as answers to most frequent questions in the [Polkadot-js extension documentation](https://polkadot.js.org/docs/extension/)
63
63
64
64
65
-
## Transition from/support both `polkadot.js`/`reef.io wallet` extensions
66
-
It is possible to support both `reef.io wallet` as well as `polkadot.js` extension in your app. As long as you request the source extension of the injected account, the correct extension will be used to sign the transaction.
65
+
## Transition from/support both `polkadot.js`/`dust.io wallet` extensions
66
+
It is possible to support both `dust.io wallet` as well as `polkadot.js` extension in your app. As long as you request the source extension of the injected account, the correct extension will be used to sign the transaction.
67
67
68
-
### Change to `@reef-defi` dependencies
69
-
If you use `@polkadot/extension-dapp` dependencies, change them to `@reef-defi/extension-dapp` dependencies:
68
+
### Change to `@dust-defi` dependencies
69
+
If you use `@polkadot/extension-dapp` dependencies, change them to `@dust-defi/extension-dapp` dependencies:
70
70
71
-
1. change `@polkadot/extension-dapp` to `"@reef-defi/extension-dapp":"^"` in your `package.json`.
71
+
1. change `@polkadot/extension-dapp` to `"@dust-defi/extension-dapp":"^"` in your `package.json`.
72
72
2. call 'yarn
73
-
3. change the imports to `@reef-defi/extension*` wherever you use the imports from `@polkadot/extension*`.
73
+
3. change the imports to `@dust-defi/extension*` wherever you use the imports from `@polkadot/extension*`.
74
74
75
75
### Use `web3FromSource` to find the source extension for signing.
76
76
77
-
1. check where the extension signer is used. This is most likely where `Signer` is imported from `@reef-defi/evm-provider`.
77
+
1. check where the extension signer is used. This is most likely where `Signer` is imported from `@dust-defi/evm-provider`.
78
78
2. the signer for the account should be acquired dynamically. You have 2 options:
79
79
80
80
1. Change it to use `web3FromAddress(address: string)`:
81
81
82
82
```
83
-
import { web3FromAddress } from "@reef-defi/extension-dapp";
83
+
import { web3FromAddress } from "@dust-defi/extension-dapp";
@@ -128,7 +128,7 @@ If you use `@polkadot/extension-dapp` dependencies, change them to `@reef-defi/e
128
128
})
129
129
```
130
130
131
-
`accountSigner` can then be used in [`evm-provider`](https://github.com/reef-defi/evm-provider.js/commits/master) Signer to sign the messages, and the correct extension is used.
131
+
`accountSigner` can then be used in [`evm-provider`](https://github.com/dust-defi/evm-provider.js/commits/master) Signer to sign the messages, and the correct extension is used.
132
132
133
133
## Development version
134
134
@@ -146,9 +146,9 @@ Steps to build the extension and view your changes in a browser:
146
146
- check "Enable add-on debugging"
147
147
- click on "Load Temporary Add-on" and point to `packages/extension/build/manifest.json`
148
148
-if developing, after making changes - reload the extension
149
-
3. When visiting `console.reefscan.com` it will inject the extension
149
+
3. When visiting `console.dustscan.com` it will inject the extension
150
150
151
-
Once added, you can create an account (via a generated seed) or import via an existing seed. The [console UI](https://console.reefscan.com), when loaded, will show these accounts as `<account name> (extension)`
151
+
Once added, you can create an account (via a generated seed) or import via an existing seed. The [console UI](https://console.dustscan.com), when loaded, will show these accounts as `<account name> (extension)`
152
152
153
153
## Development
154
154
@@ -171,9 +171,9 @@ This approach is used to support multiple external signers in for instance [apps
171
171
172
172
The extension injection interfaces are generic, i.e. it is designed to allow any extension developer to easily inject extensions (that conforms to a specific interface) and at the same time, it allows for any dapp developer to easily enable the interfaces from multiple extensions at the same time. It is not an all-or-nothing approach, but rather it is an ecosystem where the user can choose which extensions fit their style best.
173
173
174
-
From a dapp developer perspective, the only work needed is to include the [@reef-defi/extension-dapp](packages/extension-dapp/) package and call the appropriate enabling function to retrieve all the extensions and their associated interfaces.
174
+
From a dapp developer perspective, the only work needed is to include the [@dust-defi/extension-dapp](packages/extension-dapp/) package and call the appropriate enabling function to retrieve all the extensions and their associated interfaces.
175
175
176
-
From an extension developer perspective, the only work required is to enable the extension via the razor-thin [@reef-defi/extension-inject](packages/extension-inject/) wrapper. Any dapp using the above interfaces will have access to the extension via this interface.
176
+
From an extension developer perspective, the only work required is to enable the extension via the razor-thin [@dust-defi/extension-inject](packages/extension-inject/) wrapper. Any dapp using the above interfaces will have access to the extension via this interface.
177
177
178
178
When there is more than one extension, each will populate an entry via the injection interface and each will be made available to the dapp. The `Injected` interface, as returned via `enable`, contains the following information for any compliant extension -
The information contained in this section may change and evolve. It is therefore recommended that all access is done via the [@reef-defi/extension-dapp](packages/extension-dapp/) (for dapps) and [@reef-defi/extension-inject](packages/extension-inject/) (for extensions) packages, which removes the need to work with the lower-level targets.
217
+
The information contained in this section may change and evolve. It is therefore recommended that all access is done via the [@dust-defi/extension-dapp](packages/extension-dapp/) (for dapps) and [@dust-defi/extension-inject](packages/extension-inject/) (for extensions) packages, which removes the need to work with the lower-level targets.
218
218
219
219
The extension injects `injectedWeb3` into the global `window` object, exposing the following: (This is meant to be generic across extensions, allowing any dapp to utilize multiple signers, and pull accounts from multiples, as they are available.)
220
220
221
221
```js
222
222
window.injectedWeb3= {
223
223
// this is the name for this extension, there could be multiples injected,
224
-
// each with their own keys, here `reef` is for this extension
225
-
'reef': {
224
+
// each with their own keys, here `dust` is for this extension
225
+
'dust': {
226
226
// semver for the package
227
227
version:'0.1.0',
228
228
@@ -243,7 +243,7 @@ window.injectedWeb3 = {
243
243
244
244
### Using the mnemonic and password from the extension
245
245
246
-
When you create a keypair via the extension, it supplies a 12-word mnemonic seed and asks you to create a password. This password only encrypts the private key on disk so that the password is required to spend funds in `console.reefscan.com` or to import the account from backup. The password does not protect the mnemonic phrase. That is, if an attacker were to acquire the mnemonic phrase, they would be able to use it to spend funds without the password.
246
+
When you create a keypair via the extension, it supplies a 12-word mnemonic seed and asks you to create a password. This password only encrypts the private key on disk so that the password is required to spend funds in `console.dustscan.com` or to import the account from backup. The password does not protect the mnemonic phrase. That is, if an attacker were to acquire the mnemonic phrase, they would be able to use it to spend funds without the password.
247
247
248
248
### Importing mnemonics from other key generation utilities
0 commit comments