getPubKey
Get the TBC public key from the connected wallet.
Usage
ts
const { tbcPubKey } = await Turing.getPubKey();
console.log(tbcPubKey);Parameters
This method takes no parameters.
Returns
ts
interface GetPubKeyResponse {
tbcPubKey: string; // TBC public key in hex format
}| Field | Type | Description |
|---|---|---|
tbcPubKey | string | The TBC public key string |
Error Handling
ts
try {
const { tbcPubKey } = await Turing.getPubKey();
console.log("Public key:", tbcPubKey);
} catch (error) {
console.error("Failed to get public key:", error);
}