1.0.3 • Published 2 years ago
krnl v1.0.3
krnl.js
Forked from ethers.js 6.10.1and extended with krnl specific rpc calls and configs.
Installing
NodeJS
npm install krnlBrowser (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.