mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-29 09:27:36 +00:00
6b21ad9922
Everywhere including examples, external interop APIs, bindings generators code and in other valuable places. A couple of `interface{}` usages are intentionally left in the CHANGELOG.md, documentation and tests.
27 lines
735 B
Go
27 lines
735 B
Go
package rpcsrv
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neo-go/pkg/neorpc/result"
|
|
)
|
|
|
|
// tokenTransfers is a generic type used to represent NEP-11 and NEP-17 transfers.
|
|
type tokenTransfers struct {
|
|
Sent []any `json:"sent"`
|
|
Received []any `json:"received"`
|
|
Address string `json:"address"`
|
|
}
|
|
|
|
// nep17TransferToNEP11 adds an ID to the provided NEP-17 transfer and returns a new
|
|
// 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,
|
|
}
|
|
}
|