add a struct to access the tokenDetails

This commit is contained in:
Alfred Kamanda 2024-11-15 21:03:29 +03:00
parent c0ccdce0a9
commit 11bb194f26
Signed by untrusted user: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -156,7 +156,9 @@ func (as *AccountService) FetchTransactions(ctx context.Context, publicKey strin
// Parameters:
// - address: The voucher address.
func (as *AccountService) VoucherData(ctx context.Context, address string) (*models.VoucherDataResult, error) {
var voucherDataResult models.VoucherDataResult
var r struct {
TokenDetails models.VoucherDataResult `json:"tokenDetails"`
}
ep, err := url.JoinPath(config.VoucherDataURL, address)
if err != nil {
@ -168,8 +170,8 @@ func (as *AccountService) VoucherData(ctx context.Context, address string) (*mod
return nil, err
}
_, err = doRequest(ctx, req, &voucherDataResult)
return &voucherDataResult, err
_, err = doRequest(ctx, req, &r)
return &r.TokenDetails, err
}
// TokenTransfer creates a new token transfer in the custodial system.