Documentation ¶
Index ¶
- Variables
- type Decoder
- func (d *Decoder) AddKnownERC1155(address common.Address)
- func (d *Decoder) AddKnownERC20(address common.Address)
- func (d *Decoder) AddKnownERC721(address common.Address)
- func (d *Decoder) AddKnownExchange(address common.Address)
- func (d *Decoder) Decode(log types.Log, decodedLog interface{}) error
- func (d *Decoder) FindEventType(log types.Log) (string, error)
- func (d *Decoder) RemoveKnownERC1155(address common.Address)
- func (d *Decoder) RemoveKnownERC20(address common.Address)
- func (d *Decoder) RemoveKnownERC721(address common.Address)
- func (d *Decoder) RemoveKnownExchange(address common.Address)
- type ERC1155ApprovalForAllEvent
- type ERC1155TransferBatchEvent
- type ERC1155TransferSingleEvent
- type ERC20ApprovalEvent
- type ERC20TransferEvent
- type ERC721ApprovalEvent
- type ERC721ApprovalForAllEvent
- type ERC721TransferEvent
- type ExchangeCancelEvent
- type ExchangeCancelUpToEvent
- type ExchangeFillEvent
- type UnsupportedEventError
- type UntrackedTokenError
- type WKlayDepositEvent
- type WKlayDepositEventJSON
- type WKlayWithdrawalEvent
- type WKlayWithdrawalEventJSON
Constants ¶
This section is empty.
Variables ¶
var EVENT_SIGNATURES = [...]string{
"Transfer(address,address,uint256)",
"Approval(address,address,uint256)",
"TransferSingle(address,address,address,uint256,uint256)",
"TransferBatch(address,address,address,uint256[],uint256[])",
"ApprovalForAll(address,address,bool)",
"Deposit(address,uint256)",
"Withdrawal(address,uint256)",
"Fill(address,address,bytes,bytes,bytes,bytes,bytes32,address,address,uint256,uint256,uint256,uint256,uint256)",
"Cancel(address,address,bytes,bytes,address,bytes32)",
"CancelUpTo(address,address,uint256)",
}
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder decodes events relevant to the fillability of 0x orders. Since ERC20 & ERC721 events have the same signatures, but different meanings, all ERC20 & ERC721 contract addresses must be added to the decoder ahead of time.
func (*Decoder) AddKnownERC1155 ¶
AddKnownERC1155 registers the supplied contract address as an ERC1155 contract. If an event is found from this contract address, the decoder will properly decode the `Transfer` and `Approve` events including the correct event parameter names.
func (*Decoder) AddKnownERC20 ¶
AddKnownERC20 registers the supplied contract address as an ERC20 contract. If an event is found from this contract address, the decoder will properly decode the `Transfer` and `Approve` events including the correct event parameter names.
func (*Decoder) AddKnownERC721 ¶
AddKnownERC721 registers the supplied contract address as an ERC721 contract. If an event is found from this contract address, the decoder will properly decode the `Transfer` and `Approve` events including the correct event parameter names.
func (*Decoder) AddKnownExchange ¶
AddKnownExchange registers the supplied contract address as a 0x Exchange contract. If an event is found from this contract address, the decoder will properly decode it's events including the correct event parameter names.
func (*Decoder) Decode ¶
Decode attempts to decode the supplied log given the event types relevant to 0x orders. The decoded result is stored in the value pointed to by supplied `decodedLog` struct.
func (*Decoder) FindEventType ¶
FindEventType returns to event type contained in the supplied log. It looks both at the registered contract addresses and the log topic.
func (*Decoder) RemoveKnownERC1155 ¶
RemoveKnownERC1155 removes an ERC1155 address from the list of known addresses. We will no longer decode events for this token.
func (*Decoder) RemoveKnownERC20 ¶
RemoveKnownERC20 removes an ERC20 address from the list of known addresses. We will no longer decode events for this token.
func (*Decoder) RemoveKnownERC721 ¶
RemoveKnownERC721 removes an ERC721 address from the list of known addresses. We will no longer decode events for this token.
func (*Decoder) RemoveKnownExchange ¶
RemoveKnownExchange removes an Exchange address from the list of known addresses. We will no longer decode events for this contract.
type ERC1155ApprovalForAllEvent ¶
type ERC1155ApprovalForAllEvent struct { Owner common.Address `json:"owner"` Operator common.Address `json:"operator"` Approved bool `json:"approved"` }
ERC1155ApprovalForAllEvent represents an ERC1155 ApprovalForAll event
type ERC1155TransferBatchEvent ¶
type ERC1155TransferBatchEvent struct { Operator common.Address From common.Address To common.Address Ids []*big.Int Values []*big.Int }
ERC1155TransferBatchEvent represents an ERC1155 TransfeSingler event
func (ERC1155TransferBatchEvent) MarshalJSON ¶
func (e ERC1155TransferBatchEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom JSON marshaller for the ERC1155TransferBatchEvent type
func (*ERC1155TransferBatchEvent) UnmarshalJSON ¶
func (e *ERC1155TransferBatchEvent) UnmarshalJSON(data []byte) error
type ERC1155TransferSingleEvent ¶
type ERC1155TransferSingleEvent struct { Operator common.Address From common.Address To common.Address Id *big.Int Value *big.Int }
ERC1155TransferSingleEvent represents an ERC1155 TransfeSingler event
func (ERC1155TransferSingleEvent) MarshalJSON ¶
func (e ERC1155TransferSingleEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom JSON marshaller for the ERC1155TransferSingleEvent type
func (*ERC1155TransferSingleEvent) UnmarshalJSON ¶
func (e *ERC1155TransferSingleEvent) UnmarshalJSON(data []byte) error
type ERC20ApprovalEvent ¶
ERC20ApprovalEvent represents an ERC20 Approval event
func (ERC20ApprovalEvent) MarshalJSON ¶
func (e ERC20ApprovalEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom JSON marshaller for the ERC20ApprovalEvent type
func (*ERC20ApprovalEvent) UnmarshalJSON ¶
func (e *ERC20ApprovalEvent) UnmarshalJSON(data []byte) error
type ERC20TransferEvent ¶
ERC20TransferEvent represents an ERC20 Transfer event
func (ERC20TransferEvent) MarshalJSON ¶
func (e ERC20TransferEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom JSON marshaller for the ERC20TransferEvent type
func (*ERC20TransferEvent) UnmarshalJSON ¶
func (e *ERC20TransferEvent) UnmarshalJSON(data []byte) error
type ERC721ApprovalEvent ¶
ERC721ApprovalEvent represents an ERC721 Approval event
func (ERC721ApprovalEvent) MarshalJSON ¶
func (e ERC721ApprovalEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom JSON marshaller for the ERC721ApprovalEvent type
func (*ERC721ApprovalEvent) UnmarshalJSON ¶
func (e *ERC721ApprovalEvent) UnmarshalJSON(data []byte) error
type ERC721ApprovalForAllEvent ¶
type ERC721ApprovalForAllEvent struct { Owner common.Address `json:"owner"` Operator common.Address `json:"operator"` Approved bool `json:"approved"` }
ERC721ApprovalForAllEvent represents an ERC721 ApprovalForAll event
type ERC721TransferEvent ¶
ERC721TransferEvent represents an ERC721 Transfer event
func (ERC721TransferEvent) MarshalJSON ¶
func (e ERC721TransferEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom JSON marshaller for the ERC721TransferEvent type
func (*ERC721TransferEvent) UnmarshalJSON ¶
func (e *ERC721TransferEvent) UnmarshalJSON(data []byte) error
type ExchangeCancelEvent ¶
type ExchangeCancelEvent struct { MakerAddress common.Address FeeRecipientAddress common.Address SenderAddress common.Address OrderHash common.Hash MakerAssetData []byte TakerAssetData []byte }
ExchangeCancelEvent represents a 0x Exchange Cancel event
func (ExchangeCancelEvent) MarshalJSON ¶
func (e ExchangeCancelEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom JSON marshaller for the ExchangeCancelEvent type
func (*ExchangeCancelEvent) UnmarshalJSON ¶
func (e *ExchangeCancelEvent) UnmarshalJSON(data []byte) error
type ExchangeCancelUpToEvent ¶
type ExchangeCancelUpToEvent struct { MakerAddress common.Address OrderSenderAddress common.Address OrderEpoch *big.Int }
ExchangeCancelUpToEvent represents a 0x Exchange CancelUpTo event
func (ExchangeCancelUpToEvent) MarshalJSON ¶
func (e ExchangeCancelUpToEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom JSON marshaller for the ExchangeCancelUpToEvent type
func (*ExchangeCancelUpToEvent) UnmarshalJSON ¶
func (e *ExchangeCancelUpToEvent) UnmarshalJSON(data []byte) error
type ExchangeFillEvent ¶
type ExchangeFillEvent struct { MakerAddress common.Address TakerAddress common.Address SenderAddress common.Address FeeRecipientAddress common.Address MakerAssetFilledAmount *big.Int TakerAssetFilledAmount *big.Int MakerFeePaid *big.Int TakerFeePaid *big.Int ProtocolFeePaid *big.Int OrderHash common.Hash MakerAssetData []byte TakerAssetData []byte MakerFeeAssetData []byte TakerFeeAssetData []byte }
ExchangeFillEvent represents a 0x Exchange Fill event
func (ExchangeFillEvent) MarshalJSON ¶
func (e ExchangeFillEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom JSON marshaller for the ExchangeFillEvent type
func (*ExchangeFillEvent) UnmarshalJSON ¶
func (e *ExchangeFillEvent) UnmarshalJSON(data []byte) error
type UnsupportedEventError ¶
UnsupportedEventError is thrown when an unsupported topic is encountered
func (UnsupportedEventError) Error ¶
func (e UnsupportedEventError) Error() string
Error returns the error string
type UntrackedTokenError ¶
func (UntrackedTokenError) Error ¶
func (e UntrackedTokenError) Error() string
Error returns the error string
type WKlayDepositEvent ¶
WKlayDepositEvent represents a wrapped KLAY Deposit event
func (WKlayDepositEvent) MarshalJSON ¶
func (w WKlayDepositEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom JSON marshaller for the WKlayDepositEvent type
func (*WKlayDepositEvent) UnmarshalJSON ¶
func (e *WKlayDepositEvent) UnmarshalJSON(data []byte) error
type WKlayDepositEventJSON ¶
type WKlayWithdrawalEvent ¶
WKlayWithdrawalEvent represents a wrapped KLAY Withdraw event
func (WKlayWithdrawalEvent) MarshalJSON ¶
func (w WKlayWithdrawalEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom JSON marshaller for the WKlayWithdrawalEvent type
func (*WKlayWithdrawalEvent) UnmarshalJSON ¶
func (e *WKlayWithdrawalEvent) UnmarshalJSON(data []byte) error