Provider API reference
Methods
requestAccounts
Description
Connects to the user’s Phantom account.
Parameters
None
Response
Array of the connected user’s BtcAccount
objects.
BtcAccount response object properties
The Bitcoin address owned by the user.
The address’s format. For details, see Bitcoin Design Glossary.
A hex string representing the bytes of the public key of the account.
The general purpose of the address. If ordinals
, the user prefers to store Ordinals on this address. If payment
, the user prefers to store Bitcoin on this address.
signMessage
Description
Signs a message with the user’s Phantom account.
Parameters
The message to be signed.
One of the user’s addresses that should be used to sign the message.
Response
Object containing the signature.
signPSBT
Description
Signs a Partially-Signed Bitcoin Transaction (PSBT).
Parameters
A serialized PSBT.
Configuration options for signing the PSBT.
options parameters
An array containing the indexes of which transaction inputs to sign, and how to sign them.
Response
A serialized PSBT where the inputs belonging to the user’s account have been signed.
Events
accountsChanged
Description
The event that is emitted when a user changes their connected Phantom account.
Properties
The array of BtcAccount
objects of the newly connect Phantom account.
BtcAccount response object properties
The Bitcoin address owned by the user.
The address’s format. For details, see Bitcoin Design Glossary.
A hex string representing the bytes of the public key of the account.
The general purpose of the address. If ordinals
, the user prefers to store Ordinals on this address. If payment
, the user prefers to store Bitcoin on this address.