Skip to main content
Version: SDK V3

Smart Account V1 Methods

export interface IBiconomySmartAccount extends ISmartAccount {
init(initilizationData?: InitilizationData): Promise<this>;
initializeAccountAtIndex(accountIndex: number): void;
getExecuteCallData(to: string, value: BigNumberish, data: BytesLike): string;
getExecuteBatchCallData(
to: Array<string>,
value: Array<BigNumberish>,
data: Array<BytesLike>,
): string;
buildUserOp(
transactions: Transaction[],
overrides?: Overrides,
): Promise<Partial<UserOperation>>;
getAllTokenBalances(balancesDto: BalancesDto): Promise<BalancesResponse>;
getTotalBalanceInUsd(balancesDto: BalancesDto): Promise<UsdBalanceResponse>;
getSmartAccountsByOwner(
smartAccountByOwnerDto: SmartAccountByOwnerDto,
): Promise<SmartAccountsResponse>;
getTransactionsByAddress(
chainId: number,
address: string,
): Promise<SCWTransactionResponse[]>;
getTransactionByHash(txHash: string): Promise<SCWTransactionResponse>;
getAllSupportedChains(): Promise<SupportedChainsResponse>;
}

IBiconomySmartAccount Interface

The IBiconomySmartAccount interface extends the ISmartAccount interface and provides additional methods for interacting with a Biconomy Smart Account.

MethodParametersDescription
initinitilizationData?: InitilizationDataInitializes the smart account with the provided initilizationData, if provided. Returns a Promise that resolves to the initialized IBiconomySmartAccount.
initializeAccountAtIndexaccountIndex: numberInitializes the smart account at the specified accountIndex.
getExecuteCallDatato: string, value: BigNumberish, data: BytesLikeReturns the call data for executing a single transaction to the specified address (to) with the given value and data.
getExecuteBatchCallDatato: Array string , value: Array BigNumberish, data: Array BytesLikeReturns the call data for executing a batch of transactions to multiple addresses (to) with the corresponding value and data arrays.
buildUserOptransactions: Transaction[], overrides?: OverridesBuilds a UserOperation object from the provided array of Transactions. It also accepts optional overrides for specifying gas limits and gas prices. Returns a Promise that resolves to the partial UserOperation.
getAllTokenBalancesbalancesDto: BalancesDtoRetrieves the balances of multiple tokens for the smart account based on the provided balancesDto. Returns a Promise that resolves to the BalancesResponse containing the token balances.
getTotalBalanceInUsdbalancesDto: BalancesDtoRetrieves the total balance of all tokens in USD for the smart account based on the provided balancesDto. Returns a Promise that resolves to the UsdBalanceResponse.
getSmartAccountsByOwnersmartAccountByOwnerDto: SmartAccountByOwnerDtoRetrieves all smart accounts owned by the specified address based on the provided smartAccountByOwnerDto. Returns a Promise that resolves to the SmartAccountsResponse containing the array of smart account addresses.
getTransactionsByAddresschainId: number, address: stringRetrieves the transactions associated with the specified address on the given chainId. Returns a Promise that resolves to an array of SCWTransactionResponse objects containing information about the transactions.
getTransactionByHashtxHash: stringRetrieves the transaction details for the specified transaction hash (txHash). Returns a Promise that resolves to a SCWTransactionResponse object containing information about the transaction.
getAllSupportedChainsN/ARetrieves information about all supported chains. Returns a Promise that resolves to the SupportedChainsResponse containing the list of supported chains.

ISmartAccount Interface

The ISmartAccount interface provides essential methods for interacting with a Biconomy Smart Account.

import { UserOperation } from "@biconomy/core-types";
import { UserOpResponse } from "@biconomy/bundler";
export interface ISmartAccount {
getSmartAccountAddress(accountIndex: number): Promise<string>;
signUserOp(userOperation: UserOperation): Promise<UserOperation>;
sendUserOp(userOperation: UserOperation): Promise<UserOpResponse>;
sendSignedUserOp(userOperation: UserOperation): Promise<UserOpResponse>;
}
MethodParametersDescription
getSmartAccountAddressaccountIndex: numberRetrieves the address of the smart account at the specified accountIndex. Returns a Promise that resolves to the smart account address.
signUserOpuserOperation: UserOperationSigns the given UserOperation with the necessary cryptographic signature. Returns a Promise that resolves to the signed UserOperation.
sendUserOpuserOperation: UserOperationSends the provided UserOperation to the Biconomy network for execution. Returns a Promise that resolves to a UserOpResponse containing the response from the network.
sendSignedUserOpuserOperation: UserOperationSends the pre-signed UserOperation to the Biconomy network for execution. Returns a Promise that resolves to a UserOpResponse containing the response from the network.