sdk

package
v1.5.66-0...-1e0c951 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Some RPC functions aren't implemented like .Tx() and .TxSearch() because they are disable with the postgres indexer. This file has re-implementations of those so the SDK can support all RPC methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Debug(msg string, args ...interface{})
	Info(msg string, args ...interface{})
	Warn(msg string, args ...interface{})
	Error(msg string, args ...interface{})
}

type NoOpLogger

type NoOpLogger struct{}

NoOpLogger is a logger that does nothing.

func NewNoOpLogger

func NewNoOpLogger() *NoOpLogger

NewNoOpLogger creates a new NoOpLogger instance.

func (*NoOpLogger) Debug

func (l *NoOpLogger) Debug(msg string, args ...interface{})

func (*NoOpLogger) Error

func (l *NoOpLogger) Error(msg string, args ...interface{})

func (*NoOpLogger) Info

func (l *NoOpLogger) Info(msg string, args ...interface{})

func (*NoOpLogger) Warn

func (l *NoOpLogger) Warn(msg string, args ...interface{})

type Sdk

type Sdk struct {
	OAPIEndpoint string
	GRPCEndpoint string
	JRPCEndpoint string
	protocol.ClientService
	proto.ProtocolClient
	http.HTTP
	// contains filtered or unexported fields
}

func NewSdk

func NewSdk(opts ...SdkOption) (*Sdk, error)

func (*Sdk) Tx

func (sdk *Sdk) Tx(ctx context.Context, hash []byte, _ bool) (*ctypes.ResultTx, error)

func (*Sdk) TxSearch

func (sdk *Sdk) TxSearch(
	ctx context.Context,
	query string,
	prove bool,
	page,
	perPage *int,
	orderBy string,
) (*ctypes.ResultTxSearch, error)

type SdkOption

type SdkOption func(*Sdk)

func WithGrpcendpoint

func WithGrpcendpoint(GRPCEndpoint string) SdkOption

func WithJrpcendpoint

func WithJrpcendpoint(JRPCEndpoint string) SdkOption

func WithLogger

func WithLogger(logger Logger) SdkOption

func WithOapiendpoint

func WithOapiendpoint(OAPIEndpoint string) SdkOption

func WithPrivkey

func WithPrivkey(privKey string) SdkOption

func WithUsehttps

func WithUsehttps(useHttps bool) SdkOption

Jump to

Keyboard shortcuts

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