Contents

getExchangeEntryByUrlread-only#

Get the wallet’s exchange entry for an exchange base URL.

Request:

The request arguments must be a GetExchangeEntryByUrlRequest object.

Response:

On success, the result is a GetExchangeEntryByUrlResponse object, which is an alias for ExchangeListItem (see listExchanges).

Expected errors:

The caller can handle the following errors inline: WALLET_EXCHANGE_ENTRY_NOT_FOUND.

// Info about an exchange entry in the wallet.
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 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;
}
// 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; withdrawing is
// withheld until the change is confirmed.
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 only the exchange's
  // claim, not proof of continuity.
  sharesDenominations: boolean;

  firstSeen: TalerPreciseTimestamp;
}
interface OperationErrorInfo {
  error: TalerErrorDetail;
}
type ExchangeTosStatus =
  | "pending"
  | "proposed"
  | "accepted"
  | "missing-tos";
// How an exchange entry became known to the wallet.
type ExchangeEntrySource =
  | "builtin"
  | "user"
  | "discovered"
  | "unknown";
type ExchangeUpdateStatus =
  | "initial"
  | "initial-update"
  | "suspended"
  | "unavailable-update"
  | "ready"
  | "ready-update"
  | "outdated-update";
interface GetExchangeEntryByUrlRequest {
  exchangeBaseUrl: string;
}
type GetExchangeEntryByUrlResponse = ExchangeListItem;