@koibanx/signer-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

Koibanx Signer SDK

Signer SDK based in module Signer

Handles the storage of wallets and allows to sign messages with them


Installation

npm install @koibanx/signer-sdk

NOTE: you must have the npm token in your .npmrc file


Initialization

Node

Using ES6 import

import SignerSdk from '@koibanx/signer-sdk';

const signer = SignerSdk({
  baseURL: 'http://your-url',
  apiKey: 'apiKey',
});

With require

exports.__esModule = true;
const SignerSdk = require('@koibanx/signer-sdk')["default"];

const signer = SignerSdk({
  baseURL: 'http://your-url',
  apiKey: 'apiKey',
});

Types

  • Typescript (@koibanx/signer-sdk/dist/index.d.ts)

Examples

Using ES6 import

import SignerSdk from "@koibanx/signer-sdk";

const signer = SignerSdk({
    baseURL: 'http://your-url',
    apiKey: 'apiKey',
})

const catchError = (err, modulo) => {
  console.log('Modulo: ', modulo);
  console.log('details: ', err.details);
  console.log('shortMessage: ', err.message);
  console.log('errorCode: ', err.code);
}

signer.checkState().then((res) => {
  console.log('checkState: ', res);
}).catch((err) => catchError(err, 'checkState'));

signer.wallet.createWallet({
  user: 'test',
}).then((res) => {
  console.log('createWallet: ', res);
}).catch((err) => catchError(err, 'createWallet'));

signer.wallet.getWallet({
  user: 'test',
}).then((resGetWallet) => {
  console.log('getWallet: ', resGetWallet);
}).catch((err) => catchError(err, 'createWallet'));

signer.signature.signMessage({
  user: 'test1',
  unsignedMessage: 'mensaje',
}).then((resSignMessage) => console.log('signMessage: ', resSignMessage))
.catch((err) => catchError(err, 'signMessage'));

signer.wallet.deleteWallet({
  user: 'test1',
}).then((resDeleteWallet) => {
  console.log('deleteWallet: ', resDeleteWallet);
}).catch((err) => catchError(err, 'deleteWallet'));

Readme

Keywords

none

Package Sidebar

Install

npm i @koibanx/signer-sdk

Weekly Downloads

265

Version

0.0.6

License

ISC

Unpacked Size

29.4 kB

Total Files

29

Last publish

Collaborators

  • npm_koibanx
  • infra-koibanx