bsc

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: LGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client - The implementation for IClient, implement all Client APIs for Greenfield SDK.

func (*Client) CheckTxStatus

func (c *Client) CheckTxStatus(ctx context.Context, tx *common.Hash) (bool, error)

func (*Client) Execute

func (c *Client) Execute(ctx context.Context, message *bsctypes.ExecutorMessages) (*common.Hash, error)

func (*Client) GetCallbackGasPrice

func (c *Client) GetCallbackGasPrice(ctx context.Context) (gasPrice *big.Int, err error)

func (*Client) GetDefaultAccount added in v1.7.1

func (c *Client) GetDefaultAccount() (*bsctypes.BscAccount, error)

GetDefaultAccount - Get the default account of the Client.

- ret1: The default account of the Client.

- ret2: Return error when default account doesn't exist, otherwise return nil.

func (*Client) GetDeployment

func (c *Client) GetDeployment() *bsctypes.Deployment

func (*Client) GetMinAckRelayFee

func (c *Client) GetMinAckRelayFee(ctx context.Context) (relayFee *big.Int, minAckRelayFee *big.Int, err error)

func (*Client) SendMessages

func (c *Client) SendMessages(ctx context.Context, message *bsctypes.MultiMessage) (*common.Hash, error)

func (*Client) SendTx

func (c *Client) SendTx(ctx context.Context, nonce uint64, toAddr *common.Address, amount *big.Int, gasPrice *big.Int, data []byte) (*common.Hash, error)

func (*Client) SetDefaultAccount added in v1.7.1

func (c *Client) SetDefaultAccount(account *bsctypes.BscAccount)

SetDefaultAccount - Set the default account of the Client.

If you call other APIs without specifying the account, it will be assumed that you are operating on the default account. This includes sending transactions and other actions.

- account: The account to be set as the default account, should be created using a private key or a mnemonic phrase.

type IAccountClient added in v1.7.1

type IAccountClient interface {
	SetDefaultAccount(account *bsctypes.BscAccount)
	GetDefaultAccount() (*bsctypes.BscAccount, error)
}

type IBasicClient

type IBasicClient interface {
	SendTx(ctx context.Context, nonce uint64, toAddr *common.Address, amount *big.Int, gasPrice *big.Int, data []byte) (*common.Hash, error)
	GetDeployment() *bsctypes.Deployment
	GetMinAckRelayFee(ctx context.Context) (relayFee *big.Int, minAckRelayFee *big.Int, err error)
	GetCallbackGasPrice(ctx context.Context) (gasPrice *big.Int, err error)
	CheckTxStatus(ctx context.Context, tx *common.Hash) (bool, error)
}

type IClient

IClient - Declare all BSC SDK Client APIs, including APIs for multi messages & greenfield executor

func New

func New(rpcURL string, env bsctypes.Environment, option Option) (IClient, error)

type IGreenfieldExecutorClient

type IGreenfieldExecutorClient interface {
	Execute(ctx context.Context, message *bsctypes.ExecutorMessages) (*common.Hash, error)
}

type IMultiMessageClient

type IMultiMessageClient interface {
	SendMessages(ctx context.Context, message *bsctypes.MultiMessage) (*common.Hash, error)
}

type Option

type Option struct {
	// GrpcDialOption is the list of gRPC dial options used to configure the connection to the blockchain node.
	GrpcDialOption grpc.DialOption
	// DefaultAccount is the default account of Client.
	DefaultAccount *bsctypes.BscAccount
	// Secure is a flag that specifies whether the Client should use HTTPS or not.
	Secure bool
	// Transport is the HTTP transport used to send requests to the storage provider endpoint.
	Transport http.RoundTripper
	// Host is the target sp server hostname.
	Host string
}

Option - Configurations for providing optional parameters for the Binance Smart Chain SDK Client.

Jump to

Keyboard shortcuts

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