Documentation
¶
Index ¶
- Constants
- func AssetIsValid(v string) bool
- func CheckHash(logs ...Log) (int, bool)
- func Hash(t1, t2 interface{}) string
- func HydrateLog(_type string, data string) (interface{}, error)
- func RevertMetadataSpecKey() string
- func RevertedMetadataSpecKey() string
- func SpecMetadata(name string) string
- func ValidateAddress(addr string) bool
- type Account
- type AccountWithVolumes
- type AccountsAssetsVolumes
- func (a AccountsAssetsVolumes) AddInput(account, asset string, input int64)
- func (a AccountsAssetsVolumes) AddOutput(account, asset string, output int64)
- func (a AccountsAssetsVolumes) GetVolumes(account, asset string) Volumes
- func (a AccountsAssetsVolumes) HasAccount(account string) bool
- func (a *AccountsAssetsVolumes) Scan(value interface{}) error
- func (a AccountsAssetsVolumes) SetVolumes(account, asset string, volumes Volumes)
- type AccountsBalances
- type AssetsBalances
- type AssetsVolumes
- type ConstantExpr
- type Contract
- type EvalContext
- type Expr
- type ExprAnd
- type ExprEq
- type ExprGt
- type ExprGte
- type ExprLt
- type ExprLte
- type ExprOr
- type Log
- type LoggedTX
- type Mapping
- type MetaExpr
- type Metadata
- type Posting
- type Postings
- type RevertedMetadataSpecValue
- type Script
- type SetMetadata
- type Transaction
- type TransactionData
- type Transactions
- type Value
- type VariableExpr
- type Volumes
- type VolumesWithBalance
Constants ¶
View Source
const ( MetaTargetTypeAccount = "ACCOUNT" MetaTargetTypeTransaction = "TRANSACTION" )
View Source
const NewTransactionType = "NEW_TRANSACTION"
View Source
const SetMetadataType = "SET_METADATA"
View Source
const (
WORLD = "world"
)
Variables ¶
This section is empty.
Functions ¶
func AssetIsValid ¶
func HydrateLog ¶ added in v1.3.2
func RevertMetadataSpecKey ¶ added in v1.3.2
func RevertMetadataSpecKey() string
func RevertedMetadataSpecKey ¶ added in v1.3.2
func RevertedMetadataSpecKey() string
func SpecMetadata ¶ added in v1.3.2
func ValidateAddress ¶
Types ¶
type AccountWithVolumes ¶ added in v1.6.0
type AccountWithVolumes struct {
Account
Volumes AssetsVolumes `json:"volumes"`
Balances AssetsBalances `json:"balances" example:"COIN:100"`
}
type AccountsAssetsVolumes ¶ added in v1.6.0
type AccountsAssetsVolumes map[string]AssetsVolumes
func (AccountsAssetsVolumes) AddInput ¶ added in v1.7.0
func (a AccountsAssetsVolumes) AddInput(account, asset string, input int64)
func (AccountsAssetsVolumes) AddOutput ¶ added in v1.7.0
func (a AccountsAssetsVolumes) AddOutput(account, asset string, output int64)
func (AccountsAssetsVolumes) GetVolumes ¶ added in v1.7.0
func (a AccountsAssetsVolumes) GetVolumes(account, asset string) Volumes
func (AccountsAssetsVolumes) HasAccount ¶ added in v1.7.0
func (a AccountsAssetsVolumes) HasAccount(account string) bool
func (*AccountsAssetsVolumes) Scan ¶ added in v1.6.0
func (a *AccountsAssetsVolumes) Scan(value interface{}) error
Scan - Implement the database/sql scanner interface
func (AccountsAssetsVolumes) SetVolumes ¶ added in v1.7.0
func (a AccountsAssetsVolumes) SetVolumes(account, asset string, volumes Volumes)
type AccountsBalances ¶ added in v1.6.0
type AccountsBalances map[string]AssetsBalances
type AssetsBalances ¶ added in v1.6.0
type AssetsVolumes ¶ added in v1.6.0
func (AssetsVolumes) Balances ¶ added in v1.6.0
func (v AssetsVolumes) Balances() AssetsBalances
type ConstantExpr ¶
type ConstantExpr struct {
Value interface{}
}
func (ConstantExpr) MarshalJSON ¶
func (e ConstantExpr) MarshalJSON() ([]byte, error)
type Contract ¶
func (*Contract) UnmarshalJSON ¶
type EvalContext ¶
type ExprAnd ¶
type ExprAnd []Expr
func (ExprAnd) Eval ¶
func (o ExprAnd) Eval(ctx EvalContext) bool
func (ExprAnd) MarshalJSON ¶
type ExprEq ¶
func (*ExprEq) Eval ¶
func (o *ExprEq) Eval(ctx EvalContext) bool
func (ExprEq) MarshalJSON ¶
type ExprGt ¶
func (*ExprGt) Eval ¶
func (o *ExprGt) Eval(ctx EvalContext) bool
func (ExprGt) MarshalJSON ¶
type ExprGte ¶
func (*ExprGte) Eval ¶
func (o *ExprGte) Eval(ctx EvalContext) bool
func (ExprGte) MarshalJSON ¶
type ExprLt ¶
func (*ExprLt) Eval ¶
func (o *ExprLt) Eval(ctx EvalContext) bool
func (ExprLt) MarshalJSON ¶
type ExprLte ¶
func (*ExprLte) Eval ¶
func (o *ExprLte) Eval(ctx EvalContext) bool
func (ExprLte) MarshalJSON ¶
type ExprOr ¶
type ExprOr []Expr
func (ExprOr) Eval ¶
func (o ExprOr) Eval(ctx EvalContext) bool
func (ExprOr) MarshalJSON ¶
type Log ¶ added in v1.3.2
type Log struct {
ID uint64 `json:"id"`
Type string `json:"type"`
Data interface{} `json:"data"`
Hash string `json:"hash"`
Date time.Time `json:"date"`
}
func NewSetMetadataLog ¶ added in v1.3.2
func NewSetMetadataLog(previousLog *Log, metadata SetMetadata) Log
func NewTransactionLog ¶ added in v1.3.2
func NewTransactionLog(previousLog *Log, tx Transaction) Log
func NewTransactionLogWithDate ¶ added in v1.3.2
func NewTransactionLogWithDate(previousLog *Log, tx Transaction, time time.Time) Log
type LoggedTX ¶ added in v1.6.0
type LoggedTX Transaction
func (LoggedTX) MarshalJSON ¶ added in v1.6.0
type Metadata ¶
type Metadata map[string]json.RawMessage
func ComputeMetadata ¶ added in v1.3.2
func RevertMetadata ¶ added in v1.3.2
func RevertedMetadata ¶ added in v1.3.2
func (Metadata) ConvertValue ¶ added in v1.3.2
func (Metadata) IsEquivalentTo ¶ added in v1.6.0
IsEquivalentTo allow to compare to metadata object.
Postgres and SQLite doesn't have the same behavior regarding json processing Postgres will clean the json and keep a space after semicolons. Sqlite will clean the json and minify it. So we can't directly compare metadata.
func (Metadata) IsReverted ¶
func (Metadata) MarkReverts ¶ added in v1.1.0
type RevertedMetadataSpecValue ¶ added in v1.3.2
type RevertedMetadataSpecValue struct {
By string `json:"by"`
}
type SetMetadata ¶ added in v1.3.2
type SetMetadata struct {
TargetType string `json:"targetType"`
TargetID interface{} `json:"targetId"`
Metadata Metadata `json:"metadata"`
}
func (*SetMetadata) UnmarshalJSON ¶ added in v1.3.2
func (s *SetMetadata) UnmarshalJSON(data []byte) error
type Transaction ¶
type Transaction struct {
TransactionData
ID uint64 `json:"txid"`
PreCommitVolumes AccountsAssetsVolumes `json:"preCommitVolumes,omitempty"` // Keep omitempty to keep consistent hash
PostCommitVolumes AccountsAssetsVolumes `json:"postCommitVolumes,omitempty"` // Keep omitempty to keep consistent hash
}
func (*Transaction) AppendPosting ¶
func (t *Transaction) AppendPosting(p Posting)
func (*Transaction) IsReverted ¶ added in v1.6.0
func (t *Transaction) IsReverted() bool
func (Transaction) MarshalJSON ¶ added in v1.7.0
func (t Transaction) MarshalJSON() ([]byte, error)
type TransactionData ¶
type TransactionData struct {
Postings Postings `json:"postings"`
Reference string `json:"reference"`
Metadata Metadata `json:"metadata" swaggertype:"object"`
Timestamp time.Time `json:"timestamp"`
}
func (*TransactionData) Reverse ¶ added in v1.3.2
func (t *TransactionData) Reverse() TransactionData
type Transactions ¶
type Transactions struct {
Transactions []TransactionData `json:"transactions" binding:"required,dive"`
}
type VariableExpr ¶
type VariableExpr struct {
Name string
}
func (VariableExpr) MarshalJSON ¶
func (e VariableExpr) MarshalJSON() ([]byte, error)
type Volumes ¶ added in v1.3.2
func (Volumes) MarshalJSON ¶ added in v1.6.0
type VolumesWithBalance ¶ added in v1.6.0
Click to show internal directories.
Click to hide internal directories.