Versions in this module Expand all Collapse all v2 v2.0.1 Dec 6, 2021 Changes in this version type NodeOutputResponse + LedgerIndex uint64 v2.0.0 May 10, 2021 Changes in this version + const ByteArrayLengthByteSize + const DustAllowanceDivisor + const Ed25519AddressBytesLength + const Ed25519AddressSerializedBytesSize + const Float32ByteSize + const Float64ByteSize + const IndexationBinSerializedMinSize + const IndexationIndexMaxLength + const IndexationIndexMinLength + const IndexationPayloadTypeID + const Int16ByteSize + const Int32ByteSize + const Int64ByteSize + const MaxDustOutputsOnAddress + const MaxInputsCount + const MaxMigratedFundsEntryCount + const MaxOutputsCount + const MaxParentsInAMessage + const MaxPublicKeysInAMilestone + const MaxSignaturesInAMilestone + const MessageBinSerializedMaxSize + const MessageBinSerializedMinSize + const MessageIDLength + const MessageNetworkIDLength + const MilestoneBinSerializedMinSize + const MilestoneIDLength + const MilestoneInclusionMerkleProofLength + const MilestonePayloadTypeID + const MilestonePublicKeyLength + const MilestoneSignatureLength + const MinInputsCount + const MinMigratedFundsEntryCount + const MinMigratedFundsEntryDeposit + const MinOutputsCount + const MinParentsInAMessage + const MinPayloadByteSize + const MinPublicKeysInAMilestone + const MinSignaturesInAMilestone + const NodeAPIRouteAddressBech32Balance + const NodeAPIRouteAddressBech32Outputs + const NodeAPIRouteAddressEd25519Balance + const NodeAPIRouteAddressEd25519Outputs + const NodeAPIRouteHealth + const NodeAPIRouteInfo + const NodeAPIRouteMessageBytes + const NodeAPIRouteMessageChildren + const NodeAPIRouteMessageMetadata + const NodeAPIRouteMessages + const NodeAPIRouteMilestone + const NodeAPIRouteMilestoneUTXOChanges + const NodeAPIRouteOutput + const NodeAPIRoutePeer + const NodeAPIRoutePeers + const NodeAPIRouteReceipts + const NodeAPIRouteReceiptsByMigratedAtIndex + const NodeAPIRouteTips + const NodeAPIRouteTreasury + const OneByte + const OutputSigLockedDustAllowanceOutput + const OutputSigLockedDustAllowanceOutputMinDeposit + const OutputSigLockedSingleOutput + const OutputTreasuryOutput + const PayloadLengthByteSize + const ReceiptPayloadTypeID + const RefUTXOIndexMax + const RefUTXOIndexMin + const ReferenceUnlockBlockSize + const SigLockedDustAllowanceOutputAddressOffset + const SigLockedDustAllowanceOutputBytesMinSize + const SigLockedDustAllowanceOutputEd25519AddrBytesSize + const SigLockedSingleOutputAddressOffset + const SigLockedSingleOutputBytesMinSize + const SigLockedSingleOutputEd25519AddrBytesSize + const SignatureUnlockBlockMinSize + const SmallTypeDenotationByteSize + const StructArrayLengthByteSize + const TokenSupply + const TransactionBinSerializedMinSize + const TransactionEssenceMinByteSize + const TransactionEssenceNormal + const TransactionIDLength + const TransactionPayloadTypeID + const TreasuryInputBytesLength + const TreasuryInputSerializedBytesSize + const TreasuryOutputBytesSize + const TreasuryTransactionByteSize + const TreasuryTransactionPayloadTypeID + const TypeDenotationByteSize + const UInt16ByteSize + const UInt32ByteSize + const UInt64ByteSize + const UTXOInputSize + const UnlockBlockReference + const UnlockBlockSignature + var ErrAddressKeysNotMapped = errors.New("key(s) for address not mapped") + var ErrAddressKeysWrongType = errors.New("key(s) for address are of wrong type") + var ErrArrayValidationMaxElementsExceeded = errors.New("max count of elements within the array exceeded") + var ErrArrayValidationMinElementsNotReached = errors.New("min count of elements within the array not reached") + var ErrArrayValidationOrderViolatesLexicalOrder = errors.New("array elements must be in their lexical order (byte wise)") + var ErrArrayValidationViolatesUniqueness = errors.New("array elements must be unique") + var ErrDepositAmountMustBeGreaterThanZero = errors.New("deposit amount must be greater than zero") + var ErrDeserializationInvalidBoolValue = errors.New("invalid bool value") + var ErrDeserializationLengthInvalid = errors.New("length denotation invalid") + var ErrDeserializationNotAllConsumed = errors.New("not all data has been consumed but should have been") + var ErrDeserializationNotEnoughData = errors.New("not enough data for deserialization") + var ErrDeserializationTypeMismatch = errors.New("data type is invalid for deserialization") + var ErrEd25519PubKeyAndAddrMismatch = errors.New("public key and address do not correspond to each other (Ed25519)") + var ErrEd25519SignatureInvalid = errors.New("signature is invalid (Ed25519") + var ErrHTTPBadRequest = errors.New("bad request") + var ErrHTTPInternalServerError = errors.New("internal server error") + var ErrHTTPNotFound = errors.New("not found") + var ErrHTTPNotImplemented = errors.New("operation not implemented/supported/available") + var ErrHTTPUnauthorized = errors.New("unauthorized") + var ErrHTTPUnknownError = errors.New("unknown error") + var ErrIndexationIndexExceedsMaxSize = errors.New("index exceeds max size") + var ErrIndexationIndexUnderMinSize = errors.New("index is below min size") + var ErrInputOutputSumMismatch = errors.New("inputs and outputs do not spend/deposit the same amount") + var ErrInputSignatureUnlockBlockInvalid = errors.New("companion signature unlock block is invalid for input") + var ErrInputUTXORefsNotUnique = errors.New("inputs must each reference a unique UTXO") + var ErrInvalidBytes = errors.New("invalid bytes") + var ErrInvalidDustAllowance = errors.New("invalid dust allowance") + var ErrInvalidJSON = errors.New("invalid json") + var ErrInvalidReceipt = errors.New("invalid receipt") + var ErrInvalidTransactionEssence = errors.New("transaction essence is invalid") + var ErrMessageExceedsMaxSize = errors.New("message exceeds max size") + var ErrMilestoneDuplicatedPublicKey = fmt.Errorf("milestone contains duplicated public keys") + var ErrMilestoneInMemorySignerPrivateKeyMissing = fmt.Errorf("private key missing") + var ErrMilestoneInvalidMinPoWScoreValues = fmt.Errorf("invalid milestone min pow score values") + var ErrMilestoneInvalidMinSignatureThreshold = fmt.Errorf("min threshold must be at least 1") + var ErrMilestoneInvalidSignature = fmt.Errorf("invalid milestone signature") + var ErrMilestoneNonApplicablePublicKey = fmt.Errorf("non applicable public key found") + var ErrMilestoneProducedSignaturesCountMismatch = errors.New("produced and wanted signature count mismatch") + var ErrMilestoneSignatureThresholdGreaterThanApplicablePublicKeySet = fmt.Errorf(...) + var ErrMilestoneSignaturesPublicKeyCountMismatch = errors.New("milestone signatures and public keys count must be equal") + var ErrMilestoneTooFewPublicKeys = errors.New("a milestone must hold at least one public key") + var ErrMilestoneTooFewSignatures = errors.New("a milestone must hold at least one signature") + var ErrMilestoneTooFewSignaturesForVerificationThreshold = errors.New("too few signatures for verification") + var ErrMilestoneTooManySignatures = fmt.Errorf("a milestone can hold max %d signatures", MaxSignaturesInAMilestone) + var ErrMinInputsNotReached = fmt.Errorf("min %d input(s) are required within a transaction", MinInputsCount) + var ErrMinOutputsNotReached = fmt.Errorf("min %d output(s) are required within a transaction", MinOutputsCount) + var ErrMissingUTXO = errors.New("missing utxo") + var ErrOutputAddrNotUnique = errors.New("outputs must each deposit to a unique address") + var ErrOutputDepositsMoreThanTotalSupply = errors.New("an output can not deposit more than the total supply") + var ErrOutputDustAllowanceLessThanMinDeposit = errors.New("dust allowance output deposits less than the minimum required amount") + var ErrOutputsSumExceedsTotalSupply = errors.New("accumulated output balance exceeds total supply") + var ErrReceiptMustContainATreasuryTransaction = errors.New("receipt must contain a treasury transaction") + var ErrRefUTXOIndexInvalid = fmt.Errorf("the referenced UTXO index must be between %d and %d (inclusive)", ...) + var ErrRefUnlockBlockInvalidRef = errors.New("reference unlock block must point to a previous signature unlock block") + var ErrSigUnlockBlockHasNilSig = errors.New("signature is nil") + var ErrSigUnlockBlocksNotUnique = errors.New("signature unlock blocks must be unique") + var ErrSignatureAndAddrIncompatible = errors.New("address and signature type are not compatible") + var ErrTransactionBuilderUnsupportedAddress = errors.New("unsupported address type") + var ErrUnknownAddrType = errors.New("unknown address type") + var ErrUnknownArrayValidationMode = errors.New("unknown array validation mode") + var ErrUnknownInputType = errors.New("unknown input type") + var ErrUnknownOutputType = errors.New("unknown output type") + var ErrUnknownPayloadType = errors.New("unknown payload type") + var ErrUnknownSignatureType = errors.New("unknown signature type") + var ErrUnknownTransactionEssenceType = errors.New("unknown transaction essence type") + var ErrUnknownUnlockBlockType = errors.New("unknown unlock block type") + var ErrUnlockBlocksMustMatchInputCount = errors.New("the count of unlock blocks must match the inputs of the transaction") + var ErrUnsupportedObjectType = errors.New("unsupported object type") + var ErrUnsupportedPayloadType = errors.New("unsupported payload type") + func MessageIDToHexString(msgID MessageID) string + func ParseBech32(s string) (NetworkPrefix, Address, error) + func ValidateInputs(inputs Serializables, funcs ...InputsValidatorFunc) error + func ValidateOutputs(outputs Serializables, funcs ...OutputsValidatorFunc) error + func ValidateReceipt(receipt *Receipt, prevTreasuryOutput *TreasuryOutput) error + func ValidateUnlockBlocks(unlockBlocks Serializables, funcs ...UnlockBlockValidatorFunc) error + type AddPeerRequest struct + Alias *string + MultiAddress string + type Address interface + Bech32 func(hrp NetworkPrefix) string + Type func() AddressType + type AddressBalanceResponse struct + Address string + AddressType byte + Balance uint64 + DustAllowed bool + LedgerIndex uint64 + type AddressKeys struct + Address Address + Keys interface{} + func NewAddressKeysForEd25519Address(addr *Ed25519Address, prvKey ed25519.PrivateKey) AddressKeys + type AddressOutputsResponse struct + Address string + AddressType byte + Count uint32 + LedgerIndex uint64 + MaxResults uint32 + OutputIDs []OutputIDHex + type AddressSigner interface + Sign func(addr Address, msg []byte) (signature Serializable, err error) + func NewInMemoryAddressSigner(addrKeys ...AddressKeys) AddressSigner + type AddressSignerFunc func(addr Address, msg []byte) (signature Serializable, err error) + func (s AddressSignerFunc) Sign(addr Address, msg []byte) (signature Serializable, err error) + type AddressType = byte + const AddressEd25519 + type ArrayOf32Bytes = [32]byte + type ArrayOf49Bytes = [49]byte + type ArrayOf64Bytes = [64]byte + type ArrayRules struct + Max uint16 + Min uint16 + ValidationMode ArrayValidationMode + func (ar *ArrayRules) CheckBounds(count uint16) error + func (ar *ArrayRules) ElementUniqueValidator() ElementValidationFunc + func (ar *ArrayRules) ElementValidationFunc(mode ArrayValidationMode) ElementValidationFunc + func (ar *ArrayRules) LexicalOrderValidator() ElementValidationFunc + func (ar *ArrayRules) LexicalOrderWithoutDupsValidator() ElementValidationFunc + type ArrayValidationMode byte + const ArrayValidationModeLexicalOrdering + const ArrayValidationModeNoDuplicates + const ArrayValidationModeNone + func (av ArrayValidationMode) HasMode(mode ArrayValidationMode) bool + type ChildrenResponse struct + Children []string + Count uint32 + MaxResults uint32 + MessageID string + type DeSerializationMode byte + const DeSeriModeNoValidation + const DeSeriModePerformLexicalOrdering + const DeSeriModePerformValidation + func (sm DeSerializationMode) HasMode(mode DeSerializationMode) bool + type Deserializer struct + func NewDeserializer(src []byte) *Deserializer + func (d *Deserializer) AbortIf(errProducer ErrProducer) *Deserializer + func (d *Deserializer) ConsumedAll(errProducer ErrProducerWithLeftOver) *Deserializer + func (d *Deserializer) Do(f func()) *Deserializer + func (d *Deserializer) Done() (int, error) + func (d *Deserializer) ReadArrayOf32Bytes(arr *ArrayOf32Bytes, errProducer ErrProducer) *Deserializer + func (d *Deserializer) ReadArrayOf49Bytes(arr *ArrayOf49Bytes, errProducer ErrProducer) *Deserializer + func (d *Deserializer) ReadArrayOf64Bytes(arr *ArrayOf64Bytes, errProducer ErrProducer) *Deserializer + func (d *Deserializer) ReadBool(dest *bool, errProducer ErrProducer) *Deserializer + func (d *Deserializer) ReadNum(dest interface{}, errProducer ErrProducer) *Deserializer + func (d *Deserializer) ReadObject(f ReadObjectConsumerFunc, deSeriMode DeSerializationMode, ...) *Deserializer + func (d *Deserializer) ReadPayload(f ReadObjectConsumerFunc, deSeriMode DeSerializationMode, ...) *Deserializer + func (d *Deserializer) ReadSliceOfArraysOf32Bytes(slice *SliceOfArraysOf32Bytes, deSeriMode DeSerializationMode, ...) *Deserializer + func (d *Deserializer) ReadSliceOfArraysOf64Bytes(slice *SliceOfArraysOf64Bytes, deSeriMode DeSerializationMode, ...) *Deserializer + func (d *Deserializer) ReadSliceOfObjects(f ReadObjectsConsumerFunc, deSeriMode DeSerializationMode, ...) *Deserializer + func (d *Deserializer) ReadString(s *string, errProducer ErrProducer, maxSize ...uint16) *Deserializer + func (d *Deserializer) ReadVariableByteSlice(slice *[]byte, lenType SeriSliceLengthType, errProducer ErrProducer, ...) *Deserializer + func (d *Deserializer) Skip(skip int, errProducer ErrProducer) *Deserializer + type DustAllowanceFunc func(addr Address) (dustAllowanceSum uint64, amountDustOutputs int64, err error) + type Ed25519Address [Ed25519AddressBytesLength]byte + func AddressFromEd25519PubKey(pubKey ed25519.PublicKey) Ed25519Address + func MustParseEd25519AddressFromHexString(hexAddr string) *Ed25519Address + func ParseEd25519AddressFromHexString(hexAddr string) (*Ed25519Address, error) + func (edAddr *Ed25519Address) Bech32(hrp NetworkPrefix) string + func (edAddr *Ed25519Address) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (edAddr *Ed25519Address) MarshalJSON() ([]byte, error) + func (edAddr *Ed25519Address) Serialize(deSeriMode DeSerializationMode) (data []byte, err error) + func (edAddr *Ed25519Address) String() string + func (edAddr *Ed25519Address) Type() AddressType + func (edAddr *Ed25519Address) UnmarshalJSON(bytes []byte) error + type Ed25519Signature struct + PublicKey [ed25519.PublicKeySize]byte + Signature [ed25519.SignatureSize]byte + func (e *Ed25519Signature) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (e *Ed25519Signature) MarshalJSON() ([]byte, error) + func (e *Ed25519Signature) Serialize(deSeriMode DeSerializationMode) ([]byte, error) + func (e *Ed25519Signature) UnmarshalJSON(bytes []byte) error + func (e *Ed25519Signature) Valid(msg []byte, addr *Ed25519Address) error + type ElementValidationFunc func(index int, next []byte) error + type ErrProducer func(err error) error + type ErrProducerWithLeftOver func(left int, err error) error + type GossipHeartbeat struct + ConnectedNeighbors int + LatestMilestoneIndex uint32 + PrunedMilestoneIndex uint32 + SolidMilestoneIndex uint32 + SyncedNeighbors int + type GossipInfo struct + Heartbeat *GossipHeartbeat + Metrics PeerGossipMetrics + type HTTPErrorResponseEnvelope struct + Error struct{ ... } + type HTTPOkResponseEnvelope struct + Data interface{} + type InMemoryAddressSigner struct + func (s *InMemoryAddressSigner) Sign(addr Address, msg []byte) (signature Serializable, err error) + type Indexation struct + Data []byte + Index []byte + func (u *Indexation) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (u *Indexation) MarshalJSON() ([]byte, error) + func (u *Indexation) Serialize(deSeriMode DeSerializationMode) ([]byte, error) + func (u *Indexation) UnmarshalJSON(bytes []byte) error + type InputToOutputMapping = map[UTXOInputID]Output + type InputType = byte + const InputTreasury + const InputUTXO + type InputsValidatorFunc func(index int, input *UTXOInput) error + func InputsUTXORefIndexBoundsValidator() InputsValidatorFunc + func InputsUTXORefsUniqueValidator() InputsValidatorFunc + type JSONObjectEnvelope struct + Type int + type JSONSerializable interface + ToSerializable func() (Serializable, error) + func DeserializeObjectFromJSON(raw *json.RawMessage, selector JSONSerializableSelectorFunc) (JSONSerializable, error) + type JSONSerializableSelectorFunc func(ty int) (JSONSerializable, error) + type LegacyTailTransactionHash = [49]byte + type LexicalOrdered32ByteArrays [][32]byte + func (l LexicalOrdered32ByteArrays) Len() int + func (l LexicalOrdered32ByteArrays) Less(i, j int) bool + func (l LexicalOrdered32ByteArrays) Swap(i, j int) + type LexicalOrderedByteSlices [][]byte + func (l LexicalOrderedByteSlices) Len() int + func (l LexicalOrderedByteSlices) Less(i, j int) bool + func (l LexicalOrderedByteSlices) Swap(i, j int) + type Message struct + NetworkID uint64 + Nonce uint64 + Parents MessageIDs + Payload Serializable + func (m *Message) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (m *Message) ID() (*MessageID, error) + func (m *Message) MarshalJSON() ([]byte, error) + func (m *Message) MustID() MessageID + func (m *Message) POW() (float64, error) + func (m *Message) Serialize(deSeriMode DeSerializationMode) ([]byte, error) + func (m *Message) UnmarshalJSON(bytes []byte) error + type MessageBuilder struct + func NewMessageBuilder() *MessageBuilder + func (mb *MessageBuilder) Build() (*Message, error) + func (mb *MessageBuilder) NetworkID(networkID uint64) *MessageBuilder + func (mb *MessageBuilder) NetworkIDFromString(networkIDStr string) *MessageBuilder + func (mb *MessageBuilder) Parents(parents [][]byte) *MessageBuilder + func (mb *MessageBuilder) ParentsMessageIDs(parents MessageIDs) *MessageBuilder + func (mb *MessageBuilder) Payload(seri Serializable) *MessageBuilder + func (mb *MessageBuilder) ProofOfWork(ctx context.Context, targetScore float64, numWorkers ...int) *MessageBuilder + func (mb *MessageBuilder) Tips(ctx context.Context, nodeAPI *NodeHTTPAPIClient) *MessageBuilder + type MessageID = [MessageIDLength]byte + func MessageIDFromHexString(messageIDHex string) (MessageID, error) + func MustMessageIDFromHexString(messageIDHex string) MessageID + type MessageIDs = []MessageID + type MessageIDsByIndexResponse struct + Count uint32 + Index string + MaxResults uint32 + MessageIDs []string + type MessageMetadataResponse struct + ConflictReason uint8 + LedgerInclusionState *string + MessageID string + MilestoneIndex *uint32 + Parents []string + ReferencedByMilestoneIndex *uint32 + ShouldPromote *bool + ShouldReattach *bool + Solid bool + type MigratedFundsEntry struct + Address Serializable + Deposit uint64 + TailTransactionHash LegacyTailTransactionHash + func (m *MigratedFundsEntry) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (m *MigratedFundsEntry) MarshalJSON() ([]byte, error) + func (m *MigratedFundsEntry) Serialize(deSeriMode DeSerializationMode) ([]byte, error) + func (m *MigratedFundsEntry) UnmarshalJSON(bytes []byte) error + type Milestone struct + InclusionMerkleProof MilestoneInclusionMerkleProof + Index uint32 + NextPoWScore uint32 + NextPoWScoreMilestoneIndex uint32 + Parents MilestoneParentMessageIDs + PublicKeys []MilestonePublicKey + Receipt Serializable + Signatures []MilestoneSignature + Timestamp uint64 + func NewMilestone(index uint32, timestamp uint64, parents MilestoneParentMessageIDs, ...) (*Milestone, error) + func (m *Milestone) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (m *Milestone) Essence() ([]byte, error) + func (m *Milestone) ID() (*MilestoneID, error) + func (m *Milestone) MarshalJSON() ([]byte, error) + func (m *Milestone) Serialize(deSeriMode DeSerializationMode) ([]byte, error) + func (m *Milestone) Sign(signingFunc MilestoneSigningFunc) error + func (m *Milestone) UnmarshalJSON(bytes []byte) error + func (m *Milestone) VerifySignatures(minSigThreshold int, applicablePubKeys MilestonePublicKeySet) error + type MilestoneID = [MilestoneIDLength]byte + type MilestoneInclusionMerkleProof = [MilestoneInclusionMerkleProofLength]byte + type MilestoneParentMessageID = MessageID + type MilestoneParentMessageIDs = []MilestoneParentMessageID + type MilestonePublicKey = [MilestonePublicKeyLength]byte + type MilestonePublicKeyMapping = map[MilestonePublicKey]ed25519.PrivateKey + type MilestonePublicKeySet = map[MilestonePublicKey]struct + type MilestoneResponse struct + Index uint32 + MessageID string + Time int64 + type MilestoneSignature = [MilestoneSignatureLength]byte + type MilestoneSigningFunc func(pubKeys []MilestonePublicKey, msEssence []byte) ([]MilestoneSignature, error) + func InMemoryEd25519MilestoneSigner(prvKeys MilestonePublicKeyMapping) MilestoneSigningFunc + func InsecureRemoteEd25519MilestoneSigner(remoteEndpoint string) MilestoneSigningFunc + type MilestoneUTXOChangesResponse struct + ConsumedOutputs []string + CreatedOutputs []string + Index uint32 + type NetworkID = uint64 + func NetworkIDFromString(networkIDStr string) NetworkID + type NetworkPrefix string + const PrefixMainnet + const PrefixTestnet + type NodeHTTPAPIClient struct + BaseURL string + func NewNodeHTTPAPIClient(baseURL string, opts ...NodeHTTPAPIClientOption) *NodeHTTPAPIClient + func (api *NodeHTTPAPIClient) AddPeer(ctx context.Context, multiAddress string, alias ...string) (*PeerResponse, error) + func (api *NodeHTTPAPIClient) BalanceByBech32Address(ctx context.Context, bech32Addr string) (*AddressBalanceResponse, error) + func (api *NodeHTTPAPIClient) BalanceByEd25519Address(ctx context.Context, addr *Ed25519Address) (*AddressBalanceResponse, error) + func (api *NodeHTTPAPIClient) ChildrenByMessageID(ctx context.Context, msgID MessageID) (*ChildrenResponse, error) + func (api *NodeHTTPAPIClient) Do(ctx context.Context, method string, route string, reqObj interface{}, ...) (*http.Response, error) + func (api *NodeHTTPAPIClient) Health(ctx context.Context) (bool, error) + func (api *NodeHTTPAPIClient) Info(ctx context.Context) (*NodeInfoResponse, error) + func (api *NodeHTTPAPIClient) MessageByMessageID(ctx context.Context, msgID MessageID) (*Message, error) + func (api *NodeHTTPAPIClient) MessageIDsByIndex(ctx context.Context, index []byte) (*MessageIDsByIndexResponse, error) + func (api *NodeHTTPAPIClient) MessageMetadataByMessageID(ctx context.Context, msgID MessageID) (*MessageMetadataResponse, error) + func (api *NodeHTTPAPIClient) MilestoneByIndex(ctx context.Context, index uint32) (*MilestoneResponse, error) + func (api *NodeHTTPAPIClient) MilestoneUTXOChangesByIndex(ctx context.Context, index uint32) (*MilestoneUTXOChangesResponse, error) + func (api *NodeHTTPAPIClient) OutputByID(ctx context.Context, utxoID UTXOInputID) (*NodeOutputResponse, error) + func (api *NodeHTTPAPIClient) OutputIDsByBech32Address(ctx context.Context, bech32Addr string, includeSpentOutputs bool) (*AddressOutputsResponse, error) + func (api *NodeHTTPAPIClient) OutputIDsByEd25519Address(ctx context.Context, addr *Ed25519Address, includeSpentOutputs bool) (*AddressOutputsResponse, error) + func (api *NodeHTTPAPIClient) OutputsByBech32Address(ctx context.Context, bech32Addr string, includeSpentOutputs bool) (*AddressOutputsResponse, map[*UTXOInput]Output, error) + func (api *NodeHTTPAPIClient) OutputsByEd25519Address(ctx context.Context, addr *Ed25519Address, includeSpentOutputs bool) (*AddressOutputsResponse, map[*UTXOInput]Output, error) + func (api *NodeHTTPAPIClient) PeerByID(ctx context.Context, id string) (*PeerResponse, error) + func (api *NodeHTTPAPIClient) Peers(ctx context.Context) ([]*PeerResponse, error) + func (api *NodeHTTPAPIClient) Receipts(ctx context.Context) ([]*ReceiptTuple, error) + func (api *NodeHTTPAPIClient) ReceiptsByMigratedAtIndex(ctx context.Context, index uint32) ([]*ReceiptTuple, error) + func (api *NodeHTTPAPIClient) RemovePeerByID(ctx context.Context, id string) error + func (api *NodeHTTPAPIClient) SubmitMessage(ctx context.Context, m *Message) (*Message, error) + func (api *NodeHTTPAPIClient) Tips(ctx context.Context) (*NodeTipsResponse, error) + func (api *NodeHTTPAPIClient) Treasury(ctx context.Context) (*TreasuryResponse, error) + type NodeHTTPAPIClientOption func(opts *NodeHTTPAPIClientOptions) + func WithNodeHTTPAPIClientHTTPClient(httpClient *http.Client) NodeHTTPAPIClientOption + func WithNodeHTTPAPIClientUserInfo(userInfo *url.Userinfo) NodeHTTPAPIClientOption + type NodeHTTPAPIClientOptions struct + type NodeInfoResponse struct + Bech32HRP string + ConfirmedMilestoneIndex uint32 + Features []string + IsHealthy bool + LatestMilestoneIndex uint32 + LatestMilestoneTimestamp int64 + MessagesPerSecond float64 + MinPowScore float64 + Name string + NetworkID string + PruningIndex uint32 + ReferencedMessagesPerSecond float64 + ReferencedRate float64 + Version string + type NodeOutputResponse struct + MessageID string + OutputIndex uint16 + RawOutput *json.RawMessage + Spent bool + TransactionID string + func (nor *NodeOutputResponse) Output() (Output, error) + func (nor *NodeOutputResponse) TxID() (*TransactionID, error) + type NodeTipsResponse struct + TipsHex []string + func (ntr *NodeTipsResponse) Tips() (MessageIDs, error) + type Output interface + Deposit func() (uint64, error) + Target func() (Serializable, error) + Type func() OutputType + type OutputIDHex string + func (oih OutputIDHex) AsUTXOInput() (*UTXOInput, error) + func (oih OutputIDHex) MustAsUTXOInput() *UTXOInput + func (oih OutputIDHex) MustSplitParts() (*TransactionID, uint16) + func (oih OutputIDHex) SplitParts() (*TransactionID, uint16, error) + type OutputType = byte + type Outputs []Output + type OutputsValidatorFunc func(index int, output Output) error + func OutputsAddrUniqueValidator() OutputsValidatorFunc + func OutputsDepositAmountValidator() OutputsValidatorFunc + type PeerGossipMetrics struct + DroppedPackets uint32 + KnownMessages uint32 + NewMessages uint32 + ReceivedHeartbeats uint32 + ReceivedMessageRequests uint32 + ReceivedMessages uint32 + ReceivedMilestoneRequests uint32 + SentHeartbeats uint32 + SentMessageRequests uint32 + SentMessages uint32 + SentMilestoneRequests uint32 + type PeerResponse struct + Alias *string + Connected bool + Gossip *GossipInfo + ID string + MultiAddresses []string + Relation string + type RawDataEnvelope struct + Data []byte + type ReadObjectConsumerFunc func(seri Serializable) + type ReadObjectsConsumerFunc func(seri Serializables) + type Receipt struct + Final bool + Funds Serializables + MigratedAt uint32 + Transaction Serializable + func (r *Receipt) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (r *Receipt) MarshalJSON() ([]byte, error) + func (r *Receipt) Serialize(deSeriMode DeSerializationMode) ([]byte, error) + func (r *Receipt) SortFunds() + func (r *Receipt) Sum() uint64 + func (r *Receipt) Treasury() *TreasuryTransaction + func (r *Receipt) UnmarshalJSON(bytes []byte) error + type ReceiptBuilder struct + func NewReceiptBuilder(migratedAt uint32) *ReceiptBuilder + func (rb *ReceiptBuilder) AddEntry(entry *MigratedFundsEntry) *ReceiptBuilder + func (rb *ReceiptBuilder) AddTreasuryTransaction(tx *TreasuryTransaction) *ReceiptBuilder + func (rb *ReceiptBuilder) Build() (*Receipt, error) + type ReceiptTuple struct + MilestoneIndex uint32 + Receipt *Receipt + type ReceiptsResponse struct + Receipts []*ReceiptTuple + type ReferenceUnlockBlock struct + Reference uint16 + func (r *ReferenceUnlockBlock) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (r *ReferenceUnlockBlock) MarshalJSON() ([]byte, error) + func (r *ReferenceUnlockBlock) Serialize(deSeriMode DeSerializationMode) ([]byte, error) + func (r *ReferenceUnlockBlock) UnmarshalJSON(bytes []byte) error + type SemanticValidationFunc = func(t *Transaction, utxos InputToOutputMapping) error + func NewDustSemanticValidation(div int64, dustOutputsCountLimit int64, dustAllowanceFunc DustAllowanceFunc) SemanticValidationFunc + type SeriSliceLengthType byte + const SeriSliceLengthAsByte + const SeriSliceLengthAsUint16 + const SeriSliceLengthAsUint32 + type Serializable interface + Deserialize func(data []byte, deSeriMode DeSerializationMode) (int, error) + Serialize func(deSeriMode DeSerializationMode) ([]byte, error) + func AddressSelector(addressType uint32) (Serializable, error) + func InputSelector(inputType uint32) (Serializable, error) + func OutputSelector(outputType uint32) (Serializable, error) + func PayloadSelector(payloadType uint32) (Serializable, error) + func SignatureSelector(sigType uint32) (Serializable, error) + func TransactionEssenceSelector(txType uint32) (Serializable, error) + func UnlockBlockSelector(unlockBlockType uint32) (Serializable, error) + type SerializableSelectorFunc func(ty uint32) (Serializable, error) + type Serializables []Serializable + type Serializer struct + func NewSerializer() *Serializer + func (s *Serializer) AbortIf(errProducer ErrProducer) *Serializer + func (s *Serializer) Do(f func()) *Serializer + func (s *Serializer) Serialize() ([]byte, error) + func (s *Serializer) Write32BytesArraySlice(data SliceOfArraysOf32Bytes, deSeriMode DeSerializationMode, ...) *Serializer + func (s *Serializer) Write64BytesArraySlice(data SliceOfArraysOf64Bytes, deSeriMode DeSerializationMode, ...) *Serializer + func (s *Serializer) WriteBool(v bool, errProducer ErrProducer) *Serializer + func (s *Serializer) WriteBytes(data []byte, errProducer ErrProducer) *Serializer + func (s *Serializer) WriteNum(v interface{}, errProducer ErrProducer) *Serializer + func (s *Serializer) WriteObject(seri Serializable, deSeriMode DeSerializationMode, errProducer ErrProducer) *Serializer + func (s *Serializer) WritePayload(payload Serializable, deSeriMode DeSerializationMode, errProducer ErrProducer) *Serializer + func (s *Serializer) WriteSliceOfObjects(seris Serializables, deSeriMode DeSerializationMode, woc WrittenObjectConsumer, ...) *Serializer + func (s *Serializer) WriteString(str string, errProducer ErrProducer) *Serializer + func (s *Serializer) WriteVariableByteSlice(data []byte, lenType SeriSliceLengthType, errProducer ErrProducer) *Serializer + func (s *Serializer) Written() int + type SigLockedDustAllowanceOutput struct + Address Serializable + Amount uint64 + func (s *SigLockedDustAllowanceOutput) Deposit() (uint64, error) + func (s *SigLockedDustAllowanceOutput) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (s *SigLockedDustAllowanceOutput) MarshalJSON() ([]byte, error) + func (s *SigLockedDustAllowanceOutput) Serialize(deSeriMode DeSerializationMode) (data []byte, err error) + func (s *SigLockedDustAllowanceOutput) Target() (Serializable, error) + func (s *SigLockedDustAllowanceOutput) Type() OutputType + func (s *SigLockedDustAllowanceOutput) UnmarshalJSON(bytes []byte) error + type SigLockedSingleOutput struct + Address Serializable + Amount uint64 + func (s *SigLockedSingleOutput) Deposit() (uint64, error) + func (s *SigLockedSingleOutput) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (s *SigLockedSingleOutput) MarshalJSON() ([]byte, error) + func (s *SigLockedSingleOutput) Serialize(deSeriMode DeSerializationMode) (data []byte, err error) + func (s *SigLockedSingleOutput) Target() (Serializable, error) + func (s *SigLockedSingleOutput) Type() OutputType + func (s *SigLockedSingleOutput) UnmarshalJSON(bytes []byte) error + type SigValidationFunc = func() error + type SignatureType = byte + const Ed25519SignatureSerializedBytesSize + const SignatureEd25519 + type SignatureUnlockBlock struct + Signature Serializable + func (s *SignatureUnlockBlock) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (s *SignatureUnlockBlock) MarshalJSON() ([]byte, error) + func (s *SignatureUnlockBlock) Serialize(deSeriMode DeSerializationMode) ([]byte, error) + func (s *SignatureUnlockBlock) UnmarshalJSON(bytes []byte) error + type SliceOfArraysOf32Bytes = []ArrayOf32Bytes + func RemoveDupsAndSortByLexicalOrderArrayOf32Bytes(slice SliceOfArraysOf32Bytes) SliceOfArraysOf32Bytes + type SliceOfArraysOf64Bytes = []ArrayOf64Bytes + type SortedSerializables Serializables + func (ss SortedSerializables) Len() int + func (ss SortedSerializables) Less(i, j int) bool + func (ss SortedSerializables) Swap(i, j int) + type ToBeSignedUTXOInput struct + Address Address + Input *UTXOInput + type Transaction struct + Essence Serializable + UnlockBlocks Serializables + func (t *Transaction) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (t *Transaction) ID() (*TransactionID, error) + func (t *Transaction) MarshalJSON() ([]byte, error) + func (t *Transaction) SemanticallyValidate(utxos InputToOutputMapping, semValFuncs ...SemanticValidationFunc) error + func (t *Transaction) SemanticallyValidateInputs(utxos InputToOutputMapping, transaction *TransactionEssence, ...) (uint64, []SigValidationFunc, error) + func (t *Transaction) SemanticallyValidateOutputs(transaction *TransactionEssence) (uint64, error) + func (t *Transaction) Serialize(deSeriMode DeSerializationMode) ([]byte, error) + func (t *Transaction) SyntacticallyValidate() error + func (t *Transaction) UnmarshalJSON(bytes []byte) error + type TransactionBuilder struct + func NewTransactionBuilder() *TransactionBuilder + func (b *TransactionBuilder) AddIndexationPayload(payload *Indexation) *TransactionBuilder + func (b *TransactionBuilder) AddInput(input *ToBeSignedUTXOInput) *TransactionBuilder + func (b *TransactionBuilder) AddInputsViaNodeQuery(ctx context.Context, addr Address, nodeHTTPAPIClient *NodeHTTPAPIClient, ...) *TransactionBuilder + func (b *TransactionBuilder) AddOutput(output Output) *TransactionBuilder + func (b *TransactionBuilder) Build(signer AddressSigner) (*Transaction, error) + func (b *TransactionBuilder) BuildAndSwapToMessageBuilder(signer AddressSigner, txFunc TransactionFunc) *MessageBuilder + type TransactionBuilderInputFilter func(utxoInput *UTXOInput, input Output) bool + type TransactionEssence struct + Inputs Serializables + Outputs Serializables + Payload Serializable + func (u *TransactionEssence) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (u *TransactionEssence) MarshalJSON() ([]byte, error) + func (u *TransactionEssence) Serialize(deSeriMode DeSerializationMode) (data []byte, err error) + func (u *TransactionEssence) SigningMessage() ([]byte, error) + func (u *TransactionEssence) SortInputsOutputs() + func (u *TransactionEssence) SyntacticallyValidate() error + func (u *TransactionEssence) UnmarshalJSON(bytes []byte) error + type TransactionEssenceType = byte + type TransactionFunc func(tx *Transaction) + type TransactionID = [TransactionIDLength]byte + type TransactionIDs []TransactionID + type TreasuryInput [32]byte + func (ti *TreasuryInput) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (ti *TreasuryInput) MarshalJSON() ([]byte, error) + func (ti *TreasuryInput) Serialize(deSeriMode DeSerializationMode) (data []byte, err error) + func (ti *TreasuryInput) UnmarshalJSON(bytes []byte) error + type TreasuryOutput struct + Amount uint64 + func (t *TreasuryOutput) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (t *TreasuryOutput) MarshalJSON() ([]byte, error) + func (t *TreasuryOutput) Serialize(deSeriMode DeSerializationMode) ([]byte, error) + func (t *TreasuryOutput) UnmarshalJSON(bytes []byte) error + type TreasuryResponse struct + Amount uint64 + MilestoneID string + type TreasuryTransaction struct + Input Serializable + Output Serializable + func (t *TreasuryTransaction) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (t *TreasuryTransaction) MarshalJSON() ([]byte, error) + func (t *TreasuryTransaction) Serialize(deSeriMode DeSerializationMode) ([]byte, error) + func (t *TreasuryTransaction) UnmarshalJSON(bytes []byte) error + type TypeDenotationType byte + const TypeDenotationByte + const TypeDenotationNone + const TypeDenotationUint32 + type UTXOInput struct + TransactionID [TransactionIDLength]byte + TransactionOutputIndex uint16 + func (u *UTXOInput) Deserialize(data []byte, deSeriMode DeSerializationMode) (int, error) + func (u *UTXOInput) ID() UTXOInputID + func (u *UTXOInput) MarshalJSON() ([]byte, error) + func (u *UTXOInput) Serialize(deSeriMode DeSerializationMode) (data []byte, err error) + func (u *UTXOInput) UnmarshalJSON(bytes []byte) error + type UTXOInputID [TransactionIDLength + UInt16ByteSize]byte + func (utxoInputID UTXOInputID) ToHex() string + type UTXOInputIDs []UTXOInputID + func (utxoInputIDs UTXOInputIDs) ToHex() []string + type UnlockBlockType = byte + type UnlockBlockValidatorFunc func(index int, unlockBlock Serializable) error + func UnlockBlocksSigUniqueAndRefValidator() UnlockBlockValidatorFunc + type WrittenObjectConsumer func(index int, written []byte) error Other modules containing this package github.com/iotaledger/iota.go github.com/iotaledger/iota.go/v3