> ## Documentation Index
> Fetch the complete documentation index at: https://yieldxyz.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Signers Package (Deprecated)

> Create signing wallet instances from mnemonics or Ledger for transaction signing

<Warning>
  **Deprecated** — The Signers Package is no longer actively maintained. Yield.xyz is signer-agnostic; you can use any signing infrastructure (ethers.js, viem, wagmi, Fireblocks, etc.) to sign the unsigned transaction payloads returned by the API.
</Warning>

## Overview

The **StakeKit Signers** package allows you to create a signing wallet instance from a mnemonic phrase or Ledger app and sign transactions. It supports custom derivation paths and multiple wallet mechanisms including MetaMask, Omni, Phantom, and Keplr.

<CardGroup cols={2}>
  <Card title="NPM Package" icon="npm" href="https://www.npmjs.com/package/@stakekit/signers">
    @stakekit/signers
  </Card>

  <Card title="GitHub" icon="github" href="https://github.com/stakekit/signers">
    View source code
  </Card>
</CardGroup>

***

## Installation

```bash theme={null}
npm install @stakekit/signers @stakekit/common
```

or

```bash theme={null}
yarn add @stakekit/signers @stakekit/common
```

or

```bash theme={null}
pnpm add @stakekit/signers @stakekit/common
```

***

## Supported Networks

<Tabs>
  <Tab title="EVM Networks">
    **Production Networks:**
    Arbitrum, Avalanche, Base, BNB Chain, Celo, CoreDAO, Cronos, Ethereum, Harmony, Linea, Optimism, Polygon, Sonic, Unichain, Viction

    **Testnets:**
    Base-Sepolia, Ethereum-Goerli, Ethereum-Holesky, Ethereum-Sepolia, Polygon-Amoy
  </Tab>

  <Tab title="Non-EVM Networks">
    **Production Networks:**
    Agoric, Akash, Axelar, Band Protocol, Bittensor, Bitsong, Cardano, Celestia, Chihuahua, Comdex, Coreum, Cosmos, Crescent, CryptoOrg, Cudos, Desmos, Dymension, DYDX, FetchAI, Gravity Bridge, HumansAI, Injective, Irisnet, Juno, Kava, Ki-Network, Kusama, Mantra, Near, Onomy, Osmosis, Persistence, Polkadot, Quicksilver, Regen, Saga, Secret, Sei, Sentinel, Solana, Sommelier, Stargaze, Tezos, Teritori, Ton, Tron, Umee

    **Testnets:**
    Solana Devnet, Ton-Testnet, Westend
  </Tab>
</Tabs>

***

## Supported Wallets

| Wallet          | Description                   |
| --------------- | ----------------------------- |
| **MetaMask**    | Standard EVM derivation path  |
| **Omni**        | Multi-chain wallet derivation |
| **Phantom**     | Solana-focused derivation     |
| **Keplr**       | Cosmos ecosystem derivation   |
| **SteakWallet** | Alternative derivation path   |
| **Temple**      | Tezos wallet derivation       |

***

## Usage Examples

<Tabs>
  <Tab title="Ethereum">
    ```typescript theme={null}
    import { getSigningWallet, ImportableWallets } from '@stakekit/signers';
    import { Networks } from '@stakekit/common';

    const walletOptions = {
      mnemonic: process.env.MNEMONIC,
      walletType: ImportableWallets.MetaMask,
      index: 0,
    };

    const signingWallet = await getSigningWallet(Networks.Ethereum, walletOptions);
    const address = await signingWallet.getAddress();

    console.log('My wallet address:', address);

    // Get unsigned transaction from Yield API
    const unsignedTransaction = {}; // Your unsigned transaction

    // Sign the transaction
    const signedTx = await signingWallet.signTransaction(unsignedTransaction);

    // Submit to network
    // submitTransaction(signedTx);
    ```
  </Tab>

  <Tab title="Solana">
    ```typescript theme={null}
    import { getSigningWallet, ImportableWallets } from '@stakekit/signers';
    import { Networks } from '@stakekit/common';

    const walletOptions = {
      mnemonic: process.env.MNEMONIC,
      walletType: ImportableWallets.Phantom,
      index: 0,
    };

    const signingWallet = await getSigningWallet(Networks.Solana, walletOptions);
    const address = await signingWallet.getAddress();

    console.log('My wallet address:', address);

    // Get unsigned transaction from Yield API (hex encoded)
    const unsignedTransaction = ''; // Your unsigned transaction in hex

    // Sign the transaction
    const signedTx = await signingWallet.signTransaction(unsignedTransaction);

    // Submit to network
    // submitTransaction(signedTx);
    ```
  </Tab>

  <Tab title="Cosmos">
    ```typescript theme={null}
    import { getSigningWallet, ImportableWallets } from '@stakekit/signers';
    import { Networks } from '@stakekit/common';

    const walletOptions = {
      mnemonic: process.env.MNEMONIC,
      walletType: ImportableWallets.Keplr,
      index: 0,
    };

    const signingWallet = await getSigningWallet(Networks.Cosmos, walletOptions);
    const address = await signingWallet.getAddress();

    console.log('My wallet address:', address);

    // Get unsigned transaction from Yield API
    const unsignedTransaction = {}; // Your unsigned transaction

    // Sign the transaction
    const signedTx = await signingWallet.signTransaction(unsignedTransaction);

    // Submit to network
    // submitTransaction(signedTx);
    ```
  </Tab>
</Tabs>

***

## Integration with Yield API

<Steps>
  <Step title="Get unsigned transaction">
    Call `/v1/actions/enter` or `/v1/actions/exit` to receive unsigned transactions
  </Step>

  <Step title="Create signing wallet">
    Use `getSigningWallet()` with your mnemonic and network
  </Step>

  <Step title="Sign transaction">
    Call `signingWallet.signTransaction(unsignedTx)`
  </Step>

  <Step title="Submit to network">
    Broadcast the signed transaction to the blockchain
  </Step>
</Steps>

```typescript theme={null}
import { getSigningWallet, ImportableWallets } from '@stakekit/signers';
import { Networks } from '@stakekit/common';

// 1. Get unsigned transaction from Yield API
const response = await fetch('https://api.yield.xyz/v1/actions/enter', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': process.env.YIELD_API_KEY,
  },
  body: JSON.stringify({
    yieldId: 'ethereum-eth-lido-staking',
    address: '0x...',
    arguments: { amount: '1000000000000000000' },
  }),
});

const action = await response.json();

// 2. Create signing wallet
const signingWallet = await getSigningWallet(Networks.Ethereum, {
  mnemonic: process.env.MNEMONIC,
  walletType: ImportableWallets.MetaMask,
  index: 0,
});

// 3. Sign each transaction
for (const tx of action.transactions) {
  const signedTx = await signingWallet.signTransaction(tx.unsignedTransaction);
  
  // 4. Submit to network
  // await submitTransaction(signedTx);
}
```

***

## Custom Derivation Paths

You can derive different wallets from the same mnemonic by changing the `index` or `walletType`:

```typescript theme={null}
// Different account indices
const wallet0 = await getSigningWallet(Networks.Ethereum, {
  mnemonic: process.env.MNEMONIC,
  walletType: ImportableWallets.MetaMask,
  index: 0,  // First account
});

const wallet1 = await getSigningWallet(Networks.Ethereum, {
  mnemonic: process.env.MNEMONIC,
  walletType: ImportableWallets.MetaMask,
  index: 1,  // Second account
});

// Different wallet derivation paths
const metamaskWallet = await getSigningWallet(Networks.Ethereum, {
  mnemonic: process.env.MNEMONIC,
  walletType: ImportableWallets.MetaMask,
  index: 0,
});

const omniWallet = await getSigningWallet(Networks.Ethereum, {
  mnemonic: process.env.MNEMONIC,
  walletType: ImportableWallets.Omni,
  index: 0,
});
```

***

## Development Setup

1. Create `.env` file with variables from `.env.example`
2. Install dependencies:

```bash theme={null}
yarn install
```

***

## Security Considerations

<Warning>
  Never expose mnemonics in client-side code or commit them to version control. Use environment variables and secure key management.
</Warning>

<CardGroup cols={2}>
  <Card title="Use environment variables" icon="shield-halved">
    Store mnemonics in secure environment variables
  </Card>

  <Card title="Server-side signing" icon="server">
    Perform signing operations on secure backend servers
  </Card>
</CardGroup>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Shield" icon="shield-check" href="/documentation/shield-security/shield">
    Validate transactions before signing
  </Card>

  <Card title="Quickstart" icon="rocket" href="/documentation/quickstart">
    Complete integration guide
  </Card>
</CardGroup>
