curl --request POST \
--url https://api.dfns.io/keys/{keyId}/delegate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DFNS-USERACTION: <api-key>' \
--data '
{
"delegateTo": "<string>"
}
'{
"keyId": "<string>",
"status": "Delegated"
}Only keys created with “delayDelegation: true” can then be delegated to an end-user. It means you need to know ahead of time that you’re creating a wallet meant to be delegated to an end-user later. This is a safety to prevent, for example, a treasury wallet from being unintentionally delegated to an end-user.
When a key is delegated to an end user, all wallets using this key as the signing key are also automatically delegated to the same end user. Key and wallet ownerships are guaranteed to be always consistent.
This operation is irreversible. The key ownership will be transferred to the end-user
In most cases, when you want to implement Wallet Delegation, simply create the wallet by directly delegating it to an end user, in which case it will the non-custodial from the start. There are some rare cases, however, where the key or wallet must be created before the user has accessed to the system. To accommodate this, we’ve added the ability to create a key or wallet in delay delegation mode, and then later delegate it (i.e.: transfer ownership of it) to an end user via this endpoint.
curl --request POST \
--url https://api.dfns.io/keys/{keyId}/delegate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DFNS-USERACTION: <api-key>' \
--data '
{
"delegateTo": "<string>"
}
'{
"keyId": "<string>",
"status": "Delegated"
}CustomerEmployee)EndUser)Keys:Delegate: Always required.Bearer Token: Used to authenticate API requests. More details how to generate the token: Authentication flows
User Action Signature: Used to sign the change-inducing API requests. More details how to generate the token: User Action Signing flows
11Was this page helpful?