Creating a transaction means assembling a transfer or contract call, submitting
it for policy checks, and collecting the required signatures. The SDK helps you propose
the transaction, tracks approvals, and executes once thresholds are met.This quickstart walks through getting accounts, selecting a policy, and
creating a transaction proposal using the SDK.
We firmly recommend using the SDK instead of calling the API directly. The SDK performs
local policy validation, which adds an additional layer of security to every account transaction.
Initialize the SDK client and the signer that will submit approvals. You’ll need an API key created by an admin in the Den dashboard, and your signer wallet must be added to the organization as a member to propose, sign, and execute transactions.See Setting up an API member for the full setup process.
Copy
import { DenClient } from "@den/sdk";import { privateKeyToAccount } from "viem/accounts";const signer = privateKeyToAccount("0xYOUR_PRIVATE_KEY");const client = new DenClient({ apiKey: "ck_live_...", rpcProviders: { 1: "https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY", },});
Create a proposal with the selected account, policy, and transaction details.
Copy
const queued = await client.createTransaction(accountId, { networkId: 1, policyId, description: "Payment to vendor", to: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", value: "0", data: "0xa9059cbb...",});
The initial response includes a signatureData object with the initiator
signing payload. After the initiator signs, transaction responses use the same
signatureData object to expose the approve and reject payloads.
The privateKeyToAccount example in this guide is for local development. Here are some example patterns you can use in production See Signing keys to learn more.