Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor changes and fixes to Intro to Durable Nonces #570

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions content/guides/advanced/introduction-to-durable-nonces.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
date: 2024-06-29T00:00:00Z
difficulty: intermediate
difficulty: advanced
title: "Durable & Offline Transaction Signing using Nonces"
description:
"One-stop shop for Solana's Durable Nonces: an easy way to power your Solana
Expand Down Expand Up @@ -219,7 +219,7 @@ AkrQn5QWLACSP5EMT2R1ZHyKaGWVFrDHJ6NL89HKtwjQ
This is the base58 encoded hash that will be used in place of recent blockhashes
while signing a transaction.

### Displace Nonce Account
### Display Nonce Account

We can inspect the details of a Nonce Account in a prettier formatted version

Expand Down Expand Up @@ -479,19 +479,21 @@ Voila, we've gone through a very real-life use case of Durable Nonces. Now let's
see how to use them in transactions using JavaScript and the
[`@solana/web3.js`](https://solana-labs.github.io/solana-web3.js/) package.

## Durable Nonces with Solana `web3.js`
## Durable Nonces with Solana Web3.js

We'll use a similar example of making a simple transfer to demonstrate how to
send transactions using durable nonces.

### Create Nonce Authority
### Create Nonce Authority (Web3.js)

```ts
const nonceAuthKP = Keypair.generate();
// airdrop some SOL into this account from https://solfaucet.com/
```

### Create Nonce Accounts
_If you need SOL, you can use the
[faucet.solana.com](https://faucet.solana.com/)_ to get some.

### Create Nonce Accounts (Web3.js)

```ts
const nonceKeypair = Keypair.generate();
Expand Down Expand Up @@ -533,7 +535,7 @@ const sig = await sendAndConfirmRawTransaction(
console.log("Nonce initiated: ", sig);
```

### Fetch Initialised Nonce Account
### Fetch Nonce Account (Web3.js)

```ts
const accountInfo = await connection.getAccountInfo(nonceKeypair.publicKey);
Expand Down
Loading