Skip to content

Commit 77482bd

Browse files
Pessinamariavarvaroi
authored andcommitted
Fix sol docs
1 parent 5fa6ea9 commit 77482bd

File tree

5 files changed

+19
-15
lines changed

5 files changed

+19
-15
lines changed

book/build-your-staking-dapp/solana/methods.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const { tx } = await staker.buildWithdrawStakeTx({
8080

8181
Here, we are withdrawing all SOL from a stake account to the wallet owner's address.
8282

83-
To withdraw a specifc amount pass the `amount` arugment.
83+
To withdraw a specific amount pass the `amount` argument.
8484

8585
- [Read more in the API Reference](../../docs/classes/solana_src.SolanaStaker.md#buildwithdrawstaketx)
8686

@@ -137,11 +137,11 @@ Here, we are merging a source account stake into a different destination account
137137

138138
---
139139

140-
## buildSplitStakesTx
140+
## buildSplitStakeTx
141141

142142
### Description
143143

144-
The `buildSplitStakesTx` method allows you to split one stake account into two separate accounts.
144+
The `buildSplitStakeTx` method allows you to split one stake account into two separate accounts.
145145

146146
### How to Use
147147

@@ -150,7 +150,7 @@ To build a split stake transaction, you will need to provide the owner's address
150150
### Example
151151

152152
```javascript
153-
const { tx } = await staker.buildSplitStakesTx({
153+
const { tx } = await staker.buildSplitStakeTx({
154154
ownerAddress: '3Ps2hwsgGMSuqxAwjcGJHiEpMsSTZcxrCGprHgxWkfma',
155155
stakeAccountAddress: 'HJRL5PTpvwxmt796M7xDavRbPkjN28iGPVBkJn9y6rYE',
156156
amount: '1' // 1 SOL
@@ -159,7 +159,7 @@ const { tx } = await staker.buildSplitStakesTx({
159159

160160
Here, we are substracting 1 SOL from the source stake account and transferring into a newly created stake account.
161161

162-
- [Read more in the API Reference](../../docs/classes/solana_src.SolanaStaker.md#buildsplitstakestx)
162+
- [Read more in the API Reference](../../docs/classes/solana_src.SolanaStaker.md#buildsplitstaketx)
163163

164164
---
165165

@@ -173,23 +173,23 @@ The `getStake` method retrieves the staking information from a delegator.
173173

174174
### How to Use
175175

176-
To get staking information, you need to provide the delegator's address (your wallet), and optionally the validator's address. If the validator's address is not provided, the method returns rewards from all validators.
176+
To get staking information, you need to provide the owner's address (your wallet), and optionally the validator's address. If the validator's address is not provided, the method returns balance from all validators.
177177

178-
You can also specify the status of the staker. Default is 'active'.
178+
You can also specify the state of the stake accounts. Default is 'delegated'.
179179

180180
### Example
181181

182182
```javascript
183183
import { CHORUS_ONE_SOLANA_VALIDATOR } from '@chorus-one/solana'
184184

185185
const { balance } = await staker.getStake({
186-
delegatorAddress: '3Ps2hwsgGMSuqxAwjcGJHiEpMsSTZcxrCGprHgxWkfma'
186+
ownerAddress: '3Ps2hwsgGMSuqxAwjcGJHiEpMsSTZcxrCGprHgxWkfma',
187187
validatorAddress: CHORUS_ONE_SOLANA_VALIDATOR
188188
})
189189
console.log(`Staked balance: ${balance}`)
190190
```
191191

192-
In this example, we're retrieving the staked balance for a given delegator and validator.
192+
In this example, we're retrieving the staked balance for a given owner and validator.
193193

194194
- [Read more in the API Reference](../../docs/classes/solana_src.SolanaStaker.md#getstake)
195195

book/build-your-staking-dapp/solana/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The `SolanaStaker` class provides methods to build transactions for staking, uns
6868

6969
```javascript
7070
const { tx, stakeAccountAddress } = await staker.buildStakeTx({
71-
delegatorAddress: '3Ps2hwsgGMSuqxAwjcGJHiEpMsSTZcxrCGprHgxWkfma',
71+
ownerAddress: '3Ps2hwsgGMSuqxAwjcGJHiEpMsSTZcxrCGprHgxWkfma',
7272
validatorAddress: 'Chorus6Kis8tFHA7AowrPMcRJk3LbApHTYpgSNXzY5KE',
7373
amount: '1' // 1 SOL
7474
})

book/signers-explained/local.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Let's look at what these two key concepts are below:
1313
- **addressDerivationFn**: A function that derives the address from the public key, implementing the `AddressDerivationFn` type and provided by Staker classes as static methods, e.g. `SolanaStaker.getAddressDerivationFn`, `NearStaker.getAddressDerivationFn`, etc.
1414

1515
```typescript
16-
type AddressDerivationFn = (publicKey: Uint8Array, hdPath: string) => Array<string>
16+
type AddressDerivationFn = (publicKey: Uint8Array, hdPath: string) => Promise<Array<string>>
1717
```
1818
1919
{% hint style="info" %}
@@ -29,10 +29,12 @@ With your mnemonic and HD path ready, you can now configure and initialize the L
2929
```javascript
3030
import { SolanaStaker } from '@chorus-one/solana'
3131
import { LocalSigner } from '@chorus-one/signer-local'
32+
import { KeyType } from '@chorus-one/signer'
3233

3334
const signer = new LocalSigner({
3435
mnemonic: 'your-mnemonic-phrase',
3536
accounts: [{ hdPath: 'your-hd-path' }],
37+
keyType: KeyType.ED25519,
3638
addressDerivationFn: SolanaStaker.getAddressDerivationFn()
3739
})
3840

packages/signer-local/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ Here is a basic example of how to configure and initialize the LocalSigner:
2121
```javascript
2222
import { SolanaStaker } from '@chorus-one/solana';
2323
import { LocalSigner } from '@chorus-one/signer-local';
24+
import { KeyType } from '@chorus-one/signer';
2425

2526
const signer = new LocalSigner({
2627
mnemonic: 'your-mnemonic-phrase',
27-
accounts: [{ hdPath: 'your-hd-path' }]
28+
accounts: [{ hdPath: 'your-hd-path' }],
29+
keyType: KeyType.ED25519,
2830
addressDerivationFn: SolanaStaker.getAddressDerivationFn()
2931
});
3032

packages/solana/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ await staker.init()
3333
// Building the transaction
3434
// ------------------------
3535

36-
const delegatorAddress = '3Ps2hwsgGMSuqxAwjcGJHiEpMsSTZcxrCGprHgxWkfma'
36+
const ownerAddress = '3Ps2hwsgGMSuqxAwjcGJHiEpMsSTZcxrCGprHgxWkfma'
3737

3838
// You can use the Chorus One validator address or specify your own
3939
const validatorAddress = CHORUS_ONE_SOLANA_VALIDATOR
4040

4141
const { tx } = await staker.buildStakeTx({
42-
delegatorAddress,
42+
ownerAddress,
4343
validatorAddress,
4444
amount: '1' // 1 SOL
4545
})
@@ -54,7 +54,7 @@ await signer.init()
5454

5555
const { signedTx } = await staker.sign({
5656
signer,
57-
signerAddress: delegatorAddress,
57+
signerAddress: ownerAddress,
5858
tx
5959
})
6060

0 commit comments

Comments
 (0)