Generates an account signature to be used in backend-to-backend requests.

Usage

import { generateAccountSignature } from "@treasure-dev/tdk-core";

const signature = await generateAccountSignature({
  accountAddress: "...",
  kmsKey: "...",
});

Returns

Promise<Object>

backendWallet

string

  • The public address of the backend wallet used to create the signature.

signature

string

  • Signature with the accountAddress encoded for use in backend-to-backend requests.

expirationTime

number

  • Timestamp, in seconds, when the generated signature expires.

Parameters

accountAddress

string

  • The smart account address to be used in the backend-to-backend request.

kmsKey

string

  • AWS Key Management Services (KMS) key ARN for the backend wallet provided by the Treasure team.

kmsClientConfig

KMSClientConfig | undefined (see AWS docs)

  • Optional configuration for the AWS KMS client, as required by the implementing backend.
import { generateAccountSignature } from "@treasure-dev/tdk-core";

const signature = await generateAccountSignature({
  accountAddress: "...",
  kmsKey: "...",
  kmsClientConfig: {
    region: "us-west-2",
    credentials: {
      accessKeyId: "...",
      secretAccessKey: "...",
    },
  },
});