UNPKG

vana-sdk

Version:

A TypeScript library for interacting with Vana Network smart contracts

23 lines 860 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createClient = exports.defaultFromBlock = void 0; const viem_1 = require("viem"); const chains_1 = require("../config/chains"); exports.defaultFromBlock = BigInt(292220); // No need to query earlier than this // eslint-disable-next-line no-use-before-define -- circular dependency let _client; const createClient = (chainId = chains_1.mokshaTestnet.id) => { if (!_client || _client.chain?.id !== chainId) { const chain = chains_1.chains[chainId]; if (!chain) { throw new Error(`Chain ${chainId} not found`); } _client = (0, viem_1.createPublicClient)({ chain, transport: (0, viem_1.http)(), }); } return _client; }; exports.createClient = createClient; //# sourceMappingURL=client.js.map