CIP 30 support.
Opaque Wallet object to be used for all API requests.
Retrieve the descriptor associated with a [Wallet] object.
Retrieve the change address associated with a [Wallet] object.
Update the change address associated with a [Wallet] object.
Opaque type for requests to be sent to the wallets.
Encode a [Request] into a JS value that can be sent through a port.
Paginate requests that may return many elements.
Typically the first request you have to send, to discover which wallets are installed.
Will typically be followed by a response of the [AvailableWallets] variant containing a [WalletDescriptor] for each discovered wallet.
Enable an installed wallet.
Will typically be followed by a response of the [EnabledWallet] variant containing a [Wallet] to be stored in your model.
Optionally, you can watch for changes of the selected wallet at a regular interval (in seconds).
Each time, the wallet will check the current change address and notify with a ChangeAddress
API response if it has changed.
Get the list of extensions enabled by the wallet.
This feature isn't well supported yet by wallets (as of 2023-10).
Get the current network ID of the wallet.
Get a list of UTxOs in the wallet.
Get a list of UTxOs to be used for collateral.
You need to specify the amount of lovelace you need for collateral. More info about why that is in the CIP 30 spec.
Get the current wallet balance.
Get a list of used addresses from the wallet.
That list is wallet-dependent and may not contain all used addresses. Do not rely on this as a source of truth to get all addresses of a user.
Get a list of unused addresses.
Avoid this feature if possible. It is not consistent and not compatible with single-address wallets.
Get an address that can be used to send funds to this wallet.
Get addresses used to withdraw staking rewards.
Sign a transaction, already CBOR-encoded (to avoid deserialization-serialization mismatch).
Key type used for data signature.
Sign an arbitrary payload with your wallet keys. You can provide one of your payment or stake credential handled by the wallet.
Submit a transaction, already CBOR-encoded (to avoid deserialization-serialization mismatch).
Make a CIP-30 API request.
This is mainly a helper function, exposed for implementors of extensions, like CIP-95.
Response type for responses from the browser wallets.
Response type for all API requests done through the api
object returned when enabling a wallet.
UTxO type holding the reference and actual output.
Signature returned from the wallet after signing a payload with your stake key.
Decoder for the [Response] type.
API response decoder for CIP-30.
Intented to be provided as argument to the responseDecoder
function.
Decode UTxO pairs encoded as CBOR in a hex JSON field.
Helper function to decode CBOR as hex in JSON.
JSON decoder for an [Address] encoded as hexadecimal string.
Helper function to decode data signatures.
The type returned when asking for available wallets.