@threefold/tfchain_client
TypeScript icon, indicating that this package has built-in type declarations

2.5.2 • Public • Published

tfchain_client

This a Typescript client to communicate with TFChain.

Installation

yarn install

Building

yarn build

Usage

there are 2 types of client. one for just query the chain and the other one for query and do transaction on the chain.

Query Client

import { QueryClient } from "./src/client";

const cl = new QueryClient("wss://tfchain.dev.grid.tf");
await cl.connect();
const c = await cl.contracts.get(19530);
console.log(c);
cl.disconnect();

Full Client

import { Client } from "./src/client";

const cl = new Client({ url: "wss://tfchain.dev.grid.tf", mnemonicOrSecret: "<your mnemonic>" });
await cl.connect();
const contract = await (await cl.contracts.createName("hamada")).apply();
console.log(contract);
await cl.disconnect();

Supported URLs

  • devnet
  • qanet
  • testnet
  • mainnet

Readme

Keywords

Package Sidebar

Install

npm i @threefold/tfchain_client

Weekly Downloads

237

Version

2.5.2

License

ISC

Unpacked Size

239 kB

Total Files

99

Last publish

Collaborators

  • threefolddev