Documentation
¶
Index ¶
- Variables
- type Asset
- type AssetService
- type CosiSignature
- func (s *CosiSignature) Bytes() []byte
- func (s *CosiSignature) FromBytes(bts []byte) error
- func (s *CosiSignature) MarshalBinary() (data []byte, err error)
- func (s *CosiSignature) MarshalJSON() ([]byte, error)
- func (s *CosiSignature) Scan(value interface{}) error
- func (s *CosiSignature) String() string
- func (s *CosiSignature) UnmarshalBinary(data []byte) error
- func (s *CosiSignature) UnmarshalJSON(b []byte) error
- func (s *CosiSignature) Value() (driver.Value, error)
- type En256CosiSignature
- func (s *En256CosiSignature) Bytes() []byte
- func (s *En256CosiSignature) FromBytes(bts []byte) error
- func (s *En256CosiSignature) MarshalBinary() (data []byte, err error)
- func (s *En256CosiSignature) MarshalJSON() ([]byte, error)
- func (s *En256CosiSignature) Scan(value interface{}) error
- func (s *En256CosiSignature) String() string
- func (s *En256CosiSignature) UnmarshalBinary(data []byte) error
- func (s *En256CosiSignature) UnmarshalJSON(b []byte) error
- func (s *En256CosiSignature) Value() (driver.Value, error)
- type Exchange
- type PriceData
- type PriceRequest
- type Proposal
- type ProposalRequest
- type ProposalResp
- type Receiver
- type Signer
- type Subscriber
- type SubscriberStore
- type System
- type Transfer
- type WalletService
- type WalletStore
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAssetNotExist = errors.New("asset not exist")
)
View Source
var (
ErrInvalidTrace = errors.New("invalid trace")
)
Functions ¶
This section is empty.
Types ¶
type AssetService ¶
type CosiSignature ¶ added in v0.0.2
func (*CosiSignature) Bytes ¶ added in v0.0.2
func (s *CosiSignature) Bytes() []byte
func (*CosiSignature) FromBytes ¶ added in v0.0.2
func (s *CosiSignature) FromBytes(bts []byte) error
func (*CosiSignature) MarshalBinary ¶ added in v0.0.2
func (s *CosiSignature) MarshalBinary() (data []byte, err error)
func (*CosiSignature) MarshalJSON ¶ added in v0.0.2
func (s *CosiSignature) MarshalJSON() ([]byte, error)
func (*CosiSignature) Scan ¶ added in v0.0.4
func (s *CosiSignature) Scan(value interface{}) error
Scan implements the sql.Scanner interface for database deserialization.
func (*CosiSignature) String ¶ added in v0.0.2
func (s *CosiSignature) String() string
func (*CosiSignature) UnmarshalBinary ¶ added in v0.0.2
func (s *CosiSignature) UnmarshalBinary(data []byte) error
func (*CosiSignature) UnmarshalJSON ¶ added in v0.0.2
func (s *CosiSignature) UnmarshalJSON(b []byte) error
type En256CosiSignature ¶ added in v1.1.2
func (*En256CosiSignature) Bytes ¶ added in v1.1.2
func (s *En256CosiSignature) Bytes() []byte
func (*En256CosiSignature) FromBytes ¶ added in v1.1.2
func (s *En256CosiSignature) FromBytes(bts []byte) error
func (*En256CosiSignature) MarshalBinary ¶ added in v1.1.2
func (s *En256CosiSignature) MarshalBinary() (data []byte, err error)
func (*En256CosiSignature) MarshalJSON ¶ added in v1.1.2
func (s *En256CosiSignature) MarshalJSON() ([]byte, error)
func (*En256CosiSignature) Scan ¶ added in v1.1.2
func (s *En256CosiSignature) Scan(value interface{}) error
Scan implements the sql.Scanner interface for database deserialization.
func (*En256CosiSignature) String ¶ added in v1.1.2
func (s *En256CosiSignature) String() string
func (*En256CosiSignature) UnmarshalBinary ¶ added in v1.1.2
func (s *En256CosiSignature) UnmarshalBinary(data []byte) error
func (*En256CosiSignature) UnmarshalJSON ¶ added in v1.1.2
func (s *En256CosiSignature) UnmarshalJSON(b []byte) error
type PriceData ¶
type PriceData struct {
Timestamp int64 `json:"t,omitempty"`
AssetID string `json:"a,omitempty"`
Price decimal.Decimal `json:"p,omitempty"`
Signature *CosiSignature `json:"s,omitempty"`
En256Signature *En256CosiSignature `json:"es,omitempty"`
}
func (*PriceData) MarshalBinary ¶ added in v0.0.5
func (*PriceData) UnmarshalBinary ¶ added in v0.0.5
type PriceRequest ¶ added in v0.0.6
type Proposal ¶ added in v0.0.6
type Proposal struct {
PriceRequest
ProposalRequest `json:"-"`
Signatures map[uint64]*blst.Signature `json:"sigs,omitempty"`
En256Signatures map[uint64]*en256.Signature `json:"en256_sigs,omitempty"`
}
type ProposalRequest ¶ added in v0.0.6
type ProposalRequest struct {
Asset
TraceID string `json:"trace_id,omitempty"`
Timestamp int64 `json:"timestamp,omitempty"`
Price decimal.Decimal `json:"price,omitempty"`
Signers []*Signer `json:"signers,omitempty"`
Signature *ProposalResp `json:"signature,omitempty"`
}
func (ProposalRequest) Payload ¶ added in v0.0.6
func (p ProposalRequest) Payload() []byte
func (ProposalRequest) PayloadV1 ¶ added in v1.1.7
func (p ProposalRequest) PayloadV1() ([]byte, error)
func (ProposalRequest) Verify ¶ added in v0.0.6
func (p ProposalRequest) Verify(resp *ProposalResp) bool
type ProposalResp ¶ added in v0.0.6
type Subscriber ¶ added in v0.0.5
type Subscriber struct {
ID uint `sql:"PRIMARY_KEY" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `sql:"index" json:"deleted_at"`
Name string `sql:"SIZE:255;" json:"name,omitempty"`
RequestURL string `sql:"SIZE:255;" json:"request_url,omitempty"`
}
type SubscriberStore ¶ added in v0.0.5
type SubscriberStore interface {
Save(ctx context.Context, f *Subscriber) error
All(ctx context.Context) ([]*Subscriber, error)
}
type System ¶
type System struct {
ConversationID string
GasAsset string
GasAmount decimal.Decimal
SignKey *blst.PrivateKey
VerifyKey *blst.PublicKey
En256SignKey *en256.PrivateKey
En256VerifyKey *en256.PublicKey
}
System stores system information.
func (*System) SignProposal ¶
func (s *System) SignProposal(p *ProposalRequest, signer *Signer) (*ProposalResp, error)
func (*System) VerifyData ¶
func (s *System) VerifyData(req *PriceRequest, p *PriceData) bool
type Transfer ¶
type Transfer struct {
ID int64 `sql:"PRIMARY_KEY" json:"id,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
TraceID string `sql:"type:char(36)" json:"trace_id,omitempty"`
AssetID string `sql:"type:char(36)" json:"asset_id,omitempty"`
Amount decimal.Decimal `sql:"type:decimal(64,8)" json:"amount,omitempty"`
Memo string `sql:"size:200" json:"memo,omitempty"`
Threshold uint8 `json:"threshold,omitempty"`
Opponents pq.StringArray `sql:"type:varchar(1024)" json:"opponents,omitempty"`
}
type WalletService ¶ added in v0.0.2
Click to show internal directories.
Click to hide internal directories.