Skip to content

Commit

Permalink
Merge pull request #10 from wmira/main
Browse files Browse the repository at this point in the history
fix docs for keyPair loading
  • Loading branch information
0xbigz authored Dec 28, 2023
2 parents ff2a68e + 06497d2 commit 76b5644
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,15 @@ The connection object is used to send transactions to the Solana blockchain. It
```typescript
import {Wallet, loadKeypair} from "@drift-labs/sdk";

const keyPairFile = '~/.config/solana/my-keypair.json';
const keyPairFile = `${process.env.HOME}/.config/solana/my-keypair.json`;
const wallet = new Wallet(loadKeypair(keyPairFile));
```
```python
import os
from anchorpy import Wallet
from driftpy.keypair import load_keypair

keypair_file = '~/.config/solana/my-keypair.json'
keypair_file = os.path.expanduser('~/.config/solana/my-keypair.json')
keypair = load_keypair(keypair_file)
wallet = Wallet(kp)
```
Expand All @@ -142,7 +143,7 @@ import {Wallet, loadKeypair, DriftClient} from "@drift-labs/sdk";
const connection = new Connection('https://api.mainnet-beta.solana.com');

const keyPairFile = '~/.config/solana/my-keypair.json';
const wallet = new Wallet(loadKeypair(privateKeyFile))
const wallet = new Wallet(loadKeypair(keyPairFile))

const driftClient = new DriftClient({
connection,
Expand Down

0 comments on commit 76b5644

Please sign in to comment.