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) ¶
rocksideSmartWalletAddress := common.HexToAddress("my_rockside_smartwallet_hex_contract_address") contractAddress := common.HexToAddress("my_contract_hex_address") rocksideTransactor := rockside.NewTransactor(rocksideSmartWalletAddress, 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 ¶
- Constants
- func GetHash(signer, destination common.Address, data []byte, nonce *big.Int, ...) ([]byte, error)
- func TransactOpts() *bind.TransactOpts
- type Client
- type ContractCreationResponse
- type EOA
- type Forwarder
- func (e *Forwarder) Create(owner string) (ContractCreationResponse, error)
- func (e *Forwarder) Get() ([]string, error)
- func (e *Forwarder) GetRelayParams(forwarderAddress string, account string, channels ...string) (paramsResponse, error)
- func (e *Forwarder) Relay(forwarderAddress string, request RelayExecuteTxRequest) (RelayTxResponse, error)
- func (e *Forwarder) SignTxParams(privateKeyStr, forwarder, signer, destination, data, nonce string) (string, error)
- type Network
- type RPCClient
- type Relay
- type RelayExecuteTxMessage
- type RelayExecuteTxRequest
- type RelayParamsResponse
- type RelayTx
- type RelayTxResponse
- type SignMessageRequest
- type SignTransactionRequest
- type SmartWallets
- type SpeedInfo
- type Tokens
- type Transaction
- type TransactionResponse
- 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 ¶
View Source
const (
SmartWalletABI = `` /* 4021-byte string literal not displayed */
)
Variables ¶
This section is empty.
Functions ¶
func TransactOpts ¶
func TransactOpts() *bind.TransactOpts
Types ¶
type Client ¶
type Client struct { RPCClient *RPCClient EOA *EOA SmartWallets *SmartWallets Transaction *Transactions Tokens *Tokens Forwarder *Forwarder Relay *Relay // 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) } smartWallets, err := rocksideAPIclient.SmartWallets.List() if err != nil { panic(err) } fmt.Println(smartWallets)
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) } smartWallets, err := rocksideAPIclient.SmartWallets.List() if err != nil { panic(err) } fmt.Println(smartWallets)
Output:
func (*Client) CurrentNetwork ¶
func (*Client) DeployContractWithSmartWallet ¶ added in v0.0.27
func (c *Client) DeployContractWithSmartWallet(rocksideSmartWalletAddr, code, jsonABI string) (string, error)
Example ¶
smartWallets, err := rocksideClient.SmartWallets.List() if err != nil { panic(err) } var contractCode, jsonABI string txHash, err := rocksideClient.DeployContractWithSmartWallet(smartWallets[0], contractCode, jsonABI) if err != nil { panic(err) } fmt.Println(txHash)
Output:
type ContractCreationResponse ¶ added in v0.0.27
type ContractCreationResponse struct { TransactionResponse // contains filtered or unexported fields }
type EOA ¶ added in v0.0.12
type EOA endpoint
func (*EOA) SignMessage ¶ added in v0.0.22
func (e *EOA) SignMessage(address string, message SignMessageRequest) (string, error)
func (*EOA) SignTransaction ¶ added in v0.0.22
func (e *EOA) SignTransaction(address string, transaction SignTransactionRequest) (string, error)
type Forwarder ¶ added in v0.0.25
type Forwarder endpoint
func (*Forwarder) Create ¶ added in v0.0.25
func (e *Forwarder) Create(owner string) (ContractCreationResponse, error)
func (*Forwarder) GetRelayParams ¶ added in v0.0.25
func (*Forwarder) Relay ¶ added in v0.0.25
func (e *Forwarder) Relay(forwarderAddress string, request RelayExecuteTxRequest) (RelayTxResponse, 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) SendTransactionFromSmartWallet ¶ added in v0.0.27
func (r *RPCClient) SendTransactionFromSmartWallet(tx Transaction) (string, error)
type Relay ¶ added in v0.0.34
type Relay endpoint
type RelayExecuteTxMessage ¶ added in v0.0.29
type RelayExecuteTxRequest ¶
type RelayExecuteTxRequest struct { Speed string `json:"speed"` GasPriceLimit string `json:"gas_price_limit"` Message RelayExecuteTxMessage `json:"message"` Signature string `json:"signature"` Gas string `json:"gas"` }
type RelayParamsResponse ¶ added in v0.0.25
type RelayTxResponse ¶
type SignMessageRequest ¶ added in v0.0.22
type SignMessageRequest struct {
Message string `json:"message"`
}
type SignTransactionRequest ¶ added in v0.0.22
type SignTransactionRequest struct { Transaction NetworkID string `json:"network_id"` }
type SmartWallets ¶ added in v0.0.27
type SmartWallets endpoint
func (*SmartWallets) Create ¶ added in v0.0.27
func (i *SmartWallets) Create(account, forwarder string) (ContractCreationResponse, error)
func (*SmartWallets) Exists ¶ added in v0.0.27
func (i *SmartWallets) Exists(smartWalletAddr common.Address) (bool, error)
func (*SmartWallets) List ¶ added in v0.0.27
func (i *SmartWallets) List() ([]string, error)
type Transaction ¶
type TransactionResponse ¶ added in v0.0.27
type Transactions ¶ added in v0.0.12
type Transactions endpoint
func (*Transactions) Send ¶ added in v0.0.12
func (t *Transactions) Send(transaction Transaction) (ContractCreationResponse, error)
func (*Transactions) Show ¶ added in v0.0.21
func (t *Transactions) Show(txHashOrTrackingID string) (interface{}, error)
type Transactor ¶
type Transactor struct { Transaction map[common.Hash]string // contains filtered or unexported fields }
func NewTransactor ¶
func NewTransactor(rocksideSmartWallet 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.