CIP-30 Wallet interface.

interface CIP30Interface {
    getBalance(): Promise<string>;
    getChangeAddress(): Promise<string>;
    getCollateral(): Promise<string[]>;
    getNetworkId(): Promise<number>;
    getRewardAddresses(): Promise<string[]>;
    getUnusedAddresses(): Promise<string[]>;
    getUsedAddresses(): Promise<string[]>;
    getUtxos(): Promise<string[]>;
    signData(address: string, payload: string): Promise<{
        key: string;
        signature: string;
    }>;
    signTx(tx: string, partialSign: boolean): Promise<string>;
    submitTx(tx: string): Promise<string>;
}

Methods

  • Retrieves the total available balance of the wallet, encoded in CBOR.

    Returns Promise<string>

    • The balance of the wallet.
  • Retrieves an address owned by the wallet which should be used to return transaction change.

    Returns Promise<string>

    • The change address.
  • Retrieves all collateral UTXOs owned by the wallet.

    Returns Promise<string[]>

    • The hex-encoded CBOR bytes of the collateral UTXOs owned by the wallet.
  • Retrieves the network ID of the currently connected account.

    Returns Promise<number>

    • The network ID of the currently connected account.
  • Retrieves all reward addresses owned by the wallet.

    Returns Promise<string[]>

    • The reward addresses owned by the wallet.
  • Retrieves all unused addresses controlled by the wallet.

    Returns Promise<string[]>

    • The unused addresses controlled by the wallet.
  • Retrieves all used addresses controlled by the wallet.

    Returns Promise<string[]>

    • The used addresses controlled by the wallet.
  • Retrieves the unspent transaction outputs (UTXOs) controlled by the wallet.

    Returns Promise<string[]>

    • The UTXOs controlled by the wallet.
  • Request's a user's signature for a given payload conforming to the CIP-0008 signing spec

    Parameters

    • address: string

      The address to sign the payload with. The payment key is used for base, enterprise, and pointer addresses. The staking key is used for reward addresses.

    • payload: string

      The payload to sign.

    Returns Promise<{
        key: string;
        signature: string;
    }>

    • The hex-encoded CBOR bytes of the signature and public key parts of the signing-key.
  • Requests a user's signature for the unsigned portions of a transaction.

    Parameters

    • tx: string

      The transaction CBOR to sign

    • partialSign: boolean

      Whether a partial signature is permitted. If true, the wallet signs what it can. If false, the wallet must sign the full transaction.

    Returns Promise<string>

    • The signed transaction's witness set, CBOR-encoded.
  • Submits a signed transaction to the network.

    Parameters

    • tx: string

      The hex-encoded CBOR bytes of the transaction to submit.

    Returns Promise<string>

    • The transaction ID of the submitted transaction.