Generates a backend wallet signature to be used in backend-to-backend requests.

Usage

import {
  createTreasureConnectClient,
  generateBackendWalletSignature,
} from "@treasure-dev/tdk-core";

const client = createTreasureConnectClient({ clientId: "..." });

const signature = await generateBackendWalletSignature({
  client,
  chainId: 421614,
  kmsKey: "...",
});

Returns

Promise<Object>

backendWallet

string

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

signature

string

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

expirationTime

number

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

Parameters

client

TreasureConnectClient

  • The Treasure Connect client created with a Treasure-provided client ID.

chainId

number

  • Chain ID where the smart backend wallet will be deployed and used for signing.

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 {
  createTreasureConnectClient,
  generateBackendWalletSignature,
} from "@treasure-dev/tdk-core";

const client = createTreasureConnectClient({ clientId: "..." });

const signature = await generateBackendWalletSignature({
  client,
  chainId: 421614,
  kmsKey: "...",
  kmsClientConfig: {
    region: "us-west-2",
    credentials: {
      accessKeyId: "...",
      secretAccessKey: "...",
    },
  },
});