2022-07-21 13:21:44 +00:00
|
|
|
package rpcsrv
|
2021-11-17 20:04:50 +00:00
|
|
|
|
|
|
|
import (
|
2022-07-22 16:09:29 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/neorpc/result"
|
2021-11-17 20:04:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// tokenTransfers is a generic type used to represent NEP-11 and NEP-17 transfers.
|
|
|
|
type tokenTransfers struct {
|
|
|
|
Sent []interface{} `json:"sent"`
|
|
|
|
Received []interface{} `json:"received"`
|
|
|
|
Address string `json:"address"`
|
|
|
|
}
|
|
|
|
|
2022-04-20 18:30:09 +00:00
|
|
|
// nep17TransferToNEP11 adds an ID to the provided NEP-17 transfer and returns a new
|
2021-11-17 20:04:50 +00:00
|
|
|
// NEP-11 structure.
|
|
|
|
func nep17TransferToNEP11(t17 *result.NEP17Transfer, id string) result.NEP11Transfer {
|
|
|
|
return result.NEP11Transfer{
|
|
|
|
Timestamp: t17.Timestamp,
|
|
|
|
Asset: t17.Asset,
|
|
|
|
Address: t17.Address,
|
|
|
|
ID: id,
|
|
|
|
Amount: t17.Amount,
|
|
|
|
Index: t17.Index,
|
|
|
|
NotifyIndex: t17.NotifyIndex,
|
|
|
|
TxHash: t17.TxHash,
|
|
|
|
}
|
|
|
|
}
|