TypeScript client
Typed reads against a LEZ node and LWS-0 wallet actions, viem-style.
npm i @logos-kit/client @logos-kit/codec@logos-kit/client is the typed layer the QML SDK is built on. You can use it
directly from Node scripts, tests and tools. It has two sets of actions on one
client:
nodeActions: reads and raw submission against a LEZ node (the sequencer's JSON-RPC).walletActions: LWS-0 requests to the Logos Kit wallet (connect, read shared accounts, propose transactions, follow them).
Amounts are decimal strings (u128 never becomes a JS number): lepta for the
native token (1 LGO = 10^9 lepta; show them with formatUnits(amount, 9) from
@logos-kit/codec). The root entry point stays QML-safe: no native BigInt,
no Intl.
Hover over the code below to see the types.
Read the chain
import { , , } from '@logos-kit/client'
const = ({
: ('https://testnet.lez.logos.co', { : 2 }),
: 'lez:testnet',
}).()
async function () {
const height = await .() const fees = await .() .(, .)
}The official LEZ sequencer (testnet.lez.logos.co) and a default LEZ
deployment send no CORS headers, so from those http() works in Node and other
non-browser runtimes, not in a web page. In a web page, use Logos Kit's relay
for the testnet, https://lez-testnet.84.46.247.92.sslip.io, which does send
CORS headers. In Basecamp, read through the wallet (readAccount,
getWalletBalance).
Talk to the wallet
In a Basecamp module, the basecampModule transport carries LWS-0 calls to the
wallet core module over logos.callModuleAsync. The QML SDK sets this up for
you; this is what it does underneath:
import { , , } from '@logos-kit/client'
import { } from '@logos-kit/codec'
declare const : {
(
: string,
: string,
: unknown[],
: (: string) => void,
?: number,
): void
}
const = ({
: ({ : . }),
: 'lez:testnet',
}).()
async function (: string) {
const = await .({ : ['lez:testnet'] })
const from = .[0].
// Resolves when the user approves, not when the transaction lands.
// '1000' is lepta: 0.000001 LGO.
const { } = await .(, (, , '1000'))
const status = await .() return . === 'success'
}User-facing steps (connect, send, sign, faucet) open a wallet sheet through a
Basecamp intent; the rest are reads. See the QML SDK for the
transaction lifecycle and what outcome means.
Types
ClientConfig
Prop
Type
HttpOptions
Prop
Type
PollOptions
Used by every wait… action.
Prop
Type
NodeActions
Prop
Type
WalletActions
Prop
Type
ProgramCall (@logos-kit/codec)
What sendCall takes. Build one with the codec's helpers (nativeTransfer,
the token and testimonial builders) rather than by hand.
Prop
Type