Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( STELLAR_ASSET_CONTRACT_TOPICS = map[xdr.ScSymbol]EventType{ xdr.ScSymbol("transfer"): EventTypeTransfer, xdr.ScSymbol("mint"): EventTypeMint, xdr.ScSymbol("clawback"): EventTypeClawback, xdr.ScSymbol("burn"): EventTypeBurn, } ErrNotStellarAssetContract = errors.New("event was not from a Stellar Asset Contract") ErrEventUnsupported = errors.New("this type of Stellar Asset Contract event is unsupported") ErrEventIntegrity = errors.New("contract ID doesn't match asset + passphrase") )
View Source
var ErrNotBalanceChangeEvent = errors.New("event doesn't represent a balance change")
View Source
var ErrNotBurnEvent = errors.New("event is not a valid 'burn' event")
View Source
var ErrNotClawbackEvent = errors.New("event is not a valid 'clawback' event")
View Source
var ErrNotMintEvent = errors.New("event is not a valid 'mint' event")
View Source
var ErrNotTransferEvent = errors.New("event is not a valid 'transfer' event")
Functions ¶
func GenerateEvent ¶
func GenerateEvent( type_ EventType, from, to, admin string, asset xdr.Asset, amount *big.Int, passphrase string, ) xdr.ContractEvent
GenerateEvent is a utility function to be used by testing frameworks in order to generate Stellar Asset Contract events.
To provide a generic interface, there are more arguments than apply to the type, but you should only expect the relevant ones to be set (for example, transfer events have no admin, so it will be ignored). This means you can always pass your set of testing parameters, modify the type, and get the event filled out with the details you expect.
Types ¶
type BurnEvent ¶
type BurnEvent struct { From string Amount xdr.Int128Parts // contains filtered or unexported fields }
type ClawbackEvent ¶
type ClawbackEvent struct { Admin string From string Amount xdr.Int128Parts // contains filtered or unexported fields }
type Event ¶
type Event = xdr.ContractEvent
type MintEvent ¶
type MintEvent struct { Admin string To string Amount xdr.Int128Parts // contains filtered or unexported fields }
type StellarAssetContractEvent ¶
func NewStellarAssetContractEvent ¶
func NewStellarAssetContractEvent(event *Event, networkPassphrase string) (StellarAssetContractEvent, error)
Click to show internal directories.
Click to hide internal directories.