Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Chain ¶
type Chain interface { GetContract(addr []byte, contractType string) (interface{}, error) NewContract(ctx context.Context, from []byte, contractType string, contractData interface{}) (*transaction.Transaction, error) Call(ctx context.Context, from []byte, contractType string, contractAddr []byte, methodName string, value *big.Int, callData interface{}) (*transaction.Transaction, error) Query(ctx context.Context, addr []byte, abiString string, methodName string, result interface{}, params ...interface{}) error CallWithAbi(ctx context.Context, from []byte, contractAddr []byte, methodName string, value *big.Int, callData interface{}, abiStr string) (*transaction.Transaction, error) ConfirmTrans(ctx context.Context, trans *transaction.Transaction, sig []byte) error WaitMined(ctx context.Context, trans *transaction.Transaction) error BalanceAt(ctx context.Context, addr []byte) (*big.Int, error) BalanceAtICST(ctx context.Context, addr []byte) (*big.Int, error) PubKeyToAddress(pub *ecdsa.PublicKey) []byte UnmarshalPubkey(pub string) (*ecdsa.PublicKey, error) MarshalPubKey(pub *ecdsa.PublicKey) string GenerateKey(ctx context.Context) (*ecdsa.PrivateKey, error) Sign(hash []byte, prv *ecdsa.PrivateKey) (sig []byte, err error) Transfer(ctx context.Context, from []byte, to []byte, value *big.Int) (*transaction.Transaction, error) TransferICST(ctx context.Context, from []byte, to []byte, value *big.Int) (*transaction.Transaction, error) WatchBlocks(ctx context.Context, blockStart *big.Int) (<-chan *transaction.Block, <-chan error) WatchICSTTransfer(ctx context.Context, blockStart *big.Int) (<-chan *transaction.Block, <-chan error) GetContractEvents(ctx context.Context, addr []byte, fromBlock, toBlock *big.Int, abiString string, eventTypes map[string]reflect.Type) ([]*ContractEvent, error) }
type ContractEvent ¶
type ContractEvent struct { Addr []byte //contract address Name string //event name T reflect.Type //type of underlying chain specific contract event V interface{} //underlying chain specific contract event BlockNum uint64 BlockHash []byte TxIndex uint64 TxHash []byte Unwatch func() `json:"-"` //unwatch the event at any time }
type ContractType ¶
type ContractType string
const ( ContentContractType ContractType = "Content" SkillContractType ContractType = "Skill" )
Click to show internal directories.
Click to hide internal directories.