Documentation ¶
Index ¶
- func AddAuthority(chain *Chain, address string) error
- func Cleanup(chain *Chain, lastBlock *big.Int, wg *sync.WaitGroup)
- func Deposit(chain *Chain, value *big.Int, id string) error
- func DepositPrompt(chain *Chain, ks *keystore.KeyStore)
- func Filter(chain *Chain, allChains []*Chain, filter *ethereum.FilterQuery, ...)
- func FundBridge(chain *Chain, value *big.Int) error
- func FundPrompt(chain *Chain, ks *keystore.KeyStore)
- func HandleDeposit(chain *Chain, allChains []*Chain, txHash common.Hash, withdrawDone chan bool)
- func Listen(chain *Chain, ac []*Chain, e *Events, doneClient chan bool, ...)
- func ParseJsonForResult(jsonStr string) (string, error)
- func PayBridge(chain *Chain, value *big.Int) error
- func PayBridgePrompt(chain *Chain, ks *keystore.KeyStore)
- func ReadLogs(chain *Chain, allChains []*Chain, logs []types.Log, logsDone chan bool)
- func SendTx(chain *Chain, value *big.Int, data []byte) (common.Hash, error)
- func SignMessage(chain *Chain, msg []byte) ([]byte, error)
- func Withdraw(chain *Chain, withdrawal *Withdrawal) error
- func WithdrawTo(chain *Chain, value *big.Int, id string) error
- func WithdrawToPrompt(chain *Chain, ks *keystore.KeyStore)
- type Call
- type Chain
- type Events
- type JsonRpcResponse
- type Resp
- type Withdrawal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAuthority ¶
func DepositPrompt ¶
func FundPrompt ¶
func HandleDeposit ¶
func Listen ¶
func Listen(chain *Chain, ac []*Chain, e *Events, doneClient chan bool, ks *keystore.KeyStore, fl map[string]bool, wg *sync.WaitGroup)
main goroutine starts a client to listen on every chain
func ParseJsonForResult ¶
this function parses jsonStr for the entry "result" and returns its value as a string
func PayBridgePrompt ¶
func SignMessage ¶
sign a message using chain.From account
func Withdraw ¶
func Withdraw(chain *Chain, withdrawal *Withdrawal) error
func WithdrawTo ¶
ids are in hexidecimal
func WithdrawToPrompt ¶
Types ¶
type Call ¶
type Call struct { Jsonrpc string `json:"jsonrpc"` Method string `json:"method"` Params []string `json:"params"` Id int `json:"id"` }
used to json format an RPC call
type Chain ¶
type Chain struct { Name string `json:"name"` Url string `json:"url"` Id *big.Int `json:"id,omitempty"` Contract *common.Address `json:"contractAddr"` GasPrice *big.Int `json:"gasPrice"` From *common.Address `json:"from"` Password string `json:"password,omitempty"` Client *ethclient.Client `json:"client,omitempty"` Nonce uint64 `json:"nonce,omitempty"` StartBlock *big.Int `json:"startBlock,omitempty"` }
func FindChainByName ¶
type Events ¶
type Events struct { DepositId string CreationId string WithdrawId string BridgeFundedId string PaidId string }
events to listen for
type JsonRpcResponse ¶
type JsonRpcResponse struct { Id int `json:"id,omitempty"` Jsonrpc string `json:"jsonrpc,omitempty"` Result string `json:"result"` }
**** helpers ****
Click to show internal directories.
Click to hide internal directories.