@@ -93,15 +93,30 @@ To add `substrate-connect` to your application:
9393 npm i @polkadot/api
9494 ```
9595
96+ 1 . Finally install ` @substrate/connect ` package by running the appropriate command for the package manager you use.
97+
98+ For example, if you use ` yarn ` , run the following command:
99+
100+ ``` bash
101+ yarn add @substrate/connect
102+ ```
103+
104+ If you use ` npm ` as your package manager, run the following command:
105+
106+ ``` bash
107+ npm i @substrate/connect
108+ ```
109+
96110### Use the RPC provider to connect to a well-known network
97111
98112The following example illustrates how you can use the ` rpc-provider ` to connect to a well-known network such as Polkadot, Kusama, Westend, or Rococo.
99113
100114``` js
101115import { ScProvider , WellKnownChain } from " @polkadot/rpc-provider/substrate-connect" ;
116+ import * as Sc from " @substrate/connect" ;
102117import { ApiPromise } from " @polkadot/api" ;
103118// Create the provider for a known chain
104- const provider = new ScProvider (WellKnownChain .westend2 );
119+ const provider = new ScProvider (Sc, WellKnownChain .westend2 );
105120// Stablish the connection (and catch possible errors)
106121await provider .connect ();
107122// Create the PolkadotJS api instance
@@ -118,11 +133,12 @@ The following example illustrates how you can use the `rpc-provider` to connect
118133
119134``` js
120135import { ScProvider } from " @polkadot/rpc-provider/substrate-connect" ;
136+ import * as Sc from " @substrate/connect" ;
121137import { ApiPromise } from " @polkadot/api" ;
122138import jsonCustomSpec from " ./jsonCustomSpec.json" ;
123139// Create the provider for the custom chain
124140const customSpec = JSON .stringify (jsonCustomSpec);
125- const provider = new ScProvider (customSpec);
141+ const provider = new ScProvider (Sc, customSpec);
126142// Stablish the connection (and catch possible errors)
127143await provider .connect ();
128144// Create the PolkadotJS api instance
@@ -139,15 +155,16 @@ The following example illustrates how you can use the `rpc-provider` to connect
139155
140156``` js
141157import { ScProvider , WellKnownChain } from " @polkadot/rpc-provider/substrate-connect" ;
158+ import * as Sc from " @substrate/connect" ;
142159import { ApiPromise } from " @polkadot/api" ;
143160import jsonParachainSpec from " ./jsonParachainSpec.json" ;
144161// Create the provider for the relay chain
145- const relayProvider = new ScProvider (WellKnownChain .westend2 );
162+ const relayProvider = new ScProvider (Sc, WellKnownChain .westend2 );
146163// Create the provider for the parachain. Notice that
147164// we must pass the provider of the relay chain as the
148165// second argument
149166const parachainSpec = JSON .stringify (jsonParachainSpec);
150- const provider = new ScProvider (parachainSpec, relayProvider);
167+ const provider = new ScProvider (Sc, parachainSpec, relayProvider);
151168// Stablish the connection (and catch possible errors)
152169await provider .connect ();
153170// Create the PolkadotJS api instance
@@ -234,9 +251,9 @@ You can download the Chrome and Firefox extensions from [Substrate Connect](http
234251 It's meant to be quick and easy to use but less secure than other solutions.
235252 [ Github] ( https://github.com/paritytech/substrate-connect/tree/main/projects/burnr )
236253
237- - [ Multi-demo] ( https://paritytech.github.io/substrate-connect/demo/ )
254+ - [ Multi-chain demo] ( https://paritytech.github.io/substrate-connect/demo/ )
238255
239- Simple demo that covers multichain and parachain examples.
256+ A simple demo that covers multichain and parachain examples.
240257 [ Github] ( https://github.com/paritytech/substrate-connect/tree/main/projects/demo )
241258
242259## Brave browser WebSocket issue
0 commit comments