npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ancrypto-sdk-test

v5.0.0

Published

The Ancrypto SDK is a software development kit (SDK) that provides a set of tools and functions for interacting with the Ancrypto platform. It simplifies the integration of Ancrypto functionalities into your applications, allowing you to easily perform op

Downloads

12

Readme

AncryptoSDK

The Ancrypto SDK is a software development kit (SDK) that provides a set of tools and functions for interacting with the Ancrypto platform. It simplifies the integration of Ancrypto functionalities into your applications, allowing you to easily perform operations such as user address retrieval, data encryption and decryption, IPFS interaction, and more.

Installation

To use the AncryptoSdk library, you need to have Node.js installed. You can install the library using npm or yarn.

To install the Ancrypto SDK, follow these steps:

npm install ancrypto-sdk-test

Usage

After installation add this to your package

import { AncryptoSdk } from "ancrypto-sdk-test";

Create an instance of the AncryptoSdk class, providing the necessary parameters:

To initialize the AncryptoSdk, you need to provide the RPC endpoint and an optional x_access_key if required by the backend.

const rpc = "YOUR_RPC_ENDPOINT"; // polygon testnet https://rpc-mumbai.maticvigil.com/
//api key
const x_access_key = "YOUR_X_ACCESS_KEY"; // Optional

const ancryptoSdk = new AncryptoSdk(rpc, x_access_key);

Create Identity for Resolving Address

Create identity is a method that upload the data on blockchain with the help of api

...
const requestData = {
  username: "user123",
  address: "0x123...",
  signature: "<signature create with username and evm address>",
  addresses: [
      {
      "eth": "0x312d175e0bBd968e8a56Af2D28CEfee671002290",
        // create signature with username and this address
      "sign": "0x3f2c13d3aee1234dd8ebab0cb7dbb630260ee6d96c2f97af85c3177c622851d4663ff45cd6e86ee86fb29cb19793669886d620d6672201b152f9718aadae12af1c"
    },
    {
      "bsc": "0x312d175e0bBd968e8a56Af2D28CEfee671002290",
        // create signature with username and this address
      "sign": "0x3f2c13d3aee1234dd8ebab0cb7dbb630260ee6d96c2f97af85c3177c622851d4663ff45cd6e86ee86fb29cb19793669886d620d6672201b152f9718aadae12af1c"
    },
    ]
    ...
};
const identity = await ancryptoSdk.createIdentity(requestData);
console.log("Created Identity:", identity);
...

Utilize the various methods of the SDK for your desired functionality. Here's an example of how to retrieve a user's address:

const username = "your username";
const network = "eth"; //chain should be : eth, polygon, nrk, ftm, tron, bsc, bch, btc,ltc,doge, xtz
...
try {
  const address = await sdk.resolveAddress(username, network);
  console.log("User Address:", address);
} catch (error) {
  console.error("Error:", error.message);
}
...

NOTE: CahinId should be eth, nrk, tron, bsc, bch, btc, polygon, ftm, doge, ltc, xtz

Contributing

Contributions to the Ancrypto SDK are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

License