0.4.1 • Published 2 years ago
@sensible-contract/sensible-web3 v0.4.1
Sensible-Web3
This is the Sensible Contract Javascript SDK.
You need to connect a wallet to use this library.
Please read the documentation for more and try the demo.
Installation
Node
npm install @sensible-contract/sensible-web3
Yarn
yarn add @sensible-contract/sensible-web3
In the Browser
Use the prebuilt umd/sensible-web3.min.js
, or
build using the repository:
npm run build
Then include umd/sensible-web3.min.js
in your html file.
This will expose Web3
on the window object.
Or via jsDelivr CDN:
<script src="https://cdn.jsdelivr.net/npm/@sensible-contract/sensible-web3@latest/umd/sensible-web3.min.js"></script>
UNPKG:
<script src="https://unpkg.com/@sensible-contract/sensible-web3@latest/umd/sensible-web3.min.js"></script>
Usage
// In Node.js
const Web3 = require('@sensible-contract/sensible-web3');
let web3 = new Web3(window.sensilet);
console.log(web3); > {
sensible: ...,
utils: ...,
...
}
Usage with TypeScript
We support types within the repo itself. Please open an issue here if you find any wrong types.
You can use web3.js
as follows:
import Web3 from "@sensible-contract/sensible-web3";
const web3 = new Web3(window.sensilet);
Documentation
Documentation can be found at ReadTheDocs.
Demo
Some usages can be found at Demo.
Building
npm run build
Testing (mocha)
npm run test