Documentation
¶
Index ¶
- type Client
- func (c *Client) CheckTxStatus(ctx context.Context, tx *common.Hash) (bool, error)
- func (c *Client) Execute(ctx context.Context, message *bsctypes.ExecutorMessages) (*common.Hash, error)
- func (c *Client) GetCallbackGasPrice(ctx context.Context) (gasPrice *big.Int, err error)
- func (c *Client) GetDefaultAccount() (*bsctypes.BscAccount, error)
- func (c *Client) GetDeployment() *bsctypes.Deployment
- func (c *Client) GetMinAckRelayFee(ctx context.Context) (relayFee *big.Int, minAckRelayFee *big.Int, err error)
- func (c *Client) SendMessages(ctx context.Context, message *bsctypes.MultiMessage) (*common.Hash, error)
- func (c *Client) SendTx(ctx context.Context, nonce uint64, toAddr *common.Address, amount *big.Int, ...) (*common.Hash, error)
- func (c *Client) SetDefaultAccount(account *bsctypes.BscAccount)
- type IAccountClient
- type IBasicClient
- type IClient
- type IGreenfieldExecutorClient
- type IMultiMessageClient
- type Option
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 (*Client) GetCallbackGasPrice ¶
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 (*Client) SendMessages ¶
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 ¶
type IClient interface { IMultiMessageClient IGreenfieldExecutorClient IBasicClient IAccountClient }
IClient - Declare all BSC SDK Client APIs, including APIs for multi messages & greenfield executor
type IMultiMessageClient ¶
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.