import { DenClient, NetworkId } from "@den/sdk";
// 1) Set up the client.
const client = new DenClient({
apiKey: "ck_live_...",
rpcProviders: {
1: "https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY",
},
});
// 2) Create an account proposal.
const proposal = await client.createNewAccountProposal({
items: [
{
name: "Treasury",
networkIds: [NetworkId.ETHEREUM, NetworkId.POLYGON],
},
],
});
// 3) Sign and execute the proposal.
await client.signAccountProposal(proposal.id, {
type: "approve",
signature: "0x...",
});
const executed = await client.executeAccountProposal(proposal.id, {
type: "approve",
});
// 4) Get the account.
const account = await client.getAccount("acc_123");