Documentation ¶
Overview ¶
Example (ContractReadCallUsingContractABIBindings) ¶
contractAddress := common.HexToAddress("my_contract_address") contract, err := NewContractCaller(contractAddress, rocksideClient.RPCClient) if err != nil { panic(err) } timestamp, _ := contract.Read(&bind.CallOpts{}, [32]byte{}) fmt.Println(timestamp)
Output:
Example (GaslessContractWriteCallUsingContractABIBindings) ¶
rocksideIdentityAddress := common.HexToAddress("my_rockside_identity_contract_address") contractAddress := common.HexToAddress("my_contract_address") rocksideTransactor := rockside.NewTransactor(rocksideIdentityAddress, rocksideClient) contract, err := NewContractTransactor(contractAddress, rocksideTransactor) if err != nil { panic(err) } tx, _ := contract.Write(rockside.TransactOpts(), [32]byte{}) txHash := rocksideTransactor.LookupRocksideTransactionHash(tx.Hash()) fmt.Println(txHash)
Output:
Index ¶
- func TransactOpts() *bind.TransactOpts
- type Client
- type CreateEOAResponse
- type CreateIdentitiesResponse
- type CreateRelayableIdentityResponse
- type CreateTokenResponse
- type Network
- type NonceResponse
- type RPCClient
- type RelayExecuteTxRequest
- type RelayTxResponse
- type SendTxResponse
- type Transaction
- type Transactor
- func (t *Transactor) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
- func (t *Transactor) LookupRocksideTransactionHash(hash common.Hash) string
- func (t *Transactor) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
- func (t *Transactor) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
- func (t *Transactor) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (t *Transactor) SuggestGasPrice(ctx context.Context) (*big.Int, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TransactOpts ¶
func TransactOpts() *bind.TransactOpts
Types ¶
type Client ¶
type Client struct { RPCClient *RPCClient EOA *eoaEndpoint Identities *identitiesEndpoint Transaction *transactionEndpoint RelayableIdentity *relayableIdentityEndpoint Tokens *tokensEndpoint // contains filtered or unexported fields }
func NewClient ¶
Example ¶
rocksideAPIclient, err := rockside.NewClient(os.Getenv("ROCKSIDE_API_KEY"), rockside.Testnet) if err != nil { panic(err) } identities, err := rocksideAPIclient.Identities.List() if err != nil { panic(err) } fmt.Println(identities)
Output:
func (*Client) CurrentNetwork ¶
func (*Client) DeployContractWithIdentity ¶
type CreateEOAResponse ¶
type CreateEOAResponse struct {
Address string `json:"address"`
}
type CreateTokenResponse ¶
type CreateTokenResponse struct {
Token string `json:"token"`
}
type NonceResponse ¶
type NonceResponse struct {
Nonce string `json:"nonce"`
}
type RPCClient ¶
Example ¶
// Get a RPC client from your existing Rockside client. rpc := rocksideClient.RPCClient accounts, err := rpc.EthAccounts() if err != nil { panic(err) } fmt.Println(accounts) balance, err := rpc.BalanceAt(context.Background(), common.Address{}, nil) if err != nil { panic(err) } fmt.Println(balance)
Output:
func (*RPCClient) EthAccounts ¶
func (*RPCClient) SendTransactionFromIdentity ¶
func (r *RPCClient) SendTransactionFromIdentity(tx Transaction) (string, error)
type RelayExecuteTxRequest ¶
type RelayTxResponse ¶
type RelayTxResponse struct {
TransactionHash string `json:"transaction_hash"`
}
type SendTxResponse ¶
type SendTxResponse struct {
TransactionHash string `json:"transaction_hash"`
}
type Transaction ¶
type Transaction struct { From string `json:"from,omitempty"` To string `json:"to,omitempty"` Value string `json:"value,omitempty"` Data string `json:"data,omitempty"` Nonce string `json:"nonce,omitempty"` Gas string `json:"gas,omitempty"` GasPrice string `json:"gasprice,omitempty"` }
func (Transaction) ValidateFields ¶
func (t Transaction) ValidateFields() error
type Transactor ¶
type Transactor struct {
// contains filtered or unexported fields
}
func NewTransactor ¶
func NewTransactor(rocksideIdentity common.Address, client *Client) *Transactor
func (*Transactor) EstimateGas ¶
func (t *Transactor) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
func (*Transactor) LookupRocksideTransactionHash ¶
func (t *Transactor) LookupRocksideTransactionHash(hash common.Hash) string
func (*Transactor) PendingCodeAt ¶
func (*Transactor) PendingNonceAt ¶
func (*Transactor) SendTransaction ¶
func (t *Transactor) SendTransaction(ctx context.Context, tx *types.Transaction) error
func (*Transactor) SuggestGasPrice ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.