@metaio/meta-signature-util
TypeScript icon, indicating that this package has built-in type declarations

0.9.2 • Public • Published

meta-signature-util

This project is to provide Meta Network with the Authorization Utilities.

Installation

Using NPM.js:

npm install @metaio/meta-signature-util

Using Yarn:

yarn add @metaio/meta-signature-util

Usage

Import the modules from the @metaio/meta-signature-util library, and use the generate() method to generate metadata with a signature and the verify() method to validate. TypeScript is supported.

// import functions and modules
import { generateSeed, generateKeys, authorPostDigestSign } from '@metaio/meta-signature-util';

// generate keys and signature metadata
const seed = generateSeed();
const testKeys = generateKeys(seed)
const metadata = authorPostDigestSign.generate(
  testKeys,
  'server_domain',
  'the_digest',
);

// verify the signature
console.log(authorPostDigestSign.verify(metadata));

Please check our documentation to learn more about the modules.

Contributing

We welcome any PR or issue. Thank you for contributing to this project!

Add a new module

To add a new module, please clone this repository from GitHub, and copy a module from the src/modules directory.

Implement your generate and verify functions, and add the module to the modules dictionary. Remember the directory name should be the same as the type name in your metadata.

Then write a test for your module. And update the version in the package.json file.

Add a test case

We're using Jest for testing. Please add your test file to the test directory. Name your test file the same as the module, like meta-network-grids-server-sign.test.ts.

Make sure all the tests pass before you commit.

Motivation

web2_step1 web2_step2 we are doing

We provide the signature tools needed for the steps in the figure.

Readme

Keywords

Package Sidebar

Install

npm i @metaio/meta-signature-util

Weekly Downloads

1

Version

0.9.2

License

MIT

Unpacked Size

76.1 kB

Total Files

72

Last publish

Collaborators

  • remi_crystal
  • andoroyur
  • garfield550