Documentation
¶
Overview ¶
Package iotago provides IOTA data models, a node API client and builders to craft blocks and transactions.
Creating Blocks:
import ( "context" "time" iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/iota.go/v3/builder" "github.com/iotaledger/iota.go/v3/nodeclient" ) func sendblockExample() error { // create a new node API client nodeHTTPAPIClient := nodeclient.New("https://example.com") ctx, cancelFunc := context.WithTimeout(context.Background(), 15*time.Second) defer cancelFunc() // fetch the node's info to know the min. required PoW score info, err := nodeHTTPAPIClient.Info(ctx) if err != nil { return err } // craft a tagged data payload taggedDataPayload := &iotago.TaggedData{ Tag: []byte("hello world"), Data: []byte{1, 2, 3, 4}, } // get some tips from the node tipsResponse, err := nodeHTTPAPIClient.Tips(ctx) if err != nil { return err } tips, err := tipsResponse.Tips() if err != nil { return err } // get the current protocol parameters protoParas, err := info.ProtocolParameters() if err != nil { return err } // build a block by adding the paylod and the tips and then do local Proof-of-Work block, err := builder.NewBlockBuilder(). Payload(taggedDataPayload). Parents(tips). ProofOfWork(ctx, protoParas, info.Protocol.MinPoWScore). Build() // submit the block to the node if _, err := nodeHTTPAPIClient.SubmitBlock(ctx, block, protoParas); err != nil { return err } return nil }
Index ¶
- Constants
- Variables
- func AddressReadGuard(supportedAddr AddressTypeSet) serializer.SerializableReadGuardFunc
- func AddressToJSONRawMsg(addr serializer.Serializable) (*json.RawMessage, error)
- func AddressWriteGuard(supportedAddr AddressTypeSet) serializer.SerializableWriteGuardFunc
- func AliasOutputFeaturesArrayRules() serializer.ArrayRules
- func AliasOutputImmutableFeaturesArrayRules() serializer.ArrayRules
- func BasicOutputFeaturesArrayRules() serializer.ArrayRules
- func BasicOutputUnlockConditionsArrayRules() serializer.ArrayRules
- func BlockParentArrayRules() serializer.ArrayRules
- func DecodeHex(s string) ([]byte, error)
- func DecodeUint256(s string) (*big.Int, error)
- func DecodeUint64(s string) (uint64, error)
- func EncodeHex(b []byte) string
- func EncodeUint256(n *big.Int) string
- func EncodeUint64(n uint64) string
- func FeatureUnchanged(featType FeatureType, inFeatSet FeatureSet, outFeatSet FeatureSet) error
- func FoundryOutputFeaturesArrayRules() serializer.ArrayRules
- func FoundryOutputImmutableFeaturesArrayRules() serializer.ArrayRules
- func IsIssuerOnOutputUnlocked(output ChainConstrainedOutput, unlockedIdents UnlockedIdentities) error
- func MigratedFundEntriesArrayRules() serializer.ArrayRules
- func MilestoneParentArrayRules() serializer.ArrayRules
- func MilestoneSignatureArrayRules() serializer.ArrayRules
- func NFTOutputFeaturesArrayRules() serializer.ArrayRules
- func NFTOutputImmutableFeaturesArrayRules() serializer.ArrayRules
- func NativeTokenArrayRules() serializer.ArrayRules
- func ParseBech32(s string) (NetworkPrefix, Address, error)
- func PayloadSelector(payloadType uint32) (serializer.Serializable, error)
- func SignatureReadGuard(supportedSigs SignatureTypeSet) serializer.SerializableReadGuardFunc
- func SignatureWriteGuard(supportedSigs SignatureTypeSet) serializer.SerializableWriteGuardFunc
- func SyntacticallyValidateInputs(inputs Inputs, funcs ...InputsSyntacticalValidationFunc) error
- func SyntacticallyValidateOutputs(outputs Outputs, funcs ...OutputsSyntacticalValidationFunc) error
- func TransactionEssenceInputsArrayRules() serializer.ArrayRules
- func TransactionEssenceOutputsArrayRules() serializer.ArrayRules
- func TransactionUnlocksArrayRules() serializer.ArrayRules
- func UnlockSelector(unlockType uint32) (serializer.Serializable, error)
- func ValidateReceipt(receipt *ReceiptMilestoneOpt, prevTreasuryOutput *TreasuryOutput, ...) error
- func ValidateUnlocks(unlocks Unlocks, funcs ...UnlockValidatorFunc) error
- type Address
- type AddressKeys
- type AddressSigner
- type AddressSignerFunc
- type AddressType
- type AddressTypeSet
- type AddressUnlockCondition
- func (s *AddressUnlockCondition) Clone() UnlockCondition
- func (s *AddressUnlockCondition) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (s *AddressUnlockCondition) Equal(other UnlockCondition) bool
- func (s *AddressUnlockCondition) MarshalJSON() ([]byte, error)
- func (s *AddressUnlockCondition) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (s *AddressUnlockCondition) Size() int
- func (s *AddressUnlockCondition) Type() UnlockConditionType
- func (s *AddressUnlockCondition) UnmarshalJSON(bytes []byte) error
- func (s *AddressUnlockCondition) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type AliasAddress
- func (aliasAddr *AliasAddress) AliasID() AliasID
- func (aliasAddr *AliasAddress) Bech32(hrp NetworkPrefix) string
- func (aliasAddr *AliasAddress) Chain() ChainID
- func (aliasAddr *AliasAddress) Clone() Address
- func (aliasAddr *AliasAddress) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (aliasAddr *AliasAddress) Equal(other Address) bool
- func (aliasAddr *AliasAddress) Key() string
- func (aliasAddr *AliasAddress) MarshalJSON() ([]byte, error)
- func (aliasAddr *AliasAddress) Serialize(_ serializer.DeSerializationMode, deSeriCtx interface{}) (data []byte, err error)
- func (aliasAddr *AliasAddress) Size() int
- func (aliasAddr *AliasAddress) String() string
- func (aliasAddr *AliasAddress) Type() AddressType
- func (aliasAddr *AliasAddress) UnmarshalJSON(bytes []byte) error
- func (aliasAddr *AliasAddress) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type AliasID
- func (id AliasID) Addressable() bool
- func (id AliasID) Empty() bool
- func (id AliasID) FromOutputID(in OutputID) ChainID
- func (id AliasID) Key() interface{}
- func (id AliasID) Matches(other ChainID) bool
- func (id AliasID) String() string
- func (id AliasID) ToAddress() ChainConstrainedAddress
- func (id AliasID) ToHex() string
- type AliasOutput
- func (a *AliasOutput) AliasEmpty() bool
- func (a *AliasOutput) Chain() ChainID
- func (a *AliasOutput) Clone() Output
- func (a *AliasOutput) Deposit() uint64
- func (a *AliasOutput) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (a *AliasOutput) FeatureSet() FeatureSet
- func (a *AliasOutput) GovernanceSTVF(nextAliasOutput *AliasOutput, semValCtx *SemanticValidationContext) error
- func (a *AliasOutput) GovernorAddress() Address
- func (a *AliasOutput) Ident(nextState TransDepIdentOutput) (Address, error)
- func (a *AliasOutput) ImmutableFeatureSet() FeatureSet
- func (a *AliasOutput) MarshalJSON() ([]byte, error)
- func (a *AliasOutput) NativeTokenList() NativeTokens
- func (a *AliasOutput) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (a *AliasOutput) Size() int
- func (a *AliasOutput) StateController() Address
- func (a *AliasOutput) StateSTVF(nextAliasOutput *AliasOutput, semValCtx *SemanticValidationContext) error
- func (a *AliasOutput) Target() (serializer.Serializable, error)
- func (a *AliasOutput) Type() OutputType
- func (a *AliasOutput) UnlockConditionSet() UnlockConditionSet
- func (a *AliasOutput) UnlockableBy(ident Address, next TransDepIdentOutput, extParas *ExternalUnlockParameters) (bool, error)
- func (a *AliasOutput) UnmarshalJSON(bytes []byte) error
- func (a *AliasOutput) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- func (a *AliasOutput) ValidateStateTransition(transType ChainTransitionType, next ChainConstrainedOutput, ...) error
- type AliasOutputs
- type AliasOutputsSet
- type AliasUnlock
- func (r *AliasUnlock) Chainable() bool
- func (r *AliasUnlock) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (r *AliasUnlock) MarshalJSON() ([]byte, error)
- func (r *AliasUnlock) Ref() uint16
- func (r *AliasUnlock) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (r *AliasUnlock) Size() int
- func (r *AliasUnlock) SourceAllowed(address Address) bool
- func (r *AliasUnlock) Type() UnlockType
- func (r *AliasUnlock) UnmarshalJSON(bytes []byte) error
- type BasicOutput
- func (e *BasicOutput) Clone() Output
- func (e *BasicOutput) Deposit() uint64
- func (e *BasicOutput) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (e *BasicOutput) FeatureSet() FeatureSet
- func (e *BasicOutput) Ident() Address
- func (e *BasicOutput) IsSimpleTransfer() bool
- func (e *BasicOutput) MarshalJSON() ([]byte, error)
- func (e *BasicOutput) NativeTokenList() NativeTokens
- func (e *BasicOutput) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (e *BasicOutput) Size() int
- func (e *BasicOutput) Type() OutputType
- func (e *BasicOutput) UnlockConditionSet() UnlockConditionSet
- func (e *BasicOutput) UnlockableBy(ident Address, extParas *ExternalUnlockParameters) bool
- func (e *BasicOutput) UnmarshalJSON(bytes []byte) error
- func (e *BasicOutput) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type BasicOutputs
- type Block
- func (m *Block) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (m *Block) ID() (BlockID, error)
- func (m *Block) MarshalJSON() ([]byte, error)
- func (m *Block) MustID() BlockID
- func (m *Block) POW() (float64, error)
- func (m *Block) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (m *Block) UnmarshalJSON(bytes []byte) error
- type BlockID
- type BlockIDs
- type ChainConstrainedAddress
- type ChainConstrainedOutput
- type ChainConstrainedOutputs
- type ChainConstrainedOutputsSet
- type ChainID
- type ChainTransitionError
- type ChainTransitionType
- type DirectUnlockableAddress
- type Ed25519Address
- func (edAddr *Ed25519Address) Bech32(hrp NetworkPrefix) string
- func (edAddr *Ed25519Address) Clone() Address
- func (edAddr *Ed25519Address) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (edAddr *Ed25519Address) Equal(other Address) bool
- func (edAddr *Ed25519Address) Key() string
- func (edAddr *Ed25519Address) MarshalJSON() ([]byte, error)
- func (edAddr *Ed25519Address) Serialize(_ serializer.DeSerializationMode, deSeriCtx interface{}) (data []byte, err error)
- func (edAddr *Ed25519Address) Size() int
- func (edAddr *Ed25519Address) String() string
- func (edAddr *Ed25519Address) Type() AddressType
- func (edAddr *Ed25519Address) Unlock(msg []byte, sig Signature) error
- func (edAddr *Ed25519Address) UnmarshalJSON(bytes []byte) error
- func (edAddr *Ed25519Address) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type Ed25519Signature
- func (e *Ed25519Signature) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (e *Ed25519Signature) MarshalJSON() ([]byte, error)
- func (e *Ed25519Signature) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (e *Ed25519Signature) Size() int
- func (e *Ed25519Signature) String() string
- func (e *Ed25519Signature) Type() SignatureType
- func (e *Ed25519Signature) UnmarshalJSON(bytes []byte) error
- func (e *Ed25519Signature) Valid(msg []byte, addr *Ed25519Address) error
- type ExpirationUnlockCondition
- func (s *ExpirationUnlockCondition) Clone() UnlockCondition
- func (s *ExpirationUnlockCondition) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (s *ExpirationUnlockCondition) Equal(other UnlockCondition) bool
- func (s *ExpirationUnlockCondition) MarshalJSON() ([]byte, error)
- func (s *ExpirationUnlockCondition) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (s *ExpirationUnlockCondition) Size() int
- func (s *ExpirationUnlockCondition) Type() UnlockConditionType
- func (s *ExpirationUnlockCondition) UnmarshalJSON(bytes []byte) error
- func (s *ExpirationUnlockCondition) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type ExternalUnlockParameters
- type Feature
- type FeatureSet
- func (f FeatureSet) Clone() FeatureSet
- func (f FeatureSet) EveryTuple(other FeatureSet, fun func(a Feature, b Feature) error) (bool, error)
- func (f FeatureSet) IssuerFeature() *IssuerFeature
- func (f FeatureSet) MetadataFeature() *MetadataFeature
- func (f FeatureSet) SenderFeature() *SenderFeature
- func (f FeatureSet) TagFeature() *TagFeature
- type FeatureSetTransitionValidationFunc
- type FeatureType
- type Features
- func (f Features) Clone() Features
- func (f Features) Equal(other Features) bool
- func (f *Features) FromSerializables(seris serializer.Serializables)
- func (f Features) MustSet() FeatureSet
- func (f Features) Set() (FeatureSet, error)
- func (f Features) Size() int
- func (f Features) ToSerializables() serializer.Serializables
- func (f Features) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type FoundryID
- func (fID FoundryID) Addressable() bool
- func (fID FoundryID) Empty() bool
- func (fID FoundryID) FoundrySerialNumber() uint32
- func (fID FoundryID) Key() interface{}
- func (fID FoundryID) Matches(other ChainID) bool
- func (fID FoundryID) String() string
- func (fID FoundryID) ToAddress() ChainConstrainedAddress
- func (fID FoundryID) ToHex() string
- type FoundryOutput
- func (f *FoundryOutput) Chain() ChainID
- func (f *FoundryOutput) Clone() Output
- func (f *FoundryOutput) Deposit() uint64
- func (f *FoundryOutput) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (f *FoundryOutput) FeatureSet() FeatureSet
- func (f *FoundryOutput) ID() (FoundryID, error)
- func (f *FoundryOutput) Ident() Address
- func (f *FoundryOutput) ImmutableFeatureSet() FeatureSet
- func (f *FoundryOutput) MarshalJSON() ([]byte, error)
- func (f *FoundryOutput) MustID() FoundryID
- func (f *FoundryOutput) MustNativeTokenID() NativeTokenID
- func (f *FoundryOutput) NativeTokenID() (NativeTokenID, error)
- func (f *FoundryOutput) NativeTokenList() NativeTokens
- func (f *FoundryOutput) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (f *FoundryOutput) Size() int
- func (f *FoundryOutput) Type() OutputType
- func (f *FoundryOutput) UnlockConditionSet() UnlockConditionSet
- func (f *FoundryOutput) UnlockableBy(ident Address, extParas *ExternalUnlockParameters) bool
- func (f *FoundryOutput) UnmarshalJSON(bytes []byte) error
- func (f *FoundryOutput) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- func (f *FoundryOutput) ValidateStateTransition(transType ChainTransitionType, next ChainConstrainedOutput, ...) error
- type FoundryOutputs
- type FoundryOutputsSet
- type GovernorAddressUnlockCondition
- func (s *GovernorAddressUnlockCondition) Clone() UnlockCondition
- func (s *GovernorAddressUnlockCondition) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (s *GovernorAddressUnlockCondition) Equal(other UnlockCondition) bool
- func (s *GovernorAddressUnlockCondition) MarshalJSON() ([]byte, error)
- func (s *GovernorAddressUnlockCondition) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (s *GovernorAddressUnlockCondition) Size() int
- func (s *GovernorAddressUnlockCondition) Type() UnlockConditionType
- func (s *GovernorAddressUnlockCondition) UnmarshalJSON(bytes []byte) error
- func (s *GovernorAddressUnlockCondition) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type HexOutputIDs
- type ImmutableAliasUnlockCondition
- func (s *ImmutableAliasUnlockCondition) Clone() UnlockCondition
- func (s *ImmutableAliasUnlockCondition) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (s *ImmutableAliasUnlockCondition) Equal(other UnlockCondition) bool
- func (s *ImmutableAliasUnlockCondition) MarshalJSON() ([]byte, error)
- func (s *ImmutableAliasUnlockCondition) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (s *ImmutableAliasUnlockCondition) Size() int
- func (s *ImmutableAliasUnlockCondition) Type() UnlockConditionType
- func (s *ImmutableAliasUnlockCondition) UnmarshalJSON(bytes []byte) error
- func (s *ImmutableAliasUnlockCondition) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type InMemoryAddressSigner
- type IndexedUTXOReferencer
- type Input
- type InputType
- type Inputs
- type InputsCommitment
- type InputsSyntacticalValidationFunc
- type IssuerFeature
- func (s *IssuerFeature) Clone() Feature
- func (s *IssuerFeature) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (s *IssuerFeature) Equal(other Feature) bool
- func (s *IssuerFeature) MarshalJSON() ([]byte, error)
- func (s *IssuerFeature) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (s *IssuerFeature) Size() int
- func (s *IssuerFeature) Type() FeatureType
- func (s *IssuerFeature) UnmarshalJSON(bytes []byte) error
- func (s *IssuerFeature) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type JSONObjectEnvelope
- type JSONSerializable
- type JSONSerializableSelectorFunc
- type LegacyTailTransactionHash
- type MetadataFeature
- func (s *MetadataFeature) Clone() Feature
- func (s *MetadataFeature) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (s *MetadataFeature) Equal(other Feature) bool
- func (s *MetadataFeature) MarshalJSON() ([]byte, error)
- func (s *MetadataFeature) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (s *MetadataFeature) Size() int
- func (s *MetadataFeature) Type() FeatureType
- func (s *MetadataFeature) UnmarshalJSON(bytes []byte) error
- func (s *MetadataFeature) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type MigratedFundsEntries
- type MigratedFundsEntry
- func (m *MigratedFundsEntry) Clone() *MigratedFundsEntry
- func (m *MigratedFundsEntry) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (m *MigratedFundsEntry) MarshalJSON() ([]byte, error)
- func (m *MigratedFundsEntry) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (m *MigratedFundsEntry) UnmarshalJSON(bytes []byte) error
- type Milestone
- func (m *Milestone) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (m *Milestone) Essence() ([]byte, error)
- func (m *Milestone) ID() (MilestoneID, error)
- func (m *Milestone) MarshalJSON() ([]byte, error)
- func (m *Milestone) MustID() MilestoneID
- func (m *Milestone) PayloadType() PayloadType
- func (m *Milestone) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (m *Milestone) Sign(pubKeys []MilestonePublicKey, signingFunc MilestoneSigningFunc) error
- func (m *Milestone) Size() int
- func (m *Milestone) UnmarshalJSON(bytes []byte) error
- func (m *Milestone) VerifySignatures(minSigThreshold int, applicablePubKeys MilestonePublicKeySet) error
- type MilestoneID
- type MilestoneIndex
- type MilestoneMerkleProof
- type MilestoneOpt
- type MilestoneOptSet
- type MilestoneOptType
- type MilestoneOptTypeSet
- type MilestoneOpts
- type MilestonePublicKey
- type MilestonePublicKeyMapping
- type MilestonePublicKeySet
- type MilestoneSignature
- type MilestoneSigningFunc
- type NFTAddress
- func (nftAddr *NFTAddress) Bech32(hrp NetworkPrefix) string
- func (nftAddr *NFTAddress) Chain() ChainID
- func (nftAddr *NFTAddress) Clone() Address
- func (nftAddr *NFTAddress) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (nftAddr *NFTAddress) Equal(other Address) bool
- func (nftAddr *NFTAddress) Key() string
- func (nftAddr *NFTAddress) MarshalJSON() ([]byte, error)
- func (nftAddr *NFTAddress) NFTID() NFTID
- func (nftAddr *NFTAddress) Serialize(_ serializer.DeSerializationMode, deSeriCtx interface{}) (data []byte, err error)
- func (nftAddr *NFTAddress) Size() int
- func (nftAddr *NFTAddress) String() string
- func (nftAddr *NFTAddress) Type() AddressType
- func (nftAddr *NFTAddress) UnmarshalJSON(bytes []byte) error
- func (nftAddr *NFTAddress) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type NFTID
- func (nftID NFTID) Addressable() bool
- func (nftID NFTID) Empty() bool
- func (nftID NFTID) FromOutputID(id OutputID) ChainID
- func (nftID NFTID) Key() interface{}
- func (nftID NFTID) Matches(other ChainID) bool
- func (nftID NFTID) String() string
- func (nftID NFTID) ToAddress() ChainConstrainedAddress
- func (nftID NFTID) ToHex() string
- type NFTIDs
- type NFTOutput
- func (n *NFTOutput) Chain() ChainID
- func (n *NFTOutput) Clone() Output
- func (n *NFTOutput) Deposit() uint64
- func (n *NFTOutput) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (n *NFTOutput) FeatureSet() FeatureSet
- func (n *NFTOutput) Ident() Address
- func (n *NFTOutput) ImmutableFeatureSet() FeatureSet
- func (n *NFTOutput) MarshalJSON() ([]byte, error)
- func (n *NFTOutput) NativeTokenList() NativeTokens
- func (n *NFTOutput) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (n *NFTOutput) Size() int
- func (n *NFTOutput) Type() OutputType
- func (n *NFTOutput) UnlockConditionSet() UnlockConditionSet
- func (n *NFTOutput) UnlockableBy(ident Address, extParas *ExternalUnlockParameters) bool
- func (n *NFTOutput) UnmarshalJSON(bytes []byte) error
- func (n *NFTOutput) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- func (n *NFTOutput) ValidateStateTransition(transType ChainTransitionType, next ChainConstrainedOutput, ...) error
- type NFTUnlock
- func (r *NFTUnlock) Chainable() bool
- func (r *NFTUnlock) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (r *NFTUnlock) MarshalJSON() ([]byte, error)
- func (r *NFTUnlock) Ref() uint16
- func (r *NFTUnlock) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (r *NFTUnlock) Size() int
- func (r *NFTUnlock) SourceAllowed(address Address) bool
- func (r *NFTUnlock) Type() UnlockType
- func (r *NFTUnlock) UnmarshalJSON(bytes []byte) error
- type NativeToken
- func (n *NativeToken) Clone() *NativeToken
- func (n *NativeToken) Deserialize(data []byte, _ serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (n *NativeToken) Equal(other *NativeToken) bool
- func (n *NativeToken) MarshalJSON() ([]byte, error)
- func (n *NativeToken) Serialize(_ serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (n *NativeToken) Size() int
- func (n *NativeToken) UnmarshalJSON(bytes []byte) error
- func (n *NativeToken) VBytes(_ *RentStructure, _ VBytesFunc) VBytes
- type NativeTokenID
- type NativeTokenSum
- type NativeTokenSumFunc
- type NativeTokens
- func (n NativeTokens) Clone() NativeTokens
- func (n NativeTokens) Equal(other NativeTokens) bool
- func (n *NativeTokens) FromSerializables(seris serializer.Serializables)
- func (n NativeTokens) MustSet() NativeTokensSet
- func (n NativeTokens) Set() (NativeTokensSet, error)
- func (n NativeTokens) Size() int
- func (n NativeTokens) ToSerializables() serializer.Serializables
- func (n NativeTokens) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type NativeTokensSet
- type NetworkID
- type NetworkPrefix
- type NonEphemeralObject
- type Output
- type OutputID
- type OutputIDHex
- type OutputIDs
- type OutputSet
- type OutputType
- type Outputs
- func (outputs Outputs) ChainConstrainedOutputSet(txID TransactionID) ChainConstrainedOutputsSet
- func (outputs Outputs) Commitment() ([]byte, error)
- func (outputs Outputs) Filter(f OutputsFilterFunc) Outputs
- func (outputs *Outputs) FromSerializables(seris serializer.Serializables)
- func (outputs Outputs) MustCommitment() []byte
- func (outputs Outputs) NativeTokenSum() (NativeTokenSum, error)
- func (outputs Outputs) Size() int
- func (outputs Outputs) ToOutputsByType() OutputsByType
- func (outputs Outputs) ToSerializables() serializer.Serializables
- type OutputsByType
- func (outputs OutputsByType) AliasOutputs() AliasOutputs
- func (outputs OutputsByType) BasicOutputs() BasicOutputs
- func (outputs OutputsByType) ChainConstrainedOutputs() ChainConstrainedOutputs
- func (outputs OutputsByType) ChainConstrainedOutputsSet() (ChainConstrainedOutputsSet, error)
- func (outputs OutputsByType) FoundryOutputs() FoundryOutputs
- func (outputs OutputsByType) FoundryOutputsSet() (FoundryOutputsSet, error)
- func (outputs OutputsByType) NonNewAliasOutputsSet() (AliasOutputsSet, error)
- type OutputsFilterFunc
- type OutputsSyntacticalValidationFunc
- func OutputsSyntacticalAlias() OutputsSyntacticalValidationFunc
- func OutputsSyntacticalChainConstrainedOutputUniqueness() OutputsSyntacticalValidationFunc
- func OutputsSyntacticalDepositAmount(protoParas *ProtocolParameters) OutputsSyntacticalValidationFunc
- func OutputsSyntacticalExpirationAndTimelock() OutputsSyntacticalValidationFunc
- func OutputsSyntacticalFoundry() OutputsSyntacticalValidationFunc
- func OutputsSyntacticalNFT() OutputsSyntacticalValidationFunc
- func OutputsSyntacticalNativeTokens() OutputsSyntacticalValidationFunc
- type Payload
- type PayloadType
- type ProtocolParameters
- func (p *ProtocolParameters) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (p ProtocolParameters) MarshalJSON() ([]byte, error)
- func (p ProtocolParameters) NetworkID() NetworkID
- func (p *ProtocolParameters) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (p *ProtocolParameters) UnmarshalJSON(data []byte) error
- type ProtocolParamsMilestoneOpt
- func (p *ProtocolParamsMilestoneOpt) Clone() MilestoneOpt
- func (p *ProtocolParamsMilestoneOpt) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, _ interface{}) (int, error)
- func (p *ProtocolParamsMilestoneOpt) MarshalJSON() ([]byte, error)
- func (p *ProtocolParamsMilestoneOpt) Serialize(deSeriMode serializer.DeSerializationMode, _ interface{}) ([]byte, error)
- func (p *ProtocolParamsMilestoneOpt) Size() int
- func (p *ProtocolParamsMilestoneOpt) Type() MilestoneOptType
- func (p *ProtocolParamsMilestoneOpt) UnmarshalJSON(bytes []byte) error
- type ReceiptBuilder
- type ReceiptMilestoneOpt
- func (r *ReceiptMilestoneOpt) Clone() MilestoneOpt
- func (r *ReceiptMilestoneOpt) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (r *ReceiptMilestoneOpt) MarshalJSON() ([]byte, error)
- func (r *ReceiptMilestoneOpt) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (r *ReceiptMilestoneOpt) Size() int
- func (r *ReceiptMilestoneOpt) SortFunds()
- func (r *ReceiptMilestoneOpt) Sum() uint64
- func (r *ReceiptMilestoneOpt) Treasury() *TreasuryTransaction
- func (r *ReceiptMilestoneOpt) Type() MilestoneOptType
- func (r *ReceiptMilestoneOpt) UnmarshalJSON(bytes []byte) error
- type ReferenceUnlock
- func (r *ReferenceUnlock) Chainable() bool
- func (r *ReferenceUnlock) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (r *ReferenceUnlock) MarshalJSON() ([]byte, error)
- func (r *ReferenceUnlock) Ref() uint16
- func (r *ReferenceUnlock) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (r *ReferenceUnlock) Size() int
- func (r *ReferenceUnlock) SourceAllowed(address Address) bool
- func (r *ReferenceUnlock) Type() UnlockType
- func (r *ReferenceUnlock) UnmarshalJSON(bytes []byte) error
- type ReferentialUnlock
- type RentStructure
- func (r *RentStructure) CoversStateRent(object NonEphemeralObject, rent uint64) (uint64, error)
- func (r *RentStructure) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (r *RentStructure) MarshalJSON() ([]byte, error)
- func (r *RentStructure) MinRent(object NonEphemeralObject) uint64
- func (r *RentStructure) MinStorageDepositForReturnOutput(sender Address) uint64
- func (r *RentStructure) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (r *RentStructure) UnmarshalJSON(data []byte) error
- type SemValiContextWorkingSet
- type SemanticValidationContext
- type SenderFeature
- func (s *SenderFeature) Clone() Feature
- func (s *SenderFeature) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (s *SenderFeature) Equal(other Feature) bool
- func (s *SenderFeature) MarshalJSON() ([]byte, error)
- func (s *SenderFeature) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (s *SenderFeature) Size() int
- func (s *SenderFeature) Type() FeatureType
- func (s *SenderFeature) UnmarshalJSON(bytes []byte) error
- func (s *SenderFeature) VBytes(rentStruct *RentStructure, f VBytesFunc) VBytes
- type Signature
- type SignatureType
- type SignatureTypeSet
- type SignatureUnlock
- func (s *SignatureUnlock) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (s *SignatureUnlock) MarshalJSON() ([]byte, error)
- func (s *SignatureUnlock) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (s *SignatureUnlock) Size() int
- func (s *SignatureUnlock) Type() UnlockType
- func (s *SignatureUnlock) UnmarshalJSON(bytes []byte) error
- type Signatures
- type SimpleTokenScheme
- func (s *SimpleTokenScheme) Clone() TokenScheme
- func (s *SimpleTokenScheme) Deserialize(data []byte, _ serializer.DeSerializationMode, _ interface{}) (int, error)
- func (s *SimpleTokenScheme) MarshalJSON() ([]byte, error)
- func (s *SimpleTokenScheme) Serialize(_ serializer.DeSerializationMode, _ interface{}) ([]byte, error)
- func (s *SimpleTokenScheme) Size() int
- func (s *SimpleTokenScheme) StateTransition(transType ChainTransitionType, nextState TokenScheme, in *big.Int, ...) error
- func (s *SimpleTokenScheme) SyntacticalValidation() error
- func (s *SimpleTokenScheme) Type() TokenSchemeType
- func (s *SimpleTokenScheme) UnmarshalJSON(bytes []byte) error
- func (s *SimpleTokenScheme) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type StateControllerAddressUnlockCondition
- func (s *StateControllerAddressUnlockCondition) Clone() UnlockCondition
- func (s *StateControllerAddressUnlockCondition) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (s *StateControllerAddressUnlockCondition) Equal(other UnlockCondition) bool
- func (s *StateControllerAddressUnlockCondition) MarshalJSON() ([]byte, error)
- func (s *StateControllerAddressUnlockCondition) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (s *StateControllerAddressUnlockCondition) Size() int
- func (s *StateControllerAddressUnlockCondition) Type() UnlockConditionType
- func (s *StateControllerAddressUnlockCondition) UnmarshalJSON(bytes []byte) error
- func (s *StateControllerAddressUnlockCondition) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type StateTransitionValidationFunc
- type StorageDepositReturnUnlockCondition
- func (s *StorageDepositReturnUnlockCondition) Clone() UnlockCondition
- func (s *StorageDepositReturnUnlockCondition) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (s *StorageDepositReturnUnlockCondition) Equal(other UnlockCondition) bool
- func (s *StorageDepositReturnUnlockCondition) MarshalJSON() ([]byte, error)
- func (s *StorageDepositReturnUnlockCondition) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (s *StorageDepositReturnUnlockCondition) Size() int
- func (s *StorageDepositReturnUnlockCondition) Type() UnlockConditionType
- func (s *StorageDepositReturnUnlockCondition) UnmarshalJSON(bytes []byte) error
- func (s *StorageDepositReturnUnlockCondition) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type TagFeature
- func (s *TagFeature) Clone() Feature
- func (s *TagFeature) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (s *TagFeature) Equal(other Feature) bool
- func (s *TagFeature) MarshalJSON() ([]byte, error)
- func (s *TagFeature) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (s *TagFeature) Size() int
- func (s *TagFeature) Type() FeatureType
- func (s *TagFeature) UnmarshalJSON(bytes []byte) error
- func (s *TagFeature) VBytes(rentStruct *RentStructure, f VBytesFunc) VBytes
- type TaggedData
- func (u *TaggedData) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (u *TaggedData) MarshalJSON() ([]byte, error)
- func (u *TaggedData) PayloadType() PayloadType
- func (u *TaggedData) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (u *TaggedData) Size() int
- func (u *TaggedData) UnmarshalJSON(bytes []byte) error
- type TimelockUnlockCondition
- func (s *TimelockUnlockCondition) Clone() UnlockCondition
- func (s *TimelockUnlockCondition) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (s *TimelockUnlockCondition) Equal(other UnlockCondition) bool
- func (s *TimelockUnlockCondition) MarshalJSON() ([]byte, error)
- func (s *TimelockUnlockCondition) Serialize(_ serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (s *TimelockUnlockCondition) Size() int
- func (s *TimelockUnlockCondition) Type() UnlockConditionType
- func (s *TimelockUnlockCondition) UnmarshalJSON(bytes []byte) error
- func (s *TimelockUnlockCondition) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
- type TokenScheme
- type TokenSchemeType
- type TransDepIdentOutput
- type TransIndepIdentOutput
- type Transaction
- func (t *Transaction) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (t *Transaction) ID() (TransactionID, error)
- func (t *Transaction) MarshalJSON() ([]byte, error)
- func (t *Transaction) OutputsSet() (OutputSet, error)
- func (t *Transaction) PayloadType() PayloadType
- func (t *Transaction) SemanticallyValidate(svCtx *SemanticValidationContext, inputs OutputSet, ...) error
- func (t *Transaction) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (t *Transaction) Size() int
- func (t *Transaction) UnmarshalJSON(bytes []byte) error
- type TransactionEssence
- func (u *TransactionEssence) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (u *TransactionEssence) MarshalJSON() ([]byte, error)
- func (u *TransactionEssence) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (data []byte, err error)
- func (u *TransactionEssence) Sign(inputsCommitment []byte, addrKeys ...AddressKeys) ([]Signature, error)
- func (u *TransactionEssence) SigningMessage() ([]byte, error)
- func (u *TransactionEssence) Size() int
- func (u *TransactionEssence) UnmarshalJSON(bytes []byte) error
- type TransactionEssenceType
- type TransactionID
- type TransactionIDs
- type TreasuryInput
- func (ti *TreasuryInput) Clone() *TreasuryInput
- func (ti *TreasuryInput) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (ti *TreasuryInput) MarshalJSON() ([]byte, error)
- func (ti *TreasuryInput) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (data []byte, err error)
- func (ti *TreasuryInput) Size() int
- func (ti *TreasuryInput) Type() InputType
- func (ti *TreasuryInput) UnmarshalJSON(bytes []byte) error
- type TreasuryOutput
- func (t *TreasuryOutput) Clone() Output
- func (t *TreasuryOutput) Deposit() uint64
- func (t *TreasuryOutput) Deserialize(data []byte, _ serializer.DeSerializationMode, _ interface{}) (int, error)
- func (t *TreasuryOutput) FeatureSet() FeatureSet
- func (t *TreasuryOutput) MarshalJSON() ([]byte, error)
- func (t *TreasuryOutput) NativeTokenList() NativeTokens
- func (t *TreasuryOutput) Serialize(_ serializer.DeSerializationMode, _ interface{}) ([]byte, error)
- func (t *TreasuryOutput) Size() int
- func (t *TreasuryOutput) Type() OutputType
- func (t *TreasuryOutput) UnlockConditionSet() UnlockConditionSet
- func (t *TreasuryOutput) UnmarshalJSON(bytes []byte) error
- func (t *TreasuryOutput) VBytes(_ *RentStructure, _ VBytesFunc) VBytes
- type TreasuryTransaction
- func (t *TreasuryTransaction) Clone() *TreasuryTransaction
- func (t *TreasuryTransaction) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (t *TreasuryTransaction) MarshalJSON() ([]byte, error)
- func (t *TreasuryTransaction) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
- func (t *TreasuryTransaction) Size() int
- func (t *TreasuryTransaction) UnmarshalJSON(bytes []byte) error
- type TxSemanticValidationFunc
- func TxSemanticDeposit() TxSemanticValidationFunc
- func TxSemanticInputUnlocks() TxSemanticValidationFunc
- func TxSemanticNativeTokens() TxSemanticValidationFunc
- func TxSemanticOutputsSender() TxSemanticValidationFunc
- func TxSemanticSTVFOnChains() TxSemanticValidationFunc
- func TxSemanticTimelock() TxSemanticValidationFunc
- type UTXOIDChainID
- type UTXOInput
- func (u *UTXOInput) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
- func (u *UTXOInput) Equals(other *UTXOInput) bool
- func (u *UTXOInput) ID() OutputID
- func (u *UTXOInput) Index() uint16
- func (u *UTXOInput) MarshalJSON() ([]byte, error)
- func (u *UTXOInput) Ref() OutputID
- func (u *UTXOInput) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (data []byte, err error)
- func (u *UTXOInput) Size() int
- func (u *UTXOInput) Type() InputType
- func (u *UTXOInput) UnmarshalJSON(bytes []byte) error
- type Unlock
- type UnlockCondition
- type UnlockConditionSet
- func (f UnlockConditionSet) Address() *AddressUnlockCondition
- func (f UnlockConditionSet) Expiration() *ExpirationUnlockCondition
- func (f UnlockConditionSet) GovernorAddress() *GovernorAddressUnlockCondition
- func (f UnlockConditionSet) HasExpirationCondition() bool
- func (f UnlockConditionSet) HasStorageDepositReturnCondition() bool
- func (f UnlockConditionSet) HasTimelockCondition() bool
- func (f UnlockConditionSet) ImmutableAlias() *ImmutableAliasUnlockCondition
- func (f UnlockConditionSet) StateControllerAddress() *StateControllerAddressUnlockCondition
- func (f UnlockConditionSet) StorageDepositReturn() *StorageDepositReturnUnlockCondition
- func (f UnlockConditionSet) Timelock() *TimelockUnlockCondition
- func (f UnlockConditionSet) TimelocksExpired(extParas *ExternalUnlockParameters) error
- type UnlockConditionType
- type UnlockConditions
- func (f UnlockConditions) Clone() UnlockConditions
- func (f *UnlockConditions) FromSerializables(seris serializer.Serializables)
- func (f UnlockConditions) MustSet() UnlockConditionSet
- func (f UnlockConditions) Set() (UnlockConditionSet, error)
- func (f UnlockConditions) Size() int
- func (f UnlockConditions) ToSerializables() serializer.Serializables
- func (f UnlockConditions) VBytes(rentStruct *RentStructure, override VBytesFunc) VBytes
- type UnlockType
- type UnlockValidatorFunc
- type UnlockedIdentities
- func (unlockedIdents UnlockedIdentities) AddUnlockedChain(chainAddr ChainConstrainedAddress, inputIndex uint16)
- func (unlockedIdents UnlockedIdentities) RefUnlock(identKey string, ref uint16, inputIndex uint16) error
- func (unlockedIdents UnlockedIdentities) SigUnlock(ident DirectUnlockableAddress, essence []byte, sig Signature, ...) error
- func (unlockedIdents UnlockedIdentities) String() string
- func (unlockedIdents UnlockedIdentities) UnlockedBy(inputIndex uint16, identKey string) bool
- type UnlockedIdentity
- type Unlocks
- type UnlocksByType
- type VByteCostFactor
- type VBytes
- type VBytesFunc
Constants ¶
const ( // AliasAddressBytesLength is the length of an Alias address. AliasAddressBytesLength = blake2b.Size256 // AliasAddressSerializedBytesSize is the size of a serialized Alias address with its type denoting byte. AliasAddressSerializedBytesSize = serializer.SmallTypeDenotationByteSize + AliasAddressBytesLength )
const ( // Ed25519AddressBytesLength is the length of an Ed25519 address. Ed25519AddressBytesLength = blake2b.Size256 // Ed25519AddressSerializedBytesSize is the size of a serialized Ed25519 address with its type denoting byte. Ed25519AddressSerializedBytesSize = serializer.SmallTypeDenotationByteSize + Ed25519AddressBytesLength )
const ( // NFTAddressBytesLength is the length of an NFT address. NFTAddressBytesLength = blake2b.Size256 // NFTAddressSerializedBytesSize is the size of a serialized NFT address with its type denoting byte. NFTAddressSerializedBytesSize = serializer.SmallTypeDenotationByteSize + NFTAddressBytesLength )
const ( // BlockIDLength defines the length of a block ID. BlockIDLength = blake2b.Size256 // BlockBinSerializedMaxSize defines the maximum size of a block. BlockBinSerializedMaxSize = 32768 // BlockMinParents defines the minimum amount of parents in a block. BlockMinParents = 1 // BlockMaxParents defines the maximum amount of parents in a block. BlockMaxParents = 8 )
const ( // MinMetadataLength defines the min length of the data within a MetadataFeature. MinMetadataLength = 1 // MaxMetadataLength defines the max length of the data within a MetadataFeature. MaxMetadataLength = 8192 )
const ( // MinTagLength defines the min. length of a tag feature tag. MinTagLength = 1 // MaxTagLength defines the max. length of a tag feature tag. MaxTagLength = 64 )
const ( // TreasuryInputBytesLength is the length of a TreasuryInput. TreasuryInputBytesLength = blake2b.Size256 // TreasuryInputSerializedBytesSize is the size of a serialized TreasuryInput with its type denoting byte. TreasuryInputSerializedBytesSize = serializer.SmallTypeDenotationByteSize + TreasuryInputBytesLength )
const ( // RefUTXOIndexMin is the minimum index of a referenced UTXO. RefUTXOIndexMin = 0 // RefUTXOIndexMax is the maximum index of a referenced UTXO. RefUTXOIndexMax = MaxOutputsCount - 1 // UTXOInputSize is the size of a UTXO input: input type + tx id + index. UTXOInputSize = serializer.SmallTypeDenotationByteSize + TransactionIDLength + serializer.UInt16ByteSize )
const ( // MinMigratedFundsEntryDeposit defines the minimum amount a MigratedFundsEntry must deposit. MinMigratedFundsEntryDeposit = 1_000_000 // LegacyTailTransactionHashLength denotes the length of a legacy transaction. LegacyTailTransactionHashLength = 49 // MigratedFundsEntrySerializedBytesSize is the serialized size of a MigratedFundsEntry. MigratedFundsEntrySerializedBytesSize = LegacyTailTransactionHashLength + Ed25519AddressSerializedBytesSize + serializer.UInt64ByteSize )
const ( // MilestoneMerkleProofLength defines the length of a merkle proof within a milestone payload. MilestoneMerkleProofLength = blake2b.Size256 // MilestoneSignatureLength defines the length of the milestone signature. MilestoneSignatureLength = ed25519.SignatureSize // MilestoneIDLength defines the length of a Milestone ID. MilestoneIDLength = blake2b.Size256 // MilestonePublicKeyLength defines the length of a public key within a milestone. MilestonePublicKeyLength = ed25519.PublicKeySize // MaxSignaturesInAMilestone is the maximum amount of signatures in a milestone. MaxSignaturesInAMilestone = 255 // MinSignaturesInAMilestone is the minimum amount of signatures in a milestone. MinSignaturesInAMilestone = 1 )
const ( // MinMigratedFundsEntryCount defines the minimum amount of MigratedFundsEntry items within a ReceiptMilestoneOpt. MinMigratedFundsEntryCount = 1 // MaxMigratedFundsEntryCount defines the maximum amount of MigratedFundsEntry items within a ReceiptMilestoneOpt. MaxMigratedFundsEntryCount = 127 )
const ( // MinNativeTokenCountPerOutput min number of different native tokens that can reside in one output. MinNativeTokenCountPerOutput = 0 // MaxNativeTokenCountPerOutput max number of different native tokens that can reside in one output. MaxNativeTokenCountPerOutput = 64 // MaxNativeTokensCount is the max number of native tokens which can occur in a transaction (sum input/output side). MaxNativeTokensCount = 64 // Uint256ByteSize defines the size of an uint256. Uint256ByteSize = 32 // NativeTokenIDLength is the byte length of a NativeTokenID consisting out of the FoundryID plus TokenTag. NativeTokenIDLength = FoundryIDLength // NativeTokenVByteCost defines the static virtual byte cost of a NativeToken. NativeTokenVByteCost = NativeTokenIDLength + Uint256ByteSize )
const ( // TransactionEssenceNormal denotes a standard transaction essence. TransactionEssenceNormal TransactionEssenceType = 1 // MaxInputsCount defines the maximum amount of inputs within a TransactionEssence. MaxInputsCount = 128 // MinInputsCount defines the minimum amount of inputs within a TransactionEssence. MinInputsCount = 1 // MaxOutputsCount defines the maximum amount of outputs within a TransactionEssence. MaxOutputsCount = 128 // MinOutputsCount defines the minimum amount of inputs within a TransactionEssence. MinOutputsCount = 1 // InputsCommitmentLength defines the length of the inputs commitment hash. InputsCommitmentLength = blake2b.Size256 )
const ( // AliasIDLength is the byte length of an AliasID. AliasIDLength = blake2b.Size256 )
const (
// AliasUnlockSize defines the size of an AliasUnlock.
AliasUnlockSize = serializer.SmallTypeDenotationByteSize + serializer.UInt16ByteSize
)
const ( // Ed25519SignatureSerializedBytesSize defines the size of a serialized Ed25519Signature with its type denoting byte and public key. Ed25519SignatureSerializedBytesSize = serializer.SmallTypeDenotationByteSize + ed25519.PublicKeySize + ed25519.SignatureSize )
const ( // FoundryIDLength is the byte length of a FoundryID consisting out of the alias address, serial number and token scheme. FoundryIDLength = AliasAddressSerializedBytesSize + serializer.UInt32ByteSize + serializer.OneByte )
const (
// MaxParamsLength defines the max length of the data within a ProtocolParamsMilestoneOpt.
MaxParamsLength = 8192
)
const ( // NFTIDLength is the byte length of an NFTID. NFTIDLength = blake2b.Size256 )
const (
// NFTUnlockSize defines the size of an NFTUnlock.
NFTUnlockSize = serializer.SmallTypeDenotationByteSize + serializer.UInt16ByteSize
)
const ( // OutputIDLength defines the length of an OutputID. OutputIDLength = TransactionIDLength + serializer.UInt16ByteSize )
const (
// ReferenceUnlockSize defines the size of a ReferenceUnlock.
ReferenceUnlockSize = serializer.SmallTypeDenotationByteSize + serializer.UInt16ByteSize
)
const (
// TaggedPayloadTagMaxLength defines the max length of the tag within a TaggedData payload.
TaggedPayloadTagMaxLength = 64
)
const ( // TransactionIDLength defines the length of a Transaction ID. TransactionIDLength = blake2b.Size256 )
Variables ¶
var ( // ErrAddressKeysNotMapped gets returned if the needed keys to sign a message are absent/not mapped. ErrAddressKeysNotMapped = errors.New("key(s) for address not mapped") // ErrAddressKeysWrongType gets returned if the specified keys to sign a message for a given address are of the wrong type. ErrAddressKeysWrongType = errors.New("key(s) for address are of wrong type") )
var ( // ErrUnsupportedPayloadType gets returned for unsupported payload types. ErrUnsupportedPayloadType = errors.New("unsupported payload type") // ErrUnsupportedObjectType gets returned for unsupported object types. ErrUnsupportedObjectType = errors.New("unsupported object type") // ErrUnsupportedInputType gets returned for unsupported input types. ErrUnsupportedInputType = errors.New("unsupported input type") // ErrUnsupportedFeatureType gets returned when an unsupported feature exists in a set. ErrUnsupportedFeatureType = errors.New("unsupported feature type") // ErrUnsupportedUnlockConditionType gets returned when an unsupported unlock condition exists in a set. ErrUnsupportedUnlockConditionType = errors.New("unsupported unlock condition type") // ErrUnsupportedMilestoneOptType gets returned when an unsupported milestone option exists in a set. ErrUnsupportedMilestoneOptType = errors.New("unsupported milestone option type") // ErrUnknownPayloadType gets returned for unknown payload types. ErrUnknownPayloadType = errors.New("unknown payload type") // ErrUnknownAddrType gets returned for unknown address types. ErrUnknownAddrType = errors.New("unknown address type") // ErrUnknownFeatureType gets returned for unknown feature types. ErrUnknownFeatureType = errors.New("unknown feature type") // ErrUnknownMilestoneOptType gets returned for unknown milestone options types. ErrUnknownMilestoneOptType = errors.New("unknown milestone option type") // ErrUnknownUnlockConditionType gets returned for unknown unlock condition types. ErrUnknownUnlockConditionType = errors.New("unknown unlock condition type") // ErrUnknownInputType gets returned for unknown input types. ErrUnknownInputType = errors.New("unknown input type") // ErrUnknownOutputType gets returned for unknown output types. ErrUnknownOutputType = errors.New("unknown output type") // ErrUnknownTokenSchemeType gets returned for unknown token scheme types. ErrUnknownTokenSchemeType = errors.New("unknown token scheme type") // ErrUnknownTransactionEssenceType gets returned for unknown transaction essence types. ErrUnknownTransactionEssenceType = errors.New("unknown transaction essence type") // ErrUnknownUnlockType gets returned for unknown unlock. ErrUnknownUnlockType = errors.New("unknown unlock type") // ErrUnknownSignatureType gets returned for unknown signature types. ErrUnknownSignatureType = errors.New("unknown signature type") // ErrDecodeJSONUint256Str gets returned when an uint256 string could not be decoded to a big.int. ErrDecodeJSONUint256Str = errors.New("could not deserialize JSON uint256 string to big.Int") )
var ( // ErrNonUniqueFeatures gets returned when multiple Feature(s) with the same FeatureType exist within sets. ErrNonUniqueFeatures = errors.New("non unique features within outputs") // ErrInvalidFeatureTransition gets returned when a Feature's transition within a ChainConstrainedOutput is invalid. ErrInvalidFeatureTransition = errors.New("invalid feature transition") )
var ( // ErrRefUTXOIndexInvalid gets returned on invalid UTXO indices. ErrRefUTXOIndexInvalid = fmt.Errorf("the referenced UTXO index must be between %d and %d (inclusive)", RefUTXOIndexMin, RefUTXOIndexMax) // ErrTypeIsNotSupportedInput gets returned when a serializable was found to not be a supported Input. ErrTypeIsNotSupportedInput = errors.New("serializable is not a supported input") )
var ( // ErrMilestoneTooFewSignatures gets returned if a to be deserialized Milestone does not contain at least one signature. ErrMilestoneTooFewSignatures = errors.New("a milestone must hold at least one signature") // ErrMilestoneTooFewSignaturesForVerificationThreshold gets returned if there are less signatures within a Milestone than the min. threshold. ErrMilestoneTooFewSignaturesForVerificationThreshold = errors.New("too few signatures for verification") // ErrMilestoneProducedSignaturesCountMismatch gets returned when a MilestoneSigningFunc produces less signatures than expected. ErrMilestoneProducedSignaturesCountMismatch = errors.New("produced and wanted signature count mismatch") // ErrMilestoneTooManySignatures gets returned when a Milestone holds more than 255 signatures. ErrMilestoneTooManySignatures = fmt.Errorf("a milestone can hold max %d signatures", MaxSignaturesInAMilestone) // ErrMilestoneInvalidMinSignatureThreshold gets returned when an invalid min signatures threshold is given to the verification function. ErrMilestoneInvalidMinSignatureThreshold = errors.New("min threshold must be at least 1") // ErrMilestoneNonApplicablePublicKey gets returned when a Milestone contains a public key which isn't in the applicable public key set. ErrMilestoneNonApplicablePublicKey = errors.New("non applicable public key found") // ErrMilestoneSignatureThresholdGreaterThanApplicablePublicKeySet gets returned when a min. signature threshold is greater than a given applicable public key set. ErrMilestoneSignatureThresholdGreaterThanApplicablePublicKeySet = errors.New("the min. signature threshold must be less or equal the applicable public key set") // ErrMilestoneInvalidSignature gets returned when a Milestone's signature is invalid. ErrMilestoneInvalidSignature = errors.New("invalid milestone signature") // ErrMilestoneInMemorySignerPrivateKeyMissing gets returned when an InMemoryEd25519MilestoneSigner is missing a private key. ErrMilestoneInMemorySignerPrivateKeyMissing = errors.New("private key missing") )
var ( // ErrNativeTokenAmountLessThanEqualZero gets returned when a NativeToken.Amount is not bigger than 0. ErrNativeTokenAmountLessThanEqualZero = errors.New("native token must be a value bigger than zero") // ErrNativeTokenSumExceedsUint256 gets returned when a NativeToken.Amount addition results in a value bigger than the max value of a uint256. ErrNativeTokenSumExceedsUint256 = errors.New("native token sum exceeds max value of a uint256") // ErrNonUniqueNativeTokens gets returned when multiple NativeToken(s) with the same NativeTokenID exist within sets. ErrNonUniqueNativeTokens = errors.New("non unique native tokens") // ErrNativeTokenSumUnbalanced gets returned when two NativeTokenSum(s) are unbalanced. ErrNativeTokenSumUnbalanced = errors.New("native token sums are unbalanced") )
var ( // ErrTransDepIdentOutputNonUTXOChainID gets returned when a TransDepIdentOutput has a ChainID which is not a UTXOIDChainID. ErrTransDepIdentOutputNonUTXOChainID = errors.New("transition dependable ident outputs must have UTXO chain IDs") // ErrTransDepIdentOutputNextInvalid gets returned when a TransDepIdentOutput's next state is invalid. ErrTransDepIdentOutputNextInvalid = errors.New("transition dependable ident output's next output is invalid") )
var ( // ErrDepositAmountMustBeGreaterThanZero returned if the deposit amount of an output is less or equal zero. ErrDepositAmountMustBeGreaterThanZero = errors.New("deposit amount must be greater than zero") // ErrChainMissing gets returned when a chain is missing. ErrChainMissing = errors.New("chain missing") // ErrNonUniqueChainConstrainedOutputs gets returned when multiple ChainConstrainedOutputs(s) with the same ChainID exist within sets. ErrNonUniqueChainConstrainedOutputs = errors.New("non unique chain constrained outputs") // ErrTypeIsNotSupportedOutput gets returned when a serializable was found to not be a supported Output. ErrTypeIsNotSupportedOutput = errors.New("serializable is not a supported output") )
var ( // ErrNonUniqueAliasOutputs gets returned when multiple AliasOutputs(s) with the same AliasID exist within sets. ErrNonUniqueAliasOutputs = errors.New("non unique aliases within outputs") // ErrInvalidAliasStateTransition gets returned when an alias is doing an invalid state transition. ErrInvalidAliasStateTransition = errors.New("invalid alias state transition") // ErrInvalidAliasGovernanceTransition gets returned when an alias is doing an invalid governance transition. ErrInvalidAliasGovernanceTransition = errors.New("invalid alias governance transition") // ErrAliasMissing gets returned when an alias is missing. ErrAliasMissing = errors.New("alias is missing") )
var ( // ErrVByteRentNotCovered gets returned when a NonEphemeralObject does not cover the state rent // cost which are calculated from its virtual byte costs. ErrVByteRentNotCovered = errors.New("virtual byte rent costs not covered") // ErrTypeIsNotSupportedRentStructure gets returned when a serializable was found to not be a supported RentStructure. ErrTypeIsNotSupportedRentStructure = errors.New("serializable is not a supported rent structure") )
var ( // ErrEd25519PubKeyAndAddrMismatch gets returned when an Ed25519Address and public key do not correspond to each other. ErrEd25519PubKeyAndAddrMismatch = errors.New("public key and address do not correspond to each other (Ed25519)") // ErrEd25519SignatureInvalid gets returned for invalid an Ed25519Signature. ErrEd25519SignatureInvalid = errors.New("signature is invalid (Ed25519)") )
var ( // ErrSimpleTokenSchemeTransition gets returned when a SimpleTokenScheme transition is invalid. ErrSimpleTokenSchemeTransition = errors.New("simple token scheme transition invalid") // ErrSimpleTokenSchemeInvalidMaximumSupply gets returned when a SimpleTokenScheme's max supply is invalid. ErrSimpleTokenSchemeInvalidMaximumSupply = errors.New("simple token scheme's maximum supply is invalid") // ErrSimpleTokenSchemeInvalidMintedMeltedTokens gets returned when a SimpleTokenScheme's minted supply is invalid. ErrSimpleTokenSchemeInvalidMintedMeltedTokens = errors.New("simple token scheme's minted/melted tokens counters are invalid") )
var ( // ErrMissingUTXO gets returned if an UTXO is missing to commence a certain operation. ErrMissingUTXO = errors.New("missing utxo") // ErrInputOutputSumMismatch gets returned if a transaction does not spend the entirety of the inputs to the outputs. ErrInputOutputSumMismatch = errors.New("inputs and outputs do not spend/deposit the same amount") // ErrSignatureAndAddrIncompatible gets returned if an address of an input has a companion signature unlock with the wrong signature type. ErrSignatureAndAddrIncompatible = errors.New("address and signature type are not compatible") // ErrInvalidInputUnlock gets returned when an input unlock is invalid. ErrInvalidInputUnlock = errors.New("invalid input unlock") // ErrSenderFeatureNotUnlocked gets returned when an output contains a SenderFeature with an ident which is not unlocked. ErrSenderFeatureNotUnlocked = errors.New("sender feature is not unlocked") // ErrIssuerFeatureNotUnlocked gets returned when an output contains a IssuerFeature with an ident which is not unlocked. ErrIssuerFeatureNotUnlocked = errors.New("issuer feature is not unlocked") // ErrReturnAmountNotFulFilled gets returned when a return amount in a transaction is not fulfilled by the output side. ErrReturnAmountNotFulFilled = errors.New("return amount not fulfilled") // ErrTypeIsNotSupportedEssence gets returned when a serializable was found to not be a supported essence. ErrTypeIsNotSupportedEssence = errors.New("serializable is not a supported essence") )
var ( // ErrInvalidInputsCommitment gets returned when the inputs commitment is invalid. ErrInvalidInputsCommitment = errors.New("invalid inputs commitment") // ErrTxEssenceNetworkIDInvalid gets returned when a network ID within a TransactionEssence is invalid. ErrTxEssenceNetworkIDInvalid = errors.New("invalid network ID") // ErrInputUTXORefsNotUnique gets returned if multiple inputs reference the same UTXO. ErrInputUTXORefsNotUnique = errors.New("inputs must each reference a unique UTXO") // ErrAliasOutputNonEmptyState gets returned if an AliasOutput with zeroed AliasID contains state (counters non-zero etc.). ErrAliasOutputNonEmptyState = errors.New("alias output is not empty state") // ErrAliasOutputCyclicAddress gets returned if an AliasOutput's AliasID results into the same address as the State/Governance controller. ErrAliasOutputCyclicAddress = errors.New("alias output's AliasID corresponds to state and/or governance controller") // ErrNFTOutputCyclicAddress gets returned if an NFTOutput's NFTID results into the same address as the address field within the output. ErrNFTOutputCyclicAddress = errors.New("NFT output's ID corresponds to address field") // ErrOutputsSumExceedsTotalSupply gets returned if the sum of the output deposits exceeds the total supply of tokens. ErrOutputsSumExceedsTotalSupply = errors.New("accumulated output balance exceeds total supply") // ErrOutputDepositsMoreThanTotalSupply gets returned if an output deposits more than the total supply. ErrOutputDepositsMoreThanTotalSupply = errors.New("an output can not deposit more than the total supply") // ErrStorageDepositLessThanMinReturnOutputStorageDeposit gets returned when the storage deposit condition's amount is less than the min storage deposit for the return output. ErrStorageDepositLessThanMinReturnOutputStorageDeposit = errors.New("storage deposit return amount is less than the min storage deposit needed for the return output") // ErrStorageDepositExceedsTargetOutputDeposit gets returned when the storage deposit condition's amount exceeds the target output's deposit. ErrStorageDepositExceedsTargetOutputDeposit = errors.New("storage deposit return amount exceeds target output's deposit") // ErrMaxNativeTokensCountExceeded gets returned if outputs or transactions exceed the MaxNativeTokensCount. ErrMaxNativeTokensCountExceeded = errors.New("max native tokens count exceeded") )
var ( // ErrSigUnlockNotUnique gets returned if sig unlocks making part of a transaction aren't unique. ErrSigUnlockNotUnique = errors.New("signature unlock must be unique") // ErrReferentialUnlockInvalid gets returned when a ReferentialUnlock is invalid. ErrReferentialUnlockInvalid = errors.New("invalid referential unlock") // ErrSigUnlockHasNilSig gets returned if a signature unlock contains a nil signature. ErrSigUnlockHasNilSig = errors.New("signature is nil") // ErrTypeIsNotSupportedUnlock gets returned when a serializable was found to not be a supported Unlock. ErrTypeIsNotSupportedUnlock = errors.New("serializable is not a supported unlock") )
var ( // ErrNonUniqueUnlockConditions gets returned when multiple UnlockCondition(s) with the same UnlockConditionType exist within sets. ErrNonUniqueUnlockConditions = errors.New("non unique unlock conditions within outputs") // ErrTimelockNotExpired gets returned when timelocks in a UnlockConditionSet are not expired. ErrTimelockNotExpired = errors.New("timelock not expired") // ErrExpirationConditionZero gets returned when an ExpirationUnlockCondition has set the unix timestamp to zero. ErrExpirationConditionZero = errors.New("expiration condition is zero") // ErrTimelockConditionZero gets returned when a TimelockUnlockCondition has set the unix timestamp to zero. ErrTimelockConditionZero = errors.New("timelock condition is zero") )
var ( // ErrBlockExceedsMaxSize gets returned when a serialized block exceeds BlockBinSerializedMaxSize. ErrBlockExceedsMaxSize = errors.New("block exceeds max size") )
var ( // ErrInvalidJSON gets returned when invalid JSON is tried to get parsed. ErrInvalidJSON = errors.New("invalid json") )
var ( // ErrInvalidReceiptMilestoneOpt gets returned when a ReceiptMilestoneOpt is invalid. ErrInvalidReceiptMilestoneOpt = errors.New("invalid receipt") )
var ( // ErrMissingProtocolParas is returned when ProtocolParameters are missing for operations which require them. ErrMissingProtocolParas = errors.New("missing protocol parameters") )
var ( // ErrNonUniqueFoundryOutputs gets returned when multiple FoundryOutput(s) with the same FoundryID exist within an OutputsByType. ErrNonUniqueFoundryOutputs = errors.New("non unique foundries within outputs") )
var ( // ErrNonUniqueMilestoneOpts gets returned when multiple MilestoneOpt(s) with the same MilestoneOptType exist within sets. ErrNonUniqueMilestoneOpts = errors.New("non unique milestone options") )
var ( // ErrProtocolParamsMilestoneOptInvalid gets returned when a ProtocolParamsMilestoneOpt is invalid. ErrProtocolParamsMilestoneOptInvalid = errors.New("invalid protocol params milestone option") )
var ( // ErrReceiptMustContainATreasuryTransaction gets returned if a ReceiptMilestoneOpt does not contain a TreasuryTransaction. ErrReceiptMustContainATreasuryTransaction = errors.New("receipt must contain a treasury transaction") )
var ( // ErrTaggedDataTagExceedsMaxSize gets returned when a TaggedData payload's tag exceeds TaggedPayloadTagMaxLength. ErrTaggedDataTagExceedsMaxSize = errors.New("tag exceeds max size") )
var ( // ErrTypeIsNotSupportedAddress gets returned when a serializable was found to not be a supported Address. ErrTypeIsNotSupportedAddress = errors.New("serializable is not a supported address") )
var ( // ErrTypeIsNotSupportedMilestoneOpt gets returned when a serializable was found to not be a supported MilestoneOpt. ErrTypeIsNotSupportedMilestoneOpt = errors.New("serializable is not a supported milestone option") )
var ( // ErrTypeIsNotSupportedPayload gets returned when a serializable was found to not be a supported Payload. ErrTypeIsNotSupportedPayload = errors.New("serializable is not a supported payload") )
var ( // ErrTypeIsNotSupportedSignature gets returned when a serializable was found to not be a supported Signature. ErrTypeIsNotSupportedSignature = errors.New("serializable is not a supported signature") )
var ( // ErrTypeIsNotSupportedTokenScheme gets returned when a serializable was found to not be a supported TokenScheme. ErrTypeIsNotSupportedTokenScheme = errors.New("serializable is not a token scheme") )
Functions ¶
func AddressReadGuard ¶
func AddressReadGuard(supportedAddr AddressTypeSet) serializer.SerializableReadGuardFunc
func AddressToJSONRawMsg ¶
func AddressToJSONRawMsg(addr serializer.Serializable) (*json.RawMessage, error)
func AddressWriteGuard ¶
func AddressWriteGuard(supportedAddr AddressTypeSet) serializer.SerializableWriteGuardFunc
checks whether the given Serializable is an Address and also supported AddressType.
func AliasOutputFeaturesArrayRules ¶
func AliasOutputFeaturesArrayRules() serializer.ArrayRules
AliasOutputFeaturesArrayRules returns array rules defining the constraints on Features within an AliasOutput.
func AliasOutputImmutableFeaturesArrayRules ¶
func AliasOutputImmutableFeaturesArrayRules() serializer.ArrayRules
AliasOutputImmutableFeaturesArrayRules returns array rules defining the constraints on immutable Features within an AliasOutput.
func BasicOutputFeaturesArrayRules ¶
func BasicOutputFeaturesArrayRules() serializer.ArrayRules
BasicOutputFeaturesArrayRules returns array rules defining the constraints on Features within an BasicOutput.
func BasicOutputUnlockConditionsArrayRules ¶
func BasicOutputUnlockConditionsArrayRules() serializer.ArrayRules
BasicOutputUnlockConditionsArrayRules returns array rules defining the constraints on UnlockConditions within an BasicOutput.
func BlockParentArrayRules ¶
func BlockParentArrayRules() serializer.ArrayRules
BlockParentArrayRules returns array rules defining the constraints on a slice of block parent references.
func DecodeUint256 ¶
DecodeUint256 decodes the little-endian hex encoded string to an uint256.
func DecodeUint64 ¶
DecodeUint64 decodes the base 10 string to an uint64.
func EncodeHex ¶
EncodeHex encodes the bytes string to a hex string. It always adds the 0x prefix if bytes are not empty.
func EncodeUint256 ¶
EncodeUint256 encodes the uint256 to a little-endian encoded hex string.
func EncodeUint64 ¶
EncodeUint64 encodes the uint64 to a base 10 string.
func FeatureUnchanged ¶
func FeatureUnchanged(featType FeatureType, inFeatSet FeatureSet, outFeatSet FeatureSet) error
FeatureUnchanged checks whether the specified Feature type is unchanged between in and out. Unchanged also means that the block's existence is unchanged between both sets.
func FoundryOutputFeaturesArrayRules ¶
func FoundryOutputFeaturesArrayRules() serializer.ArrayRules
FoundryOutputFeaturesArrayRules returns array rules defining the constraints on Features within an FoundryOutput.
func FoundryOutputImmutableFeaturesArrayRules ¶
func FoundryOutputImmutableFeaturesArrayRules() serializer.ArrayRules
FoundryOutputImmutableFeaturesArrayRules returns array rules defining the constraints on immutable Features within an FoundryOutput.
func IsIssuerOnOutputUnlocked ¶
func IsIssuerOnOutputUnlocked(output ChainConstrainedOutput, unlockedIdents UnlockedIdentities) error
IsIssuerOnOutputUnlocked checks whether the issuer in an IssuerFeature of this new ChainConstrainedOutput has been unlocked. This function is a no-op if the chain output does not contain an IssuerFeature.
func MigratedFundEntriesArrayRules ¶
func MigratedFundEntriesArrayRules() serializer.ArrayRules
MigratedFundEntriesArrayRules returns array rules defining the constraints of a slice of MigratedFundsEntry.
func MilestoneParentArrayRules ¶
func MilestoneParentArrayRules() serializer.ArrayRules
MilestoneParentArrayRules returns array rules defining the constraints on a slice of milestone parent references.
func MilestoneSignatureArrayRules ¶
func MilestoneSignatureArrayRules() serializer.ArrayRules
MilestoneSignatureArrayRules returns array rules defining the constraints on a slice of signatures within a milestone.
func NFTOutputFeaturesArrayRules ¶
func NFTOutputFeaturesArrayRules() serializer.ArrayRules
NFTOutputFeaturesArrayRules returns array rules defining the constraints on Features within an NFTOutput.
func NFTOutputImmutableFeaturesArrayRules ¶
func NFTOutputImmutableFeaturesArrayRules() serializer.ArrayRules
NFTOutputImmutableFeaturesArrayRules returns array rules defining the constraints on immutable Features within an NFTOutput.
func NativeTokenArrayRules ¶
func NativeTokenArrayRules() serializer.ArrayRules
NativeTokenArrayRules returns array rules defining the constraints on a slice of NativeTokens.
func ParseBech32 ¶
func ParseBech32(s string) (NetworkPrefix, Address, error)
ParseBech32 decodes a bech32 encoded string.
func PayloadSelector ¶
PayloadSelector implements SerializableSelectorFunc for payload types.
func SignatureReadGuard ¶
func SignatureReadGuard(supportedSigs SignatureTypeSet) serializer.SerializableReadGuardFunc
func SignatureWriteGuard ¶
func SignatureWriteGuard(supportedSigs SignatureTypeSet) serializer.SerializableWriteGuardFunc
checks whether the given Serializable is a Signature and also supported SignatureType.
func SyntacticallyValidateInputs ¶
func SyntacticallyValidateInputs(inputs Inputs, funcs ...InputsSyntacticalValidationFunc) error
SyntacticallyValidateInputs validates the inputs by running them against the given InputsSyntacticalValidationFunc(s).
func SyntacticallyValidateOutputs ¶
func SyntacticallyValidateOutputs(outputs Outputs, funcs ...OutputsSyntacticalValidationFunc) error
SyntacticallyValidateOutputs validates the outputs by running them against the given OutputsSyntacticalValidationFunc(s).
func TransactionEssenceInputsArrayRules ¶
func TransactionEssenceInputsArrayRules() serializer.ArrayRules
TransactionEssenceInputsArrayRules returns array rules defining the constraints on Inputs within a TransactionEssence.
func TransactionEssenceOutputsArrayRules ¶
func TransactionEssenceOutputsArrayRules() serializer.ArrayRules
TransactionEssenceOutputsArrayRules returns array rules defining the constraints on Outputs within a TransactionEssence.
func TransactionUnlocksArrayRules ¶
func TransactionUnlocksArrayRules() serializer.ArrayRules
TransactionUnlocksArrayRules returns array rules defining the constraints on Unlocks within a Transaction.
func UnlockSelector ¶
UnlockSelector implements SerializableSelectorFunc for unlock types.
func ValidateReceipt ¶
func ValidateReceipt(receipt *ReceiptMilestoneOpt, prevTreasuryOutput *TreasuryOutput, totalSupply uint64) error
ValidateReceipt validates whether given the following receipt:
- None of the MigratedFundsEntry objects deposits more than the max supply and deposits at least MinMigratedFundsEntryDeposit tokens.
- The sum of all migrated fund entries is not bigger than the total supply.
- The previous unspent TreasuryOutput minus the sum of all migrated funds equals the amount of the new TreasuryOutput.
This function panics if the receipt is nil, the receipt does not include any migrated fund entries or the given treasury output is nil.
func ValidateUnlocks ¶
func ValidateUnlocks(unlocks Unlocks, funcs ...UnlockValidatorFunc) error
ValidateUnlocks validates the unlocks by running them against the given UnlockValidatorFunc.
Types ¶
type Address ¶
type Address interface { serializer.SerializableWithSize NonEphemeralObject fmt.Stringer // Type returns the type of the address. Type() AddressType // Bech32 encodes the address as a bech32 string. Bech32(hrp NetworkPrefix) string // Equal checks whether other is equal to this Address. Equal(other Address) bool // Key returns a string which can be used to index the Address in a map. Key() string // Clone clones the Address. Clone() Address }
Address describes a general address.
func AddressFromJSONRawMsg ¶
func AddressFromJSONRawMsg(jRawMsg *json.RawMessage) (Address, error)
func AddressSelector ¶
AddressSelector implements SerializableSelectorFunc for address types.
type AddressKeys ¶
type AddressKeys struct { // The target address. Address Address `json:"address"` // The signing keys. Keys interface{} `json:"keys"` }
AddressKeys pairs an address and its source key(s).
func NewAddressKeysForEd25519Address ¶
func NewAddressKeysForEd25519Address(addr *Ed25519Address, prvKey ed25519.PrivateKey) AddressKeys
NewAddressKeysForEd25519Address returns new AddressKeys for Ed25519Address.
type AddressSigner ¶
type AddressSigner interface { // Sign produces the signature for the given message. Sign(addr Address, msg []byte) (signature Signature, err error) }
AddressSigner produces signatures for messages which get verified against a given address.
func NewInMemoryAddressSigner ¶
func NewInMemoryAddressSigner(addrKeys ...AddressKeys) AddressSigner
NewInMemoryAddressSigner creates a new InMemoryAddressSigner holding the given AddressKeys.
type AddressSignerFunc ¶
type AddressSignerFunc func(addr Address, msg []byte) (signature serializer.Serializable, err error)
AddressSignerFunc implements the AddressSigner interface.
type AddressType ¶
type AddressType byte
AddressType defines the type of addresses.
const ( // AddressEd25519 denotes an Ed25519 address. AddressEd25519 AddressType = 0 // AddressAlias denotes an Alias address. AddressAlias AddressType = 8 // AddressNFT denotes an NFT address. AddressNFT AddressType = 16 )
func (AddressType) String ¶
func (addrType AddressType) String() string
type AddressTypeSet ¶
type AddressTypeSet map[AddressType]struct{}
AddressTypeSet is a set of AddressType.
type AddressUnlockCondition ¶
type AddressUnlockCondition struct {
Address Address
}
AddressUnlockCondition is an UnlockCondition defining an identity which has to be unlocked.
func (*AddressUnlockCondition) Clone ¶
func (s *AddressUnlockCondition) Clone() UnlockCondition
func (*AddressUnlockCondition) Deserialize ¶
func (s *AddressUnlockCondition) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*AddressUnlockCondition) Equal ¶
func (s *AddressUnlockCondition) Equal(other UnlockCondition) bool
func (*AddressUnlockCondition) MarshalJSON ¶
func (s *AddressUnlockCondition) MarshalJSON() ([]byte, error)
func (*AddressUnlockCondition) Serialize ¶
func (s *AddressUnlockCondition) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*AddressUnlockCondition) Size ¶
func (s *AddressUnlockCondition) Size() int
func (*AddressUnlockCondition) Type ¶
func (s *AddressUnlockCondition) Type() UnlockConditionType
func (*AddressUnlockCondition) UnmarshalJSON ¶
func (s *AddressUnlockCondition) UnmarshalJSON(bytes []byte) error
func (*AddressUnlockCondition) VBytes ¶
func (s *AddressUnlockCondition) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type AliasAddress ¶
type AliasAddress [AliasAddressBytesLength]byte
AliasAddress defines an Alias address. An AliasAddress is the Blake2b-256 hash of the OutputID which created it.
func AliasAddressFromOutputID ¶
func AliasAddressFromOutputID(outputID OutputID) AliasAddress
AliasAddressFromOutputID returns the alias address computed from a given OutputID.
func MustParseAliasAddressFromHexString ¶
func MustParseAliasAddressFromHexString(hexAddr string) *AliasAddress
MustParseAliasAddressFromHexString parses the given hex string into an AliasAddress. It panics if the hex address is invalid.
func ParseAliasAddressFromHexString ¶
func ParseAliasAddressFromHexString(hexAddr string) (*AliasAddress, error)
ParseAliasAddressFromHexString parses the given hex string into an AliasAddress.
func (*AliasAddress) AliasID ¶
func (aliasAddr *AliasAddress) AliasID() AliasID
func (*AliasAddress) Bech32 ¶
func (aliasAddr *AliasAddress) Bech32(hrp NetworkPrefix) string
func (*AliasAddress) Chain ¶
func (aliasAddr *AliasAddress) Chain() ChainID
func (*AliasAddress) Clone ¶
func (aliasAddr *AliasAddress) Clone() Address
func (*AliasAddress) Deserialize ¶
func (aliasAddr *AliasAddress) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*AliasAddress) Equal ¶
func (aliasAddr *AliasAddress) Equal(other Address) bool
func (*AliasAddress) Key ¶
func (aliasAddr *AliasAddress) Key() string
func (*AliasAddress) MarshalJSON ¶
func (aliasAddr *AliasAddress) MarshalJSON() ([]byte, error)
func (*AliasAddress) Serialize ¶
func (aliasAddr *AliasAddress) Serialize(_ serializer.DeSerializationMode, deSeriCtx interface{}) (data []byte, err error)
func (*AliasAddress) Size ¶
func (aliasAddr *AliasAddress) Size() int
func (*AliasAddress) String ¶
func (aliasAddr *AliasAddress) String() string
func (*AliasAddress) Type ¶
func (aliasAddr *AliasAddress) Type() AddressType
func (*AliasAddress) UnmarshalJSON ¶
func (aliasAddr *AliasAddress) UnmarshalJSON(bytes []byte) error
func (*AliasAddress) VBytes ¶
func (aliasAddr *AliasAddress) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type AliasID ¶
type AliasID [AliasIDLength]byte
AliasID is the identifier for an alias account. It is computed as the Blake2b-256 hash of the OutputID of the output which created the account.
func AliasIDFromOutputID ¶
AliasIDFromOutputID returns the AliasID computed from a given OutputID.
func (AliasID) Addressable ¶
func (AliasID) FromOutputID ¶
func (AliasID) ToAddress ¶
func (id AliasID) ToAddress() ChainConstrainedAddress
type AliasOutput ¶
type AliasOutput struct { // The amount of IOTA tokens held by the output. Amount uint64 // The native tokens held by the output. NativeTokens NativeTokens // The identifier for this alias account. AliasID AliasID // The index of the state. StateIndex uint32 // The state of the alias account which can only be mutated by the state controller. StateMetadata []byte // The counter that denotes the number of foundries created by this alias account. FoundryCounter uint32 // The unlock conditions on this output. Conditions UnlockConditions // The features on the output. Features Features // The immutable feature on the output. ImmutableFeatures Features }
AliasOutput is an output type which represents an alias account.
func (*AliasOutput) AliasEmpty ¶
func (a *AliasOutput) AliasEmpty() bool
func (*AliasOutput) Chain ¶
func (a *AliasOutput) Chain() ChainID
func (*AliasOutput) Clone ¶
func (a *AliasOutput) Clone() Output
func (*AliasOutput) Deposit ¶
func (a *AliasOutput) Deposit() uint64
func (*AliasOutput) Deserialize ¶
func (a *AliasOutput) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*AliasOutput) FeatureSet ¶
func (a *AliasOutput) FeatureSet() FeatureSet
func (*AliasOutput) GovernanceSTVF ¶
func (a *AliasOutput) GovernanceSTVF(nextAliasOutput *AliasOutput, semValCtx *SemanticValidationContext) error
GovernanceSTVF checks whether the governance transition with other is valid. Under a governance transition, only the StateController, GovernanceController and MetadataFeature can change.
func (*AliasOutput) GovernorAddress ¶
func (a *AliasOutput) GovernorAddress() Address
func (*AliasOutput) Ident ¶
func (a *AliasOutput) Ident(nextState TransDepIdentOutput) (Address, error)
func (*AliasOutput) ImmutableFeatureSet ¶
func (a *AliasOutput) ImmutableFeatureSet() FeatureSet
func (*AliasOutput) MarshalJSON ¶
func (a *AliasOutput) MarshalJSON() ([]byte, error)
func (*AliasOutput) NativeTokenList ¶
func (a *AliasOutput) NativeTokenList() NativeTokens
func (*AliasOutput) Serialize ¶
func (a *AliasOutput) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*AliasOutput) Size ¶
func (a *AliasOutput) Size() int
func (*AliasOutput) StateController ¶
func (a *AliasOutput) StateController() Address
func (*AliasOutput) StateSTVF ¶
func (a *AliasOutput) StateSTVF(nextAliasOutput *AliasOutput, semValCtx *SemanticValidationContext) error
StateSTVF checks whether the state transition with other is valid. Under a state transition, only Amount, NativeTokens, StateIndex, StateMetadata, SenderFeature and FoundryCounter can change.
func (*AliasOutput) Target ¶
func (a *AliasOutput) Target() (serializer.Serializable, error)
func (*AliasOutput) Type ¶
func (a *AliasOutput) Type() OutputType
func (*AliasOutput) UnlockConditionSet ¶
func (a *AliasOutput) UnlockConditionSet() UnlockConditionSet
func (*AliasOutput) UnlockableBy ¶
func (a *AliasOutput) UnlockableBy(ident Address, next TransDepIdentOutput, extParas *ExternalUnlockParameters) (bool, error)
func (*AliasOutput) UnmarshalJSON ¶
func (a *AliasOutput) UnmarshalJSON(bytes []byte) error
func (*AliasOutput) VBytes ¶
func (a *AliasOutput) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
func (*AliasOutput) ValidateStateTransition ¶
func (a *AliasOutput) ValidateStateTransition(transType ChainTransitionType, next ChainConstrainedOutput, semValCtx *SemanticValidationContext) error
- For output AliasOutput(s) with non-zeroed AliasID, there must be a corresponding input AliasOutput where either its AliasID is zeroed and StateIndex and FoundryCounter are zero or an input AliasOutput with the same AliasID.
- On alias state transitions:
- The StateIndex must be incremented by 1
- Only Amount, NativeTokens, StateIndex, StateMetadata and FoundryCounter can be mutated
- On alias governance transition:
- Only StateController (must be mutated), GovernanceController and the MetadataBlock can be mutated
type AliasOutputs ¶
type AliasOutputs []*AliasOutput
AliasOutputs is a slice of AliasOutput(s).
func (AliasOutputs) Every ¶
func (outputs AliasOutputs) Every(f func(output *AliasOutput) bool) int
Every checks whether every element passes f. Returns either -1 if all elements passed f or the index of the first element which didn't.
type AliasOutputsSet ¶
type AliasOutputsSet map[AliasID]*AliasOutput
AliasOutputsSet is a set of AliasOutput(s).
func (AliasOutputsSet) EveryTuple ¶
func (set AliasOutputsSet) EveryTuple(other AliasOutputsSet, f func(in *AliasOutput, out *AliasOutput) error) error
EveryTuple runs f for every key which exists in both this set and other.
func (AliasOutputsSet) Includes ¶
func (set AliasOutputsSet) Includes(other AliasOutputsSet) error
Includes checks whether all aliases included in other exist in this set.
func (AliasOutputsSet) Merge ¶
func (set AliasOutputsSet) Merge(other AliasOutputsSet) (AliasOutputsSet, error)
Merge merges other with this set in a new set. Returns an error if an alias isn't unique across both sets.
type AliasUnlock ¶
type AliasUnlock struct { // The other unlock this AliasUnlock references to. Reference uint16 }
AliasUnlock is an Unlock which references a previous unlock.
func (*AliasUnlock) Chainable ¶
func (r *AliasUnlock) Chainable() bool
func (*AliasUnlock) Deserialize ¶
func (r *AliasUnlock) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*AliasUnlock) MarshalJSON ¶
func (r *AliasUnlock) MarshalJSON() ([]byte, error)
func (*AliasUnlock) Ref ¶
func (r *AliasUnlock) Ref() uint16
func (*AliasUnlock) Serialize ¶
func (r *AliasUnlock) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*AliasUnlock) Size ¶
func (r *AliasUnlock) Size() int
func (*AliasUnlock) SourceAllowed ¶
func (r *AliasUnlock) SourceAllowed(address Address) bool
func (*AliasUnlock) Type ¶
func (r *AliasUnlock) Type() UnlockType
func (*AliasUnlock) UnmarshalJSON ¶
func (r *AliasUnlock) UnmarshalJSON(bytes []byte) error
type BasicOutput ¶
type BasicOutput struct { // The amount of IOTA tokens held by the output. Amount uint64 // The native tokens held by the output. NativeTokens NativeTokens // The unlock conditions on this output. Conditions UnlockConditions // The features on the output. Features Features }
BasicOutput is an output type which can hold native tokens and features.
func (*BasicOutput) Clone ¶
func (e *BasicOutput) Clone() Output
func (*BasicOutput) Deposit ¶
func (e *BasicOutput) Deposit() uint64
func (*BasicOutput) Deserialize ¶
func (e *BasicOutput) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*BasicOutput) FeatureSet ¶
func (e *BasicOutput) FeatureSet() FeatureSet
func (*BasicOutput) Ident ¶
func (e *BasicOutput) Ident() Address
func (*BasicOutput) IsSimpleTransfer ¶
func (e *BasicOutput) IsSimpleTransfer() bool
IsSimpleTransfer tells whether this BasicOutput fulfills the criteria of being a simple transfer.
func (*BasicOutput) MarshalJSON ¶
func (e *BasicOutput) MarshalJSON() ([]byte, error)
func (*BasicOutput) NativeTokenList ¶
func (e *BasicOutput) NativeTokenList() NativeTokens
func (*BasicOutput) Serialize ¶
func (e *BasicOutput) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*BasicOutput) Size ¶
func (e *BasicOutput) Size() int
func (*BasicOutput) Type ¶
func (e *BasicOutput) Type() OutputType
func (*BasicOutput) UnlockConditionSet ¶
func (e *BasicOutput) UnlockConditionSet() UnlockConditionSet
func (*BasicOutput) UnlockableBy ¶
func (e *BasicOutput) UnlockableBy(ident Address, extParas *ExternalUnlockParameters) bool
func (*BasicOutput) UnmarshalJSON ¶
func (e *BasicOutput) UnmarshalJSON(bytes []byte) error
func (*BasicOutput) VBytes ¶
func (e *BasicOutput) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type Block ¶
type Block struct { // The protocol version under which this block operates. ProtocolVersion byte // The parents the block references. Parents BlockIDs // The inner payload of the block. Can be nil. Payload Payload // The nonce which lets this block fulfill the PoW requirements. Nonce uint64 }
Block represents a vertex in the Tangle.
func (*Block) Deserialize ¶
func (*Block) MarshalJSON ¶
func (*Block) UnmarshalJSON ¶
type BlockID ¶
type BlockID [BlockIDLength]byte
BlockID is the ID of a Block.
func BlockIDFromHexString ¶
BlockIDFromHexString converts the given block ID from its hex to BlockID representation.
func MustBlockIDFromHexString ¶
MustBlockIDFromHexString converts the given block ID from its hex to BlockID representation.
func (BlockID) MarshalText ¶
func (*BlockID) UnmarshalText ¶
type BlockIDs ¶
type BlockIDs []BlockID
BlockIDs are IDs of blocks.
func BlockIDsFromHexString ¶
BlockIDsFromHexString converts the given block IDs from their hex to BlockID representation.
func (BlockIDs) RemoveDupsAndSort ¶
RemoveDupsAndSort removes duplicated BlockIDs and sorts the slice by the lexical ordering.
func (BlockIDs) ToSerializerType ¶
func (ids BlockIDs) ToSerializerType() serializer.SliceOfArraysOf32Bytes
type ChainConstrainedAddress ¶
ChainConstrainedAddress is a type of Address representing ownership of an output by a ChainConstrainedOutput.
type ChainConstrainedOutput ¶
type ChainConstrainedOutput interface { Output // Chain returns the ChainID to which this Output belongs to. Chain() ChainID // ValidateStateTransition runs a StateTransitionValidationFunc with next. // Next is nil if transType is ChainTransitionTypeGenesis or ChainTransitionTypeDestroy. ValidateStateTransition(transType ChainTransitionType, next ChainConstrainedOutput, semValCtx *SemanticValidationContext) error // ImmutableFeatureSet returns the immutable FeatureSet this output contains. ImmutableFeatureSet() FeatureSet }
ChainConstrainedOutput is a type of Output which represents a chain of state transitions.
type ChainConstrainedOutputs ¶
type ChainConstrainedOutputs []ChainConstrainedOutput
ChainConstrainedOutputs is a slice of ChainConstrainedOutput.
type ChainConstrainedOutputsSet ¶
type ChainConstrainedOutputsSet map[ChainID]ChainConstrainedOutput
ChainConstrainedOutputsSet is a map of ChainID to ChainConstrainedOutput.
func (ChainConstrainedOutputsSet) EveryTuple ¶
func (set ChainConstrainedOutputsSet) EveryTuple(other ChainConstrainedOutputsSet, f func(in ChainConstrainedOutput, out ChainConstrainedOutput) error) error
EveryTuple runs f for every key which exists in both this set and other.
func (ChainConstrainedOutputsSet) Includes ¶
func (set ChainConstrainedOutputsSet) Includes(other ChainConstrainedOutputsSet) error
Includes checks whether all chains included in other exist in this set.
func (ChainConstrainedOutputsSet) Merge ¶
func (set ChainConstrainedOutputsSet) Merge(other ChainConstrainedOutputsSet) (ChainConstrainedOutputsSet, error)
Merge merges other with this set in a new set. Returns an error if a chain isn't unique across both sets.
type ChainID ¶
type ChainID interface { // Matches checks whether other matches this ChainID. Matches(other ChainID) bool // Addressable tells whether this ChainID can be converted into a ChainConstrainedAddress. Addressable() bool // ToAddress converts this ChainID into an ChainConstrainedAddress. ToAddress() ChainConstrainedAddress // Empty tells whether the ChainID is empty. Empty() bool // Key returns a key to use to index this ChainID. Key() interface{} // ToHex returns the hex representation of the ChainID. ToHex() string }
ChainID represents the chain ID of a chain created by a ChainConstrainedOutput.
type ChainTransitionError ¶
ChainTransitionError gets returned when a state transition validation fails for a ChainConstrainedOutput.
func (*ChainTransitionError) Error ¶
func (i *ChainTransitionError) Error() string
func (*ChainTransitionError) Unwrap ¶
func (i *ChainTransitionError) Unwrap() error
type ChainTransitionType ¶
type ChainTransitionType byte
ChainTransitionType defines the type of transition a ChainConstrainedOutput is doing.
const ( // ChainTransitionTypeGenesis indicates that the chain is in its genesis, aka it is new. ChainTransitionTypeGenesis ChainTransitionType = iota // ChainTransitionTypeStateChange indicates that the chain is state transitioning. ChainTransitionTypeStateChange // ChainTransitionTypeDestroy indicates that the chain is being destroyed. ChainTransitionTypeDestroy )
type DirectUnlockableAddress ¶
type DirectUnlockableAddress interface { Address // Unlock unlocks this DirectUnlockableAddress given the Signature. Unlock(msg []byte, sig Signature) error }
DirectUnlockableAddress is a type of Address which can be directly unlocked.
type Ed25519Address ¶
type Ed25519Address [Ed25519AddressBytesLength]byte
Ed25519Address defines an Ed25519 address. An Ed25519Address is the Blake2b-256 hash of an Ed25519 public key.
func Ed25519AddressFromPubKey ¶
func Ed25519AddressFromPubKey(pubKey ed25519.PublicKey) Ed25519Address
Ed25519AddressFromPubKey returns the address belonging to the given Ed25519 public key.
func MustParseEd25519AddressFromHexString ¶
func MustParseEd25519AddressFromHexString(hexAddr string) *Ed25519Address
MustParseEd25519AddressFromHexString parses the given hex string into an Ed25519Address. It panics if the hex address is invalid.
func ParseEd25519AddressFromHexString ¶
func ParseEd25519AddressFromHexString(hexAddr string) (*Ed25519Address, error)
ParseEd25519AddressFromHexString parses the given hex string into an Ed25519Address.
func (*Ed25519Address) Bech32 ¶
func (edAddr *Ed25519Address) Bech32(hrp NetworkPrefix) string
func (*Ed25519Address) Clone ¶
func (edAddr *Ed25519Address) Clone() Address
func (*Ed25519Address) Deserialize ¶
func (edAddr *Ed25519Address) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*Ed25519Address) Equal ¶
func (edAddr *Ed25519Address) Equal(other Address) bool
func (*Ed25519Address) Key ¶
func (edAddr *Ed25519Address) Key() string
func (*Ed25519Address) MarshalJSON ¶
func (edAddr *Ed25519Address) MarshalJSON() ([]byte, error)
func (*Ed25519Address) Serialize ¶
func (edAddr *Ed25519Address) Serialize(_ serializer.DeSerializationMode, deSeriCtx interface{}) (data []byte, err error)
func (*Ed25519Address) Size ¶
func (edAddr *Ed25519Address) Size() int
func (*Ed25519Address) String ¶
func (edAddr *Ed25519Address) String() string
func (*Ed25519Address) Type ¶
func (edAddr *Ed25519Address) Type() AddressType
func (*Ed25519Address) Unlock ¶
func (edAddr *Ed25519Address) Unlock(msg []byte, sig Signature) error
func (*Ed25519Address) UnmarshalJSON ¶
func (edAddr *Ed25519Address) UnmarshalJSON(bytes []byte) error
func (*Ed25519Address) VBytes ¶
func (edAddr *Ed25519Address) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type Ed25519Signature ¶
type Ed25519Signature struct { // The public key used to verify the given signature. PublicKey [ed25519.PublicKeySize]byte // The signature. Signature [ed25519.SignatureSize]byte }
Ed25519Signature defines an Ed25519 signature.
func (*Ed25519Signature) Deserialize ¶
func (e *Ed25519Signature) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*Ed25519Signature) MarshalJSON ¶
func (e *Ed25519Signature) MarshalJSON() ([]byte, error)
func (*Ed25519Signature) Serialize ¶
func (e *Ed25519Signature) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*Ed25519Signature) Size ¶
func (e *Ed25519Signature) Size() int
func (*Ed25519Signature) String ¶
func (e *Ed25519Signature) String() string
func (*Ed25519Signature) Type ¶
func (e *Ed25519Signature) Type() SignatureType
func (*Ed25519Signature) UnmarshalJSON ¶
func (e *Ed25519Signature) UnmarshalJSON(bytes []byte) error
func (*Ed25519Signature) Valid ¶
func (e *Ed25519Signature) Valid(msg []byte, addr *Ed25519Address) error
Valid verifies whether given the message and Ed25519 address, the signature is valid.
type ExpirationUnlockCondition ¶
type ExpirationUnlockCondition struct { // The identity who is allowed to use the output after the expiration has happened. ReturnAddress Address // The unix time in second resolution at which the expiration happens. UnixTime uint32 }
ExpirationUnlockCondition is an unlock condition which puts a time constraint on whether the receiver or return identity can consume an output depending on the latest confirmed milestone's timestamp T:
- only the receiver identity can consume the output, if T is before than the one defined in the condition.
- only the return identity can consume the output, if T is at the same time or after the one defined in the condition.
func (*ExpirationUnlockCondition) Clone ¶
func (s *ExpirationUnlockCondition) Clone() UnlockCondition
func (*ExpirationUnlockCondition) Deserialize ¶
func (s *ExpirationUnlockCondition) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*ExpirationUnlockCondition) Equal ¶
func (s *ExpirationUnlockCondition) Equal(other UnlockCondition) bool
func (*ExpirationUnlockCondition) MarshalJSON ¶
func (s *ExpirationUnlockCondition) MarshalJSON() ([]byte, error)
func (*ExpirationUnlockCondition) Serialize ¶
func (s *ExpirationUnlockCondition) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*ExpirationUnlockCondition) Size ¶
func (s *ExpirationUnlockCondition) Size() int
func (*ExpirationUnlockCondition) Type ¶
func (s *ExpirationUnlockCondition) Type() UnlockConditionType
func (*ExpirationUnlockCondition) UnmarshalJSON ¶
func (s *ExpirationUnlockCondition) UnmarshalJSON(bytes []byte) error
func (*ExpirationUnlockCondition) VBytes ¶
func (s *ExpirationUnlockCondition) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type ExternalUnlockParameters ¶
type ExternalUnlockParameters struct { // The confirmed unix epoch time in seconds. ConfUnix uint32 }
ExternalUnlockParameters defines a palette of external system parameters which are used to determine whether an Output can be unlocked.
type Feature ¶
type Feature interface { serializer.SerializableWithSize NonEphemeralObject // Type returns the type of the Feature. Type() FeatureType // Equal tells whether this Feature is equal to other. Equal(other Feature) bool // Clone clones the Feature. Clone() Feature }
Feature is an abstract building block extending the features of an Output.
func FeatureSelector ¶
FeatureSelector implements SerializableSelectorFunc for features.
type FeatureSet ¶
type FeatureSet map[FeatureType]Feature
FeatureSet is a set of Feature(s).
func (FeatureSet) EveryTuple ¶
func (f FeatureSet) EveryTuple(other FeatureSet, fun func(a Feature, b Feature) error) (bool, error)
EveryTuple runs f for every key which exists in both this set and other. Returns a bool indicating whether all element of this set existed on the other set.
func (FeatureSet) IssuerFeature ¶
func (f FeatureSet) IssuerFeature() *IssuerFeature
IssuerFeature returns the IssuerFeature in the set or nil.
func (FeatureSet) MetadataFeature ¶
func (f FeatureSet) MetadataFeature() *MetadataFeature
MetadataFeature returns the MetadataFeature in the set or nil.
func (FeatureSet) SenderFeature ¶
func (f FeatureSet) SenderFeature() *SenderFeature
SenderFeature returns the SenderFeature in the set or nil.
func (FeatureSet) TagFeature ¶
func (f FeatureSet) TagFeature() *TagFeature
TagFeature returns the TagFeature in the set or nil.
type FeatureSetTransitionValidationFunc ¶
type FeatureSetTransitionValidationFunc func(inSet FeatureSet, outSet FeatureSet) error
FeatureSetTransitionValidationFunc checks whether the Features transition from in to out is valid.
type FeatureType ¶
type FeatureType byte
FeatureType defines the type of features.
const ( // FeatureSender denotes a SenderFeature. FeatureSender FeatureType = iota // FeatureIssuer denotes an IssuerFeature. FeatureIssuer // FeatureMetadata denotes a MetadataFeature. FeatureMetadata // FeatureTag denotes a TagFeature. FeatureTag )
func (FeatureType) String ¶
func (featType FeatureType) String() string
type Features ¶
type Features []Feature
Features is a slice of Feature(s).
func (*Features) FromSerializables ¶
func (f *Features) FromSerializables(seris serializer.Serializables)
func (Features) MustSet ¶
func (f Features) MustSet() FeatureSet
MustSet works like Set but panics if an error occurs. This function is therefore only safe to be called when it is given, that a Features slice does not contain the same FeatureType multiple times.
func (Features) Set ¶
func (f Features) Set() (FeatureSet, error)
Set converts the slice into a FeatureSet. Returns an error if a FeatureType occurs multiple times.
func (Features) ToSerializables ¶
func (f Features) ToSerializables() serializer.Serializables
func (Features) VBytes ¶
func (f Features) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type FoundryID ¶
type FoundryID [FoundryIDLength]byte
FoundryID defines the identifier for a foundry consisting out of the address, serial number and TokenScheme.
func (FoundryID) Addressable ¶
func (FoundryID) FoundrySerialNumber ¶
FoundrySerialNumber returns the serial number of the foundry.
func (FoundryID) ToAddress ¶
func (fID FoundryID) ToAddress() ChainConstrainedAddress
type FoundryOutput ¶
type FoundryOutput struct { // The amount of IOTA tokens held by the output. Amount uint64 // The native tokens held by the output. NativeTokens NativeTokens // The serial number of the foundry. SerialNumber uint32 // The token scheme this foundry uses. TokenScheme TokenScheme // The unlock conditions on this output. Conditions UnlockConditions // The feature on the output. Features Features // The immutable feature on the output. ImmutableFeatures Features }
FoundryOutput is an output type which controls the supply of user defined native tokens.
func (*FoundryOutput) Chain ¶
func (f *FoundryOutput) Chain() ChainID
func (*FoundryOutput) Clone ¶
func (f *FoundryOutput) Clone() Output
func (*FoundryOutput) Deposit ¶
func (f *FoundryOutput) Deposit() uint64
func (*FoundryOutput) Deserialize ¶
func (f *FoundryOutput) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*FoundryOutput) FeatureSet ¶
func (f *FoundryOutput) FeatureSet() FeatureSet
func (*FoundryOutput) ID ¶
func (f *FoundryOutput) ID() (FoundryID, error)
ID returns the FoundryID of this FoundryOutput.
func (*FoundryOutput) Ident ¶
func (f *FoundryOutput) Ident() Address
func (*FoundryOutput) ImmutableFeatureSet ¶
func (f *FoundryOutput) ImmutableFeatureSet() FeatureSet
func (*FoundryOutput) MarshalJSON ¶
func (f *FoundryOutput) MarshalJSON() ([]byte, error)
func (*FoundryOutput) MustID ¶
func (f *FoundryOutput) MustID() FoundryID
MustID works like ID but panics if an error occurs.
func (*FoundryOutput) MustNativeTokenID ¶
func (f *FoundryOutput) MustNativeTokenID() NativeTokenID
MustNativeTokenID works like NativeTokenID but panics if there is an error.
func (*FoundryOutput) NativeTokenID ¶
func (f *FoundryOutput) NativeTokenID() (NativeTokenID, error)
NativeTokenID returns the NativeTokenID this FoundryOutput operates on.
func (*FoundryOutput) NativeTokenList ¶
func (f *FoundryOutput) NativeTokenList() NativeTokens
func (*FoundryOutput) Serialize ¶
func (f *FoundryOutput) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*FoundryOutput) Size ¶
func (f *FoundryOutput) Size() int
func (*FoundryOutput) Type ¶
func (f *FoundryOutput) Type() OutputType
func (*FoundryOutput) UnlockConditionSet ¶
func (f *FoundryOutput) UnlockConditionSet() UnlockConditionSet
func (*FoundryOutput) UnlockableBy ¶
func (f *FoundryOutput) UnlockableBy(ident Address, extParas *ExternalUnlockParameters) bool
func (*FoundryOutput) UnmarshalJSON ¶
func (f *FoundryOutput) UnmarshalJSON(bytes []byte) error
func (*FoundryOutput) VBytes ¶
func (f *FoundryOutput) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
func (*FoundryOutput) ValidateStateTransition ¶
func (f *FoundryOutput) ValidateStateTransition(transType ChainTransitionType, next ChainConstrainedOutput, semValCtx *SemanticValidationContext) error
type FoundryOutputs ¶
type FoundryOutputs []*FoundryOutput
FoundryOutputs is a slice of FoundryOutput(s).
type FoundryOutputsSet ¶
type FoundryOutputsSet map[FoundryID]*FoundryOutput
FoundryOutputsSet is a set of FoundryOutput(s).
type GovernorAddressUnlockCondition ¶
type GovernorAddressUnlockCondition struct {
Address Address
}
GovernorAddressUnlockCondition is an UnlockCondition defining the governor identity for an AliasOutput.
func (*GovernorAddressUnlockCondition) Clone ¶
func (s *GovernorAddressUnlockCondition) Clone() UnlockCondition
func (*GovernorAddressUnlockCondition) Deserialize ¶
func (s *GovernorAddressUnlockCondition) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*GovernorAddressUnlockCondition) Equal ¶
func (s *GovernorAddressUnlockCondition) Equal(other UnlockCondition) bool
func (*GovernorAddressUnlockCondition) MarshalJSON ¶
func (s *GovernorAddressUnlockCondition) MarshalJSON() ([]byte, error)
func (*GovernorAddressUnlockCondition) Serialize ¶
func (s *GovernorAddressUnlockCondition) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*GovernorAddressUnlockCondition) Size ¶
func (s *GovernorAddressUnlockCondition) Size() int
func (*GovernorAddressUnlockCondition) Type ¶
func (s *GovernorAddressUnlockCondition) Type() UnlockConditionType
func (*GovernorAddressUnlockCondition) UnmarshalJSON ¶
func (s *GovernorAddressUnlockCondition) UnmarshalJSON(bytes []byte) error
func (*GovernorAddressUnlockCondition) VBytes ¶
func (s *GovernorAddressUnlockCondition) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type HexOutputIDs ¶
type HexOutputIDs []string
HexOutputIDs is a slice of hex encoded OutputID strings.
func (HexOutputIDs) MustOutputIDs ¶
func (ids HexOutputIDs) MustOutputIDs() OutputIDs
MustOutputIDs converts the hex strings into OutputIDs.
func (HexOutputIDs) OutputIDs ¶
func (ids HexOutputIDs) OutputIDs() (OutputIDs, error)
OutputIDs converts the hex strings into OutputIDs.
type ImmutableAliasUnlockCondition ¶
type ImmutableAliasUnlockCondition struct {
Address *AliasAddress
}
ImmutableAliasUnlockCondition is an UnlockCondition defining an alias which has to be unlocked. Unlike the AddressUnlockCondition, this unlock condition is immutable for an output which contains it, meaning it also only applies to ChainConstrainedOutput(s).
func (*ImmutableAliasUnlockCondition) Clone ¶
func (s *ImmutableAliasUnlockCondition) Clone() UnlockCondition
func (*ImmutableAliasUnlockCondition) Deserialize ¶
func (s *ImmutableAliasUnlockCondition) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*ImmutableAliasUnlockCondition) Equal ¶
func (s *ImmutableAliasUnlockCondition) Equal(other UnlockCondition) bool
func (*ImmutableAliasUnlockCondition) MarshalJSON ¶
func (s *ImmutableAliasUnlockCondition) MarshalJSON() ([]byte, error)
func (*ImmutableAliasUnlockCondition) Serialize ¶
func (s *ImmutableAliasUnlockCondition) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*ImmutableAliasUnlockCondition) Size ¶
func (s *ImmutableAliasUnlockCondition) Size() int
func (*ImmutableAliasUnlockCondition) Type ¶
func (s *ImmutableAliasUnlockCondition) Type() UnlockConditionType
func (*ImmutableAliasUnlockCondition) UnmarshalJSON ¶
func (s *ImmutableAliasUnlockCondition) UnmarshalJSON(bytes []byte) error
func (*ImmutableAliasUnlockCondition) VBytes ¶
func (s *ImmutableAliasUnlockCondition) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type InMemoryAddressSigner ¶
type InMemoryAddressSigner struct {
// contains filtered or unexported fields
}
InMemoryAddressSigner implements AddressSigner by holding keys simply in-memory.
type IndexedUTXOReferencer ¶
type IndexedUTXOReferencer interface { Input // Ref returns the UTXO this Input references. Ref() OutputID // Index returns the output index of the UTXO this Input references. Index() uint16 }
IndexedUTXOReferencer is a type of Input which references a UTXO by the transaction ID and output index.
type Input ¶
type Input interface { serializer.SerializableWithSize // Type returns the type of Input. Type() InputType }
Input references a UTXO.
func InputSelector ¶
InputSelector implements SerializableSelectorFunc for input types.
type Inputs ¶
type Inputs []Input
Inputs a slice of Input.
func (*Inputs) FromSerializables ¶
func (in *Inputs) FromSerializables(seris serializer.Serializables)
func (Inputs) ToSerializables ¶
func (in Inputs) ToSerializables() serializer.Serializables
type InputsCommitment ¶
type InputsCommitment = [InputsCommitmentLength]byte
InputsCommitment is a commitment to the inputs of a transaction.
type InputsSyntacticalValidationFunc ¶
InputsSyntacticalValidationFunc which given the index of an input and the input itself, runs syntactical validations and returns an error if any should fail.
func InputsSyntacticalIndicesWithinBounds ¶
func InputsSyntacticalIndicesWithinBounds() InputsSyntacticalValidationFunc
InputsSyntacticalIndicesWithinBounds returns an InputsSyntacticalValidationFunc which checks that the UTXO ref index is within bounds.
func InputsSyntacticalUnique ¶
func InputsSyntacticalUnique() InputsSyntacticalValidationFunc
InputsSyntacticalUnique returns an InputsSyntacticalValidationFunc which checks that every input has a unique UTXO ref.
type IssuerFeature ¶
type IssuerFeature struct {
Address Address
}
IssuerFeature is a feature which associates an output with an issuer identity. Unlike the SenderFeature, the issuer identity only has to be unlocked when the ChainConstrainedOutput is first created, afterwards, the issuer feature must not change, meaning that subsequent outputs must always define the same issuer identity (the identity does not need to be unlocked anymore though).
func (*IssuerFeature) Clone ¶
func (s *IssuerFeature) Clone() Feature
func (*IssuerFeature) Deserialize ¶
func (s *IssuerFeature) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*IssuerFeature) Equal ¶
func (s *IssuerFeature) Equal(other Feature) bool
func (*IssuerFeature) MarshalJSON ¶
func (s *IssuerFeature) MarshalJSON() ([]byte, error)
func (*IssuerFeature) Serialize ¶
func (s *IssuerFeature) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*IssuerFeature) Size ¶
func (s *IssuerFeature) Size() int
func (*IssuerFeature) Type ¶
func (s *IssuerFeature) Type() FeatureType
func (*IssuerFeature) UnmarshalJSON ¶
func (s *IssuerFeature) UnmarshalJSON(bytes []byte) error
func (*IssuerFeature) VBytes ¶
func (s *IssuerFeature) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type JSONObjectEnvelope ¶
type JSONObjectEnvelope struct {
Type int `json:"type"`
}
JSONObjectEnvelope defines the envelope for looking-ahead an object's type before deserializing it to its actual object.
type JSONSerializable ¶
type JSONSerializable interface { // ToSerializable returns the Serializable form of the JSONSerializable. ToSerializable() (serializer.Serializable, error) }
JSONSerializable is an object which can return a Serializable.
func DeserializeObjectFromJSON ¶
func DeserializeObjectFromJSON(raw *json.RawMessage, selector JSONSerializableSelectorFunc) (JSONSerializable, error)
DeserializeObjectFromJSON reads out the type of the given raw json message, then selects the appropriate object type and deserializes the given *json.RawMessage into it.
func JsonOutputSelector ¶
func JsonOutputSelector(ty int) (JSONSerializable, error)
JsonOutputSelector selects the json output implementation for the given type.
type JSONSerializableSelectorFunc ¶
type JSONSerializableSelectorFunc func(ty int) (JSONSerializable, error)
JSONSerializableSelectorFunc is a function that given a type int, returns an empty instance of the given underlying type. If the type doesn't resolve, an error is returned.
type LegacyTailTransactionHash ¶
type LegacyTailTransactionHash = [49]byte
LegacyTailTransactionHash represents the bytes of a T5B1 encoded legacy tail transaction hash.
type MetadataFeature ¶
type MetadataFeature struct {
Data []byte
}
MetadataFeature is a feature which simply holds binary data to be freely interpreted by higher layer applications.
func (*MetadataFeature) Clone ¶
func (s *MetadataFeature) Clone() Feature
func (*MetadataFeature) Deserialize ¶
func (s *MetadataFeature) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*MetadataFeature) Equal ¶
func (s *MetadataFeature) Equal(other Feature) bool
func (*MetadataFeature) MarshalJSON ¶
func (s *MetadataFeature) MarshalJSON() ([]byte, error)
func (*MetadataFeature) Serialize ¶
func (s *MetadataFeature) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*MetadataFeature) Size ¶
func (s *MetadataFeature) Size() int
func (*MetadataFeature) Type ¶
func (s *MetadataFeature) Type() FeatureType
func (*MetadataFeature) UnmarshalJSON ¶
func (s *MetadataFeature) UnmarshalJSON(bytes []byte) error
func (*MetadataFeature) VBytes ¶
func (s *MetadataFeature) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type MigratedFundsEntries ¶
type MigratedFundsEntries []*MigratedFundsEntry
MigratedFundsEntries is a slice of MigratedFundsEntry.
func (MigratedFundsEntries) Clone ¶
func (o MigratedFundsEntries) Clone() MigratedFundsEntries
func (*MigratedFundsEntries) FromSerializables ¶
func (o *MigratedFundsEntries) FromSerializables(seris serializer.Serializables)
func (MigratedFundsEntries) Size ¶
func (o MigratedFundsEntries) Size() int
func (MigratedFundsEntries) ToSerializables ¶
func (o MigratedFundsEntries) ToSerializables() serializer.Serializables
type MigratedFundsEntry ¶
type MigratedFundsEntry struct { // The tail transaction hash of the migration bundle. TailTransactionHash LegacyTailTransactionHash // The target address of the migrated funds. Address Address // The amount of the deposit. Deposit uint64 }
MigratedFundsEntry are funds which were migrated from a legacy network.
func (*MigratedFundsEntry) Clone ¶
func (m *MigratedFundsEntry) Clone() *MigratedFundsEntry
func (*MigratedFundsEntry) Deserialize ¶
func (m *MigratedFundsEntry) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*MigratedFundsEntry) MarshalJSON ¶
func (m *MigratedFundsEntry) MarshalJSON() ([]byte, error)
func (*MigratedFundsEntry) Serialize ¶
func (m *MigratedFundsEntry) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*MigratedFundsEntry) UnmarshalJSON ¶
func (m *MigratedFundsEntry) UnmarshalJSON(bytes []byte) error
type Milestone ¶
type Milestone struct { // The index of this milestone. Index MilestoneIndex // The time at which this milestone was issued. Timestamp uint32 // The protocol version under which this milestone operates. ProtocolVersion byte // The pointer to the previous milestone. // Zeroed if there wasn't a previous milestone. PreviousMilestoneID MilestoneID // The parents where this milestone attaches to. Parents BlockIDs // The merkle root of all directly/indirectly referenced blocks (their IDs) which // were newly included by this milestone. InclusionMerkleRoot MilestoneMerkleProof // The merkle root of all blocks (their IDs) carrying ledger state mutating transactions. AppliedMerkleRoot MilestoneMerkleProof // The metadata associated with this milestone. Metadata []byte // The milestone options carried with this milestone. Opts MilestoneOpts // The signatures held by the milestone. Signatures Signatures }
Milestone represents a special payload which defines the inclusion set of other blocks in the Tangle.
func NewMilestone ¶
func NewMilestone(index MilestoneIndex, timestamp uint32, protocolVersion byte, prevMsID MilestoneID, parents BlockIDs, inclMerkleProof MilestoneMerkleProof, appliedMerkleRoot MilestoneMerkleProof) *Milestone
NewMilestone creates a new unsigned Milestone.
func (*Milestone) Deserialize ¶
func (*Milestone) Essence ¶
Essence returns the essence bytes (the bytes to be signed) of the Milestone.
func (*Milestone) ID ¶
func (m *Milestone) ID() (MilestoneID, error)
ID computes the ID of the Milestone.
func (*Milestone) MarshalJSON ¶
func (*Milestone) MustID ¶
func (m *Milestone) MustID() MilestoneID
MustID works like ID but panics if there is an error.
func (*Milestone) PayloadType ¶
func (m *Milestone) PayloadType() PayloadType
func (*Milestone) Sign ¶
func (m *Milestone) Sign(pubKeys []MilestonePublicKey, signingFunc MilestoneSigningFunc) error
Sign produces the signatures with the given envelope block and updates the Signatures field of the Milestone with the resulting signatures of the given MilestoneSigningFunc. pubKeys are passed to the given MilestoneSigningFunc so it can determine which signatures to produce.
func (*Milestone) UnmarshalJSON ¶
func (*Milestone) VerifySignatures ¶
func (m *Milestone) VerifySignatures(minSigThreshold int, applicablePubKeys MilestonePublicKeySet) error
VerifySignatures verifies that min. minSigThreshold signatures occur in the Milestone and that all signatures within it are valid with respect to the given applicable public key set. The public key set must only contain keys applicable for the given Milestone index. The caller must only call this function on a Milestone which was deserialized with validation.
type MilestoneID ¶
type MilestoneID [MilestoneIDLength]byte
MilestoneID is the ID of a Milestone.
func (MilestoneID) Empty ¶
func (id MilestoneID) Empty() bool
Empty tells whether the MilestoneID is empty.
func (MilestoneID) MarshalText ¶
func (id MilestoneID) MarshalText() (text []byte, err error)
func (*MilestoneID) String ¶
func (id *MilestoneID) String() string
func (MilestoneID) ToHex ¶
func (id MilestoneID) ToHex() string
ToHex converts the given milestone ID to their hex representation.
func (*MilestoneID) UnmarshalText ¶
func (id *MilestoneID) UnmarshalText(text []byte) error
type MilestoneMerkleProof ¶
type MilestoneMerkleProof = [MilestoneMerkleProofLength]byte
MilestoneMerkleProof is the merkle root within a milestone.
type MilestoneOpt ¶
type MilestoneOpt interface { serializer.SerializableWithSize // Type returns the type of the MilestoneOpt. Type() MilestoneOptType // Clone clones the MilestoneOpt. Clone() MilestoneOpt }
MilestoneOpt is an object carried within a Milestone.
func MilestoneOptSelector ¶
func MilestoneOptSelector(msOptType uint32) (MilestoneOpt, error)
MilestoneOptSelector implements SerializableSelectorFunc for milestone options.
type MilestoneOptSet ¶
type MilestoneOptSet map[MilestoneOptType]MilestoneOpt
MilestoneOptSet is a set of MilestoneOpt(s).
func (MilestoneOptSet) Clone ¶
func (set MilestoneOptSet) Clone() MilestoneOptSet
Clone clones the FeatureSet.
func (MilestoneOptSet) ProtocolParams ¶
func (set MilestoneOptSet) ProtocolParams() *ProtocolParamsMilestoneOpt
ProtocolParams returns the ProtocolParamsMilestoneOpt in the set or nil.
func (MilestoneOptSet) Receipt ¶
func (set MilestoneOptSet) Receipt() *ReceiptMilestoneOpt
Receipt returns the ReceiptMilestoneOpt in the set or nil.
type MilestoneOptType ¶
type MilestoneOptType byte
MilestoneOptType defines the type of milestone options.
const ( // MilestoneOptReceipt denotes a ReceiptMilestoneOpt milestone option. MilestoneOptReceipt MilestoneOptType = 0 // MilestoneOptProtocolParams denotes a ProtocolParams milestone option. MilestoneOptProtocolParams MilestoneOptType = 1 )
func (MilestoneOptType) String ¶
func (msOptType MilestoneOptType) String() string
type MilestoneOptTypeSet ¶
type MilestoneOptTypeSet map[MilestoneOptType]struct{}
MilestoneOptTypeSet is a set of MilestoneOptType.
type MilestoneOpts ¶
type MilestoneOpts []MilestoneOpt
MilestoneOpts is a slice of MilestoneOpt(s).
func (*MilestoneOpts) FromSerializables ¶
func (m *MilestoneOpts) FromSerializables(seris serializer.Serializables)
func (MilestoneOpts) MustSet ¶
func (m MilestoneOpts) MustSet() MilestoneOptSet
MustSet works like Set but panics if an error occurs. This function is therefore only safe to be called when it is given, that a MilestoneOpts slice does not contain the same MilestoneOptType multiple times.
func (MilestoneOpts) Set ¶
func (m MilestoneOpts) Set() (MilestoneOptSet, error)
Set converts the slice into a MilestoneOptSet. Returns an error if a MilestoneOpt occurs multiple times.
func (MilestoneOpts) Size ¶
func (m MilestoneOpts) Size() int
func (MilestoneOpts) ToSerializables ¶
func (m MilestoneOpts) ToSerializables() serializer.Serializables
type MilestonePublicKey ¶
type MilestonePublicKey = [MilestonePublicKeyLength]byte
MilestonePublicKey is a public key within a Milestone.
type MilestonePublicKeyMapping ¶
type MilestonePublicKeyMapping = map[MilestonePublicKey]ed25519.PrivateKey
MilestonePublicKeyMapping is a mapping from a public key to a private key.
type MilestonePublicKeySet ¶
type MilestonePublicKeySet = map[MilestonePublicKey]struct{}
MilestonePublicKeySet is a set of unique MilestonePublicKey.
type MilestoneSignature ¶
type MilestoneSignature = [MilestoneSignatureLength]byte
MilestoneSignature is a signature within a Milestone.
type MilestoneSigningFunc ¶
type MilestoneSigningFunc func(pubKeys []MilestonePublicKey, msEssence []byte) ([]MilestoneSignature, error)
MilestoneSigningFunc is a function which produces a set of signatures for the given Milestone essence data. The given public keys dictate in which order the returned signatures must occur.
func InMemoryEd25519MilestoneSigner ¶
func InMemoryEd25519MilestoneSigner(prvKeys MilestonePublicKeyMapping) MilestoneSigningFunc
InMemoryEd25519MilestoneSigner is a function which uses the provided Ed25519 MilestonePublicKeyMapping to produce signatures for the Milestone essence data.
func InsecureRemoteEd25519MilestoneSigner ¶
func InsecureRemoteEd25519MilestoneSigner(remoteEndpoint string) MilestoneSigningFunc
InsecureRemoteEd25519MilestoneSigner is a function which uses a remote RPC server via an insecure connection to produce signatures for the Milestone essence data. You must only use this function if the remote lives on the same host as the caller.
type NFTAddress ¶
type NFTAddress [NFTAddressBytesLength]byte
NFTAddress defines an NFT address. An NFTAddress is the Blake2b-256 hash of the OutputID which created it.
func MustParseNFTAddressFromHexString ¶
func MustParseNFTAddressFromHexString(hexAddr string) *NFTAddress
MustParseNFTAddressFromHexString parses the given hex string into an NFTAddress. It panics if the hex address is invalid.
func NFTAddressFromOutputID ¶
func NFTAddressFromOutputID(outputID OutputID) NFTAddress
NFTAddressFromOutputID returns the NFT address computed from a given OutputID.
func ParseNFTAddressFromHexString ¶
func ParseNFTAddressFromHexString(hexAddr string) (*NFTAddress, error)
ParseNFTAddressFromHexString parses the given hex string into an NFTAddress.
func (*NFTAddress) Bech32 ¶
func (nftAddr *NFTAddress) Bech32(hrp NetworkPrefix) string
func (*NFTAddress) Chain ¶
func (nftAddr *NFTAddress) Chain() ChainID
func (*NFTAddress) Clone ¶
func (nftAddr *NFTAddress) Clone() Address
func (*NFTAddress) Deserialize ¶
func (nftAddr *NFTAddress) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*NFTAddress) Equal ¶
func (nftAddr *NFTAddress) Equal(other Address) bool
func (*NFTAddress) Key ¶
func (nftAddr *NFTAddress) Key() string
func (*NFTAddress) MarshalJSON ¶
func (nftAddr *NFTAddress) MarshalJSON() ([]byte, error)
func (*NFTAddress) NFTID ¶
func (nftAddr *NFTAddress) NFTID() NFTID
func (*NFTAddress) Serialize ¶
func (nftAddr *NFTAddress) Serialize(_ serializer.DeSerializationMode, deSeriCtx interface{}) (data []byte, err error)
func (*NFTAddress) Size ¶
func (nftAddr *NFTAddress) Size() int
func (*NFTAddress) String ¶
func (nftAddr *NFTAddress) String() string
func (*NFTAddress) Type ¶
func (nftAddr *NFTAddress) Type() AddressType
func (*NFTAddress) UnmarshalJSON ¶
func (nftAddr *NFTAddress) UnmarshalJSON(bytes []byte) error
func (*NFTAddress) VBytes ¶
func (nftAddr *NFTAddress) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type NFTID ¶
type NFTID [NFTIDLength]byte
NFTID is the identifier for an NFT. It is computed as the Blake2b-256 hash of the OutputID of the output which created the NFT.
func NFTIDFromOutputID ¶
func (NFTID) Addressable ¶
func (NFTID) FromOutputID ¶
func (NFTID) ToAddress ¶
func (nftID NFTID) ToAddress() ChainConstrainedAddress
type NFTOutput ¶
type NFTOutput struct { // The amount of IOTA tokens held by the output. Amount uint64 // The native tokens held by the output. NativeTokens NativeTokens // The identifier of this NFT. NFTID NFTID // The unlock conditions on this output. Conditions UnlockConditions // The feature on the output. Features Features // The immutable feature on the output. ImmutableFeatures Features }
NFTOutput is an output type used to implement non-fungible tokens.
func (*NFTOutput) Deserialize ¶
func (*NFTOutput) FeatureSet ¶
func (n *NFTOutput) FeatureSet() FeatureSet
func (*NFTOutput) ImmutableFeatureSet ¶
func (n *NFTOutput) ImmutableFeatureSet() FeatureSet
func (*NFTOutput) MarshalJSON ¶
func (*NFTOutput) NativeTokenList ¶
func (n *NFTOutput) NativeTokenList() NativeTokens
func (*NFTOutput) Type ¶
func (n *NFTOutput) Type() OutputType
func (*NFTOutput) UnlockConditionSet ¶
func (n *NFTOutput) UnlockConditionSet() UnlockConditionSet
func (*NFTOutput) UnlockableBy ¶
func (n *NFTOutput) UnlockableBy(ident Address, extParas *ExternalUnlockParameters) bool
func (*NFTOutput) UnmarshalJSON ¶
func (*NFTOutput) VBytes ¶
func (n *NFTOutput) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
func (*NFTOutput) ValidateStateTransition ¶
func (n *NFTOutput) ValidateStateTransition(transType ChainTransitionType, next ChainConstrainedOutput, semValCtx *SemanticValidationContext) error
type NFTUnlock ¶
type NFTUnlock struct { // The other unlock this NFTUnlock references to. Reference uint16 }
NFTUnlock is an Unlock which references a previous unlock.
func (*NFTUnlock) Deserialize ¶
func (*NFTUnlock) MarshalJSON ¶
func (*NFTUnlock) SourceAllowed ¶
func (*NFTUnlock) Type ¶
func (r *NFTUnlock) Type() UnlockType
func (*NFTUnlock) UnmarshalJSON ¶
type NativeToken ¶
type NativeToken struct { ID NativeTokenID Amount *big.Int }
NativeToken represents a token which resides natively on the ledger.
func (*NativeToken) Clone ¶
func (n *NativeToken) Clone() *NativeToken
Clone clones the NativeToken.
func (*NativeToken) Deserialize ¶
func (n *NativeToken) Deserialize(data []byte, _ serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*NativeToken) Equal ¶
func (n *NativeToken) Equal(other *NativeToken) bool
Equal checks whether other is equal to this NativeToken.
func (*NativeToken) MarshalJSON ¶
func (n *NativeToken) MarshalJSON() ([]byte, error)
func (*NativeToken) Serialize ¶
func (n *NativeToken) Serialize(_ serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*NativeToken) Size ¶
func (n *NativeToken) Size() int
func (*NativeToken) UnmarshalJSON ¶
func (n *NativeToken) UnmarshalJSON(bytes []byte) error
func (*NativeToken) VBytes ¶
func (n *NativeToken) VBytes(_ *RentStructure, _ VBytesFunc) VBytes
type NativeTokenID ¶
type NativeTokenID = FoundryID
NativeTokenID is an identifier which uniquely identifies a NativeToken.
type NativeTokenSum ¶
type NativeTokenSum map[NativeTokenID]*big.Int
NativeTokenSum is a mapping of NativeTokenID to a sum value.
func (NativeTokenSum) ValueOrBigInt0 ¶
func (sum NativeTokenSum) ValueOrBigInt0(id NativeTokenID) *big.Int
ValueOrBigInt0 returns the value for the given native token or a 0 big int.
type NativeTokenSumFunc ¶
NativeTokenSumFunc gets called with a NativeTokenID and the sums of input/output side.
type NativeTokens ¶
type NativeTokens []*NativeToken
NativeTokens is a set of NativeToken.
func (NativeTokens) Clone ¶
func (n NativeTokens) Clone() NativeTokens
Clone clones this slice of NativeToken(s).
func (NativeTokens) Equal ¶
func (n NativeTokens) Equal(other NativeTokens) bool
Equal checks whether other is equal to this slice.
func (*NativeTokens) FromSerializables ¶
func (n *NativeTokens) FromSerializables(seris serializer.Serializables)
func (NativeTokens) MustSet ¶
func (n NativeTokens) MustSet() NativeTokensSet
MustSet works like Set but panics if an error occurs. This function is therefore only safe to be called when it is given, that a NativeTokens slice does not contain the same NativeTokenID multiple times.
func (NativeTokens) Set ¶
func (n NativeTokens) Set() (NativeTokensSet, error)
Set converts the slice into a NativeTokenSet. Returns an error if a NativeTokenID occurs multiple times.
func (NativeTokens) Size ¶
func (n NativeTokens) Size() int
func (NativeTokens) ToSerializables ¶
func (n NativeTokens) ToSerializables() serializer.Serializables
func (NativeTokens) VBytes ¶
func (n NativeTokens) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type NativeTokensSet ¶
type NativeTokensSet map[NativeTokenID]*NativeToken
NativeTokensSet is a set of NativeToken(s).
type NetworkID ¶
type NetworkID = uint64
NetworkID defines the ID of the network on which entities operate on.
func NetworkIDFromString ¶
NetworkIDFromString returns the network ID string's numerical representation.
type NetworkPrefix ¶
type NetworkPrefix string
NetworkPrefix denotes the different network prefixes.
const ( PrefixMainnet NetworkPrefix = "iota" PrefixDevnet NetworkPrefix = "atoi" PrefixShimmer NetworkPrefix = "smr" PrefixTestnet NetworkPrefix = "rms" )
Network prefixes.
type NonEphemeralObject ¶
type NonEphemeralObject interface { // VBytes returns the cost this object has in terms of taking up // virtual and physical space within the data set needed to implement the IOTA protocol. // The override parameter acts as an escape hatch in case the cost needs to be adjusted // according to some external properties outside the NonEphemeralObject. VBytes(rentStruct *RentStructure, override VBytesFunc) VBytes }
NonEphemeralObject is an object which can not be pruned by nodes as it makes up an integral part to execute the IOTA protocol. This kind of objects are associated with costs in terms of the resources they take up.
type Output ¶
type Output interface { serializer.SerializableWithSize NonEphemeralObject // Deposit returns the amount this Output deposits. Deposit() uint64 // NativeTokenList returns the NativeToken this output defines. NativeTokenList() NativeTokens // UnlockConditionSet returns the UnlockConditionSet this output defines. UnlockConditionSet() UnlockConditionSet // FeatureSet returns the FeatureSet this output contains. FeatureSet() FeatureSet // Type returns the type of the output. Type() OutputType // Clone clones the Output. Clone() Output }
Output defines a unit of output of a transaction.
func OutputSelector ¶
OutputSelector implements SerializableSelectorFunc for output types.
type OutputID ¶
type OutputID [OutputIDLength]byte
OutputID defines the identifier for an UTXO which consists out of the referenced TransactionID and the output's index.
func MustOutputIDFromHex ¶
MustOutputIDFromHex works like OutputIDFromHex but panics if an error is encountered.
func OutputIDFromHex ¶
OutputIDFromHex creates a OutputID from the given hex encoded OututID data.
func OutputIDFromTransactionIDAndIndex ¶
func OutputIDFromTransactionIDAndIndex(txID TransactionID, index uint16) OutputID
OutputIDFromTransactionIDAndIndex creates a OutputID from the given TransactionID and index.
func (OutputID) TransactionID ¶
func (outputID OutputID) TransactionID() TransactionID
TransactionID returns the TransactionID of the Output this OutputID references.
type OutputIDHex ¶
type OutputIDHex string
OutputIDHex is the hex representation of an output ID.
func (OutputIDHex) AsUTXOInput ¶
func (oih OutputIDHex) AsUTXOInput() (*UTXOInput, error)
AsUTXOInput converts the hex output ID to a UTXOInput.
func (OutputIDHex) MustAsUTXOInput ¶
func (oih OutputIDHex) MustAsUTXOInput() *UTXOInput
MustAsUTXOInput converts the hex output ID to a UTXOInput. It panics if the hex output ID is invalid.
func (OutputIDHex) MustSplitParts ¶
func (oih OutputIDHex) MustSplitParts() (*TransactionID, uint16)
MustSplitParts returns the transaction ID and output index parts of the hex output ID. It panics if the hex output ID is invalid.
func (OutputIDHex) SplitParts ¶
func (oih OutputIDHex) SplitParts() (*TransactionID, uint16, error)
SplitParts returns the transaction ID and output index parts of the hex output ID.
type OutputIDs ¶
type OutputIDs []OutputID
OutputIDs is a slice of OutputID.
func (OutputIDs) OrderedSet ¶
OrderedSet returns an Outputs slice ordered by this OutputIDs slice given a OutputSet.
func (OutputIDs) RemoveDupsAndSort ¶
RemoveDupsAndSort removes duplicated OutputIDs and sorts the slice by the lexical ordering.
func (OutputIDs) UTXOInputs ¶
UTXOInputs converts the OutputIDs slice to Inputs.
type OutputSet ¶
OutputSet is a map of the OutputID to Output.
func (OutputSet) ChainConstrainedOutputSet ¶
func (outputSet OutputSet) ChainConstrainedOutputSet() ChainConstrainedOutputsSet
ChainConstrainedOutputSet returns a ChainConstrainedOutputsSet for all ChainConstrainedOutputs in the OutputSet.
func (OutputSet) Filter ¶
Filter creates a new OutputSet with Outputs which pass the filter function f.
func (OutputSet) NewAliases ¶
func (outputSet OutputSet) NewAliases() AliasOutputsSet
NewAliases returns an AliasOutputsSet for all AliasOutputs which are new.
type OutputType ¶
type OutputType byte
OutputType defines the type of outputs.
const ( // OutputTreasury denotes the type of the TreasuryOutput. OutputTreasury OutputType = 2 // OutputBasic denotes an BasicOutput. OutputBasic OutputType = 3 // OutputAlias denotes an AliasOutput. OutputAlias OutputType = 4 // OutputFoundry denotes a FoundryOutput. OutputFoundry OutputType = 5 // OutputNFT denotes an NFTOutput. OutputNFT OutputType = 6 )
func (OutputType) String ¶
func (outputType OutputType) String() string
type Outputs ¶
type Outputs []Output
Outputs is a slice of Output.
func (Outputs) ChainConstrainedOutputSet ¶
func (outputs Outputs) ChainConstrainedOutputSet(txID TransactionID) ChainConstrainedOutputsSet
ChainConstrainedOutputSet returns a ChainConstrainedOutputsSet for all ChainConstrainedOutputs in Outputs.
func (Outputs) Commitment ¶
Commitment computes a hash of the outputs slice to be used as a commitment.
func (Outputs) Filter ¶
func (outputs Outputs) Filter(f OutputsFilterFunc) Outputs
Filter returns Outputs (retained order) passing the given OutputsFilterFunc.
func (*Outputs) FromSerializables ¶
func (outputs *Outputs) FromSerializables(seris serializer.Serializables)
func (Outputs) MustCommitment ¶
MustCommitment works like Commitment but panics if there's an error.
func (Outputs) NativeTokenSum ¶
func (outputs Outputs) NativeTokenSum() (NativeTokenSum, error)
NativeTokenSum sums up the different NativeTokens occurring within the given outputs.
func (Outputs) ToOutputsByType ¶
func (outputs Outputs) ToOutputsByType() OutputsByType
ToOutputsByType converts the Outputs slice to OutputsByType.
func (Outputs) ToSerializables ¶
func (outputs Outputs) ToSerializables() serializer.Serializables
type OutputsByType ¶
type OutputsByType map[OutputType][]Output
OutputsByType is a map of OutputType(s) to slice of Output(s).
func (OutputsByType) AliasOutputs ¶
func (outputs OutputsByType) AliasOutputs() AliasOutputs
AliasOutputs returns a slice of Outputs which are AliasOutput.
func (OutputsByType) BasicOutputs ¶
func (outputs OutputsByType) BasicOutputs() BasicOutputs
BasicOutputs returns a slice of Outputs which are BasicOutput.
func (OutputsByType) ChainConstrainedOutputs ¶
func (outputs OutputsByType) ChainConstrainedOutputs() ChainConstrainedOutputs
ChainConstrainedOutputs returns a slice of Outputs which are ChainConstrainedOutput.
func (OutputsByType) ChainConstrainedOutputsSet ¶
func (outputs OutputsByType) ChainConstrainedOutputsSet() (ChainConstrainedOutputsSet, error)
ChainConstrainedOutputsSet returns a map of ChainID to ChainConstrainedOutput. If multiple ChainConstrainedOutput(s) exist for a given ChainID, an error is returned.
func (OutputsByType) FoundryOutputs ¶
func (outputs OutputsByType) FoundryOutputs() FoundryOutputs
FoundryOutputs returns a slice of Outputs which are FoundryOutput.
func (OutputsByType) FoundryOutputsSet ¶
func (outputs OutputsByType) FoundryOutputsSet() (FoundryOutputsSet, error)
FoundryOutputsSet returns a map of FoundryID to FoundryOutput. If multiple FoundryOutput(s) exist for a given FoundryID, an error is returned.
func (OutputsByType) NonNewAliasOutputsSet ¶
func (outputs OutputsByType) NonNewAliasOutputsSet() (AliasOutputsSet, error)
NonNewAliasOutputsSet returns a map of AliasID to AliasOutput. If multiple AliasOutput(s) exist for a given AliasID, an error is returned. The produced set does not include AliasOutputs of which their AliasID are zeroed.
type OutputsFilterFunc ¶
OutputsFilterFunc is a predicate function operating on an Output.
func OutputsFilterByType ¶
func OutputsFilterByType(ty OutputType) OutputsFilterFunc
OutputsFilterByType is an OutputsFilterFunc which filters Outputs by OutputType.
type OutputsSyntacticalValidationFunc ¶
OutputsSyntacticalValidationFunc which given the index of an output and the output itself, runs syntactical validations and returns an error if any should fail.
func OutputsSyntacticalAlias ¶
func OutputsSyntacticalAlias() OutputsSyntacticalValidationFunc
OutputsSyntacticalAlias returns an OutputsSyntacticalValidationFunc which checks that AliasOutput(s)':
- StateIndex/FoundryCounter are zero if the AliasID is zeroed
- StateController and GovernanceController must be different from AliasAddress derived from AliasID
func OutputsSyntacticalChainConstrainedOutputUniqueness ¶
func OutputsSyntacticalChainConstrainedOutputUniqueness() OutputsSyntacticalValidationFunc
func OutputsSyntacticalDepositAmount ¶
func OutputsSyntacticalDepositAmount(protoParas *ProtocolParameters) OutputsSyntacticalValidationFunc
OutputsSyntacticalDepositAmount returns an OutputsSyntacticalValidationFunc which checks that:
- every output deposits more than zero
- every output deposits less than the total supply
- the sum of deposits does not exceed the total supply
- the deposit fulfills the minimum storage deposit as calculated from the virtual byte cost of the output
- if the output contains a StorageDepositReturnUnlockCondition, it must "return" bigger equal than the minimum storage deposit required for the sender to send back the tokens.
func OutputsSyntacticalExpirationAndTimelock ¶
func OutputsSyntacticalExpirationAndTimelock() OutputsSyntacticalValidationFunc
OutputsSyntacticalExpirationAndTimelock returns an OutputsSyntacticalValidationFunc which checks that: That ExpirationUnlockCondition and TimelockUnlockCondition does not have its unix criteria set to zero.
func OutputsSyntacticalFoundry ¶
func OutputsSyntacticalFoundry() OutputsSyntacticalValidationFunc
OutputsSyntacticalFoundry returns an OutputsSyntacticalValidationFunc which checks that FoundryOutput(s)':
- Minted and melted supply is less equal MaximumSupply
- MaximumSupply is not zero
func OutputsSyntacticalNFT ¶
func OutputsSyntacticalNFT() OutputsSyntacticalValidationFunc
OutputsSyntacticalNFT returns an OutputsSyntacticalValidationFunc which checks that NFTOutput(s)':
- Address must be different from NFTAddress derived from NFTID
func OutputsSyntacticalNativeTokens ¶
func OutputsSyntacticalNativeTokens() OutputsSyntacticalValidationFunc
OutputsSyntacticalNativeTokens returns an OutputsSyntacticalValidationFunc which checks that:
- the sum of native tokens count across all outputs does not exceed MaxNativeTokensCount
- each native token holds an amount bigger than zero
type Payload ¶
type Payload interface { serializer.SerializableWithSize // PayloadType returns the type of the payload. PayloadType() PayloadType }
Payload is an object which can be embedded into other objects.
type PayloadType ¶
type PayloadType uint32
PayloadType denotes a type of payload.
const ( // PayloadTreasuryTransaction denotes a TreasuryTransaction. PayloadTreasuryTransaction PayloadType = 4 // PayloadTaggedData denotes a TaggedData payload. PayloadTaggedData PayloadType = 5 // PayloadTransaction denotes a Transaction. PayloadTransaction PayloadType = 6 // PayloadMilestone denotes a Milestone. PayloadMilestone PayloadType = 7 )
func (PayloadType) String ¶
func (payloadType PayloadType) String() string
type ProtocolParameters ¶
type ProtocolParameters struct { // The version of the protocol running. Version byte // The human friendly name of the network. NetworkName string // The HRP prefix used for Bech32 addresses in the network. Bech32HRP NetworkPrefix // The minimum pow score of the network. MinPoWScore uint32 // The below max depth parameter of the network. BelowMaxDepth uint8 // The rent structure used by given node/network. RentStructure RentStructure // TokenSupply defines the current token supply on the network. TokenSupply uint64 }
ProtocolParameters defines the parameters of the protocol.
func (*ProtocolParameters) Deserialize ¶
func (p *ProtocolParameters) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (ProtocolParameters) MarshalJSON ¶
func (p ProtocolParameters) MarshalJSON() ([]byte, error)
func (ProtocolParameters) NetworkID ¶
func (p ProtocolParameters) NetworkID() NetworkID
func (*ProtocolParameters) Serialize ¶
func (p *ProtocolParameters) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*ProtocolParameters) UnmarshalJSON ¶
func (p *ProtocolParameters) UnmarshalJSON(data []byte) error
type ProtocolParamsMilestoneOpt ¶
type ProtocolParamsMilestoneOpt struct { // The milestone index at which these protocol parameters become active. TargetMilestoneIndex MilestoneIndex // The protocol version. ProtocolVersion byte // The protocol parameters in binary form. Params []byte }
ProtocolParamsMilestoneOpt is a MilestoneOpt defining changing protocol parameters.
func (*ProtocolParamsMilestoneOpt) Clone ¶
func (p *ProtocolParamsMilestoneOpt) Clone() MilestoneOpt
func (*ProtocolParamsMilestoneOpt) Deserialize ¶
func (p *ProtocolParamsMilestoneOpt) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, _ interface{}) (int, error)
func (*ProtocolParamsMilestoneOpt) MarshalJSON ¶
func (p *ProtocolParamsMilestoneOpt) MarshalJSON() ([]byte, error)
func (*ProtocolParamsMilestoneOpt) Serialize ¶
func (p *ProtocolParamsMilestoneOpt) Serialize(deSeriMode serializer.DeSerializationMode, _ interface{}) ([]byte, error)
func (*ProtocolParamsMilestoneOpt) Size ¶
func (p *ProtocolParamsMilestoneOpt) Size() int
func (*ProtocolParamsMilestoneOpt) Type ¶
func (p *ProtocolParamsMilestoneOpt) Type() MilestoneOptType
func (*ProtocolParamsMilestoneOpt) UnmarshalJSON ¶
func (p *ProtocolParamsMilestoneOpt) UnmarshalJSON(bytes []byte) error
type ReceiptBuilder ¶
type ReceiptBuilder struct {
// contains filtered or unexported fields
}
ReceiptBuilder is used to easily build up a ReceiptMilestoneOpt.
func NewReceiptBuilder ¶
func NewReceiptBuilder(migratedAt MilestoneIndex) *ReceiptBuilder
NewReceiptBuilder creates a new ReceiptBuilder.
func (*ReceiptBuilder) AddEntry ¶
func (rb *ReceiptBuilder) AddEntry(entry *MigratedFundsEntry) *ReceiptBuilder
AddEntry adds the given MigratedFundsEntry to the receipt.
func (*ReceiptBuilder) AddTreasuryTransaction ¶
func (rb *ReceiptBuilder) AddTreasuryTransaction(tx *TreasuryTransaction) *ReceiptBuilder
AddTreasuryTransaction adds the given TreasuryTransaction to the receipt. This function overrides the previously added TreasuryTransaction.
func (*ReceiptBuilder) Build ¶
func (rb *ReceiptBuilder) Build(protoParas *ProtocolParameters) (*ReceiptMilestoneOpt, error)
Build builds the ReceiptMilestoneOpt.
type ReceiptMilestoneOpt ¶
type ReceiptMilestoneOpt struct { // The milestone index at which the funds were migrated in the legacy network. MigratedAt MilestoneIndex // Whether this ReceiptMilestoneOpt is the final one for a given migrated at index. Final bool // The funds which were migrated with this ReceiptMilestoneOpt. Funds MigratedFundsEntries // The TreasuryTransaction used to fund the funds. Transaction *TreasuryTransaction }
ReceiptMilestoneOpt is a listing of migrated funds.
func (*ReceiptMilestoneOpt) Clone ¶
func (r *ReceiptMilestoneOpt) Clone() MilestoneOpt
func (*ReceiptMilestoneOpt) Deserialize ¶
func (r *ReceiptMilestoneOpt) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*ReceiptMilestoneOpt) MarshalJSON ¶
func (r *ReceiptMilestoneOpt) MarshalJSON() ([]byte, error)
func (*ReceiptMilestoneOpt) Serialize ¶
func (r *ReceiptMilestoneOpt) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*ReceiptMilestoneOpt) Size ¶
func (r *ReceiptMilestoneOpt) Size() int
func (*ReceiptMilestoneOpt) SortFunds ¶
func (r *ReceiptMilestoneOpt) SortFunds()
SortFunds sorts the funds within the receipt after their serialized binary form in lexical order.
func (*ReceiptMilestoneOpt) Sum ¶
func (r *ReceiptMilestoneOpt) Sum() uint64
Sum returns the sum of all MigratedFundsEntry items within the ReceiptMilestoneOpt.
func (*ReceiptMilestoneOpt) Treasury ¶
func (r *ReceiptMilestoneOpt) Treasury() *TreasuryTransaction
Treasury returns the TreasuryTransaction within the receipt or nil if none is contained. This function panics if the ReceiptMilestoneOpt.Transaction is not nil and not a TreasuryTransaction.
func (*ReceiptMilestoneOpt) Type ¶
func (r *ReceiptMilestoneOpt) Type() MilestoneOptType
func (*ReceiptMilestoneOpt) UnmarshalJSON ¶
func (r *ReceiptMilestoneOpt) UnmarshalJSON(bytes []byte) error
type ReferenceUnlock ¶
type ReferenceUnlock struct { // The other unlock this ReferenceUnlock references to. Reference uint16 }
ReferenceUnlock is an Unlock which references a previous unlock.
func (*ReferenceUnlock) Chainable ¶
func (r *ReferenceUnlock) Chainable() bool
func (*ReferenceUnlock) Deserialize ¶
func (r *ReferenceUnlock) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*ReferenceUnlock) MarshalJSON ¶
func (r *ReferenceUnlock) MarshalJSON() ([]byte, error)
func (*ReferenceUnlock) Ref ¶
func (r *ReferenceUnlock) Ref() uint16
func (*ReferenceUnlock) Serialize ¶
func (r *ReferenceUnlock) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*ReferenceUnlock) Size ¶
func (r *ReferenceUnlock) Size() int
func (*ReferenceUnlock) SourceAllowed ¶
func (r *ReferenceUnlock) SourceAllowed(address Address) bool
func (*ReferenceUnlock) Type ¶
func (r *ReferenceUnlock) Type() UnlockType
func (*ReferenceUnlock) UnmarshalJSON ¶
func (r *ReferenceUnlock) UnmarshalJSON(bytes []byte) error
type ReferentialUnlock ¶
type ReferentialUnlock interface { Unlock // Ref returns the index of the Unlock this ReferentialUnlock references. Ref() uint16 // Chainable indicates whether this ReferentialUnlock can reference another ReferentialUnlock. Chainable() bool // SourceAllowed tells whether the given Address is allowed to be the source of this ReferentialUnlock. SourceAllowed(address Address) bool }
ReferentialUnlock is an Unlock which references another Unlock.
type RentStructure ¶
type RentStructure struct { // Defines the rent of a single virtual byte denoted in IOTA tokens. VByteCost uint32 // Defines the factor to be used for data only fields. VBFactorData VByteCostFactor // defines the factor to be used for key/lookup generating fields. VBFactorKey VByteCostFactor }
RentStructure defines the parameters of rent cost calculations on objects which take node resources.
func (*RentStructure) CoversStateRent ¶
func (r *RentStructure) CoversStateRent(object NonEphemeralObject, rent uint64) (uint64, error)
CoversStateRent tells whether given this NonEphemeralObject, the given rent fulfills the renting costs by examining the virtual bytes cost of the object. Returns the minimum rent computed and an error if it is not covered by rent.
func (*RentStructure) Deserialize ¶
func (r *RentStructure) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*RentStructure) MarshalJSON ¶
func (r *RentStructure) MarshalJSON() ([]byte, error)
func (*RentStructure) MinRent ¶
func (r *RentStructure) MinRent(object NonEphemeralObject) uint64
MinRent returns the minimum rent to cover a given object.
func (*RentStructure) MinStorageDepositForReturnOutput ¶
func (r *RentStructure) MinStorageDepositForReturnOutput(sender Address) uint64
MinStorageDepositForReturnOutput returns the minimum renting costs for an BasicOutput which returns a StorageDepositReturnUnlockCondition amount back to the origin sender.
func (*RentStructure) Serialize ¶
func (r *RentStructure) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*RentStructure) UnmarshalJSON ¶
func (r *RentStructure) UnmarshalJSON(data []byte) error
type SemValiContextWorkingSet ¶
type SemValiContextWorkingSet struct { // The identities which are successfully unlocked from the input side. UnlockedIdents UnlockedIdentities // The mapping of OutputID to the actual Outputs. InputSet OutputSet // The inputs to the transaction. Inputs Outputs // The mapping of inputs' OutputID to the index. InputIDToIndex map[OutputID]uint16 // The transaction for which this semantic validation happens. Tx *Transaction // The message which signatures are signing. EssenceMsgToSign []byte // The inputs of the transaction mapped by type. InputsByType OutputsByType // The ChainConstrainedOutput(s) at the input side. InChains ChainConstrainedOutputsSet // The sum of NativeTokens at the input side. InNativeTokens NativeTokenSum // The Outputs of the transaction mapped by type. OutputsByType OutputsByType // The ChainConstrainedOutput(s) at the output side. OutChains ChainConstrainedOutputsSet // The sum of NativeTokens at the output side. OutNativeTokens NativeTokenSum // The Unlocks carried by the transaction mapped by type. UnlocksByType UnlocksByType }
SemValiContextWorkingSet contains fields which get automatically populated by the library during the semantic validation of a Transaction.
func NewSemValiContextWorkingSet ¶
func NewSemValiContextWorkingSet(t *Transaction, inputsSet OutputSet) (*SemValiContextWorkingSet, error)
func (*SemValiContextWorkingSet) UTXOInputAtIndex ¶
func (workingSet *SemValiContextWorkingSet) UTXOInputAtIndex(inputIndex uint16) *UTXOInput
UTXOInputAtIndex retrieves the UTXOInput at the given index. Caller must ensure that the index is valid.
type SemanticValidationContext ¶
type SemanticValidationContext struct { ExtParas *ExternalUnlockParameters // The working set which is auto. populated during the semantic validation. WorkingSet *SemValiContextWorkingSet }
SemanticValidationContext defines the context under which a semantic validation for a Transaction is happening.
type SenderFeature ¶
type SenderFeature struct {
Address Address
}
SenderFeature is a feature which associates an output with a sender identity. The sender identity needs to be unlocked in the transaction for the SenderFeature to be valid.
func (*SenderFeature) Clone ¶
func (s *SenderFeature) Clone() Feature
func (*SenderFeature) Deserialize ¶
func (s *SenderFeature) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*SenderFeature) Equal ¶
func (s *SenderFeature) Equal(other Feature) bool
func (*SenderFeature) MarshalJSON ¶
func (s *SenderFeature) MarshalJSON() ([]byte, error)
func (*SenderFeature) Serialize ¶
func (s *SenderFeature) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*SenderFeature) Size ¶
func (s *SenderFeature) Size() int
func (*SenderFeature) Type ¶
func (s *SenderFeature) Type() FeatureType
func (*SenderFeature) UnmarshalJSON ¶
func (s *SenderFeature) UnmarshalJSON(bytes []byte) error
func (*SenderFeature) VBytes ¶
func (s *SenderFeature) VBytes(rentStruct *RentStructure, f VBytesFunc) VBytes
type Signature ¶
type Signature interface { serializer.SerializableWithSize // Type returns the type of the Signature. Type() SignatureType }
Signature is a signature.
func SignatureFromJSONRawMsg ¶
func SignatureFromJSONRawMsg(jRawMsg *json.RawMessage) (Signature, error)
func SignatureSelector ¶
SignatureSelector implements SerializableSelectorFunc for signature types.
type SignatureType ¶
type SignatureType byte
SignatureType defines the type of signature.
const ( // SignatureEd25519 denotes an Ed25519Signature. SignatureEd25519 SignatureType = iota )
func (SignatureType) String ¶
func (sigType SignatureType) String() string
type SignatureTypeSet ¶
type SignatureTypeSet map[SignatureType]struct{}
SignatureTypeSet is a set of SignatureType.
type SignatureUnlock ¶
type SignatureUnlock struct { // The signature of this unlock. Signature Signature `json:"signature"` }
SignatureUnlock holds a signature which unlocks inputs.
func (*SignatureUnlock) Deserialize ¶
func (s *SignatureUnlock) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*SignatureUnlock) MarshalJSON ¶
func (s *SignatureUnlock) MarshalJSON() ([]byte, error)
func (*SignatureUnlock) Serialize ¶
func (s *SignatureUnlock) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*SignatureUnlock) Size ¶
func (s *SignatureUnlock) Size() int
func (*SignatureUnlock) Type ¶
func (s *SignatureUnlock) Type() UnlockType
func (*SignatureUnlock) UnmarshalJSON ¶
func (s *SignatureUnlock) UnmarshalJSON(bytes []byte) error
type Signatures ¶
type Signatures []Signature
Signatures is a slice of Signature(s).
func (*Signatures) FromSerializables ¶
func (sigs *Signatures) FromSerializables(seris serializer.Serializables)
func (Signatures) Len ¶
func (sigs Signatures) Len() int
func (Signatures) Less ¶
func (sigs Signatures) Less(i, j int) bool
func (Signatures) Swap ¶
func (sigs Signatures) Swap(i, j int)
func (Signatures) ToSerializables ¶
func (sigs Signatures) ToSerializables() serializer.Serializables
type SimpleTokenScheme ¶
type SimpleTokenScheme struct { // The amount of tokens which has been minted. MintedTokens *big.Int // The amount of tokens which has been melted. MeltedTokens *big.Int // The maximum supply of tokens controlled. MaximumSupply *big.Int }
SimpleTokenScheme is a TokenScheme which works with minted/melted/maximum supply counters.
func (*SimpleTokenScheme) Clone ¶
func (s *SimpleTokenScheme) Clone() TokenScheme
func (*SimpleTokenScheme) Deserialize ¶
func (s *SimpleTokenScheme) Deserialize(data []byte, _ serializer.DeSerializationMode, _ interface{}) (int, error)
func (*SimpleTokenScheme) MarshalJSON ¶
func (s *SimpleTokenScheme) MarshalJSON() ([]byte, error)
func (*SimpleTokenScheme) Serialize ¶
func (s *SimpleTokenScheme) Serialize(_ serializer.DeSerializationMode, _ interface{}) ([]byte, error)
func (*SimpleTokenScheme) Size ¶
func (s *SimpleTokenScheme) Size() int
func (*SimpleTokenScheme) StateTransition ¶
func (s *SimpleTokenScheme) StateTransition(transType ChainTransitionType, nextState TokenScheme, in *big.Int, out *big.Int) error
func (*SimpleTokenScheme) SyntacticalValidation ¶
func (s *SimpleTokenScheme) SyntacticalValidation() error
func (*SimpleTokenScheme) Type ¶
func (s *SimpleTokenScheme) Type() TokenSchemeType
func (*SimpleTokenScheme) UnmarshalJSON ¶
func (s *SimpleTokenScheme) UnmarshalJSON(bytes []byte) error
func (*SimpleTokenScheme) VBytes ¶
func (s *SimpleTokenScheme) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type StateControllerAddressUnlockCondition ¶
type StateControllerAddressUnlockCondition struct {
Address Address
}
StateControllerAddressUnlockCondition is an UnlockCondition defining the state controller identity for an AliasOutput.
func (*StateControllerAddressUnlockCondition) Clone ¶
func (s *StateControllerAddressUnlockCondition) Clone() UnlockCondition
func (*StateControllerAddressUnlockCondition) Deserialize ¶
func (s *StateControllerAddressUnlockCondition) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*StateControllerAddressUnlockCondition) Equal ¶
func (s *StateControllerAddressUnlockCondition) Equal(other UnlockCondition) bool
func (*StateControllerAddressUnlockCondition) MarshalJSON ¶
func (s *StateControllerAddressUnlockCondition) MarshalJSON() ([]byte, error)
func (*StateControllerAddressUnlockCondition) Serialize ¶
func (s *StateControllerAddressUnlockCondition) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*StateControllerAddressUnlockCondition) Size ¶
func (s *StateControllerAddressUnlockCondition) Size() int
func (*StateControllerAddressUnlockCondition) Type ¶
func (s *StateControllerAddressUnlockCondition) Type() UnlockConditionType
func (*StateControllerAddressUnlockCondition) UnmarshalJSON ¶
func (s *StateControllerAddressUnlockCondition) UnmarshalJSON(bytes []byte) error
func (*StateControllerAddressUnlockCondition) VBytes ¶
func (s *StateControllerAddressUnlockCondition) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type StateTransitionValidationFunc ¶
type StateTransitionValidationFunc func(current ChainConstrainedOutput, next ChainConstrainedOutput) error
StateTransitionValidationFunc is a function which given the current and next chain state, validates the state transition.
type StorageDepositReturnUnlockCondition ¶
StorageDepositReturnUnlockCondition is an unlock condition which defines the amount of tokens which must be sent back to the return identity, when the output in which it occurs in, is consumed. If a transaction consumes multiple outputs which have a StorageDepositReturnUnlockCondition, then on the output side at least the sum of all occurring StorageDepositReturnUnlockCondition(s) on the input side must be deposited to the designated return identity.
func (*StorageDepositReturnUnlockCondition) Clone ¶
func (s *StorageDepositReturnUnlockCondition) Clone() UnlockCondition
func (*StorageDepositReturnUnlockCondition) Deserialize ¶
func (s *StorageDepositReturnUnlockCondition) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*StorageDepositReturnUnlockCondition) Equal ¶
func (s *StorageDepositReturnUnlockCondition) Equal(other UnlockCondition) bool
func (*StorageDepositReturnUnlockCondition) MarshalJSON ¶
func (s *StorageDepositReturnUnlockCondition) MarshalJSON() ([]byte, error)
func (*StorageDepositReturnUnlockCondition) Serialize ¶
func (s *StorageDepositReturnUnlockCondition) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*StorageDepositReturnUnlockCondition) Size ¶
func (s *StorageDepositReturnUnlockCondition) Size() int
func (*StorageDepositReturnUnlockCondition) Type ¶
func (s *StorageDepositReturnUnlockCondition) Type() UnlockConditionType
func (*StorageDepositReturnUnlockCondition) UnmarshalJSON ¶
func (s *StorageDepositReturnUnlockCondition) UnmarshalJSON(bytes []byte) error
func (*StorageDepositReturnUnlockCondition) VBytes ¶
func (s *StorageDepositReturnUnlockCondition) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type TagFeature ¶
type TagFeature struct {
Tag []byte
}
TagFeature is a feature which allows to additionally tag an output by a user defined value.
func (*TagFeature) Clone ¶
func (s *TagFeature) Clone() Feature
func (*TagFeature) Deserialize ¶
func (s *TagFeature) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*TagFeature) Equal ¶
func (s *TagFeature) Equal(other Feature) bool
func (*TagFeature) MarshalJSON ¶
func (s *TagFeature) MarshalJSON() ([]byte, error)
func (*TagFeature) Serialize ¶
func (s *TagFeature) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*TagFeature) Size ¶
func (s *TagFeature) Size() int
func (*TagFeature) Type ¶
func (s *TagFeature) Type() FeatureType
func (*TagFeature) UnmarshalJSON ¶
func (s *TagFeature) UnmarshalJSON(bytes []byte) error
func (*TagFeature) VBytes ¶
func (s *TagFeature) VBytes(rentStruct *RentStructure, f VBytesFunc) VBytes
type TaggedData ¶
type TaggedData struct { // The tag to use to categorize the data. Tag []byte // The data within the payload. Data []byte }
TaggedData is a payload which holds a tag and associated data.
func (*TaggedData) Deserialize ¶
func (u *TaggedData) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*TaggedData) MarshalJSON ¶
func (u *TaggedData) MarshalJSON() ([]byte, error)
func (*TaggedData) PayloadType ¶
func (u *TaggedData) PayloadType() PayloadType
func (*TaggedData) Serialize ¶
func (u *TaggedData) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*TaggedData) Size ¶
func (u *TaggedData) Size() int
func (*TaggedData) UnmarshalJSON ¶
func (u *TaggedData) UnmarshalJSON(bytes []byte) error
type TimelockUnlockCondition ¶
type TimelockUnlockCondition struct { // The unix time in second resolution until which the timelock applies (inclusive). UnixTime uint32 }
TimelockUnlockCondition is an unlock condition which puts a time constraint on an output depending on the latest confirmed milestone's timestamp T:
- the output can only be consumed, if T is bigger than the one defined in the condition.
func (*TimelockUnlockCondition) Clone ¶
func (s *TimelockUnlockCondition) Clone() UnlockCondition
func (*TimelockUnlockCondition) Deserialize ¶
func (s *TimelockUnlockCondition) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*TimelockUnlockCondition) Equal ¶
func (s *TimelockUnlockCondition) Equal(other UnlockCondition) bool
func (*TimelockUnlockCondition) MarshalJSON ¶
func (s *TimelockUnlockCondition) MarshalJSON() ([]byte, error)
func (*TimelockUnlockCondition) Serialize ¶
func (s *TimelockUnlockCondition) Serialize(_ serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*TimelockUnlockCondition) Size ¶
func (s *TimelockUnlockCondition) Size() int
func (*TimelockUnlockCondition) Type ¶
func (s *TimelockUnlockCondition) Type() UnlockConditionType
func (*TimelockUnlockCondition) UnmarshalJSON ¶
func (s *TimelockUnlockCondition) UnmarshalJSON(bytes []byte) error
func (*TimelockUnlockCondition) VBytes ¶
func (s *TimelockUnlockCondition) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes
type TokenScheme ¶
type TokenScheme interface { serializer.SerializableWithSize NonEphemeralObject // Type returns the type of the TokenScheme. Type() TokenSchemeType // Clone clones the TokenScheme. Clone() TokenScheme // StateTransition validates the transition of the token scheme against its new state. StateTransition(transType ChainTransitionType, nextState TokenScheme, in *big.Int, out *big.Int) error // SyntacticalValidation validates the syntactical rules. SyntacticalValidation() error }
TokenScheme defines a scheme for to be used for an OutputFoundry.
func TokenSchemeSelector ¶
func TokenSchemeSelector(tokenSchemeType uint32) (TokenScheme, error)
TokenSchemeSelector implements SerializableSelectorFunc for token scheme types.
type TokenSchemeType ¶
type TokenSchemeType byte
TokenSchemeType defines the type of token schemes.
const ( // TokenSchemeSimple denotes a type of output which is locked by a signature and deposits onto a single address. TokenSchemeSimple TokenSchemeType = iota )
func (TokenSchemeType) String ¶
func (tokenSchemeType TokenSchemeType) String() string
type TransDepIdentOutput ¶
type TransDepIdentOutput interface { ChainConstrainedOutput // Ident computes the identity to which this output is locked to by examining // the transition to the next output state. If next is nil, then this TransDepIdentOutput // treats the ident computation as being for ChainTransitionTypeDestroy. Ident(next TransDepIdentOutput) (Address, error) // UnlockableBy tells whether the given ident can unlock this Output // while also taking into consideration constraints enforced by UnlockConditions(s) within this Output // and the next state of this TransDepIdentOutput. To indicate that this TransDepIdentOutput // is to be destroyed, pass nil as next. UnlockableBy(ident Address, next TransDepIdentOutput, extParas *ExternalUnlockParameters) (bool, error) }
TransDepIdentOutput is a type of Output where the identity to unlock is dependent on the transition the output does (without considering UnlockConditions(s)).
type TransIndepIdentOutput ¶
type TransIndepIdentOutput interface { Output // Ident returns the default identity to which this output is locked to. Ident() Address // UnlockableBy tells whether the given ident can unlock this Output // while also taking into consideration constraints enforced by UnlockConditions(s) within this Output (if any). UnlockableBy(ident Address, extParas *ExternalUnlockParameters) bool }
TransIndepIdentOutput is a type of Output where the identity to unlock is independent of any transition the output does (without considering Feature(s)).
type Transaction ¶
type Transaction struct { // The transaction essence, respectively the transfer part of a Transaction. Essence *TransactionEssence // The unlocks defining the unlocking data for the inputs within the Essence. Unlocks Unlocks }
Transaction is a transaction with its inputs, outputs and unlocks.
func (*Transaction) Deserialize ¶
func (t *Transaction) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*Transaction) ID ¶
func (t *Transaction) ID() (TransactionID, error)
ID computes the ID of the Transaction.
func (*Transaction) MarshalJSON ¶
func (t *Transaction) MarshalJSON() ([]byte, error)
func (*Transaction) OutputsSet ¶
func (t *Transaction) OutputsSet() (OutputSet, error)
OutputsSet returns an OutputSet from the Transaction's outputs, mapped by their OutputID.
func (*Transaction) PayloadType ¶
func (t *Transaction) PayloadType() PayloadType
func (*Transaction) SemanticallyValidate ¶
func (t *Transaction) SemanticallyValidate(svCtx *SemanticValidationContext, inputs OutputSet, semValFuncs ...TxSemanticValidationFunc) error
SemanticallyValidate semantically validates the Transaction by checking that the semantic rules applied to the inputs and outputs are fulfilled. Semantic validation must only be executed on Transaction(s) which are syntactically valid.
func (*Transaction) Serialize ¶
func (t *Transaction) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) ([]byte, error)
func (*Transaction) Size ¶
func (t *Transaction) Size() int
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(bytes []byte) error
type TransactionEssence ¶
type TransactionEssence struct { // The network ID for which this essence is valid for. NetworkID NetworkID // The inputs of this transaction. Inputs Inputs `json:"inputs"` // The commitment to the referenced inputs. InputsCommitment InputsCommitment `json:"inputsCommitment"` // The outputs of this transaction. Outputs Outputs `json:"outputs"` // The optional embedded payload. Payload Payload `json:"payload"` }
TransactionEssence is the essence part of a Transaction.
func TransactionEssenceSelector ¶
func TransactionEssenceSelector(txType uint32) (*TransactionEssence, error)
TransactionEssenceSelector implements SerializableSelectorFunc for transaction essence types.
func (*TransactionEssence) Deserialize ¶
func (u *TransactionEssence) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*TransactionEssence) MarshalJSON ¶
func (u *TransactionEssence) MarshalJSON() ([]byte, error)
func (*TransactionEssence) Serialize ¶
func (u *TransactionEssence) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (data []byte, err error)
func (*TransactionEssence) Sign ¶
func (u *TransactionEssence) Sign(inputsCommitment []byte, addrKeys ...AddressKeys) ([]Signature, error)
Sign produces signatures signing the essence for every given AddressKeys. The produced signatures are in the same order as the AddressKeys.
func (*TransactionEssence) SigningMessage ¶
func (u *TransactionEssence) SigningMessage() ([]byte, error)
SigningMessage returns the to be signed message.
func (*TransactionEssence) Size ¶
func (u *TransactionEssence) Size() int
func (*TransactionEssence) UnmarshalJSON ¶
func (u *TransactionEssence) UnmarshalJSON(bytes []byte) error
type TransactionEssenceType ¶
type TransactionEssenceType = byte
TransactionEssenceType defines the type of transaction.
type TransactionID ¶
type TransactionID [TransactionIDLength]byte
TransactionID is the ID of a Transaction.
func (TransactionID) ToHex ¶
func (transactionID TransactionID) ToHex() string
ToHex converts the TransactionID to its hex representation.
type TreasuryInput ¶
type TreasuryInput [32]byte
TreasuryInput is an input which references a milestone which generated a TreasuryOutput.
func (*TreasuryInput) Clone ¶
func (ti *TreasuryInput) Clone() *TreasuryInput
func (*TreasuryInput) Deserialize ¶
func (ti *TreasuryInput) Deserialize(data []byte, deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (int, error)
func (*TreasuryInput) MarshalJSON ¶
func (ti *TreasuryInput) MarshalJSON() ([]byte, error)
func (*TreasuryInput) Serialize ¶
func (ti *TreasuryInput) Serialize(deSeriMode serializer.DeSerializationMode, deSeriCtx interface{}) (data []byte, err error)
func (*TreasuryInput) Size ¶
func (ti *TreasuryInput) Size() int
func (*TreasuryInput) Type ¶
func (ti *TreasuryInput) Type() InputType
func (*TreasuryInput) UnmarshalJSON ¶
func (ti *TreasuryInput) UnmarshalJSON(bytes []byte) error
type TreasuryOutput ¶
type TreasuryOutput struct { // The currently residing funds in the treasury. Amount uint64 }
TreasuryOutput is an output which holds the treasury of a network.
func (*TreasuryOutput) Clone ¶
func (t *TreasuryOutput) Clone() Output
func (*TreasuryOutput) Deposit ¶
func (t *TreasuryOutput) Deposit() uint64
func (*TreasuryOutput) Deserialize ¶
func (t *TreasuryOutput) Deserialize(data []byte, _ serializer.DeSerializationMode, _ interface{}) (int, error)
func (*TreasuryOutput) FeatureSet ¶
func (t *TreasuryOutput) FeatureSet() FeatureSet
func (*TreasuryOutput) MarshalJSON ¶
func (t *TreasuryOutput) MarshalJSON() ([]byte, error)
func (*TreasuryOutput) NativeTokenList ¶
func (t *TreasuryOutput) NativeTokenList() NativeTokens
func (*TreasuryOutput) Serialize ¶
func (t *TreasuryOutput) Serialize(_ serializer.DeSerializationMode, _ interface{}) ([]byte, error)
func (*TreasuryOutput) Size ¶
func (t *TreasuryOutput) Size() int
func (*TreasuryOutput) Type ¶
func (t *TreasuryOutput) Type() OutputType
func (*TreasuryOutput) UnlockConditionSet ¶
func (t *TreasuryOutput) UnlockConditionSet() UnlockConditionSet
func (*TreasuryOutput) UnmarshalJSON ¶
func (t *TreasuryOutput) UnmarshalJSON(bytes []byte) error