Skip to content

🛠 Solana Web3 Tools - A set of tools to improve the user experience on Web3 Solana Frontends.

Notifications You must be signed in to change notification settings

holaplex/solana-web3-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solana Web3 Tools

  • Insert nice art here.

Installation

$ yarn add @holaplex/solana-web3-tools

Usage

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}`);
        })
        .onFailure((err) => {
            console.error(`Error: ${err}`);
        })
        .onReSign((attempt, i) => {
            console.warn(`ReSigning: ${i} attempt: ${attempt}`);
        });
    await sender.send();
}

About

🛠 Solana Web3 Tools - A set of tools to improve the user experience on Web3 Solana Frontends.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published