xqcxx-stacks-analytics-tracker-sdk
v0.1.0
Published
TypeScript SDK for the analytics-tracker Clarity contract on Stacks.
Downloads
14,974
Maintainers
Readme
xqcxx-stacks-analytics-tracker-sdk
TypeScript SDK for interacting with the analytics-tracker Clarity contract.
Install
npm install xqcxx-stacks-analytics-tracker-sdk @stacks/transactionsUsage
import {
CONTRACT_NAME,
getContractId,
buildTrackPageViewArgs,
fetchContractInfo,
} from "xqcxx-stacks-analytics-tracker-sdk";
const contract = {
contractAddress: "ST000000000000000000002AMW42H",
contractName: CONTRACT_NAME,
};
const contractId = getContractId(contract);
const functionArgs = buildTrackPageViewArgs({
projectId: "demo-app",
page: "/home",
});
const info = await fetchContractInfo(contract, "testnet", "ST1...");Use functionArgs with your wallet/provider request flow (stx_callContract) or with makeContractCall from @stacks/transactions.
