exchangecc

package
v1.0.7-hotfix1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: GPL-3.0, GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const EXCHANGELIST_HISTORY = "ExchangeOrderHistory-"
View Source
const EXCHANGELIST_RECORD = "ExchangeOrder-"
View Source
const MatchRecordPrefix = "MatchRecord-"

Variables

This section is empty.

Functions

func KycUser

func KycUser(addr common.Address) bool

func SaveExchangeOrder

func SaveExchangeOrder(stub shim.ChaincodeStubInterface, order *ExchangeOrder) error

增加一个新订单

func UpdateExchangeOrder

func UpdateExchangeOrder(stub shim.ChaincodeStubInterface, order *ExchangeOrder) error

更新一个已有的订单

Types

type ExchangeMgr

type ExchangeMgr struct {
}

PCGTta3M4t3yXu8uRgkKvaWd2d8DS36t3ba

func (*ExchangeMgr) AddExchangeOrder

func (p *ExchangeMgr) AddExchangeOrder(stub shim.ChaincodeStubInterface, sheet *ExchangeOrder) error

func (*ExchangeMgr) Cancel

func (p *ExchangeMgr) Cancel(stub shim.ChaincodeStubInterface, orderSn string) error

func (*ExchangeMgr) GetActiveOrderList

func (p *ExchangeMgr) GetActiveOrderList(stub shim.ChaincodeStubInterface) ([]*ExchangeOrderJson, error)

func (*ExchangeMgr) GetActiveOrdersByMaker

func (p *ExchangeMgr) GetActiveOrdersByMaker(stub shim.ChaincodeStubInterface, addr common.Address) ([]*ExchangeOrderJson, error)

func (*ExchangeMgr) GetAllMatchList

func (p *ExchangeMgr) GetAllMatchList(stub shim.ChaincodeStubInterface) ([]*MatchRecordJson, error)

func (*ExchangeMgr) GetHistoryOrderList

func (p *ExchangeMgr) GetHistoryOrderList(stub shim.ChaincodeStubInterface) ([]*ExchangeOrderJson, error)

func (*ExchangeMgr) GetOrderMatchList

func (p *ExchangeMgr) GetOrderMatchList(stub shim.ChaincodeStubInterface, orderSn string) ([]*MatchRecordJson, error)

func (*ExchangeMgr) Init

func (*ExchangeMgr) Invoke

func (*ExchangeMgr) Maker

func (p *ExchangeMgr) Maker(stub shim.ChaincodeStubInterface, wantAsset *modules.Asset, wantAmount decimal.Decimal) error

func (*ExchangeMgr) Payout

func (p *ExchangeMgr) Payout(stub shim.ChaincodeStubInterface, addr common.Address, amount decimal.Decimal, asset *modules.Asset) error

func (*ExchangeMgr) Taker

func (p *ExchangeMgr) Taker(stub shim.ChaincodeStubInterface, orderSn string) error

type ExchangeOrder

type ExchangeOrder struct {
	Address           common.Address
	SaleAsset         *modules.Asset
	SaleAmount        uint64 //挂单时卖多少金额
	CurrentSaleAmount uint64 //当前还有多少Amount在卖
	WantAsset         *modules.Asset
	WantAmount        uint64 //挂单时需要多少金额
	CurrentWantAmount uint64 //当前还需要多少Amount
	ExchangeSn        string
	Status            byte //1挂单中,2成交完毕,0撤销
}

type ExchangeOrderJson

type ExchangeOrderJson struct {
	Address           common.Address
	SaleAsset         string
	SaleAmount        decimal.Decimal
	CurrentSaleAmount decimal.Decimal
	DealSaleAmount    decimal.Decimal
	WantAsset         string
	WantAmount        decimal.Decimal
	DealWantAmount    decimal.Decimal
	CurrentWantAmount decimal.Decimal
	ExchangeSn        string
	Status            string
}

type MatchRecord

type MatchRecord struct {
	ExchangeOrderSn  string
	TakerReqId       string
	MakerMatchAmount uint64 //Maker成交了多少金额
	MakerMatchAsset  *modules.Asset
	MakerAddress     common.Address
	TakerMatchAmount uint64 //Taker成交了多少金额
	TakerMatchAsset  *modules.Asset
	TakerAddress     common.Address
}

订单成交记录

type MatchRecordJson

type MatchRecordJson struct {
	ExchangeOrderSn  string
	TakerReqId       string
	MakerMatchAmount decimal.Decimal //Maker成交了多少金额
	MakerMatchAsset  string
	MakerAddress     string
	TakerMatchAmount decimal.Decimal //Taker成交了多少金额
	TakerMatchAsset  string
	TakerAddress     string
}

Jump to

Keyboard shortcuts

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