protocol

package
v0.0.0-...-73b4c3b Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Hex      = "h"
	Numeric  = "n"
	UnixTime = "x"
	String   = "s"
	Boolean  = "b"
)

Data Types

View Source
const (
	Horizontal = "h"
	Vertical   = "v"
	Diagonal   = "d"
	Add        = "a"
)

Dimension

View Source
const (
	DmtDeploy     = "dmt-deploy"
	DmtMint       = "dmt-mint"
	TokenTransfer = "token-transfer"
)

Dmt Op

Variables

View Source
var FieldMap = map[int]Field{
	0: {
		FieldNum:    0,
		FieldName:   "block_hash",
		FieldGroup:  "block",
		DefaultType: Hex,
	},
	1: {
		FieldNum:    1,
		FieldName:   "size",
		FieldGroup:  "block",
		DefaultType: Numeric,
	},
	2: {
		FieldNum:    2,
		FieldName:   "strippedsize",
		FieldGroup:  "block",
		DefaultType: Numeric,
	},
	3: {
		FieldNum:    3,
		FieldName:   "weight",
		FieldGroup:  "block",
		DefaultType: Numeric,
	},
	4: {
		FieldNum:    4,
		FieldName:   "height",
		FieldGroup:  "block",
		DefaultType: Numeric,
	},
	5: {
		FieldNum:    5,
		FieldName:   "version",
		FieldGroup:  "block",
		DefaultType: Numeric,
	},
	6: {
		FieldNum:    6,
		FieldName:   "versionHex",
		FieldGroup:  "block",
		DefaultType: Hex,
	},
	7: {
		FieldNum:    7,
		FieldName:   "merkleroot",
		FieldGroup:  "block",
		DefaultType: Hex,
	},
	8: {
		FieldNum:    8,
		FieldName:   "time",
		FieldGroup:  "block",
		DefaultType: UnixTime,
	},
	9: {
		FieldNum:    9,
		FieldName:   "mediantime",
		FieldGroup:  "block",
		DefaultType: UnixTime,
	},
	10: {
		FieldNum:    10,
		FieldName:   "nonce",
		FieldGroup:  "block",
		DefaultType: Numeric,
	},
	11: {
		FieldNum:    11,
		FieldName:   "bits",
		FieldGroup:  "block",
		DefaultType: Hex,
	},
	12: {
		FieldNum:    12,
		FieldName:   "difficulty",
		FieldGroup:  "block",
		DefaultType: Numeric,
	},
	13: {
		FieldNum:    13,
		FieldName:   "chainwork",
		FieldGroup:  "block",
		DefaultType: Hex,
	},
	14: {
		FieldNum:    14,
		FieldName:   "nTx",
		FieldGroup:  "block",
		DefaultType: Numeric,
	},
	15: {
		FieldNum:    15,
		FieldName:   Hex,
		FieldGroup:  "transaction",
		DefaultType: Hex,
	},

	16: {
		FieldNum:    16,
		FieldName:   "txid",
		FieldGroup:  "transaction",
		DefaultType: Hex,
	},
	17: {
		FieldNum:    17,
		FieldName:   "tx_hash",
		FieldGroup:  "transaction",
		DefaultType: Hex,
	},
	18: {
		FieldNum:    18,
		FieldName:   "size",
		FieldGroup:  "transaction",
		DefaultType: Numeric,
	},
	19: {
		FieldNum:    19,
		FieldName:   "vsize",
		FieldGroup:  "transaction",
		DefaultType: Numeric,
	},

	20: {
		FieldNum:    20,
		FieldName:   "weight",
		FieldGroup:  "transaction",
		DefaultType: Numeric,
	},
	21: {
		FieldNum:    21,
		FieldName:   "version",
		FieldGroup:  "transaction",
		DefaultType: Numeric,
	},
	22: {
		FieldNum:    22,
		FieldName:   "locktime",
		FieldGroup:  "transaction",
		DefaultType: UnixTime,
	},
	23: {
		FieldNum:    23,
		FieldName:   "blocktime",
		FieldGroup:  "transaction",
		DefaultType: UnixTime,
	},
	24: {
		FieldNum:    24,
		FieldName:   "asm",
		FieldGroup:  "input",
		DefaultType: String,
	},
	25: {
		FieldNum:    25,
		FieldName:   Hex,
		FieldGroup:  "input",
		DefaultType: Hex,
	},
	26: {
		FieldNum:    26,
		FieldName:   "sequence",
		FieldGroup:  "input",
		DefaultType: Numeric,
	},
	27: {
		FieldNum:    27,
		FieldName:   "txinwitness",
		FieldGroup:  "input",
		DefaultType: Hex,
	},

	28: {
		FieldNum:    28,
		FieldName:   "value",
		FieldGroup:  "input",
		DefaultType: Numeric,
	},
	29: {
		FieldNum:    29,
		FieldName:   Numeric,
		FieldGroup:  "input",
		DefaultType: Numeric,
	},
	30: {
		FieldNum:    30,
		FieldName:   "asm",
		FieldGroup:  "output",
		DefaultType: String,
	},
	31: {
		FieldNum:    31,
		FieldName:   Hex,
		FieldGroup:  "output",
		DefaultType: String,
	},
	32: {
		FieldNum:    32,
		FieldName:   "reqSigs",
		FieldGroup:  "output",
		DefaultType: Numeric,
	},
	33: {
		FieldNum:    33,
		FieldName:   "type",
		FieldGroup:  "output",
		DefaultType: String,
	},
	34: {
		FieldNum:    34,
		FieldName:   "witness",
		FieldGroup:  "extras",
		DefaultType: Boolean,
	},
	35: {
		FieldNum:    35,
		FieldName:   "btc_fee",
		FieldGroup:  "extras",
		DefaultType: Numeric,
	},
	36: {
		FieldNum:    36,
		FieldName:   "is_coinbase",
		FieldGroup:  "extras",
		DefaultType: Boolean,
	},
	37: {
		FieldNum:    37,
		FieldName:   "coinbase",
		FieldGroup:  "extras",
		DefaultType: Hex,
	},
}
View Source
var InvalidChar = []rune{'/', '.', '[', ']', '{', '}', ':', ';', '"', '\'', ' '}

InvalidChar character in name

Functions

This section is empty.

Types

type DMTDeploy

type DMTDeploy struct {
	Protocol  string `json:"p"`    // Protocol: TAP
	Operation string `json:"op"`   // Operation: Event (dmt-deploy, token-mint, token-transfer)
	Element   string `json:"elem"` // Element: Reference to the .element inscriptionID
	Ticker    string `json:"tick"` // Ticker: 3 and 5 to 32 (UTF16)
	Project   string `json:"prj"`  // Project: Reference to existing project's (i.e. 0.bitmap) inscriptionID
	Dimension string `json:"dim"`  // Dimension: Only required if you're recognizing a pattern in a given field. (horizontal, vertical, diagonal, add) 'add' represents the sum of 'h', 'v', and 'd', counts of the given pattern.
	DataTypes string `json:"dt"`   // Data Types: "h" hex, "n" numeric, "x" unix time, "s" string, "b" boolean. If the "dt" field is left out, the data type set within the block data is used by default. ⚠️ If the element you choose has a pattern, "dt" in your deploy inscription is required. ⚠️
	Id        string `json:"id"`   // ID: this is the inscription id of your UNAT content. (generative script art, 3d model, app)
}

DMTDeploy

{
	"p": "tap",
	"op": "dmt-deploy",
	"elem": "<inscriptionID>",
	"tick": "<name>",
	"prj": "<0.bitmap inscriptionID>",
	"dim": "h | v | d | a",
	"dt": "h | n | x | s | b",
	"id": "<content inscriptionID>"
}

func (*DMTDeploy) Type

func (d *DMTDeploy) Type() string

type DMTMint

type DMTMint struct {
	Protocol  string `json:"p"`    // Protocol: TAP
	Operation string `json:"op"`   // Operation: Event (dmt-deploy, token-mint, token-transfer)
	Deploy    string `json:"dep"`  // Deploy: Reference to the dmt-deploy inscriptionID. Note: "dep" will be optional from a block height TBA)
	Ticker    string `json:"tick"` // Ticker: Matches the ticker in the dmt-deploy inscription
	Block     string `json:"blk"`  // Block: Inscribe a block number of your choosing. ⚠️ First is first.
}

DMTMint

{
	"p": "tap",
	"op": "dmt-mint",
	"dep": "<inscriptionID>",
	"tick": "<name>",
	"blk": "#"
}

type DMTTransfer

type DMTTransfer struct {
	Protocol  string `json:"p"`    // Protocol: TAP
	Operation string `json:"op"`   // Operation: Event (dmt-deploy, token-mint, token-transfer)
	Ticker    string `json:"tick"` // Ticker: Matches the ticker in the token-mint inscription
	Amount    string `json:"amt"`  // Amount: Chose an amount of NATs to transfer.
}

DMTTransfer

{
	"p": "tap",
	"op": "token-transfer",
	"tick": "dmt-<name>",
	"amt": "#"
}

type Element

type Element struct {
	// contains filtered or unexported fields
}

Element format : <name>.<pattern>.<field>.element

func (*Element) IsAvailable

func (e *Element) IsAvailable(block *wire.MsgBlock) bool

func (*Element) IsValid

func (e *Element) IsValid(elements []Element) bool

func (*Element) String

func (e *Element) String() string

type Field

type Field struct {
	FieldNum    int    `json:"field_num"`
	FieldName   string `json:"field_name"`
	FieldGroup  string `json:"field_group"`
	DefaultType string `json:"default_type"`
}

Jump to

Keyboard shortcuts

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