Sets a new threshold for a modular smart account.
This function prepares and sends a user operation to change the threshold of the specified modular smart account. The threshold determines how many owners need to approve a transaction before it can be executed.
Type of the modular smart account, extending ModularSmartAccount or undefined.
The client used to interact with the blockchain.
The parameters for setting the new threshold.
A promise that resolves to the hash of the sent user operation.
If no account is provided and the client doesn't have an associated account.
const nexusClient = createSmartAccountClient({ ... });const hash = await setThreshold(nexusClient, { threshold: 2, maxFeePerGas: 1000000000n});console.log(`Set threshold transaction hash: ${hash}`); Copy
const nexusClient = createSmartAccountClient({ ... });const hash = await setThreshold(nexusClient, { threshold: 2, maxFeePerGas: 1000000000n});console.log(`Set threshold transaction hash: ${hash}`);
Sets a new threshold for a modular smart account.
This function prepares and sends a user operation to change the threshold of the specified modular smart account. The threshold determines how many owners need to approve a transaction before it can be executed.