Class IssueVoucherResponse
java.lang.Object
xyz.tcheeric.cashu.voucher.app.dto.IssueVoucherResponse
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:
- Take the SignedVoucher from this response
- Swap proofs at the mint with the voucher as the secret
- 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 Summary
Constructors -
Method Summary
-
Constructor Details
-
IssueVoucherResponse
public IssueVoucherResponse()
-
-
Method Details
-
getVoucherId
The unique voucher identifier (convenience accessor). Equivalent to voucher.getSecret().getVoucherId() -
getAmount
The face value of the voucher (convenience accessor). Equivalent to voucher.getSecret().getFaceValue() -
getUnit
The currency unit (convenience accessor). Equivalent to voucher.getSecret().getUnit()
-