# README

Parser

GoDoc

The Parser package provides support for parsing Rosetta blocks. This includes things like calculating all the balance changes that occurred in a block and grouping related operations.

Installation

go get github.com/HelloKashif/rosetta-sdk-go/parser

# Functions

Err takes an error as an argument and returns whether or not the error is one thrown by the parser along with the specific source of the error.
ExpectedOperation returns an error if an observed operation differs from the intended operation.
ExpectedSigners returns an error if a slice of SigningPayload has different signers than what was observed (typically populated using the signers returned from parsing a transaction).
GroupOperations parses all of a transaction's opertations and returns a slice of each group of related operations (assuming transitive relatedness).
MatchBalanceExemption returns a *types.BalanceExemption associated with the *types.AccountIdentifier, *types.Currency, and difference, if it exists.
MatchOperations attempts to match a slice of operations with a slice of OperationDescriptions (high-level descriptions of what operations are desired).
New creates a new Parser.

# Constants

AnyAmountSign is a positive or negative amount.
NegativeAmountSign is a negative amount.
PositiveAmountSign is a positive amount.

# Variables

Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Intent Errors.
Intent Errors.
Intent Errors.
Intent Errors.
Intent Errors.
Intent Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Match Operations Errors.
Intent Errors.
Match Operations Errors.

# Structs

AccountDescription is used to describe a *types.AccountIdentifier.
AmountDescription is used to describe a *types.Amount.
BalanceChange represents a balance change that affected a *types.AccountIdentifier and a *types.Currency.
Descriptions contains a slice of OperationDescriptions and high-level requirements enforced across multiple *types.Operations.
Match contains all *types.Operation matching a given OperationDescription and their parsed *big.Int amounts (if populated).
MetadataDescription is used to check if a map[string]interface{} has certain keys and values of a certain kind.
OperationDescription is used to describe a *types.Operation.
OperationGroup is a group of related operations If all operations in a group have the same operation.Type, the Type is also populated.
Parser provides support for parsing Rosetta blocks.

# Type aliases

AmountSign is used to represent possible signedness of an amount.
ExemptOperation is a function that returns a boolean indicating if the operation should be skipped eventhough it passes other checks indiciating it should be considered a balance change.