Neoclassical Programming Multitude
Have ideas to improve npm?Join in the discussion! »

js-conflux-sdkTypeScript icon, indicating that this package has built-in type declarations

0.10.2 • Public • Published

js-conflux-sdk

JavaScript Conflux Software Development Kit

Installation

npm install js-conflux-sdk

Usage

api document

Nodejs

const { Conflux } = require('js-conflux-sdk');
 
async function main() {
  const cfx = new Conflux({
    url: 'http://testnet-jsonrpc.conflux-chain.org:12537',
    defaultGasPrice: 100,
    defaultGas: 1000000,
    logger: console,
  });
 
  const balance = await cfx.getBalance('0xbbd9e9be525ab967e633bcdaeac8bd5723ed4d6b');
  console.log(balance); // 937499420597305000n
}
 
main();

require deep nested file/dir

const util = require('js-conflux-sdk/src/util');

Frontend

umd

import { Conflux } from 'js-conflux-sdk/dist/js-conflux-sdk.umd.min.js';

or

<script type="text/javascript" src="node_modules/js-conflux-sdk/dist/js-conflux-sdk.umd.min.js"></script>
<script type="text/javascript">
  const cfx = new window.Conflux.Conflux({
    url: 'http://testnet-jsonrpc.conflux-chain.org:12537',
    defaultGasPrice: 100,
    defaultGas: 1000000,
    logger: console,
  });
</script> 

Change log

see

Example

example

Keywords

Install

npm i [email protected]

Version

0.10.2

License

LGPL-3.0

Unpacked Size

3.42 MB

Total Files

46

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar