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

Usage

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

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

const verifiedBackendWallet = await verifyBackendWalletSignature({
  client,
  chainId: 421614,
  backendWallet: "...",
  signature: "...",
  expirationTime: ...,
});

Returns

Promise<string>

  • The address recovered from the signature, which corresponds to a backend wallet address for use in backend-to-backend requests.

Parameters

client

TreasureConnectClient

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

chainId

number

  • Chain ID where the smart backend wallet was used for signing.

backendWallet

string

signature

string

expirationTime

number