rpc

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evm

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

func NewEvm

func NewEvm(c context.Context, rpcURL string) (*Evm, error)

func (*Evm) GetTxStatus

func (r *Evm) GetTxStatus(ct context.Context, txHash string) (TxOnChainStatus, error)

type MayaChain added in v0.1.19

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

func NewMayaChain added in v0.1.19

func NewMayaChain(rpcURL string) (*MayaChain, error)

func (*MayaChain) GetTxStatus added in v0.1.19

func (m *MayaChain) GetTxStatus(ctx context.Context, txHash string) (TxOnChainStatus, error)

type Rpc

type Rpc interface {
	GetTxStatus(ctx context.Context, txHash string) (TxOnChainStatus, error)
}

type Solana

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

func NewSolana

func NewSolana(rpcURL string) (*Solana, error)

func (*Solana) GetTxStatus

func (s *Solana) GetTxStatus(ctx context.Context, txHash string) (TxOnChainStatus, error)

type THORChain added in v0.1.16

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

func NewTHORChain added in v0.1.16

func NewTHORChain(rpcURL string) (*THORChain, error)

func (*THORChain) GetTxStatus added in v0.1.16

func (t *THORChain) GetTxStatus(ctx context.Context, txHash string) (TxOnChainStatus, error)

type Tron added in v0.1.17

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

func NewTron added in v0.1.17

func NewTron(ctx context.Context, rpcURL string) (*Tron, error)

func (*Tron) GetTxStatus added in v0.1.17

func (t *Tron) GetTxStatus(ctx context.Context, txHash string) (TxOnChainStatus, error)

type TronReceipt added in v0.1.17

type TronReceipt struct {
	Result           string `json:"result,omitempty"` // "SUCCESS" or empty for success, "REVERT" or others for failure
	NetFee           int64  `json:"net_fee,omitempty"`
	NetUsage         int64  `json:"net_usage,omitempty"`
	EnergyUsage      int64  `json:"energy_usage,omitempty"`
	EnergyUsageTotal int64  `json:"energy_usage_total,omitempty"`
}

type TronRequest added in v0.1.17

type TronRequest struct {
	Value string `json:"value"`
}

type TronTransactionInfoResponse added in v0.1.17

type TronTransactionInfoResponse struct {
	ID             string      `json:"id"`
	BlockNumber    int64       `json:"blockNumber"`
	BlockTimeStamp int64       `json:"blockTimeStamp"`
	ContractResult []string    `json:"contractResult"`
	Receipt        TronReceipt `json:"receipt"`
	Result         string      `json:"result,omitempty"` // "FAILED" if failed
}

TronTransactionInfoResponse represents the response from gettransactioninfobyid

type TxOnChainStatus

type TxOnChainStatus string
const (
	TxOnChainPending TxOnChainStatus = "PENDING"
	TxOnChainSuccess TxOnChainStatus = "SUCCESS"
	TxOnChainFail    TxOnChainStatus = "FAIL"
)

type Utxo added in v0.1.16

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

Utxo is a generic UTXO chain RPC client that uses Blockchair API. It supports any UTXO chain that Blockchair provides (litecoin, dogecoin, bitcoin-cash, etc.)

func NewBitcoin

func NewBitcoin(baseURL string) (*Utxo, error)

NewBitcoin creates a Bitcoin RPC client using Blockchair API. This uses the same Blockchair REST API as other UTXO chains.

func NewBitcoinCash added in v0.1.16

func NewBitcoinCash(baseURL string) (*Utxo, error)

NewBitcoinCash creates a Bitcoin Cash RPC client using Blockchair

func NewDash added in v0.1.19

func NewDash(baseURL string) (*Utxo, error)

NewDash creates a Dash RPC client using Blockchair

func NewDogecoin added in v0.1.16

func NewDogecoin(baseURL string) (*Utxo, error)

NewDogecoin creates a Dogecoin RPC client using Blockchair

func NewLitecoin added in v0.1.16

func NewLitecoin(baseURL string) (*Utxo, error)

NewLitecoin creates a Litecoin RPC client using Blockchair

func NewUtxo added in v0.1.16

func NewUtxo(baseURL, chainPath string) (*Utxo, error)

NewUtxo creates a new UTXO RPC client for the specified chain. chainPath should be the Blockchair API path for the chain (e.g., "litecoin", "dogecoin", "bitcoin-cash")

func (*Utxo) GetTxStatus added in v0.1.16

func (u *Utxo) GetTxStatus(ctx context.Context, txHash string) (TxOnChainStatus, error)

GetTxStatus retrieves the on-chain status of a transaction by its hash. Returns TxOnChainPending if the transaction is not yet confirmed or not found, TxOnChainSuccess if the transaction is confirmed with at least one confirmation, or an error if the HTTP request or response parsing fails.

type XRP

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

func NewXRP

func NewXRP(rpcURL string) (*XRP, error)

func (*XRP) GetTxStatus

func (x *XRP) GetTxStatus(ctx context.Context, txHash string) (TxOnChainStatus, error)

type XRPRequest

type XRPRequest struct {
	Method string `json:"method"`
	Params []any  `json:"params"`
}

type XRPTransactionMeta

type XRPTransactionMeta struct {
	TransactionResult string `json:"TransactionResult"`
}

type XRPTransactionParams

type XRPTransactionParams struct {
	Transaction string `json:"transaction"`
	Binary      bool   `json:"binary"`
}

type XRPTransactionResponse

type XRPTransactionResponse struct {
	Result struct {
		TransactionIndex int                    `json:"TransactionIndex"`
		Meta             XRPTransactionMeta     `json:"meta"`
		Transaction      map[string]interface{} `json:"transaction"`
		Validated        bool                   `json:"validated"`
	} `json:"result"`
	Status string      `json:"status"`
	Type   string      `json:"type"`
	Error  interface{} `json:"error,omitempty"`
}

type Zcash added in v0.1.16

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

func NewZcash added in v0.1.16

func NewZcash(baseURL string) (*Zcash, error)

func (*Zcash) GetTxStatus added in v0.1.16

func (z *Zcash) GetTxStatus(ctx context.Context, txHash string) (TxOnChainStatus, error)

GetTxStatus retrieves the on-chain status of a Zcash transaction by its hash. Returns TxOnChainPending if the transaction is not yet confirmed or not found, TxOnChainSuccess if the transaction is confirmed with at least one confirmation, or an error if the HTTP request or response parsing fails.

Jump to

Keyboard shortcuts

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