bridge

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// 合约函数
	BridgeSetOperator       = "bridge_setoperator"
	BridgePause             = "bridge_pause"
	BridgeUnpause           = "bridge_unpause"
	BridgePauseToken        = "bridge_pause_token"
	BridgeUnpauseToken      = "bridge_unpause_token"
	BridgeWithdraw          = "bridge_withdraw"
	BridgeSendTokenApproval = "bridge_sendtoken_approval"
	BridgeSendToken         = "bridge_sendtoken"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

type Bridge struct {
	// contains filtered or unexported fields
}

Bridge is a Go wrapper around an on-chain checkpoint oracle contract.

func NewBridge

func NewBridge(contractAddr common.Address, backend bind.ContractBackend) (ctrt *Bridge, err error)

NewBridge binds checkpoint contract and returns a registrar instance.

func (*Bridge) Contract

func (ctrct *Bridge) Contract() *contract.Bridge

Contract returns the underlying contract instance.

func (*Bridge) ContractAddr

func (ctrct *Bridge) ContractAddr() common.Address

ContractAddr returns the address of contract.

func (*Bridge) DepositToken

func (ctrct *Bridge) DepositToken(ctx context.Context, chainID *big.Int, fromPriv *ecdsa.PrivateKey, nonce *big.Int, token common.Address, value *big.Int) (txHash, rawTx string, err error)

func (*Bridge) GetBalance

func (ctrct *Bridge) GetBalance(ctx context.Context, from common.Address) (*big.Int, error)

GetBalance 获取主币余额

func (*Bridge) GetIn

func (ctrct *Bridge) GetIn(ctx context.Context, from common.Address, offset *big.Int) (contract.BridgeTokenIn, error)

func (*Bridge) GetInLength

func (ctrct *Bridge) GetInLength(ctx context.Context, from common.Address) (*big.Int, error)

func (*Bridge) GetOut

func (ctrct *Bridge) GetOut(ctx context.Context, from common.Address, offset *big.Int) (contract.BridgeTokenOut, error)

func (*Bridge) Operator1

func (ctrct *Bridge) Operator1(ctx context.Context, from common.Address) (common.Address, error)

func (*Bridge) Operator2

func (ctrct *Bridge) Operator2(ctx context.Context, from common.Address) (common.Address, error)

func (*Bridge) Owner

func (ctrct *Bridge) Owner(ctx context.Context, from common.Address) (common.Address, error)

Owner 获取主币余额

func (*Bridge) PauseToken

func (ctrct *Bridge) PauseToken(ctx context.Context, chainID *big.Int, fromPriv *ecdsa.PrivateKey, nonce *big.Int, token common.Address) (txHash, rawTx string, err error)

func (*Bridge) SendToken

func (ctrct *Bridge) SendToken(ctx context.Context, chainID *big.Int, fromPriv *ecdsa.PrivateKey, nonce *big.Int, fromIndex *big.Int, token common.Address, to common.Address, value *big.Int) (txHash, rawTx string, err error)

func (*Bridge) SetOperator

func (ctrct *Bridge) SetOperator(ctx context.Context, chainID *big.Int, fromPriv *ecdsa.PrivateKey, nonce *big.Int, operator common.Address, index *big.Int) (txHash, rawTx string, err error)

func (*Bridge) UnpauseToken

func (ctrct *Bridge) UnpauseToken(ctx context.Context, chainID *big.Int, fromPriv *ecdsa.PrivateKey, nonce *big.Int, token common.Address) (txHash, rawTx string, err error)

func (*Bridge) Withdraw

func (ctrct *Bridge) Withdraw(ctx context.Context, chainID *big.Int, fromPriv *ecdsa.PrivateKey, nonce *big.Int, token common.Address) (txHash, rawTx string, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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