Documentation ¶
Index ¶
- func FindScale(asset string, v float64, s int) gold.Amount
- func OperateAmounts(amount gold.Amount, balance *a.Balance, operation string) (o.Balance, error)
- func Scale(v, s0, s1 int) float64
- func UndoScale(v float64, s int) int
- func UpdateAccounts(operation string, fromTo map[string]gold.Amount, accounts []*a.Account, ...)
- func ValidateAccounts(validate Responses, accounts []*a.Account) error
- func ValidateFromToOperation(ft gold.FromTo, validate Responses, acc *a.Account) (o.Amount, o.Balance, error)
- type Repository
- type Response
- type Responses
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OperateAmounts ¶ added in v1.15.0
OperateAmounts Function to sum or sub two amounts and normalize the scale
func UpdateAccounts ¶ added in v1.15.0
func UpdateAccounts(operation string, fromTo map[string]gold.Amount, accounts []*a.Account, result chan []*a.Account, e chan error)
UpdateAccounts function with some updates values in accounts and
func ValidateAccounts ¶ added in v1.15.0
ValidateAccounts function with some validates in accounts and DSL operations
Types ¶
type Repository ¶
type Repository interface { GetAccountsByIds(ctx context.Context, token string, organizationID, ledgerID uuid.UUID, ids []string) (*proto.AccountsResponse, error) GetAccountsByAlias(ctx context.Context, token string, organizationID, ledgerID uuid.UUID, aliases []string) (*proto.AccountsResponse, error) UpdateAccounts(ctx context.Context, token string, organizationID, ledgerID uuid.UUID, accounts []*proto.Account) (*proto.AccountsResponse, error) }
Repository provides an interface for gRPC operations related to account in the Ledger.
type Responses ¶ added in v1.15.0
type Responses struct { Total int From map[string]gold.Amount To map[string]gold.Amount Sources []string Destinations []string Aliases []string }
Responses return struct with total send and per-accounts
func ValidateSendSourceAndDistribute ¶ added in v1.15.0
func ValidateSendSourceAndDistribute(transaction gold.Transaction) (*Responses, error)
ValidateSendSourceAndDistribute Validate send and distribute totals
Click to show internal directories.
Click to hide internal directories.