import { DenClient } from "@onchainden/mls-sdk-ts";
// 1) Set up the client.
const client = new DenClient({
apiKey: process.env.DEN_API_KEY!,
baseUrl: process.env.DEN_API_BASE_URL!,
});
// 2) Create an account proposal.
const { data: proposal } = await client.proposeAccountCreation({
items: [
{
name: "Treasury",
networkIds: [1, 137],
},
],
});
// 3) Sign and execute the proposal.
await client.signAccountProposal(proposal.id, {
type: "approve",
signature: "0x...",
});
const { data: executed } = await client.executeAccountProposal(proposal.id, {
type: "approve",
});
// 4) Get the account.
const { data: account } = await client.getAccount("acc_123");