Skip to content

Commit cdc0acb

Browse files
committed
Update PK example fromwallet
1 parent 094238a commit cdc0acb

File tree

1 file changed

+7
-8
lines changed
  • docs/pages/interaction/permissioned-keys

1 file changed

+7
-8
lines changed

docs/pages/interaction/permissioned-keys/index.mdx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ On the dYdX.trade, after signing in with your wallet or socials:
3434

3535
### Create an authenticator
3636

37-
Alternativaly, you can create a custom authenticator which allows only the **trader** to place orders.
37+
Alternatively, you can create a custom authenticator which allows only the **trader** to place orders.
3838

3939
To create this authenticator, we use two sub-authenticators: `signatureVerification` and `messageFilter`:
4040
- the `signatureVerification` authenticator must be present in all authenticator sets and contains the **trader**'s public key;
@@ -194,21 +194,20 @@ client
194194

195195
### Get the authenticator ID and permissioned API Key
196196

197-
Grab the authenticator ID created by the **owner** in [Add authenticator](/interaction/permissioned-keys#add-the-authenticator), either by:
198-
- request the **owner** for the authenticator ID or by using the list authenticators method to fetch the to be used authenticator (see [list authenticators](/interaction/permissioned-keys#last-authenticators)).
199-
- Get the private key from the owner in [via the Trade Interface](/interaction/permissioned-keys#get-the-private-key).
197+
Grab the `authenticatorId` created by the **owner** in [Add authenticator](/interaction/permissioned-keys#add-the-authenticator), either by:
198+
- request the **owner** for the `authenticatorId` or by using the list authenticators method to fetch the to be used authenticator (see [list authenticators](/interaction/permissioned-keys#last-authenticators)).
199+
- Get the private key `DYDX_TEST_PRIVATE_KEY` from the owner in [via the Trade Interface](/interaction/permissioned-keys#get-the-private-key).
200200

201201

202202
### Setup the permissioned wallet
203203
If you got a private key from the trading interface load in via `fromPrivateKey`, otherwise use `fromMnemonic` if you didn't create via the trading interface by assigning to mnemonic.
204204

205205
```typescript
206206
const fromWallet = await LocalWallet.fromPrivateKey(DYDX_TEST_PRIVATE_KEY, BECH32_PREFIX);
207-
const fromSubaccount = SubaccountInfo.forLocalWallet(fromWallet, 0);
208207
const authenticatedSubaccount = SubaccountInfo.forPermissionedWallet(
209-
fromAccount.signingWallet,
210-
address,
211-
subaccountNumber,
208+
fromWallet,
209+
address, //owner dydx address
210+
subaccountNumber, //subaccount to trade onbehalf of
212211
[authenticatorId],
213212
)
214213
```

0 commit comments

Comments
 (0)