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

Several refactoring suggestions for the @solana/[email protected] implementation #10

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
660d590
Force all package resolutions to suitable canary release
steveluscher Aug 8, 2024
646d1e6
Make the RPC global to the application
steveluscher Aug 8, 2024
bdac4b9
Repair missing import of `isSolanaError`
steveluscher Aug 8, 2024
5a7cb98
Implement a blockhash fetcher as an AsyncIterator
steveluscher Aug 8, 2024
5c80154
Implement a slot fetcher as an AsyncIterator
steveluscher Aug 8, 2024
c3c9aed
Use `TransactionSigner#address` instead of computing the address from…
steveluscher Aug 8, 2024
13e34ce
Only create the base transaction once
steveluscher Aug 8, 2024
a94ee1c
Use signers API
steveluscher Aug 8, 2024
83fe4c0
Hoist factory creation up to global scope
steveluscher Aug 8, 2024
4e627bd
Replace transaction send-and-confirm with default implementation
steveluscher Aug 8, 2024
bd1e906
Sprinking dotenv configs where they need to go
steveluscher Oct 6, 2024
e425521
Move the stopwatch starter _after_ the slot fetcher
steveluscher Oct 6, 2024
c5e69b3
JSON.stringify no longer fatals when it encounters a `bigint`
steveluscher Oct 6, 2024
9d72a30
Keep the entire list of blockhashes in memory, and vend the latest _u…
steveluscher Oct 6, 2024
d00892b
Start exactly _one_ transaction confirmer, and a separate send retry …
steveluscher Oct 6, 2024
f98870b
Fetch the next slot by watching the trailing edge (completed) instead…
steveluscher Oct 8, 2024
e8d53b4
Prevent uncaught errors in the send-retry loop from bubbling up uncaught
steveluscher Oct 10, 2024
4acf40b
Fail the transaction loop when the blockhash expires
steveluscher Oct 15, 2024
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
Prev Previous commit
Next Next commit
Sprinking dotenv configs where they need to go
  • Loading branch information
steveluscher committed Oct 23, 2024
commit bd1e9065b55aa2526de3d26d76f264d5ce2fb68f
3 changes: 3 additions & 0 deletions utils/rpc.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import dotenv from 'dotenv';
import { createSolanaRpc, createSolanaRpcSubscriptions_UNSTABLE } from "@solana/web3.js";

dotenv.config();

export const rpc = createSolanaRpc(
process.env.RPC_ENDPOINT,
);
3 changes: 3 additions & 0 deletions utils/slot.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import dotenv from 'dotenv';
import { createCipheriv } from "crypto";
import { rpcSubscriptions } from "./rpc.mjs";

dotenv.config();

const MAX_SLOT_FETCH_ATTEMPTS = process.env.MAX_SLOT_FETCH_ATTEMPTS || 100;

let resolveSlotPromise;