SDK Overview

By AnchorFactory ·

Keeta development uses two npm packages. They serve different purposes and have different module systems.

Core SDK: @keetanetwork/keetanet-client

The blockchain SDK — accounts, blocks, operations, client.

npm install @keetanetwork/keetanet-client
  • Module system: CommonJS (require() works)

  • npm: latest version

  • Docs: https://static.network.keeta.com/docs/

Key APIs

const Keeta = require("@keetanetwork/keetanet-client");

// Account management
const seed = Keeta.lib.Account.generateRandomSeed();
const account = Keeta.lib.Account.fromSeed(seed, 0);
const address = account.publicKeyString.get();

// High-level client
const client = await Keeta.UserClient.fromNetwork('main', null, { account });
const state = await client.getAccountState(account);

// Send tokens
await client.send(amount, recipientAddress, tokenAddress);

// Signatures
const msgBytes = new TextEncoder().encode("message");
const signature = await account.sign(msgBytes.buffer);
const valid = account.verify(msgBytes.buffer, signature);

File Locations

node_modules/@keetanetwork/keetanet-client/
  client/index.d.ts          -- UserClient & Client API
  lib/index.d.ts             -- Account, Block, Utils
  lib/account.d.ts           -- Account class
  lib/block/index.d.ts       -- Block & BlockBuilder
  lib/block/operations.d.ts  -- All operation types
  docs/GETTING-STARTED.md    -- SDK quick start
  examples/                  -- Example code

Pro tip: The .d.ts files are the best documentation.

Anchor SDK: @keetanetwork/anchor

Anchor services SDK — KYC, FX, asset movement, username, notification, storage.

npm install @keetanetwork/anchor
  • Module system: ESM only — must use `import()`, not `require()`

  • npm: latest version

Service Clients

const { KYC } = await import("@keetanetwork/anchor/client");
const { FX } = await import("@keetanetwork/anchor/client");
const { Username } = await import("@keetanetwork/anchor/client");

Namespace

Purpose

KYC.Client

KYC flows (verification, certificates)

FX.Client

FX operations (estimate, quote, exchange)

AssetMovement.Client

Cross-chain bridges

Username.Client

Username claim/release/resolve

Notification.Client

Push notification registration

Storage.Client

Encrypted data storage

Resolver (Service Discovery)

const { Resolver } = await import("@keetanetwork/anchor/lib/resolver");

const resolver = new Resolver({ root: resolverAccount, client: keetaClient });
const fxServices = await resolver.lookup('fx', criteria);
const kycServices = await resolver.lookup('kyc', { countryCodes: ['US'] });

Signed Data (Authentication)

const { SignData, VerifySignedData } = await import(
  "@keetanetwork/anchor/lib/utils/signing.js"
);

// Client side: sign
const signed = await SignData(account, ["field1", "field2"]);

// Anchor side: verify
const valid = await VerifySignedData(account, ["field1", "field2"], signed);

File Locations

node_modules/@keetanetwork/anchor/
  client/index.d.ts          -- Namespace exports
  lib/index.d.ts             -- Certificates, Resolver, URI
  lib/certificates.d.ts      -- Certificate sharing
  lib/resolver.d.ts          -- Service discovery
  lib/utils/signing.d.ts     -- SignData, VerifySignedData
  services/kyc/              -- KYC anchor client
  services/fx/               -- FX anchor client
  services/asset-movement/   -- Asset movement client
  services/username/         -- Username client
  services/storage/          -- Storage client
  services/notification/     -- Notification client

Other Useful Packages

Package

Purpose

@keetanetwork/currency-info

Currency/country info, ISO codes, SVG flags

@keetanetwork/demo-fx-anchor

Reference FX anchor implementation

@keetanetwork/pulumi-components

Infrastructure-as-code for Keeta nodes

More in Reference · All documentation