Skip to content

providerToSmartAccountSigner

Takes an EIP-1193 provider and returns a signer that can be used as a signer with permissionless accounts.

Import

import { providerToSmartAccountSigner } from "permissionless"
## Errors were thrown in the sample, but not included in an error tag These errors were not marked as being expected: 2305. Expected: // @errors: 2305 Compiler Errors: index.ts [2305] 9 - Module '"permissionless"' has no exported member 'providerToSmartAccountSigner'.

Usage

import { type EIP1193Provider } from "viem"
declare global {
    interface Window {
        ethereum: EIP1193Provider;
    }
}
// ---cut---
import { providerToSmartAccountSigner } from "permissionless"
 
const smartAccountSigner = await providerToSmartAccountSigner(window.ethereum)
## Errors were thrown in the sample, but not included in an error tag These errors were not marked as being expected: 2305. Expected: // @errors: 2305 Compiler Errors: index.ts [2305] 149 - Module '"permissionless"' has no exported member 'providerToSmartAccountSigner'.

Returns

SmartAccountSigner

The smart account signer that can be used with permissionless accounts.

Parameters

provider

  • Type: EIP1193Provider

The EIP-1193 provider.

signerAddress (optional)

  • Type: Address

The address of the signer. If not provided, it will automatically be fetched from the provider using eth_requestAccounts.