0.6.1 • Published 6 years ago

@iota-pico/examples-browser-js v0.6.1

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

GitHub license Build Status NSP Status

IOTA Pico Framework Examples for Browser in JavaScript

Introduction

The IOTA Pico Framework is intended to be a multi-layered set of object oriented JavaScript libraries.

Each layer is fully abstracted allowing you to replace components with your own implementations very easily.

The libraries are written in TypeScript so are all strongly typed. The modules are generated as ES6 so you may need to transpile them when including them for use in older JavaScript eco-systems. The code will run without transpilation in all modern browsers and when used by NodeJs.

Installation

npm install @iota-pico/examples-browser-ts

Examples

Example code for using IOTA Pico Framework with Browser written in JavaScript.

Running

You can run the examples by serving the web pages locally by running:

npm run serve

The will automatically start a web server and launch the index page containing links to all the examples.

Configuration

If you want to modify the node that is used to service the examples please modify the config file config/networkConfig.json.

To connect to a node use:

{
    "protocol": "http",
    "host": "n1.iota.eco",
    "port": 14265
}

To connect to the sandbox use the following:

{
    "protocol": "http",
    "host": "sandbox.iotatoken.com",
    "path": "/api/v1/commands",
    "port": 14265,
    "additionalHeaders": {
        "Authorization": "YOUR_SANDBOX_TOKEN"
    }
}