Wallet-Core API Documentation

Contents

20.6. Wallet-Core API Documentation#

This file is auto-generated from the taler-typescript-core repository.

20.6.1. Overview#

20.6.1.1. Initialization#

20.6.1.2. Generic request handling#

20.6.1.3. Donau#

20.6.1.4. Contacts#

20.6.1.5. Taldir#

20.6.1.6. Mailbox#

20.6.1.7. Basic Wallet Information#

20.6.1.8. Managing Transactions#

20.6.1.9. Withdrawals#

20.6.1.10. Merchant Payments#

20.6.1.11. Token family management#

20.6.1.12. Global Currency management#

20.6.1.13. Exchange Management#

20.6.1.14. Deposits#

20.6.1.15. Backups#

20.6.1.16. Peer Payments#

20.6.1.17. Data Validation and Conversion#

20.6.1.18. Database Management#

20.6.1.19. Testing and Debugging#

20.6.2. Operation Reference#

20.6.2.1. InitWalletOp#

/**
 * Initialize wallet-core.
 *
 * Must be the first request made to wallet-core.
 */
export type InitWalletOp = {
  op: WalletApiOperation.InitWallet;
  request: InitRequest;
  response: InitResponse;
};
// InitWallet = "initWallet"

20.6.2.2. ShutdownOp#

export type ShutdownOp = {
  op: WalletApiOperation.Shutdown;
  request: EmptyObject;
  response: EmptyObject;
};
// Shutdown = "shutdown"

20.6.2.3. HintApplicationResumedOp#

/**
 * Give wallet-core a kick and restart all pending tasks.
 * Useful when the host application gets suspended and resumed,
 * and active network requests might have stalled.
 */
export type HintApplicationResumedOp = {
  op: WalletApiOperation.HintApplicationResumed;
  request: EmptyObject;
  response: HintApplicationResumedResponse;
};
// HintApplicationResumed = "hintApplicationResumed"

export interface HintApplicationResumedResponse {
  dbWriteHealthy: boolean;
  dbReadHealthy: boolean;
}

20.6.2.4. SetWalletRunConfigOp#

/**
 * Change the configuration of wallet-core.
 *
 * Currently an alias for the initWallet request.
 */
export type SetWalletRunConfigOp = {
  op: WalletApiOperation.SetWalletRunConfig;
  request: InitRequest;
  response: InitResponse;
};
// SetWalletRunConfig = "setWalletRunConfig"

20.6.2.5. GetVersionOp#

export type GetVersionOp = {
  op: WalletApiOperation.GetVersion;
  request: EmptyObject;
  response: WalletCoreVersion;
};
// GetVersion = "getVersion"

20.6.2.6. HintNetworkAvailabilityOp#

export type HintNetworkAvailabilityOp = {
  op: WalletApiOperation.HintNetworkAvailability;
  request: HintNetworkAvailabilityRequest;
  response: EmptyObject;
};
// HintNetworkAvailability = "hintNetworkAvailability"

export interface HintNetworkAvailabilityRequest {
  isNetworkAvailable: boolean;
}

20.6.2.7. HintPowerStateOp#

/** Report a current power observation. Unknown power never enables free opportunistic refresh. */
export type HintPowerStateOp = {
  op: WalletApiOperation.HintPowerState;
  request: HintPowerStateRequest;
  response: EmptyObject;
};
// HintPowerState = "hintPowerState"

export interface HintPowerStateRequest {
  powerSource: WalletPowerSource;
}
/** Host observation; unknown never qualifies for an opportunistic refresh. */
export declare enum WalletPowerSource {
  External = "external",
  Battery = "battery",
  Unknown = "unknown",
}

20.6.2.8. DismissWalletWarningOp#

/** Dismiss a completed renewal notice. Active expiration risks cannot be dismissed. */
export type DismissWalletWarningOp = {
  op: WalletApiOperation.DismissWalletWarning;
  request: DismissWalletWarningRequest;
  response: EmptyObject;
};
// DismissWalletWarning = "dismissWalletWarning"

export interface DismissWalletWarningRequest {
  warningId: string;
}

20.6.2.9. RetryProgressTokenNowOp#

export type RetryProgressTokenNowOp = {
  op: WalletApiOperation.RetryProgressTokenNow;
  request: RetryProgressTokenNowRequest;
  response: EmptyObject;
};
// RetryProgressTokenNow = "retryProgressTokenNow"

export interface RetryProgressTokenNowRequest {
  operation: string;
  progressToken: string;
}

20.6.2.10. CancelProgressTokenOp#

export type CancelProgressTokenOp = {
  op: WalletApiOperation.CancelProgressToken;
  request: CancelProgressTokenRequest;
  response: EmptyObject;
};
// CancelProgressToken = "cancelProgressToken"

export interface CancelProgressTokenRequest {
  operation: string;
  progressToken: string;
}

20.6.2.11. SetDonauOp#

/**
 * Set the donation authority for this wallet.
 */
export type SetDonauOp = {
  op: WalletApiOperation.SetDonau;
  request: SetDonauRequest;
  response: EmptyObject;
};
// SetDonau = "setDonau"

export interface SetDonauRequest {
  donauBaseUrl: string;
  taxPayerId: string;
}

20.6.2.12. GetDonauOp#

/**
 * Get the currently configured donation authority for this
 * wallet.
 */
export type GetDonauOp = {
  op: WalletApiOperation.GetDonau;
  request: EmptyObject;
  response: GetDonauResponse;
};
// GetDonau = "getDonau"

export interface GetDonauResponse {
  currentDonauInfo:
    | {
        donauBaseUrl: string;
        taxPayerId: string;
      }
    | undefined;
}

20.6.2.13. GetDonauStatementsOp#

/**
 * Get a list of donation statements
 * for this wallet.
 * Both donation statements for the currently configured
 * donation authority as well as past configurations (if they exist)
 * are returned.
 */
export type GetDonauStatementsOp = {
  op: WalletApiOperation.GetDonauStatements;
  request: GetDonauStatementsRequest;
  response: GetDonauStatementsResponse;
};
// GetDonauStatements = "getDonauStatements"

export interface GetDonauStatementsRequest {
  donauBaseUrl?: string;
}
export interface GetDonauStatementsResponse {
  statements: DonauStatementItem[];
}
export interface DonauStatementItem {
  total: AmountString;
  year: number;
  legalDomain: string;
  uri: string;
  donationStatementSig: EddsaSignatureString;
  donauPub: EddsaPublicKeyString;
}

20.6.2.14. AddContactOp#

/**
 * add contact.
 */
export type AddContactOp = {
  op: WalletApiOperation.AddContact;
  request: AddContactRequest;
  response: EmptyObject;
};
// AddContact = "addContact"

export interface AddContactRequest {
  contact: ContactEntry;
}

20.6.2.15. DeleteContactOp#

/**
 * delete contact.
 */
export type DeleteContactOp = {
  op: WalletApiOperation.DeleteContact;
  request: DeleteContactRequest;
  response: EmptyObject;
};
// DeleteContact = "deleteContact"

export interface DeleteContactRequest {
  contact: ContactEntry;
}

20.6.2.16. GetContactsOp#

/**
 * Get contacts.
 */
export type GetContactsOp = {
  op: WalletApiOperation.GetContacts;
  request: EmptyObject;
  response: ContactListResponse;
};
// GetContacts = "getContacts"

export interface ContactListResponse {
  contacts: ContactEntry[];
}

20.6.2.17. RegisterAliasOp#

/**
 * Register alias
 */
export type RegisterAliasOp = {
  op: WalletApiOperation.RegisterAlias;
  request: TaldirRegistrationRequest;
  response: TaldirRegistrationResponse;
};
// RegisterAlias = "registerAlias"

export interface TaldirRegistrationRequest {
  alias: string;
  aliasType: string;
  targetUri: string;
  taldirBaseUrl: string;
  duration: RelativeTime;
}
export type TaldirRegistrationResponse =
  | TaldirAlreadyPaidResponse
  | EmptyObject;
export interface TaldirAlreadyPaidResponse {
  valid_for: RelativeTime;
}

20.6.2.18. CompleteRegisterAliasOp#

/**
 * Complete alias registration
 */
export type CompleteRegisterAliasOp = {
  op: WalletApiOperation.CompleteRegisterAlias;
  request: TaldirRegistrationCompletionRequest;
  response: EmptyObject;
};
// CompleteRegisterAlias = "completeRegisterAlias"

export interface TaldirRegistrationCompletionRequest {
  alias: string;
  aliasType: string;
  challenge: string;
  taldirBaseUrl: string;
  targetUri: string;
}

20.6.2.19. LookupAliasOp#

/**
 * Lookup alias
 */
export type LookupAliasOp = {
  op: WalletApiOperation.LookupAlias;
  request: TaldirLookupRequest;
  response: TaldirLookupResponse;
};
// LookupAlias = "lookupAlias"

export interface TaldirLookupRequest {
  alias: string;
  aliasType: string;
  taldirBaseUrl: string;
}
export interface TaldirLookupResponse {
  targetUri?: string;
}

20.6.2.20. RefreshMailboxOp#

/**
 * Refresh mailbox Op.
 */
export type RefreshMailboxOp = {
  op: WalletApiOperation.RefreshMailbox;
  request: MailboxConfiguration;
  response: MailboxMessageRecordsResponse;
};
// RefreshMailbox = "refreshMailbox"

export interface MailboxMessageRecordsResponse {
  messages: MailboxMessageRecord[];
}

20.6.2.21. InitializeMailboxOp#

/**
 * Initialize messages mailbox Op.
 */
export type InitializeMailboxOp = {
  op: WalletApiOperation.InitializeMailbox;
  request: MailboxBaseUrl;
  response: MailboxConfiguration;
};
// InitializeMailbox = "initializeMailbox"

20.6.2.22. GetMailboxOp#

/**
 * Get messages mailbox Op.
 */
export type GetMailboxOp = {
  op: WalletApiOperation.GetMailbox;
  request: MailboxBaseUrl;
  response: GetMailboxResponse;
};
// GetMailbox = "getMailbox"

export interface GetMailboxResponse {
  mailboxConfiguration?: MailboxConfiguration;
}

20.6.2.23. GetMailboxMessagesOp#

/**
 * Get Messages Op.
 */
export type GetMailboxMessagesOp = {
  op: WalletApiOperation.GetMailboxMessages;
  request: EmptyObject;
  response: MailboxMessagesResponse;
};
// GetMailboxMessages = "getMailboxMessage"

export interface MailboxMessagesResponse {
  messages: MailboxMessageRecord[];
}

20.6.2.24. DeleteMailboxMessageOp#

/**
 * delete message.
 */
export type DeleteMailboxMessageOp = {
  op: WalletApiOperation.DeleteMailboxMessage;
  request: DeleteMailboxMessageRequest;
  response: EmptyObject;
};
// DeleteMailboxMessage = "deleteMailboxMessage"

export interface DeleteMailboxMessageRequest {
  message: MailboxMessageRecord;
}

20.6.2.25. AddMailboxMessageOp#

/**
 * add message.
 */
export type AddMailboxMessageOp = {
  op: WalletApiOperation.AddMailboxMessage;
  request: AddMailboxMessageRequest;
  response: EmptyObject;
};
// AddMailboxMessage = "addMailboxMessage"

export interface AddMailboxMessageRequest {
  message: MailboxMessageRecord;
}

20.6.2.26. SendTalerUriMailboxMessageOp#

/**
 * send message.
 */
export type SendTalerUriMailboxMessageOp = {
  op: WalletApiOperation.SendTalerUriMailboxMessage;
  request: SendTalerUriMailboxMessageRequest;
  response: EmptyObject;
};
// SendTalerUriMailboxMessage = "sendTalerUriMailboxMessage"

export interface SendTalerUriMailboxMessageRequest {
  contact: ContactEntry;
  talerUri: string;
}

20.6.2.27. GetBalancesOp#

/**
 * Get current wallet balance.
 */
export type GetBalancesOp = {
  op: WalletApiOperation.GetBalances;
  request: EmptyObject;
  response: BalancesResponse;
};
// GetBalances = "getBalances"

/**
 * Response to a getBalances request.
 */
export interface BalancesResponse {
  /** Electronic cash balances, per currency scope. */
  balances: WalletBalance[];
  /** Does the user have money from an exchange other than demo or test? */
  haveProdBalance: boolean;
  donauSummary?: DonauSummaryItem[];
}
export interface WalletBalance {
  /** True when this scope contains funds at risk of expiration. */
  hasExpirationRisk?: boolean;
  scopeInfo: ScopeInfo;
  available: AmountString;
  pendingIncoming: AmountString;
  pendingOutgoing: AmountString;
  flags: BalanceFlag[];
  /**
   * Available URLs for pages that list
   * where money in this scope can be spent.
   */
  shoppingUrls?: string[];
  /**
   * Are p2p payments disabled for this scope?
   */
  disablePeerPayments?: boolean;
  /**
   * Are wallet deposits enabled for this scope?
   */
  disableDirectDeposits?: boolean;
}
export declare enum BalanceFlag {
  IncomingKyc = "incoming-kyc",
  IncomingAml = "incoming-aml",
  IncomingConfirmation = "incoming-confirmation",
  OutgoingKyc = "outgoing-kyc",
}
export interface DonauSummaryItem {
  /** Base URL of the donau service. */
  donauBaseUrl: string;
  /** Legal domain of the donau service (if available). */
  legalDomain?: string;
  /** Year of the donation(s). */
  year: number;
  /**
   * Sum of donation receipts we received from merchants in the
   * applicable year.
   */
  amountReceiptsAvailable: AmountString;
  /**
   * Sum of donation receipts that were already submitted
   * to the donau in the applicable year.
   */
  amountReceiptsSubmitted: AmountString;
  /**
   * Amount of the latest available statement. Missing if no statement
   * was requested yet.
   */
  amountStatement?: AmountString;
}

20.6.2.28. GetBalanceRefreshInfoOp#

export interface BalanceRefreshInfoRequest {
  scopeInfo: ScopeInfo;
}
export type GetBalanceRefreshInfoOp = {
  op: WalletApiOperation.GetBalanceRefreshInfo;
  request: BalanceRefreshInfoRequest;
  response: WalletRefreshInfo | null;
};
// GetBalanceRefreshInfo = "getBalanceRefreshInfo"

export interface WalletRefreshInfo {
  risks: CashExpirationRisk[];
  recoveries: CashRenewalNotice[];
  annualCostBound: AnnualRefreshCostBound;
}
export interface CashExpirationRisk {
  exchangeBaseUrl: string;
  exchangeMasterPub: string;
  amount: AmountString;
  earliestDepositExpiration: TalerProtocolTimestamp;
  reason:
    | "pending"
    | "connectivity"
    | "exchange-error"
    | "no-replacement"
    | "checking"
    | "invalid-lifetime";
}
export interface CashRenewalNotice {
  warningId: string;
  exchangeBaseUrl: string;
  exchangeMasterPub: string;
  amount: AmountString;
  oldDepositExpiration: TalerProtocolTimestamp;
  newDepositExpiration: TalerProtocolTimestamp;
  /** Earliest emergency threshold of the renewed coins. */
  nextRelevantDate: TalerProtocolTimestamp;
}
/** Conditional on stable, continuously available compatible offerings and timely reveal. */
export type AnnualRefreshCostBound = {
  horizonDays: 365;
  projection: "stable-current-offerings";
} & (
  | {
      status: "available";
      amount: AmountString;
    }
  | {
      status: "unavailable";
      reasons: string[];
    }
);

20.6.2.29. ObserveBalanceRefreshInfoOp#

export type ObserveBalanceRefreshInfoOp = {
  op: WalletApiOperation.ObserveBalanceRefreshInfo;
  request: ObserveBalanceRefreshInfoRequest;
  response: EmptyObject;
};
// ObserveBalanceRefreshInfo = "observeBalanceRefreshInfo"

export interface ObserveBalanceRefreshInfoRequest
  extends BalanceRefreshInfoRequest {
  observationId: string;
}

20.6.2.30. GetBalancesDetailOp#

export type GetBalancesDetailOp = {
  op: WalletApiOperation.GetBalanceDetail;
  request: GetBalanceDetailRequest;
  response: PaymentBalanceDetails;
};
// GetBalanceDetail = "getBalanceDetail"

export interface GetBalanceDetailRequest {
  currency: string;
}
export interface PaymentBalanceDetails {
  /**
   * Balance of type "available" (see balance.ts for definition).
   */
  balanceAvailable: AmountJson;
  /**
   * Balance of type "material" (see balance.ts for definition).
   */
  balanceMaterial: AmountJson;
  /**
   * Balance of type "age-acceptable" (see balance.ts for definition).
   */
  balanceAgeAcceptable: AmountJson;
  /**
   * Balance of type "receiver-acceptable" (see balance.ts for definition).
   *
   * @deprecated (2025-12-05) use balanceReceiver[...]Acceptable instead.
   */
  balanceReceiverAcceptable: AmountJson;
  /**
   * Balance of type "receiver-exchange-url-acceptable" (see balance.ts for definition).
   */
  balanceReceiverExchangeUrlAcceptable: AmountJson;
  /**
   * Balance of type "receiver-exchange-pub-acceptable" (see balance.ts for definition).
   */
  balanceReceiverExchangePubAcceptable: AmountJson;
  /**
   * Balance of type "receiver-auditor-url-acceptable" (see balance.ts for definition).
   */
  balanceReceiverAuditorUrlAcceptable: AmountJson;
  /**
   * Balance of type "receiver-depositable" (see balance.ts for definition).
   */
  balanceReceiverDepositable: AmountJson;
  /**
   * Balance that's depositable with the exchange.
   * This balance is reduced by the exchange's debit restrictions
   * and wire fee configuration.
   */
  balanceExchangeDepositable: AmountJson;
  /**
   * Estimated maximum amount that the wallet could pay for, under the assumption
   * that the merchant pays absolutely no fees.
   */
  maxMerchantEffectiveDepositAmount: AmountJson;
}
/**
 * Non-negative financial amount.  Fractional values are expressed as multiples
 * of 1e-8.
 */
export interface AmountJson {
  /**
   * Value, must be an integer.
   */
  readonly value: number;
  /**
   * Fraction, must be an integer.  Represent 1/1e8 of a unit.
   */
  readonly fraction: number;
  /**
   * Currency of the amount.
   */
  readonly currency: string;
}

20.6.2.31. ConvertDepositAmountOp#

/**
 * @deprecated Use {@link CheckDepositOp} for a concrete instructed amount,
 * or {@link GetMaxDepositAmountOp} to query deposit limits.
 */
export type ConvertDepositAmountOp = {
  op: WalletApiOperation.ConvertDepositAmount;
  request: ConvertAmountRequest;
  response: AmountResponse;
};
// ConvertDepositAmount = "convertDepositAmount"

/**
 * @deprecated Use {@link CheckDepositRequest} for a concrete instructed
 * amount, or {@link GetMaxDepositAmountRequest} to query deposit limits.
 */
export interface ConvertAmountRequest {
  amount: AmountString;
  type: TransactionAmountMode;
  depositPaytoUri: PaytoString;
}
/**
 * How the amount should be interpreted in a transaction
 * Effective = how the balance is change
 * Raw = effective amount without fee
 *
 * Depending on the transaction, raw can be higher than effective
 */
export declare enum TransactionAmountMode {
  Effective = "effective",
  Raw = "raw",
}
export type PaytoString = string;
export interface AmountResponse {
  effectiveAmount: AmountString;
  rawAmount: AmountString;
}

20.6.2.32. GetMaxDepositAmountOp#

export type GetMaxDepositAmountOp = {
  op: WalletApiOperation.GetMaxDepositAmount;
  request: GetMaxDepositAmountRequest;
  response: GetMaxDepositAmountResponse;
};
// GetMaxDepositAmount = "getMaxDepositAmount"

export interface GetMaxDepositAmountRequest {
  /**
   * Currency to deposit.
   */
  currency: string;
  /**
   * Target bank account to deposit into.
   *
   * When omitted, wire-method eligibility, account restrictions and wire
   * fees cannot be reflected in the response.
   */
  depositPaytoUri?: string;
  /**
   * Restrict the deposit to a certain scope.
   */
  restrictScope?: ScopeInfo;
}
export interface GetMaxDepositAmountResponse {
  /** Maximum that can be deposited immediately. */
  material: DepositMaximum;
  /** Maximum including expected outputs of pending refresh operations. */
  available: DepositMaximum;
  /** Eligibility and maximum amounts for every ready same-currency exchange. */
  exchangeDiagnostics: Record<string, DepositExchangeDiagnostics>;
}
/** Maximum amounts and fees for one coherent deposit coin selection. */
export interface DepositMaximum {
  /** Gross target amount passed to CheckDeposit or CreateDepositGroup. */
  instructedAmount: AmountString;
  /**
   * Total balance effect on the wallet: instructed amount plus fees paid by
   * the customer and the cost of refreshing any change.
   */
  effectiveAmount: AmountString;
  /**
   * Amount expected to reach the destination account: instructed amount
   * minus fees covered by the counterparty.
   */
  rawAmount: AmountString;
  /** Total fees incurred by this deposit selection. */
  fees: DepositGroupFees;
}
export interface DepositExchangeDiagnostics {
  /** Maximum that can be deposited immediately. */
  material: DepositMaximum;
  /** Maximum including expected outputs of pending refresh operations. */
  available: DepositMaximum;
  /** Eligibility failures, in deterministic evaluation order. */
  reasons: DepositEligibilityReason[];
}
/** Reason why a ready, same-currency exchange cannot serve a deposit. */
export type DepositEligibilityReason =
  | {
      type: DepositEligibilityReasonType.DirectDepositDisabled;
    }
  | {
      type: DepositEligibilityReasonType.ScopeRestricted;
      scopeInfo: ScopeInfo;
    }
  | {
      type: DepositEligibilityReasonType.WireMethodUnsupported;
      wireMethod: string;
    }
  | {
      type: DepositEligibilityReasonType.WireFeeUnavailable;
      wireMethod: string;
    }
  | {
      type: DepositEligibilityReasonType.DepositAccountRestricted;
      wireMethod: string;
      accountRestrictions: Record<string, AccountRestriction[]>;
    };
export declare enum DepositEligibilityReasonType {
  DirectDepositDisabled = "direct-deposit-disabled",
  ScopeRestricted = "scope-restricted",
  WireMethodUnsupported = "wire-method-unsupported",
  WireFeeUnavailable = "wire-fee-unavailable",
  DepositAccountRestricted = "deposit-account-restricted",
}

20.6.2.33. GetMaxPeerPushDebitAmountOp#

export type GetMaxPeerPushDebitAmountOp = {
  op: WalletApiOperation.GetMaxPeerPushDebitAmount;
  request: GetMaxPeerPushDebitAmountRequest;
  response: GetMaxPeerPushDebitAmountResponse;
};
// GetMaxPeerPushDebitAmount = "getMaxPeerPushDebitAmount"

export interface GetMaxPeerPushDebitAmountRequest {
  currency: string;
  /**
   * Preferred exchange to use for the p2p payment.
   */
  exchangeBaseUrl?: string;
  restrictScope?: ScopeInfo;
}
export interface GetMaxPeerPushDebitAmountResponse {
  effectiveAmount: AmountString;
  rawAmount: AmountString;
  exchangeBaseUrl?: string;
}

20.6.2.34. GetTransactionsOp#

/**
 * Get transactions.
 */
export type GetTransactionsOp = {
  op: WalletApiOperation.GetTransactions;
  request: TransactionsRequest;
  response: TransactionsResponse;
};
// GetTransactions = "getTransactions"

export interface TransactionsRequest {
  /**
   * return only transactions in the given currency
   *
   * it will be removed in next release
   *
   * @deprecated use scopeInfo
   */
  currency?: string;
  /**
   * return only transactions in the given scopeInfo
   */
  scopeInfo?: ScopeInfo;
  /**
   * if present, results will be limited to transactions related to the given search string
   */
  search?: string;
  /**
   * Sort order of the transaction items.
   * By default, items are sorted ascending by their
   * main timestamp.
   *
   * ascending: ascending by timestamp, but pending transactions first
   * descending: ascending by timestamp, but pending transactions first
   * stable-ascending: ascending by timestamp, with pending transactions amidst other transactions
   *    (stable in the sense of: pending transactions don't jump around)
   */
  sort?: "ascending" | "descending" | "stable-ascending";
  /**
   * If true, include all refreshes in the transactions list.
   */
  includeRefreshes?: boolean;
  filterByState?: TransactionStateFilter;
}
export type TransactionStateFilter = "nonfinal";

20.6.2.35. GetTransactionsV2Op#

export type GetTransactionsV2Op = {
  op: WalletApiOperation.GetTransactionsV2;
  request: GetTransactionsV2Request;
  response: TransactionsResponse;
};
// GetTransactionsV2 = "getTransactionsV2"

export interface GetTransactionsV2Request {
  /**
   * Return only transactions in the given currency.
   */
  currency?: string;
  /**
   * Return only transactions in the given scopeInfo
   */
  scopeInfo?: ScopeInfo;
  /**
   * If true, include all refreshes in the transactions list.
   */
  includeRefreshes?: boolean;
  /**
   * If true, include transactions that would usually be filtered out.
   * Implies includeRefreshes.
   */
  includeAll?: boolean;
  /**
   * Only return transactions before/after this offset.
   */
  offsetTransactionId?: TransactionIdStr;
  /**
   * Only return transactions before/after the transaction with this
   * timestamp.
   *
   * Used as a fallback if the offsetTransactionId was deleted.
   */
  offsetTimestamp?: TalerPreciseTimestamp;
  /**
   * Number of transactions to return.
   *
   * When the limit is positive, results are returned
   * in ascending order of their timestamp.  If no offset is specified,
   * the result list begins with the first transaction.
   * If an offset is specified, transactions after the offset are returned.
   *
   * When the limit is negative, results are returned
   * in descending order of their timestamp.  If no offset is specified,
   * the result list begins with with the last transaction.
   * If an offset is specified, transactions before the offset are returned.
   */
  limit?: number;
  /**
   * Filter transactions by their state / state category.
   *
   * If not specified, all transactions are returned.
   *
   * final: Transactions in any final state
   * nonfinal: Transactions in any state but the final states
   * nonfinal-dialog: nonfinal transactions that require confirmation / some
   *   choice by the user
   * nonfinal-approved: nonfinal transactions that need no further user approval
   * done: Transactions in the "done" major state
   */
  filterByState?:
    | "final"
    | "nonfinal"
    | "done"
    | "nonfinal-approved"
    | "nonfinal-dialog";
}

20.6.2.36. ListAssociatedRefreshesOp#

/**
 * List refresh transactions associated with another transaction.
 */
export type ListAssociatedRefreshesOp = {
  op: WalletApiOperation.ListAssociatedRefreshes;
  request: ListAssociatedRefreshesRequest;
  response: ListAssociatedRefreshesResponse;
};
// ListAssociatedRefreshes = "listAssociatedRefreshes"

export interface ListAssociatedRefreshesRequest {
  transactionId: string;
}
export interface ListAssociatedRefreshesResponse {
  transactionIds: string[];
}

20.6.2.37. TestingGetSampleTransactionsOp#

/**
 * Get sample transactions.
 */
export type TestingGetSampleTransactionsOp = {
  op: WalletApiOperation.TestingGetSampleTransactions;
  request: EmptyObject;
  response: TransactionsResponse;
};
// TestingGetSampleTransactions = "testingGetSampleTransactions"

20.6.2.38. GetTransactionByIdOp#

export type GetTransactionByIdOp = {
  op: WalletApiOperation.GetTransactionById;
  request: TransactionByIdRequest;
  response: Transaction;
};
// GetTransactionById = "getTransactionById"

export interface TransactionByIdRequest {
  transactionId: string;
  /**
   * If set to true, report the full contract terms in the response
   * if the transaction has them.
   */
  includeContractTerms?: boolean;
}

20.6.2.39. ResolveTransactionReferenceOp#

export type ResolveTransactionReferenceOp = {
  op: WalletApiOperation.ResolveTransactionReference;
  request: ResolveTransactionReferenceRequest;
  response: ResolveTransactionReferenceResponse;
};
// ResolveTransactionReference = "resolveTransactionReference"

/**
 * Resolve a stable transaction ID, a wallet-local identifier, or an external
 * withdrawal reference containing a reserve public key to a stable ID.
 */
export interface ResolveTransactionReferenceRequest {
  transactionReference: string;
}
export interface ResolveTransactionReferenceResponse {
  transactionId: TransactionIdStr;
}

20.6.2.40. DeleteTransactionOp#

/**
 * Delete a transaction locally in the wallet.
 */
export type DeleteTransactionOp = {
  op: WalletApiOperation.DeleteTransaction;
  request: DeleteTransactionRequest;
  response: EmptyObject;
};
// DeleteTransaction = "deleteTransaction"

export interface DeleteTransactionRequest {
  transactionId: TransactionIdStr;
}

20.6.2.41. RetryTransactionOp#

/**
 * Immediately retry a transaction.
 */
export type RetryTransactionOp = {
  op: WalletApiOperation.RetryTransaction;
  request: RetryTransactionRequest;
  response: EmptyObject;
};
// RetryTransaction = "retryTransaction"

export interface RetryTransactionRequest {
  transactionId: TransactionIdStr;
}

20.6.2.42. AbortTransactionOp#

/**
 * Abort a transaction
 *
 * For payment transactions, it puts the payment into an "aborting" state.
 */
export type AbortTransactionOp = {
  op: WalletApiOperation.AbortTransaction;
  request: AbortTransactionRequest;
  response: EmptyObject;
};
// AbortTransaction = "abortTransaction"

20.6.2.43. FailTransactionOp#

/**
 * Cancel aborting a transaction
 *
 * For payment transactions, it puts the payment into an "aborting" state.
 */
export type FailTransactionOp = {
  op: WalletApiOperation.FailTransaction;
  request: FailTransactionRequest;
  response: EmptyObject;
};
// FailTransaction = "failTransaction"

export interface FailTransactionRequest {
  transactionId: TransactionIdStr;
}
export interface FailTransactionRequest {
  transactionId: TransactionIdStr;
}

20.6.2.44. SuspendTransactionOp#

/**
 * Suspend a transaction
 */
export type SuspendTransactionOp = {
  op: WalletApiOperation.SuspendTransaction;
  request: AbortTransactionRequest;
  response: EmptyObject;
};
// SuspendTransaction = "suspendTransaction"

20.6.2.45. ResumeTransactionOp#

/**
 * Resume a transaction
 */
export type ResumeTransactionOp = {
  op: WalletApiOperation.ResumeTransaction;
  request: AbortTransactionRequest;
  response: EmptyObject;
};
// ResumeTransaction = "resumeTransaction"

20.6.2.46. GetWithdrawalDetailsForAmountOp#

/**
 * Get details for withdrawing a particular amount (manual withdrawal).
 */
export type GetWithdrawalDetailsForAmountOp = {
  op: WalletApiOperation.GetWithdrawalDetailsForAmount;
  request: GetWithdrawalDetailsForAmountRequest;
  response: WithdrawalDetailsForAmount;
};
// GetWithdrawalDetailsForAmount = "getWithdrawalDetailsForAmount"

export interface GetWithdrawalDetailsForAmountRequest {
  exchangeBaseUrl?: string;
  /**
   * Specify currency scope for the withdrawal.
   *
   * May only be used when exchangeBaseUrl is not specified.
   */
  restrictScope?: ScopeInfo;
  amount: AmountString;
  restrictAge?: number;
  progressToken?: string;
}
export interface WithdrawalDetailsForAmount {
  /**
   * Exchange base URL for the withdrawal.
   */
  exchangeBaseUrl: string;
  /**
   * Amount that the user will transfer to the exchange.
   */
  amountRaw: AmountString;
  /**
   * Amount that will be added to the user's wallet balance.
   */
  amountEffective: AmountString;
  /**
   * Number of coins that would be used for withdrawal.
   *
   * The UIs should warn if this number is too high (roughly at >100).
   */
  numCoins: number;
  /**
   * Ways to pay the exchange, including accounts that require currency conversion.
   */
  withdrawalAccountsList: WithdrawalExchangeAccountDetails[];
  /**
   * If the exchange supports age-restricted coins it will return
   * the array of ages.
   */
  ageRestrictionOptions?: number[];
  /**
   * Scope info of the currency withdrawn.
   */
  scopeInfo: ScopeInfo;
  /**
   * Set when the exchange changed its key set and the user has not confirmed
   * the change.  Accepting the withdrawal will be refused until they do, so
   * this is the point at which to warn them.
   */
  unconfirmedKeyChange?: ExchangeKeyChangeInfo;
  /**
   * KYC soft limit.
   *
   * Withdrawals over that amount will require KYC.
   */
  kycSoftLimit?: AmountString;
  /**
   * KYC soft limits.
   *
   * Withdrawals over that amount will be denied.
   */
  kycHardLimit?: AmountString;
  /**
   * Ways to pay the exchange.
   *
   * @deprecated in favor of withdrawalAccountsList
   */
  paytoUris: string[];
}

20.6.2.47. GetWithdrawalDetailsForUriOp#

/**
 * Get details for withdrawing via a particular taler:// URI.
 *
 * @deprecated Use {@link PrepareBankIntegratedWithdrawalOp} instead
 */
export type GetWithdrawalDetailsForUriOp = {
  op: WalletApiOperation.GetWithdrawalDetailsForUri;
  request: GetWithdrawalDetailsForUriRequest;
  response: WithdrawUriInfoResponse;
};
// GetWithdrawalDetailsForUri = "getWithdrawalDetailsForUri"

export interface GetWithdrawalDetailsForUriRequest {
  talerWithdrawUri: string;
  /**
   * @deprecated not used
   */
  restrictAge?: number;
  progressToken?: string;
}

20.6.2.48. PrepareBankIntegratedWithdrawalOp#

/**
 * Prepare a bank-integrated withdrawal operation.
 */
export type PrepareBankIntegratedWithdrawalOp = {
  op: WalletApiOperation.PrepareBankIntegratedWithdrawal;
  request: PrepareBankIntegratedWithdrawalRequest;
  response: PrepareBankIntegratedWithdrawalResponse;
};
// PrepareBankIntegratedWithdrawal = "prepareBankIntegratedWithdrawal"

export interface PrepareBankIntegratedWithdrawalRequest {
  talerWithdrawUri: string;
  progressToken?: string;
}
export interface PrepareBankIntegratedWithdrawalResponse {
  transactionId: TransactionIdStr;
  info: WithdrawUriInfoResponse;
}

20.6.2.49. ConfirmWithdrawalOp#

/**
 * Confirm a withdrawal transaction.
 */
export type ConfirmWithdrawalOp = {
  op: WalletApiOperation.ConfirmWithdrawal;
  request: ConfirmWithdrawalRequest;
  response: EmptyObject;
};
// ConfirmWithdrawal = "confirmWithdrawal"

export interface ConfirmWithdrawalRequest {
  transactionId: string;
  exchangeBaseUrl: string;
  amount?: AmountString | undefined;
  forcedDenomSel?: ForcedDenomSel;
  restrictAge?: number;
  progressToken?: string;
}

20.6.2.50. AcceptBankIntegratedWithdrawalOp#

/**
 * Accept a bank-integrated withdrawal.
 *
 * @deprecated in favor of prepare/confirm withdrawal.
 */
export type AcceptBankIntegratedWithdrawalOp = {
  op: WalletApiOperation.AcceptBankIntegratedWithdrawal;
  request: AcceptBankIntegratedWithdrawalRequest;
  response: AcceptWithdrawalResponse;
};
// AcceptBankIntegratedWithdrawal = "acceptBankIntegratedWithdrawal"

export interface AcceptBankIntegratedWithdrawalRequest {
  talerWithdrawUri: string;
  exchangeBaseUrl: string;
  forcedDenomSel?: ForcedDenomSel;
  /**
   * Amount to withdraw.
   * If the bank's withdrawal operation uses a fixed amount,
   * this field must either be left undefined or its value must match
   * the amount from the withdrawal operation.
   */
  amount?: AmountString;
  restrictAge?: number;
  progressToken?: string;
}
export interface AcceptWithdrawalResponse {
  confirmTransferUrl?: string;
  transactionId: TransactionIdStr;
}

20.6.2.51. AcceptManualWithdrawalOp#

/**
 * Create a manual withdrawal.
 */
export type AcceptManualWithdrawalOp = {
  op: WalletApiOperation.AcceptManualWithdrawal;
  request: AcceptManualWithdrawalRequest;
  response: AcceptManualWithdrawalResult;
};
// AcceptManualWithdrawal = "acceptManualWithdrawal"

export interface AcceptManualWithdrawalRequest {
  exchangeBaseUrl: string;
  amount: AmountString;
  restrictAge?: number;
  /**
   * Instead of generating a fresh, random reserve key pair,
   * use the provided reserve private key.
   *
   * Use with caution.  Usage of this field may be restricted
   * to developer mode.
   */
  forceReservePriv?: EddsaPrivateKeyString;
  progressToken?: string;
}
export interface AcceptManualWithdrawalResult {
  /**
   * Transaction ID of the newly created withdrawal transaction.
   */
  transactionId: TransactionIdStr;
  /**
   * Public key of the newly created reserve.
   */
  reservePub: string;
  /**
   * Bank accounts of the exchange that can be used
   * to fund the withdrawal.
   */
  withdrawalAccountsList: WithdrawalExchangeAccountDetails[];
}

20.6.2.52. PreparePayForUriV2Op#

/**
 * Prepare to make a payment based on a taler://pay/ URI.
 */
export type PreparePayForUriV2Op = {
  op: WalletApiOperation.PreparePayForUriV2;
  request: PreparePayRequest;
  response: PreparePayV2Result;
};
// PreparePayForUriV2 = "preparePayForUriV2"

export interface PreparePayRequest {
  talerPayUri: string;
}

20.6.2.53. PreparePayForTemplateV2Op#

/**
 * Prepare to make a payment based on a taler://pay-template/ URI.
 */
export type PreparePayForTemplateV2Op = {
  op: WalletApiOperation.PreparePayForTemplateV2;
  request: PreparePayTemplateRequest;
  response: PreparePayV2Result;
};
// PreparePayForTemplateV2 = "preparePayForTemplateV2"

export interface PreparePayTemplateRequest {
  talerPayTemplateUri: string;
  templateParams?: TemplateParams;
  progressToken?: string;
}
export type TemplateParams = {
  amount?: AmountString;
  summary?: string;
};

20.6.2.54. PreparePayForPaivanaOp#

/** Prepare a payment for an HTTP(S) resource protected by Paivana. */
export type PreparePayForPaivanaOp = {
  op: WalletApiOperation.PreparePayForPaivana;
  request: PreparePayForPaivanaRequest;
  response: PreparePayForPaivanaResult;
};
// PreparePayForPaivana = "preparePayForPaivana"

export interface PreparePayForPaivanaRequest {
  url: string;
  progressToken?: string;
}
export interface PreparePayForPaivanaResult {
  transactionId: TransactionIdStr;
  paivana: PaivanaRedemption;
}

20.6.2.55. GetPaivanaCookieOp#

/** Redeem a successfully paid Paivana transaction for an access cookie. */
export type GetPaivanaCookieOp = {
  op: WalletApiOperation.GetPaivanaCookie;
  request: GetPaivanaCookieRequest;
  response: GetPaivanaCookieResult;
};
// GetPaivanaCookie = "getPaivanaCookie"

export interface GetPaivanaCookieRequest {
  transactionId: TransactionIdStr;
  paivana: PaivanaRedemption;
}
export interface GetPaivanaCookieResult {
  /** Plain Cookie request-header value, without Set-Cookie attributes. */
  cookie: string;
}

20.6.2.56. GetChoicesForPaymentOp#

/**
 * Get a list of contract v1 choices for a given payment tx
 * in dialog(confirm) state, as well as additional information
 * on whether they can be used to pay the order or not, depending
 * on the funds available on the wallet, or whether a specific
 * choice should be paid automatically without user confirmation,
 * based on user configuration or the type of payment requested.
 *
 * This request will fail if contract choices are not yet
 * available, in which case the `choicesAvailable' field of the tx
 * will be undefined or set to false.
 */
export type GetChoicesForPaymentOp = {
  op: WalletApiOperation.GetChoicesForPayment;
  request: GetChoicesForPaymentRequest;
  response: GetChoicesForPaymentResult;
};
// GetChoicesForPayment = "getChoicesForPayment"

export interface GetChoicesForPaymentRequest {
  transactionId: string;
  forcedCoinSel?: ForcedCoinSel;
}
export type GetChoicesForPaymentResult = {
  /**
   * Details for all choices in the contract.
   *
   * The index in this array corresponds to the choice
   * index in the original contract v1. For contract v0
   * orders, it will only contain a single choice with no
   * inputs/outputs.
   */
  choices: ChoiceSelectionDetail[];
  /**
   * Index of the choice in the choices array to present
   * to the user as default.
   *
   * Won´t be set if no default selection is configured
   * or no choice is payable, otherwise, it will always
   * be 0 for v0 orders.
   */
  defaultChoiceIndex?: number;
  /**
   * Whether the choice referenced by automaticExecutableIndex
   * should be confirmed automatically without
   * user interaction.
   *
   * If true, the wallet should call `confirmPay'
   * immediately afterwards, if false, the user
   * should be first prompted to select and
   * confirm a choice. Undefined when no choices
   * are payable.
   */
  automaticExecution?: boolean;
  /**
   * Index of the choice that would be set to automatically
   * execute if the choice was payable. When automaticExecution
   * is set to true, the payment should be confirmed with this
   * choice index without user interaction.
   */
  automaticExecutableIndex?: number;
  /**
   * Data extracted from the contract terms that
   * is relevant for payment processing in the wallet.
   */
  contractTerms: MerchantContractTerms;
};
export interface ChoiceSelectionDetailPaymentPossible {
  status: ChoiceSelectionDetailType.PaymentPossible;
  amountRaw: AmountString;
  amountEffective: AmountString;
  scopeInfo: ScopeInfo | undefined;
  tokenDetails?: PaymentTokenAvailabilityDetails;
}
export declare enum ChoiceSelectionDetailType {
  PaymentPossible = "payment-possible",
  InsufficientBalance = "insufficient-balance",
}
export interface PaymentTokenAvailabilityDetails {
  /**
   * Number of tokens requested by the merchant.
   */
  tokensRequested: number;
  /**
   * Number of tokens available to use.
   */
  tokensAvailable: number;
  /**
   * Number of tokens for which the merchant is unexpected.
   *
   * Can be used to pay (i.e. with forced selection),
   * but a warning should be displayed to the user.
   */
  tokensUnexpected: number;
  /**
   * Number of tokens for which the merchant is untrusted.
   *
   * Cannot be used to pay, so an error should be displayed.
   */
  tokensUntrusted: number;
  perTokenFamily: {
    [slug: string]: {
      causeHint?: TokenAvailabilityHint;
      requested: number;
      available: number;
      unexpected: number;
      untrusted: number;
    };
  };
}
export declare enum TokenAvailabilityHint {
  WalletTokensAvailableInsufficient = "wallet-tokens-available-insufficient",
  MerchantUnexpected = "merchant-unexpected",
  MerchantUntrusted = "merchant-untrusted",
}
export interface ChoiceSelectionDetailInsufficientBalance {
  status: ChoiceSelectionDetailType.InsufficientBalance;
  amountRaw: AmountString;
  balanceDetails?: PaymentInsufficientBalanceDetails;
  tokenDetails?: PaymentTokenAvailabilityDetails;
}

20.6.2.57. UnclaimPaymentOp#

export type UnclaimPaymentOp = {
  op: WalletApiOperation.UnclaimPayment;
  request: UnclaimPaymentRequest;
  response: UnclaimPaymentResult;
};
// UnclaimPayment = "unclaimPayment"

export interface UnclaimPaymentRequest {
  transactionId: TransactionIdStr;
  /** Enables progress correlation and cancellation through cancelProgressToken. */
  progressToken?: string;
}
export interface UnclaimPaymentResult {
  talerPayUri: TalerUriString;
}

20.6.2.58. ReclaimPaymentOp#

export type ReclaimPaymentOp = {
  op: WalletApiOperation.ReclaimPayment;
  request: ReclaimPaymentRequest;
  response: EmptyObject;
};
// ReclaimPayment = "reclaimPayment"

export interface ReclaimPaymentRequest {
  transactionId: TransactionIdStr;
}

20.6.2.59. CheckPayForTemplateOp#

export type CheckPayForTemplateOp = {
  op: WalletApiOperation.CheckPayForTemplate;
  request: CheckPayTemplateRequest;
  response: CheckPayTemplateReponse;
};
// CheckPayForTemplate = "checkPayForTemplate"

export interface CheckPayTemplateRequest {
  talerPayTemplateUri: string;
  progressToken?: string;
}
export type CheckPayTemplateReponse = {
  templateDetails: WalletTemplateDetailsResponse;
  supportedCurrencies: string[];
  availableBalances: {
    scopeInfo: ScopeInfo;
    amountAvailable: AmountString;
  }[];
};

availableBalances is always returned, for fixed and editable amounts and all template types. It contains wallet balance snapshots for scopes whose currency appears in supportedCurrencies, preserving the scopes and ordering from getBalances. Known zero balances are included; an empty array means there are no matching wallet balance entries. No scopes are synthesized.

amountAvailable has the same meaning as getBalances.available, including expected outputs from pending refreshes. It is not a guaranteed maximum payment amount or proof that the merchant accepts these funds. Merchant acceptance, age restrictions, fees and final payment eligibility are checked during payment preparation. Template currency requirements still apply, and balances may change after the response. Missing or empty advisory exchange_candidates do not suppress wallet balances. Clients must not use this snapshot as an authoritative affordability check or exact input limit.

export interface WalletTemplateDetailsResponse {
  template_contract: TemplateContractDetails;
  editable_defaults?: TemplateContractDetailsDefaults;
  required_currency?: string;
  merchant?: MerchantInfo;
  merchant_pub?: EddsaPublicKey;
  exchange_candidates?: TemplateExchangeCandidate[];
}
export interface TemplateContractFixedOrder extends TemplateContractCommon {
  template_type: TemplateType.FIXED_ORDER;
  amount?: AmountString;
}
export interface TemplateContractCommon {
  summary?: string;
  currency?: string;
  pay_duration?: RelativeTime;
  max_pickup_duration?: RelativeTime;
  minimum_age?: Integer;
  request_tip?: boolean;
}
export declare enum TemplateType {
  FIXED_ORDER = "fixed-order",
  INVENTORY_CART = "inventory-cart",
  PAIVANA = "paivana",
}
export interface TemplateContractInventoryCart extends TemplateContractCommon {
  template_type: TemplateType.INVENTORY_CART;
  selected_all?: boolean;
  selected_categories?: Integer[];
  selected_products?: string[];
  choose_one?: boolean;
  inventory_payload?: InventoryPayload;
}
export interface InventoryPayload {
  products: InventoryPayloadProduct[];
  categories: InventoryPayloadCategory[];
  units: InventoryPayloadUnit[];
}
export interface InventoryPayloadProduct {
  product_id: string;
  product_name: string;
  description: string;
  description_i18n?: {
    [lang_tag: string]: string;
  };
  unit: string;
  unit_prices: AmountString[];
  unit_allow_fraction: boolean;
  unit_precision_level: Integer;
  remaining_stock: DecimalQuantity;
  categories: Integer[];
  taxes?: Tax[];
  image_hash?: string;
}
export interface InventoryPayloadCategory {
  category_id: Integer;
  category_name: string;
  category_name_i18n?: {
    [lang_tag: string]: string;
  };
}
export interface InventoryPayloadUnit {
  unit: string;
  unit_name_long: string;
  unit_name_long_i18n?: {
    [lang_tag: string]: string;
  };
  unit_name_short: string;
  unit_name_short_i18n?: {
    [lang_tag: string]: string;
  };
  unit_allow_fraction: boolean;
  unit_precision_level: Integer;
}
export interface TemplateContractPaivana extends TemplateContractCommon {
  template_type: TemplateType.PAIVANA;
  website_regex?: string;
  choices: OrderChoice[];
}
export interface OrderChoice {
  amount: AmountString;
  description?: string;
  description_i18n?: InternationalizedString;
  inputs?: OrderInput[];
  outputs?: OrderOutput[];
  max_fee?: AmountString;
}
export type OrderInput = OrderInputToken;
export interface OrderInputToken {
  type: OrderInputType.Token;
  token_family_slug: string;
  count?: Integer;
}
export declare enum OrderInputType {
  Token = "token",
}
export type OrderOutput = OrderOutputToken | OrderOutputTaxReceipt;
export interface OrderOutputToken {
  type: OrderOutputType.Token;
  token_family_slug: string;
  count?: Integer;
  valid_at?: TalerProtocolTimestamp;
}
export declare enum OrderOutputType {
  Token = "token",
  TaxReceipt = "tax-receipt",
}
export interface OrderOutputTaxReceipt {
  type: OrderOutputType.TaxReceipt;
  amount?: AmountString;
  donau_urls: string[];
}
/**
 * Key-value pairs matching a subset of the
 * fields from template_contract that are
 * user-editable defaults for this template.
 * Since protocol **v13**.
 */
export interface TemplateContractDetailsDefaults {
  summary?: string;
  currency?: string;
  /**
   * Amount *or* a plain currency string.
   */
  amount?: string;
}
export interface TemplateExchangeCandidate {
  base_url: string;
  currency: string;
  master_pub: EddsaPublicKey;
  wire_methods: string[];
}

20.6.2.60. ConfirmPayOp#

/**
 * Confirm a payment that was previously prepared with
 * {@link PreparePayForUriV2Op}
 */
export type ConfirmPayOp = {
  op: WalletApiOperation.ConfirmPay;
  request: ConfirmPayRequest;
  response: ConfirmPayResult;
};
// ConfirmPay = "confirmPay"

export interface ConfirmPayRequest {
  transactionId: TransactionIdStr;
  useDonau?: boolean;
  sessionId?: string;
  forcedCoinSel?: ForcedCoinSel;
  /**
   * Whether token selection should be forced
   * e.g. use tokens with non-matching `expected_domains'
   *
   * Only applies to v1 orders.
   */
  forcedTokenSel?: boolean;
  /**
   * Only applies to v1 orders.
   */
  choiceIndex?: number;
  /**
   * Do not wait for the first payment success or error
   * before returning a response. Instead, status will
   * be communicated via notifications.
   *
   * Will become the default in future versions.
   */
  noWait?: boolean;
}
export type ConfirmPayResult = ConfirmPayResultDone | ConfirmPayResultPending;
/**
 * Result for confirmPay
 */
export interface ConfirmPayResultDone {
  type: ConfirmPayResultType.Done;
  contractTerms: MerchantContractTermsV0;
  transactionId: TransactionIdStr;
}
export declare enum ConfirmPayResultType {
  Done = "done",
  Pending = "pending",
}
export interface ConfirmPayResultPending {
  type: ConfirmPayResultType.Pending;
  transactionId: TransactionIdStr;
  lastError?: TalerErrorDetail | undefined;
}

20.6.2.61. StartRefundQueryForUriOp#

/**
 * Check for a refund based on a taler://refund URI.
 */
export type StartRefundQueryForUriOp = {
  op: WalletApiOperation.StartRefundQueryForUri;
  request: PrepareRefundRequest;
  response: StartRefundQueryForUriResponse;
};
// StartRefundQueryForUri = "startRefundQueryForUri"

export interface PrepareRefundRequest {
  talerRefundUri: string;
}
export interface StartRefundQueryForUriResponse {
  /**
   * Transaction id of the *payment* where the refund query was started.
   */
  transactionId: TransactionIdStr;
}

20.6.2.62. StartRefundQueryOp#

export type StartRefundQueryOp = {
  op: WalletApiOperation.StartRefundQuery;
  request: StartRefundQueryRequest;
  response: EmptyObject;
};
// StartRefundQuery = "startRefundQuery"

export interface StartRefundQueryRequest {
  transactionId: TransactionIdStr;
}

20.6.2.63. ListDiscountsOp#

/**
 * List discount tokens stored in the wallet. Listed tokens
 * will be grouped based on token family details.
 */
export type ListDiscountsOp = {
  op: WalletApiOperation.ListDiscounts;
  request: ListDiscountsRequest;
  response: ListDiscountsResponse;
};
// ListDiscounts = "listDiscounts"

export interface ListDiscountsResponse {
  discounts: DiscountListDetail[];
}

20.6.2.64. DeleteDiscountOp#

export type DeleteDiscountOp = {
  op: WalletApiOperation.DeleteDiscount;
  request: DeleteDiscountRequest;
  response: EmptyObject;
};
// DeleteDiscount = "deleteDiscount"

export interface DeleteDiscountRequest {
  /**
   * Hash of token family info.
   */
  tokenFamilyHash: string;
}

20.6.2.65. ListSubscriptionsOp#

/**
 * List subscription tokens stored in the wallet. Listed tokens
 * will be grouped based on token family details.
 */
export type ListSubscriptionsOp = {
  op: WalletApiOperation.ListSubscriptions;
  request: ListSubscriptionsRequest;
  response: ListSubscriptionsResponse;
};
// ListSubscriptions = "listSubscriptions"

export type ListSubscriptionsRequest = ListDiscountsRequest;
export interface ListSubscriptionsResponse {
  subscriptions: SubscriptionListDetail[];
}
export type SubscriptionListDetail = Omit<
  DiscountListDetail,
  "tokensAvailable"
>;

20.6.2.66. DeleteSubscriptionOp#

export type DeleteSubscriptionOp = {
  op: WalletApiOperation.DeleteSubscription;
  request: DeleteSubscriptionRequest;
  response: EmptyObject;
};
// DeleteSubscription = "deleteSubscription"

export interface DeleteSubscriptionRequest {
  /**
   * Hash of token family info.
   */
  tokenFamilyHash: string;
}

20.6.2.67. ListGlobalCurrencyAuditorsOp#

export type ListGlobalCurrencyAuditorsOp = {
  op: WalletApiOperation.ListGlobalCurrencyAuditors;
  request: EmptyObject;
  response: ListGlobalCurrencyAuditorsResponse;
};
// ListGlobalCurrencyAuditors = "listGlobalCurrencyAuditors"

export interface ListGlobalCurrencyAuditorsResponse {
  auditors: {
    currency: string;
    auditorBaseUrl: string;
    auditorPub: string;
  }[];
}

20.6.2.68. ListGlobalCurrencyExchangesOp#

export type ListGlobalCurrencyExchangesOp = {
  op: WalletApiOperation.ListGlobalCurrencyExchanges;
  request: EmptyObject;
  response: ListGlobalCurrencyExchangesResponse;
};
// ListGlobalCurrencyExchanges = "listGlobalCurrencyExchanges"

export interface ListGlobalCurrencyExchangesResponse {
  exchanges: {
    currency: string;
    exchangeBaseUrl: string;
    exchangeMasterPub: string;
  }[];
}

20.6.2.69. AddGlobalCurrencyExchangeOp#

export type AddGlobalCurrencyExchangeOp = {
  op: WalletApiOperation.AddGlobalCurrencyExchange;
  request: AddGlobalCurrencyExchangeRequest;
  response: EmptyObject;
};
// AddGlobalCurrencyExchange = "addGlobalCurrencyExchange"

export interface AddGlobalCurrencyExchangeRequest {
  currency: string;
  exchangeBaseUrl: string;
  exchangeMasterPub: string;
}

20.6.2.70. AddGlobalCurrencyAuditorOp#

export type AddGlobalCurrencyAuditorOp = {
  op: WalletApiOperation.AddGlobalCurrencyAuditor;
  request: AddGlobalCurrencyAuditorRequest;
  response: EmptyObject;
};
// AddGlobalCurrencyAuditor = "addGlobalCurrencyAuditor"

export interface AddGlobalCurrencyAuditorRequest {
  currency: string;
  auditorBaseUrl: string;
  auditorPub: string;
}

20.6.2.71. RemoveGlobalCurrencyExchangeOp#

export type RemoveGlobalCurrencyExchangeOp = {
  op: WalletApiOperation.RemoveGlobalCurrencyExchange;
  request: RemoveGlobalCurrencyExchangeRequest;
  response: EmptyObject;
};
// RemoveGlobalCurrencyExchange = "removeGlobalCurrencyExchange"

export interface RemoveGlobalCurrencyExchangeRequest {
  currency: string;
  exchangeBaseUrl: string;
  exchangeMasterPub: string;
}

20.6.2.72. RemoveGlobalCurrencyAuditorOp#

export type RemoveGlobalCurrencyAuditorOp = {
  op: WalletApiOperation.RemoveGlobalCurrencyAuditor;
  request: RemoveGlobalCurrencyAuditorRequest;
  response: EmptyObject;
};
// RemoveGlobalCurrencyAuditor = "removeGlobalCurrencyAuditor"

export interface RemoveGlobalCurrencyAuditorRequest {
  currency: string;
  auditorBaseUrl: string;
  auditorPub: string;
}

20.6.2.73. CompleteExchangeBaseUrlOp#

/**
 * Force a refresh on coins where it would not
 * be necessary.
 */
export type CompleteExchangeBaseUrlOp = {
  op: WalletApiOperation.CompleteExchangeBaseUrl;
  request: CompleteBaseUrlRequest;
  response: CompleteBaseUrlResult;
};
// CompleteExchangeBaseUrl = "completeExchangeBaseUrl"

export interface CompleteBaseUrlRequest {
  url: string;
  progressToken?: string;
}
export type CompleteBaseUrlResult =
  | {
      /**
       * ok: completion is a proper exchange
       */
      status: "ok";
      /** Completed exchange base URL, if completion was possible */
      completion: string;
    }
  | {
      /**
       * bad-syntax: url is so badly malformed, it can't be completed
       * bad-network: syntax okay, but exchange can't be reached
       * bad-exchange: syntax and network okay, but not talking to an exchange
       */
      status: "bad-syntax" | "bad-network" | "bad-exchange";
      /** Error details in case status is not "ok" */
      error: TalerErrorDetail;
      /**
       * Base URLs of exchanges known to the wallet whose host looks like what
       * the user meant to type, most likely first.
       *
       * Absent when the wallet does not know anything similar.
       */
      suggestions?: string[];
    };

20.6.2.74. ListExchangesOp#

/**
 * List exchanges known to the wallet.
 */
export type ListExchangesOp = {
  op: WalletApiOperation.ListExchanges;
  request: ListExchangesRequest;
  response: ExchangesListResponse;
};
// ListExchanges = "listExchanges"

export interface ListExchangesRequest {
  /**
   * Filter results to only include exchanges in the given scope.
   */
  filterByScope?: ScopeInfo;
  /**
   * Filter results to only include exchanges
   * with the given status.
   */
  filterByExchangeEntryStatus?: ExchangeEntryStatus;
  /**
   * Filter results to only include exchanges with the
   * given type.
   */
  filterByType?: ExchangeType;
}
export type ExchangeType = "demo" | "prod";
export interface ExchangesListResponse {
  exchanges: ExchangeListItem[];
}

20.6.2.75. StartExchangeWalletKycOp#

export type StartExchangeWalletKycOp = {
  op: WalletApiOperation.StartExchangeWalletKyc;
  request: StartExchangeWalletKycRequest;
  response: EmptyObject;
};
// StartExchangeWalletKyc = "startExchangeWalletKyc"

export interface StartExchangeWalletKycRequest {
  exchangeBaseUrl: string;
  amount: AmountString;
}

20.6.2.76. TestingWaitExchangeWalletKycOp#

export type TestingWaitExchangeWalletKycOp = {
  op: WalletApiOperation.TestingWaitExchangeWalletKyc;
  request: TestingWaitWalletKycRequest;
  response: EmptyObject;
};
// TestingWaitExchangeWalletKyc = "testingWaitWalletKyc"

export interface TestingWaitWalletKycRequest {
  exchangeBaseUrl: string;
  amount: AmountString;
  /**
   * Do we wait for the KYC to be passed (true),
   * or do we already return if legitimization is
   * required (false).
   */
  passed: boolean;
}

20.6.2.77. TestingPlanMigrateExchangeBaseUrlOp#

/**
 * Enable migration from an old exchange base URL to a new
 * exchange base URL.
 *
 * The actual migration is only applied once the exchange
 * returns the new base URL.
 */
export type TestingPlanMigrateExchangeBaseUrlOp = {
  op: WalletApiOperation.TestingPlanMigrateExchangeBaseUrl;
  request: TestingPlanMigrateExchangeBaseUrlRequest;
  response: EmptyObject;
};
// TestingPlanMigrateExchangeBaseUrl = "testingPlanMigrateExchangeBaseUrl"

export interface TestingPlanMigrateExchangeBaseUrlRequest {
  oldExchangeBaseUrl: string;
  newExchangeBaseUrl: string;
}

20.6.2.78. PrepareWithdrawExchangeOp#

/**
 * Prepare for withdrawing via a taler://withdraw-exchange URI.
 */
export type PrepareWithdrawExchangeOp = {
  op: WalletApiOperation.PrepareWithdrawExchange;
  request: PrepareWithdrawExchangeRequest;
  response: PrepareWithdrawExchangeResponse;
};
// PrepareWithdrawExchange = "prepareWithdrawExchange"

export interface PrepareWithdrawExchangeRequest {
  /**
   * A taler://withdraw-exchange URI.
   */
  talerUri: string;
  progressToken?: string;
}
export interface PrepareWithdrawExchangeResponse {
  /**
   * Base URL of the exchange that already existed
   * or was ephemerally added as an exchange entry to
   * the wallet.
   */
  exchangeBaseUrl: string;
  /**
   * Amount from the taler://withdraw-exchange URI.
   * Only present if specified in the URI.
   */
  amount?: AmountString;
}

20.6.2.79. AddExchangeOp#

/**
 * Add / force-update an exchange.
 */
export type AddExchangeOp = {
  op: WalletApiOperation.AddExchange;
  request: AddExchangeRequest;
  response: AddExchangeResponse;
};
// AddExchange = "addExchange"

export interface AddExchangeRequest {
  /**
   * Either an http(s) exchange base URL or
   * a taler://add-exchange/ URI.
   */
  uri?: string;
  /**
   * Only ephemerally add the exchange.
   */
  ephemeral?: boolean;
  /**
   * Allow passing incomplete URLs.  The wallet will try to complete
   * the URL and throw an error if completion is not possible.
   */
  allowCompletion?: boolean;
  /**
   * @deprecated use a separate API call to start a forced exchange update instead
   */
  forceUpdate?: boolean;
  /**
   * @deprecated Use {@link uri} instead
   */
  exchangeBaseUrl?: string;
  progressToken?: string;
}
export interface AddExchangeResponse {
  /**
   * Base URL of the exchange that was added to the wallet.
   */
  exchangeBaseUrl: string;
}

20.6.2.80. UpdateExchangeEntryOp#

/**
 * Update an exchange entry.
 *
 * Only starts updating the exchange entry.
 * After this request finishes, it is not guaranteed that
 * the exchange entry has been updated.
 *
 * Use notifications and the listExchanges request
 * to check the status.
 */
export type UpdateExchangeEntryOp = {
  op: WalletApiOperation.UpdateExchangeEntry;
  request: UpdateExchangeEntryRequest;
  response: EmptyObject;
};
// UpdateExchangeEntry = "updateExchangeEntry"

export interface UpdateExchangeEntryRequest {
  exchangeBaseUrl: string;
  force?: boolean;
}

20.6.2.81. ListBankAccountsOp#

export type ListBankAccountsOp = {
  op: WalletApiOperation.ListBankAccounts;
  request: ListBankAccountsRequest;
  response: ListBankAccountsResponse;
};
// ListBankAccounts = "listBankAccounts"

export interface ListBankAccountsRequest {
  currency?: string;
}
export interface ListBankAccountsResponse {
  accounts: WalletBankAccountInfo[];
}

20.6.2.82. GetBankAccountByIdOp#

export type GetBankAccountByIdOp = {
  op: WalletApiOperation.GetBankAccountById;
  request: GetBankAccountByIdRequest;
  response: GetBankAccountByIdResponse;
};
// GetBankAccountById = "getBankAccountById"

export interface GetBankAccountByIdRequest {
  bankAccountId: string;
}
export type GetBankAccountByIdResponse = WalletBankAccountInfo;

20.6.2.83. AddBankAccountsOp#

export type AddBankAccountsOp = {
  op: WalletApiOperation.AddBankAccount;
  request: AddBankAccountRequest;
  response: AddBankAccountResponse;
};
// AddBankAccount = "addBankAccount"

export interface AddBankAccountRequest {
  /**
   * Payto URI of the bank account that should be added.
   */
  paytoUri: string;
  /**
   * Human-readable label for the account.
   */
  label: string;
  /**
   * Currencies supported by the bank (if known).
   */
  currencies?: string[] | undefined;
  /**
   * Bank account that this new account should replace.
   */
  replaceBankAccountId?: string;
}
export interface AddBankAccountResponse {
  /**
   * Identifier of the added bank account.
   */
  bankAccountId: string;
}

20.6.2.84. ForgetBankAccountsOp#

export type ForgetBankAccountsOp = {
  op: WalletApiOperation.ForgetBankAccount;
  request: ForgetBankAccountRequest;
  response: EmptyObject;
};
// ForgetBankAccount = "forgetBankAccount"

export interface ForgetBankAccountRequest {
  bankAccountId: string;
}

20.6.2.85. ConfirmExchangeKeyChangeOp#

/**
 * Confirm that the exchange's changed key set is legitimate.
 *
 * The wallet has already adopted it; this releases the operations that send
 * money to the exchange, which are withheld until the user has had a chance
 * to notice that the key changed.
 */
export type ConfirmExchangeKeyChangeOp = {
  op: WalletApiOperation.ConfirmExchangeKeyChange;
  request: ConfirmExchangeKeyChangeRequest;
  response: EmptyObject;
  errors:
    | TalerErrorCode.WALLET_EXCHANGE_NO_KEY_CHANGE_PENDING
    | TalerErrorCode.WALLET_EXCHANGE_KEY_CHANGE_MISMATCH;
};
// ConfirmExchangeKeyChange = "confirmExchangeKeyChange"

export interface ConfirmExchangeKeyChangeRequest {
  exchangeBaseUrl: string;
  /**
   * Master public key the exchange now uses.
   *
   * Required, so that a UI showing a stale key change cannot confirm a
   * different one than the user was looking at.
   */
  currentMasterPub: string;
}

20.6.2.86. SetExchangeTosAcceptedOp#

/**
 * Accept a particular version of the exchange terms of service.
 */
export type SetExchangeTosAcceptedOp = {
  op: WalletApiOperation.SetExchangeTosAccepted;
  request: AcceptExchangeTosRequest;
  response: EmptyObject;
};
// SetExchangeTosAccepted = "setExchangeTosAccepted"

20.6.2.87. SetExchangeTosForgottenOp#

/**
 * Accept a particular version of the exchange terms of service.
 */
export type SetExchangeTosForgottenOp = {
  op: WalletApiOperation.SetExchangeTosForgotten;
  request: AcceptExchangeTosRequest;
  response: EmptyObject;
};
// SetExchangeTosForgotten = "setExchangeTosForgotten"

20.6.2.88. GetExchangeTosOp#

/**
 * Get the current terms of a service of an exchange.
 */
export type GetExchangeTosOp = {
  op: WalletApiOperation.GetExchangeTos;
  request: GetExchangeTosRequest;
  response: GetExchangeTosResult;
};
// GetExchangeTos = "getExchangeTos"

export interface GetExchangeTosRequest {
  exchangeBaseUrl: string;
  acceptedFormat?: string[];
  acceptLanguage?: string;
  progressToken?: string;
}
export interface GetExchangeTosResult {
  /**
   * Markdown version of the current ToS.
   */
  content: string;
  /**
   * Version tag of the current ToS.
   */
  currentEtag: string;
  /**
   * Version tag of the last ToS that the user has accepted,
   * if any.
   */
  acceptedEtag: string | undefined;
  /**
   * Accepted content type
   */
  contentType: string;
  /**
   * Language of the returned content.
   *
   * If missing, language is unknown.
   */
  contentLanguage: string | undefined;
  /**
   * Available languages as advertised by the exchange.
   */
  tosAvailableLanguages: string[];
  tosStatus: ExchangeTosStatus;
}

20.6.2.89. GetDepositWireTypesOp#

export type GetDepositWireTypesOp = {
  op: WalletApiOperation.GetDepositWireTypes;
  request: GetDepositWireTypesRequest;
  response: GetDepositWireTypesResponse;
};
// GetDepositWireTypes = "getDepositWireTypes"

export interface GetDepositWireTypesRequest {
  currency?: string;
  /**
   * Optional scope info to further restrict the result.
   * Currency must match the currency field.
   */
  scopeInfo?: ScopeInfo;
}
export interface GetDepositWireTypesResponse {
  /**
   * Details for each wire type.
   */
  wireTypeDetails: WireTypeDetails[];
}

20.6.2.90. GetDepositWireTypesForCurrencyOp#

/**
 * Get wire types that can be used for a deposit operation
 * with the provided currency.
 *
 * @deprecated Use getDepositWireTypes instead
 */
export type GetDepositWireTypesForCurrencyOp = {
  op: WalletApiOperation.GetDepositWireTypesForCurrency;
  request: GetDepositWireTypesForCurrencyRequest;
  response: GetDepositWireTypesForCurrencyResponse;
};
// GetDepositWireTypesForCurrency = "getDepositWireTypesForCurrency"

export interface GetDepositWireTypesForCurrencyRequest {
  currency: string;
  /**
   * Optional scope info to further restrict the result.
   * Currency must match the currency field.
   */
  scopeInfo?: ScopeInfo;
}
/**
 * Response with wire types that are supported for a deposit.
 *
 * In the future, we might surface more information here, such as debit restrictions
 * by the exchange, which then can be shown by UIs to the user before they
 * enter their payment information.
 */
export interface GetDepositWireTypesForCurrencyResponse {
  /**
   * @deprecated, use wireTypeDetails instead.
   */
  wireTypes: string[];
  /**
   * Details for each wire type.
   */
  wireTypeDetails: WireTypeDetails[];
}

20.6.2.91. GetExchangeDetailedInfoOp#

/**
 * Get the current terms of a service of an exchange.
 */
export type GetExchangeDetailedInfoOp = {
  op: WalletApiOperation.GetExchangeDetailedInfo;
  request: GetExchangeDetailedInfoRequest;
  response: ExchangeDetailedResponse;
};
// GetExchangeDetailedInfo = "getExchangeDetailedInfo"

export interface GetExchangeDetailedInfoRequest {
  exchangeBaseUrl: string;
}
export interface ExchangeDetailedResponse {
  exchange: ExchangeFullDetails;
}
export interface ExchangeFullDetails {
  exchangeBaseUrl: string;
  currency: string;
  paytoUris: string[];
  auditors: ExchangeAuditor[];
  wireInfo: WireInfo;
  denomFees: DenomOperationMap<FeeDescription[]>;
  transferFees: Record<string, FeeDescription[]>;
  globalFees: FeeDescription[];
}
/**
 * Auditor information as given by the exchange in /keys.
 */
export interface ExchangeAuditor {
  /**
   * Auditor's public key.
   */
  auditor_pub: string;
  /**
   * Base URL of the auditor.
   */
  auditor_url: string;
  /**
   * Human-readable name of the auditor.
   */
  auditor_name: string;
  /**
   * List of signatures for denominations by the auditor.
   */
  denomination_keys: AuditorDenomSig[];
}
/**
 * Signature by the auditor that a particular denomination key is audited.
 */
export interface AuditorDenomSig {
  /**
   * Denomination public key's hash.
   */
  denom_pub_h: string;
  /**
   * The signature.
   */
  auditor_sig: string;
}
export interface WireInfo {
  feesForType: WireFeeMap;
  accounts: ExchangeWireAccount[];
}
export type WireFeeMap = {
  [wireMethod: string]: WireFee[];
};
/**
 * Wire fee for one wire method
 */
export interface WireFee {
  /**
   * Fee for wire transfers.
   */
  wireFee: AmountString;
  /**
   * Fees to close and refund a reserve.
   */
  closingFee: AmountString;
  /**
   * Start date of the fee.
   */
  startStamp: TalerProtocolTimestamp;
  /**
   * End date of the fee.
   */
  endStamp: TalerProtocolTimestamp;
  /**
   * Signature made by the exchange master key.
   */
  sig: string;
}
export interface ExchangeWireAccount {
  payto_uri: string;
  conversion_url?: string;
  open_banking_gateway?: string;
  prepared_transfer_url?: string;
  credit_restrictions: AccountRestriction[];
  debit_restrictions: AccountRestriction[];
  master_sig: EddsaSignatureString;
  bank_label?: string;
  priority?: number;
}
export type DenomOperationMap<T> = {
  [op in DenomOperation]: T;
};
export type DenomOperation = "deposit" | "withdraw" | "refresh" | "refund";
export interface FeeDescription {
  group: string;
  from: AbsoluteTime;
  until: AbsoluteTime;
  fee?: AmountString;
}

20.6.2.92. GetDefaultExchangesOp#

/** @deprecated Use {@link ListWithdrawalExchangeCandidatesOp} instead. */
export type GetDefaultExchangesOp = {
  op: WalletApiOperation.GetDefaultExchanges;
  request: GetDefaultExchangesRequest;
  response: GetDefaultExchangesResponse;
};
// GetDefaultExchanges = "getDefaultExchanges"

/**
 * @deprecated Use {@link ListWithdrawalExchangeCandidatesResponse} instead.
 */
export interface GetDefaultExchangesResponse {
  defaultExchanges: {
    /**
     * A taler://withdraw-exchange URI for the
     * exchange.
     */
    talerUri: string;
    /**
     * Currency offered by the exchange.
     */
    currency: string;
    /**
     * Currency spec for the currency offered
     * by the exchange.
     */
    currencySpec: CurrencySpecification;
  }[];
}

20.6.2.93. ListWithdrawalExchangeCandidatesOp#

export type ListWithdrawalExchangeCandidatesOp = {
  op: WalletApiOperation.ListWithdrawalExchangeCandidates;
  request: ListWithdrawalExchangeCandidatesRequest;
  response: ListWithdrawalExchangeCandidatesResponse;
};
// ListWithdrawalExchangeCandidates = "listWithdrawalExchangeCandidates"

export type ListWithdrawalExchangeCandidatesRequest =
  GetDefaultExchangesRequest;
export interface ListWithdrawalExchangeCandidatesResponse {
  candidates: WithdrawalExchangeCandidate[];
}
export interface WithdrawalExchangeCandidate {
  /** A taler://withdraw-exchange URI for the exchange. */
  talerUri: string;
  exchangeBaseUrl: string;
  currency: string;
  currencySpec: CurrencySpecification;
  exchangeEntryStatus: ExchangeEntryStatus;
  exchangeUpdateStatus: ExchangeUpdateStatus;
  source: ExchangeEntrySource;
  recommendationReasons: ExchangeRecommendationReason[];
  lastWithdrawal?: TalerPreciseTimestamp;
}
export declare enum ExchangeRecommendationReason {
  Preset = "preset",
  UserAdded = "user-added",
  PreviousWithdrawal = "previous-withdrawal",
  PreviouslyUsed = "previously-used",
}

20.6.2.94. GetExchangeEntryByUrlOp#

/**
 * Get the current terms of a service of an exchange.
 */
export type GetExchangeEntryByUrlOp = {
  op: WalletApiOperation.GetExchangeEntryByUrl;
  request: GetExchangeEntryByUrlRequest;
  response: GetExchangeEntryByUrlResponse;
};
// GetExchangeEntryByUrl = "getExchangeEntryByUrl"

export interface GetExchangeEntryByUrlRequest {
  exchangeBaseUrl: string;
}
export type GetExchangeEntryByUrlResponse = ExchangeListItem;

20.6.2.95. GetExchangeResourcesOp#

/**
 * Get resources associated with an exchange.
 */
export type GetExchangeResourcesOp = {
  op: WalletApiOperation.GetExchangeResources;
  request: GetExchangeResourcesRequest;
  response: GetExchangeResourcesResponse;
};
// GetExchangeResources = "getExchangeResources"

export interface GetExchangeResourcesRequest {
  exchangeBaseUrl: string;
}
export interface GetExchangeResourcesResponse {
  hasResources: boolean;
}

20.6.2.96. DeleteExchangeOp#

/**
 * Delete an exchange and its associated resources.
 */
export type DeleteExchangeOp = {
  op: WalletApiOperation.DeleteExchange;
  request: DeleteExchangeRequest;
  response: EmptyObject;
};
// DeleteExchange = "deleteExchange"

export interface DeleteExchangeRequest {
  exchangeBaseUrl: string;
  /**
   * Delete the exchange even if it's in use.
   */
  purge?: boolean;
}

20.6.2.97. PurgeExchangeLegacyKeysOp#

/** Purge every non-current key set retained for an exchange URL. */
export type PurgeExchangeLegacyKeysOp = {
  op: WalletApiOperation.PurgeExchangeLegacyKeys;
  request: PurgeExchangeLegacyKeysRequest;
  response: EmptyObject;
};
// PurgeExchangeLegacyKeys = "purgeExchangeLegacyKeys"

export interface PurgeExchangeLegacyKeysRequest {
  exchangeBaseUrl: string;
  /**
   * Current master key observed by the client before confirming the purge.
   * The operation fails atomically if the exchange has changed keys since.
   */
  currentMasterPub: string;
}

20.6.2.98. GetCurrencySpecificationOp#

export type GetCurrencySpecificationOp = {
  op: WalletApiOperation.GetCurrencySpecification;
  request: GetCurrencySpecificationRequest;
  response: GetCurrencySpecificationResponse;
};
// GetCurrencySpecification = "getCurrencySpecification"

export interface GetCurrencySpecificationRequest {
  scope: ScopeInfo;
}
export interface GetCurrencySpecificationResponse {
  currencySpecification: CurrencySpecification;
}

20.6.2.99. CreateDepositGroupOp#

/**
 * Create a new deposit group.
 *
 * Deposit groups are used to deposit multiple coins to a bank
 * account, usually the wallet user's own bank account.
 */
export type CreateDepositGroupOp = {
  op: WalletApiOperation.CreateDepositGroup;
  request: CreateDepositGroupRequest;
  response: CreateDepositGroupResponse;
};
// CreateDepositGroup = "createDepositGroup"

export interface CreateDepositGroupRequest {
  depositPaytoUri: string;
  /**
   * Instructed amount used for deposit coin selection.
   */
  amount: AmountString;
  /**
   * Restrict the deposit to a certain scope.
   */
  restrictScope?: ScopeInfo;
  /**
   * Use a fixed merchant private key.
   */
  testingFixedPriv?: string;
  /**
   * Optional wire deadline for the deposits.
   */
  wireDeadline?: TalerProtocolTimestamp;
  /**
   * Pre-allocated transaction ID.
   * Allows clients to easily handle notifications
   * that occur while the operation has been created but
   * before the creation request has returned.
   */
  transactionId?: TransactionIdStr;
  progressToken?: string;
}
/**
 * Response to a createDepositGroup request.
 */
export interface CreateDepositGroupResponse {
  /**
   * Transaction ID of the newly created deposit transaction.
   */
  transactionId: TransactionIdStr;
  /**
   * Current state of the new deposit transaction.
   * Returned as a performance optimization, so that the UI
   * doesn't have to do a separate getTransactionById.
   */
  txState: TransactionState;
  /**
   * @deprecated 2025-06-03, use transactionId instead.
   */
  depositGroupId: string;
}

20.6.2.100. CheckDepositOp#

export type CheckDepositOp = {
  op: WalletApiOperation.CheckDeposit;
  request: CheckDepositRequest;
  response: CheckDepositResponse;
};
// CheckDeposit = "checkDeposit"

export interface CheckDepositRequest {
  /**
   * Payto URI to identify the (bank) account that the exchange will wire
   * the money to.
   */
  depositPaytoUri: string;
  /**
   * Instructed amount used for deposit coin selection.
   *
   * CheckDepositResponse reports the resulting wallet cost and destination
   * amount, which can differ because of fees and refresh change.
   */
  amount: AmountString;
  /**
   * Restrict the deposit to a certain scope.
   */
  restrictScope?: ScopeInfo;
  progressToken?: string;
}
export interface CheckDepositResponse {
  totalDepositCost: AmountString;
  effectiveDepositAmount: AmountString;
  fees: DepositGroupFees;
  kycSoftLimit?: AmountString;
  kycHardLimit?: AmountString;
  /**
   * Base URL of exchanges that would likely require soft KYC.
   */
  kycExchanges?: string[];
}

20.6.2.101. ExportDbToFileOp#

/**
 * Export the database to a file.
 *
 * The target directory must already exist.
 */
export type ExportDbToFileOp = {
  op: WalletApiOperation.ExportDbToFile;
  request: ExportDbToFileRequest;
  response: ExportDbToFileResponse;
};
// ExportDbToFile = "exportDbToFile"

export interface ExportDbToFileRequest {
  /**
   * Directory that the DB should be exported into.
   */
  directory: string;
  /**
   * Stem of the exported DB filename.
   *
   * The final name will be ${directory}/${stem}.${extension},
   * where the extension depends on the used DB backend.
   */
  stem: string;
  /**
   * Force the format of the export.
   *
   * Supported values on filesystem-capable hosts are "json" and "sqlite3".
   * If omitted, the host's default is "sqlite3".
   */
  forceFormat?: string;
}
export interface ExportDbToFileResponse {
  /**
   * Full path to the backup.
   */
  path: string;
}

20.6.2.102. ImportDbFromFileOp#

/**
 * Import the database from a JSON or SQLite file.
 *
 * CAUTION: Overrides existing data.
 */
export type ImportDbFromFileOp = {
  op: WalletApiOperation.ImportDbFromFile;
  request: ImportDbFromFileRequest;
  response: EmptyObject;
};
// ImportDbFromFile = "importDbFromFile"

export interface ImportDbFromFileRequest {
  /**
   * Full path to a .json or .sqlite3 backup.
   */
  path: string;
  /** Correlates progress notifications and allows cancellation. */
  progressToken?: string;
}

20.6.2.103. CheckPeerPushDebitOp#

/**
 * Check if initiating a peer push payment is possible
 * based on the funds in the wallet.
 */
export type CheckPeerPushDebitOp = {
  op: WalletApiOperation.CheckPeerPushDebit;
  request: CheckPeerPushDebitRequest;
  response: CheckPeerPushDebitOkResponse;
};
// CheckPeerPushDebit = "checkPeerPushDebit"

20.6.2.104. CheckPeerPushDebitV2Op#

/**
 * Check if initiating a peer push payment is possible
 * based on the funds in the wallet.
 */
export type CheckPeerPushDebitV2Op = {
  op: WalletApiOperation.CheckPeerPushDebitV2;
  request: CheckPeerPushDebitRequest;
  response: CheckPeerPushDebitResponse;
};
// CheckPeerPushDebitV2 = "checkPeerPushDebitV2"

export interface CheckPeerPushDebitInsufficientBalanceResponse {
  type: "insufficient-balance";
  insufficientBalanceDetails: PaymentInsufficientBalanceDetails;
}

20.6.2.105. InitiatePeerPushDebitOp#

/**
 * Initiate an outgoing peer push payment.
 */
export type InitiatePeerPushDebitOp = {
  op: WalletApiOperation.InitiatePeerPushDebit;
  request: InitiatePeerPushDebitRequest;
  response: InitiatePeerPushDebitResponse;
};
// InitiatePeerPushDebit = "initiatePeerPushDebit"

export interface InitiatePeerPushDebitRequest {
  exchangeBaseUrl?: string;
  /**
   * Restrict the scope of funds that can be spent via the given
   * scope info.
   */
  restrictScope?: ScopeInfo;
  /** Quote returned by checkPeerPushDebitV2. */
  peerPushDebitQuote?: string;
  partialContractTerms: PartialPeerContractTerms;
}
export interface PartialPeerContractTerms {
  amount: AmountString;
  summary: string;
  icon_id?: string;
  purse_expiration?: TalerProtocolTimestamp;
}
export interface InitiatePeerPushDebitResponse {
  exchangeBaseUrl: string;
  pursePub: string;
  mergePriv: string;
  contractPriv: string;
  transactionId: TransactionIdStr;
}

20.6.2.106. PreparePeerPushCreditOp#

/**
 * Check an incoming peer push payment.
 */
export type PreparePeerPushCreditOp = {
  op: WalletApiOperation.PreparePeerPushCredit;
  request: PreparePeerPushCreditRequest;
  response: PreparePeerPushCreditResponse;
};
// PreparePeerPushCredit = "preparePeerPushCredit"

/**
 * Result of initiating a peer-push-credit payment.
 *
 * Either {@link talerUri} or {@link transactionId} must be specified.
 */
export interface PreparePeerPushCreditRequest {
  talerUri?: string;
  transactionId?: string;
  progressToken?: string;
}
export interface PreparePeerPushCreditResponse {
  contractTerms: PeerContractTerms;
  amountRaw: AmountString;
  amountEffective: AmountString;
  transactionId: TransactionIdStr;
  /**
   * State of the existing or newly created transaction.
   */
  txState: TransactionState;
  exchangeBaseUrl: string;
  scopeInfo: ScopeInfo;
  /**
   * @deprecated
   */
  amount: AmountString;
}

20.6.2.107. ConfirmPeerPushCreditOp#

/**
 * Accept an incoming peer push payment.
 */
export type ConfirmPeerPushCreditOp = {
  op: WalletApiOperation.ConfirmPeerPushCredit;
  request: ConfirmPeerPushCreditRequest;
  response: AcceptPeerPushPaymentResponse;
};
// ConfirmPeerPushCredit = "confirmPeerPushCredit"

export interface ConfirmPeerPushCreditRequest {
  transactionId: string;
  progressToken?: string;
}
export interface AcceptPeerPushPaymentResponse {
  transactionId: TransactionIdStr;
}

20.6.2.108. CheckPeerPullCreditOp#

/**
 * Check fees for an outgoing peer pull payment.
 */
export type CheckPeerPullCreditOp = {
  op: WalletApiOperation.CheckPeerPullCredit;
  request: CheckPeerPullCreditRequest;
  response: CheckPeerPullCreditResponse;
};
// CheckPeerPullCredit = "checkPeerPullCredit"

export interface CheckPeerPullCreditRequest {
  /**
   * Require using this particular exchange for this operation.
   */
  exchangeBaseUrl?: string;
  restrictScope?: ScopeInfo;
  amount: AmountString;
  progressToken?: string;
}
export interface CheckPeerPullCreditResponse {
  exchangeBaseUrl: string;
  amountRaw: AmountString;
  amountEffective: AmountString;
  /**
   * Wallet-selected default expiration for the request.
   */
  defaultExpiration: TalerProtocolDuration;
  /**
   * Number of coins that will be used,
   * can be used by the UI to warn if excessively large.
   */
  numCoins: number;
}

20.6.2.109. InitiatePeerPullCreditOp#

/**
 * Initiate an outgoing peer pull payment.
 */
export type InitiatePeerPullCreditOp = {
  op: WalletApiOperation.InitiatePeerPullCredit;
  request: InitiatePeerPullCreditRequest;
  response: InitiatePeerPullCreditResponse;
};
// InitiatePeerPullCredit = "initiatePeerPullCredit"

export interface InitiatePeerPullCreditRequest {
  exchangeBaseUrl?: string;
  partialContractTerms: PeerContractTerms;
  progressToken?: string;
}
export interface InitiatePeerPullCreditResponse {
  /**
   * Taler URI for the other party to make the payment
   * that was requested.
   *
   * @deprecated since it's not necessarily valid yet until the tx is in the right state
   */
  talerUri?: string;
  transactionId: TransactionIdStr;
}

20.6.2.110. PreparePeerPullDebitOp#

/**
 * Prepare for an incoming peer pull payment.
 */
export type PreparePeerPullDebitOp = {
  op: WalletApiOperation.PreparePeerPullDebit;
  request: PreparePeerPullDebitRequest;
  response: PreparePeerPullDebitResponse;
};
// PreparePeerPullDebit = "preparePeerPullDebit"

/**
 * Result of initiating a peer-pull-debit payment.
 *
 * Either {@link talerUri} or {@link transactionId} must be specified.
 */
export interface PreparePeerPullDebitRequest {
  talerUri?: string;
  transactionId?: string;
  progressToken?: string;
}
export interface PreparePeerPullDebitResponse {
  contractTerms: PeerContractTerms;
  amountRaw: AmountString;
  amountEffective: AmountString;
  transactionId: TransactionIdStr;
  /**
   * State of the existing or newly created transaction.
   */
  txState: TransactionState;
  exchangeBaseUrl: string;
  scopeInfo: ScopeInfo;
  /**
   * @deprecated Redundant field with bad name, will be removed soon.
   */
  amount: AmountString;
}

20.6.2.111. ConfirmPeerPullDebitOp#

/**
 * Accept an incoming peer pull payment (i.e. pay the other party).
 */
export type ConfirmPeerPullDebitOp = {
  op: WalletApiOperation.ConfirmPeerPullDebit;
  request: ConfirmPeerPullDebitRequest;
  response: AcceptPeerPullPaymentResponse;
};
// ConfirmPeerPullDebit = "confirmPeerPullDebit"

export interface ConfirmPeerPullDebitRequest {
  transactionId: TransactionIdStr;
}
export interface AcceptPeerPullPaymentResponse {
  transactionId: TransactionIdStr;
}

20.6.2.112. ValidateIbanOp#

export type ValidateIbanOp = {
  op: WalletApiOperation.ValidateIban;
  request: ValidateIbanRequest;
  response: ValidateIbanResponse;
};
// ValidateIban = "validateIban"

export interface ValidateIbanRequest {
  iban: string;
}
export interface ValidateIbanResponse {
  valid: boolean;
}

20.6.2.113. CanonicalizeBaseUrlOp#

export type CanonicalizeBaseUrlOp = {
  op: WalletApiOperation.CanonicalizeBaseUrl;
  request: CanonicalizeBaseUrlRequest;
  response: CanonicalizeBaseUrlResponse;
};
// CanonicalizeBaseUrl = "canonicalizeBaseUrl"

export interface CanonicalizeBaseUrlRequest {
  url: string;
}
export interface CanonicalizeBaseUrlResponse {
  url: string;
}

20.6.2.114. GetQrCodesForPaytoOp#

export type GetQrCodesForPaytoOp = {
  op: WalletApiOperation.GetQrCodesForPayto;
  request: GetQrCodesForPaytoRequest;
  response: GetQrCodesForPaytoResponse;
};
// GetQrCodesForPayto = "getQrCodesForPayto"

export interface GetQrCodesForPaytoRequest {
  paytoUri: string;
}
export interface GetQrCodesForPaytoResponse {
  codes: QrCodeSpec[];
}

20.6.2.115. ConvertIbanAccountFieldToPaytoOp#

export type ConvertIbanAccountFieldToPaytoOp = {
  op: WalletApiOperation.ConvertIbanAccountFieldToPayto;
  request: ConvertIbanAccountFieldToPaytoRequest;
  response: ConvertIbanAccountFieldToPaytoResponse;
};
// ConvertIbanAccountFieldToPayto = "convertIbanAccountFieldToPayto"

export interface ConvertIbanAccountFieldToPaytoRequest {
  value: string;
  currency: string;
}
export type ConvertIbanAccountFieldToPaytoResponse =
  | {
      ok: true;
      type: "iban" | "bban";
      paytoUri: string;
    }
  | {
      ok: false;
    };

20.6.2.116. ConvertIbanPaytoToAccountFieldOp#

export type ConvertIbanPaytoToAccountFieldOp = {
  op: WalletApiOperation.ConvertIbanPaytoToAccountField;
  request: ConvertIbanPaytoToAccountFieldRequest;
  response: ConvertIbanPaytoToAccountFieldResponse;
};
// ConvertIbanPaytoToAccountField = "convertIbanPaytoToAccountField"

export interface ConvertIbanPaytoToAccountFieldRequest {
  paytoUri: string;
}
export interface ConvertIbanPaytoToAccountFieldResponse {
  type: "iban" | "bban";
  value: string;
}

20.6.2.117. GetBankingChoicesForPaytoOp#

export type GetBankingChoicesForPaytoOp = {
  op: WalletApiOperation.GetBankingChoicesForPayto;
  request: GetBankingChoicesForPaytoRequest;
  response: GetBankingChoicesForPaytoResponse;
};
// GetBankingChoicesForPayto = "getBankingChoicesForPayto"

export interface GetBankingChoicesForPaytoRequest {
  paytoUri: string;
}
export interface GetBankingChoicesForPaytoResponse {
  choices: BankingChoiceSpec[];
}
export interface BankingChoiceSpec {
  label: string;
  type: "link";
  uri: string;
}

20.6.2.118. ExportDbOp#

/**
 * Export the wallet database's contents to JSON.
 */
export type ExportDbOp = {
  op: WalletApiOperation.ExportDb;
  request: EmptyObject;
  response: any;
};
// ExportDb = "exportDb"

20.6.2.119. ImportDbOp#

export type ImportDbOp = {
  op: WalletApiOperation.ImportDb;
  request: ImportDbRequest;
  response: EmptyObject;
};
// ImportDb = "importDb"

export interface ImportDbRequest {
  dump?: any;
  /** Correlates progress notifications and allows cancellation. */
  progressToken?: string;
}

20.6.2.120. MigrateDatabaseOp#

/**
 * Explicitly migrate an IndexedDB-emulation wallet to the native sqlite
 * schema.  The operation is idempotent when the wallet is already native.
 */
export type MigrateDatabaseOp = {
  op: WalletApiOperation.MigrateDatabase;
  request: MigrateDatabaseRequest;
  response: MigrateDatabaseResponse;
};
// MigrateDatabase = "migrateDatabase"

/** Start an explicit migration from IndexedDB emulation to native sqlite. */
export interface MigrateDatabaseRequest {
  /** Enables progress correlation and cancellation through cancelProgressToken. */
  progressToken?: string;
}
export interface MigrateDatabaseResponse {
  /** Whether this request changed the active database backend. */
  migrated: boolean;
  /** Database backend active after the request. */
  databaseBackend: WalletDatabaseBackend;
}

20.6.2.121. ClearDbOp#

/**
 * Dangerously clear the whole wallet database.
 */
export type ClearDbOp = {
  op: WalletApiOperation.ClearDb;
  request: EmptyObject;
  response: EmptyObject;
};
// ClearDb = "clearDb"

20.6.2.122. RecycleOp#

/**
 * Export a backup, clear the database and re-import it.
 */
export type RecycleOp = {
  op: WalletApiOperation.Recycle;
  request: EmptyObject;
  response: EmptyObject;
};
// Recycle = "recycle"

20.6.2.123. ApplyDevExperimentOp#

/**
 * Apply a developer experiment to the current wallet state.
 *
 * This allows UI developers / testers to play around without
 * an elaborate test environment.
 */
export type ApplyDevExperimentOp = {
  op: WalletApiOperation.ApplyDevExperiment;
  request: ApplyDevExperimentRequest;
  response: EmptyObject;
};
// ApplyDevExperiment = "applyDevExperiment"

export interface ApplyDevExperimentRequest {
  devExperimentUri: string;
}

20.6.2.124. RunIntegrationTestOp#

/**
 * Run a simple integration test on a test deployment
 * of the exchange and merchant.
 */
export type RunIntegrationTestOp = {
  op: WalletApiOperation.RunIntegrationTest;
  request: IntegrationTestArgs;
  response: EmptyObject;
};
// RunIntegrationTest = "runIntegrationTest"

export interface IntegrationTestArgs {
  exchangeBaseUrl: string;
  corebankApiBaseUrl: string;
  merchantBaseUrl: string;
  merchantAuthToken?: string;
  amountToWithdraw: AmountString;
  amountToSpend: AmountString;
}

20.6.2.125. RunIntegrationTestV2Op#

/**
 * Run a simple integration test on a test deployment
 * of the exchange and merchant.
 */
export type RunIntegrationTestV2Op = {
  op: WalletApiOperation.RunIntegrationTestV2;
  request: IntegrationTestV2Args;
  response: EmptyObject;
};
// RunIntegrationTestV2 = "runIntegrationTestV2"

export interface IntegrationTestV2Args {
  exchangeBaseUrl: string;
  corebankApiBaseUrl: string;
  merchantBaseUrl: string;
  merchantAuthToken?: string;
}

20.6.2.126. TestCryptoOp#

/**
 * Test crypto worker.
 */
export type TestCryptoOp = {
  op: WalletApiOperation.TestCrypto;
  request: EmptyObject;
  response: any;
};
// TestCrypto = "testCrypto"

20.6.2.127. WithdrawTestBalanceOp#

/**
 * Make withdrawal on a test deployment of the exchange
 * and merchant.
 */
export type WithdrawTestBalanceOp = {
  op: WalletApiOperation.WithdrawTestBalance;
  request: WithdrawTestBalanceRequest;
  response: WithdrawTestBalanceResult;
};
// WithdrawTestBalance = "withdrawTestBalance"

export interface WithdrawTestBalanceRequest {
  /**
   * Amount to withdraw.
   */
  amount: AmountString;
  /**
   * Corebank API base URL.
   */
  corebankApiBaseUrl: string;
  /**
   * Exchange to use for withdrawal.
   */
  exchangeBaseUrl: string;
  /**
   * Force the usage of a particular denomination selection.
   *
   * Only useful for testing.
   */
  forcedDenomSel?: ForcedDenomSel;
  /**
   * If set to true, treat the account created during
   * the withdrawal as a foreign withdrawal account.
   */
  useForeignAccount?: boolean;
}

20.6.2.128. WithdrawTestkudosOp#

/**
 * Make a withdrawal of testkudos on test.taler.net.
 */
export type WithdrawTestkudosOp = {
  op: WalletApiOperation.WithdrawTestkudos;
  request: EmptyObject;
  response: WithdrawTestBalanceResult;
};
// WithdrawTestkudos = "withdrawTestkudos"

20.6.2.129. TestPayOp#

/**
 * Make a test payment using a test deployment of
 * the exchange and merchant.
 */
export type TestPayOp = {
  op: WalletApiOperation.TestPay;
  request: TestPayArgs;
  response: TestPayResult;
};
// TestPay = "testPay"

export interface TestPayArgs {
  merchantBaseUrl: string;
  merchantAuthToken?: string;
  amount: AmountString;
  summary: string;
  forcedCoinSel?: ForcedCoinSel;
}
export interface TestPayResult {
  /**
   * Number of coins used for the payment.
   */
  numCoins: number;
}

20.6.2.130. GetActiveTasksOp#

export type GetActiveTasksOp = {
  op: WalletApiOperation.GetActiveTasks;
  request: EmptyObject;
  response: GetActiveTasksResponse;
};
// GetActiveTasks = "getActiveTasks"

export interface GetActiveTasksResponse {
  tasks: ActiveTask[];
}
export interface ActiveTask {
  taskId: string;
  transaction?: TransactionIdStr | undefined;
  firstTry?: AbsoluteTime | undefined;
  nextTry?: AbsoluteTime | undefined;
  retryCounter?: number | undefined;
  lastError?: TalerErrorDetail | undefined;
}

20.6.2.131. GetPerformanceStatsOp#

/**
 * Get a list of performance stats for diagnostics.
 *
 * Requires observability events to be enabled. Performance tables for the
 * current running wallet instance are generated from observability events and
 * stored in memory.
 *
 * Under each table, different types of duration for each operation
 * (e.g. getBalances wallet request) are included.
 */
export type GetPerformanceStatsOp = {
  op: WalletApiOperation.TestingGetPerformanceStats;
  request: GetPerformanceStatsRequest;
  response: GetPerformanceStatsResponse;
};
// TestingGetPerformanceStats = "testingGetPerformanceStats"

export interface GetPerformanceStatsRequest {
  /**
   * Limit to N largest average performance stats of each table.
   *
   * When undefined, all performance stats will be returned.
   */
  limit?: number;
}
export interface GetPerformanceStatsResponse {
  stats: PerformanceTable;
}
export type PerformanceTable = {
  [key in PerformanceStatType]?: PerformanceStat[];
};
export declare enum PerformanceStatType {
  HttpFetch = "http-fetch",
  DbQuery = "db-query",
  Crypto = "crypto",
  WalletRequest = "wallet-request",
  WalletTask = "wallet-task",
}
export type PerformanceStat =
  | {
      type: PerformanceStatType.HttpFetch;
      url: string;
      avgDurationMs: number;
      maxDurationMs: number;
      minDurationMs: number;
      totalDurationMs: number;
      count: number;
    }
  | {
      type: PerformanceStatType.DbQuery;
      name: string;
      location: string;
      avgDurationMs: number;
      maxDurationMs: number;
      minDurationMs: number;
      totalDurationMs: number;
      count: number;
    }
  | {
      type: PerformanceStatType.Crypto;
      operation: string;
      avgDurationMs: number;
      maxDurationMs: number;
      minDurationMs: number;
      totalDurationMs: number;
      count: number;
    }
  | {
      type: PerformanceStatType.WalletRequest;
      operation: string;
      avgDurationMs: number;
      maxDurationMs: number;
      minDurationMs: number;
      totalDurationMs: number;
      count: number;
    }
  | {
      type: PerformanceStatType.WalletTask;
      taskId: string;
      avgDurationMs: number;
      maxDurationMs: number;
      minDurationMs: number;
      totalDurationMs: number;
      count: number;
    };

20.6.2.132. DumpCoinsOp#

/**
 * Dump all coins of the wallet in a simple JSON format.
 */
export type DumpCoinsOp = {
  op: WalletApiOperation.DumpCoins;
  request: EmptyObject;
  response: CoinDumpJson;
};
// DumpCoins = "dumpCoins"

/**
 * Easy to process format for the public data of coins
 * managed by the wallet.
 */
export 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 refreshing.
     */
    withdrawalReservePub: string | undefined;
    /**
     * Status of the coin.
     */
    coinStatus: CoinStatus;
    /**
     * Information about the age restriction
     */
    ageCommitmentProof: AgeCommitmentProof | undefined;
    history: WalletCoinHistoryItem[];
  }>;
}
export type DenominationPubKey = RsaDenominationPubKey | CsDenominationPubKey;
export interface RsaDenominationPubKey {
  readonly cipher: DenomKeyType.Rsa;
  readonly rsa_public_key: string;
  readonly age_mask: number;
}
export declare enum DenomKeyType {
  Rsa = "RSA",
  ClauseSchnorr = "CS",
}
export interface CsDenominationPubKey {
  readonly cipher: DenomKeyType.ClauseSchnorr;
  readonly age_mask: number;
  readonly cs_public_key: string;
}
/**
 * Status of a coin.
 */
export declare enum CoinStatus {
  /**
   * Withdrawn and never shown to anybody.
   */
  Fresh = "fresh",
  /**
   * Coin was lost as the denomination is not usable anymore.
   */
  DenomLoss = "denom-loss",
  /**
   * Fresh, but currently marked as "suspended", thus won't be used
   * for spending.  Used for testing.
   */
  FreshSuspended = "fresh-suspended",
  /**
   * A coin that has been spent and refreshed.
   */
  Dormant = "dormant",
}
export interface AgeCommitmentProof {
  commitment: AgeCommitment;
  proof: AgeProof;
}
export interface AgeCommitment {
  mask: number;
  /**
   * Public keys, one for each age group specified in the age mask.
   */
  publicKeys: Edx25519PublicKeyEnc[];
}
export type Edx25519PublicKeyEnc = string & FlavorEdx25519PublicKeyEnc;
type FlavorEdx25519PublicKeyEnc = {
  readonly [isEdx25519PublicKeyEnc]?: true;
};
export interface AgeProof {
  /**
   * Private keys.  Typically smaller than the number of public keys,
   * because we drop private keys from age groups that are restricted.
   */
  privateKeys: Edx25519PrivateKeyEnc[];
}
export type Edx25519PrivateKeyEnc = string & FlavorEdx25519PrivateKeyEnc;
type FlavorEdx25519PrivateKeyEnc = {
  readonly [isEdx25519PrivateKeyEnc]?: true;
};
export 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;
    };

20.6.2.133. TestingSetTimetravelOp#

/**
 * Add an offset to the wallet's internal time.
 */
export type TestingSetTimetravelOp = {
  op: WalletApiOperation.TestingSetTimetravel;
  request: TestingSetTimetravelRequest;
  response: EmptyObject;
};
// TestingSetTimetravel = "testingSetTimetravel"

export interface TestingSetTimetravelRequest {
  offsetMs: number;
}

20.6.2.134. TestingWaitTransactionsFinalOp#

/**
 * Wait until all transactions are in a final state.
 */
export type TestingWaitTransactionsFinalOp = {
  op: WalletApiOperation.TestingWaitTransactionsFinal;
  request: EmptyObject;
  response: EmptyObject;
};
// TestingWaitTransactionsFinal = "testingWaitTransactionsFinal"

20.6.2.135. TestingWaitTasksDoneOp#

/**
 * Wait until all transactions are in a final state.
 */
export type TestingWaitTasksDoneOp = {
  op: WalletApiOperation.TestingWaitTasksDone;
  request: EmptyObject;
  response: EmptyObject;
};
// TestingWaitTasksDone = "testingWaitTasksDone"

20.6.2.136. TestingWaitRefreshesFinalOp#

/**
 * Wait until all refresh transactions are in a final state.
 */
export type TestingWaitRefreshesFinalOp = {
  op: WalletApiOperation.TestingWaitRefreshesFinal;
  request: EmptyObject;
  response: EmptyObject;
};
// TestingWaitRefreshesFinal = "testingWaitRefreshesFinal"

20.6.2.137. TestingWaitBalanceOp#

/**
 * Wait until a balance has reached the desired value.
 */
export type TestingWaitBalanceOp = {
  op: WalletApiOperation.TestingWaitBalance;
  request: TestingWaitBalanceRequest;
  response: EmptyObject;
};
// TestingWaitBalance = "testingWaitBalance"

export interface TestingWaitBalanceRequest {
  type: "material" | "available";
  amount: AmountString;
}

20.6.2.138. TestingWaitTransactionStateOp#

/**
 * Wait until a transaction is in a particular state.
 */
export type TestingWaitTransactionStateOp = {
  op: WalletApiOperation.TestingWaitTransactionState;
  request: TestingWaitTransactionRequest;
  response: TestingWaitTransactionStateResponse;
};
// TestingWaitTransactionState = "testingWaitTransactionState"

export interface TestingWaitTransactionRequest {
  transactionId: TransactionIdStr;
  /**
   * Additional identifier that is used in the logs
   * to easily find the status of the particular wait
   * request.
   */
  logId?: string;
  /**
   * After the timeout has passed, give up on
   * waiting for the desired state and raise
   * an error instead.
   */
  timeout?: DurationUnitSpec;
  /**
   * If set to true, wait until the desired state
   * is reached with an error.
   */
  requireError?: boolean;
  txState: TestingWaitTxStateSpec;
  /**
   * States that end the wait even though they are not the
   * state that was waited for.  The response says which of the
   * two sets matched.
   *
   * Without this, a transaction that ends up in a state it will
   * never leave keeps the caller waiting until the timeout.
   */
  bailStates?: TestingWaitTxStateSpec;
  /**
   * End the wait as soon as an error is recorded for the transaction.
   *
   * Beware that this includes transient errors of retried operations,
   * which are cleared again once the operation succeeds.
   */
  bailOnError?: boolean;
}
export interface DurationUnitSpec {
  seconds?: number;
  minutes?: number;
  hours?: number;
  days?: number;
  months?: number;
  years?: number;
}
/**
 * State(s) to wait for.
 *
 * A plain pattern or a list of patterns (matching any of them),
 * a wallet-internal numeric state ID, or one of the shorthands
 * for a category of states.
 */
export type TestingWaitTxStateSpec =
  | TransactionStatePattern
  | TransactionStatePattern[]
  | number
  | "nonpending"
  | "final";
export interface TransactionStatePattern {
  major: TransactionMajorState | TransactionStateWildcard;
  minor?: TransactionMinorState | TransactionStateWildcard;
  /**
   * Required value of the "working" flag of the transaction state.
   * A transaction state without the flag counts as false.
   *
   * If left undefined, the flag is not taken into account
   * when matching, i.e. it behaves like a wildcard.
   */
  working?: boolean | TransactionStateWildcard;
}
export type TransactionStateWildcard = "*";
export interface TestingWaitTransactionStateResponse {
  /**
   * Which set of states ended the wait: the requested state
   * or one of the bail states.
   */
  matched: "target" | "bail";
  /**
   * State that ended the wait.
   */
  txState: TransactionState;
  /**
   * Wallet-internal state ID, only used for debugging and testing.
   */
  stId: number;
}

20.6.2.139. TestingWaitExchangeStateOp#

/**
 * Wait until an exchange entry is in a particular state.
 */
export type TestingWaitExchangeStateOp = {
  op: WalletApiOperation.TestingWaitExchangeState;
  request: TestingWaitExchangeStateRequest;
  response: EmptyObject;
};
// TestingWaitExchangeState = "testingWaitExchangeState"

export interface TestingWaitExchangeStateRequest {
  exchangeBaseUrl: string;
  walletKycStatus?: ExchangeWalletKycStatus;
}

20.6.2.140. TestingWaitExchangeReadyOp#

/**
 * Wait until an exchange entry is ready.
 * Returns an error if updating the exchange
 * failed.
 */
export type TestingWaitExchangeReadyOp = {
  op: WalletApiOperation.TestingWaitExchangeReady;
  request: TestingWaitExchangeReadyRequest;
  response: EmptyObject;
};
// TestingWaitExchangeReady = "testingWaitExchangeReady"

export interface TestingWaitExchangeReadyRequest {
  exchangeBaseUrl: string;
  /**
   * Do not stop waiting even when the exchange is
   * in an error state.
   */
  noBail?: boolean;
  /**
   * Force waiting until an update really happened.
   */
  forceUpdate?: boolean;
  /**
   * Only consider the exchange as ready if the
   * next auto-refresh is scheduled for the future.
   */
  waitAutoRefresh?: boolean;
}

20.6.2.141. TestingPingOp#

export type TestingPingOp = {
  op: WalletApiOperation.TestingPing;
  request: EmptyObject;
  response: EmptyObject;
};
// TestingPing = "testingPing"

20.6.2.142. TestingGetReserveHistoryOp#

export type TestingGetReserveHistoryOp = {
  op: WalletApiOperation.TestingGetReserveHistory;
  request: TestingGetReserveHistoryRequest;
  response: any;
};
// TestingGetReserveHistory = "testingGetReserveHistory"

export interface TestingGetReserveHistoryRequest {
  reservePub: string;
  exchangeBaseUrl: string;
}

20.6.2.143. TestingResetAllRetriesOp#

/**
 * Reset all task/transaction retries,
 * resulting in immediate re-try of all operations.
 */
export type TestingResetAllRetriesOp = {
  op: WalletApiOperation.TestingResetAllRetries;
  request: EmptyObject;
  response: EmptyObject;
};
// TestingResetAllRetries = "testingResetAllRetries"

20.6.2.144. TestingGetDenomStatsOp#

/**
 * Get stats about an exchange denomination.
 */
export type TestingGetDenomStatsOp = {
  op: WalletApiOperation.TestingGetDenomStats;
  request: TestingGetDenomStatsRequest;
  response: TestingGetDenomStatsResponse;
};
// TestingGetDenomStats = "testingGetDenomStats"

export interface TestingGetDenomStatsRequest {
  exchangeBaseUrl: string;
}
export interface TestingGetDenomStatsResponse {
  numKnown: number;
  numOffered: number;
  numLost: number;
}

20.6.2.145. TestingRunFixupOp#

export type TestingRunFixupOp = {
  op: WalletApiOperation.TestingRunFixup;
  request: RunFixupRequest;
  response: EmptyObject;
};
// TestingRunFixup = "testingRunFixup"

export interface RunFixupRequest {
  id: string;
}

20.6.2.146. GetDiagnosticsOp#

20.6.2.147. TestingGetDiagnosticsOp#

/** @deprecated Use {@link GetDiagnosticsOp}. */
export type TestingGetDiagnosticsOp = GetDiagnosticsOp;

20.6.2.148. TestingGetFlightRecordsOp#

export type TestingGetFlightRecordsOp = {
  op: WalletApiOperation.TestingGetFlightRecords;
  request: EmptyObject;
  response: TestingGetFlightRecordsResponse;
};
// TestingGetFlightRecords = "testingGetFlightRecords"

export interface TestingGetFlightRecordsResponse {
  flightRecords: FlightRecordEntry[];
}
export interface FlightRecordEntry {
  timestamp: TalerPreciseTimestamp;
  target: string;
  event: FlightRecordEvent;
}
export declare enum FlightRecordEvent {
  MeltGone = "melt-gone",
  WithdrawalRedenominate = "withdrawal-redenominate",
}

20.6.2.149. TestingCorruptWithdrawalCoinSelOp#

export type TestingCorruptWithdrawalCoinSelOp = {
  op: WalletApiOperation.TestingCorruptWithdrawalCoinSel;
  request: TestingCorruptWithdrawalCoinSelRequest;
  response: EmptyObject;
};
// TestingCorruptWithdrawalCoinSel = "testingCorruptWithdrawalCoinSel"

export interface TestingCorruptWithdrawalCoinSelRequest {
  transactionId: TransactionIdStr;
}

20.6.2.150. SetCoinSuspendedOp#

/**
 * Set a coin as (un-)suspended.
 * Suspended coins won't be used for payments.
 */
export type SetCoinSuspendedOp = {
  op: WalletApiOperation.SetCoinSuspended;
  request: SetCoinSuspendedRequest;
  response: EmptyObject;
};
// SetCoinSuspended = "setCoinSuspended"

export interface SetCoinSuspendedRequest {
  coinPub: string;
  suspended: boolean;
}

20.6.2.151. ForceRefreshOp#

/**
 * Force a refresh on coins where it would not
 * be necessary.
 */
export type ForceRefreshOp = {
  op: WalletApiOperation.ForceRefresh;
  request: ForceRefreshRequest;
  response: EmptyObject;
};
// ForceRefresh = "forceRefresh"

export interface ForceRefreshRequest {
  refreshCoinSpecs: RefreshCoinSpec[];
}
export interface RefreshCoinSpec {
  coinPub: string;
  amount?: AmountString;
}

20.6.3. Common Declarations#

export enum WalletApiOperation {
  // Initialization and wallet lifecycle
  InitWallet = "initWallet",
  SetWalletRunConfig = "setWalletRunConfig",
  GetVersion = "getVersion",
  Shutdown = "shutdown",
  // Generic request management
  RetryProgressTokenNow = "retryProgressTokenNow",
  CancelProgressToken = "cancelProgressToken",
  // Balances
  GetBalances = "getBalances",
  GetBalanceRefreshInfo = "getBalanceRefreshInfo",
  ObserveBalanceRefreshInfo = "observeBalanceRefreshInfo",
  GetBalanceDetail = "getBalanceDetail",
  // Misc.
  GetActiveTasks = "getActiveTasks",
  ValidateIban = "validateIban",
  GetCurrencySpecification = "getCurrencySpecification",
  ListGlobalCurrencyExchanges = "listGlobalCurrencyExchanges",
  ListGlobalCurrencyAuditors = "listGlobalCurrencyAuditors",
  AddGlobalCurrencyExchange = "addGlobalCurrencyExchange",
  RemoveGlobalCurrencyExchange = "removeGlobalCurrencyExchange",
  AddGlobalCurrencyAuditor = "addGlobalCurrencyAuditor",
  RemoveGlobalCurrencyAuditor = "removeGlobalCurrencyAuditor",
  CanonicalizeBaseUrl = "canonicalizeBaseUrl",
  StartExchangeWalletKyc = "startExchangeWalletKyc",
  GetBankingChoicesForPayto = "getBankingChoicesForPayto",
  ConvertIbanAccountFieldToPayto = "convertIbanAccountFieldToPayto",
  ConvertIbanPaytoToAccountField = "convertIbanPaytoToAccountField",
  // Generic transaction management
  GetTransactions = "getTransactions",
  GetTransactionsV2 = "getTransactionsV2",
  GetTransactionById = "getTransactionById",
  ResolveTransactionReference = "resolveTransactionReference",
  AbortTransaction = "abortTransaction",
  FailTransaction = "failTransaction",
  SuspendTransaction = "suspendTransaction",
  ResumeTransaction = "resumeTransaction",
  DeleteTransaction = "deleteTransaction",
  RetryTransaction = "retryTransaction",
  ListAssociatedRefreshes = "listAssociatedRefreshes",
  // Bank account management
  ListBankAccounts = "listBankAccounts",
  GetBankAccountById = "getBankAccountById",
  AddBankAccount = "addBankAccount",
  ForgetBankAccount = "forgetBankAccount",
  // Exchange entry management
  AddExchange = "addExchange",
  ListExchanges = "listExchanges",
  ListWithdrawalExchangeCandidates = "listWithdrawalExchangeCandidates",
  /** @deprecated Use listWithdrawalExchangeCandidates instead. */
  GetDefaultExchanges = "getDefaultExchanges",
  GetExchangeEntryByUrl = "getExchangeEntryByUrl",
  UpdateExchangeEntry = "updateExchangeEntry",
  GetExchangeResources = "getExchangeResources",
  CompleteExchangeBaseUrl = "completeExchangeBaseUrl",
  DeleteExchange = "deleteExchange",
  PurgeExchangeLegacyKeys = "purgeExchangeLegacyKeys",
  ConfirmExchangeKeyChange = "confirmExchangeKeyChange",
  SetExchangeTosAccepted = "setExchangeTosAccepted",
  SetExchangeTosForgotten = "setExchangeTosForgotten",
  GetExchangeTos = "getExchangeTos",
  GetExchangeDetailedInfo = "getExchangeDetailedInfo",
  // Withdrawals
  PrepareWithdrawExchange = "prepareWithdrawExchange",
  PrepareBankIntegratedWithdrawal = "prepareBankIntegratedWithdrawal",
  ConfirmWithdrawal = "confirmWithdrawal",
  AcceptBankIntegratedWithdrawal = "acceptBankIntegratedWithdrawal",
  GetWithdrawalDetailsForAmount = "getWithdrawalDetailsForAmount",
  AcceptManualWithdrawal = "acceptManualWithdrawal",
  // Merchant Payments
  GetChoicesForPayment = "getChoicesForPayment",
  PreparePayForUriV2 = "preparePayForUriV2",
  PreparePayForTemplateV2 = "preparePayForTemplateV2",
  PreparePayForPaivana = "preparePayForPaivana",
  GetPaivanaCookie = "getPaivanaCookie",
  UnclaimPayment = "unclaimPayment",
  ReclaimPayment = "reclaimPayment",
  CheckPayForTemplate = "checkPayForTemplate",
  StartRefundQueryForUri = "startRefundQueryForUri",
  StartRefundQuery = "startRefundQuery",
  ConfirmPay = "confirmPay",
  // Deposits
  CheckDeposit = "checkDeposit",
  CreateDepositGroup = "createDepositGroup",
  /**
   * @deprecated Use CheckDeposit for a concrete instructed amount, or
   * GetMaxDepositAmount to query deposit limits.
   */
  ConvertDepositAmount = "convertDepositAmount",
  GetMaxDepositAmount = "getMaxDepositAmount",
  GetDepositWireTypes = "getDepositWireTypes",
  GetDepositWireTypesForCurrency = "getDepositWireTypesForCurrency",
  // P2P Payments
  PreparePeerPushCredit = "preparePeerPushCredit",
  CheckPeerPushDebit = "checkPeerPushDebit",
  CheckPeerPushDebitV2 = "checkPeerPushDebitV2",
  InitiatePeerPushDebit = "initiatePeerPushDebit",
  ConfirmPeerPushCredit = "confirmPeerPushCredit",
  CheckPeerPullCredit = "checkPeerPullCredit",
  InitiatePeerPullCredit = "initiatePeerPullCredit",
  PreparePeerPullDebit = "preparePeerPullDebit",
  ConfirmPeerPullDebit = "confirmPeerPullDebit",
  GetMaxPeerPushDebitAmount = "getMaxPeerPushDebitAmount",
  // Tokens and token families
  ListDiscounts = "listDiscounts",
  DeleteDiscount = "deleteDiscount",
  ListSubscriptions = "listSubscriptions",
  DeleteSubscription = "deleteSubscription",
  // Donau
  SetDonau = "setDonau",
  GetDonau = "getDonau",
  GetDonauStatements = "getDonauStatements",
  // Mailbox
  AddContact = "addContact",
  DeleteContact = "deleteContact",
  GetContacts = "getContacts",
  GetMailbox = "getMailbox",
  InitializeMailbox = "initializeMailbox",
  GetMailboxMessages = "getMailboxMessage",
  AddMailboxMessage = "addMailboxMessage",
  DeleteMailboxMessage = "deleteMailboxMessage",
  SendTalerUriMailboxMessage = "sendTalerUriMailboxMessage",
  RefreshMailbox = "refreshMailbox",
  // Taldir
  RegisterAlias = "registerAlias",
  CompleteRegisterAlias = "completeRegisterAlias",
  LookupAlias = "lookupAlias",
  // Wallet database management
  ImportDb = "importDb",
  ExportDb = "exportDb",
  ExportDbToFile = "exportDbToFile",
  ImportDbFromFile = "importDbFromFile",
  MigrateDatabase = "migrateDatabase",
  ClearDb = "clearDb",
  Recycle = "recycle",
  // Testing
  ApplyDevExperiment = "applyDevExperiment",
  TestingGetSampleTransactions = "testingGetSampleTransactions",
  WithdrawTestkudos = "withdrawTestkudos",
  WithdrawTestBalance = "withdrawTestBalance",
  RunIntegrationTest = "runIntegrationTest",
  RunIntegrationTestV2 = "runIntegrationTestV2",
  DumpCoins = "dumpCoins",
  TestCrypto = "testCrypto",
  TestPay = "testPay",
  SetCoinSuspended = "setCoinSuspended",
  ForceRefresh = "forceRefresh",
  TestingWaitTransactionsFinal = "testingWaitTransactionsFinal",
  TestingWaitRefreshesFinal = "testingWaitRefreshesFinal",
  TestingWaitTransactionState = "testingWaitTransactionState",
  TestingWaitExchangeState = "testingWaitExchangeState",
  TestingWaitExchangeReady = "testingWaitExchangeReady",
  TestingWaitTasksDone = "testingWaitTasksDone",
  TestingWaitBalance = "testingWaitBalance",
  TestingGetDbStats = "testingGetDbStats",
  TestingSetTimetravel = "testingSetTimetravel",
  TestingGetDenomStats = "testingGetDenomStats",
  TestingPing = "testingPing",
  TestingGetReserveHistory = "testingGetReserveHistory",
  TestingResetAllRetries = "testingResetAllRetries",
  TestingWaitExchangeWalletKyc = "testingWaitWalletKyc",
  TestingPlanMigrateExchangeBaseUrl = "testingPlanMigrateExchangeBaseUrl",
  TestingRunFixup = "testingRunFixup",
  TestingGetFlightRecords = "testingGetFlightRecords",
  TestingGetPerformanceStats = "testingGetPerformanceStats",
  TestingCorruptWithdrawalCoinSel = "testingCorruptWithdrawalCoinSel",
  // Diagnostics
  GetDiagnostics = "getDiagnostics",
  // Hints
  HintNetworkAvailability = "hintNetworkAvailability",
  HintPowerState = "hintPowerState",
  DismissWalletWarning = "dismissWalletWarning",
  HintApplicationResumed = "hintApplicationResumed",
  /**
   * @deprecated (2025-05-07)
   * Use {@link WalletApiOperation.PrepareBankIntegratedWithdrawal} instead.
   */
  GetWithdrawalDetailsForUri = "getWithdrawalDetailsForUri",
  /**
   * @deprecated(2026-05-26) Consult withdrawal transaction details instead.
   */
  GetQrCodesForPayto = "getQrCodesForPayto",
}
export interface InitRequest {
  config?: PartialWalletRunConfig;
}
export interface PartialWalletRunConfig {
  testing?: Partial<WalletRunConfig["testing"]>;
  features?: Partial<WalletRunConfig["features"]>;
  lazyTaskLoop?: Partial<WalletRunConfig["lazyTaskLoop"]>;
  logLevel?: Partial<WalletRunConfig["logLevel"]>;
}
export interface WalletRunConfig {
  /**
   * Unsafe options which it should only be used to create
   * testing environment.
   */
  testing: {
    devModeActive: boolean;
    insecureTrustExchange: boolean;
    preventThrottling: boolean;
    skipDefaults: boolean;
    emitObservabilityEvents?: boolean;
    /**
     * Coin selection algorithm to use when spending.
     *
     * Defaults to the TALER_WALLET_COINSEL environment variable, and to
     * "default" when that is unset.
     */
    coinSelectionAlgorithm: CoinSelectionAlgorithm;
  };
  /**
   * Configurations values that may be safe to show to the user
   */
  features: {
    allowHttp: boolean;
    /**
     * Migrate the wallet database to wallet-core's native sqlite schema,
     * replacing the IndexedDB emulation it has been stored in so far.
     *
     * Checked whenever the wallet is initialized, so a client that offers
     * this as a setting only has to initialize the wallet again for it to
     * take effect.  Off by default: the native schema is still experimental.
     *
     * The migration happens once and is not undone by clearing the flag --
     * afterwards the database *is* a native one.  It also only ever runs
     * where the host stores the wallet in a sqlite file, which excludes the
     * browser extension.
     */
    migrateNativeDb: boolean;
    /**
     * Use wallet-core's native sqlite schema when initializing a new, empty
     * database.
     *
     * Unlike migrateNativeDb, this never converts an existing IndexedDB
     * wallet.  Hosts without a native sqlite backend ignore the preference.
     */
    useNativeDb: boolean;
  };
  /**
   * Start processing tasks only when explicitly required, even after
   * init has been called.
   *
   * Useful when the wallet is started to make single read-only request,
   * as otherwise wallet-core starts making network request and process
   * unrelated pending tasks.
   */
  lazyTaskLoop: boolean;
  /**
   * Global log level.
   */
  logLevel: string;
}
/**
 * Coin selection algorithm the wallet uses when spending.
 *
 * "legacy-2024" is the algorithm the wallet shipped with in 2024: strictly
 * largest-coin-first, without the exact-fit shortcut and the deposit-fee
 * allowance correction that were added later.  It is kept reachable because
 * test suites outside this repository (in particular the exchange's auditor
 * tests) pin the coin selections it produces.
 */
export type CoinSelectionAlgorithm = "default" | "legacy-2024";
export interface InitResponse {
  versionInfo: WalletCoreVersion;
  /** Database backend used by the initialized wallet. */
  databaseBackend: WalletDatabaseBackend;
}
export interface WalletCoreVersion {
  implementationSemver: string;
  implementationGitHash: string;
  /**
   * Wallet-core protocol version supported by this implementation
   * of the API ("server" version).
   */
  version: string;
  exchange: string;
  merchant: string;
  bankIntegrationApiRange: string;
  bankConversionApiRange: string;
  corebankApiRange: string;
  /**
   * @deprecated as bank was split into multiple APIs with separate versioning
   */
  bank: string;
  /**
   * @deprecated
   */
  hash: string | undefined;
  /**
   * @deprecated will be removed
   */
  devMode: boolean;
}
export type WalletDatabaseBackend = "indexeddb" | "sqlite";
export type EmptyObject = Record<string, never>;
export type AmountString =
  | (string & {
      [__amount_str]: true;
    })
  | LitAmountString;
export type LitAmountString = `${string}:${number}`;
export type EddsaSignatureString = string;
export type EddsaPublicKeyString = string;
export interface ContactEntry {
  /**
   * Contact alias
   */
  alias: string;
  /**
   * Alias type
   */
  aliasType: string;
  /**
   * mailbox URI
   */
  mailboxBaseUri: string;
  /**
   * mailbox identity
   */
  mailboxAddress: HashCodeString;
  /**
   * The source of this contact
   * may be a URI
   */
  source: string;
  /**
   * The local petname of the contact
   */
  petname: string;
}
export type HashCodeString = string;
export type RelativeTime = TalerProtocolDuration;
export interface TalerProtocolDuration {
  readonly d_us: number | "forever";
}
export interface MailboxConfiguration {
  mailboxBaseUrl: string;
  privateKey: EddsaPrivateKeyString;
  privateEncryptionKey: string;
  expiration: Timestamp;
  hAddress: string;
  payUri?: TalerUri;
}
export type EddsaPrivateKeyString = string;
export type Timestamp = TalerProtocolTimestamp;
export interface TalerProtocolTimestamp {
  /**
   * Seconds (as integer) since epoch.
   */
  readonly t_s: number | "never";
  readonly _flavor?: typeof flavor_TalerProtocolTimestamp;
}
export interface TalerPayUriResult {
  type: TalerUriAction.Pay;
  merchantBaseUrl: HostPortPath;
  orderId: string;
  /**
   * Session the payment is bound to.  Undefined if the payment is not
   * bound to any session, which the URI encodes as an empty last path
   * component.
   */
  sessionId?: string;
  claimToken?: string;
  /**
   * Nonce priv, only present in the
   * "continue on mobile" payment flow.
   */
  noncePriv?: string;
  nfc?: boolean;
}
export declare enum TalerUriAction {
  /**
   * https://lsd.gnunet.org/lsd0006/#section-5.1
   */
  Withdraw = "withdraw",
  /**
   * https://lsd.gnunet.org/lsd0006/#section-5.2
   */
  Pay = "pay",
  /**
   * https://lsd.gnunet.org/lsd0006/#section-5.3
   */
  Refund = "refund",
  /**
   * https://lsd.gnunet.org/lsd0006/#section-5.4
   */
  PayPush = "pay-push",
  /**
   * https://lsd.gnunet.org/lsd0006/#section-5.5
   */
  PayPull = "pay-pull",
  /**
   * https://lsd.gnunet.org/lsd0006/#section-5.6
   */
  PayTemplate = "pay-template",
  /**
   * https://lsd.gnunet.org/lsd0006/#section-5.7
   */
  Restore = "restore",
  /**
   * https://lsd.gnunet.org/lsd0006/#section-5.8
   */
  DevExperiment = "dev-experiment",
  /**
   * https://lsd.gnunet.org/lsd0006/#section-5.9
   */
  AddExchange = "add-exchange",
  /**
   * https://lsd.gnunet.org/lsd0006/#section-5.10
   */
  WithdrawExchange = "withdraw-exchange",
  /**
   * https://lsd.gnunet.org/lsd0006/#section-5.12
   */
  WithdrawalTransferResult = "withdrawal-transfer-result",
  /**
   * FIXME: LSD
   * Add a contact to the wallet
   */
  AddContact = "add-contact",
}
export type HostPortPath = string & {
  [__hostport_str]: true;
};
export interface TalerPayTemplateUri {
  type: TalerUriAction.PayTemplate;
  merchantBaseUrl: HostPortPath;
  templateId: string;
  sessionId?: string;
  fulfillmentUrl?: string;
  editableSummary?: boolean;
  summary?: string;
  editableAmount?: boolean;
  amount?: AmountString;
  nfc?: boolean;
}
export interface TalerDevExperimentUri {
  type: TalerUriAction.DevExperiment;
  devExperimentId: string;
  query?: Record<string, string>;
}
export interface TalerPayPullUri {
  type: TalerUriAction.PayPull;
  exchangeBaseUrl: HostPortPath;
  contractPriv: EddsaPrivateKeyString;
  /** Exchange-authenticated purse metadata, required before paying. */
  purseCreateProof?: {
    totalDeposited: AmountString;
    exchangeTimestamp: TalerProtocolTimestamp;
    exchangeSig: EddsaSignatureString;
    exchangePub: EddsaPublicKeyString;
  };
}
export interface TalerPayPushUri {
  type: TalerUriAction.PayPush;
  exchangeBaseUrl: HostPortPath;
  contractPriv: EddsaPrivateKeyString;
}
export interface TalerRestoreUri {
  type: TalerUriAction.Restore;
  walletRootPriv: string;
  providers: Array<HostPortPath>;
}
export interface TalerRefundUri {
  type: TalerUriAction.Refund;
  merchantBaseUrl: HostPortPath;
  orderId: string;
}
export interface TalerWithdrawUri {
  type: TalerUriAction.Withdraw;
  bankIntegrationApiBaseUrl: HostPortPath;
  withdrawalOperationId: string;
  externalConfirmation?: boolean;
}
export interface TalerWithdrawExchangeUri {
  type: TalerUriAction.WithdrawExchange;
  exchangeBaseUrl: HostPortPath;
  amount?: AmountString;
}
export interface TalerAddExchangeUri {
  type: TalerUriAction.AddExchange;
  exchangeBaseUrl: HostPortPath;
}
export interface TalerWithdrawalTransferResultUri {
  type: TalerUriAction.WithdrawalTransferResult;
  ref: string;
  status?: "success" | "aborted";
}
export interface TalerAddContactUri {
  type: TalerUriAction.AddContact;
  alias: string;
  aliasType: string;
  mailboxBaseUri: string;
  mailboxIdentity: EddsaPublicKeyString;
  sourceBaseUrl?: string;
}
/**
 * Record metadata for mailbox messages
 */
export interface MailboxMessageRecord {
  originMailboxBaseUrl: string;
  downloadedAt: Timestamp;
  talerUri: string;
}
export interface MailboxBaseUrl {
  mailboxBaseUrl: string;
}
export type ScopeInfoGlobal = {
  type: ScopeType.Global;
  currency: string;
};
export declare enum ScopeType {
  Global = "global",
  Exchange = "exchange",
  Auditor = "auditor",
  /**
   * Funds issued under a master public key the exchange has since replaced.
   *
   * A distinct type rather than an optional field on {@link ScopeInfoExchange}
   * on purpose: these funds must never be pooled with, or selected alongside,
   * funds under the key the exchange currently uses, and a scope that merely
   * carried an extra field would render as a second bucket with the same
   * label and would still be matched by an existing exchange-scoped filter.
   */
  ExchangeLegacyKeys = "exchange-legacy-keys",
}
export type ScopeInfoExchange = {
  type: ScopeType.Exchange;
  currency: string;
  url: string;
};
export type ScopeInfoAuditor = {
  type: ScopeType.Auditor;
  currency: string;
  url: string;
};
export type ScopeInfoExchangeLegacyKeys = {
  type: ScopeType.ExchangeLegacyKeys;
  currency: string;
  url: string;
  /** The superseded key the funds were issued under. */
  masterPub: string;
};
export interface DepositGroupFees {
  coin: AmountString;
  wire: AmountString;
  refresh: AmountString;
}
export type AccountRestriction =
  | RegexAccountRestriction
  | DenyAllAccountRestriction;
export interface RegexAccountRestriction {
  type: "regex";
  payto_regex: string;
  human_hint: string;
  human_hint_i18n?: InternationalizedString;
}
export interface InternationalizedString {
  [lang_tag: string]: string;
}
export interface DenyAllAccountRestriction {
  type: "deny";
}
export interface TransactionsResponse {
  transactions: Transaction[];
}
/**
 * A withdrawal transaction (either bank-integrated or manual).
 */
export interface TransactionWithdrawal extends TransactionCommon {
  type: TransactionType.Withdrawal;
  /**
   * Exchange of the withdrawal.
   */
  exchangeBaseUrl: string | undefined;
  /**
   * Amount that got subtracted from the reserve balance.
   */
  amountRaw: AmountString;
  /**
   * Amount that actually was (or will be) added to the wallet's balance.
   */
  amountEffective: AmountString;
  withdrawalDetails: WithdrawalDetails;
}
export interface TransactionCommon {
  transactionId: TransactionIdStr;
  /**
   * The transaction produced funds under an exchange key set that the user
   * subsequently purged from the wallet.
   */
  legacy?: boolean;
  /**
   * Short identifier assigned by this wallet for local, human-facing use.
   *
   * It has the form #${type}:${localIdent}.  It is intentionally not
   * portable: importing or merging a wallet can assign different local
   * identifiers.  Clients must use transactionId when they need a stable ID.
   * Undefined when the active wallet backend does not support local IDs.
   */
  localTransactionId?: string;
  type: TransactionType;
  timestamp: TalerPreciseTimestamp;
  /**
   * Scope of this tx
   */
  scopes: ScopeInfo[];
  /**
   * Transaction state, as per DD37.
   */
  txState: TransactionState;
  /**
   * Wallet-internal state ID, only used for debugging and testing.
   */
  stId: number;
  /**
   * Possible transitions based on the current state.
   */
  txActions: TransactionAction[];
  /**
   * Raw amount of the transaction (exclusive of fees or other extra costs).
   */
  amountRaw: AmountString;
  /**
   * Amount shown when the transaction was confirmed, including estimated fees.
   * This amount is preserved when execution fails, expires or is aborted.
   */
  amountEffective: AmountString;
  /**
   * Settled wallet balance effect, including fees and abort recovery.
   * Nonnegative; the transaction type determines whether this is a debit or
   * credit. Absent until the transaction and its recovery have settled, or
   * when historical records cannot establish the amount. Ordinary merchant
   * refunds remain separate credits. Associated refreshes have zero effect.
   */
  amountEffectiveFinal?: AmountString;
  error?: TalerErrorDetail;
  abortReason?: TalerErrorDetail;
  failReason?: TalerErrorDetail;
  /**
   * If the transaction minor state is in KycRequired this field is going to
   * have the location where the user need to go to complete KYC information.
   */
  kycUrl?: string;
  /**
   * KYC payto hash. Useful for testing, not so useful for UIs.
   */
  kycPaytoHash?: string;
  /**
   * KYC access token. Useful for testing, not so useful for UIs.
   */
  kycAccessToken?: string;
  kycAuthTransferInfo?: KycAuthTransferInfo;
}
export type TransactionIdStr = `txn:${string}:${string}` & {
  [__txId]: true;
};
export declare enum TransactionType {
  Withdrawal = "withdrawal",
  InternalWithdrawal = "internal-withdrawal",
  Payment = "payment",
  Refund = "refund",
  Refresh = "refresh",
  Deposit = "deposit",
  PeerPushDebit = "peer-push-debit",
  PeerPushCredit = "peer-push-credit",
  PeerPullDebit = "peer-pull-debit",
  PeerPullCredit = "peer-pull-credit",
  Recoup = "recoup",
  DenomLoss = "denom-loss",
}
/**
 * Precise timestamp, typically used in the wallet-core
 * API but not in other Taler APIs so far.
 */
export interface TalerPreciseTimestamp {
  /**
   * Seconds (as integer) since epoch.
   */
  readonly t_s: number | "never";
  /**
   * Optional microsecond offset (non-negative integer).
   */
  readonly off_us?: number;
  readonly _flavor?: typeof flavor_TalerPreciseTimestamp;
}
export interface TransactionState {
  /**
   * Major state component of the transaction state.
   */
  major: TransactionMajorState;
  /**
   * Minor state component of the transaction.
   */
  minor?: TransactionMinorState;
  /**
   * Indicator of whether the wallet is currently
   * actively processing the transaction or waiting
   * for a counterparty.
   *
   * Will eventually be folded into a new major state,
   * first via a feature flag and then permanently.
   */
  working?: boolean;
}
export declare enum TransactionMajorState {
  None = "none",
  Pending = "pending",
  Done = "done",
  Aborting = "aborting",
  Aborted = "aborted",
  Dialog = "dialog",
  Finalizing = "finalizing",
  Suspended = "suspended",
  SuspendedFinalizing = "suspended-finalizing",
  SuspendedAborting = "suspended-aborting",
  Failed = "failed",
  Expired = "expired",
  Deleted = "deleted",
}
export declare enum TransactionMinorState {
  AbortingBank = "aborting-bank",
  AcceptRefund = "accept-refund",
  AutoRefund = "auto-refund",
  BalanceKycRequired = "balance-kyc",
  Bank = "bank",
  BankConfirmTransfer = "bank-confirm-transfer",
  BankRegisterReserve = "bank-register-reserve",
  CheckRefund = "check-refund",
  ClaimProposal = "claim-proposal",
  CompletedByOtherWallet = "completed-by-other-wallet",
  ContinuedWithOtherWallet = "continued-with-other-wallet",
  CreatePurse = "create-purse",
  DeletePurse = "delete-purse",
  Deposit = "deposit",
  DepositAbortPartial = "deposit-abort-partial",
  DepositAbortRecovered = "deposit-abort-recovered",
  DepositAbortRecoveryFailed = "deposit-abort-recovery-failed",
  DepositAbortRefundFailed = "deposit-abort-refund-failed",
  DepositAbortTooLate = "deposit-abort-too-late",
  Exchange = "exchange",
  ExchangeWaitReserve = "exchange-wait-reserve",
  KycAuthRequired = "kyc-auth",
  KycHardLimit = "kyc-hard-limit",
  KycInit = "kyc-init",
  KycRequired = "kyc",
  Merge = "merge",
  PaidByOther = "paid-by-other",
  Proposed = "proposed",
  Ready = "ready",
  RebindSession = "rebind-session",
  Refresh = "refresh",
  Refused = "refused",
  Repurchase = "repurchase",
  SubmitPayment = "submit-payment",
  Track = "track",
  Unknown = "unknown",
  Withdraw = "withdraw",
  WaitingForOtherWallet = "waiting-for-other-wallet",
  Abort = "abort",
}
export declare enum TransactionAction {
  Delete = "delete",
  Suspend = "suspend",
  Resume = "resume",
  Abort = "abort",
  Fail = "fail",
  Retry = "retry",
}
export interface TalerErrorDetail {
  code: TalerErrorCode;
  when?: AbsoluteTime;
  hint?: string;
  [x: string]: unknown;
}
export interface AbsoluteTime {
  /**
   * Timestamp in milliseconds.
   */
  readonly t_ms: number | "never";
  readonly _flavor?: typeof flavor_AbsoluteTime;
  [opaque_AbsoluteTime]: true;
}
export interface KycAuthTransferInfo {
  /**
   * Payto URI of the account that must make the transfer.
   *
   * The KYC auth transfer will *not* work if it originates
   * from a different account.
   */
  debitPaytoUri: string;
  /**
   * Account public key.
   *
   * Included in the transfer subject for some of the transfer options.
   */
  accountPub: string;
  /**
   * Options for making the KYC auth transfer, grouped by exchange credit
   * account in the same format used for withdrawals.
   */
  transferOptionsExt: WithdrawalExchangeAccountDetails[];
  /**
   * Options for making the KYC auth transfer payment
   * to the exchange.
   *
   * @deprecated Use transferOptionsExt instead.
   */
  transferOptions: TransferOption[];
  /**
   * Validity of the transferOptions or undefined
   * if transferOptions does not expire.
   *
   * @deprecated Use the per-account expiry in transferOptionsExt instead.
   */
  transferExpiry: TalerProtocolTimestamp | undefined;
  /**
   * Amount that the exchange expects to be deposited.
   *
   * Usually corresponds to the TINY_AMOUNT configuration of the exchange,
   * and thus is the smallest amount that can be transferred
   * via a bank transfer.
   *
   * @deprecated Use transferOptions instead.
   */
  amount: AmountString;
  /**
   * Possible target payto URIs.
   *
   * @deprecated Use transferOptions instead.
   */
  creditPaytoUris: string[];
}
export interface WithdrawalExchangeAccountDetails {
  /**
   * Payto URI to of the exchange.
   *
   * Depending on whether the (manual!) withdrawal is accepted or just
   * being checked, this already includes the subject with the
   * reserve public key.
   *
   * Wallet UIs should never show instructions to send money to the exchange's payto
   */
  paytoUri: string;
  /**
   * Status that indicates whether the account can be used
   * by the user to send funds for a withdrawal.
   *
   * ok: account should be shown to the user
   * error: account should not be shown to the user, UIs might render the error (in conversionError),
   *   especially in dev mode.
   */
  status: "ok" | "error";
  /**
   * Transfer amount. Might be in a different currency than the requested
   * amount for withdrawal.
   *
   * Absent if this is a conversion account and the conversion failed.
   */
  transferAmount?: AmountString;
  /**
   * Currency specification for the external currency.
   *
   * Only included if this account requires a currency conversion.
   */
  currencySpecification?: CurrencySpecification;
  /**
   * Further restrictions for sending money to the
   * exchange.
   */
  creditRestrictions?: AccountRestriction[];
  /**
   * Label given to the account or the account's bank by the exchange.
   */
  bankLabel?: string;
  priority?: number;
  /**
   * Error that happened when attempting to request the conversion rate.
   */
  conversionError?: TalerErrorDetail;
  /**
   * Timestamp that indicates when the transfer options expire.
   *
   * If missing, options do not expire.
   */
  transferExpiry?: TalerProtocolTimestamp;
  /**
   * Options for transferring funds to the exchange for the withdrawal.
   */
  transferOptions: TransferOption[];
}
/**
 * DD51 https://docs.taler.net/design-documents/051-fractional-digits.html
 */
export interface CurrencySpecification {
  name: string;
  num_fractional_input_digits: Integer;
  num_fractional_normal_digits: Integer;
  num_fractional_trailing_zero_digits: Integer;
  alt_unit_names: {
    [log10: string]: string;
  };
  common_amounts?: AmountString[];
}
export type Integer = number;
export interface TransferOptionPayto {
  type: "payto";
  paytoUri: string;
  qrCodes: QrCodeSpec[];
}
/**
 * Specification of a QR code that includes payment information.
 */
export interface QrCodeSpec {
  /**
   * Type of the QR code.
   *
   * Depending on the type, different visual styles
   * might be applied.
   */
  type: SupportedBankQr;
  /**
   * Content of the QR code that should be rendered.
   */
  qrContent: string;
}
export type SupportedBankQr = "epc-qr" | "spc";
export interface TransferOptionUri {
  type: "uri";
  uri: string;
}
export interface TransferOptionSwissQrBill {
  type: "ch-qr-bill";
  paytoUri: string;
  qrReferenceNumber: string;
  qrCodes: QrCodeSpec[];
}
interface WithdrawalDetailsForManualTransfer {
  type: WithdrawalType.ManualTransfer;
  /**
   * Payto URIs that the exchange supports.
   *
   * Already contains the amount and message.
   *
   * @deprecated in favor of exchangeCreditAccounts
   */
  exchangePaytoUris: string[];
  exchangeCreditAccountDetails?: WithdrawalExchangeAccountDetails[];
  reservePub: string;
  /**
   * Is the reserve ready for withdrawal?
   */
  reserveIsReady: boolean;
  /**
   * How long does the exchange wait to transfer back funds from a
   * reserve?
   */
  reserveClosingDelay: TalerProtocolDuration;
}
export declare enum WithdrawalType {
  TalerBankIntegrationApi = "taler-bank-integration-api",
  ManualTransfer = "manual-transfer",
}
interface WithdrawalDetailsForTalerBankIntegrationApi {
  type: WithdrawalType.TalerBankIntegrationApi;
  /**
   * Set to true if the bank has confirmed the withdrawal, false if not.
   * An unconfirmed withdrawal usually requires user-input and should be highlighted in the UI.
   * See also bankConfirmationUrl below.
   */
  confirmed: boolean;
  /**
   * If the withdrawal is unconfirmed, this can include a URL for user
   * initiated confirmation.
   */
  bankConfirmationUrl?: string;
  reservePub: string;
  /**
   * Is the reserve ready for withdrawal?
   */
  reserveIsReady: boolean;
  /**
   * Is the bank transfer for the withdrawal externally confirmed?
   */
  externalConfirmation?: boolean;
  exchangeCreditAccountDetails?: WithdrawalExchangeAccountDetails[];
}
export interface TransactionPayment extends TransactionCommon {
  type: TransactionType.Payment;
  /**
   * Public payment URI shown while this wallet waits for another wallet to
   * claim an order that it released.
   */
  unclaimedPayUri?: TalerUriString;
  /**
   * Additional information about the payment.
   *
   * Only present if the information about the
   * order is already available.
   */
  info: OrderShortInfo | undefined;
  /**
   * Full contract terms.
   *
   * Only included if explicitly included in the request.
   */
  contractTerms?: MerchantContractTerms;
  /**
   * Amount that must be paid for the contract
   */
  amountRaw: AmountString;
  /**
   * Amount that was paid, including deposit, wire and refresh fees.
   */
  amountEffective: AmountString;
  /**
   * Amount that has been refunded by the merchant
   */
  totalRefundRaw: AmountString;
  /**
   * Amount will be added to the wallet's balance after fees and refreshing
   */
  totalRefundEffective: AmountString;
  /**
   * Amount pending to be picked up
   */
  refundPending: AmountString | undefined;
  /**
   * Reference to applied refunds
   */
  refunds: RefundInfoShort[];
  /**
   * Is the wallet currently checking for a refund?
   */
  refundQueryActive: boolean;
  /**
   * PoS confirmation codes, separated by newlines.
   * Only present for purchases that support PoS confirmation.
   */
  posConfirmation: string | undefined;
  /**
   * Until when will the posConfirmation be valid?
   */
  posConfirmationDeadline?: TalerProtocolTimestamp;
  /**
   * Did we receive the payment via a taler://pay-template/ URI
   * and did the URI contain a nfc=1 flag?
   */
  posConfirmationViaNfc?: boolean;
  /**
   * In case this payment transaction was detected as a repurchase,
   * this is the transaction ID of the original payment.
   */
  repurchaseTransactionId?: TransactionIdStr;
  /**
   * If applicable, the choice that the user selected.
   */
  choiceIndex?: number;
}
export type TalerUriString = string & {
  [__action_str]: true;
};
export interface OrderShortInfo {
  /**
   * Order ID, uniquely identifies the order within a merchant instance
   */
  orderId: string;
  /**
   * Hash of the contract terms.
   */
  contractTermsHash: string;
  /**
   * More information about the merchant
   */
  merchant: MerchantInfo;
  /**
   * Summary of the order, given by the merchant
   */
  summary: string;
  /**
   * Map from IETF BCP 47 language tags to localized summaries
   */
  summary_i18n?: InternationalizedString;
  /**
   * URL of the fulfillment, given by the merchant
   */
  fulfillmentUrl?: string;
  /**
   * Plain text message that should be shown to the user
   * when the payment is complete.
   */
  fulfillmentMessage?: string;
  /**
   * Translations of fulfillmentMessage.
   */
  fulfillmentMessage_i18n?: InternationalizedString;
}
export interface MerchantInfo {
  name: string;
  email?: string;
  website?: string;
  logo?: ImageDataUrl;
  address?: Location;
  jurisdiction?: Location;
}
export type ImageDataUrl = string;
export interface Location {
  country?: string;
  country_subdivision?: string;
  district?: string;
  town?: string;
  town_location?: string;
  post_code?: string;
  street?: string;
  building_name?: string;
  building_number?: string;
  address_lines?: string[];
}
export interface Location {
  country?: string;
  country_subdivision?: string;
  district?: string;
  town?: string;
  town_location?: string;
  post_code?: string;
  street?: string;
  building_name?: string;
  building_number?: string;
  address_lines?: string[];
}
export type MerchantContractTerms =
  | MerchantContractTermsV0
  | MerchantContractTermsV1;
export interface MerchantContractTermsV0 extends MerchantContractTermsCommon {
  version?: MerchantContractVersion.V0;
  amount: AmountString;
  max_fee: AmountString;
}
/**
 * Contract terms from a merchant.
 */
interface MerchantContractTermsCommon {
  h_wire: string;
  auto_refund?: TalerProtocolDuration;
  wire_method: string;
  summary: string;
  summary_i18n?: InternationalizedString;
  order_id: string;
  nonce: string;
  pay_deadline: TalerProtocolTimestamp;
  merchant: MerchantInfo;
  merchant_pub: string;
  delivery_date?: TalerProtocolTimestamp;
  delivery_location?: Location;
  exchanges: Exchange[];
  products?: ProductSold[];
  refund_deadline: TalerProtocolTimestamp;
  wire_transfer_deadline: TalerProtocolTimestamp;
  timestamp: TalerProtocolTimestamp;
  merchant_base_url: string;
  fulfillment_url?: string;
  public_reorder_url?: string;
  fulfillment_message?: string;
  fulfillment_message_i18n?: InternationalizedString;
  extra?: any;
  minimum_age?: Integer;
  default_money_pot?: Integer;
}
export interface Exchange {
  url: string;
  priority: Integer;
  master_pub: EddsaPublicKey;
  max_contribution?: AmountString;
}
export type EddsaPublicKey = EddsaPublicKeyString;
export interface ProductSold {
  product_id?: string;
  product_name?: string;
  description: string;
  description_i18n?: {
    [lang_tag: string]: string;
  };
  quantity?: Integer;
  unit_quantity?: DecimalQuantity;
  unit?: string;
  price?: AmountString;
  prices?: AmountString[];
  prices_are_net?: boolean;
  image?: ImageDataUrl;
  taxes?: Tax[];
  delivery_date?: Timestamp;
  product_money_pot?: Integer;
}
export type DecimalQuantity = string;
export interface Tax {
  name: string;
  tax: AmountString;
}
export interface Tax {
  name: string;
  tax: AmountString;
}
export declare enum MerchantContractVersion {
  V0 = 0,
  V1 = 1,
}
export interface MerchantContractTermsV1 extends MerchantContractTermsCommon {
  version: MerchantContractVersion.V1;
  choices: MerchantContractChoice[];
  token_families: {
    [token_family_slug: string]: MerchantContractTokenFamily;
  };
}
export interface MerchantContractChoice {
  amount: AmountString;
  description?: string;
  description_i18n?: InternationalizedString;
  inputs: MerchantContractInput[];
  outputs: MerchantContractOutput[];
  max_fee: AmountString;
}
export type MerchantContractInput = MerchantContractInputToken;
export interface MerchantContractInputToken {
  type: MerchantContractInputType.Token;
  token_family_slug: string;
  count?: Integer;
}
export declare enum MerchantContractInputType {
  Token = "token",
}
export type MerchantContractOutput =
  | MerchantContractOutputToken
  | MerchantContractOutputTaxReceipt;
export interface MerchantContractOutputToken {
  type: MerchantContractOutputType.Token;
  token_family_slug: string;
  count?: Integer;
  valid_at?: Timestamp;
  key_index: Integer;
}
export declare enum MerchantContractOutputType {
  Token = "token",
  TaxReceipt = "tax-receipt",
}
export interface MerchantContractOutputTaxReceipt {
  type: MerchantContractOutputType.TaxReceipt;
  donau_urls: string[];
  amount?: AmountString;
}
export interface MerchantContractTokenFamily {
  name: string;
  description: string;
  description_i18n?: {
    [lang_tag: string]: string;
  };
  keys: TokenIssuePublicKey[];
  details: MerchantContractTokenDetails;
  critical: boolean;
}
export type TokenIssuePublicKey =
  | TokenIssueRsaPublicKey
  | TokenIssueCsPublicKey;
export interface TokenIssueRsaPublicKey {
  cipher: "RSA";
  rsa_pub: RsaPublicKey;
  signature_validity_start: Timestamp;
  signature_validity_end: Timestamp;
}
export type RsaPublicKey = string;
export interface TokenIssueCsPublicKey {
  cipher: "CS";
  cs_pub: Cs25519Point;
  signature_validity_start: Timestamp;
  signature_validity_end: Timestamp;
}
/**
 * 32-byte value representing a point on Curve25519.
 */
export type Cs25519Point = string;
export interface MerchantContractSubscriptionTokenDetails {
  class: MerchantContractTokenKind.Subscription;
  trusted_domains: string[];
}
export declare enum MerchantContractTokenKind {
  Subscription = "subscription",
  Discount = "discount",
}
export interface MerchantContractDiscountTokenDetails {
  class: MerchantContractTokenKind.Discount;
  expected_domains: string[];
}
export interface RefundInfoShort {
  transactionId: string;
  timestamp: TalerProtocolTimestamp;
  amountEffective: AmountString;
  amountRaw: AmountString;
}
export interface TransactionRefund extends TransactionCommon {
  /** Recovery already included in the unsuccessful payment's final cost. */
  isAbortRecovery?: boolean;
  type: TransactionType.Refund;
  amountRaw: AmountString;
  amountEffective: AmountString;
  refundedTransactionId: string;
  paymentInfo: RefundPaymentInfo | undefined;
}
/**
 * Summary information about the payment that we got a refund for.
 */
export interface RefundPaymentInfo {
  summary: string;
  summary_i18n?: InternationalizedString;
  /**
   * More information about the merchant
   */
  merchant: MerchantInfo;
}
/**
 * A transaction shown for refreshes.
 * Only shown for (1) refreshes not associated with other transactions
 * and (2) refreshes in an error state.
 */
export interface TransactionRefresh extends TransactionCommon {
  type: TransactionType.Refresh;
  refreshReason: RefreshReason;
  /**
   * Transaction ID that caused this refresh.
   */
  originatingTransactionId?: string;
  /**
   * Always zero for refreshes
   */
  amountRaw: AmountString;
  /**
   * Fees, i.e. the effective, negative effect of the refresh
   * on the balance.
   *
   * Only applicable for stand-alone refreshes, and zero for
   * other refreshes where the transaction itself accounts for the
   * refresh fee.
   */
  amountEffective: AmountString;
  refreshInputAmount: AmountString;
  refreshOutputAmount: AmountString;
}
/**
 * Reasons for why a coin is being refreshed.
 */
export declare enum RefreshReason {
  Manual = "manual",
  PayMerchant = "pay-merchant",
  PayDeposit = "pay-deposit",
  PayPeerPush = "pay-peer-push",
  PayPeerPull = "pay-peer-pull",
  Refund = "refund",
  AbortPay = "abort-pay",
  AbortDeposit = "abort-deposit",
  AbortPeerPushDebit = "abort-peer-push-debit",
  AbortPeerPullDebit = "abort-peer-pull-debit",
  Recoup = "recoup",
  BackupRestored = "backup-restored",
  Scheduled = "scheduled",
}
/**
 * Deposit transaction, which effectively sends
 * money from this wallet somewhere else.
 */
export interface TransactionDeposit extends TransactionCommon {
  type: TransactionType.Deposit;
  depositGroupId: string;
  /**
   * Target for the deposit.
   */
  targetPaytoUri: string;
  /**
   * Raw amount that is being deposited
   */
  amountRaw: AmountString;
  /**
   * Deposit account public key.
   */
  accountPub: string;
  /**
   * Effective amount that is being deposited
   */
  amountEffective: AmountString;
  wireTransferDeadline: TalerProtocolTimestamp;
  wireTransferProgress: number;
  /**
   * Did all the deposit requests succeed?
   */
  deposited: boolean;
  trackingState: Array<DepositTransactionTrackingState>;
}
export interface DepositTransactionTrackingState {
  wireTransferId: string;
  timestampExecuted: TalerProtocolTimestamp;
  amountRaw: AmountString;
  wireFee: AmountString;
}
/**
 * Credit because we were paid for a P2P invoice we created.
 */
export interface TransactionPeerPullCredit extends TransactionCommon {
  type: TransactionType.PeerPullCredit;
  info: PeerInfoShort;
  /**
   * Exchange used.
   */
  exchangeBaseUrl: string;
  /**
   * Amount that got subtracted from the reserve balance.
   */
  amountRaw: AmountString;
  /**
   * Amount that actually was (or will be) added to the wallet's balance.
   */
  amountEffective: AmountString;
  /**
   * URI to send to the other party.
   *
   * Only available in the right state.
   */
  talerUri: string | undefined;
}
export interface PeerInfoShort {
  expiration: TalerProtocolTimestamp | undefined;
  summary: string | undefined;
  iconId: string | undefined;
}
/**
 * Debit because we paid someone's invoice.
 */
export interface TransactionPeerPullDebit extends TransactionCommon {
  type: TransactionType.PeerPullDebit;
  info: PeerInfoShort;
  /**
   * Exchange used.
   */
  exchangeBaseUrl: string;
  amountRaw: AmountString;
  amountEffective: AmountString;
}
/**
 * We received money via a P2P payment.
 */
export interface TransactionPeerPushCredit extends TransactionCommon {
  type: TransactionType.PeerPushCredit;
  info: PeerInfoShort;
  /**
   * Exchange used.
   */
  exchangeBaseUrl: string;
  /**
   * Amount that got subtracted from the reserve balance.
   */
  amountRaw: AmountString;
  /**
   * Amount that actually was (or will be) added to the wallet's balance.
   */
  amountEffective: AmountString;
}
/**
 * We sent money via a P2P payment.
 */
export interface TransactionPeerPushDebit extends TransactionCommon {
  type: TransactionType.PeerPushDebit;
  info: PeerInfoShort;
  /**
   * Exchange used.
   */
  exchangeBaseUrl: string;
  /**
   * Amount that got subtracted from the reserve balance.
   */
  amountRaw: AmountString;
  /**
   * Amount that actually was (or will be) added to the wallet's balance.
   */
  amountEffective: AmountString;
  /**
   * URI to accept the payment.
   *
   * Only present if the transaction is in a state where the other party can
   * accept the payment.
   */
  talerUri?: string;
}
/**
 * Internal withdrawal operation, only reported on request.
 *
 * Some transactions (peer-*-credit) internally do a withdrawal,
 * but only the peer-*-credit transaction is reported.
 *
 * The internal withdrawal transaction allows to access the details of
 * the underlying withdrawal for testing/debugging.
 *
 * It is usually not reported, so that amounts of transactions properly
 * add up, since the amountEffecive of the withdrawal is already reported
 * in the peer-*-credit transaction.
 */
export interface TransactionInternalWithdrawal extends TransactionCommon {
  type: TransactionType.InternalWithdrawal;
  /**
   * Exchange of the withdrawal.
   */
  exchangeBaseUrl: string;
  /**
   * Amount that got subtracted from the reserve balance.
   */
  amountRaw: AmountString;
  /**
   * Amount that actually was (or will be) added to the wallet's balance.
   */
  amountEffective: AmountString;
  withdrawalDetails: WithdrawalDetails;
}
/**
 * The exchange revoked a key and the wallet recoups funds.
 */
export interface TransactionRecoup extends TransactionCommon {
  type: TransactionType.Recoup;
}
/**
 * A transaction to indicate financial loss due to denominations
 * that became unusable for deposits.
 */
export interface TransactionDenomLoss extends TransactionCommon {
  type: TransactionType.DenomLoss;
  lossEventType: DenomLossEventType;
  exchangeBaseUrl: string;
}
export declare enum DenomLossEventType {
  DenomExpired = "denom-expired",
  DenomVanished = "denom-vanished",
  DenomUnoffered = "denom-unoffered",
  /**
   * The exchange revoked the denomination.  A revoked denomination also stops
   * being offered, so this must be checked before DenomUnoffered to say what
   * actually happened.
   */
  DenomRevoked = "denom-revoked",
}
export interface AbortTransactionRequest {
  transactionId: TransactionIdStr;
}
/**
 * Info about an exchange entry in the wallet.
 */
/**
 * An exchange that changed its key set, pending the user's confirmation.
 *
 * The wallet has already adopted the new key set, so the entry works and the
 * older coins stay spendable.  What is withheld until this is confirmed is
 * withdrawing: the bank details a withdrawal pays into are signed by the
 * master key, so adopting a new one silently would let a URL that changed
 * hands redirect the next transfer.
 */
export interface ExchangeKeyChangeInfo {
  /** Master public key the exchange now uses, and the wallet now trusts. */
  currentMasterPub: string;
  currentCurrency: string;
  /** Master public key the wallet's older funds were issued under. */
  supersededMasterPub: string;
  supersededCurrency: string;
  /**
   * Whether the new key set still advertises denominations the wallet holds
   * coins of.
   *
   * False means the exchange does not offer to settle the older coins at all.
   * True is the exchange's claim that it does, not proof of continuity:
   * denomination public keys are public and anyone can re-publish them.
   */
  sharesDenominations: boolean;
  firstSeen: TalerPreciseTimestamp;
}
export interface WithdrawUriInfoResponse {
  operationId: string;
  status: WithdrawalOperationStatusFlag;
  confirmTransferUrl?: string;
  currency: string;
  amount: AmountString | undefined;
  /**
   * Set to true if the user is allowed to edit the amount.
   *
   * Note that even with a non-editable amount, the amount
   * might be undefined at the beginning of the withdrawal
   * process.
   */
  editableAmount: boolean;
  maxAmount: AmountString | undefined;
  wireFee: AmountString | undefined;
  defaultExchangeBaseUrl?: string;
  editableExchange: boolean;
  possibleExchanges: ExchangeListItem[];
}
export type WithdrawalOperationStatusFlag =
  | "pending"
  | "selected"
  | "aborted"
  | "confirmed";
export interface ExchangeListItem {
  exchangeBaseUrl: string;
  source?: ExchangeEntrySource;
  masterPub: string | undefined;
  /**
   * Master public keys this exchange URL used before its current key.
   *
   * The array is sorted and does not include {@link masterPub}.
   */
  legacyMasterPubs: string[];
  /**
   * Set when the exchange changed its key set and the user has not confirmed
   * the change yet.  Operations that send money to the exchange or disclose
   * coin authorizations are refused while this is present.
   */
  unconfirmedKeyChange?: ExchangeKeyChangeInfo;
  currency: string;
  paytoUris: string[];
  tosStatus: ExchangeTosStatus;
  exchangeEntryStatus: ExchangeEntryStatus;
  exchangeUpdateStatus: ExchangeUpdateStatus;
  ageRestrictionOptions: number[];
  walletKycStatus?: ExchangeWalletKycStatus;
  walletKycReservePub?: string;
  walletKycAccessToken?: string;
  walletKycUrl?: string;
  /** Threshold that we've requested to satisfy. */
  walletKycRequestedThreshold?: string;
  /**
   * P2P payments are disabled with this exchange
   * (e.g. because no global fees are configured).
   */
  peerPaymentsDisabled: boolean;
  directDepositsDisabled: boolean;
  /** Set to true if this exchange doesn't charge any fees. */
  noFees: boolean;
  /** Most general scope that the exchange is a part of. */
  scopeInfo: ScopeInfo;
  /**
   * Instructs wallets to use certain bank-specific
   * language (for buttons) and/or other UI/UX customization
   * for compliance with the rules of that bank.
   */
  bankComplianceLanguage?: string;
  lastUpdateTimestamp: TalerPreciseTimestamp | undefined;
  /** Most recent successful withdrawal through this exchange. */
  lastWithdrawal?: TalerPreciseTimestamp;
  /**
   * Information about the last error that occurred when trying
   * to update the exchange info.
   */
  lastUpdateErrorInfo?: OperationErrorInfo;
  /**
   * Currency spec for the currency offered
   * by the exchange.
   */
  currencySpec: CurrencySpecification;
}
/** How an exchange entry became known to the wallet. */
export declare enum ExchangeEntrySource {
  Builtin = "builtin",
  User = "user",
  Discovered = "discovered",
  Unknown = "unknown",
}
export declare enum ExchangeTosStatus {
  Pending = "pending",
  Proposed = "proposed",
  Accepted = "accepted",
  MissingTos = "missing-tos",
}
export declare enum ExchangeEntryStatus {
  Preset = "preset",
  Ephemeral = "ephemeral",
  Used = "used",
}
export declare enum ExchangeUpdateStatus {
  Initial = "initial",
  InitialUpdate = "initial-update",
  Suspended = "suspended",
  UnavailableUpdate = "unavailable-update",
  Ready = "ready",
  ReadyUpdate = "ready-update",
  OutdatedUpdate = "outdated-update",
}
export declare enum ExchangeWalletKycStatus {
  Done = "done",
  /**
   * Wallet needs to request KYC status.
   */
  LegiInit = "legi-init",
  /**
   * User requires KYC or AML.
   */
  Legi = "legi",
}
export interface OperationErrorInfo {
  error: TalerErrorDetail;
}
export interface ForcedDenomSel {
  denoms: {
    value: AmountString;
    count: number;
  }[];
}
export interface PreparePayV2Result {
  transactionId: TransactionIdStr;
}
/** Information needed to redeem a paid Paivana order for an access cookie. */
export interface PaivanaRedemption {
  /** Canonical HTTP(S) URL of the protected resource. */
  url: string;
  /** Crockford-base32 encoded 16-byte client nonce. */
  nonce: string;
  /** Minimum acceptable access expiry bound into the Paivana session ID. */
  expiration: TalerProtocolTimestamp;
}
/**
 * Forced coin selection for deposits/payments.
 */
export interface ForcedCoinSel {
  coins: {
    value: AmountString;
    contribution: AmountString;
  }[];
}
/**
 * Detailed reason for why the wallet's balance is insufficient.
 *
 * Current wallet-core versions emit all structured fields.  The legacy-only
 * alternative lets clients continue decoding responses from older cores
 * without allowing partially populated structured diagnostics.
 */
export type PaymentInsufficientBalanceDetails =
  PaymentInsufficientBalanceCompatibilityDetails &
    (
      | PaymentInsufficientBalanceStructuredDetails
      | PaymentInsufficientBalanceLegacyOnly
    );
/**
 * Request context and compatibility fields shared by old and current
 * insufficient-balance responses.
 */
interface PaymentInsufficientBalanceCompatibilityDetails {
  /**
   * Amount requested by the merchant.
   */
  amountRequested: AmountString;
  /**
   * Wire method for the requested payment, only applicable
   * for merchant payments.
   */
  wireMethod?: string | undefined;
  /**
   * Hint as to why the balance is insufficient.
   *
   * If this hint is not provided, the balance hints of
   * the individual exchanges should be shown, as the overall
   * reason might be a combination of the reasons for different exchanges.
   *
   * Compatibility-only and planned for removal after consumers migrate.
   *
   * @deprecated (2026-08-19) Use reasons.
   */
  causeHint?: InsufficientBalanceHint;
  /**
   * Balance of type "available" (see balance.ts for definition).
   *
   * Compatibility-only and planned for removal after consumers migrate.
   *
   * @deprecated (2026-08-19) Use balance.available.
   */
  balanceAvailable: AmountString;
  /**
   * Balance of type "material" (see balance.ts for definition).
   *
   * Compatibility-only and planned for removal after consumers migrate.
   *
   * @deprecated (2026-08-19) Use balance.material.
   */
  balanceMaterial: AmountString;
  /**
   * Balance of type "age-acceptable" (see balance.ts for definition).
   *
   * Compatibility-only and planned for removal after consumers migrate.
   *
   * @deprecated (2026-08-19) Use reasons and exchanges.
   */
  balanceAgeAcceptable: AmountString;
  /**
   * Balance of type "receiver-acceptable" (see balance.ts for definition).
   *
   * Compatibility-only and planned for removal after consumers migrate.
   *
   * @deprecated (2025-12-05) Use reasons and exchanges.
   */
  balanceReceiverAcceptable: AmountString;
  /**
   * Balance of type "receiver-exchange-url-acceptable" (see balance.ts for definition).
   *
   * Compatibility-only and planned for removal after consumers migrate.
   *
   * @deprecated (2026-08-19) Use reasons and exchanges.
   */
  balanceReceiverExchangeUrlAcceptable: AmountString;
  /**
   * Balance of type "receiver-exchange-pub-acceptable" (see balance.ts for definition).
   *
   * Compatibility-only and planned for removal after consumers migrate.
   *
   * @deprecated (2026-08-19) Use reasons and exchanges.
   */
  balanceReceiverExchangePubAcceptable: AmountString;
  /**
   * Balance of type "receiver-auditor-url-acceptable" (see balance.ts for definition).
   *
   * Compatibility-only and planned for removal after consumers migrate.
   *
   * @deprecated (2026-08-19) Use reasons and exchanges.
   */
  balanceReceiverAuditorUrlAcceptable: AmountString;
  /**
   * Balance of type "merchant-depositable" (see balance.ts for definition).
   *
   * Compatibility-only and planned for removal after consumers migrate.
   *
   * @deprecated (2026-08-19) Use maximumPayableAmount and reasons.
   */
  balanceReceiverDepositable: AmountString;
  /**
   * Compatibility-only and planned for removal after consumers migrate.
   *
   * @deprecated (2026-08-19) Use maximumPayableAmount and reasons.
   */
  balanceExchangeDepositable: AmountString;
  /**
   * Maximum effective amount that the wallet can spend,
   * when all fees are paid by the wallet.
   *
   * Compatibility-only and planned for removal after consumers migrate.
   *
   * @deprecated (2026-08-19) Use maximumPayableAmount.
   */
  maxEffectiveSpendAmount: AmountString;
  /**
   * Compatibility-only and planned for removal after consumers migrate.
   *
   * @deprecated (2026-08-19) Use exchanges.
   */
  perExchange: {
    [url: string]: {
      /**
       * Compatibility-only and planned for removal after consumers migrate.
       *
       * @deprecated (2026-08-19) Use exchanges[url].balance.available.
       */
      balanceAvailable: AmountString;
      /**
       * Compatibility-only and planned for removal after consumers migrate.
       *
       * @deprecated (2026-08-19) Use exchanges[url].balance.material.
       */
      balanceMaterial: AmountString;
      /**
       * Compatibility-only and planned for removal after consumers migrate.
       *
       * @deprecated (2026-08-19) Use exchanges[url].maximumPayableAmount and reasons.
       */
      balanceExchangeDepositable: AmountString;
      /**
       * Compatibility-only and planned for removal after consumers migrate.
       *
       * @deprecated (2026-08-19) Use exchanges[url].reasons.
       */
      balanceAgeAcceptable: AmountString;
      /**
       * Compatibility-only and planned for removal after consumers migrate.
       *
       * @deprecated (2025-12-05) Use exchanges[url].reasons.
       */
      balanceReceiverAcceptable: AmountString;
      /**
       * Compatibility-only and planned for removal after consumers migrate.
       *
       * @deprecated (2026-08-19) Use exchanges[url].reasons.
       */
      balanceReceiverExchangeUrlAcceptable: AmountString;
      /**
       * Compatibility-only and planned for removal after consumers migrate.
       *
       * @deprecated (2026-08-19) Use exchanges[url].reasons.
       */
      balanceReceiverExchangePubAcceptable: AmountString;
      /**
       * Compatibility-only and planned for removal after consumers migrate.
       *
       * @deprecated (2026-08-19) Use exchanges[url].reasons.
       */
      balanceReceiverAuditorUrlAcceptable: AmountString;
      /**
       * Compatibility-only and planned for removal after consumers migrate.
       *
       * @deprecated (2026-08-19) Use exchanges[url].maximumPayableAmount and reasons.
       */
      balanceReceiverDepositable: AmountString;
      /**
       * Compatibility-only and planned for removal after consumers migrate.
       *
       * @deprecated (2026-08-19) Use exchanges[url].maximumPayableAmount.
       */
      maxEffectiveSpendAmount: AmountString;
      /**
       * The exchange master public key configured by the merchant
       * backend differs from the one of the coins stored in the wallet.
       *
       * Compatibility-only and planned for removal after consumers migrate.
       *
       * @deprecated (2026-08-19) Use the receiver-exchange-master-pub-mismatch reason.
       */
      exchangeMasterPubMismatch: boolean;
      /**
       * Exchange doesn't have global fees configured for the relevant year,
       * p2p payments aren't possible.
       *
       * Compatibility-only and planned for removal after consumers migrate.
       *
       * @deprecated (2025-02-18) Use the exchange-global-fees-unavailable reason.
       */
      missingGlobalFees: boolean;
      /**
       * Hint that UIs should show to explain the insufficient
       * balance.
       *
       * Compatibility-only and planned for removal after consumers migrate.
       *
       * @deprecated (2026-08-19) Use exchanges[url].reasons.
       */
      causeHint?: InsufficientBalanceHint | undefined;
    };
  };
}
export declare enum InsufficientBalanceHint {
  /**
   *  Merchant doesn't accept money from exchange(s) that the wallet supports.
   */
  MerchantAcceptInsufficient = "merchant-accept-insufficient",
  /**
   * Merchant accepts funds from a matching exchange, but the funds can't be
   * deposited with the wire method.
   */
  MerchantDepositInsufficient = "merchant-deposit-insufficient",
  /**
   * While in principle the balance is sufficient,
   * the age restriction on coins causes the spendable
   * balance to be insufficient.
   */
  AgeRestricted = "age-restricted",
  /**
   * Wallet has enough available funds,
   * but the material funds are insufficient. Usually because there is a
   * pending refresh operation.
   */
  WalletBalanceMaterialInsufficient = "wallet-balance-material-insufficient",
  /**
   * The wallet simply doesn't have enough available funds.
   * This is the "obvious" case of insufficient balance.
   */
  WalletBalanceAvailableInsufficient = "wallet-balance-available-insufficient",
  /**
   * Exchange is missing the global fee configuration, thus fees are unknown
   * and funds from this exchange can't be used for p2p payments.
   */
  ExchangeMissingGlobalFees = "exchange-missing-global-fees",
  /**
   * Even though the balance looks sufficient for the instructed amount,
   * the fees can be covered by neither the merchant nor the remaining wallet
   * balance.
   */
  FeesNotCovered = "fees-not-covered",
}
/** Structured explanation emitted by current wallet-core versions. */
export interface PaymentInsufficientBalanceStructuredDetails {
  /** Balance in the requested sender scope before payment restrictions. */
  balance: CoinSelectionBalanceSnapshot;
  /**
   * Maximum contribution attainable under the failed request's actual
   * restrictions and fee policy.  For peer payments this is the maximum at
   * one exchange, since peer payments cannot combine exchanges.
   */
  maximumPayableAmount: AmountString;
  /** Operation-wide reasons, in deterministic evaluation order. */
  reasons: CoinSelectionFailureReason[];
  /** Detailed analysis for every same-currency exchange known to the wallet. */
  exchanges: Record<string, CoinSelectionExchangeFailureDiagnostics>;
}
/**
 * Balance amounts before age, receiver, wire and fee restrictions.
 *
 * The terminology follows balance.ts: pending withdrawals and peer credits
 * are pending incoming balance and are not included here.  Only effective
 * outputs expected from unfinished refreshes bridge material to available.
 */
export interface CoinSelectionBalanceSnapshot {
  /** Balance that the wallet believes it can spend immediately. */
  material: AmountString;
  /** Expected effective output of unfinished refresh operations. */
  pendingRefresh: AmountString;
  /** Material balance plus pending refresh output. */
  available: AmountString;
}
export type CoinSelectionFailureReason =
  | {
      type: CoinSelectionFailureReasonType.AvailableBalanceInsufficient;
      amountAvailable: AmountString;
    }
  | {
      type: CoinSelectionFailureReasonType.PendingRefresh;
      amountPendingRefresh: AmountString;
    }
  | {
      type: CoinSelectionFailureReasonType.MinimumAge;
      requiredMinimumAge: number;
      amountAgeAcceptable: AmountString;
    }
  | {
      type: CoinSelectionFailureReasonType.ScopeRestricted;
      scopeInfo: ScopeInfo;
    }
  | {
      type: CoinSelectionFailureReasonType.ReceiverNotAccepted;
    }
  | {
      type: CoinSelectionFailureReasonType.ReceiverExchangeMasterPubMismatch;
      walletMasterPub: string;
      receiverMasterPubs: string[];
    }
  | {
      type: CoinSelectionFailureReasonType.WireMethodUnsupported;
      wireMethod: string;
    }
  | {
      type: CoinSelectionFailureReasonType.WireFeeUnavailable;
      wireMethod: string;
    }
  | {
      type: CoinSelectionFailureReasonType.DepositAccountRestricted;
      wireMethod: string;
      accountRestrictions: Record<string, AccountRestriction[]>;
    }
  | {
      type: CoinSelectionFailureReasonType.ExchangeGlobalFeesUnavailable;
    }
  | {
      type: CoinSelectionFailureReasonType.FeesNotCovered;
      maximumPayableAmount: AmountString;
    }
  | {
      type: CoinSelectionFailureReasonType.BalanceFragmented;
      combinedMaximumPayableAmount: AmountString;
    }
  | {
      type: CoinSelectionFailureReasonType.SupersededExchangeMasterPub;
      amountAffected: AmountString;
    }
  | {
      type: CoinSelectionFailureReasonType.SelectionFailed;
    };
/**
 * Machine-readable reasons that prevented a requested coin selection.
 *
 * Unlike {@link InsufficientBalanceHint}, these values are exhaustive and can
 * be reported together.  Consumers must branch on the discriminator instead
 * of assuming that the first entry is the only cause.
 */
export declare enum CoinSelectionFailureReasonType {
  AvailableBalanceInsufficient = "available-balance-insufficient",
  PendingRefresh = "pending-refresh",
  MinimumAge = "minimum-age",
  ScopeRestricted = "scope-restricted",
  ReceiverNotAccepted = "receiver-not-accepted",
  ReceiverExchangeMasterPubMismatch = "receiver-exchange-master-pub-mismatch",
  WireMethodUnsupported = "wire-method-unsupported",
  WireFeeUnavailable = "wire-fee-unavailable",
  DepositAccountRestricted = "deposit-account-restricted",
  ExchangeGlobalFeesUnavailable = "exchange-global-fees-unavailable",
  FeesNotCovered = "fees-not-covered",
  BalanceFragmented = "balance-fragmented",
  SupersededExchangeMasterPub = "superseded-exchange-master-pub",
  SelectionFailed = "selection-failed",
}
export interface CoinSelectionExchangeFailureDiagnostics {
  /** Balance held at this exchange before payment restrictions. */
  balance: CoinSelectionBalanceSnapshot;
  /** Maximum contribution selectable from this exchange for this request. */
  maximumPayableAmount: AmountString;
  /** Exchange-local reasons, in deterministic evaluation order. */
  reasons: CoinSelectionFailureReason[];
}
interface PaymentInsufficientBalanceLegacyOnly {
  balance?: undefined;
  maximumPayableAmount?: undefined;
  reasons?: undefined;
  exchanges?: undefined;
}
export interface ListDiscountsRequest {
  /**
   * Filter by hash of token issue public key.
   */
  tokenIssuePubHash?: string;
  /**
   * Filter by merchant base URL.
   */
  merchantBaseUrl?: string;
}
export interface DiscountListDetail {
  /**
   * Hash of token family info.
   */
  tokenFamilyHash: string;
  /**
   * Hash of token issue public key.
   */
  tokenIssuePubHash: string;
  /**
   * URL of the merchant issuing the token.
   */
  merchantBaseUrl: string;
  /**
   * Name of the merchant instance issuing the token.
   */
  merchantInfo?: MerchantInfo;
  /**
   * Human-readable name for the token family.
   */
  name: string;
  /**
   * Human-readable description for the token family.
   */
  description: string;
  /**
   * Optional map from IETF BCP 47 language tags to localized descriptions.
   */
  descriptionI18n: any | undefined;
  /**
   * Start time of the token's validity period.
   */
  validityStart: Timestamp;
  /**
   * End time of the token's validity period.
   */
  validityEnd: Timestamp;
  /**
   * Number of tokens available to use.
   */
  tokensAvailable: number;
}
export interface WalletBankAccountInfo {
  bankAccountId: string;
  paytoUri: string;
  /**
   * Did we previously complete a KYC process for this bank account?
   *
   * @deprecated no enough information since the kyc can be completed for one exchange but not for another
   * https://bugs.gnunet.org/view.php?id=9696
   */
  kycCompleted: boolean;
  /**
   * Currencies supported by the bank, if known.
   */
  currencies: string[] | undefined;
  label: string | undefined;
}
export interface AcceptExchangeTosRequest {
  exchangeBaseUrl: string;
}
export interface WireTypeDetails {
  paymentTargetType: string;
  /**
   * Only applicable for payment target type IBAN.
   *
   * Specifies whether the user wants to preferably
   * enter their bank account details as an IBAN
   * or as a BBAN.
   *
   * Mandatory for paymentTargetType="iban".
   */
  preferredEntryType?: "iban" | "bban";
  /**
   * Allowed hostnames for the deposit payto URI.
   * Only applicable to x-taler-bank.
   */
  talerBankHostnames?: string[];
}
/**
 * @deprecated Use {@link ListWithdrawalExchangeCandidatesRequest} instead.
 */
export interface GetDefaultExchangesRequest {
  /**
   * Only return production exchanges from the builtin exchange list.
   * Cannot be combined with withBuiltin: false.
   */
  presetOnly?: boolean;
  /** Include exchanges from the builtin list.  Defaults to true. */
  withBuiltin?: boolean;
  /** Include demo exchanges from the builtin list.  Defaults to false. */
  withDemo?: boolean;
  /** Include test exchanges from the builtin list.  Defaults to false. */
  withTest?: boolean;
}
export interface CheckPeerPushDebitRequest {
  /**
   * Preferred exchange to use for the p2p payment.
   */
  exchangeBaseUrl?: string;
  /**
   * Instructed amount.
   *
   * FIXME: Allow specifying the instructed amount type.
   */
  amount: AmountString;
  /**
   * Restrict the scope of funds that can be spent via the given
   * scope info.
   */
  restrictScope?: ScopeInfo;
  progressToken?: string;
}
export interface CheckPeerPushDebitOkResponse {
  type: "ok";
  amountRaw: AmountString;
  amountEffective: AmountString;
  /**
   * Exchange base URL.
   */
  exchangeBaseUrl: string;
  /**
   * Maximum expiration date, based on how close the coins
   * used for the payment are to expiry.
   *
   * The value is based on when the wallet would typically
   * automatically refresh the coins on its own, leaving enough
   * time to get a refund for the push payment and refresh the
   * coin.
   */
  maxExpirationDate: TalerProtocolTimestamp;
  /**
   * Default expiration, as given by the exchange
   * (or 1 week if the exchange does not specify it).
   */
  defaultExpiration: TalerProtocolDuration;
  /**
   * Opaque description of the values reviewed by the caller.  Passing this
   * back to initiatePeerPushDebit makes wallet-core reject the operation when
   * coin selection, fees or the selected exchange changed in the meantime.
   *
   * Optional for compatibility with older wallet-core implementations.
   */
  peerPushDebitQuote?: string;
}
/**
 * Contract terms between two wallets (as opposed to a merchant and wallet).
 */
export interface PeerContractTerms {
  amount: AmountString;
  summary: string;
  icon_id?: string;
  purse_expiration: TalerProtocolTimestamp;
}
export interface WithdrawTestBalanceResult {
  /**
   * Transaction ID of the newly created withdrawal transaction.
   */
  transactionId: TransactionIdStr;
  /**
   * Account of the user registered for the withdrawal.
   */
  accountPaytoUri: string;
}
export type GetDiagnosticsOp = {
  op: WalletApiOperation.GetDiagnostics;
  request: GetDiagnosticsRequest;
  response: GetDiagnosticsResponse;
};
export interface GetDiagnosticsRequest {
  /** Serialized output format.  Defaults to JSON. */
  format?: DiagnosticsFormat;
  /** Maximum number of newest transactions to include.  Defaults to 100. */
  transactionLimit?: number;
  /** Information supplied by the wallet frontend invoking wallet-core. */
  frontendInfo?: DiagnosticsFrontendInfo;
}
export type DiagnosticsFormat = "json" | "yaml";
export interface DiagnosticsFrontendInfo {
  name: string;
  version: string;
  platform?: string;
}
/**
 * A serialized diagnostics report in the requested format.
 *
 * Returning the report as a string lets clients save it without duplicating
 * formatters or depending on the report's internal schema.
 */
export type GetDiagnosticsResponse = string;