Account
Interact with ERC-4337 accounts
Exposes useful functions available on account contracts.
const contract = await sdk.getContract("{{contract_address}}");await contract.account.getAllAdminsAndSigners();
class Account implements DetectableFeature {}
function constructor( contractWrapper: ContractWrapper<IAccountCore>,
let returnType: { address: Address; onTransactionRequested?: ( ) => Promise<void>; sendBatchTransaction?: ( txs: Array<SendTransactionOption>, ) => Promise<SendTransactionResult>; sendRawTransaction?: ( tx: SendRawTransactionOptions, ) => Promise<SendTransactionResult>; sendTransaction: ( tx: SendTransactionOption, ) => Promise<SendTransactionResult>; signMessage: ({ message, }: { message: SignableMessage; }) => Promise<Hex>; signTransaction?: (tx: TransactionSerializable) => Promise<Hex>; signTypedData: ( _typedData: TypedDataDefinition<typedData, primaryType>, ) => Promise<Hex>; watchAsset?: (asset: WatchAssetParams) => Promise<boolean>;};
Get all admins and non-admin signers with permissions to use the account.
const allAdminsAndSigners = await contract.account.getAllAdminsAndSigners();
function getAllAdminsAndSigners(): Promise<>;
All admins and non-admin signers with permissions to use the account.
Get all (non-admin) signers with permissions to use the account.
const allSigners = await contract.account.getAllSigners();
All (non-admin) signers with permissions to use the account.
Get whether a signer has permissions to use the account.
const isAdmin = await contract.account.isSigner(signer);
function isSigner(signerAddress: string): Promise<boolean>;
function approveTargetForSigner( signerAddress: string, target: string,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling approveTargetForSigner.prepare()
with same arguments. Learn more
function disapproveTargetForSigner( signerAddress: string, target: string,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling disapproveTargetForSigner.prepare()
with same arguments. Learn more
function grantAdminPermissions( signerAddress: string,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling grantAdminPermissions.prepare()
with same arguments. Learn more
function grantPermissions( signerAddress: string, permissions: { approvedCallTargets: Array<string> | "*"; expirationDate?: number | Date; nativeTokenLimitPerTransaction?: string | number; startDate?: number | Date; },): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling grantPermissions.prepare()
with same arguments. Learn more
function resetAllPermissions( permissionSnapshot: Array<{ makeAdmin: boolean; permissions: { approvedCallTargets: Array<string> | "*"; expirationDate?: number | Date; nativeTokenLimitPerTransaction?: string | number; startDate?: number | Date; }; signer: string; }>,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling resetAllPermissions.prepare()
with same arguments. Learn more
function revokeAccess(signerAddress: string): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling revokeAccess.prepare()
with same arguments. Learn more
function revokeAdminPermissions( signerAddress: string,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling revokeAdminPermissions.prepare()
with same arguments. Learn more
function updatePermissions( signerAddress: string, permissions: { approvedCallTargets: Array<string> | "*"; expirationDate?: number | Date; nativeTokenLimitPerTransaction?: string | number; startDate?: number | Date; },): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling updatePermissions.prepare()
with same arguments. Learn more