taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

dump-coins.rst (2151B)


      1 .. ts:op:: dumpCoins
      2   :read-only:
      3 
      4   Dump all coins of the wallet in a simple JSON format.
      5 
      6   **Request:**
      7 
      8     This operation takes no arguments (an empty object).
      9 
     10   **Response:**
     11 
     12     On success, the result is a `CoinDumpJson` object.
     13 
     14 .. ts:def:: CoinDumpJson
     15 
     16   interface CoinDumpJson {
     17     coins: Array<{
     18       // The coin's denomination's public key.
     19       denomPub: DenominationPubKey;
     20 
     21       // Hash of denom_pub.
     22       denomPubHash: string;
     23 
     24       // Value of the denomination (without any fees).
     25       denomValue: string;
     26 
     27       // Public key of the coin.
     28       coinPub: string;
     29 
     30       // Base URL of the exchange for the coin.
     31       exchangeBaseUrl: string;
     32 
     33       // Public key of the parent coin.
     34       // Only present if this coin was obtained via refreshing.
     35       refreshParentCoinPub: string | undefined;
     36 
     37       // Public key of the reserve for this coin.
     38       // Only present if this coin was obtained via withdrawal.
     39       withdrawalReservePub: string | undefined;
     40 
     41       // Status of the coin.
     42       coinStatus: CoinStatus;
     43 
     44       // Information about the age restriction.
     45       ageCommitmentProof: AgeCommitmentProof | undefined;
     46 
     47       history: WalletCoinHistoryItem[];
     48     }>;
     49   }
     50 
     51 .. ts:def:: CoinStatus
     52 
     53   type CoinStatus =
     54     // Withdrawn and never shown to anybody.
     55     | "fresh"
     56     // Coin was lost as the denomination is not usable anymore.
     57     | "denom-loss"
     58     // Fresh, but marked as suspended, thus won't be used for spending.
     59     | "fresh-suspended"
     60     // A coin that has been spent and refreshed.
     61     | "dormant";
     62 
     63 .. ts:def:: WalletCoinHistoryItem
     64 
     65   type WalletCoinHistoryItem =
     66     | {
     67         type: "withdraw";
     68         transactionId: TransactionIdStr;
     69       }
     70     | {
     71         type: "spend";
     72         transactionId: TransactionIdStr;
     73         amount: AmountString;
     74       }
     75     | {
     76         type: "refresh";
     77         transactionId: TransactionIdStr;
     78         amount: AmountString;
     79       }
     80     | {
     81         type: "recoup";
     82         transactionId: TransactionIdStr;
     83         amount: AmountString;
     84       }
     85     | {
     86         type: "refund";
     87         transactionId: TransactionIdStr;
     88         amount: AmountString;
     89       };