Documentation
¶
Index ¶
- Constants
- func DeleteAccountAllFeeRate(account common.Address, db *gorm.DB) (err error)
- func UpdataAccountDefaultFeePolicy(account common.Address, fee *Fee, db *gorm.DB) error
- func UpdateAccountTokenFee(account, token common.Address, fee *Fee, db *gorm.DB) error
- type AccountFee
- type AccountTokenFee
- type BalanceProof
- type ChannelParticipantFee
- type ChannelParticipantInfo
- type Fee
- type TokenFee
Constants ¶
View Source
const ( //FeePolicyConstant 每笔交易,不论金额,固定收费 FeePolicyConstant = iota //FeePolicyPercent 每笔交易固定收取一定比例的费用 FeePolicyPercent //FeePolicyCombined 以上两种方式的组合 FeePolicyCombined )
Variables ¶
This section is empty.
Functions ¶
func DeleteAccountAllFeeRate ¶
func UpdataAccountDefaultFeePolicy ¶
设置某个账户的缺省收费,新创建的通道都会按照此缺省设置进行
Types ¶
type AccountFee ¶
type AccountFee struct {
Account string `gorm:"primary_key"`
FeePolicy int //收费模式
FeeConstantPart string //固定费用
FeePercentPart int64 //比例费用
}
AccountFee 账户的缺省收费
type AccountTokenFee ¶
type AccountTokenFee struct {
gorm.Model //auto id createat updataat deleteat
Token string `gorm:"index"` //调用者保证Token+Account必须是唯一的
Account string `gorm:"index"` //调用者保证Token+Account必须是唯一的
FeePolicy int
FeeConstantPart string
FeePercentPart int64
}
AccountTokenFee 某个账户针对某个Token的缺省收费
type BalanceProof ¶
type BalanceProof struct {
Nonce uint64 `json:"nonce"`
TransferAmount *big.Int `json:"transfer_amount"`
LocksRoot common.Hash `json:"locks_root"`
ChannelID common.Hash `json:"channel_identifier"`
OpenBlockNumber int64 `json:"open_block_number"`
AdditionalHash common.Hash `json:"addition_hash"`
Signature []byte `json:"signature"`
}
type ChannelParticipantFee ¶
type ChannelParticipantFee struct {
ID int
ChannelID string `gorm:"index"`
Participant string `gorm:"index"`
Token string
FeePolicy int
FeeConstantPart string //固定部分是一个整数,比如一次收取1token
FeePercentPart int64 //0表示不收费,1000表示收费千分之一
}
ChannelParticipantFee 存储通道一方的收费信息
type ChannelParticipantInfo ¶
type ChannelParticipantInfo struct {
ID int
ChannelID string `gorm:"index"`
Participant string
Nonce uint64
Balance string
Deposit string
LockedAmount string
TransferedAmount string
IgnoreMediatedTransfer bool
}
func (*ChannelParticipantInfo) BalanceValue ¶
func (c *ChannelParticipantInfo) BalanceValue() *big.Int
type Fee ¶
type Fee struct {
FeePolicy int `json:"fee_policy"`
FeeConstant *big.Int `json:"fee_constant" `
FeePercent int64 `json:"fee_percent"`
}
Fee 为了使用方便 外部定义
func GetAccountFeePolicy ¶
GetAccountFeePolicy 获取某个账户的缺省收费,新创建的通道都会按照此缺省设置进行
func GetAccountTokenFee ¶
Click to show internal directories.
Click to hide internal directories.