-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip: broadcast claim tx to multiple rpcs * Fix endpoints env var parsing * Adjust tests to rpc broadcast * Use the first successful rpc provider result when waiting for the transaction submit results. Use the first one if none are found * Apply prettier * rebase multibroadcast onto feat/multiple-rpc * Refactor submitClaims signature back to return a single array for each ecosystem submit * Fix cancellation signal and max priority fee * Revert initial changes to tests * small bug fix * Update .env.sample * Add additional check for the fringe case of getting mixed responses from the rpcs * Add fallback ENDPOINT env variable * Apply prettier --------- Co-authored-by: chase-45 <chasemoran45@gmail.com>
- Loading branch information
Showing
9 changed files
with
207 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { clusterApiUrl } from '@solana/web3.js' | ||
|
||
const parseEndpoints = () => { | ||
let endpoints | ||
try { | ||
endpoints = JSON.parse(process.env.ENDPOINTS || process.env.ENDPOINT!) | ||
} catch (e) { | ||
// if parse fails, assume it's a single endpoint | ||
endpoints = [ | ||
process.env.ENDPOINTS || process.env.ENDPOINT || clusterApiUrl('devnet'), | ||
] | ||
} | ||
|
||
if (!Array.isArray(endpoints)) { | ||
throw new Error('ENDPOINTS must be an array') | ||
} | ||
|
||
return endpoints | ||
} | ||
|
||
const config = { | ||
ENDPOINTS: parseEndpoints(), | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters