Documentation ¶
Overview ¶
Example (ContractCaller) ¶
contractAddress := common.HexToAddress("my_contract_address") // NewContractCaller is typically in your contract binding GO file which was generated via `abigen` contract, err := NewContractCaller(contractAddress, rocksideClient.RPCClient) if err != nil { panic(err) } timestamp, _ := contract.Read(&bind.CallOpts{}, [32]byte{}) fmt.Println(timestamp)
Output:
Example (GaslessContractTransactor) ¶
rocksideIdentityAddress := common.HexToAddress("my_rockside_identity_hex_contract_address") contractAddress := common.HexToAddress("my_contract_hex_address") rocksideTransactor := rockside.NewTransactor(rocksideIdentityAddress, rocksideClient) // NewContractTransactor is typically in your contract binding GO file which was generated via `abigen` contract, err := NewContractTransactor(contractAddress, rocksideTransactor) if err != nil { panic(err) } tx, _ := contract.Write(rockside.TransactOpts(), [32]byte{}) txHash := rocksideTransactor.ReturnRocksideTransactionHash(tx.Hash()) fmt.Println(txHash)
Output:
Index ¶
- func TransactOpts() *bind.TransactOpts
- func TransactOptsWithoutReward() *bind.TransactOpts
- type Client
- type CreateTokenResponse
- type EOA
- type Identities
- type Network
- type RPCClient
- type RelayExecuteTxRequest
- type RelayableIdentity
- func (e *RelayableIdentity) Create(account string) (createRelayableIdentityResponse, error)
- func (e *RelayableIdentity) GetNonce(contractAddress string, account string, channels ...string) (nonceResponse, error)
- func (e *RelayableIdentity) RelayExecute(contractAddress string, request RelayExecuteTxRequest) (relayTxResponse, error)
- func (b *RelayableIdentity) SignTxParams(privateKeyStr string, bouncerAddress string, signer string, destination string, ...) (string, error)
- type SendTxResponse
- type Tokens
- type Transaction
- type Transactions
- type Transactor
- func (t *Transactor) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
- 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) ReturnRocksideTransactionHash(hash common.Hash) string
- 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
func TransactOptsWithoutReward ¶ added in v0.0.17
func TransactOptsWithoutReward() *bind.TransactOpts
Types ¶
type Client ¶
type Client struct { RPCClient *RPCClient EOA *EOA Identities *Identities Transaction *Transactions RelayableIdentity *RelayableIdentity Tokens *Tokens // contains filtered or unexported fields }
func NewClientFromAPIKey ¶ added in v0.0.14
Example ¶
rocksideAPIclient, err := rockside.NewClientFromAPIKey(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 NewClientFromToken ¶ added in v0.0.14
func NewClientFromToken(token, origin string, net Network, rocksideBaseURL ...string) (*Client, error)
Example ¶
rocksideAPIclient, err := rockside.NewClientFromToken("token", "example.com", 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 ¶
func (c *Client) DeployContractWithIdentity(rocksideIdentityAddr, code, jsonABI string) (string, error)
Example ¶
identities, err := rocksideClient.Identities.List() if err != nil { panic(err) } var contractCode, jsonABI string txHash, err := rocksideClient.DeployContractWithIdentity(identities[0], contractCode, jsonABI) if err != nil { panic(err) } fmt.Println(txHash)
Output:
type CreateTokenResponse ¶
type CreateTokenResponse struct {
Token string `json:"token"`
}
type Identities ¶ added in v0.0.12
type Identities endpoint
func (*Identities) Create ¶ added in v0.0.12
func (i *Identities) Create() (createIdentitiesResponse, error)
func (*Identities) Exists ¶ added in v0.0.12
func (i *Identities) Exists(identityAddress common.Address) (bool, error)
func (*Identities) List ¶ added in v0.0.12
func (i *Identities) List() ([]string, error)
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) SendRocksideTransaction ¶ added in v0.0.15
func (r *RPCClient) SendRocksideTransaction(tx Transaction) (string, error)
func (*RPCClient) SendTransactionFromIdentity ¶
func (r *RPCClient) SendTransactionFromIdentity(tx Transaction) (string, error)
type RelayExecuteTxRequest ¶
type RelayableIdentity ¶ added in v0.0.12
type RelayableIdentity endpoint
func (*RelayableIdentity) Create ¶ added in v0.0.12
func (e *RelayableIdentity) Create(account string) (createRelayableIdentityResponse, error)
func (*RelayableIdentity) GetNonce ¶ added in v0.0.12
func (e *RelayableIdentity) GetNonce(contractAddress string, account string, channels ...string) (nonceResponse, error)
func (*RelayableIdentity) RelayExecute ¶ added in v0.0.12
func (e *RelayableIdentity) RelayExecute(contractAddress string, request RelayExecuteTxRequest) (relayTxResponse, error)
type SendTxResponse ¶
type Tokens ¶ added in v0.0.12
type Tokens endpoint
func (*Tokens) Create ¶ added in v0.0.12
func (i *Tokens) Create(domain string, contracts []string) (CreateTokenResponse, error)
func (*Tokens) CreateForEndUser ¶ added in v0.0.17
type Transaction ¶
type Transactions ¶ added in v0.0.12
type Transactions endpoint
func (*Transactions) Send ¶ added in v0.0.12
func (t *Transactions) Send(transaction Transaction) (SendTxResponse, error)
type Transactor ¶
type Transactor struct { Transaction map[common.Hash]string // 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) PendingCodeAt ¶
func (*Transactor) PendingNonceAt ¶
func (*Transactor) ReturnRocksideTransactionHash ¶ added in v0.0.10
func (t *Transactor) ReturnRocksideTransactionHash(hash common.Hash) string
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.