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

orbiter-chaincore-dev

v1.0.1

Published

Orbier Finance Chain SDK

Downloads

6

Readme

Orbiter-Finance ChainCoreBin

Hacker News showcase using typescript

  / _ \   _ __  | |__   (_) | |_    ___   _ __          |  ___| (_)  _ __     __ _   _ __     ___    ___ 
 | | | | | '__| | '_ \  | | | __|  / _ \ | '__|  _____  | |_    | | | '_ \   / _` | | '_ \   / __|  / _ \
 | |_| | | |    | |_) | | | | |_  |  __/ | |    |_____| |  _|   | | | | | | | (_| | | | | | | (__  |  __/
  \___/  |_|    |_.__/  |_|  \__|  \___| |_|            |_|     |_| |_| |_|  \__,_| |_| |_|  \___|  \___|
                                                        

QuickStart

Chain structure

  • chains.json Mainnet
  • testnet.json Testnet
{
  // Whether to enable debug mode, default false
  "debug": false,
  "api": {
    // API interface of block browser
    "url": "https://api.etherscan.io/api",
    // Interface request key, if any
    "key": "You Key"
  },
  // ChainID
  "chainId": "1",
  // NetworkId In most public chains, the network ID and the public chain ID are the same
  "networkId": "1",
  // Orbiter custom id,unique, not repeated
  "internalId": "1",
  // Chain Name
  "name": "Ethereum Mainnet",
  // The default main currency of the public chain
  "nativeCurrency": {
    // Token Name
    "name": "Ether",
    // Token Symbol
    "symbol": "ETH",
    // Token decimals
    "decimals": 18,
    // Token Contract Address
    "address": "0x0000000000000000000000000000000000000000"
  },
  // RPC server address
  "rpc": [
    "wss://eth-mainnet.alchemyapi.io/v2/You Key"
  ],
  // The monitoring method to enable
  "watch": ["rpc", "api"],
  // contract address to monitor
  "contracts": ["0xd9d74a29307cc6fc8bf424ee4217f1a587fbc8dc"],
  // List of contract tokens to monitor
  "tokens": [
    // The structure is consistent with nativeCurrency
    {
      "name": "USD Coin",
      "symbol": "USDC",
      "decimals": 6,
      "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
    }
  ]
}

Easy access to code

import { logger, ScanChainMain } from "../..";
import mainChains from "../chains.json";
import testChains from "../testnet.json";
const scanChain = new ScanChainMain(<any>[...mainChains, ...testChains]);
scanChain.startScanChain("internalId", ["Wallet Address", "xxxx"])

Monitored cursor position

  • The monitored cursor position is stored and the cache directory

Struct

{
  "cache": [
    [
      "keyv:ApiCursor:{Wallet Address}",
      {
        "value": "{\"value\":{\"blockNumber\":{Last Watch Tx Number},\"hash\":\"{Last Watch Tx Hash}\",\"timestamp\":{Last Watch Tx Time}}},\"expires\":null}"
      }
    ],
    [
      "keyv:rpcScan:288",
      {
        "value": "{\"value\":{RPC Last Scan Block Number}},\"expires\":null}"
      }
    ]
  ],
  "lastExpire": 1654672839824
}

Query historical transactions

  • If you need to query historical transactions, you need to rebuild the cursor index, and you need to modify the index file in the cache directory corresponding to the public chain
  • Api Major Modified Fields
    • blockNumber // Start scanning from this block
    • hash // Start scanning from this Hash
    • timestamp // Start scanning from this Time
  • RPC Major Modified Fields
    • rpcScan-> value // Start scanning from this block

Code documentthe file Modules documentthe file

Requirement

  • Node.js 8.x+
  • Typescript 2.8+