Skip to main content

SimpleWallet

export interface SimpleWallet {
  address: ShelleyAddress<PubKeyHash>
  cardanoClient: CardanoClient
  collateral: Promise<TxInput<PubKeyHash>[]>
  isMainnet(): Promise<boolean>
  signData(
    addr: ShelleyAddress<PubKeyHash>,
    data: BytesLike
  ): Promise<{
    key: PubKey
    signature: Cip30CoseSign1
  }>
  signTx(tx: Tx): Promise<Signature[]>
  spendingPrivateKey: Bip32PrivateKey
  spendingPubKey: PubKey
  spendingPubKeyHash: PubKeyHash
  stakingAddress: undefined | StakingAddress
  stakingAddresses: Promise<StakingAddress[]>
  stakingPubKey: undefined | PubKey
  stakingPubKeyHash: undefined | PubKeyHash
  submitTx(tx: Tx): Promise<TxId>
  unusedAddresses: Promise<ShelleyAddress<PubKeyHash>[]>
  usedAddresses: Promise<ShelleyAddress<PubKeyHash>[]>
  utxos: Promise<TxInput<PubKeyHash>[]>
}

Properties​

address​

address: ShelleyAddress<PubKeyHash>

cardanoClient​

cardanoClient: CardanoClient

collateral​

collateral: Promise<TxInput<PubKeyHash>[]>
Don't define any collateral, let the TxBuilder use the regular inputs

isMainnet​

isMainnet(): Promise<boolean>

signData​

signData(
  addr: ShelleyAddress<PubKeyHash>,
  data: BytesLike
): Promise<{
  key: PubKey
  signature: Cip30CoseSign1
}>
This method has the same interface as the Cip30Wallet.signData() method, using either the spendingCredential pubKey or the stakingCredential pubKey depending on which address is given.

signTx​

signTx(tx: Tx): Promise<Signature[]>
Simply assumes the tx needs to by signed by this wallet without checking.

spendingPrivateKey​

spendingPrivateKey: Bip32PrivateKey

spendingPubKey​

spendingPubKey: PubKey

spendingPubKeyHash​

spendingPubKeyHash: PubKeyHash

stakingAddress​

stakingAddress: undefined | StakingAddress

stakingAddresses​

stakingAddresses: Promise<StakingAddress[]>

stakingPubKey​

stakingPubKey: undefined | PubKey

stakingPubKeyHash​

stakingPubKeyHash: undefined | PubKeyHash

submitTx​

submitTx(tx: Tx): Promise<TxId>

unusedAddresses​

unusedAddresses: Promise<ShelleyAddress<PubKeyHash>[]>
Returns an empty list

usedAddresses​

usedAddresses: Promise<ShelleyAddress<PubKeyHash>[]>
Assumed wallet was initiated with at least 1 UTxO at the pubkeyhash address.

utxos​

utxos: Promise<TxInput<PubKeyHash>[]>