Documentation ¶
Index ¶
- Constants
- type KoinosRPCClient
- func (c *KoinosRPCClient) Call(ctx context.Context, method string, params proto.Message, ...) error
- func (c *KoinosRPCClient) GetAccountBalance(ctx context.Context, address []byte, contractID []byte, balanceOfEntry uint32) (uint64, error)
- func (c *KoinosRPCClient) GetAccountNonce(ctx context.Context, address []byte) (uint64, error)
- func (c *KoinosRPCClient) GetAccountRc(ctx context.Context, address []byte) (uint64, error)
- func (c *KoinosRPCClient) GetChainID(ctx context.Context) ([]byte, error)
- func (c *KoinosRPCClient) GetContractMeta(ctx context.Context, contractID []byte) (*contract_meta_store.ContractMetaItem, error)
- func (c *KoinosRPCClient) ReadContract(ctx context.Context, args []byte, contractID []byte, entryPoint uint32) (*chain.ReadContractResponse, error)
- func (c *KoinosRPCClient) SubmitTransaction(ctx context.Context, ops []*protocol.Operation, key *util.KoinosKey, ...) (*protocol.TransactionReceipt, error)
- func (c *KoinosRPCClient) SubmitTransactionWithPayer(ctx context.Context, ops []*protocol.Operation, key *util.KoinosKey, ...) (*protocol.TransactionReceipt, error)
- type KoinosRPCError
- type SubmissionParams
Constants ¶
const ( ReadContractCall = "chain.read_contract" GetAccountNonceCall = "chain.get_account_nonce" GetAccountRcCall = "chain.get_account_rc" SubmitTransactionCall = "chain.submit_transaction" GetChainIDCall = "chain.get_chain_id" GetContractMetaCall = "contract_meta_store.get_contract_meta" )
These are the rpc calls that the wallet uses
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KoinosRPCClient ¶
type KoinosRPCClient struct {
// contains filtered or unexported fields
}
KoinosRPCClient is a wrapper around the jsonrpc client
func NewKoinosRPCClient ¶
func NewKoinosRPCClient(url string) *KoinosRPCClient
NewKoinosRPCClient creates a new koinos rpc client
func (*KoinosRPCClient) Call ¶
func (c *KoinosRPCClient) Call(ctx context.Context, method string, params proto.Message, returnType proto.Message) error
Call wraps the rpc client call and handles some of the boilerplate
func (*KoinosRPCClient) GetAccountBalance ¶
func (c *KoinosRPCClient) GetAccountBalance(ctx context.Context, address []byte, contractID []byte, balanceOfEntry uint32) (uint64, error)
GetAccountBalance gets the balance of a given account
func (*KoinosRPCClient) GetAccountNonce ¶
GetAccountNonce gets the nonce of a given account
func (*KoinosRPCClient) GetAccountRc ¶
GetAccountRc gets the rc of a given account
func (*KoinosRPCClient) GetChainID ¶
func (c *KoinosRPCClient) GetChainID(ctx context.Context) ([]byte, error)
GetChainID gets the chain id
func (*KoinosRPCClient) GetContractMeta ¶
func (c *KoinosRPCClient) GetContractMeta(ctx context.Context, contractID []byte) (*contract_meta_store.ContractMetaItem, error)
GetContractMeta gets the metadata of a given contract
func (*KoinosRPCClient) ReadContract ¶
func (c *KoinosRPCClient) ReadContract(ctx context.Context, args []byte, contractID []byte, entryPoint uint32) (*chain.ReadContractResponse, error)
ReadContract reads from the given contract and returns the response
func (*KoinosRPCClient) SubmitTransaction ¶
func (c *KoinosRPCClient) SubmitTransaction(ctx context.Context, ops []*protocol.Operation, key *util.KoinosKey, subParams *SubmissionParams, broadcast bool) (*protocol.TransactionReceipt, error)
SubmitTransaction creates and submits a transaction from a list of operations
func (*KoinosRPCClient) SubmitTransactionWithPayer ¶
func (c *KoinosRPCClient) SubmitTransactionWithPayer(ctx context.Context, ops []*protocol.Operation, key *util.KoinosKey, subParams *SubmissionParams, payer []byte, broadcast bool) (*protocol.TransactionReceipt, error)
SubmitTransaction creates and submits a transaction from a list of operations with a specified payer
type KoinosRPCError ¶
type KoinosRPCError struct { Logs []string // contains filtered or unexported fields }
KoinosRPCError is a golang error that also contains log messages from a reverted transaction
func (KoinosRPCError) Error ¶
func (e KoinosRPCError) Error() string
Error returns the error message
type SubmissionParams ¶
SubmissionParams is the parameters for a transaction submission