SDK Reference
init(projectId: string, metadata: SignClientTypes.Metadata, network?: LedgerId)
Initializes the SDK with the given project ID, metadata, and optional network selection.
UMD Example:
const projectId = 'your_project_id';
const metadata = {
name: 'My Hashinals App',
description: 'A Hashinals application using WalletConnect',
url: 'https://myapp.com',
icons: ['https://myapp.com/icon.png'],
};
await window.HashinalsWalletConnectSDK.init(projectId, metadata);
ESM Example:
import { HashinalsWalletConnectSDK } from '@hashgraphonline/hashinal-wc';
import { LedgerId } from '@hashgraph/sdk';
const sdk = HashinalsWalletConnectSDK.getInstance();
await sdk.init(projectId, metadata, LedgerId.TESTNET);
connect()
Opens the WalletConnect modal for users to connect their wallet.
UMD Example:
const session = await window.HashinalsWalletConnectSDK.connect();
ESM Example:
const session = await sdk.connect();