Create an account

In this guide, we'll walk you through the essential processes to perform authenticated requests on Ledger Enterprise APIs as an API Administrator.

Prerequisite

To perform the following steps, your API Administrator must:

Create an account with policy

circle-exclamation

Building your request payload:

To build a payload to create a new account with policy, we need to know:

  • the account type (e.g, TRC20_LIKE)

  • the account index (e.g, 0)

  • the account name (max 19 characters, no special characters, e.g, USDT 1)

  • the account currency (e.g, tron)

  • the name of the policy used (e.g, Multipolicy 1)

  • (if token) the parent id (e.g, 95)

  • (if token) the contract address (e.g, TCFLL5dx5ZJdKnWuesXxi1VPwjLVmWZZy9)

See the create request reference for more information.

The resulting request payload is the following:

Approve a request

Once you created your request, you need to approve the challenge as the request creator before other administrators are notified to approve. To approve a request, you'll need to follow these steps:

Get the challenge

Given a request_id, first need to fetch the HSM challenge:

Decoding the challenge

Decode the challenge to validate that the instructions HSM received is the same as the one you passed in your request:

Carefully review that what you are about to sign is the right instructions matching your initial intention. This challenge is the trusted data signed by your administrator that will allow the HSM to sign the true account.

circle-exclamation

Signing the challenge

Sign the challenge with your user private key

with privatekeybytes the PEM format bytes of the private key

JSON Web Signature details

And jws the signed challenge / jws object. The resulting jws consists of three parts: the JWS Header, the JWS Payload, and the JWS Signature. The three parts are base64url-encoded and concatenated in that order being separated by period ('.') characters.

Approve the request

Once you signed the challenge use it to post your approval on the approve request endpoint:

If the response status is 200, the response payload will be the request with its new status, in our case we are still waiting for another approval from a second user so the status stays in PENDING_APPROVAL.

Once this is done, the next important step is approving the request so the account is created.

Last updated