erg

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErgBlock

type ErgBlock struct {
	HeaderId string  `json:"headerId"`
	Txs      []ErgTx `json:"transactions"`
}

type ErgBoxIds

type ErgBoxIds struct {
	Items []ErgTx `json:"items"`
}

type ErgHeader

type ErgHeader []struct {
	Timestamp int `json:"timestamp"`
	Height    int `json:"height"`
}

type ErgNode

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

func NewErgNode

func NewErgNode(client *retryablehttp.Client) (*ErgNode, error)

func (*ErgNode) ErgoTreeToAddress

func (n *ErgNode) ErgoTreeToAddress(ergoTree string) (string, error)

func (*ErgNode) GetCurrenHeight

func (n *ErgNode) GetCurrenHeight() (int, error)

func (*ErgNode) GetErgUtxoBox

func (n *ErgNode) GetErgUtxoBox(boxId string) (ErgTxOutputNode, error)

func (*ErgNode) GetTxFee added in v0.0.3

func (n *ErgNode) GetTxFee(txSize int) (int, error)

func (*ErgNode) GetUnconfirmedOutputsByErgoTree added in v0.0.4

func (n *ErgNode) GetUnconfirmedOutputsByErgoTree(ergoTree string, limit, offset int) ([]ErgTxOutputNode, error)

func (*ErgNode) GetUnconfirmedTxs

func (n *ErgNode) GetUnconfirmedTxs(limit, offset int) ([]ErgTxUnconfirmed, error)

func (*ErgNode) PostErgOracleTx

func (n *ErgNode) PostErgOracleTx(payload []byte) ([]byte, error)

func (*ErgNode) SerializeErgBox

func (n *ErgNode) SerializeErgBox(boxId string) (string, error)

type ErgTx

type ErgTx struct {
	Id            string        `json:"id"`
	Height        int           `json:"inclusionHeight"`
	Confirmations int           `json:"numConfirmations,omitempty"`
	Outputs       []ErgTxOutput `json:"outputs"`
}

type ErgTxOutput

type ErgTxOutput struct {
	BoxId               string    `json:"boxId"`
	AdditionalRegisters Registers `json:"additionalRegisters,omitempty"`
	ErgoTree            string    `json:"ergoTree"`
}

type ErgTxOutputNode

type ErgTxOutputNode struct {
	BoxId               string        `json:"boxId"`
	Assets              []Tokens      `json:"assets,omitempty"`
	AdditionalRegisters RegistersNode `json:"additionalRegisters,omitempty"`
	ErgoTree            string        `json:"ergoTree"`
	TxId                string        `json:"transactionId"`
}

type ErgTxUnconfirmed

type ErgTxUnconfirmed struct {
	Id            string            `json:"id"`
	Height        int               `json:"inclusionHeight"`
	Confirmations int               `json:"numConfirmations,omitempty"`
	Outputs       []ErgTxOutputNode `json:"outputs"`
}

type Explorer

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

func NewExplorer

func NewExplorer(client *retryablehttp.Client) (*Explorer, error)

func (*Explorer) GetErgTx

func (e *Explorer) GetErgTx(unconfirmedTx string) (ErgTx, error)

func (*Explorer) GetOracleTxs

func (e *Explorer) GetOracleTxs(minHeight, maxHeight, limit, offset int) (ErgBoxIds, error)

type Reg

type Reg struct {
	Value string `json:"renderedValue"`
}

type Registers

type Registers struct {
	R4 Reg `json:"R4"`
	R5 Reg `json:"R5"`
}

type RegistersNode

type RegistersNode struct {
	R4 string `json:"R4"`
	R5 string `json:"R5"`
	R6 string `json:"R6"`
}

type Serialized

type Serialized struct {
	BoxId string `json:"boxId"`
	Bytes string `json:"bytes"`
}

type Tokens

type Tokens struct {
	TokenId string `json:"tokenId"`
	Amount  int    `json:"amount"`
}

Jump to

Keyboard shortcuts

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