Returns the wallet's public key encoded as Base58.
An object containing:
derivationPath
- Derivation paths segments that will be appended to m/44'/501'confirm
- Whether to show a confirm dialog.
Base58 encoded public key.
Example:
ethereum.request({
method: 'wallet_invokeSnap',
params: {
snapId: 'npm:@solflare-wallet/solana-snap',
request: {
method: 'getPublicKey',
params: {
derivationPath: [`0'`, `0'`],
confirm: true
}
}
}
});
Sign a transaction and return the signature encoded as Base58.
An object containing:
derivationPath
- Derivation paths segments that will be appended to m/44'/501'message
- Transaction message encoded as Base58
An object containing:
publicKey
- Base58 encoded public keysignature
- Transaction signature encoded as Base58
Example:
ethereum.request({
method: 'wallet_invokeSnap',
params: {
snapId: 'npm:@solflare-wallet/solana-snap',
request: {
method: 'signTransaction',
params: {
derivationPath: [`0'`, `0'`],
message: '...'
}
}
}
});
Sign multiple transactions and return the signatures encoded as Base58.
An object containing:
derivationPath
- Derivation paths segments that will be appended to m/44'/501'messages
- An array of transaction messages encoded as Base58
An object containing:
publicKey
- Base58 encoded public keysignatures
- An array of transaction signatures encoded as Base58
Example:
ethereum.request({
method: 'wallet_invokeSnap',
params: {
snapId: 'npm:@solflare-wallet/solana-snap',
request: {
method: 'signAllTransactions',
params: {
derivationPath: [`0'`, `0'`],
messages: ['...', '...']
}
}
}
});
Sign a message (can be either arbitrary bytes or a UTF-8 string) and return the signature encoded as Base58.
An object containing:
derivationPath
- Derivation paths segments that will be appended to m/44'/501'message
- Message encoded as Base58display
- How to decode and display the message,utf8
orhex
An object containing:
publicKey
- Base58 encoded public keysignature
- Message signature encoded as Base58
Example:
const bytes = new TextEncoder().encode('Lorem ipsum');
const base58Message = base58.encode(bytes);
ethereum.request({
method: 'wallet_invokeSnap',
params: {
snapId: 'npm:@solflare-wallet/solana-snap',
request: {
method: 'signMessage',
params: {
derivationPath: [`0'`, `0'`],
message: base58Message,
display: 'utf8'
}
}
}
});