Frontend SDK¶
The Frontend SDK provides a TypeScript/JavaScript library for building browser-based dApps on Wasichain. It handles wallet connection, transaction construction, contract queries, and event subscriptions.
Installation¶
Connecting to a wallet¶
import { WasichainClient } from "@wasichain/sdk";
const client = await WasichainClient.connect();
const address = client.address;
The SDK automatically detects the Wasichain wallet extension. If the extension is not installed, connect() throws an error that the dApp can use to prompt the user to install it.
Querying contracts¶
Queries are read-only and do not require a signature or gas payment.
Sending transactions¶
The SDK builds the transaction, requests a signature from the wallet extension, and submits it to the network. The returned hash can be used to poll for the transaction receipt.