krnl
v1.0.3
Published
A complete and compact Ethereum library, for dapps, wallets and any other tools extended with Krnl compatible functionalities.
Downloads
18
Readme
krnl.js
Forked from ethers.js 6.10.1and extended with krnl specific rpc calls and configs.
Installing
NodeJS
npm install krnl
Browser (ESM)
The bundled library is available in the ./dist/
folder in this repo.
<script type="module">
import { ethers } from "./dist/ethers.min.js";
</script>
Changelog
For the latest changes, see the CHANGELOG.
Original ethers documentation
Browse the documentation online:
Usage
Note: Metamask connection is currently not supported.
Setting up your krnl json rpc provider
const provider = new ethers.JsonRpcProvider(KRNL_NODE, krnlAccessToken);
Sending krnl transaction requests and calling contracts
// specify the FaaS you need
const faasRequests: string[] = ["KYT", "KYC"];
// requesting the signatureToken
const hashAndSig = await provider.sendKrnlTransactionRequest(faasRequests);
// call your contract
const sentTx = await dapp.protectedFunctionality(
"test",
hashAndSig.hash,
hashAndSig.signatureToken,
{ messages: faasRequests }
);
For more example see the sandbox example scripts.