Functions and Methods
This document provides a detailed overview of the primary functions and methods available in the 0xGassless SDK. These functions enable developers to interact with the 0xGassless platform to manage gasless transactions, configure modules, and more.
initialize
Initializes the 0xGassless SDK with the provided configuration.
Parameters
config
(Object): Configuration object containing necessary parameters.network
(String): The blockchain network to use (e.g.,base
,ropsten
).rpcUrl
(String): The RPC URL for connecting to the blockchain.bundlerUrl
(String): The URL of the 0xGassless bundler service.paymasterUrl
(String): The URL of the 0xGassless Paymaster service.privateKey
(String): The private key of the account to use for signing transactions.
Example
sendTransaction
Sends a gasless transaction through the 0xGassless network.
Parameters
transaction
(Object): The transaction object containing the necessary details.to
(String): The recipient address.value
(String): The amount of value to send (in wei).data
(String): The data payload for the transaction.
Example
getTransactionStatus
Retrieves the status of a specific transaction.
Parameters
transactionHash
(String): The hash of the transaction to query.
Example
getBalance
Fetches the balance of an account.
Parameters
address
(String): The address of the account to query.
Example
addModule
Adds a module to a Smart Account.
Parameters
moduleAddress
(String): The address of the module to add.accountAddress
(String): The address of the Smart Account.
Example
removeModule
Removes a module from a Smart Account.
Parameters
moduleAddress
(String): The address of the module to remove.accountAddress
(String): The address of the Smart Account.
Example
listModules
Lists all modules associated with a Smart Account.
Parameters
accountAddress
(String): The address of the Smart Account.
Example
deploySmartAccount
Deploys a new Smart Account contract.
Parameters
ownerAddress
(String): The address of the owner of the new Smart Account.factoryAddress
(String): The address of the Smart Account Factory contract.
Example
getSmartAccount
Retrieves details of a Smart Account.
Parameters
accountAddress
(String): The address of the Smart Account.