Create Stake
Creates a new stake in the specified staking protocol. A stake represents assets locked to earn rewards under the protocol’s staking rules.
- HTTP request
- POST/staking/stakes
- Authentication
-
Authentication Type Supported Organization User (CustomerEmployee) Yes Delegated User (EndUser) No Service Account Yes - Required permissions
- Stakes:Create (always required)
- Authorization requirements
-
Header Type Required Description Authorizationstring Yes Bearer token used to authenticate the request. See Authentication flows for instructions on generating this token. X-DFNS-USERACTIONstring Yes User action signature used to authorize change-inducing requests. See User Action Signing flows for instructions on generating this signature. - Request body
-
Different protocols can have different requirements. The following fields apply to Babylon staking.
Field Type Required Description protocol string Yes Staking protocol. Currently supports Babylon.walletId string Yes ID of the IBM Digital Asset Haven wallet making the deposit. provider string Yes Staking provider. Currently supports Figment.amount string Yes Transaction amount denominated in minimum units. duration number Yes Duration of the stake, defined in protocol-specific units. externalId string No Optional client-provided identifier for idempotency. curl --request POST \ --url https://api.digitalassets.ibm.com/staking/stakes \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'X-DFNS-USERACTION: <api-key>' \ --data ' { "externalId": "ext-123", "walletId": "wa-4g991-s29to-9hrq4nbuto6ih33b", "protocol": "Ethereum", "provider": "Figment", "amount": "32000000000000000000" } ' - Response
- 200: Success
Example response:
{ "id": "<string>", "walletId": "<string>", "status": "Active", "requester": { "userId": "<string>", "tokenId": "<string>" }, "requestBody": { "protocol": "Babylon", "walletId": "<string>", "provider": "Figment", "amount": "<string>", "duration": 123, "externalId": "<string>" }, "dateCreated": "<string>", "protocol": "Babylon", "data": { "finalityProviders": [ "<string>" ], "covenantPubkeys": [ "<string>" ], "magicBytes": "<string>", "covenantThreshold": 123, "minUnbondingTime": 123, "lockHeight": 123 }, "actions": [ { "id": "<string>", "stakeId": "<string>", "kind": "Stake", "requester": { "userId": "<string>", "tokenId": "<string>" }, "requestBody": { "protocol": "Babylon", "walletId": "<string>", "provider": "Figment", "amount": "<string>", "duration": 123, "externalId": "<string>" }, "dateCreated": "<string>", "transactionId": "<string>", "signatureId": "<string>", "transactionHash": "<string>", "failureReason": "<string>" } ], "provider": "Figment" }