0.3.1 • Published 2 years ago

@ic-naming/client v0.3.1

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

IC-Naming JS SDK

Installing

Using npm:

npm install @dfinity/{agent,candid,principal} # dfinity needs
npm install @ic-naming/client

Using yarn:

yarn add @dfinity/{agent,candid,principal} # dfinity needs
yarn add @ic-naming/client

Example

Normal:

import { IcNamingClient } from "@ic-naming/client";

const client = new IcNamingClient({
  net: "MAINNET", // MAINNET | TICP
  mode: "local", // local | production
});

client.isAvailableNaming("hello.world").then((isAvailable) => {
  console.log(isAvailable ? "Available!" : "Not Available!");
});

Special host and identity:

import { IcNamingClient } from "@ic-naming/client";

const client = new IcNamingClient({
  net: "MAINNET",
  mode: "local",
  httpAgent: {
    host: "https://ic0.app", // default by mode
    identity: {
      identity: {
        transformRequest: () => {
          /* ... */
        },
        getPrincipal: () => {
          /* ... */
        },
      },
    },
  },
});

More example in repo

Client API

client.ts

Document TODO

Contribute

Local commands:

yarn dev # rollup library watch mode
yarn type # typescript type check
yarn test # jest unit test
yarn build # rollup build to dist/
yarn release # generate new version
0.3.0-1

2 years ago

0.3.0-2

2 years ago

0.3.0

2 years ago

0.3.1

2 years ago

0.2.0

2 years ago

0.2.6

2 years ago

0.3.0-0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.0.1

2 years ago