> For the complete documentation index, see [llms.txt](https://whitepaper.lacunalabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whitepaper.lacunalabs.io/for-developers/sdk.md).

# Wallet & Developer SDK

The Lacuna SDK lets you add private transactions to your own app or agent — the same shielding, transfers, and x402 payments the wallet uses.

## Install

```
npm install @lacuna/sdk
```

## Create A Wallet

```ts
import { LacunaWallet } from "@lacuna/sdk";

const wallet = await LacunaWallet.create({ pin });
```

## Core Actions

```ts
// Move funds into the shielded pool
await wallet.shield({ token: "USDC", amount: "100" });

// Private transfer to another user
await wallet.transfer({ to: recipientAddress, amount: "40" });

// Withdraw back to a public address
await wallet.unshield({ to: publicAddress, amount: "25" });
```

## Private x402 Payments

```ts
await wallet.payX402({
  endpoint: "https://api.example.com/resource",
  amount: "5",
  token: "USDC",
});
```

## Selective Disclosure

```ts
// Export a read-only viewing key (it can never spend)
const viewingKey = await wallet.exportViewingKey();
```

> The surface above illustrates the developer experience; method names are stabilizing ahead of the public release — see the [Roadmap](/resources/roadmap.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://whitepaper.lacunalabs.io/for-developers/sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
