Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConnect = errors.New("pfsClient connect to pfs error")
ErrConnect :
View Source
var ErrNotInit = errors.New("pfgClient not init")
ErrNotInit :
Functions ¶
This section is empty.
Types ¶
type FindPathResponse ¶
type FindPathResponse struct {
PathID int `json:"path_id"`
PathHop int `json:"path_hop"`
Fee *big.Int `json:"fee"`
Result []string `json:"result"`
}
FindPathResponse :
func (*FindPathResponse) GetPath ¶
func (fpr *FindPathResponse) GetPath() []common.Address
GetPath get path array
type PfsProxy ¶
type PfsProxy interface {
/*
submit partner's balance proof to pfg
*/
SubmitBalance(nonce uint64, transferAmount, lockAmount *big.Int, openBlockNumber int64, locksroot, channelIdentifier, additionHash common.Hash, proofSigner common.Address, signature []byte) error
/*
find path
*/
FindPath(peerFrom, peerTo, token common.Address, amount *big.Int, isInitiator bool) (resp []FindPathResponse, err error)
/*
set fee rate by account
*/
SetFeePolicy(fp *models.FeePolicy) (err error)
/*
set fee rate by account
*/
SetAccountFee(feeConstant *big.Int, feePercent int64) (err error)
/*
get fee rate by account
*/
GetAccountFee() (feeConstant *big.Int, feePercent int64, err error)
/*
set fee rate by token
*/
SetTokenFee(feeConstant *big.Int, feePercent int64, tokenAddress common.Address) (err error)
/*
get fee rate by token
*/
GetTokenFee(tokenAddress common.Address) (feeConstant *big.Int, feePercent int64, err error)
/*
set fee rate by channel
*/
SetChannelFee(feeConstant *big.Int, feePercent int64, channelIdentifier common.Hash) (err error)
/*
get fee rate by channel
*/
GetChannelFee(channelIdentifier common.Hash) (feeConstant *big.Int, feePercent int64, err error)
}
PfsProxy : api to call pfg server
func NewPfsProxy ¶
func NewPfsProxy(pfgHost string, privateKey *ecdsa.PrivateKey) (pfsProxy PfsProxy)
NewPfsProxy :
Click to show internal directories.
Click to hide internal directories.