Helper function to register the entity secret for the first time and downloads the recovery file. This is non idempotent process, so make sure you save the recovery file or the entity secret some place secure.
Parameters for registering the entity secret cipher text.
ApiKey that will be used to authenticate the request.
Optional base URL to override the default: https://api.circle.com
.
New Entity Secret that you want to be registered.
Relative path to download the recovery file.
1import * as fs from "fs";
2import { registerEntitySecretCiphertext } from "@circle-fin/developer-controlled-wallets";
3const response = await registerEntitySecretCiphertext({
4 apiKey: "<api-key>",
5 entitySecret: "<entity-secret>",
6});
7fs.writeFileSync("recovery_file.dat", response.data?.recoveryFile ?? "");