@kevinrodriguez-io/solana-web3-tools
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Solana Web3 Tools

  • Insert nice art here.

Installation

$ yarn add @kevinrodriguez-io/solana-web3-tools

Usage

import { SmartInstructionSender } from '@kevinrodriguez-io/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();
}

Package Sidebar

Install

npm i @kevinrodriguez-io/solana-web3-tools

Weekly Downloads

6

Version

0.2.0

License

AGPL-3.0-or-later

Unpacked Size

20.2 kB

Total Files

16

Last publish

Collaborators

  • kevinrodriguez-io