pfsproxy

package
v0.0.0-...-9f791b1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 18 Imported by: 0

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 :

Jump to

Keyboard shortcuts

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