Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

First Call

Hit the public testnet with a read-only client. No signer needed.

Hello, chain

import { createPublicClient, createTransport, testnet } from "@left-curve/sdk"
 
const client = createPublicClient({
  chain: testnet,
  transport: createTransport(),
})
 
const status = await client.queryStatus()
console.log(status.chainId, status.block.height)

createTransport() reads the URL from the chain config (testnet.url). To override, pass a URL: createTransport("https://api-testnet.dango.zone").

Query a balance

import { createPublicClient, createTransport, testnet } from "@left-curve/sdk"
import type { Address } from "@left-curve/sdk"
 
const client = createPublicClient({
  chain: testnet,
  transport: createTransport(),
})
 
const address: Address = "0x1234567890abcdef1234567890abcdef12345678"
const amount = await client.getBalance({ address, denom: "dango" })
console.log(amount)

getBalance returns a base-unit string. Parse with BigInt or Decimal before doing arithmetic — see Encoding & Types.

Next