@caldera-trade/3dp-registrar
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

Caldera Trade 3DP Registrar

NPM version NPM downloads

Build Status

The Caldera Trade 3DP Registrar provides your JavaScript & TypeScript applications easy access to Polkadot Judgements.

This library can be used by NodeJS applications, tools, and other automations to provide users Judgements and validate KYC.

Installation

You can install the SDK using npm or yarn

npm install @caldera-trade/3dp-registrar
yarn add @caldera-trade/3dp-registrar

Usage

Discord Validation

import { validateMessageSignature } from "@caldera-trade/3dp-registrar";

process.env['P3D_REGISTRAR_MNEMONIC'] = '<some_mnemonic>'; // We suggest using Doppler or another secrets management syste to inject your secrets instead

// Create new client with your private access tokens
await validateMessageSignature(message, message.content, 1);

Website Validation

import {
    extractDataAndSignature,
	isJudgementRequestSubmitted,
	provideJudgement,
	verifyOnChainIdentity,
} from "@caldera-trade/3dp-registrar";

process.env['P3D_REGISTRAR_MNEMONIC'] = '<some_mnemonic>'; // We suggest using Doppler or another secrets management syste to inject your secrets instead

/** Validate Identity */
const { validOnChainIdentity, isReasonable } =
    await verifyOnChainIdentity(walletAddress);


/** Check if Judgement Extrinsic is on Blockchain */
const judgmentRequestSubmitted = await isJudgementRequestSubmitted(
    walletAddress,
    registrarIndex,
    registrarFee,
);

/** Provide Judgement */
await provideJudgement(walletAddress, mnemonic, registrarIndex, 'Reasonable');

If you would like any additional features exposed, create an Issue or submit a Pull Request!

Readme

Keywords

none

Package Sidebar

Install

npm i @caldera-trade/3dp-registrar

Weekly Downloads

110

Version

1.2.2

License

Apache-2.0

Unpacked Size

346 kB

Total Files

27

Last publish

Collaborators

  • deafwave