export interface Wallet {
collateral: Promise<TxInput[]>
isMainnet(): Promise<boolean>
signData(
addr: ShelleyAddress<PubKeyHash>,
data: BytesLike
): Promise<{
key: PubKey
signature: Cip30CoseSign1
}>
signTx(tx: Tx): Promise<Signature[]>
stakingAddresses: Promise<StakingAddress[]>
submitTx(tx: Tx): Promise<TxId>
unusedAddresses: Promise<Address[]>
usedAddresses: Promise<Address[]>
utxos: Promise<TxInput[]>
}
An interface type for a wallet that manages a user's UTxOs and addresses.
Properties
collateral
collateral: Promise<TxInput[]>
Returns a list of utxos suitable for use as collateral
isMainnet
isMainnet(): Promise<boolean>
Returns
true
if the wallet is connected to the mainnet.
signData
signData(
addr: ShelleyAddress<PubKeyHash>,
data: BytesLike
): Promise<{
key: PubKey
signature: Cip30CoseSign1
}>
Signs a message, returning an object containing the Signature and PubKey that can be used to verify/authenticate the message later.
signTx
signTx(tx: Tx): Promise<Signature[]>
Signs a transaction, returning a list of signatures needed for submitting a valid transaction.
stakingAddresses
stakingAddresses: Promise<StakingAddress[]>
Returns a list of the reward addresses.
submitTx
submitTx(tx: Tx): Promise<TxId>
Submits a transaction to the blockchain and returns the id of that transaction upon success.
unusedAddresses
unusedAddresses: Promise<Address[]>
Returns a list of unique unused addresses which can be used to send UTxOs to with increased anonimity.
usedAddresses
usedAddresses: Promise<Address[]>
Returns a list of addresses which already contain UTxOs.
utxos
utxos: Promise<TxInput[]>
Returns a list of all the utxos controlled by the wallet.