Documentation ¶
Index ¶
- Variables
- type BcosSDK
- func (sdk *BcosSDK) BuildSDKWithParam(keyFile string, callback PostCallback, groupID int, chainID int64, ...) *BuildSDKResult
- func (sdk *BcosSDK) Call(abiContract string, address string, method string, params string, ...) *CallResult
- func (sdk *BcosSDK) DeployContract(contractAbi string, contractBin string, params string) *ReceiptResult
- func (sdk *BcosSDK) GetBlockNumber() *RPCResult
- func (sdk *BcosSDK) GetCallOpts() *bind.CallOpts
- func (sdk *BcosSDK) GetClientVersion() *RPCResult
- func (sdk *BcosSDK) GetTransactOpts() *bind.TransactOpts
- func (sdk *BcosSDK) GetTransactionByHash(txHash string) *TransactionResult
- func (sdk *BcosSDK) GetTransactionReceipt(txHash string) *ReceiptResult
- func (sdk *BcosSDK) SendTransaction(contractAbi string, address string, method string, params string) *ReceiptResult
- type BuildSDKResult
- type CallResult
- type ContractParams
- type ContractProxy
- func (c *ContractProxy) AsyncSendTransaction(ctx context.Context, tx *types.Transaction, ...) error
- func (c *ContractProxy) Call(ctx context.Context, groupID int, msg ethereum.CallMsg) ([]byte, error)
- func (c *ContractProxy) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
- func (c *ContractProxy) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (c *ContractProxy) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)
- func (c *ContractProxy) GetBlockLimit(ctx context.Context) (*big.Int, error)
- func (c *ContractProxy) GetChainID(ctx context.Context) (*big.Int, error)
- func (c *ContractProxy) GetContractAddress(ctx context.Context, txHash common.Hash) (common.Address, error)
- func (c *ContractProxy) GetGroupID() *big.Int
- func (c *ContractProxy) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
- func (c *ContractProxy) SMCrypto() bool
- func (c *ContractProxy) SendTransaction(ctx context.Context, tx *types.Transaction) (*types.Receipt, error)
- func (c *ContractProxy) SubscribeEventLogs(eventLogParams types.EventLogParams, handler func(int, []types.Log)) (string, error)
- func (c *ContractProxy) UnSubscribeEventLogs(filterID string) error
- type FullTransaction
- type NetworkResponse
- type PostCallback
- type RPCResult
- type ReceiptResult
- type TransactionResult
- type TxReceipt
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoResult = errors.New("no result in JSON-RPC response")
)
Functions ¶
This section is empty.
Types ¶
type BcosSDK ¶
type BcosSDK struct {
// contains filtered or unexported fields
}
func (*BcosSDK) BuildSDKWithParam ¶
func (sdk *BcosSDK) BuildSDKWithParam(keyFile string, callback PostCallback, groupID int, chainID int64, isSMCrypto bool) *BuildSDKResult
BuildSDKWithParam Connect to the proxy or FISCO BCOS node. Please make sure ca.crt, sdk.crt, sdk.key under path certPath. Please provider full keyFile path
func (*BcosSDK) Call ¶
func (sdk *BcosSDK) Call(abiContract string, address string, method string, params string, outputNum int) *CallResult
Call is a function to call a smart contract function without sending transaction return CallResult
func (*BcosSDK) DeployContract ¶
func (sdk *BcosSDK) DeployContract(contractAbi string, contractBin string, params string) *ReceiptResult
DeployContract is a function to deploy a FISCO BCOS smart contract Return receipt
func (*BcosSDK) GetBlockNumber ¶
GetBlockNumber is to query the blockchain and get the latest block number. Return the latest block number
func (*BcosSDK) GetCallOpts ¶
GetCallOpts return *bind.CallOpts
func (*BcosSDK) GetClientVersion ¶
RPC calls GetClientVersion is to query the client version of connected nodes
func (*BcosSDK) GetTransactOpts ¶
func (sdk *BcosSDK) GetTransactOpts() *bind.TransactOpts
GetTransactOpts return *bind.TransactOpts
func (*BcosSDK) GetTransactionByHash ¶
func (sdk *BcosSDK) GetTransactionByHash(txHash string) *TransactionResult
GetTransactionByHash is to query the blockchain and get the transaction of a transaction hash. Get transaction by tx hash
func (*BcosSDK) GetTransactionReceipt ¶
func (sdk *BcosSDK) GetTransactionReceipt(txHash string) *ReceiptResult
GetTransactionReceipt is to query the blockchain and get the receipt of a transaction.
func (*BcosSDK) SendTransaction ¶
func (sdk *BcosSDK) SendTransaction(contractAbi string, address string, method string, params string) *ReceiptResult
SendTransaction is a function to send an transaction to call smart contract function. return receipt
type BuildSDKResult ¶
type BuildSDKResult struct { IsSuccess bool `json:"isSuccess"` Information string `json:"information"` }
BuildSDKResult return when build sdk
type CallResult ¶
CallResult return by call function
type ContractParams ¶
type ContractParams struct { ValueType string `json:"type"` Value interface{} `json:"value"` }
ContractParams Parameters
type ContractProxy ¶
type ContractProxy struct {
// contains filtered or unexported fields
}
func (*ContractProxy) AsyncSendTransaction ¶
func (c *ContractProxy) AsyncSendTransaction(ctx context.Context, tx *types.Transaction, handler func(*types.Receipt, error)) error
AsyncSendTransaction injects the transaction into the pending pool for execution.
func (*ContractProxy) CallContext ¶
func (c *ContractProxy) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
func (*ContractProxy) CallContract ¶
func (c *ContractProxy) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
ContractCall executes a Solidity contract call with the specified data as the input.
func (*ContractProxy) CodeAt ¶
func (c *ContractProxy) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)
CodeAt returns the code of the given account. This is needed to differentiate between contract internal errors and the local chain being out of sync.
func (*ContractProxy) GetBlockLimit ¶
GetBlockLimit returns the blocklimit for current blocknumber
func (*ContractProxy) GetChainID ¶
GetChainID returns the chainID of the blockchain
func (*ContractProxy) GetContractAddress ¶
func (c *ContractProxy) GetContractAddress(ctx context.Context, txHash common.Hash) (common.Address, error)
GetContractAddress returns the contract address once it was deployed
func (*ContractProxy) GetGroupID ¶
func (c *ContractProxy) GetGroupID() *big.Int
GetGroupID returns the groupID of the client
func (*ContractProxy) PendingCodeAt ¶
PendingCodeAt returns the code of the given account in the pending state.
func (*ContractProxy) SMCrypto ¶
func (c *ContractProxy) SMCrypto() bool
SMCrypto returns true if use sm crypto
func (*ContractProxy) SendTransaction ¶
func (c *ContractProxy) SendTransaction(ctx context.Context, tx *types.Transaction) (*types.Receipt, error)
SendTransaction injects the transaction into the pending pool for execution.
func (*ContractProxy) SubscribeEventLogs ¶ added in v1.0.0
func (c *ContractProxy) SubscribeEventLogs(eventLogParams types.EventLogParams, handler func(int, []types.Log)) (string, error)
SubscribeEventLogs
func (*ContractProxy) UnSubscribeEventLogs ¶ added in v1.1.0
func (c *ContractProxy) UnSubscribeEventLogs(filterID string) error
UnSubscribeEventLogs
type FullTransaction ¶
type FullTransaction struct { BlockHash string `json:"blockHash"` BlockNumber string `json:"blockNumber"` From string `json:"from"` Gas string `json:"gas"` GasPrice string `json:"gasPrice"` Hash string `json:"hash"` Input string `json:"input"` Nonce string `json:"nonce"` To string `json:"to"` TransactionIndex string `json:"transactionIndex"` Value string `json:"value"` }
type NetworkResponse ¶
type NetworkResponse struct { Code int `json:"code"` Message string `json:"message"` Result json.RawMessage `json:"data"` }
NetworkResponse data type return from the post callback
type PostCallback ¶
PostCallback delegate callback function, will implement in outside objc code
type ReceiptResult ¶
ReceiptResult return by deploy and sendTransaction function.
type TransactionResult ¶
type TransactionResult struct { Code int Message string Transaction *FullTransaction }
TransactionResult result with transaction
type TxReceipt ¶
type TxReceipt struct { TransactionHash string `json:"transactionHash"` TransactionIndex string `json:"transactionIndex"` BlockHash string `json:"blockHash"` BlockNumber string `json:"blockNumber"` GasUsed string `json:"gasUsed"` ContractAddress string `json:"contractAddress"` Root string `json:"root"` Status int `json:"status"` From string `json:"from"` To string `json:"to"` Input string `json:"input"` Output string `json:"output"` Logs string `json:"logs"` LogsBloom string `json:"logsBloom"` }