scry

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes32ToIpfsHash

func Bytes32ToIpfsHash(value [32]byte) (string, error)

Types

type ChainWrapper

type ChainWrapper interface {
	Publish(txParams *chainoperations.TransactParams, price *big.Int, metaDataID []byte, proofDataIDs []string,
		proofNum int, detailsID string, supportVerify bool) (string, error)
	PrepareToBuy(txParams *chainoperations.TransactParams, publishId string, startVerify bool) error
	BuyData(txParams *chainoperations.TransactParams, txId *big.Int) error
	CancelTransaction(txParams *chainoperations.TransactParams, txId *big.Int) error
	SubmitMetaDataIdEncWithBuyer(txParams *chainoperations.TransactParams, txId *big.Int, encyptedMetaDataId []byte) error
	ConfirmDataTruth(txParams *chainoperations.TransactParams, txId *big.Int, truth bool) error
	ApproveTransfer(txParams *chainoperations.TransactParams, spender common.Address, value *big.Int) error
	Vote(txParams *chainoperations.TransactParams, txId *big.Int, judge bool, comments string) error
	RegisterAsVerifier(txParams *chainoperations.TransactParams) error
	CreditsToVerifier(txParams *chainoperations.TransactParams, txId *big.Int, index uint8, credit uint8) error
	TransferTokens(txParams *chainoperations.TransactParams, to common.Address, value *big.Int) error
	GetTokenBalance(txParams *chainoperations.TransactParams, owner common.Address) (*big.Int, error)
	TransferEth(from common.Address,
		password string,
		to common.Address,
		value *big.Int) (*types.Transaction, error)
	GetEthBalance(owner common.Address) (*big.Int, error)
}

func NewChainWrapper

func NewChainWrapper(protocolContractAddress common.Address,
	tokenContractAddress common.Address,
	clientConn *ethclient.Client,
) (ChainWrapper, error)

type Client

type Client interface {
	Account() *accounts.Account
	SubscribeEvent(eventName string, callback chainevents.EventCallback) error
	UnSubscribeEvent(eventName string) error
	Authenticate(password string) (bool, error)
	TransferEthFrom(from common.Address, password string, value *big.Int, ec *ethclient.Client) error
	TransferTokenFrom(from common.Address, password string, value *big.Int) error
	GetEth(owner common.Address, ec *ethclient.Client) (*big.Int, error)
	GetScryToken(owner common.Address) (*big.Int, error)
}

func CreateScryClient

func CreateScryClient(password string, chainWrapper ChainWrapper) (Client, error)

func NewScryClient

func NewScryClient(publicKey string, chainWrapper ChainWrapper) Client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL