Skip to main content

Wallet daemon signer

This is the only signer that works in both Node.js and browser environments. It enables a direct connection to a wallet via JSON-RPC.

Install required dependencies

npm install @tari-project/wallet-daemon-signer @tari-project/tari-permissions

Establish and test the connection

import { TariPermissions } from "@tari-project/tari-permissions";
import { WalletDaemonTariSigner } from "@tari-project/wallet-daemon-signer";

const permissions = new TariPermissions().addPermission("Admin");
const serverUrl = "http://127.0.0.1:12010/json_rpc";
const signer = await WalletDaemonTariSigner.buildFetchProvider({
permissions,
serverUrl,
});

// Test connection
const account = await signer.getAccount();
console.log(`Account address: ${account.address}`);

If the connection is successful, it should output an account address similar to the following:

Account id: component_24b679b98056c7ca7e3d9f9266fec928c7f29d35e7aec546ed69f532aff40710