Skip to content

v0.1.2 — Add CreateATA

Latest

Choose a tag to compare

@valentineejk valentineejk released this 10 May 17:47

New

  • Client.CreateATA(ctx, CreateATAOpts) — idempotently creates an Associated Token Account on-chain for a given owner+mint. Pays the ~0.002 SOL rent from PayerSigner and signs the tx. Returns AlreadyExists=true with no tx sent when the ATA already exists.

Use case

Warm up a new user's USDC (or USDT) deposit address before exposing it to them, so the first inbound transfer succeeds without forcing the sender to pay rent.

```go
res, err := c.CreateATA(ctx, stablekit.CreateATAOpts{
Owner: userWallet,
Mint: stablekit.USDC,
PayerSigner: rilleFunderKey,
})
if res.AlreadyExists {
// No-op
}
```

Install

```bash
go get github.com/rillehq/stablekit@v0.1.2
```