🚀 DAY 1 OF LAUNCH WEEK: Reachability for Ruby Now in Beta.Learn more →
Socket
Book a DemoInstallSign in
Socket

@tensor-oss/ledger-solana-sdk

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tensor-oss/ledger-solana-sdk

NodeJS SDK to sign Solana txs with Ledger.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
2
Created
Source

ledger-solana-sdk

NodeJS SDK for signing Solana txs with Ledger.

Installation

npm i '@tensor-oss/ledger-solana-sdk'
yarn add '@tensor-oss/ledger-solana-sdk'

Usage

import { PublicKey, Transaction } from "@solana/web3.js";
import {
    solanaDerivationPath,
    solanaLedgerSignTx,
    Transport,
} from "@tensor-oss/ledger-solana-sdk";

// Lookup addresses corresponding to account + change index
const change = undefined; // most wallets leave this as undefined.
const transport = await Transport.default.open(undefined);
for (let account = 0; account < 10; account++) {
  const deriv = solanaDerivationPath(account, change);
  const pubkey = new PublicKey(solanaLedgerGetPubkey(transport, deriv));
  console.log(`pubkey for account ${account}: ${pubkey.toBase58()}`);
}

// Sign tx
const tx = new Transaction().add(...);
const ledgerAddr = new PublicKey("...");
const ledgerAcc = ...; // From above
const ledgerChange = ...; // From above
await solanaLedgerSignTx({
    tx,
    signer: ledgerAddr,
    account: ledgerAcc,
    change: ledgerChange
});

FAQs

Package last updated on 12 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts