Versions in this module Expand all Collapse all v1 v1.1.1 Dec 18, 2024 Changes in this version + const CostPerSignature + const MaxSignatures + var ErrEmptyRecipient = errors.New("receipient cannot be empty") + var ErrInputCredentialSignersMismatch = errors.New("input expected a different number of signers than provided in the credential") + var ErrInputOutputIndexOutOfBounds = errors.New("input referenced a nonexistent address in the output") + var ErrMismatchedAmounts = errors.New("utxo amount and input amount are not equal") + var ErrMsigCombination = errors.New("msig combinations not supported") + var ErrNilCredential = errors.New("nil credential") + var ErrNoValueInput = errors.New("input has no value") + var ErrNoValueOutput = errors.New("output has no value") + var ErrNotAliasGetter = errors.New("state isn't msig alias getter") + var ErrTimelocked = errors.New("output is time locked") + var ErrTooFewSigners = errors.New("input has less signers than expected") + var ErrTooManySigners = errors.New("input has more signers than expected") + var ErrWrongCredentialType = errors.New("wrong credential type") + var ErrWrongInputType = errors.New("wrong input type") + var ErrWrongMintCreated = errors.New("wrong mint output created from the operation") + var ErrWrongNumberOfUTXOs = errors.New("wrong number of utxos for the operation") + var ErrWrongOpType = errors.New("wrong operation type") + var ErrWrongOwnerType = errors.New("wrong owner type") + var ErrWrongSig = errors.New("wrong signature") + var ErrWrongTxType = errors.New("wrong tx type") + var ErrWrongUTXOType = errors.New("wrong utxo type") + var ErrWrongVMType = errors.New("wrong vm type") + var ID = ids.ID + func ExtractFromAndSigners(keys []*secp256k1.PrivateKey) (set.Set[ids.ShortID], []*secp256k1.PrivateKey) + func TraverseAliases(out *OutputOwners, msig AliasGetter, callback TraverseAliasFunc) error + func TraverseOwners(out *OutputOwners, msig AliasGetter, callback TraverseOwnerFunc) (uint32, error) + type AliasGetter interface + GetMultisigAlias func(ids.ShortID) (*multisig.AliasWithNonce, error) + type CaminoFx struct + func (fx *CaminoFx) Initialize(vmIntf interface{}) error + func (fx *CaminoFx) VerifyOperation(txIntf, opIntf, credIntf interface{}, utxosIntf []interface{}) error + func (fx *CaminoFx) VerifyPermission(txIntf, inIntf, credIntf, ownerIntf interface{}) error + func (fx *CaminoFx) VerifyTransfer(txIntf, inIntf, credIntf, utxoIntf interface{}) error + type Credential struct + Sigs [][secp256k1.SignatureLen]byte + func (*Credential) SignatureIndices() []uint32 + func (cr *Credential) MarshalJSON() ([]byte, error) + func (cr *Credential) Signatures() [][secp256k1.SignatureLen]byte + func (cr *Credential) Verify() error + type CredentialIntf interface + SignatureIndices func() []uint32 + Signatures func() [][secp256k1.SignatureLen]byte + type CrossTransferOutput struct + Recipient ids.ShortID + func (out *CrossTransferOutput) MarshalJSON() ([]byte, error) + func (out *CrossTransferOutput) Verify() error + type Factory struct + func (*Factory) New(logging.Logger) (interface{}, error) + type Fx struct + SECPFactory secp256k1.Factory + VM VM + func (*Fx) Bootstrapping() error + func (*Fx) CollectMultisigAliases(ownerIntf, msigIntf interface{}) ([]interface{}, error) + func (*Fx) CreateOutput(amount uint64, ownerIntf interface{}) (interface{}, error) + func (*Fx) IsNestedMultisig(ownerIntf interface{}, msigIntf interface{}) (bool, error) + func (*Fx) VerifyMultisigOwner(ownerIntf, msigIntf interface{}) error + func (fx *Fx) Bootstrapped() error + func (fx *Fx) Initialize(vmIntf interface{}) error + func (fx *Fx) InitializeVM(vmIntf interface{}) error + func (fx *Fx) RecoverAddresses(msg []byte, verifies []verify.Verifiable) (RecoverMap, error) + func (fx *Fx) VerifyCredentials(utx UnsignedTx, in *Input, cred *Credential, out *OutputOwners) error + func (fx *Fx) VerifyMultisigMessage(msg []byte, inIntf, credIntf, ownerIntf, msigIntf interface{}) error + func (fx *Fx) VerifyMultisigOutputOwner(outIntf, msigIntf interface{}) error + func (fx *Fx) VerifyMultisigPermission(txIntf, inIntf, credIntf, ownerIntf, msigIntf interface{}) error + func (fx *Fx) VerifyMultisigTransfer(txIntf, inIntf, credIntf, utxoIntf, msigIntf interface{}) error + func (fx *Fx) VerifyOperation(txIntf, opIntf, credIntf interface{}, utxosIntf []interface{}) error + func (fx *Fx) VerifyPermission(txIntf, inIntf, credIntf, ownerIntf interface{}) error + func (fx *Fx) VerifySpend(utx UnsignedTx, in *TransferInput, cred *Credential, utxo *TransferOutput) error + func (fx *Fx) VerifyTransfer(txIntf, inIntf, credIntf, utxoIntf interface{}) error + type Input struct + SigIndices []uint32 + func (in *Input) Cost() (uint64, error) + func (in *Input) Verify() error + type Keychain struct + Addrs set.Set[ids.ShortID] + Keys []*secp256k1.PrivateKey + func NewKeychain(keys ...*secp256k1.PrivateKey) *Keychain + func (kc *Keychain) Add(key *secp256k1.PrivateKey) + func (kc *Keychain) Match(owners *OutputOwners, time uint64) ([]uint32, []*secp256k1.PrivateKey, bool) + func (kc *Keychain) New() (*secp256k1.PrivateKey, error) + func (kc *Keychain) PrefixedString(prefix string) string + func (kc *Keychain) Spend(out verify.Verifiable, time uint64) (verify.Verifiable, []*secp256k1.PrivateKey, error) + func (kc *Keychain) SpendMultiSig(out verify.Verifiable, time uint64, msigIntf interface{}) (verify.Verifiable, []*secp256k1.PrivateKey, error) + func (kc *Keychain) String() string + func (kc Keychain) Addresses() set.Set[ids.ShortID] + func (kc Keychain) Get(id ids.ShortID) (keychain.Signer, bool) + type MintOperation struct + MintInput Input + MintOutput MintOutput + TransferOutput TransferOutput + func (op *MintOperation) Cost() (uint64, error) + func (op *MintOperation) InitCtx(ctx *snow.Context) + func (op *MintOperation) Outs() []verify.State + func (op *MintOperation) Verify() error + type MintOutput struct + func (out *MintOutput) Verify() error + func (out *MintOutput) VerifyState() error + type MockAliasGetter struct + func NewMockAliasGetter(ctrl *gomock.Controller) *MockAliasGetter + func (m *MockAliasGetter) EXPECT() *MockAliasGetterMockRecorder + func (m *MockAliasGetter) GetMultisigAlias(arg0 ids.ShortID) (*multisig.AliasWithNonce, error) + type MockAliasGetterMockRecorder struct + func (mr *MockAliasGetterMockRecorder) GetMultisigAlias(arg0 interface{}) *gomock.Call + type MultisigCredential struct + SigIdxs []uint32 + func (mcr *MultisigCredential) MarshalJSON() ([]byte, error) + func (mcr *MultisigCredential) SignatureIndices() []uint32 + func (mcr *MultisigCredential) Verify() error + type OutputOwners struct + Addrs []ids.ShortID + Locktime uint64 + Threshold uint32 + func (out *OutputOwners) Addresses() [][]byte + func (out *OutputOwners) AddressesSet() set.Set[ids.ShortID] + func (out *OutputOwners) Equals(other *OutputOwners) bool + func (out *OutputOwners) Fields() (map[string]interface{}, error) + func (out *OutputOwners) InitCtx(ctx *snow.Context) + func (out *OutputOwners) IsZero() bool + func (out *OutputOwners) MarshalJSON() ([]byte, error) + func (out *OutputOwners) Sort() + func (out *OutputOwners) Verify() error + func (out *OutputOwners) VerifyState() error + type Owned interface + Owners func() interface{} + type RecoverMap map[ids.ShortID][secp256k1.SignatureLen]byte + type TestTx struct + UnsignedBytes []byte + func (tx *TestTx) Bytes() []byte + type TestVM struct + Clk mockable.Clock + Codec codec.Registry + Log logging.Logger + func (vm *TestVM) Clock() *mockable.Clock + func (vm *TestVM) CodecRegistry() codec.Registry + func (vm *TestVM) Logger() logging.Logger + type TransferInput struct + Amt uint64 + func (*TransferInput) InitCtx(*snow.Context) + func (in *TransferInput) Amount() uint64 + func (in *TransferInput) Equal(to any) bool + func (in *TransferInput) Verify() error + type TransferOutput struct + Amt uint64 + func (out *TransferOutput) Amount() uint64 + func (out *TransferOutput) Equal(to any) bool + func (out *TransferOutput) MarshalJSON() ([]byte, error) + func (out *TransferOutput) Owners() interface{} + func (out *TransferOutput) Verify() error + func (out *TransferOutput) VerifyState() error + type TransferOutputIntf interface + Amount func() uint64 + Owners func() interface{} + type TraverseAliasFunc func(alias *multisig.AliasWithNonce) + type TraverseOwnerFunc func(addr ids.ShortID, totalVisited, totalVerified uint32) (bool, error) + type UnsignedTx interface + Bytes func() []byte + type VM interface + Clock func() *mockable.Clock + CodecRegistry func() codec.Registry + Logger func() logging.Logger