File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,23 @@ npm install --save @streamr/config
14
14
### Typescript
15
15
Import DATA token production Ethereum address as a variable in a Typescript project:
16
16
``` typescript
17
+ import { Chains } from " @streamr/config"
18
+
19
+ const {
20
+ ethereum : {
21
+ id : chainId
22
+ contracts : {
23
+ " DATA-token" : dataTokenAddress
24
+ }
25
+ }
26
+ } = Chains .load (" production" )
27
+ ```
28
+
29
+ Find RPC endpoints:
30
+ ``` typescript
17
31
import * as config from " @streamr/config"
18
32
19
33
const chains: config .Chains = config .Chains .load (" production" )
20
- const contractAddress: string = chains .ethereum .contracts [" DATA-token" ]
21
- const chainId: number = chains .ethereum .id
22
34
const httpRpcEndpoints: RPCEndpoint [] = chains .ethereum .getRPCEndpointsByProtocol (config .RPCProtocol .HTTP )
23
35
const wsRpcEndpoints: RPCEndpoint [] = chains .ethereum .getRPCEndpointsByProtocol (config .RPCProtocol .WEBSOCKET )
24
36
```
You can’t perform that action at this time.
0 commit comments