@kinetic-sdk/ts
v0.1.4
Published
TypeScript client SDK for the Kinetic Daemon
Readme
[email protected]
A TypeScript SDK client for the 127.0.0.1 API.
Usage
First, install the SDK from npm.
npm install kinetic-sdk --saveNext, try it out.
import {
Configuration,
PrivateApi,
} from 'kinetic-sdk';
import type { CommitNameRequest } from 'kinetic-sdk';
async function example() {
console.log("🚀 Testing kinetic-sdk SDK...");
const config = new Configuration({
// Configure HTTP bearer authorization: bearerAuth
accessToken: "YOUR BEARER TOKEN",
});
const api = new PrivateApi(config);
const body = {
// CommitRequest
commitRequest: ...,
} satisfies CommitNameRequest;
try {
const data = await api.commitName(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);Documentation
API Endpoints
All URIs are relative to http://127.0.0.1:16002/api
| Class | Method | HTTP request | Description | ----- | ------ | ------------ | ------------- PrivateApi | commitName | POST /commit | Commit a name hash to DHT PrivateApi | deleteVdfTask | DELETE /vdf/status/{task_id} | Delete a VDF task from memory PrivateApi | getConfig | GET /config | Get config PrivateApi | getOwnedNames | GET /owned-names | Get list of locally owned names PrivateApi | getVdfStatus | GET /vdf/status/{task_id} | Get status of a VDF task PrivateApi | gossipPublish | POST /gossip/publish/{topic} | Broadcast a payload to a Gossipsub topic PrivateApi | publishGovernance | POST /publish-governance | Publish a Governance action to DHT PrivateApi | publishKid | POST /publish-kid | Publish a KID to DHT PrivateApi | publishManifest | POST /publish-manifest | Publish a Capability Manifest to DHT PrivateApi | publishName | POST /publish | Publish a name reveal to DHT PrivateApi | publishZone | POST /zone/{name}/publish | Cryptographically sign and publish local zone to DHT PrivateApi | saveZone | POST /zone/{name} | Save local DNS zone file PrivateApi | syncAtlas | POST /internal/atlas/sync | Trigger a synchronization of the foreign TLD bridge PrivateApi | updateConfig | POST /config | Update config PrivateApi | vdfRegister | POST /vdf/register | Start VDF name registration task PrivateApi | vdfRenew | POST /vdf/renew | Start VDF name renewal task PublicApi | getGovernance | GET /governance | Get current governance state PublicApi | getHealth | GET /health | Get daemon health status PublicApi | getNetworkStatus | GET /network-status | Get network status PublicApi | getPeerId | GET /peer_id | Get local peer ID PublicApi | getTime | GET /time | Get verified Kinetic network time PublicApi | getZone | GET /zone/{name} | Get local DNS zone file PublicApi | gossipSubscribe | GET /gossip/subscribe/{topic} | Subscribe to a Gossipsub topic via Server-Sent Events (SSE) PublicApi | resolveKid | GET /resolve-kid/{did} | Resolve a KID PublicApi | resolveName | GET /resolve/{name} | Resolve a Kinetic name
Models
- AuthorizedKid
- AuthorizedManifest
- CapabilityManifest
- CommitRequest
- Commitment
- DeleteVdfTask200Response
- DnsRecord
- DnsZone
- KidDocument
- NameRenewRequest
- PreviousProof
- PublishRequest
- PublishResponse
- ResolveKid200Response
- Reveal
- UpdateConfigRequest
- VdfProof
- VdfRegister200Response
- VdfRegisterRequest
- VdfTaskStatus
Authorization
Authentication schemes defined for the API:
bearerAuth
- Type: HTTP Bearer Token authentication
About
This TypeScript SDK client supports the Fetch API and is automatically generated by the OpenAPI Generator project:
- API version:
0.1.0 - Package version:
0.1.3 - Generator version:
7.23.0 - Build package:
org.openapitools.codegen.languages.TypeScriptFetchClientCodegen
The generated npm module supports the following:
- Environments
- Node.js
- Webpack
- Browserify
- Language levels
- ES5 - you must have a Promises/A+ library installed
- ES6
- Module systems
- CommonJS
- ES6 module system
Development
Building
To build the TypeScript source code, you need to have Node.js and npm installed. After cloning the repository, navigate to the project directory and run:
npm install
npm run buildPublishing
Once you've built the package, you can publish it to npm:
npm publish