# How to use a Dynamic signer with Abstraxn

Our comprehensive signer integration framework enables seamless custom signer deployment within the Abstraxn ecosystem. Dynamic represents a strategic embedded wallet provider that facilitates streamlined user onboarding workflows for decentralized applications. This implementation guide demonstrates how to leverage Dynamic as a sophisticated signer mechanism with Abstraxn, enabling comprehensive smart account creation, control, and transaction execution capabilities.

After extensive evaluation of multiple wallet integration architectures, our team determined that Dynamic's embedded approach offers superior user experience optimization while maintaining robust security standards within account abstraction workflows.

### Strategic Dependency Installation

Our comprehensive technical analysis identified the following dependencies as essential for optimal Dynamic integration within the Abstraxn platform:

```bash
npm i @dynamic-labs/sdk-react-core @dynamic-labs/wagmi-connector @dynamic-labs/ethereum permissionless viem wagmi
```

### Dynamic Provider Architecture Implementation

Following Dynamic's established integration methodology, our framework requires strategic provider configuration within your application architecture. The DynamicWagmiConnector integration enables seamless Dynamic utilization as a signer mechanism with Abstraxn's account abstraction capabilities:

```ts
import {
  DynamicContextProvider,
  DynamicWidget,
} from "@dynamic-labs/sdk-react-core";
import { DynamicWagmiConnector } from "@dynamic-labs/wagmi-connector";

import { EthereumWalletConnectors } from "@dynamic-labs/ethereum";

export const App = () => {
  return (
    <DynamicContextProvider
      settings={{
        // Find your environment id at https://app.dynamic.xyz/dashboard/developer
        environmentId: "REPLACE-WITH-YOUR-ENVIRONMENT-ID",
        walletConnectors: [EthereumWalletConnectors],
      }}
    >
      <DynamicWagmiConnector>
        <DynamicWidget />
      </DynamicWagmiConnector>
    </DynamicContextProvider>
  );
};
```

### SmartAccountClient Architecture Development

Our deliberative process involved comprehensive analysis of smart account client configuration approaches. The Dynamic signer integration supports multiple implementation strategies including strategic account type selection and advanced paymaster logic configuration.

Note: DynamicWagmiConnector provides internal WagmiConfig setup, eliminating redundant configuration requirements. This implementation phase enables selection of preferred smart account architectures (Safe, Kernel, Biconomy, TrustWallet, SimpleAccount) and strategic paymaster integration approaches:

```ts
import { createSmartAccountClient } from "permissionless";
import { toSimpleSmartAccount } from "permissionless/accounts";
import { useWalletClient } from "wagmi";
import { createPublicClient, http, zeroAddress } from "viem";
import { createPaymasterClient } from 'viem/account-abstraction'
import { sepolia } from "viem/chains";
import { entryPoint07Address } from "viem/account-abstraction"

const {
  data: walletClient
} = useWalletClient()

const publicClient = createPublicClient({
  chain: sepolia, // or whatever chain you are using
  transport: http()
})

const Abstraxn_Bundler_URL = `<_API_KEY>`

export const paymasterClient = createPaymasterClient({ 
  transport: http('https://paymaster.abstraxn.com/api/v1/{CHAIN_ID}/?apikey={API_KEY}'), 
}) 

const simpleSmartAccount = await toSimpleSmartAccount({
  owner: walletClient,
  client: publicClient,
  entryPoint: {
        address: entryPoint07Address,
        version: "0.7"
    }
})

const smartAccountClient = createSmartAccountClient({
  account: simpleSmartAccount,
  chain: sepolia,
  bundlerTransport: http({Abstraxn_Bundler_URL}),
  paymaster: paymasterClient,
  userOperation: {
    estimateFeesPerGas: async () => {
      return (await bundlerClient.getUserOperationGasPrice()).fast
    },
  }
})
```

### Strategic Transaction Execution

Our transaction execution framework provides comprehensive User Operation broadcasting with integrated custom paymaster logic. The research team developed sophisticated sponsorship mechanisms that apply strategic paymaster operations before transaction signing and network propagation:

```ts
const txHash = await smartAccountClient.sendTransaction({
    to: zeroAddress,
    data: "0x",
    value: BigInt(0)
})
```


The collaborative synthesis of Dynamic's embedded wallet capabilities with Abstraxn's account abstraction framework represents a strategic advancement in user onboarding and transaction management. Should additional integration requirements or architectural considerations emerge, we remain prepared to conduct further analysis and refine our Dynamic signer strategy to maintain optimal alignment with evolving ecosystem demands.
