|
1 | 1 | ```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()) |
16 | 16 | ``` |
0 commit comments