Update README.md
This commit is contained in:
parent
d06091807b
commit
363660c00a
31
README.md
31
README.md
|
@ -5,5 +5,32 @@ typsecript client for https://github.com/blockworks-foundation/voter-stake-regis
|
||||||
# development
|
# development
|
||||||
node version v16.13.1
|
node version v16.13.1
|
||||||
|
|
||||||
## TODO:
|
# installation
|
||||||
publish npm package under @blockworks-foundation
|
|
||||||
|
```
|
||||||
|
|
||||||
|
yarn add @blockworks-foundation/voter-stake-registry-client
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
# usage
|
||||||
|
|
||||||
|
```
|
||||||
|
import { Provider, Wallet } from '@project-serum/anchor';
|
||||||
|
import { Connection, Keypair } from '@solana/web3.js';
|
||||||
|
import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
const options = Provider.defaultOptions();
|
||||||
|
const connection = new Connection('https://api.devnet.solana.com', options);
|
||||||
|
const wallet = new Wallet(Keypair.generate());
|
||||||
|
const provider = new Provider(connection, wallet, options);
|
||||||
|
const client = await VsrClient.connect(provider, true);
|
||||||
|
|
||||||
|
<img width="708" alt="image" src="https://user-images.githubusercontent.com/89031858/148725238-646198da-133b-4f13-af02-b48647073b7e.png">
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
||||||
|
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in New Issue