Class IssueVoucherResponse

java.lang.Object
xyz.tcheeric.cashu.voucher.app.dto.IssueVoucherResponse

public class IssueVoucherResponse extends Object
Response DTO for voucher issuance.

This DTO contains the newly issued voucher. The voucher is signed by the issuer and published to the ledger, but does not include a shareable token.

Token Creation

Creating a shareable Cashu token requires mint interaction (blind signatures, keyset). Use a wallet implementation (e.g., cashu-client's VoucherService) to:

  1. Take the SignedVoucher from this response
  2. Swap proofs at the mint with the voucher as the secret
  3. Encode the result as a TokenV4 (cashuB...) token

Usage Example

 // Issue voucher (creates and signs voucher, publishes to ledger)
 IssueVoucherResponse response = voucherService.issue(request);
 SignedVoucher voucher = response.getVoucher();

 // To create a shareable token, use a wallet:
 // IssueVoucherResult result = walletVoucherService.issueAndBackup(...);
 // String token = result.token();  // "cashuB..." format
 
See Also:
  • Constructor Details

    • IssueVoucherResponse

      public IssueVoucherResponse()
  • Method Details

    • getVoucherId

      public String getVoucherId()
      The unique voucher identifier (convenience accessor). Equivalent to voucher.getSecret().getVoucherId()
    • getAmount

      public Long getAmount()
      The face value of the voucher (convenience accessor). Equivalent to voucher.getSecret().getFaceValue()
    • getUnit

      public String getUnit()
      The currency unit (convenience accessor). Equivalent to voucher.getSecret().getUnit()