omnilock

package
v2.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Flag        OmnilockFlag
	AuthContent []byte
}

func UnpackAuth

func UnpackAuth(v *molecule.Auth) *Auth

type AuthFlag

type AuthFlag byte
const (
	AuthFlagCKBSecp256k1Blake160 AuthFlag = 0x0
	AuthFlagEthereum             AuthFlag = 0x1
	AuthFlagEOS                  AuthFlag = 0x2
	AuthFlagTRON                 AuthFlag = 0x3
	AuthFlagBitcoin              AuthFlag = 0x4
	AuthFlagDogcoin              AuthFlag = 0x5
	AuthFlagCKBMultiSig          AuthFlag = 0x6
	AuthFlagLockScriptHash       AuthFlag = 0xFC
	AuthFlagExec                 AuthFlag = 0xFD
	AuthFlagDynamicLinking       AuthFlag = 0xFE
)

type Authentication

type Authentication struct {
	Flag        AuthFlag
	AuthContent [20]byte
}

func DecodeToAuthentication

func DecodeToAuthentication(in []byte) (*Authentication, error)

func (Authentication) Encode

func (a Authentication) Encode() []byte

type OmniConfig

type OmniConfig struct {
	Flag                     byte
	AdminListCellTypeId      [32]byte
	MinimumCKBExponentInAcp  byte
	MinimumSUDTExponentInAcp byte
	SinceForTimeLock         uint8
	TypeScriptHashForSupply  [32]byte
}

func DecodeToOmniConfig

func DecodeToOmniConfig(in []byte) (*OmniConfig, error)

func (OmniConfig) Encode

func (o OmniConfig) Encode() []byte

func (OmniConfig) IsAdminModeEnabled

func (o OmniConfig) IsAdminModeEnabled() bool

func (OmniConfig) IsAnyoneCanPayModeEnabled

func (o OmniConfig) IsAnyoneCanPayModeEnabled() bool

func (OmniConfig) IsSupplyModeEnabled

func (o OmniConfig) IsSupplyModeEnabled() bool

func (OmniConfig) IsTimeLockModeEnabled

func (o OmniConfig) IsTimeLockModeEnabled() bool

type OmnilockArgs

type OmnilockArgs struct {
	Authentication *Authentication
	OmniConfig     *OmniConfig
}

func NewOmnilockArgsFromAddress

func NewOmnilockArgsFromAddress(address string) (*OmnilockArgs, error)

func NewOmnilockArgsFromAgrs

func NewOmnilockArgsFromAgrs(args []byte) (*OmnilockArgs, error)

func (OmnilockArgs) Encode

func (o OmnilockArgs) Encode() []byte

type OmnilockFlag

type OmnilockFlag byte
const (
	OmnilockFlagCKBSecp256k1Blake160 OmnilockFlag = 0x0
	OmnilockFlagLockScriptHash       OmnilockFlag = 0xfc
)

type OmnilockIdentity

type OmnilockIdentity struct {
	Identity *Auth
	Proofs   []*SmtProofEntry
}

func UnpackIdentityOpt

func UnpackIdentityOpt(v *molecule.IdentityOpt) *OmnilockIdentity

func (*OmnilockIdentity) Pack

func (o *OmnilockIdentity) Pack() *molecule.Identity

func (*OmnilockIdentity) PackOpt

func (o *OmnilockIdentity) PackOpt() *molecule.IdentityOpt

type OmnilockWitnessLock

type OmnilockWitnessLock struct {
	Signature        []byte
	OmnilockIdentity *OmnilockIdentity
	Preimage         []byte
}

func DeserializeOmnilockWitnessLock

func DeserializeOmnilockWitnessLock(in []byte) (*OmnilockWitnessLock, error)

func (*OmnilockWitnessLock) Pack

func (*OmnilockWitnessLock) Serialize

func (o *OmnilockWitnessLock) Serialize() []byte

func (*OmnilockWitnessLock) SerializeAsPlaceholder

func (o *OmnilockWitnessLock) SerializeAsPlaceholder() []byte

type SmtProofEntry

type SmtProofEntry struct {
	Mask     byte
	SmtProof []byte
}

func UnpackSmtProofEntry

func UnpackSmtProofEntry(v *molecule.SmtProofEntry) *SmtProofEntry

func (*SmtProofEntry) Pack

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL