Skip to content

Commit

Permalink
Added "confirmed" commitment to new Connection examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lukecaan committed Oct 17, 2024
1 parent fd8b9b1 commit 7387aa3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions source/includes/_orderbook_blockchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This is the main source of orders for maintaing the orderbook.
import {Connection} from "@solana/web3.js";
import {DriftClient, UserMap, Wallet, loadKeypair} from "@drift-labs/sdk";

const connection = new Connection("https://api.mainnet-beta.solana.com");
const connection = new Connection("https://api.mainnet-beta.solana.com", 'confirmed');

const keyPairFile = `${process.env.HOME}/.config/solana/my-keypair.json`;
const wallet = new Wallet(loadKeypair(keyPairFile))
Expand Down Expand Up @@ -92,7 +92,7 @@ await user_map.subscribe()
import {Connection} from "@solana/web3.js";
import {DriftClient, OrderSubscriber, Wallet, loadKeypair} from "@drift-labs/sdk";

const connection = new Connection("https://api.mainnet-beta.solana.com");
const connection = new Connection("https://api.mainnet-beta.solana.com", 'confirmed');

const keyPairFile = `${process.env.HOME}/.config/solana/my-keypair.json`;
const wallet = new Wallet(loadKeypair(keyPairFile))
Expand Down
4 changes: 2 additions & 2 deletions source/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Use the self-hosted HTTP [gateway](https://github.com/drift-labs/gateway)
import {Connection} from "@solana/web3.js";

// the default RPC for devnet is `https://api.devnet.solana.com`
const connection = new Connection('https://api.mainnet-beta.solana.com');
const connection = new Connection('https://api.mainnet-beta.solana.com', 'confirmed');
```

```python
Expand Down Expand Up @@ -156,7 +156,7 @@ Make sure this wallet has some SOL first. SOL is used to pay for transactions an
import {Connection} from "@solana/web3.js";
import {Wallet, loadKeypair, DriftClient} from "@drift-labs/sdk";

const connection = new Connection('https://api.mainnet-beta.solana.com');
const connection = new Connection('https://api.mainnet-beta.solana.com', 'confirmed');

const keyPairFile = `${process.env.HOME}/.config/solana/my-keypair.json`;
const wallet = new Wallet(loadKeypair(keyPairFile))
Expand Down

0 comments on commit 7387aa3

Please sign in to comment.