Documentation ¶
Index ¶
- Variables
- func GetJubileeHeight(network common.Network) uint64
- type Envelope
- type Fields
- type Inscription
- type InscriptionEntry
- type InscriptionId
- type PushScriptBuilder
- func (b *PushScriptBuilder) AddData(data []byte) *PushScriptBuilder
- func (b *PushScriptBuilder) AddFullData(data []byte) *PushScriptBuilder
- func (b *PushScriptBuilder) AddOp(opcode byte) *PushScriptBuilder
- func (b *PushScriptBuilder) AddOps(opcodes []byte) *PushScriptBuilder
- func (b *PushScriptBuilder) Script() ([]byte, error)
- type SatPoint
- type Tag
Constants ¶
This section is empty.
Variables ¶
var ( TagBody = Tag(0) TagPointer = Tag(2) // TagUnbound is unrecognized TagUnbound = Tag(66) TagContentType = Tag(1) TagParent = Tag(3) TagMetadata = Tag(5) TagMetaprotocol = Tag(7) TagContentEncoding = Tag(9) TagDelegate = Tag(11) // TagNop is unrecognized TagNop = Tag(255) )
var ErrInscriptionIdInvalidSeparator = fmt.Errorf("invalid inscription id: must contain exactly one separator")
var ErrSatPointInvalidSeparator = fmt.Errorf("invalid sat point: must contain exactly two separators")
Functions ¶
func GetJubileeHeight ¶
Types ¶
type Envelope ¶
type Envelope struct { Inscription Inscription InputIndex uint32 // Index of input that contains the envelope Offset int // Number of envelope in the input PushNum bool // True if envelope contains pushnum opcodes Stutter bool // True if envelope matches stuttering curse structure IncompleteField bool // True if payload is incomplete DuplicateField bool // True if payload contains duplicated field UnrecognizedEvenField bool // True if payload contains unrecognized even field }
func ParseEnvelopesFromTx ¶
func ParseEnvelopesFromTx(tx *types.Transaction) []*Envelope
type Inscription ¶
type Inscription struct { Content []byte ContentEncoding string ContentType string Delegate *InscriptionId Metadata []byte Metaprotocol string Parent *InscriptionId // in 0.14, inscription has only one parent Pointer *uint64 }
type InscriptionEntry ¶
type InscriptionEntry struct { Id InscriptionId Number int64 SequenceNumber uint64 Cursed bool CursedForBRC20 bool CreatedAt time.Time CreatedAtHeight uint64 Inscription Inscription TransferCount uint32 }
TODO: refactor ordinals.InscriptionEntry to entity.InscriptionEntry
type InscriptionId ¶
func NewInscriptionId ¶
func NewInscriptionId(txHash chainhash.Hash, index uint32) InscriptionId
func NewInscriptionIdFromString ¶
func NewInscriptionIdFromString(s string) (InscriptionId, error)
func (InscriptionId) MarshalJSON ¶
func (r InscriptionId) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (InscriptionId) String ¶
func (i InscriptionId) String() string
func (*InscriptionId) UnmarshalJSON ¶
func (r *InscriptionId) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler
type PushScriptBuilder ¶
type PushScriptBuilder struct {
// contains filtered or unexported fields
}
PushScriptBuilder is a helper to build scripts that requires data pushes to use OP_PUSHDATA* or OP_DATA_* opcodes only. Empty data pushes are still encoded as OP_0.
func NewPushScriptBuilder ¶
func NewPushScriptBuilder() *PushScriptBuilder
func (*PushScriptBuilder) AddData ¶
func (b *PushScriptBuilder) AddData(data []byte) *PushScriptBuilder
AddData pushes the passed data to the end of the script. It automatically chooses canonical opcodes depending on the length of the data. A zero length buffer will lead to a push of empty data onto the stack (OP_0) and any push of data greater than MaxScriptElementSize will not modify the script since that is not allowed by the script engine. Also, the script will not be modified if pushing the data would cause the script to exceed the maximum allowed script engine size.
func (*PushScriptBuilder) AddFullData ¶
func (b *PushScriptBuilder) AddFullData(data []byte) *PushScriptBuilder
AddFullData should not typically be used by ordinary users as it does not include the checks which prevent data pushes larger than the maximum allowed sizes which leads to scripts that can't be executed. This is provided for testing purposes such as regression tests where sizes are intentionally made larger than allowed.
Use AddData instead.
func (*PushScriptBuilder) AddOp ¶
func (b *PushScriptBuilder) AddOp(opcode byte) *PushScriptBuilder
AddOp pushes the passed opcode to the end of the script. The script will not be modified if pushing the opcode would cause the script to exceed the maximum allowed script engine size.
func (*PushScriptBuilder) AddOps ¶
func (b *PushScriptBuilder) AddOps(opcodes []byte) *PushScriptBuilder
AddOps pushes the passed opcodes to the end of the script. The script will not be modified if pushing the opcodes would cause the script to exceed the maximum allowed script engine size.
func (*PushScriptBuilder) Script ¶
func (b *PushScriptBuilder) Script() ([]byte, error)
Script returns the currently built script. When any errors occurred while building the script, the script will be returned up the point of the first error along with the error.
type SatPoint ¶
func NewSatPointFromString ¶
func (SatPoint) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*SatPoint) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler