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

@oneid-xyz/inspect

v1.0.3

Published

OneID SDK supports our partners to integrate OneID Service easily, which will solve all the complicated cross-chain issues, and help the blockchain products easier to use. Currently, OneID Service supports 70+ chains with only 1 step setup and the OneID N

Downloads

1,785

Readme

Inspect SDK

OneID SDK supports our partners to integrate OneID Service easily, which will solve all the complicated cross-chain issues, and help the blockchain products easier to use. Currently, OneID Service supports 70+ chains with only 1 step setup and the OneID NFT is using TRC-721 (TomoChain)

Published on npm

Installation

We recommend switching to Node.js Version 16 to make sure common crypto dependencies works.

Then run:

npm install @oneid-xyz/inspect
yarn add @oneid-xyz/inspect

Getting Started

To get started, your must accept with the terms of use for using @oneid-xyz/inspect.

import { OneID } from '@oneid-xyz/inspect';

const oneId = new OneID({
  provider: provider,
  rpcUrl: string,
})

Parameter

Functions

Init Configuration

initConfig() allows to init base configuration from OneID SDK

  • Interface
await oneid.systemConfig.initConfig()

Note: Inspect & Core SDK are using same system config, developer shall only need to init once.

Get Wallet by ID Name

getWalletsByID will return the Linked Wallet of an ID Name.

Linked Wallet is the wallet address that user actually interacts with when Dapps/Wallets integrated our ONEID SDK

For example, when you transfer assets to ID Name test.c98 on C98 Wallet, the assets are transferred to the Linked Wallet address.

  • Interface
getWalletsByID(id: string, chainId?: ChainId): Promise<LinkedWallet[]>
  • Params

    • chainId is optional
      • If null, OneID will return 70+ chains & its address.
      • If developers have included chainId, then OneID will return address of that chain.
      • chainId has been defined in SDK to be managed easier. In case, the chain does not have public chainID, CHAIN_TYPE will support to get the chain’s address. we recommend using CHAIN_TYPE in second params.
    const wallets = await oneid.getWalletsByID(“test.c98”, CHAIN_TYPE.BINANCE_SMART) // BSC
    • Result
    LinkedWallet [
        {
            chain: "binanceSmart",
            address: '0x123...'
        }
    ]

Get Primary Name

getPrimaryName will return the Primary Name of the wallet address.

Primary Name is using as main interacting with DAPPs when the wallet address has multiple ID names. For example, in the OneID website, user shall be able to see their Primary Name on the top right corner.

Note: OneID Primary Name offers multi-chains, hence Developer can use address of any chain to get Primary Name even if it's Solana, Cosmos or EVM

  • Interface
getPrimaryName(walletAddress: string): Promise<string>
  • For example
    const id = await oneid.getPrimaryName('0x123...')
    • Result
    id: 'test.c98'

Get Linked ID Names

getLinkedIDs will return all the ID Names that linked to the wallets.

Note: this function support EVM address only

  • Interface
getLinkedIDs(walletAddress: string): Promise<LinkedID[]>
  • For example
    const ids = await oneid.getLinkedIDs('0x123...')
    • Result
    IDs
    [
        {
            "walletName": "",
            "isPrimary": false,
            "node": "0xzxc...",
            "code": "123...",
            "linked": [
                {
                    "chain": "bitcoin",
                    "address": "bc...",
                },
                ...
            ],
            "registar": "0xzxc...",
            "expires": 1725437071,
            "id": "123...",
            "name": "test.c98"
        },
        ...
    ]

Get Controller Permission

getPermission will return the address that has permission to edit Records of ID Name.

  • Interface
getPermission(ids: string[]): Promise<ResponseExecuteTransaction<string[]>>
  • For example
    const owners = await oneid.getPermission(['test.c98'])
    • Result
    owners: ['0x123...', ...]

Get Node

getNode will return node of ID Name which has been stored in contract

  • Interface
getNode(id: string): string
  • For example
    const node = await oneid.getNode(['test.c98'])
    • Result
    node: '0xzxc...'