Documentation ¶
Index ¶
- Constants
- Variables
- func AddressToBytes(address string) []byte
- func AddressValidate(address string) error
- func BytesToAddress(rawAddress []byte) string
- func ContractNameToAddressAsBytes(contractName string) []byte
- func ReadSourcesFromDir(dirname string) ([][]byte, error)
- type EventProcessingCallback
- type OrbsAccount
- type OrbsClient
- func (c *OrbsClient) CreateDeployTransaction(publicKey []byte, privateKey []byte, contractName string, ...) (rawTransaction []byte, txId string, err error)
- func (c *OrbsClient) CreateQuery(publicKey []byte, contractName string, methodName string, ...) (rawQuery []byte, err error)
- func (c *OrbsClient) CreateTransaction(publicKey []byte, privateKey []byte, contractName string, methodName string, ...) (rawTransaction []byte, txId string, err error)
- func (c *OrbsClient) GetBlock(blockHeight uint64) (response *codec.GetBlockResponse, err error)
- func (c *OrbsClient) GetBlockHeight(publicKey []byte) (uint64, error)
- func (c *OrbsClient) GetTransactionReceiptProof(txId string) (response *codec.GetTransactionReceiptProofResponse, err error)
- func (c *OrbsClient) GetTransactionStatus(txId string) (response *codec.GetTransactionStatusResponse, err error)
- func (c *OrbsClient) SendQuery(rawQuery []byte) (response *codec.RunQueryResponse, err error)
- func (c *OrbsClient) SendTransaction(rawTransaction []byte) (response *codec.SendTransactionResponse, err error)
- func (c *OrbsClient) SendTransactionAsync(rawTransaction []byte) (response *codec.SendTransactionResponse, err error)
- func (c *OrbsClient) Subscribe(ctx context.Context, publicKey []byte, contractName string, ...) (blockHeight uint64, eventIndex uint64, err error)
- type ProcessorType
Constants ¶
View Source
const ( SHA256_HASH_SIZE_BYTES = 32 CLIENT_ADDRESS_SIZE_BYTES = 20 CLIENT_ADDRESS_SHA256_OFFSET = SHA256_HASH_SIZE_BYTES - CLIENT_ADDRESS_SIZE_BYTES )
View Source
const ( SEND_TRANSACTION_URL = "/api/v1/send-transaction" SEND_TRANSACTION_ASYNC_URL = "/api/v1/send-transaction-async" CALL_METHOD_URL = "/api/v1/run-query" GET_TRANSACTION_STATUS_URL = "/api/v1/get-transaction-status" GET_TRANSACTION_RECEIPT_PROOF_URL = "/api/v1/get-transaction-receipt-proof" GET_BLOCK_URL = "/api/v1/get-block" )
View Source
const CONTENT_TYPE_MEMBUFFERS = "application/membuffers"
View Source
const PROCESSOR_TYPE_JAVASCRIPT = ProcessorType(2)
View Source
const PROCESSOR_TYPE_NATIVE = ProcessorType(1)
View Source
const PROTOCOL_VERSION = 1
Variables ¶
View Source
var NoConnectionError = errors.New("cannot connect to server")
TODO: streamline these errors
Functions ¶
func AddressToBytes ¶
func AddressValidate ¶
func BytesToAddress ¶
func ContractNameToAddressAsBytes ¶ added in v0.9.0
https://github.com/orbs-network/orbs-network-go/commit/681e1383bbfaec977204df1e41d51a291b62c8e5
func ReadSourcesFromDir ¶ added in v0.8.0
provides functionality required for CreateDeployTransaction
Types ¶
type EventProcessingCallback ¶ added in v0.15.0
type EventProcessingCallback func(event *codec.Event, blockHeight uint64, transactionHash []byte, transactionId []byte, eventIndex uint64) error
EventIndex helps looking for the events of a certain transaction
type OrbsAccount ¶
type OrbsAccount struct { PublicKey []byte PrivateKey []byte Address string // hex string starting with 0x }
func CreateAccount ¶
func CreateAccount() (*OrbsAccount, error)
func (*OrbsAccount) AddressAsBytes ¶
func (oa *OrbsAccount) AddressAsBytes() []byte
type OrbsClient ¶
type OrbsClient struct { Endpoint string VirtualChainId uint32 NetworkType codec.NetworkType }
func NewClient ¶
func NewClient(endpoint string, virtualChainId uint32, networkType codec.NetworkType) *OrbsClient
func (*OrbsClient) CreateDeployTransaction ¶ added in v0.8.0
func (c *OrbsClient) CreateDeployTransaction(publicKey []byte, privateKey []byte, contractName string, processorType ProcessorType, code ...[]byte) (rawTransaction []byte, txId string, err error)
func (*OrbsClient) CreateQuery ¶
func (*OrbsClient) CreateTransaction ¶
func (*OrbsClient) GetBlock ¶ added in v0.7.0
func (c *OrbsClient) GetBlock(blockHeight uint64) (response *codec.GetBlockResponse, err error)
func (*OrbsClient) GetBlockHeight ¶ added in v0.15.0
func (c *OrbsClient) GetBlockHeight(publicKey []byte) (uint64, error)
func (*OrbsClient) GetTransactionReceiptProof ¶
func (c *OrbsClient) GetTransactionReceiptProof(txId string) (response *codec.GetTransactionReceiptProofResponse, err error)
func (*OrbsClient) GetTransactionStatus ¶
func (c *OrbsClient) GetTransactionStatus(txId string) (response *codec.GetTransactionStatusResponse, err error)
func (*OrbsClient) SendQuery ¶
func (c *OrbsClient) SendQuery(rawQuery []byte) (response *codec.RunQueryResponse, err error)
func (*OrbsClient) SendTransaction ¶
func (c *OrbsClient) SendTransaction(rawTransaction []byte) (response *codec.SendTransactionResponse, err error)
func (*OrbsClient) SendTransactionAsync ¶ added in v0.7.0
func (c *OrbsClient) SendTransactionAsync(rawTransaction []byte) (response *codec.SendTransactionResponse, err error)
type ProcessorType ¶ added in v0.8.0
type ProcessorType uint32
Click to show internal directories.
Click to hide internal directories.