From 11bb194f264d22eeda652035f744a77bfad9e325 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Fri, 15 Nov 2024 21:03:29 +0300 Subject: [PATCH] add a struct to access the tokenDetails --- remote/accountservice.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/remote/accountservice.go b/remote/accountservice.go index 6c94a28..23b62ca 100644 --- a/remote/accountservice.go +++ b/remote/accountservice.go @@ -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.