relayer

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKeyStore

func GetKeyStore() (string, *strings.Reader)

GetKeyStore return passparser and keystore reader

func GetKeyStoreReader

func GetKeyStoreReader() *strings.Reader

GetKeyStoreReader return reader for keystore

Types

type Blockchain

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

Blockchain struct

func NewBlockchain

func NewBlockchain(client *rpc.Client,
	ethclient *ethclient.Client,
	signer *Signer) *Blockchain

NewBlockchain init

func (*Blockchain) GetLendingRelayer added in v1.2.0

func (b *Blockchain) GetLendingRelayer(coinAddress common.Address, contractAddress common.Address) (*LendingRInfo, error)

GetLendingRelayer return all lending pair in smart contract

func (*Blockchain) GetLendingRelayers added in v1.2.0

func (b *Blockchain) GetLendingRelayers(registrationAddress common.Address, lendingAddress common.Address) ([]*LendingRInfo, error)

func (*Blockchain) GetRelayer

func (b *Blockchain) GetRelayer(coinAddress common.Address, contractAddress common.Address) (*RInfo, error)

GetRelayer return all tokens in smart contract

func (*Blockchain) GetRelayerCoinBaseByIndex added in v1.2.0

func (b *Blockchain) GetRelayerCoinBaseByIndex(idx int64, contractAddress common.Address) (common.Address, error)

func (*Blockchain) GetRelayerCount added in v1.2.0

func (b *Blockchain) GetRelayerCount(contractAddress common.Address) (*big.Int, error)

func (*Blockchain) GetRelayerResignStatus added in v1.2.0

func (b *Blockchain) GetRelayerResignStatus(contractAddress common.Address, coinbase common.Address) (*big.Int, error)

func (*Blockchain) GetRelayers added in v1.2.0

func (b *Blockchain) GetRelayers(contractAddress common.Address) ([]*RInfo, error)

func (*Blockchain) GetTokenInfo

func (b *Blockchain) GetTokenInfo(token common.Address, abi *abi.ABI) (*TokenInfo, error)

GetTokenInfo return token info

func (*Blockchain) GetTokenInfoEx

func (b *Blockchain) GetTokenInfoEx(token common.Address, abiPath string) (*TokenInfo, error)

GetTokenInfoEx return token info

func (*Blockchain) RunContract

func (b *Blockchain) RunContract(contractAddr common.Address, abi *abi.ABI, method string, args ...interface{}) (interface{}, error)

RunContract run smart contract

type Corrateral added in v1.2.0

type Corrateral struct {
	Name    string         `json:"name"`
	Address common.Address `json:"address"`
}

type LendingPairToken added in v1.2.0

type LendingPairToken struct {
	Term         uint64
	LendingToken common.Address
}

LendingPairToken lending pari

type LendingRInfo added in v1.2.0

type LendingRInfo struct {
	Address         common.Address
	ColateralTokens map[common.Address]*TokenInfo
	LendingTokens   map[common.Address]*TokenInfo
	LendingPairs    []*LendingPairToken
	Fee             uint16
}

LendingRInfo lending relayer info

type PairToken

type PairToken struct {
	BaseToken  common.Address
	QuoteToken common.Address
}

PairToken pare token

type RInfo

type RInfo struct {
	RID      int
	Owner    common.Address
	Deposit  *big.Int
	Address  common.Address
	Tokens   map[common.Address]*TokenInfo
	Pairs    []*PairToken
	Resign   bool
	LockTime int
	MakeFee  uint16
	TakeFee  uint16
}

RInfo struct

type Relayer

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

Relayer get token

func NewRelayer

func NewRelayer(rpcURL string,
	coinBase common.Address,
	relayerAddress common.Address,
	lendingRelayerAddress common.Address,
) *Relayer

NewRelayer init relayer

func (*Relayer) GetLending added in v1.2.0

func (r *Relayer) GetLending() (*LendingRInfo, error)

GetLending get relayer information

func (*Relayer) GetLendings added in v1.2.0

func (r *Relayer) GetLendings() ([]*LendingRInfo, error)

func (*Relayer) GetRelayer

func (r *Relayer) GetRelayer(coinbase common.Address) (*RInfo, error)

GetRelayer get relayer information

func (*Relayer) GetRelayers added in v1.2.0

func (r *Relayer) GetRelayers() ([]*RInfo, error)

type Signer

type Signer struct {
	Keystore   string `json:"keystore_path"`
	Passphrase string `json:"passphrase"`
	// contains filtered or unexported fields
}

func NewSigner

func NewSigner() *Signer

func NewSignerFile

func NewSignerFile(file string, fileLocation string) *Signer

func (*Signer) GetAddress

func (self *Signer) GetAddress() ethereum.Address

func (*Signer) GetTransactOpts

func (self *Signer) GetTransactOpts() *bind.TransactOpts

func (*Signer) Sign

func (self *Signer) Sign(tx *types.Transaction) (*types.Transaction, error)

type TokenInfo

type TokenInfo struct {
	Name     string
	Symbol   string
	Decimals uint8
	// contains filtered or unexported fields
}

TokenInfo token info

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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