@getsafle/safle-identity-wallet

1.3.0 • Public • Published

Safle Identity Wallet

This package is used to interact with Safle smart contracts. Registered Registrars can use this package to set and update safleId for the user.

Anyone can use this for SafleId Resolution.

For now the registrar process is manual, if you want to become one, drop us an email or engage on our social media channels. We will be making it democratic and decentralized soon, it's already in the smart contracts [Hint: You can build on it by yourself too!].

Disclaimer - This is WIP, and release in alpha.

Installation and Usage

Installation

Install the package by running the command,

npm install @getsafle/safle-identity-wallet

Import the package into your project using,

const safleId = require('@getsafle/safle-identity-wallet').SafleID;

Initialising

Initialise the constructor using your Infura secret key or RPC URL like this,

const safle = new safleId(env, rpcUrl);

  • env - The network to perform the blockchain queries. (valid values - mainnet or testnet).
  • rpcUrl - RPC URL for the specified network env.

List of all functions

Set SafleId


  • setSafleId()

Inputs

userAddress - Address of the user. safleId - SafleId to be set. from - Address of the registrar. privateKey - Private Key of the registrar.

Output

Transaction details.

Update SafleId


  • updateSafleId()

Inputs

userAddress - Address of the user. newSafleId - New SafleId to be set. from - Address of the registrar. privateKey - Private Key of the registrar.

Output

Transaction details.

Check if SafleId registration is paused,


  • isRegistrationPaused()

Inputs

No inputs.

Output

If registration is paused - true If registration is not paused - false

SafleId update count


  • getUpdateCount()

Input

address - Address of the user to check the SafleId update count.

Output

update count If invalid or wrong address - Invalid address.

Retrieve the SafleId of a particular address


  • getSafleId()

Input

userAddress - Address of the user to get the SafleId.

Output

SafleId of the user If invalid or wrong address - Invalid address.

Retrieve the address of a particular SafleId


  • getAddress()

Input

safleId - SafleId of the user to get the address.

Output

Address of the user.

Get the current SafleId registration fees


  • safleIdFees()

Output

SafleId registration fees.

Resolve old safleIds of a user


  • resolveOldSafleId()

Input

address - Address of the user. index - Index of the old SafleId.

Output

Old safleId of the user at that index.

Resolve safleId from coin address


  • coinAddressToSafleId()

Input

coinAddress - Coin address of the user.

Output

safleId mapped to that coin address

Resolve coin address from safleId and chainId


  • safleIdToCoinAddress()

Input

safleId - SafleId of the user. chainId - ChainId of the chain for which the address has to be resolved.

Output

Coin address for that particular safleId and chainId.

WIP

Want to contribute, we would ❤️ that!

We are a Global 🌏🌍🌎 team! 💪

Write to dev@getsafle.com, or follow us on twitter, https://twitter.com/getsafle

Readme

Keywords

none

Package Sidebar

Install

npm i @getsafle/safle-identity-wallet

Weekly Downloads

3

Version

1.3.0

License

ISC

Unpacked Size

39.5 kB

Total Files

12

Last publish

Collaborators

  • subhanshugupta
  • apoorv31
  • shubham.3008
  • sidth