1.0.12 • Published 2 years ago

hotweb3 v1.0.12

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

hotweb3

JavaScript/TypeScript client for a remote Hotmoka node

Usage

// In Browser
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.1/axios.min.js"></script>
<script src="dist/hotweb3.js"></script>

<script type="application/javascript">
    const remoteNode = new hotweb3.RemoteNode("http://panarea.hotmoka.io");
    (async function() {
        try {
            const takamakacode = await remoteNode.getTakamakaCode();
            alert('takamakacode: ' + JSON.stringify(takamakacode));
        } catch (e) {
            console.error(e);
            alert(e);
        }
    })();
</script>
// In Node.js/JavaScript
const { RemoteNode } = require("hotweb3");

const remoteNode = new RemoteNode("http://panarea.hotmoka.io")
(async function () {
    try {
        const takamakaCode = await remoteNode.getTakamakaCode()
        console.log('takamakaCode', takamakaCode)
    } catch (e) {
        console.error(e)
    }
})()
// In TypeScript
import {
    RemoteNode,
    TransactionReferenceModel
} from "hotweb3";

const remoteNode = new RemoteNode("http://panarea.hotmoka.io")
(async (): Promise<void> => {
    try {
        const takamakaCode: TransactionReferenceModel = await remoteNode.getTakamakaCode()
        console.log('takamakaCode', takamakaCode)
    } catch (e) {
        console.error(e)
    }
})()

Build

Requirements

Install dependencies

npm install

Bundle source code

npm run bundle

Tests

npm run test:all
1.0.12

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago