utxo

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(url, network, blockcypherToken string) (*Handler, error)

func (*Handler) CallContract

func (h *Handler) CallContract(ctx context.Context, contractAddress, params, blockNumber string) ([]byte, error)

func (*Handler) CheckTx

func (h *Handler) CheckTx(ctx context.Context, hash string) (*chainrpc.TxResult, error)

func (*Handler) GetBalance

func (h *Handler) GetBalance(ctx context.Context, address, contractAddress, blockNumber string) (string, error)

func (*Handler) GetHeight

func (h *Handler) GetHeight(ctx context.Context) (string, error)

func (*Handler) GetTransfersByHash

func (h *Handler) GetTransfersByHash(ctx context.Context, hash string,
	confirmation uint64, withInternal bool) (*chainrpc.TxTransfers, error)

func (*Handler) InquireChain

func (h *Handler) InquireChain(ctx context.Context, instruction, params string) (string, error)

func (*Handler) SendTx

func (h *Handler) SendTx(ctx context.Context, signedHex string) (string, error)

type RpcBlock

type RpcBlock struct {
	Hash          string  `json:"hash"`
	Confirmations int64   `json:"confirmations"`
	Height        int64   `json:"height"`
	Version       int32   `json:"version"`
	MerkleRoot    string  `json:"merkleroot"`
	Time          int64   `json:"time"`
	Nonce         uint32  `json:"nonce"`
	Bits          string  `json:"bits"`
	Difficulty    float64 `json:"difficulty"`
	PreviousHash  string  `json:"previousblockhash"`
	NextHash      string  `json:"nextblockhash,omitempty"`
	Tx            []RpcTx `json:"tx"`
}

types

type RpcScriptPubKey

type RpcScriptPubKey struct {
	Asm       string   `json:"asm"`
	Hex       string   `json:"hex"`
	ReqSigs   int      `json:"reqSigs,omitempty"`
	Type      string   `json:"type"`
	Address   string   `json:"address,omitempty"`   // for BTC new version
	Addresses []string `json:"addresses,omitempty"` // for BTC old version and DOGE
}

types

type RpcTx

type RpcTx struct {
	Txid     string    `json:"txid"`
	Version  int32     `json:"version"`
	Locktime uint32    `json:"locktime"`
	Vin      []RpcVin  `json:"vin"`
	Vout     []RpcVout `json:"vout"`
}

types

type RpcVin

type RpcVin struct {
	Coinbase  string `json:"coinbase,omitempty"`
	Txid      string `json:"txid"`
	Vout      uint32 `json:"vout"`
	ScriptSig struct {
		Asm string `json:"asm"`
		Hex string `json:"hex"`
	} `json:"scriptSig"`
	TxinWitness []string `json:"txinwitness,omitempty"` //only for btc
	Sequence    uint32   `json:"sequence"`
}

types

type RpcVout

type RpcVout struct {
	Value        float64         `json:"value"`
	N            int             `json:"n"`
	ScriptPubKey RpcScriptPubKey `json:"scriptPubKey"`
}

types

Jump to

Keyboard shortcuts

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