Documentation
¶
Index ¶
- Constants
- func FromHex(s string) []byte
- func Hex2Bytes(str string) []byte
- func OwnerToString(o *ObjectOwner) string
- type Address
- type Checkpoint
- type CoinBalanceChange
- type CoinBalanceChangeType
- type DeleteObject
- type Digest
- type EpochChange
- type Event
- type EventID
- type EventPage
- type EventQuery
- type EventResult
- type EventType
- type MoveEvent
- type MoveModule
- type MutateObject
- type NewObject
- type ObjectId
- type ObjectOwner
- type ObjectOwnerInternal
- type Publish
- type StructTag
- type SubscribeEventQuery
- type Subscription
- type SubscriptionID
- type TimeRange
- type TransferObject
Constants ¶
const ( EventTypeMove = EventType("MoveEvent") EventTypePublish = EventType("Publish") EventTypeCoinBalanceChange = EventType("CoinBalanceChange") EventTypeTransferObject = EventType("TransferObject") EventTypeNewObject = EventType("NewObject") EventTypeDeleteObject = EventType("DeleteObject") EventTypeMutateObject = EventType("MutateObject") )
const ( CoinBalanceChangeGas CoinBalanceChangeType = "Gas" CoinBalanceChangePay = "Pay" CoinBalanceChangeReceive = "Receive" )
const (
AddressLength = 20
)
Variables ¶
This section is empty.
Functions ¶
func FromHex ¶
FromHex returns the bytes represented by the hexadecimal string s. s may be prefixed with "0x".
func OwnerToString ¶
func OwnerToString(o *ObjectOwner) string
Types ¶
type Address ¶
type Address [AddressLength]byte
func BytesToAddress ¶
BytesToAddress returns Address with value b. If b is larger than len(h), b will be cropped from the left.
func HexToAddress ¶
HexToAddress returns Address with byte values of s. If s is larger than len(h), s will be cropped from the left.
func (Address) MarshalJSON ¶
func (*Address) SetBytes ¶
SetBytes sets the address to the value of b. If b is larger than len(a), b will be cropped from the left.
func (*Address) UnmarshalJSON ¶
type Checkpoint ¶
type Checkpoint struct {
CheckpointSequenceNumber uint64 `json:"checkpoint_sequence_number"`
}
Checkpoint New checkpoint
type CoinBalanceChange ¶
type CoinBalanceChange struct { PackageId string `json:"packageId"` TransactionModule string `json:"transactionModule"` Sender string `json:"sender"` ChangeType string `json:"changeType"` Owner *ObjectOwner `json:"owner"` CoinType string `json:"coinType"` CoinObjectId string `json:"coinObjectId"` Version int64 `json:"version"` Amount int64 `json:"amount"` }
CoinBalanceChange Coin balance changing event
type CoinBalanceChangeType ¶
type CoinBalanceChangeType string
type DeleteObject ¶
type DeleteObject struct { PackageID string `json:"packageId"` TransactionModule string `json:"transactionModule"` Sender string `json:"sender"` ObjectID string `json:"objectId"` Version int64 `json:"version"` }
DeleteObject Delete object
type EpochChange ¶
type EpochChange struct {
EpochId uint64 `json:"epoch_id"`
}
EpochChange Epoch change
type Event ¶
type Event json.RawMessage
type EventPage ¶
type EventPage struct { Data []json.RawMessage `json:"data"` NextCursor EventID `json:"nextCursor"` }
type EventQuery ¶
type EventQuery struct { // Return all events. All *string `json:"All"` // Return events emitted by the given transaction. Transaction *Digest `json:"Transaction"` // Return events emitted in a specified Move module MoveModule *MoveModule `json:"MoveModule"` // Return events with the given move event struct name MoveEvent *string `json:"MoveEvent"` // e.g. `0x2::devnet_nft::MintNFTEvent` // MoveEvent/Publish/CoinBalanceChange/EpochChange/Checkpoint // TransferObject/MutateObject/DeleteObject/NewObject EventType *string `json:"EventType"` // Query by sender address. Sender *Address `json:"Sender"` // Query by recipient address Recipient *ObjectOwnerInternal `json:"Recipient"` // Return events associated with the given object Object *ObjectId `json:"Object"` // Return events emitted in [start_time, end_time] interval TimeRange *TimeRange `json:"TimeRange"` }
func (EventQuery) MarshalJSON ¶
func (q EventQuery) MarshalJSON() ([]byte, error)
type EventResult ¶
type MoveEvent ¶
type MoveEvent struct { PackageId string `json:"packageId"` TransactionModule string `json:"transactionModule"` Sender string `json:"sender"` Type string `json:"type"` Fields json.RawMessage `json:"fields"` Bcs string `json:"bcs"` }
MoveEvent is a move event. Transaction level event Move-specific event
type MoveModule ¶
type MutateObject ¶
type MutateObject struct { PackageID string `json:"packageId"` TransactionModule string `json:"transactionModule"` Sender string `json:"sender"` ObjectType string `json:"objectType"` ObjectID string `json:"objectId"` Version int64 `json:"version"` }
MutateObject Object level event Object mutated.
type NewObject ¶
type NewObject struct { PackageID string `json:"packageId"` TransactionModule string `json:"transactionModule"` Sender string `json:"sender"` Recipient *ObjectOwner `json:"recipient"` ObjectType string `json:"objectType"` ObjectID string `json:"objectId"` Version int64 `json:"version"` }
NewObject object creation
type ObjectOwner ¶
type ObjectOwner struct { *ObjectOwnerInternal // contains filtered or unexported fields }
func (*ObjectOwner) MarshalJSON ¶
func (o *ObjectOwner) MarshalJSON() ([]byte, error)
func (*ObjectOwner) Scan ¶
func (o *ObjectOwner) Scan(value interface{}) error
Scan scan value into Jsonb, implements sql.Scanner interface
func (*ObjectOwner) UnmarshalJSON ¶
func (o *ObjectOwner) UnmarshalJSON(data []byte) error
type ObjectOwnerInternal ¶
type Publish ¶
type Publish struct { Sender string `json:"sender"` PackageID string `json:"packageId"` Version int64 `json:"version"` Digest string `json:"digest"` }
Publish Module published
type SubscribeEventQuery ¶
type SubscribeEventQuery struct { //Package *string //Module *string //MoveEventType *string //MoveEventField interface{} //SenderAddress *string EventType EventType }
type Subscription ¶
type Subscription struct { Subscription SubscriptionID `json:"subscription"` Result json.RawMessage `json:"result"` }
type SubscriptionID ¶
type SubscriptionID uint64
type TransferObject ¶
type TransferObject struct { PackageID string `json:"packageId"` TransactionModule string `json:"transactionModule"` Sender string `json:"sender"` Recipient *ObjectOwner `json:"recipient"` ObjectType string `json:"objectType"` ObjectID string `json:"objectId"` Version int64 `json:"version"` }
TransferObject Object level event Transfer objects to new address / wrap in another object