Skip to main content
Version: 3.0.0

Provider API reference

Properties

publicKey

publicKey: PublicKey | null

The PublicKey of the connected user account.

isConnected

isConnected: boolean

If true, the user account has established a connection. Otherwise, false.

Methods

connect

connect(): Promise<void>

Connects the user’s wallet.

If successful, sets the isConnected property to true, and sets the publicKey property to the user’s public key.

disconnect

disconnect(): Promise<void>

Disconnects the user’s wallet.

If successful, sets the isConnected property to false, and sets the publicKey property to null.

info

This method does not disconnect the dapp from the wallet under Settings > Dapp Connections.

sendTransaction

sendTransaction(transaction: Transaction, options?: SendOptions): Promise<{ signature: string }>

Sends a transaction.

Returns a Promise for an object containing the signature.

info

SendOptions can be specified as a optional second argument.

Parameters

NameTypeDescription
transactionTransactionThe transaction to send.
options (optional)SendOptionsOptions for sending transactions.

signAllTransactions

signAllTransactions(transactions: Transaction[]): Promise<Transaction[]>

Signs a list of transactions.

Returns a Promise for the list of signed transactions.

Parameters

NameTypeDescription
transactionsTransaction[]The list of transactions to sign.

signAndSendTransaction

signAndSendTransaction(transaction: Transaction, options?: SendOptions): Promise<{ signature: string }>

Signs and sends a transaction.

Returns a Promise for an object containing the signature.

info

SendOptions can be specified as a optional second argument.

Parameters

NameTypeDescription
transactionTransactionThe transaction to sign and send.
options (optional)SendOptionsOptions for sending transactions.

signMessage

signMessage(message: Uint8Array): Promise<{ signature: Uint8Array}>

Signs a message.

Returns a Promise for an object containing the signature.

Parameters

NameTypeDescription
messageUint8ArrayThe message to sign.

signTransaction

signTransaction(transaction: Transaction): Promise<Transaction>

Signs a transaction.

Returns a Promise for the signed transaction.

Parameters

NameTypeDescription
transactionTransactionThe transaction to sign.

Was this helpful?