---
title: Wallets
---
Goat 🐐 is designed to work seamlessly with any wallet provider you use.

Use basic key pair wallets or advanced smart wallets, such as those provided by companies like Crossmint or Coinbase.

<CodeGroup>
```typescript viem
import { createWalletClient } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { sepolia } from "viem/chains";
import { http } from "viem";

import { getOnChainTools } from "@goat-sdk/adapter-vercel-ai";
import { viem } from "@goat-sdk/wallet-viem";

const account = privateKeyToAccount(
    process.env.WALLET_PRIVATE_KEY as `0x${string}`
);

const walletClient = createWalletClient({
    account: account,
    transport: http(process.env.ALCHEMY_API_KEY),
    chain: sepolia,
});

const tools = await getOnChainTools({
    wallet: viem(walletClient),
});
```

```typescript Crossmint Smart Wallets
import { getOnChainTools } from "@goat-sdk/adapter-vercel-ai";
import { crossmint } from "@goat-sdk/crossmint";

const apiKey = process.env.CROSSMINT_STAGING_API_KEY;
const walletSignerSecretKey = process.env.SIGNER_WALLET_SECRET_KEY;
const alchemyApiKey = process.env.ALCHEMY_API_KEY_BASE_SEPOLIA;
const smartWalletAddress = process.env.SMART_WALLET_ADDRESS;

const { smartwallet } = crossmint(apiKey);

const tools = await getOnChainTools({
    wallet: await smartwallet({
        address: smartWalletAddress,
        signer: {
            secretKey: walletSignerSecretKey as `0x${string}`,
        },
        chain: "base-sepolia",
        provider: alchemyApiKey,
    }),
});
```

```typescript Crossmint Custodial Wallets
import { getOnChainTools } from "@goat-sdk/adapter-vercel-ai";
import { crossmint } from "@goat-sdk/crossmint";
import { Connection } from "@solana/web3.js";

const apiKey = process.env.CROSSMINT_STAGING_API_KEY;
const email = process.env.EMAIL;

if (!apiKey || !email) {
    throw new Error("Missing environment variables");
}

const { custodial } = crossmint(apiKey);

const tools = await getOnChainTools({
    wallet: await custodial({
        chain: "solana",
        email: email,
        env: "staging",
        connection: new Connection(
            "https://api.devnet.solana.com",
            "confirmed"
        ),
    }),
});

```

```typescript Dynamic
import { getOnChainTools } from "@goat-sdk/adapter-vercel-ai";
import { viem } from "@goat-sdk/wallet-viem";
import { useDynamicContext, useIsLoggedIn } from "@dynamic-labs/sdk-react-core";
import { isEthereumWallet } from "@dynamic-labs/ethereum";

const isLoggedIn = useIsLoggedIn();
const { primaryWallet } = useDynamicContext();

if (!isLoggedIn) {
    throw new Error("User is not logged in");
}

if (!isEthereumWallet(primaryWallet)) {
    throw new Error("Primary wallet is not an Ethereum wallet");
}

const walletClient = await primaryWallet.getWalletClient();

const tools = await getOnChainTools({
    wallet: viem(walletClient),
});
```


```typescript Solana
import { getOnChainTools } from "@goat-sdk/adapter-vercel-ai";
import { solana } from "@goat-sdk/wallet-solana";

import { Connection, Keypair } from "@solana/web3.js";
import * as bip39 from "bip39";

const connection = new Connection(
    "https://api.mainnet-beta.solana.com",
    "confirmed"
);

const mnemonic = process.env.WALLET_MNEMONIC;

const seed = bip39.mnemonicToSeedSync(mnemonic);
const keypair = Keypair.fromSeed(Uint8Array.from(seed).subarray(0, 32));

const tools = await getOnChainTools({
    wallet: solana({
        keypair,
        connection,
    }),
});
```
</CodeGroup>

## Creating your own wallet client
If you don't see your wallet provider supported, you can easily integrate it by implementing the specific [WalletClient](https://github.com/goat-sdk/goat/blob/main/typescript/packages/core/src/wallets/core.ts) interface for the chain and type of wallet you want to support:

1. [EVMWalletClient](https://github.com/goat-sdk/goat/blob/main/typescript/packages/core/src/wallets/evm.ts) for all EVM chains
2. [EVMSmartWalletClient](https://github.com/goat-sdk/goat/blob/main/typescript/packages/core/src/wallets/evm-smart-wallet.ts) for EVM smart wallets
2. [SolanaWalletClient](https://github.com/goat-sdk/goat/blob/main/typescript/packages/core/src/wallets/solana.ts) for Solana

Checkout [here how the viem client implementation](https://github.com/goat-sdk/goat/blob/main/typescript/packages/wallets/viem/src/index.ts).

If you would like to see your wallet provider supported, please open an issue or submit a PR.