@betdexlabs/transactor
v0.1.1
Published
BetDEX Labs Solana Transactor
Downloads
74
Keywords
Readme
Transactor
Package for sending transactions on solana.
Env Variables
LOG_LEVEL
If not set, defaults to silent can be:
silentinfodebug
COMMITMENT_LEVEL
Set web3 commitment level for state of transaction. Defaults to confirmed if not set.
Send Transactions
Transactions can be sent either singularly or in batches. To send a transactions you must provide:
- provider
AnchorProvider - instructions
TransactionInstruction[] - transactionPriceOptions:
- computePrice: default price you wish to pay, will be used as a default
- heliusUrl (optional): if you wish to get the minimum suggested price from helius
- feeThreshold (optional): the minimum fee helius requires for processing
- transactionRetryOptions:
- retryInterval: how long to wait before resending a transaction (in ms)
- timeout (optional): how long to attempt sending transactions (in ms)
- maxRetries (optional): how many transactions you wish to attempt, it not set then transactions will continue to be attempted until the blockheight expires or timeout is reached
- batchSize (optional): for batched transactions, defaults to 10
Transaction Options
const priceOptions = {
computePrice: 5000,
heliusUrl:
"https://rpc.helius.xyz/?api-key=<API_KEY>",
feeThreshold: 10001 * 10 ** 6
};
const retryOptions = {
retryInterval: 1000,
timeout: 60000,
maxRetries: 100
};Response
The sendTransactionResponse type returns as much information as it can including meta data such as numberOfRetries, units and computePrice should this data be useful for internal metrics.
