Contents

dumpCoinsread-only#

Dump all coins of the wallet in a simple JSON format.

Request:

This operation takes no arguments (an empty object).

Response:

On success, the result is a CoinDumpJson object.

interface CoinDumpJson {
  coins: Array<{
    // The coin's denomination's public key.
    denomPub: DenominationPubKey;

    // Hash of denom_pub.
    denomPubHash: string;

    // Value of the denomination (without any fees).
    denomValue: string;

    // Public key of the coin.
    coinPub: string;

    // Base URL of the exchange for the coin.
    exchangeBaseUrl: string;

    // Public key of the parent coin.
    // Only present if this coin was obtained via refreshing.
    refreshParentCoinPub: string | undefined;

    // Public key of the reserve for this coin.
    // Only present if this coin was obtained via withdrawal.
    withdrawalReservePub: string | undefined;

    // Status of the coin.
    coinStatus: CoinStatus;

    // Information about the age restriction.
    ageCommitmentProof: AgeCommitmentProof | undefined;

    history: WalletCoinHistoryItem[];
  }>;
}
type CoinStatus =
  // Withdrawn and never shown to anybody.
  | "fresh"
  // Coin was lost as the denomination is not usable anymore.
  | "denom-loss"
  // Fresh, but marked as suspended, thus won't be used for spending.
  | "fresh-suspended"
  // A coin that has been spent and refreshed.
  | "dormant";
type WalletCoinHistoryItem =
  | {
      type: "withdraw";
      transactionId: TransactionIdStr;
    }
  | {
      type: "spend";
      transactionId: TransactionIdStr;
      amount: AmountString;
    }
  | {
      type: "refresh";
      transactionId: TransactionIdStr;
      amount: AmountString;
    }
  | {
      type: "recoup";
      transactionId: TransactionIdStr;
      amount: AmountString;
    }
  | {
      type: "refund";
      transactionId: TransactionIdStr;
      amount: AmountString;
    };