Provider API
The Oyl Connect Provider API allows DApps to interact with the Oyl wallet, enabling them to request account information, sign messages and transactions, and broadcast transactions to the network.
isConnected
Used to check if the current site origin is connected to the wallet.
Response
boolean
Example
disconnect
Used to disconnect the current site origin from the wallet.
Example
getAddresses
Returns all the addresses and the public keys of the current account.
Params
None
Response
Promise - object
taproot - object
address - string
publicKey - string
nativeSegwit - object
address - string
publicKey - string
nestedSegwit - object
address - string
publicKey - string
legacy
address - string
publicKey - string
Example
getBalance
Returns the balance of all the addresses of the current account.
Params
None
Response
Promise - object
confirmed - number: confirmed amount in sats
unconfirmed - number: unconfirmed amount in sats
total - number: total amount in sats
Example
signMessage
Sign a message using BIP322 or ECDSA
Params
Object
address - string: address to be used for signing
message - string: message to be signed
protocol - string (optional) "bip322" | "ecdsa": the protocol to be used for signing — the default value is "bip322".
Response
Promise - object
address - string: address used to sign the message
signature - string: signing result
Example
signPsbt
Sign a partially signed bitcoin transaction (PSBT).
This method will use all the addresses of the current account to sign the inputs.
Params
Object
psbt - string: hexadecimal representation of the partially signed bitcoin transaction (PSBT) to be signed
finalize - boolean (optional): whether to finalize the PSBT after signing — the default is true
broadcast - boolean (optional): whether to broadcast the transaction after signing — the default is false
Response
Promise - object
psbt - string: hexadecimal representation of the signed PSBT
txid - string (optional): ID of the transaction that was broadcasted if the broadcast option was enabled
Example
pushPsbt
Broadcast a signed PSBT transaction.
Params
Object
psbt - string: hexadecimal representation of the PSBT transaction to be broadcasted
Response
Promise - object
txid - string: ID of the transaction that was broadcasted
Example
Last updated