depositcfg

package
v0.0.0-...-c3c44a6 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php

Index

Constants

View Source
const (
	CurrentDeposit  = uint64(0)
	MONTH_1         = uint64(1)
	MONTH_3         = uint64(3)
	MONTH_6         = uint64(6)
	MONTH_12        = uint64(12)
	SecondsPerMonth = 30 * 24 * 60 * 60 //每月秒数
	Days7Seconds    = 7 * 24 * 60 * 60
	Delay           = 60 * 60 * 2 //2小时
)
View Source
const (
	VersionA = "A"
)

Variables

View Source
var (
	FixDepositAmountMin  = new(big.Int).Mul(big.NewInt(2000), man) //定期抵押最小限额
	CurDepositAmountMin  = new(big.Int).Mul(big.NewInt(100), man)  //活期抵押最小限额
	CruWithDrawAmountMin = new(big.Int).Mul(big.NewInt(100), man)  //活期退选最小限额

)

Functions

This section is empty.

Types

type DepositCfgInterface

type DepositCfgInterface interface {
	GetDepositPositionCfg(depositType uint64) DepositCfger
}

func GetDepositCfg

func GetDepositCfg(version string) DepositCfgInterface

type DepositCfger

type DepositCfger interface {
	CheckwithdrawDeposit(index uint64, deposit *common.DepositBase, wdAm *big.Int) (bool, error)
	CheckAndcalcrefundDeposit(index uint64, deposit *common.DepositBase, t uint64) (bool, *big.Int, error)
	CheckAmountDeposit(addr common.Address, deposit *common.DepositBase, wdAm *big.Int) (bool, error)
	CalcDepositTime(index uint64, deposit *common.DepositBase, wdAm *big.Int, t uint64) error
	GetRate() uint64
}

type DepositPositionConfig

type DepositPositionConfig struct {
	DepositType          uint64
	Tmduration           uint64   //时长(活期是7天,定期是按月)
	CruWithDrawAmountMin *big.Int //参退选最小金额
	DepositRate          uint64   //利率
}

type Depositcurrent

type Depositcurrent struct {
	DepositCur DepositPositionConfig
}

func (*Depositcurrent) CalcDepositTime

func (cur *Depositcurrent) CalcDepositTime(index uint64, deposit *common.DepositBase, wdAm *big.Int, t uint64) error

func (*Depositcurrent) CheckAmountDeposit

func (cur *Depositcurrent) CheckAmountDeposit(addr common.Address, deposit *common.DepositBase, wdAm *big.Int) (bool, error)

func (*Depositcurrent) CheckAndcalcrefundDeposit

func (cur *Depositcurrent) CheckAndcalcrefundDeposit(index uint64, deposit *common.DepositBase, t uint64) (bool, *big.Int, error)

func (*Depositcurrent) CheckwithdrawDeposit

func (cur *Depositcurrent) CheckwithdrawDeposit(index uint64, deposit *common.DepositBase, wdAm *big.Int) (bool, error)

func (*Depositcurrent) GetRate

func (cur *Depositcurrent) GetRate() uint64

type Depositregular

type Depositregular struct {
	Depositreg DepositPositionConfig
}

func (*Depositregular) CalcDepositTime

func (drg *Depositregular) CalcDepositTime(index uint64, deposit *common.DepositBase, wdAm *big.Int, t uint64) error

func (*Depositregular) CheckAmountDeposit

func (drg *Depositregular) CheckAmountDeposit(addr common.Address, deposit *common.DepositBase, wdAm *big.Int) (bool, error)

func (*Depositregular) CheckAndcalcrefundDeposit

func (drg *Depositregular) CheckAndcalcrefundDeposit(index uint64, deposit *common.DepositBase, t uint64) (bool, *big.Int, error)

func (*Depositregular) CheckwithdrawDeposit

func (drg *Depositregular) CheckwithdrawDeposit(index uint64, deposit *common.DepositBase, wdAm *big.Int) (bool, error)

func (*Depositregular) GetRate

func (dc *Depositregular) GetRate() uint64

Jump to

Keyboard shortcuts

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