Versions in this module Expand all Collapse all v0 v0.7.0 Nov 27, 2020 Changes in this version + const MaxUnixEpoch + const MinUnixEpoch + var AccountBalanceErrs = []error + var BlockErrs = []error + var CoinErrs = []error + var ConstructionErrs = []error + var ErrAccountAddrMissing = errors.New("Account.Address is missing") + var ErrAccountBalanceRequestHistoricalBalanceLookupNotSupported = errors.New("historical balance lookup is not supported") + var ErrAccountBalanceRequestIsNil = errors.New("AccountBalanceRequest is nil") + var ErrAccountCoinsRequestIsNil = errors.New("AccountCoinsRequest is nil") + var ErrAccountIsNil = errors.New("Account is nil") + var ErrAccountSubAccountAddrMissing = errors.New("Account.SubAccount.Address is missing") + var ErrAllowIsNil = errors.New("Allow is nil") + var ErrAmountCurrencyHasNegDecimals = errors.New("Amount.Currency.Decimals must be >= 0") + var ErrAmountCurrencyIsNil = errors.New("Amount.Currency is nil") + var ErrAmountCurrencySymbolEmpty = errors.New("Amount.Currency.Symbol is empty") + var ErrAmountIsNotInt = errors.New("Amount.Value is not an integer") + var ErrAmountValueMissing = errors.New("Amount.Value is missing") + var ErrAsserterNotInitialized = errors.New("asserter not initialized") + var ErrBalanceExemptionIsNil = errors.New("BalanceExemption is nil") + var ErrBalanceExemptionMissingSubject = errors.New("BalanceExemption missing subject") + var ErrBalanceExemptionNoHistoricalLookup = errors.New("BalanceExemptions only supported when HistoricalBalanceLookup supported") + var ErrBalanceExemptionSubAccountAddressEmpty = errors.New("BalanceExemption.SubAccountAddress is empty") + var ErrBalanceExemptionTypeInvalid = errors.New("BalanceExemption.Type is invalid") + var ErrBlockEventTypeInvalid = errors.New("block event type invalid") + var ErrBlockHashEqualsParentBlockHash = errors.New("BlockIdentifier.Hash == ParentBlockIdentifier.Hash") + var ErrBlockIdentifierHashMissing = errors.New("BlockIdentifier.Hash is missing") + var ErrBlockIdentifierIndexIsNeg = errors.New("BlockIdentifier.Index is negative") + var ErrBlockIdentifierIsNil = errors.New("BlockIdentifier is nil") + var ErrBlockIndexPrecedesParentBlockIndex = errors.New("BlockIdentifier.Index <= ParentBlockIdentifier.Index") + var ErrBlockIsNil = errors.New("Block is nil") + var ErrBlockRequestIsNil = errors.New("BlockRequest is nil") + var ErrBlockTransactionRequestIsNil = errors.New("BlockTransactionRequest is nil") + var ErrCallMethodDuplicate = errors.New("duplicate call method detected") + var ErrCallMethodEmpty = errors.New("call method cannot be empty") + var ErrCallMethodUnsupported = errors.New("call method is not supported") + var ErrCallRequestIsNil = errors.New("CallRequest is nil") + var ErrCoinActionInvalid = errors.New("not a valid coin action") + var ErrCoinChangeIsNil = errors.New("coin change cannot be nil") + var ErrCoinDuplicate = errors.New("duplicate coin identifier detected") + var ErrCoinIdentifierIsNil = errors.New("coin identifier cannot be nil") + var ErrCoinIdentifierNotSet = errors.New("coin identifier cannot be empty") + var ErrCoinIsNil = errors.New("coin cannot be nil") + var ErrConstructionCombineRequestIsNil = errors.New("ConstructionCombineRequest is nil") + var ErrConstructionCombineRequestUnsignedTxEmpty = errors.New("UnsignedTransaction cannot be empty") + var ErrConstructionCombineResponseIsNil = errors.New("construction combine response cannot be nil") + var ErrConstructionDeriveRequestIsNil = errors.New("ConstructionDeriveRequest is nil") + var ErrConstructionDeriveResponseAddrEmpty = errors.New("address cannot be empty") + var ErrConstructionDeriveResponseIsNil = errors.New("construction derive response cannot be nil") + var ErrConstructionHashRequestIsNil = errors.New("ConstructionHashRequest is nil") + var ErrConstructionHashRequestSignedTxEmpty = errors.New("SignedTransaction cannot be empty") + var ErrConstructionMetadataRequestIsNil = errors.New("ConstructionMetadataRequest is nil") + var ErrConstructionMetadataResponseIsNil = errors.New("ConstructionMetadataResponse cannot be nil") + var ErrConstructionMetadataResponseMetadataMissing = errors.New("Metadata is nil") + var ErrConstructionParseRequestEmpty = errors.New("Transaction cannot be empty") + var ErrConstructionParseRequestIsNil = errors.New("ConstructionParseRequest is nil") + var ErrConstructionParseResponseDuplicateSigner = errors.New("found duplicate signer") + var ErrConstructionParseResponseIsNil = errors.New("construction parse response cannot be nil") + var ErrConstructionParseResponseOperationsEmpty = errors.New("operations cannot be empty") + var ErrConstructionParseResponseSignerEmpty = errors.New("signer cannot be empty string") + var ErrConstructionParseResponseSignersEmptyOnSignedTx = errors.New("signers cannot be empty on signed transaction") + var ErrConstructionParseResponseSignersNonEmptyOnUnsignedTx = errors.New("signers should be empty for unsigned txs") + var ErrConstructionPayloadsRequestIsNil = errors.New("ConstructionPayloadsRequest is nil") + var ErrConstructionPayloadsResponseIsNil = errors.New("construction payloads response cannot be nil") + var ErrConstructionPayloadsResponsePayloadsEmpty = errors.New("signing payloads cannot be empty") + var ErrConstructionPayloadsResponseUnsignedTxEmpty = errors.New("unsigned transaction cannot be empty") + var ErrConstructionPreprocessRequestIsNil = errors.New("ConstructionPreprocessRequest is nil") + var ErrConstructionPreprocessRequestSuggestedFeeMultiplierIsNeg = errors.New("suggested fee multiplier cannot be less than 0") + var ErrConstructionPreprocessResponseIsNil = errors.New("ConstructionPreprocessResponse cannot be nil") + var ErrConstructionSubmitRequestIsNil = errors.New("ConstructionSubmitRequest is nil") + var ErrConstructionSubmitRequestSignedTxEmpty = errors.New("ConstructionSubmitRequest.SignedTransaction is empty") + var ErrCurveTypeNotSupported = errors.New("not a supported CurveType") + var ErrDuplicateCurrency = errors.New("duplicate currency") + var ErrErrorCodeIsNeg = errors.New("Error.Code is negative") + var ErrErrorCodeUsedMultipleTimes = errors.New("error code used multiple times") + var ErrErrorDescriptionEmpty = errors.New("Error.Description is provided but is empty") + var ErrErrorDetailsPopulated = errors.New("error details populated in /network/options") + var ErrErrorIsNil = errors.New("Error is nil") + var ErrErrorMessageMismatch = errors.New("Error.Message does not match message from /network/options") + var ErrErrorMessageMissing = errors.New("Error.Message is missing") + var ErrErrorRetriableMismatch = errors.New("Error.Retriable mismatch") + var ErrErrorUnexpectedCode = errors.New("Error.Code unexpected") + var ErrEventsBlocksRequestIsNil = errors.New("EventsBlocksRequest is nil") + var ErrLimitIsNegative = errors.New("limit is negative") + var ErrMaxBlockInvalid = errors.New("max block invalid") + var ErrMaxSequenceInvalid = errors.New("max sequence invalid") + var ErrMempoolCoinsNotSupported = errors.New("mempool coins not supported") + var ErrMempoolTransactionRequestIsNil = errors.New("MempoolTransactionRequest is nil") + var ErrMetadataRequestIsNil = errors.New("MetadataRequest is nil") + var ErrNetworkIdentifierBlockchainMissing = errors.New("NetworkIdentifier.Blockchain is missing") + var ErrNetworkIdentifierIsNil = errors.New("NetworkIdentifier is nil") + var ErrNetworkIdentifierNetworkMissing = errors.New("NetworkIdentifier.Network is missing") + var ErrNetworkListResponseIsNil = errors.New("NetworkListResponse is nil") + var ErrNetworkListResponseNetworksContainsDuplicates = errors.New("NetworkListResponse.Networks contains duplicates") + var ErrNetworkOptionsResponseIsNil = errors.New("options is nil") + var ErrNetworkRequestIsNil = errors.New("NetworkRequest is nil") + var ErrNetworkStatusResponseIsNil = errors.New("network status response is nil") + var ErrNextOffsetInvalid = errors.New("next offset invalid") + var ErrNoAllowedOperationStatuses = errors.New("no Allow.OperationStatuses found") + var ErrNoOperationsForConstruction = errors.New("operations cannot be empty for construction") + var ErrNoSuccessfulAllowedOperationStatuses = errors.New("no successful Allow.OperationStatuses found") + var ErrNoSupportedNetworks = errors.New("no supported networks") + var ErrOffsetIsNegative = errors.New("offset is negative") + var ErrOperationIdentifierIndexIsNil = errors.New("Operation.OperationIdentifier.Index is invalid") + var ErrOperationIdentifierIndexOutOfOrder = errors.New("Operation.OperationIdentifier.Index is out of order") + var ErrOperationIdentifierNetworkIndexInvalid = errors.New("Operation.OperationIdentifier.NetworkIndex is invalid") + var ErrOperationIsNil = errors.New("Operation is nil") + var ErrOperationStatusInvalid = errors.New("Operation.Status is invalid") + var ErrOperationStatusMissing = errors.New("Operation.Status is missing") + var ErrOperationStatusNotEmptyForConstruction = errors.New("Operation.Status must be empty for construction") + var ErrOperationTypeInvalid = errors.New("Operation.Type is invalid") + var ErrOperatorInvalid = errors.New("operator is invalid") + var ErrPartialBlockIdentifierFieldsNotSet = errors.New("neither PartialBlockIdentifier.Hash nor PartialBlockIdentifier.Index is set") + var ErrPartialBlockIdentifierIsNil = errors.New("PartialBlockIdentifier is nil") + var ErrPeerIDMissing = errors.New("Peer.PeerID is missing") + var ErrPublicKeyBytesEmpty = errors.New("public key bytes cannot be empty") + var ErrPublicKeyBytesZero = errors.New("public key bytes 0") + var ErrPublicKeyIsNil = errors.New("PublicKey cannot be nil") + var ErrRelatedOperationIndexDuplicate = errors.New("found duplicate related operation index") + var ErrRelatedOperationIndexOutOfOrder = errors.New("related operation has index greater than operation") + var ErrRequestedNetworkNotSupported = errors.New("requestNetwork not supported") + var ErrReturnedBlockHashMismatch = errors.New("request block hash does not match response block hash") + var ErrReturnedBlockIndexMismatch = errors.New("request block index does not match response block index") + var ErrSearchTransactionsRequestIsNil = errors.New("SearchTransactionsRequest is nil") + var ErrSequenceInvalid = errors.New("sequence invalid") + var ErrSequenceOutOfOrder = errors.New("sequence out of order") + var ErrSignatureBytesEmpty = errors.New("signature bytes cannot be empty") + var ErrSignatureBytesZero = errors.New("signature bytes cannot be 0") + var ErrSignatureTypeNotSupported = errors.New("not a supported SignatureType") + var ErrSignaturesEmpty = errors.New("signatures cannot be empty") + var ErrSignaturesReturnedSigMismatch = errors.New("requested signature type does not match returned signature type") + var ErrSignedTxEmpty = errors.New("signed transaction cannot be empty") + var ErrSigningPayloadAddrEmpty = errors.New("signing payload address cannot be empty") + var ErrSigningPayloadBytesEmpty = errors.New("signing payload bytes cannot be empty") + var ErrSigningPayloadBytesZero = errors.New("signing payload bytes cannot be 0") + var ErrSigningPayloadIsNil = errors.New("signing payload cannot be nil") + var ErrSubNetworkIdentifierInvalid = errors.New("NetworkIdentifier.SubNetworkIdentifier.Network is missing") + var ErrSupportedNetworksDuplicate = errors.New("supported network duplicate") + var ErrTimestampAfterMax = errors.New("timestamp is after 01/01/2040") + var ErrTimestampBeforeMin = errors.New("timestamp is before 01/01/2000") + var ErrTimestampStartIndexInvalid = errors.New("TimestampStartIndex is invalid") + var ErrTxIdentifierHashMissing = errors.New("TransactionIdentifier.Hash is missing") + var ErrTxIdentifierIsNil = errors.New("TransactionIdentifier is nil") + var ErrTxIdentifierResponseIsNil = errors.New("TransactionIdentifierResponse cannot be nil") + var ErrTxIsNil = errors.New("Transaction is nil") + var ErrVersionIsNil = errors.New("version is nil") + var ErrVersionMiddlewareVersionMissing = errors.New("Version.MiddlewareVersion is missing") + var ErrVersionNodeVersionMissing = errors.New("Version.NodeVersion is missing") + var ErrorErrs = []error + var EventsErrs = []error + var NetworkErrs = []error + var SearchErrs = []error + var ServerErrs = []error + func AccountArray(arrName string, arr []*types.AccountIdentifier) error + func AccountBalanceResponse(requestBlock *types.PartialBlockIdentifier, ...) error + func AccountCoinsResponse(response *types.AccountCoinsResponse) error + func AccountIdentifier(account *types.AccountIdentifier) error + func Allow(allowed *types.Allow) error + func Amount(amount *types.Amount) error + func AssertUniqueAmounts(amounts []*types.Amount) error + func BalanceExemptions(exemptions []*types.BalanceExemption) error + func BlockEvent(event *types.BlockEvent) error + func BlockIdentifier(blockIdentifier *types.BlockIdentifier) error + func BytesArrayZero(arr []byte) bool + func CallMethods(methods []string) error + func Coin(coin *types.Coin) error + func CoinAction(action types.CoinAction) error + func CoinChange(change *types.CoinChange) error + func CoinIdentifier(coinIdentifier *types.CoinIdentifier) error + func Coins(coins []*types.Coin) error + func ConstructionCombineResponse(response *types.ConstructionCombineResponse) error + func ConstructionDeriveResponse(response *types.ConstructionDeriveResponse) error + func ConstructionMetadataResponse(response *types.ConstructionMetadataResponse) error + func ConstructionPayloadsResponse(response *types.ConstructionPayloadsResponse) error + func ConstructionPreprocessResponse(response *types.ConstructionPreprocessResponse) error + func ContainsCurrency(currencies []*types.Currency, currency *types.Currency) bool + func ContainsDuplicateCurrency(currencies []*types.Currency) *types.Currency + func Currency(currency *types.Currency) error + func CurveType(curve types.CurveType) error + func Err(err error) (bool, string) + func Error(err *types.Error) error + func Errors(rosettaErrors []*types.Error) error + func EventsBlocksResponse(response *types.EventsBlocksResponse) error + func MempoolTransactions(transactions []*types.TransactionIdentifier) error + func NetworkIdentifier(network *types.NetworkIdentifier) error + func NetworkListResponse(response *types.NetworkListResponse) error + func NetworkOptionsResponse(options *types.NetworkOptionsResponse) error + func NetworkStatusResponse(response *types.NetworkStatusResponse) error + func OperationIdentifier(identifier *types.OperationIdentifier, index int64) error + func OperationStatuses(statuses []*types.OperationStatus) error + func OperationTypes(types []string) error + func PartialBlockIdentifier(blockIdentifier *types.PartialBlockIdentifier) error + func Peer(peer *types.Peer) error + func PublicKey(publicKey *types.PublicKey) error + func SignatureType(signature types.SignatureType) error + func Signatures(signatures []*types.Signature) error + func SigningPayload(signingPayload *types.SigningPayload) error + func StringArray(arrName string, arr []string) error + func SubNetworkIdentifier(subNetworkIdentifier *types.SubNetworkIdentifier) error + func SupportedNetworks(supportedNetworks []*types.NetworkIdentifier) error + func Timestamp(timestamp int64) error + func TransactionIdentifier(transactionIdentifier *types.TransactionIdentifier) error + func TransactionIdentifierResponse(response *types.TransactionIdentifierResponse) error + func Version(version *types.Version) error + type Asserter struct + func NewClientWithFile(filePath string) (*Asserter, error) + func NewClientWithOptions(network *types.NetworkIdentifier, ...) (*Asserter, error) + func NewClientWithResponses(network *types.NetworkIdentifier, networkStatus *types.NetworkStatusResponse, ...) (*Asserter, error) + func NewServer(supportedOperationTypes []string, historicalBalanceLookup bool, ...) (*Asserter, error) + func (a *Asserter) AccountBalanceRequest(request *types.AccountBalanceRequest) error + func (a *Asserter) AccountCoinsRequest(request *types.AccountCoinsRequest) error + func (a *Asserter) Block(block *types.Block) error + func (a *Asserter) BlockRequest(request *types.BlockRequest) error + func (a *Asserter) BlockTransactionRequest(request *types.BlockTransactionRequest) error + func (a *Asserter) CallRequest(request *types.CallRequest) error + func (a *Asserter) ClientConfiguration() (*Configuration, error) + func (a *Asserter) ConstructionCombineRequest(request *types.ConstructionCombineRequest) error + func (a *Asserter) ConstructionDeriveRequest(request *types.ConstructionDeriveRequest) error + func (a *Asserter) ConstructionHashRequest(request *types.ConstructionHashRequest) error + func (a *Asserter) ConstructionMetadataRequest(request *types.ConstructionMetadataRequest) error + func (a *Asserter) ConstructionParseRequest(request *types.ConstructionParseRequest) error + func (a *Asserter) ConstructionParseResponse(response *types.ConstructionParseResponse, signed bool) error + func (a *Asserter) ConstructionPayloadsRequest(request *types.ConstructionPayloadsRequest) error + func (a *Asserter) ConstructionPreprocessRequest(request *types.ConstructionPreprocessRequest) error + func (a *Asserter) ConstructionSubmitRequest(request *types.ConstructionSubmitRequest) error + func (a *Asserter) Error(err *types.Error) error + func (a *Asserter) EventsBlocksRequest(request *types.EventsBlocksRequest) error + func (a *Asserter) MempoolTransactionRequest(request *types.MempoolTransactionRequest) error + func (a *Asserter) MetadataRequest(request *types.MetadataRequest) error + func (a *Asserter) NetworkRequest(request *types.NetworkRequest) error + func (a *Asserter) Operation(operation *types.Operation, index int64, construction bool) error + func (a *Asserter) OperationStatus(status *string, construction bool) error + func (a *Asserter) OperationSuccessful(operation *types.Operation) (bool, error) + func (a *Asserter) OperationType(t string) error + func (a *Asserter) Operations(operations []*types.Operation, construction bool) error + func (a *Asserter) SearchTransactionsRequest(request *types.SearchTransactionsRequest) error + func (a *Asserter) SearchTransactionsResponse(response *types.SearchTransactionsResponse) error + func (a *Asserter) SupportedNetwork(requestNetwork *types.NetworkIdentifier) error + func (a *Asserter) Transaction(transaction *types.Transaction) error + func (a *Asserter) ValidCallMethod(method string) error + func (a *Asserter) ValidSupportedNetwork(requestNetwork *types.NetworkIdentifier) error + type Configuration struct + AllowedErrors []*types.Error + AllowedOperationStatuses []*types.OperationStatus + AllowedOperationTypes []string + AllowedTimestampStartIndex int64 + GenesisBlockIdentifier *types.BlockIdentifier + NetworkIdentifier *types.NetworkIdentifier