This file contains hidden or 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
| export async function getPriorityFeeEstimateForIxs( | |
| ixs: TransactionInstruction[], | |
| priorityLevel: PriorityConfigLevel = PriorityConfigLevel.NORMAL, | |
| ): Promise<number | null> { | |
| try { | |
| const heliusPriorityLevel: string = (() => { | |
| switch (priorityLevel) { | |
| case PriorityConfigLevel.NORMAL: | |
| return 'Medium' | |
| case PriorityConfigLevel.HIGH: |
This file contains hidden or 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
| use reqwest::Client; | |
| use serde_json::json; | |
| use solana_client::{ | |
| client_error::{ClientError, ClientErrorKind, Result as ClientResult}, | |
| nonblocking::rpc_client::RpcClient, | |
| rpc_config::RpcSimulateTransactionConfig, | |
| }; | |
| use solana_program::instruction::Instruction; | |
| use solana_sdk::{ | |
| commitment_config::CommitmentConfig, |
This file contains hidden or 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
| export async function newTxWithComputeAndPriorityFees( | |
| ixs: TransactionInstruction[], | |
| userWallet: string, | |
| lookupTables?: AddressLookupTableAccount[], | |
| ): Promise<Transaction> { | |
| const ixsWithComputeAndPriorityFees = await prependComputeAndPriorityFees( | |
| ixs, | |
| userWallet, | |
| lookupTables, | |
| ) |
This file contains hidden or 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
| const data = await axios.post( | |
| 'http://localhost:3001/api/dev/transactions/buySingleListing', | |
| { | |
| nftMint: 'E2Lo6nxNC6bGP1JZHTsce4ebVCn3cE6uDagbmhvUoit', | |
| wallet_address: 'BGQDmkQDrxZjNiUHCsSZYuKP4XJMfoJ6AXtmJh7CaxLH', | |
| }, | |
| ) | |
| const reconstructedInstructions = reconstructTransactionInstructions( | |
| data.data as JsonTransactionInstruction[], | |
| ) |
NewerOlder