Skip to main content
Solana methods handle addresses, transactions, and public keys for the Solana blockchain.

solanaGetAddress

Retrieves a Solana address from the device.
path
string | number[]
required
BIP32 derivation path (e.g., m/44'/501'/0'/0').
address
string
Expected address for verification.
showOnTrezor
boolean
Display address on device screen.
chunkify
boolean
Split large requests into chunks.
address
string
Solana address (base58 encoded).
path
number[]
Derivation path as integer array.
serializedPath
string
Derivation path as string.
const result = await TrezorConnect.solanaGetAddress({
    path: "m/44'/501'/0'/0'",
    showOnTrezor: true,
});

if (result.success) {
    console.log('Solana address:', result.payload.address);
}

solanaGetPublicKey

Retrieves a Solana public key from the device.
path
string | number[]
required
BIP32 derivation path.
showOnTrezor
boolean
Display public key on device screen.
publicKey
string
Public key (hex).
publicKeyBase58
string
Public key (base58).
path
number[]
Derivation path.
serializedPath
string
Path as string.
const result = await TrezorConnect.solanaGetPublicKey({
    path: "m/44'/501'/0'/0'",
});

if (result.success) {
    console.log('Public key:', result.payload.publicKeyBase58);
}

solanaSignTransaction

Signs a Solana transaction. The transaction must be serialized and provided as a hex string.
path
string | number[]
required
BIP32 derivation path for signing key.
serializedTx
string
required
Serialized transaction (hex string).
additionalInfo
object
Additional transaction information for better device display.
serialize
boolean
Return serialized transaction.
chunkify
boolean
Split large transactions into chunks.
signature
string
Transaction signature (hex).
serializedTx
string
Serialized signed transaction (if serialize=true).
import { Transaction } from '@solana/web3.js';

// Create and serialize transaction
const transaction = new Transaction();
// ... add instructions

const serialized = transaction.serializeMessage().toString('hex');

const result = await TrezorConnect.solanaSignTransaction({
    path: "m/44'/501'/0'/0'",
    serializedTx: serialized,
    additionalInfo: {
        tokenAccountsInfos: [
            {
                baseAddress: 'base...',
                tokenProgram: 'Token...',
                tokenMint: 'mint...',
                tokenAccount: 'acc...',
                symbol: 'USDC',
            },
        ],
    },
});

if (result.success) {
    console.log('Signature:', result.payload.signature);
}

solanaComposeTransaction

Composes a Solana transaction, automatically handling token accounts and priority fees.
fromAddress
string
required
Sender’s address.
toAddress
string
Recipient’s address (required if serializedTx not provided).
amount
string
required
Amount to send (in lamports or token units).
blockHash
string
required
Recent block hash.
lastValidBlockHeight
number
required
Last valid block height.
priorityFees
object
Priority fee configuration.
token
object
SPL token transfer information.
serializedTx
string
Pre-serialized transaction (alternative to toAddress).
coin
string
Coin identifier.
identity
string
Device identity.
serializedTx
string
Serialized transaction ready for signing.
additionalInfo
object
Additional information about the composed transaction.
// SOL transfer
const result = await TrezorConnect.solanaComposeTransaction({
    fromAddress: 'sender...',
    toAddress: 'recipient...',
    amount: '1000000000', // 1 SOL
    blockHash: 'recent...',
    lastValidBlockHeight: 123456789,
    priorityFees: {
        computeUnitPrice: '1000',
        computeUnitLimit: '200000',
    },
});

// SPL Token transfer
const tokenResult = await TrezorConnect.solanaComposeTransaction({
    fromAddress: 'sender...',
    toAddress: 'recipient...',
    amount: '1000000', // 1 USDC (6 decimals)
    blockHash: 'recent...',
    lastValidBlockHeight: 123456789,
    token: {
        mint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
        program: 'spl-token',
        decimals: 6,
        accounts: [
            {
                publicKey: 'account...',
                balance: '5000000',
            },
        ],
    },
});

if (result.success) {
    console.log('Composed tx:', result.payload.serializedTx);
}

Build docs developers (and LLMs) love