Function getFallbackBySelector

  • Retrieves the fallback handler for a given selector in a smart account.

    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";
          }

    Parameters

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

      The client instance.

    • parameters: GetFallbackBySelectorParameters<TSmartAccount>

      Parameters including the smart account and optional selector.

    Returns Promise<[`0x${string}`, `0x${string}`]>

    A tuple containing the call type and address of the fallback handler.

    If the account is not found.

    import { getFallbackBySelector } from '@biconomy/abstractjs'

    const [callType, handlerAddress] = await getFallbackBySelector(nexusClient, {
    selector: '0x12345678'
    })
    console.log(callType, handlerAddress) // '0x1' '0x...'