Documentation ¶
Overview ¶
SPDX-License-Identifier: LGPL-3.0-or-later Copyright 2019 DNA Dev team
- Copyright (C) 2018 The ontology Authors
- This file is part of The ontology library. *
- The ontology is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- The ontology is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details. *
- You should have received a copy of the GNU Lesser General Public License
- along with The ontology. If not, see <http://www.gnu.org/licenses/>.
SPDX-License-Identifier: LGPL-3.0-or-later Copyright 2019 DNA Dev team
- Copyright (C) 2018 The ontology Authors
- This file is part of The ontology library. *
- The ontology is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- The ontology is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details. *
- You should have received a copy of the GNU Lesser General Public License
- along with The ontology. If not, see <http://www.gnu.org/licenses/>.
Provide some utils for dna-go-sdk
Index ¶
- func AddressFromBase58(s string) (common.Address, error)
- func AddressFromHexString(s string) (common.Address, error)
- func AddressParseFromBytes(b []byte) (common.Address, error)
- func GetAssetAddress(asset string) (common.Address, error)
- func GetBlock(data []byte) (*types.Block, error)
- func GetBlockTxHashes(data []byte) (*sdkcom.BlockTxHashes, error)
- func GetContractAddress(contractCode string) (common.Address, error)
- func GetInt(data []byte) (int, error)
- func GetMemPoolTxCount(data []byte) (*sdkcom.MemPoolTxCount, error)
- func GetMemPoolTxState(data []byte) (*sdkcom.MemPoolTxState, error)
- func GetMerkleProof(data []byte) (*sdkcom.MerkleProof, error)
- func GetSmartContactEvents(data []byte) ([]*sdkcom.SmartContactEvent, error)
- func GetSmartContract(data []byte) (*payload.DeployCode, error)
- func GetSmartContractEvent(data []byte) (*sdkcom.SmartContactEvent, error)
- func GetSmartContractEventLog(data []byte) (*sdkcom.SmartContractEventLog, error)
- func GetStorage(data []byte) ([]byte, error)
- func GetTransaction(data []byte) (*types.Transaction, error)
- func GetUint256(data []byte) (common.Uint256, error)
- func GetUint32(data []byte) (uint32, error)
- func GetUint64(data []byte) (uint64, error)
- func GetVersion(data []byte) (string, error)
- func HasAlreadySig(data []byte, pk keypair.PublicKey, sigDatas [][]byte) bool
- func IsEmptyJsonArray(data []byte) bool
- func IsFileExist(file string) bool
- func PubKeysEqual(pks1, pks2 []keypair.PublicKey) bool
- func TransactionFromHexString(rawTx string) (*types.Transaction, error)
- func Uint256FromHexString(s string) (common.Uint256, error)
- func Uint256ParseFromBytes(f []byte) (common.Uint256, error)
- type WebSocketClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBlockTxHashes ¶
func GetBlockTxHashes(data []byte) (*sdkcom.BlockTxHashes, error)
func GetMemPoolTxCount ¶
func GetMemPoolTxCount(data []byte) (*sdkcom.MemPoolTxCount, error)
func GetMemPoolTxState ¶
func GetMemPoolTxState(data []byte) (*sdkcom.MemPoolTxState, error)
func GetMerkleProof ¶
func GetMerkleProof(data []byte) (*sdkcom.MerkleProof, error)
func GetSmartContactEvents ¶
func GetSmartContactEvents(data []byte) ([]*sdkcom.SmartContactEvent, error)
func GetSmartContract ¶
func GetSmartContract(data []byte) (*payload.DeployCode, error)
func GetSmartContractEvent ¶
func GetSmartContractEvent(data []byte) (*sdkcom.SmartContactEvent, error)
func GetSmartContractEventLog ¶
func GetSmartContractEventLog(data []byte) (*sdkcom.SmartContractEventLog, error)
func GetStorage ¶
func GetTransaction ¶
func GetTransaction(data []byte) (*types.Transaction, error)
func GetVersion ¶
func IsEmptyJsonArray ¶
func PubKeysEqual ¶
func TransactionFromHexString ¶
func TransactionFromHexString(rawTx string) (*types.Transaction, error)
Types ¶
type WebSocketClient ¶
type WebSocketClient struct { OnConnect func(address string) OnClose func(address string) OnError func(address string, err error) OnMessage func([]byte) // contains filtered or unexported fields }
WebSocketClient use for client to operation web socket
func NewWebSocketClient ¶
func NewWebSocketClient() *WebSocketClient
Create WebSocketClient instance
func (*WebSocketClient) Close ¶
func (this *WebSocketClient) Close() error
Close the connection of server
func (*WebSocketClient) Connect ¶
func (this *WebSocketClient) Connect(addr string) (err error)
Connect to server
func (*WebSocketClient) Send ¶
func (this *WebSocketClient) Send(data []byte) error
Send data to server
func (*WebSocketClient) Status ¶
func (this *WebSocketClient) Status() bool
Status return the status of connection of client and server
Click to show internal directories.
Click to hide internal directories.