Store and retrieve delegations
Experimental
This is an experimental feature and may change in future releases.
You can use methods provided by the DelegationStorageClient
of the MetaMask Delegation Toolkit to store and retrieve
delegations.
Prerequisites
- Install and set up the Delegation Toolkit.
- Configure the Delegation Toolkit.
- Ensure you have an API key and API key ID to interact with the
DelegationStorageClient
. If you need to gain access, email hellogators@consensys.net.
Configure the storage client
Create the DelegationStorageClient
instance, and configure it using your API key and API key ID.
import {
DelegationStorageClient,
DelegationStorageEnvironment
} from "@metamask/delegation-toolkit/experimental";
const delegationStorageClient = new DelegationStorageClient({
apiKey: "<YOUR-API-KEY>",
apiKeyId: "<YOUR-API-KEY-ID>",
environment: DelegationStorageEnvironment.prod
});