Initializes a new client.
(optional) base58 encoded PublicKey of wallet signing the swap transaction. If omitted the client will be able to fetch quotes but not to execute swaps.
Prepares a quote for on-chain execution.
to fetch ALT accounts & latestBlockhash
generated by SpurClient.quote
configure transaction failure in case the executed price differs from the quoted price by more than the configured fraction. Example value for 1%: 0.01.
OptionalpriorityLamports: bigint(optional) Fee paid to validators for block inclusion preference in lamports. If omitted a recent value is queried using SpurClient.getPriorityLamports("medium").
Optionalblockhash: Readonly<{ blockhash: string; lastValidBlockHeight: number }>(optional) Recent blockhash to limit transaction validity. If ommitted a recent value is queried using connection.getLatestBlockhash("finalized").
Fetch AddressLookupTableAccounts of a given quote either from a local cache or the provided Connection.
Executor instructions execute swap.
Fetch a recommended priority tip either from a local cache or the Spur API.
Fetch a fresh quote from the Spur API. The returned quote can be passed to SpurClient.swapInteractive to trigger interactive wallet signing with a Solana Wallet adapter compatible wallet and submit the transaction on-chain. Use SpurClient.swapNonInteractive for signing using a Keypair inside a server or cli application. To customize the transaction submission process, use SpurClient.compileSwap to generate a SpurCompiledSwap and familiarize yourself with the source code of the beforementioned methods.
u64 native atoms
base58 encoded PublicKey
base58 encoded PublicKey
Optionallimits: Limits(optional) customize the resource constraints of the swap transaction
Execute a swap for the given Quote using a Solana Wallet Adapter for generating signatures.
to fetch ALT accounts & latestBlockhash
generated by SpurClient.quote
configure transaction failure in case the executed price differs from the quoted price by more than the configured fraction. Example value for 1%: 0.01.
OptionalpriorityLamports: bigint(optional) Fee paid to validators for block inclusion preference in lamports. If omitted a recent value is queried using SpurClient.getPriorityLamports("medium").
signature of the swap transaction after it has been confirmed
Execute a swap for the given Quote using a Keypair for generating signatures.
to fetch ALT accounts & latestBlockhash
generated by SpurClient.quote
a solana/web3.js Keypair
configure transaction failure in case the executed price differs from the quoted price by more than the configured fraction. Example value for 1%: 0.01.
OptionalpriorityLamports: bigint(optional) Fee paid to validators for block inclusion preference in lamports. If omitted a recent value is queried using SpurClient.getPriorityLamports("medium").
signature of the swap transaction after it has been confirmed
Client to access the Spur API.
Start with fetching a quote using SpurClient.quote and execute a swap using SpurClient.swapInteractive in the browser using a Solana Wallet Adapter or SpurClient.swapNonInteractive in a server or cli application using a Keypair.