Versions in this module Expand all Collapse all v1 v1.11.13-rc.2 Dec 4, 2024 v1.0.0 Dec 4, 2024 Changes in this version + const MaxMemoSize + var ErrInputsNotSortedUnique = errors.New("inputs not sorted and unique") + var ErrInsufficientFunds = errors.New("insufficient funds") + var ErrMemoTooLarge = errors.New("memo exceeds maximum length") + var ErrMismatchedChainIDs = errors.New("mismatched chainIDs") + var ErrNilTransferableFxInput = errors.New("nil transferable feature extension input is not valid") + var ErrNilTransferableFxOutput = errors.New("nil transferable feature extension output is not valid") + var ErrNilTransferableInput = errors.New("nil transferable input is not valid") + var ErrNilTransferableOutput = errors.New("nil transferable output is not valid") + var ErrNilTx = errors.New("nil tx is not valid") + var ErrOutputsNotSorted = errors.New("outputs not sorted") + var ErrWrongChainID = errors.New("tx has wrong chain ID") + var ErrWrongNetworkID = errors.New("tx has wrong network ID") + func Consume(utxoDB UTXODeleter, ins []*TransferableInput) + func GetBalance(db UTXOReader, addrs set.Set[ids.ShortID]) (uint64, error) + func IsSortedTransferableOutputs(outs []*TransferableOutput, c codec.Manager) bool + func ParseLocalAddresses(a AddressManager, addrStrs []string) (set.Set[ids.ShortID], error) + func ParseServiceAddress(a AddressManager, addrStr string) (ids.ShortID, error) + func ParseServiceAddresses(a AddressManager, addrStrs []string) (set.Set[ids.ShortID], error) + func Produce(utxoDB UTXOAdder, txID ids.ID, outs []*TransferableOutput) + func SortTransferableInputsWithSigners(ins []*TransferableInput, signers [][]*secp256k1.PrivateKey) + func SortTransferableOutputs(outs []*TransferableOutput, c codec.Manager) + func VerifyMemoFieldLength(memo types.JSONByteSlice, isDurangoActive bool) error + func VerifyTx(feeAmount uint64, feeAssetID ids.ID, allIns [][]*TransferableInput, ...) error + type AddressManager interface + FormatAddress func(chainID ids.ID, addr ids.ShortID) (string, error) + FormatLocalAddress func(addr ids.ShortID) (string, error) + ParseAddress func(addrStr string) (ids.ID, ids.ShortID, error) + ParseLocalAddress func(addrStr string) (ids.ShortID, error) + func NewAddressManager(ctx *snow.Context) AddressManager + type Addressable interface + Addresses func() [][]byte + type Amounter interface + Amount func() uint64 + type Asset struct + ID ids.ID + func (asset *Asset) AssetID() ids.ID + func (asset *Asset) Verify() error + type AtomicUTXOManager interface + GetAtomicUTXOs func(chainID ids.ID, addrs set.Set[ids.ShortID], startAddr ids.ShortID, ...) ([]*UTXO, ids.ShortID, ids.ID, error) + func NewAtomicUTXOManager(sm atomic.SharedMemory, codec codec.Manager) AtomicUTXOManager + type BaseTx struct + BlockchainID ids.ID + Ins []*TransferableInput + Memo types.JSONByteSlice + NetworkID uint32 + Outs []*TransferableOutput + func (t *BaseTx) InputUTXOs() []*UTXOID + func (t *BaseTx) NumCredentials() int + func (t *BaseTx) Verify(ctx *snow.Context) error + type Coster interface + Cost func() (uint64, error) + type FlowChecker struct + func NewFlowChecker() *FlowChecker + func (fc *FlowChecker) Consume(assetID ids.ID, amount uint64) + func (fc *FlowChecker) Produce(assetID ids.ID, amount uint64) + func (fc *FlowChecker) Verify() error + type Metadata struct + func (md *Metadata) Bytes() []byte + func (md *Metadata) ID() ids.ID + func (md *Metadata) Initialize(unsignedBytes, bytes []byte) + func (md *Metadata) SignedBytes() []byte + func (md *Metadata) Verify() error + type MockTransferableIn struct + func NewMockTransferableIn(ctrl *gomock.Controller) *MockTransferableIn + func (m *MockTransferableIn) Amount() uint64 + func (m *MockTransferableIn) Cost() (uint64, error) + func (m *MockTransferableIn) EXPECT() *MockTransferableInMockRecorder + func (m *MockTransferableIn) InitCtx(arg0 *snow.Context) + func (m *MockTransferableIn) Verify() error + type MockTransferableInMockRecorder struct + func (mr *MockTransferableInMockRecorder) Amount() *gomock.Call + func (mr *MockTransferableInMockRecorder) Cost() *gomock.Call + func (mr *MockTransferableInMockRecorder) InitCtx(arg0 any) *gomock.Call + func (mr *MockTransferableInMockRecorder) Verify() *gomock.Call + type MockTransferableOut struct + func NewMockTransferableOut(ctrl *gomock.Controller) *MockTransferableOut + func (m *MockTransferableOut) Amount() uint64 + func (m *MockTransferableOut) EXPECT() *MockTransferableOutMockRecorder + func (m *MockTransferableOut) InitCtx(arg0 *snow.Context) + func (m *MockTransferableOut) Verify() error + type MockTransferableOutMockRecorder struct + func (mr *MockTransferableOutMockRecorder) Amount() *gomock.Call + func (mr *MockTransferableOutMockRecorder) InitCtx(arg0 any) *gomock.Call + func (mr *MockTransferableOutMockRecorder) Verify() *gomock.Call + type TestAddressable struct + Addrs [][]byte + func (a *TestAddressable) Addresses() [][]byte + type TestState struct + Err error + func (*TestState) InitCtx(*snow.Context) + func (v *TestState) Verify() error + type TestTransferable struct + Val uint64 + func (*TestTransferable) Cost() (uint64, error) + func (*TestTransferable) InitCtx(*snow.Context) + func (t *TestTransferable) Amount() uint64 + type TransferableIn interface + type TransferableInput struct + FxID ids.ID + In TransferableIn + func (in *TransferableInput) Compare(other *TransferableInput) int + func (in *TransferableInput) Input() TransferableIn + func (in *TransferableInput) Verify() error + type TransferableOut interface + type TransferableOutput struct + FxID ids.ID + Out TransferableOut + func (out *TransferableOutput) InitCtx(ctx *snow.Context) + func (out *TransferableOutput) Output() TransferableOut + func (out *TransferableOutput) Verify() error + type UTXO struct + Out verify.State + func GetAllUTXOs(db UTXOReader, addrs set.Set[ids.ShortID]) ([]*UTXO, error) + func GetPaginatedUTXOs(db UTXOReader, addrs set.Set[ids.ShortID], lastAddr ids.ShortID, ...) ([]*UTXO, ids.ShortID, ids.ID, error) + func (utxo *UTXO) Verify() error + type UTXOAdder interface + AddUTXO func(utxo *UTXO) + type UTXODeleter interface + DeleteUTXO func(utxoID ids.ID) + type UTXOGetter interface + GetUTXO func(utxoID ids.ID) (*UTXO, error) + type UTXOID struct + OutputIndex uint32 + Symbol bool + TxID ids.ID + func UTXOIDFromString(s string) (*UTXOID, error) + func (utxo *UTXOID) Compare(other *UTXOID) int + func (utxo *UTXOID) InputID() ids.ID + func (utxo *UTXOID) InputSource() (ids.ID, uint32) + func (utxo *UTXOID) String() string + func (utxo *UTXOID) Symbolic() bool + func (utxo *UTXOID) Verify() error + type UTXOReader interface + UTXOIDs func(addr []byte, previous ids.ID, limit int) ([]ids.ID, error) + type UTXOState interface + Checksum func() ids.ID + func NewMeteredUTXOState(db database.Database, codec codec.Manager, metrics prometheus.Registerer, ...) (UTXOState, error) + func NewUTXOState(db database.Database, codec codec.Manager, trackChecksum bool) (UTXOState, error) + type UTXOWriter interface + DeleteUTXO func(utxoID ids.ID) error + PutUTXO func(utxo *UTXO) error