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
The locator of the signer to add.
Returns
The wallet with the new delegated signer.
import { useWallet } from '@crossmint/client-sdk-react-ui';
const { wallet } = useWallet();
await wallet.addDelegatedSigner({
signer: externalSigner,
});
Parameters
The locator of the signer to add.
Returns
The wallet with the new delegated signer.
const wallet = await crossmintWallets.getWallet(walletLocator);
await wallet.addDelegatedSigner({
signer: externalSigner,
});
Parameters
The locator of the signer to add.
Returns
The wallet with the new delegated signer.
import { useWallet } from '@crossmint/client-sdk-react-native-ui';
const { wallet } = useWallet();
await wallet.addDelegatedSigner({
signer: externalSigner,
});
Parameters
The locator of the signer to add.
Returns
The wallet with the new delegated signer.
Getting all delegated signers
import { useWallet } from '@crossmint/client-sdk-react-ui';
const { wallet } = useWallet();
const signers = await wallet.delegatedSigners();
Returns
import { useWallet } from '@crossmint/client-sdk-react-ui';
const { wallet } = useWallet();
const signers = await wallet.delegatedSigners();
Returns
const wallet = await crossmintWallets.getWallet(walletLocator);
const signers = await wallet.delegatedSigners();
Returns
import { useWallet } from '@crossmint/client-sdk-react-native-ui';
const { wallet } = useWallet();
const signers = await wallet.delegatedSigners();
Returns
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
The locator of the signer to add.
The expiration date of the delegated signer.
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
The locator of the signer to add.
The expiration date of the delegated signer.
const wallet = await crossmintWallets.getWallet(walletLocator);
await wallet.addDelegatedSigner({
signer: externalSigner,
expiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24 * 30).getTime(),
});
Parameters
The locator of the signer to add.
The expiration date of the delegated signer.
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
The locator of the signer to add.
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
The locator of the signer to add.
import { useWallet } from '@crossmint/client-sdk-react-ui';
const { wallet } = useWallet();
await wallet.addDelegatedSigner({
signer: externalSigner,
permissions: permissions,
});
Parameters
The locator of the signer to add.
const wallet = await crossmintWallets.getWallet(walletLocator);
await wallet.addDelegatedSigner({
signer: externalSigner,
permissions: permissions,
});
Parameters
The locator of the signer to add.
import { useWallet } from '@crossmint/client-sdk-react-native-ui';
const { wallet } = useWallet();
await wallet.addDelegatedSigner({
signer: externalSigner,
permissions: permissions,
});
Parameters
The locator of the signer 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
},
},
];