1.8.1 • Published 7 months ago

fairyring-client-ts v1.8.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 months ago

FairyRing Client

TypeScript client for the FairyRing blockchain.

Browser Support

ChromeFirefoxSafariOperaEdgeIE
Latest ✔Latest ✔Latest ✔Latest ✔Latest ✔11 ✔

Install

Using npm:

$ npm install fairyring-client-ts

Using yarn:

$ yarn add fairyring-client-ts

Using pnpm:

$ pnpm add fairyring-client-ts

How to use

useClient() hook:

import { Client } from "fairyring-client-ts";
import { env } from "../env";

const useClientInstance = () => {
  const client = new Client(env);
  return client;
};
let clientInstance: ReturnType<typeof useClientInstance>;

export const useClient = () => {
  if (!clientInstance) {
    clientInstance = useClientInstance();
  }
  return clientInstance;
};

Get the latest block height from PEP module:

const client = useClient();
const latestHeight = await client.FairyringPep.query.queryLatestHeight();

Get nonce:

const client = useClient();
await client.FairyringPep.query.queryPepNonce(address);
const client = useClient();
const txResult = await client.FairyringPep.tx.sendMsgSubmitEncryptedTx({
  value: {
    creator: address,
    data: encryptedHex,
    targetBlockHeight: state.targetHeight,
  },
  fee: {
    amount: [
      {
        denom: "ufairy",
        amount: ENCRYPTION_PAY.toString(),
      },
    ],
    gas: "500000",
  },
});
1.8.1

7 months ago

1.8.0

7 months ago

1.7.20

11 months ago

1.7.21

11 months ago

1.7.22

11 months ago

1.7.23

11 months ago

1.7.24

11 months ago

1.7.25

11 months ago

1.7.17

12 months ago

1.7.18

12 months ago

1.7.19

12 months ago

1.2.23

1 year ago

1.2.24

1 year ago

1.2.22

1 year ago

1.2.25

1 year ago

1.2.21

1 year ago

1.2.20

1 year ago

1.2.19

1 year ago

1.2.18

1 year ago

1.2.16

1 year ago

1.2.17

1 year ago

1.1.27

1 year ago

1.2.15

1 year ago

1.1.26

1 year ago

1.1.16

2 years ago

1.1.18

2 years ago

1.1.22

2 years ago

1.1.20

2 years ago

1.1.24

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.0.9

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

0.0.8

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago