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

@datafire/chaingateway

v3.0.0

Published

DataFire integration for Chaingateway.io

Downloads

13

Readme

@datafire/chaingateway

Client library for Chaingateway.io

Installation and Usage

npm install --save @datafire/chaingateway
let chaingateway = require('@datafire/chaingateway').create();

.then(data => {
  console.log(data);
});

Description

Chaingateway.io

REST API to build the bridge between Ethereum and the real world

Please check out our website for detailed information about this API.

To use our API, you need an API Key (Described as Authorization header in the examples below). To get one, please create an account on our website.

For our internal documentation, please check out our Docs Site.

If you need help with integrating our API in your application, you can reach us via email or join our official Telegram group.

Actions

clearAddress

Sends all available ethereum funds of an address to a specified receiver address.

chaingateway.clearAddress({
  "Authorization": "",
  "body": {
    "ethereumaddress": "",
    "newaddress": "",
    "password": ""
  }
}, context)

Input

Output

deleteAddress

Deletes an existing ethereum address. Be careful when using this function.

chaingateway.deleteAddress({
  "Authorization": "",
  "body": {
    "ethereumaddress": "",
    "password": ""
  }
}, context)

Input

Output

exportAddress

Returns all ethereum addresses created with an account.

chaingateway.exportAddress({
  "Authorization": "",
  "body": {
    "ethaddress": "",
    "password": ""
  }
}, context)

Input

Output

getBlock

Returns information of an ethereum block with or without transactions

chaingateway.getBlock({
  "Authorization": "",
  "body": {
    "block": ""
  }
}, context)

Input

  • input object

Output

getEthereumBalance

Returns the ethereum balance of a given address.

chaingateway.getEthereumBalance({
  "Authorization": "",
  "body": {
    "ethereumaddress": ""
  }
}, context)

Input

Output

getExchangeRate

Returns the current Ethereum price in Euro or US Dollar.

chaingateway.getExchangeRate({
  "Authorization": "",
  "body": {
    "currency": ""
  }
}, context)

Input

Output

getGasPrice

Returns the current gas price in GWEI.

chaingateway.getGasPrice({
  "Content-Type": "",
  "Authorization": ""
}, context)

Input

  • input object
    • Content-Type required string
    • Authorization required string: API Key

Output

getLastBlockNumber

Returns the block number of the last mined ethereum block.

chaingateway.getLastBlockNumber({
  "Content-Type": "",
  "Authorization": ""
}, context)

Input

  • input object
    • Content-Type required string
    • Authorization required string: API Key

Output

getToken

Returns information about a specific ERC20 token like name, symbol, decimal places and total supply.

chaingateway.getToken({
  "Authorization": "",
  "body": {
    "contractaddress": ""
  }
}, context)

Input

  • input object

Output

getTokenBalance

Returns the token balance of a given address.

chaingateway.getTokenBalance({
  "Authorization": "",
  "body": {
    "contractaddress": "",
    "ethereumaddress": ""
  }
}, context)

Input

Output

getTransactions

Returns information like confirmations, token contract address, amount, gas price and more of a given transaction.

chaingateway.getTransactions({
  "Authorization": "",
  "body": {
    "txid": ""
  }
}, context)

Input

Output

importAddress

Returns all ethereum addresses created with an account.

chaingateway.importAddress({
  "Authorization": "",
  "body": {
    "filename": "",
    "content": {
      "version": 0,
      "id": "",
      "address": "",
      "crypto": {
        "ciphertext": "",
        "cipherparams": {
          "iv": ""
        },
        "cipher": "",
        "kdf": "",
        "kdfparams": {
          "dklen": 0,
          "salt": "",
          "n": 0,
          "r": 0,
          "p": 0
        },
        "mac": ""
      }
    },
    "password": ""
  }
}, context)

Input

Output

listAddresses

Returns all ethereum addresses created with an account.

chaingateway.listAddresses({
  "Content-Type": "",
  "Authorization": ""
}, context)

Input

  • input object
    • Content-Type required string
    • Authorization required string: API Key

Output

listFailedIPNs

Returns all subscriptions/IPNs created with an account.

chaingateway.listFailedIPNs({
  "Content-Type": "",
  "Authorization": ""
}, context)

Input

  • input object
    • Content-Type required string
    • Authorization required string: API Key

Output

listSubscribedAddresses

Returns all subscriptions/IPNs created with an account.

chaingateway.listSubscribedAddresses({
  "Content-Type": "",
  "Authorization": ""
}, context)

Input

  • input object
    • Content-Type required string
    • Authorization required string: API Key

Output

newAddress

Generates a new ethereum addresses you can use to send or receive funds. Do not lose the password! We can't restore access to an address if you lose it.

chaingateway.newAddress({
  "Authorization": "",
  "body": {
    "password": ""
  }
}, context)

Input

Output

resendFailedIPN

Returns all subscriptions/IPNs created with an account.

chaingateway.resendFailedIPN({
  "Authorization": "",
  "body": {
    "id": 0
  }
}, context)

Input

Output

sendEthereum

Sends ethereum from an address controlled by the account to a specified receiver address.

chaingateway.sendEthereum({
  "Authorization": "",
  "body": {
    "from": "",
    "to": "",
    "password": "",
    "amount": 0
  }
}, context)

Input

Output

sendToken

Sends ERC20 tokens from an address controlled by the account to a specified receiver address. The token contract address is needed to specify the token. The use of the identifier parameter is recommend and awaits an unique string. Whenever a transaction is beeing sent, the identifier is checked and the transaction gets dropped if there is one with that identifier already.

chaingateway.sendToken({
  "Authorization": "",
  "body": {
    "contractaddress": "",
    "from": "",
    "to": "",
    "password": "",
    "amount": 0,
    "identifier": ""
  }
}, context)

Input

  • input object

Output

subscribeAddress

Creates a new subscription/IPN for the given address (and contractaddress). You will receive a notification to the given url every time a deposit is received. Unsubscribe the address before sending tokens/ETH from it or you won't get reliable notifications anymore.

chaingateway.subscribeAddress({
  "Authorization": "",
  "body": {
    "ethereumaddress": "",
    "contractaddress": "",
    "url": ""
  }
}, context)

Input

Output

unsubscribeAddress

Deletes an existing subscription/IPN for the given address (and contractaddress).

chaingateway.unsubscribeAddress({
  "Authorization": "",
  "body": {
    "ethereumaddress": "",
    "contractaddress": "",
    "url": ""
  }
}, context)

Input

Output

Definitions

Address

  • Address object
    • ethereumaddress required string

Cipherparams

  • Cipherparams object
    • iv required string

Content

  • Content object
    • address required string
    • crypto required Crypto
    • id required string
    • version required integer

Crypto

  • Crypto object
    • cipher required string
    • cipherparams required Cipherparams
    • ciphertext required string
    • kdf required string
    • kdfparams required Kdfparams
    • mac required string

FailedIpn

  • FailedIpn object
    • action required string
    • amount required string
    • contractaddress required string
    • ethereumaddress required string
    • id required string
    • timestamp required string
    • url required string

Ipn

  • Ipn object
    • contractaddress required string
    • ethereumaddress required string
    • url required string

Kdfparams

  • Kdfparams object
    • dklen required integer
    • n required integer
    • p required integer
    • r required integer
    • salt required string

Transaction

  • Transaction object
    • amount required string
    • block_number required string
    • contract_address required string
    • from required string
    • gas required string
    • gas_price required string
    • to required string
    • token_decimals required string
    • token_name required string
    • token_supply required string
    • token_symbol required string
    • txid required string
    • type required string

clearAddress

  • clearAddress object
    • amount required number
    • ethereumaddress required string
    • gas required number
    • newaddress required string
    • ok required boolean
    • total required string
    • txid required string

clearAddressRequest

  • clearAddressRequest object
    • ethereumaddress required string
    • newaddress required string
    • password required string

deleteAddress

  • deleteAddress object
    • deleted required boolean
    • ethereumaddress required string
    • ok required boolean

deleteAddressRequest

  • deleteAddressRequest object
    • ethereumaddress required string
    • password required string

exportAddress

  • exportAddress object
    • content required string
    • filename required string
    • ok required boolean

exportAddressRequest

  • exportAddressRequest object
    • ethaddress required string
    • password required string

getBlock

  • getBlock object
    • block_number required string
    • difficulty required string
    • gas_limit required string
    • gas_used required string
    • hash required string
    • miner required string
    • ok required boolean
    • parent_hash required string
    • size_in_bytes required string
    • time_stamp required string
    • transactions_count required string

getBlockRequest

  • getBlockRequest object
    • block required string

getEthereumBalance

  • getEthereumBalance object
    • balance required number
    • ethereumaddress required string
    • ok required boolean

getEthereumBalanceRequest

  • getEthereumBalanceRequest object
    • ethereumaddress required string

getExchangeRate

  • getExchangeRate object
    • currency required string
    • ok required boolean
    • rate required number

getExchangeRateRequest

  • getExchangeRateRequest object
    • currency required string

getGasPrice

  • getGasPrice object
    • gasprice required integer
    • ok required boolean

getLastBlockNumber

  • getLastBlockNumber object
    • blocknumber required integer
    • ok required boolean

getToken

  • getToken object
    • contractaddress required string
    • decimals required integer
    • name required string
    • ok required boolean
    • supply required integer
    • symbol required string

getTokenBalance

  • getTokenBalance object
    • balance required integer
    • contractaddress required string
    • ethereumaddress required string
    • ok required boolean

getTokenBalanceRequest

  • getTokenBalanceRequest object
    • contractaddress required string
    • ethereumaddress required string

getTokenRequest

  • getTokenRequest object
    • contractaddress required string

getTransactions

  • getTransactions object
    • ok required boolean
    • transactions required array

getTransactionsRequest

  • getTransactionsRequest object
    • txid required string

importAddress

  • importAddress object
    • ethaddress required string
    • filename required string
    • ok required boolean

importAddressRequest

  • importAddressRequest object
    • content required Content
    • filename required string
    • password required string

listAddresses

  • listAddresses object
    • addresses required array
    • ok required boolean

listFailedIPNs

  • listFailedIPNs object
    • failed_ipns required array
    • ok required boolean

listSubscribedAddresses

  • listSubscribedAddresses object
    • ipns required array
    • ok required boolean

newAddress

  • newAddress object
    • ethereumaddress required string
    • ok required boolean
    • password required string

newAddressRequest

  • newAddressRequest object
    • password required string

resendFailedIPN

  • resendFailedIPN object
    • id required integer
    • ok required boolean

resendFailedIPNRequest

  • resendFailedIPNRequest object
    • id required integer

sendEthereum

  • sendEthereum object
    • amount required string
    • from required string
    • ok required boolean
    • to required string
    • txid required string

sendEthereumRequest

  • sendEthereumRequest object
    • amount required number
    • from required string
    • password required string
    • to required string

sendToken

  • sendToken object
    • amount required integer
    • contractaddress required string
    • from required string
    • identifier required string
    • ok required boolean
    • to required string
    • txid required string

sendTokenRequest

  • sendTokenRequest object
    • amount required integer
    • contractaddress required string
    • from required string
    • identifier required string
    • password required string
    • to required string

subscribeAddress

  • subscribeAddress object
    • contractaddress required string
    • ethereumaddress required string
    • ok required boolean
    • url required string

subscribeAddressRequest

  • subscribeAddressRequest object
    • contractaddress required string
    • ethereumaddress required string
    • url required string

unsubscribeAddress

  • unsubscribeAddress object
    • contractaddress required string
    • deleted required boolean
    • ethereumaddress required string
    • ok required boolean
    • url required string

unsubscribeAddressRequest

  • unsubscribeAddressRequest object
    • contractaddress required string
    • ethereumaddress required string
    • url required string