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

# Delegated Signers

> Register a delegated signer

Give third parties the possibility to transact with your wallet.
Always maintain control over what that key can do with tight permissions and being able to revoke them at any time.

## Prerequisites

* Ensure you have a wallet created.
* **API Key**: Ensure you have an API key with the scopes: `wallets:signatures.create` and `wallets:transactions.create`.

## Adding a delegated signer

<Tabs>
  <Tab title="React">
    ```typescript theme={null}
    import { useWallet } from '@crossmint/client-sdk-react-ui';

    const { wallet } = useWallet();

    await wallet.addDelegatedSigner({
        signer: externalSigner,
    });
    ```

    ### Parameters

    <ParamField path="signer" type="string | object" required>
      The locator of the signer to add.
    </ParamField>

    ### Returns

    <ParamField path="wallet" type="Wallet">
      The wallet with the new delegated signer.
    </ParamField>
  </Tab>

  <Tab title="Node.js">
    ```typescript theme={null}
    const wallet = await crossmintWallets.getWallet(walletLocator);

    await wallet.addDelegatedSigner({
        signer: externalSigner,
    });
    ```

    ### Parameters

    <ParamField path="signer" type="string | object" required>
      The locator of the signer to add.
    </ParamField>

    ### Returns

    <ParamField path="wallet" type="Wallet">
      The wallet with the new delegated signer.
    </ParamField>
  </Tab>

  <Tab title="React Native">
    ```typescript theme={null}
    import { useWallet } from '@crossmint/client-sdk-react-native-ui';

    const { wallet } = useWallet();

    await wallet.addDelegatedSigner({
        signer: externalSigner,
    });
    ```

    ### Parameters

    <ParamField path="signer" type="string | object" required>
      The locator of the signer to add.
    </ParamField>

    ### Returns

    <ParamField path="wallet" type="Wallet">
      The wallet with the new delegated signer.
    </ParamField>
  </Tab>
</Tabs>

## Getting all delegated signers

<Tabs>
  <Tab title="React">
    ```typescript theme={null}
    import { useWallet } from '@crossmint/client-sdk-react-ui';

    const { wallet } = useWallet();

    const signers = await wallet.delegatedSigners();
    ```

    ### Returns

    <ParamField path="signers" type="DelegatedSigner[]">
      The delegated signers.
    </ParamField>
  </Tab>

  <Tab title="Node.js">
    ```typescript theme={null}
    const wallet = await crossmintWallets.getWallet(walletLocator);

    const signers = await wallet.delegatedSigners();
    ```

    ### Returns

    <ParamField path="signers" type="DelegatedSigner[]">
      The delegated signers.
    </ParamField>
  </Tab>

  <Tab title="React Native">
    ```typescript React Native theme={null}
    import { useWallet } from '@crossmint/client-sdk-react-native-ui';

    const { wallet } = useWallet();

    const signers = await wallet.delegatedSigners();
    ```

    ### Returns

    <ParamField path="signers" type="DelegatedSigner[]">
      The delegated signers.
    </ParamField>
  </Tab>
</Tabs>

## Adding delegated signers with expiration date

<Tabs>
  <Tab title="React">
    ```typescript theme={null}
    import { useWallet } from '@crossmint/client-sdk-react-ui';

    const { wallet } = useWallet();

    await wallet.addDelegatedSigner({
        signer: externalSigner,
        expiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24 * 30).getTime(),
    });
    ```

    ### Parameters

    <ParamField path="signer" type="string | object" required>
      The locator of the signer to add.
    </ParamField>

    <ParamField path="expiresAt" type="number">
      The expiration date of the delegated signer.
    </ParamField>
  </Tab>

  <Tab title="Node.js">
    ```typescript theme={null}
    const wallet = await crossmintWallets.getWallet(walletLocator);

    await wallet.addDelegatedSigner({
        signer: externalSigner,
        expiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24 * 30).getTime(),
    });
    ```

    ### Parameters

    <ParamField path="signer" type="string | object" required>
      The locator of the signer to add.
    </ParamField>

    <ParamField path="expiresAt" type="number">
      The expiration date of the delegated signer.
    </ParamField>
  </Tab>

  <Tab title="React Native">
    ```typescript React Native theme={null}
    import { useWallet } from '@crossmint/client-sdk-react-native-ui';

    const { wallet } = useWallet();

    await wallet.addDelegatedSigner({
        signer: externalSigner,
        expiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24 * 30).getTime(),
    });
    ```

    ### Parameters

    <ParamField path="signer" type="string | object" required>
      The locator of the signer to add.
    </ParamField>

    <ParamField path="expiresAt" type="number">
      The expiration date of the delegated signer.
    </ParamField>
  </Tab>
</Tabs>

## Permissions

<Note>
  Permissions are available under private access. [Contact us](https://www.crossmint.com/contact/sales) if you need
  access
</Note>

<Tabs>
  <Tab title="React">
    ```typescript theme={null}
    import { useWallet } from '@crossmint/client-sdk-react-ui';

    const { wallet } = useWallet();

    await wallet.addDelegatedSigner({
        signer: externalSigner,
        permissions: permissions,
    });
    ```

    ### Parameters

    <ParamField path="signer" type="string | object" required>
      The locator of the signer to add.
    </ParamField>

    <ParamField path="permissions" type="Permission[]">
      The permissions to add.
    </ParamField>
  </Tab>

  <Tab title="Node.js">
    ```typescript theme={null}
    const wallet = await crossmintWallets.getWallet(walletLocator);

    await wallet.addDelegatedSigner({
        signer: externalSigner,
        permissions: permissions,
    });
    ```

    ### Parameters

    <ParamField path="signer" type="string | object" required>
      The locator of the signer to add.
    </ParamField>

    <ParamField path="permissions" type="Permission[]">
      The permissions to add.
    </ParamField>
  </Tab>

  <Tab title="React Native">
    ```typescript React Native theme={null}
    import { useWallet } from '@crossmint/client-sdk-react-native-ui';

    const { wallet } = useWallet();

    await wallet.addDelegatedSigner({
        signer: externalSigner,
        permissions: permissions,
    });
    ```

    ### Parameters

    <ParamField path="signer" type="string | object" required>
      The locator of the signer to add.
    </ParamField>

    <ParamField path="permissions" type="Permission[]">
      The permissions to add.
    </ParamField>
  </Tab>
</Tabs>

## Available Permissions

### Token Transfers

```typescript theme={null}
const permissions = [
    {
        type: "token-transfer",
        data: {
            allowance: allowance,
            token: tokenLocator,
        },
    },
];
```

### Gas Limit

```typescript theme={null}
const permissions = [
    {
        type: "gas-limit",
        data: {
            limit: limit, // Maximum gas in decimal string
        },
    },
];
```

### Call Limit

```typescript theme={null}
const permissions = [
    {
        type: "call-limit",
        data: {
            count: count, // Maximum number of calls
        },
    },
];
```
