SolanaSigner

Defined in: account-kit/signer/src/solanaSigner.ts:18

The SolanaSigner class is used to sign transactions and messages for the Solana blockchain. It provides methods to add signatures to transactions and sign messages.

Constructors

Constructor

1new SolanaSigner(client): SolanaSigner;

Defined in: account-kit/signer/src/solanaSigner.ts:27

Constructor for the SolanaSigner class which is a wrapper around the alchemy client, and is more focused on the solana web3

Parameters

ParameterTypeDescription

client

BaseSignerClient

This is the client that will be used to sign the transaction, and we are just having functions on top of it.

Returns

SolanaSigner

Properties

PropertyType

address

string

alchemyClient

BaseSignerClient

Methods

addSignature()

1addSignature(transaction): Promise<Transaction | VersionedTransaction>;

Defined in: account-kit/signer/src/solanaSigner.ts:41

Adds a signature of the client user to a transaction

Parameters

ParameterTypeDescription

transaction

Transaction | VersionedTransaction

The transaction to add the signature to

Returns

Promise<Transaction | VersionedTransaction>

The transaction with the signature added


addSponsorship()

1addSponsorship(
2 instructions,
3 connection,
4 policyId?): Promise<VersionedTransaction>;

Defined in: account-kit/signer/src/solanaSigner.ts:158

Adds sponsorship to a transaction. Used to have a party like Alchemy pay for the transaction.

Parameters

ParameterTypeDescription

instructions

TransactionInstruction[]

The instructions to add to the transaction

connection

Connection

The connection to use for the transaction

policyId?

string

The policy ID to add sponsorship to

Returns

Promise<VersionedTransaction>

The transaction with sponsorship added


createTransaction()

Creates a transfer transaction. Used for the SolanaCard example.

Param

The instructions to add to the transaction

Param

The connection to use for the transaction

Param

The version of the transaction

Call Signature

1createTransaction(
2 instructions,
3 connection,
4 version?): Promise<VersionedTransaction>;

Defined in: account-kit/signer/src/solanaSigner.ts:92

Parameters
ParameterType

instructions

TransactionInstruction[]

connection

Connection

version?

"versioned"

Returns

Promise<VersionedTransaction>

Call Signature

1createTransaction(
2 instructions,
3 connection,
4 version?): Promise<Transaction>;

Defined in: account-kit/signer/src/solanaSigner.ts:97

Parameters
ParameterType

instructions

TransactionInstruction[]

connection

Connection

version?

"legacy"

Returns

Promise<Transaction>

Call Signature

1createTransaction(instructions, connection): Promise<VersionedTransaction>;

Defined in: account-kit/signer/src/solanaSigner.ts:102

Parameters
ParameterType

instructions

TransactionInstruction[]

connection

Connection

Returns

Promise<VersionedTransaction>


signMessage()

1signMessage(message): Promise<ByteArray>;

Defined in: account-kit/signer/src/solanaSigner.ts:73

Signs a message

Parameters

ParameterTypeDescription

message

Uint8Array

The message to sign

Returns

Promise<ByteArray>

The signature of the message