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

import { useWallet } from '@crossmint/client-sdk-react-ui';

const { wallet } = useWallet();

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

Parameters

signer
string | object
required
The locator of the signer to add.

Getting all delegated signers

import { useWallet } from '@crossmint/client-sdk-react-ui';

const { wallet } = useWallet();

const signers = await wallet.delegatedSigners();

Returns

signers
DelegatedSigner[]
The delegated signers.

Adding delegated signers with expiration date

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

signer
string | object
required
The locator of the signer to add.
expiresAt
number
The expiration date of the delegated signer.

Permissions

Permissions are available under private access. Contact us if you need access
import { useWallet } from '@crossmint/client-sdk-react-ui';

const { wallet } = useWallet();

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

Parameters

signer
string | object
required
The locator of the signer to add.
permissions
Permission[]
The permissions to add.

Available Permissions

Token Transfers

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

Gas Limit

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

Call Limit

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