Skip to content

Commit f8ba362

Browse files
authored
Update get-balance.mdx
1 parent b78d6e3 commit f8ba362

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
```typescript
2-
import { PublicKey } from "@solana/web3.js";
3-
import { createRpc } from "@lightprotocol/stateless.js";
4-
import {
5-
getAssociatedTokenAddressInterface,
6-
getAtaInterface,
7-
} from "@lightprotocol/compressed-token/unified";
8-
9-
const rpc = createRpc();
10-
const mint = new PublicKey("YOUR_MINT_ADDRESS");
11-
const owner = new PublicKey("YOUR_OWNER_ADDRESS");
12-
13-
const ata = getAssociatedTokenAddressInterface(mint, owner);
14-
const account = await getAtaInterface(rpc, ata, owner, mint);
15-
console.log("Balance:", account.parsed.amount.toString());
2+
import { PublicKey } from "@solana/web3.js";
3+
import { createRpc } from "@lightprotocol/stateless.js";
4+
import {
5+
getAssociatedTokenAddressInterface,
6+
getAtaInterface,
7+
} from "@lightprotocol/compressed-token/unified";
8+
9+
const rpc = createRpc();
10+
const mint = new PublicKey("YOUR_MINT_ADDRESS");
11+
const owner = new PublicKey("YOUR_OWNER_ADDRESS");
12+
13+
const ata = getAssociatedTokenAddressInterface(mint, owner);
14+
const account = await getAtaInterface(rpc, ata, owner, mint);
15+
console.log("Balance:", account.parsed.amount.toString())
1616
```

0 commit comments

Comments
 (0)