A set of Web3 tools to improve the User Experience on Solana Frontends.
npm install @holaplex/solana-web3-tools- Insert nice art here.
``bash`
$ yarn add @holaplex/solana-web3-tools
`ts
import { SmartInstructionSender } from '@holaplex/solana-web3-tools';
const someMethod = async (
instructions: TransactionInstruction[][],
signers: Signer[][]
) => {
const sender = SmartInstructionSender
.build(wallet, connection)
.config({
maxSigningAttempts: 3,
abortOnFailure: true,
commitment: 'confirmed',
})
.withInstructionSets(instructions.map((ixs, i) => ({
instructions: ixs,
signers: signers[i]
})))
.onProgress((i) => {
console.log(Just sent: ${i});Error: ${err}
})
.onFailure((err) => {
console.error();ReSigning: ${i} attempt: ${attempt}
})
.onReSign((attempt, i) => {
console.warn();``
});
await sender.send();
}