• Add the Sapphire transaction encryption wrapper to a wallet client

    Example:

    walletClient = await wrapWalletClient(createWalletClient({
    account,
    chain: sapphireLocalnet,
    transport: sapphireHttpTransport()
    }));

    Type Parameters

    • T extends {
          account: undefined | Account;
          addChain: ((args) => Promise<void>);
          batch?: {
              multicall?: boolean | {
                  batchSize?: number;
                  wait?: number;
              };
          };
          cacheTime: number;
          ccipRead?: false | {
              request?: ((parameters) => Promise<`0x${string}`>);
          };
          chain: undefined | Chain;
          deployContract: (<const abi, chainOverride>(args) => Promise<`0x${string}`>);
          extend: (<const client>(fn) => Client<Transport, undefined | Chain, undefined | Account, WalletRpcSchema, {
              [K in string | number | symbol]: client[K]
          } & WalletActions<undefined | Chain, undefined | Account>>);
          getAddresses: (() => Promise<GetAddressesReturnType>);
          getChainId: (() => Promise<number>);
          getPermissions: (() => Promise<GetPermissionsReturnType>);
          key: string;
          name: string;
          pollingInterval: number;
          prepareTransactionRequest: (<const TRequest, TChainOverride, TAccountOverride>(args) => Promise<{
              [K in string | number | symbol]: (UnionRequiredBy<Extract<UnionOmit<(...), (...)> & ((...) extends (...)
                  ? (...)
                  : (...)) & ((...) extends (...)
                  ? (...)
                  : (...)), IsNever<(...)> extends true
                  ? unknown
                  : ExactPartial<(...)>> & {
                  chainId?: number;
              }, ParameterTypeToParameters<TRequest["parameters"] extends readonly PrepareTransactionRequestParameterType[]
                  ? any[any][number]
                  : "fees" | "gas" | "nonce" | "blobVersionedHashes" | "chainId" | "type">> & (unknown extends TRequest["kzg"]
                  ? {}
                  : Pick<TRequest, "kzg">))[K]
          }>);
          request: EIP1193RequestFn<WalletRpcSchema>;
          requestAddresses: (() => Promise<RequestAddressesReturnType>);
          requestPermissions: ((args) => Promise<RequestPermissionsReturnType>);
          sendRawTransaction: ((args) => Promise<`0x${string}`>);
          sendTransaction: (<const TRequest, TChainOverride>(args) => Promise<`0x${string}`>);
          signMessage: ((args) => Promise<`0x${string}`>);
          signTransaction: (<TChainOverride>(args) => Promise<`0x02${string}` | `0x01${string}` | `0x03${string}` | TransactionSerializedLegacy>);
          signTypedData: (<const TTypedData, TPrimaryType>(args) => Promise<`0x${string}`>);
          switchChain: ((args) => Promise<void>);
          transport: TransportConfig<string, EIP1193RequestFn> & Record<string, any>;
          type: string;
          uid: string;
          watchAsset: ((args) => Promise<boolean>);
          writeContract: (<const abi, functionName, args, TChainOverride>(args) => Promise<`0x${string}`>);
      }

    Parameters

    • client: T

      Wagmi wallet client

    Returns Promise<T>

    wrapped wallet client