Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
SWCqueueABI = ethereum.MustParseABI("SWCqueue", contracts.SWCqueueABI)
)
SWCqueue globals
Functions ¶
func LogSWCqueueDirectPledge ¶
LogSWCqueueDirectPledge returns event
Types ¶
type EventDirectPledge ¶
EventDirectPledge represents LogSWCqueueDirectPledge event payload
type LogPledger ¶
LogPledger is an interface for an object which is able to construct new pledges from a Log
func NewLogTransferPledger ¶
func NewLogTransferPledger(brgs map[common.Address]liquidity.Currency) LogPledger
NewLogTransferPledger constructs new Pledge from a Transfer event. It uses mapping for various BRG* flavours handling different currencies
type Pledge ¶
type Pledge struct { Tx string `sql:"pledge_queue_id,pk"` // ID is a Tx hash WalletAddr ethereum.PgtAddress `sql:"wallet_addr"` CtrAddr ethereum.PgtAddress `sql:"ctr_addr,notnull"` Wad pgt.BigInt `sql:",notnull"` CreatedAt time.Time `sql:"created_at"` Currency liquidity.Currency `sql:",notnull"` Direct bool `sql:",notnull"` // contains filtered or unexported fields }
Pledge represents pledge_queue entry
type Pledger ¶
type Pledger struct { BRG *contracts.BridgeToken SWCQ *contracts.SWCqueue SWCQaddr common.Address // contains filtered or unexported fields }
Pledger provides functionality for creating pledges
func NewPledger ¶
func NewPledger(cf ethereum.ContractFactory) (Pledger, errstack.E)
NewPledger constructs Pledger
func (Pledger) Post ¶
func (plr Pledger) Post(dst common.Address, wei *big.Int, curr liquidity.Currency) ( *types.Transaction, *types.Transaction, error)
Post mints new BRG for the SWCqueue and posts the pledge request to the blockchain It reteurns transaction objects for Mint and for DirectPledge respectively.
type Token ¶
type Token struct { ID string `sql:"token_id,pk" json:"id"` // token name CreatedAt time.Time `sql:"created_at,notnull" json:"createdAt"` Comment string `sql:"comment,notnull" json:"comment"` MaxTotalContrib pgt.BigInt `sql:"max_total_contrib" json:"maxTotalContrib"` // in wad, 0 = no limit }
Token represents tokens DB table entry
type Tranche ¶
Tranche represents tranche model
func GetTranche ¶
GetTranche returns tranche from DB
func GetTranches ¶
GetTranches returns Tranches combined with prices from DB. TODO: in the future we need to return only active tranches.
type TrancheDB ¶
type TrancheDB struct { ID int64 `sql:"tranche_id,pk" json:"id"` TokenID string `sql:",notnull" json:"tokenID"` CreatedAt time.Time `sql:"created_at,notnull" json:"createdAt"` StartsAt time.Time `sql:"starts_at,notnull" json:"startsAt"` ExecutesAt time.Time `sql:"executes_at,notnull" json:"executesAt"` EndsAt *time.Time `sql:"ends_at" json:"endsAt"` Supply pgt.BigInt `sql:"supply,notnull" json:"supply"` // in wad MaxContrib pgt.BigInt `sql:"max_contrib,notnull" json:"maxContrib"` // in wad, 0=no limit // contains filtered or unexported fields }
TrancheDB represents tranches DB table entry