Documentation
¶
Index ¶
- Constants
- Variables
- func CalculateMaxSafeWithdraw(balance *big.Int, overdraft *big.Int) *big.Int
- func CalculateSafeWithdraw(balance *big.Int, overdraft *big.Int, requestedAmount *big.Int) *big.Int
- func NewAccountAddress(src string) (AccountAddress, InterpreterError)
- func NewArgsParser(args []Value) *argsParser
- func RunProgram(ctx context.Context, program parser.Program, vars map[string]string, ...) (*ExecutionResult, InterpreterError)
- type AccountAddress
- type AccountBalance
- type AccountMetadata
- type AccountsMetadata
- type Asset
- type BadArityErr
- type BadPortionParsingErr
- type BalanceQuery
- type Balances
- type CannotCastToString
- type DivideByZero
- type ExecutionResult
- type ExperimentalFeature
- type InterpreterError
- type InvalidAccountName
- type InvalidAllotmentInSendAll
- type InvalidAllotmentSum
- type InvalidColor
- type InvalidMonetaryLiteral
- type InvalidNestedMeta
- type InvalidNumberLiteral
- type InvalidTypeErr
- type InvalidUnboundedInSendAll
- type Metadata
- type MetadataNotFound
- type MetadataQuery
- type MismatchedCurrencyError
- type MissingFundsErr
- type MissingVariableErr
- type Monetary
- type MonetaryInt
- type NegativeAmountErr
- type NegativeBalanceError
- type Portion
- type Posting
- type QueryBalanceError
- type QueryMetadataError
- type Sender
- type StaticStore
- type Store
- type String
- type TypeError
- type UnboundFunctionErr
- type UnboundVariableErr
- type Value
- type VariablesMap
Constants ¶
View Source
const KEPT_ADDR = "<kept>"
Variables ¶
View Source
var Regexp = regexp.MustCompile(accountPattern)
Functions ¶
func CalculateMaxSafeWithdraw ¶ added in v0.0.17
PRE: ovedraft != nil, balance != nil PRE: ovedraft >= 0 POST: $out >= 0
func CalculateSafeWithdraw ¶ added in v0.0.17
func CalculateSafeWithdraw( balance *big.Int, overdraft *big.Int, requestedAmount *big.Int, ) *big.Int
PRE: ovedraft != nil, balance != nil PRE: ovedraft >= 0 PRE: requestedAmount >= 0 POST: $out >= 0
func NewAccountAddress ¶ added in v0.0.12
func NewAccountAddress(src string) (AccountAddress, InterpreterError)
func NewArgsParser ¶
func NewArgsParser(args []Value) *argsParser
func RunProgram ¶
func RunProgram( ctx context.Context, program parser.Program, vars map[string]string, store Store, featureFlags map[string]struct{}, ) (*ExecutionResult, InterpreterError)
Types ¶
type AccountAddress ¶
type AccountAddress string
func (AccountAddress) String ¶
func (v AccountAddress) String() string
type AccountBalance ¶
type AccountMetadata ¶
type AccountsMetadata ¶
type AccountsMetadata map[string]AccountMetadata
type BadArityErr ¶
func (BadArityErr) Error ¶
func (e BadArityErr) Error() string
type BadPortionParsingErr ¶ added in v0.0.10
func (BadPortionParsingErr) Error ¶ added in v0.0.10
func (e BadPortionParsingErr) Error() string
type BalanceQuery ¶
For each account, list of the needed assets
type Balances ¶
type Balances map[string]AccountBalance
type CannotCastToString ¶ added in v0.0.12
func (CannotCastToString) Error ¶ added in v0.0.12
func (e CannotCastToString) Error() string
type DivideByZero ¶ added in v0.0.11
func (DivideByZero) Error ¶ added in v0.0.11
func (e DivideByZero) Error() string
type ExecutionResult ¶
type ExecutionResult struct { Postings []Posting `json:"postings"` Metadata Metadata `json:"txMeta"` AccountsMetadata AccountsMetadata `json:"accountsMeta"` }
type ExperimentalFeature ¶ added in v0.0.10
func (ExperimentalFeature) Error ¶ added in v0.0.10
func (e ExperimentalFeature) Error() string
type InterpreterError ¶
func ParsePortionSpecific ¶ added in v0.0.10
func ParsePortionSpecific(input string) (*big.Rat, InterpreterError)
type InvalidAccountName ¶ added in v0.0.12
func (InvalidAccountName) Error ¶ added in v0.0.12
func (e InvalidAccountName) Error() string
type InvalidAllotmentInSendAll ¶
func (InvalidAllotmentInSendAll) Error ¶
func (e InvalidAllotmentInSendAll) Error() string
type InvalidAllotmentSum ¶
func (InvalidAllotmentSum) Error ¶
func (e InvalidAllotmentSum) Error() string
type InvalidColor ¶ added in v0.0.17
func (InvalidColor) Error ¶ added in v0.0.17
func (e InvalidColor) Error() string
type InvalidMonetaryLiteral ¶
func (InvalidMonetaryLiteral) Error ¶
func (e InvalidMonetaryLiteral) Error() string
type InvalidNestedMeta ¶ added in v0.0.15
func (InvalidNestedMeta) Error ¶ added in v0.0.15
func (InvalidNestedMeta) Error() string
type InvalidNumberLiteral ¶
func (InvalidNumberLiteral) Error ¶
func (e InvalidNumberLiteral) Error() string
type InvalidTypeErr ¶
func (InvalidTypeErr) Error ¶
func (e InvalidTypeErr) Error() string
type InvalidUnboundedInSendAll ¶
func (InvalidUnboundedInSendAll) Error ¶
func (e InvalidUnboundedInSendAll) Error() string
type MetadataNotFound ¶
func (MetadataNotFound) Error ¶
func (e MetadataNotFound) Error() string
type MetadataQuery ¶
For each account, list of the needed keys
type MismatchedCurrencyError ¶
func (MismatchedCurrencyError) Error ¶
func (e MismatchedCurrencyError) Error() string
type MissingFundsErr ¶
func (MissingFundsErr) Error ¶
func (e MissingFundsErr) Error() string
type MissingVariableErr ¶
func (MissingVariableErr) Error ¶
func (e MissingVariableErr) Error() string
type Monetary ¶
type Monetary struct { Amount MonetaryInt Asset Asset }
func NewMonetary ¶ added in v0.0.15
func (Monetary) MarshalJSON ¶
type MonetaryInt ¶
func NewMonetaryInt ¶
func NewMonetaryInt(n int64) MonetaryInt
func (MonetaryInt) Add ¶ added in v0.0.10
func (m MonetaryInt) Add(other MonetaryInt) MonetaryInt
func (MonetaryInt) MarshalJSON ¶
func (v MonetaryInt) MarshalJSON() ([]byte, error)
func (MonetaryInt) String ¶
func (v MonetaryInt) String() string
func (MonetaryInt) Sub ¶ added in v0.0.10
func (m MonetaryInt) Sub(other MonetaryInt) MonetaryInt
type NegativeAmountErr ¶
type NegativeAmountErr struct { parser.Range Amount MonetaryInt }
func (NegativeAmountErr) Error ¶
func (e NegativeAmountErr) Error() string
type NegativeBalanceError ¶
func (NegativeBalanceError) Error ¶
func (e NegativeBalanceError) Error() string
type Portion ¶
func (Portion) MarshalJSON ¶
type QueryBalanceError ¶
func (QueryBalanceError) Error ¶
func (e QueryBalanceError) Error() string
type QueryMetadataError ¶
func (QueryMetadataError) Error ¶
func (e QueryMetadataError) Error() string
type StaticStore ¶
type StaticStore struct { Balances Balances Meta AccountsMetadata }
func (StaticStore) GetAccountsMetadata ¶
func (s StaticStore) GetAccountsMetadata(context.Context, MetadataQuery) (AccountsMetadata, error)
func (StaticStore) GetBalances ¶
func (s StaticStore) GetBalances(_ context.Context, q BalanceQuery) (Balances, error)
type Store ¶
type Store interface { GetBalances(context.Context, BalanceQuery) (Balances, error) GetAccountsMetadata(context.Context, MetadataQuery) (AccountsMetadata, error) }
type UnboundFunctionErr ¶
func (UnboundFunctionErr) Error ¶
func (e UnboundFunctionErr) Error() string
type UnboundVariableErr ¶
func (UnboundVariableErr) Error ¶
func (e UnboundVariableErr) Error() string
type VariablesMap ¶
Click to show internal directories.
Click to hide internal directories.