Quick Access
Coin Methods
Solana
Miscellaneous
Methods
Solana
solanaGetPublicKey

Solana: get public key

Display requested public key derived by given BIP44 path on device and return it to the caller. User is presented with a description of the requested public key and asked to confirm the export on Trezor.

const result = await TrezorConnect.solanaGetPublicKey(params);

Params

Including CommonParams

GetPublicKey

showOnTrezor

Boolean

Optional

determines if public key will be displayed on device. Default is set to true

suppressBackupWarning

Boolean

Optional

By default, this method will emit an event to show a warning if the wallet does not have a backup. This option suppresses the message.

chunkify

Boolean

Optional

Display the result in chunks for better readability. Default is false

Bundle(GetPublicKey)

Example

Display public key of first Solana account:

TrezorConnect.solanaGetPublicKey({
    path: "m/44'/501'/0'/0'",
});

Return a bundle of Solana public keys without displaying them on device:

TrezorConnect.solanaGetPublicKey({
    bundle: [
        { path: "m/44'/501'/0'", showOnTrezor: false }, // account 1
        { path: "m/44'/501'/1'", showOnTrezor: false }, // account 2
        { path: "m/44'/501'/2'", showOnTrezor: false }, // account 3
    ],
});

Result

SolanaPublicKey type

Result with only one public key

{
    success: true,
    payload: {
        path: Array<number>, // hardended path
        serializedPath: string,
        publicKey: string,
    }
}

Result with a bundle of public keys

{
    success: true,
    payload: [
        { path: Array<number>, serializedPath: string, publicKey: string }, // account 1
        { path: Array<number>, serializedPath: string, publicKey: string }, // account 2
        { path: Array<number>, serializedPath: string, publicKey: string }  // account 3
    ]
}

Error

{
    success: false,
    payload: {
        error: string // error message
    }
}