Function getSetThresholdTx

  • Generates transaction data for setting a new threshold on a smart account.

    The threshold in a multi-signature wallet determines how many owners need to approve a transaction before it can be executed. This function prepares the transaction data needed to change this threshold, but does not actually send the transaction.

    Type Parameters

    • TSmartAccount extends
          | undefined
          | object & Assign_<
              SmartAccountImplementation<Abi, EntryPointVersion, object>,
              {
                  address: `0x${string}`;
                  getNonce: (parameters?: { key?: bigint }) => Promise<bigint>;
                  isDeployed: () => Promise<boolean>;
                  type: "smart";
              },
          > & {
              address: `0x${string}`;
              getNonce: (parameters?: { key?: bigint }) => Promise<bigint>;
              isDeployed: () => Promise<boolean>;
              type: "smart";
          }

      Type of the smart account, extending SmartAccount or undefined.

    Parameters

    • client: Client<Transport, undefined | Chain, TSmartAccount>

      The client instance used for blockchain interactions.

    • parameters: GetSetThresholdTxParameters<TSmartAccount>

      Object containing the account and new threshold value.

    Returns Promise<Call>

    A Promise resolving to a Call object with the transaction data.

    When no account is provided and the client lacks an associated account.

    If the account parsing fails or if there's an issue generating the action data.

    const txData = await getSetThresholdTx(client, { threshold: 2 });
    console.log(txData); // { to: '0x...', value: 0n, data: '0x...' }