Modular SDK
Functions
This page will contain an exhaustive list of all functions we can call using the SDK.
If you want to take a look at the SDK code in more detail then you can check these functions out here on Github.
Function Name | Description |
---|---|
installModule(moduleTypeId: MODULE_TYPE, module: string, initData?: string) | installs a module identified by its moduleType and moduleAddress. moduleType must be from the list of valid moduleTypes in module-details page. initData is optional |
getPreviousModuleAddress(moduleTypeId: MODULE_TYPE, module: string) | get previous module for a specific module installed on etherspot modular wallet |
generateModuleDeInitData(moduleTypeId: MODULE_TYPE, module: string, moduleDeInitData: string) | generate the deInitData to uninstall the module. deInitData includes the prevModuleAddress along with deinitData specific to the module being uninstalled. |
uninstallModule(moduleTypeId: MODULE_TYPE, module: string, deinitData: string) | uninstalls a module identified by its moduleType and moduleAddress. moduleType must be from the list of valid moduleTypes in module-details page. deinitData is mandatory which is used to identify previous module to unlink current module |
isModuleInstalled(moduleTypeId: MODULE_TYPE, module: string) | check if the module is installed on the etherspot modular wallet. returns true or false |
getAllModules(pageSize: number = DEFAULT_QUERY_PAGE_SIZE) | get List of all modules installed on etherspot modular wallet. Query is made in paginated manner with an option to set page-size, In absence of page-size, defaultPageSize will override the pageSize argument |
destroy() | Destroys the SDK object. |
signMessage() | Signs a message using the Etherspot modular wallet. |
supportedNetworks() | get list of supported networks and chainIds |
getCounterFactualAddress() | Gets the address of the Etherspot wallet created. |
estimate(gasDetails?: TransactionGasInfoForUserOp) | Returns the estimated amount of gas a transaction will cost. |
totalGasEstimated(userOp: UserOperationStruct) | Returns the estimated amount of gas a batch of transactions will cost. |
getGasFee() | Returns the current gas fee for the network. |
send(userOp: UserOperationStruct) | Sends a struct of signed UserOps to the bundler. |
getNativeBalance() | Returns the native token amount of the Etherspot wallet. |
getUserOpReceipt(userOpHash: string) | Returns the receipt of a UserOp processed by the bundler. |
getUserOpHash(userOp: UserOperationStruct) | Returns the hash of a UserOp processed by the bundler. |
addUserOpsToBatch(tx: UserOpsRequest) | Adds a UserOp to the batch before sending. |
clearUserOpsFromBatch() | Clears the batch. |
getAccountContract() | Returns the Etherspot smart contract for the Etherspot smart wallet. |