github.com/nspcc-dev/neo-go@v0.105.2-0.20240517133400-6be757af3eba/pkg/services/rpcsrv/tokens.go (about)

     1  package rpcsrv
     2  
     3  import (
     4  	"github.com/nspcc-dev/neo-go/pkg/neorpc/result"
     5  )
     6  
     7  // tokenTransfers is a generic type used to represent NEP-11 and NEP-17 transfers.
     8  type tokenTransfers struct {
     9  	Sent     []any  `json:"sent"`
    10  	Received []any  `json:"received"`
    11  	Address  string `json:"address"`
    12  }
    13  
    14  // nep17TransferToNEP11 adds an ID to the provided NEP-17 transfer and returns a new
    15  // NEP-11 structure.
    16  func nep17TransferToNEP11(t17 *result.NEP17Transfer, id string) result.NEP11Transfer {
    17  	return result.NEP11Transfer{
    18  		Timestamp:   t17.Timestamp,
    19  		Asset:       t17.Asset,
    20  		Address:     t17.Address,
    21  		ID:          id,
    22  		Amount:      t17.Amount,
    23  		Index:       t17.Index,
    24  		NotifyIndex: t17.NotifyIndex,
    25  		TxHash:      t17.TxHash,
    26  	}
    27  }