Skip to content

anataliocs/avail-api-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Avail API Use Cases

Typescript ts-node scripts that demonstrate interacting with an Avail node.

Run an Avail node on Spheron

Install

Install:

    npm i

Install ts-node if needed

npm i -g ts-node

Create Local Config

Update: config.ts

export default {
    mnemonic: "", // The secret seed value for account used to sign transactions 
    ApiURL: "",   // Api url
    app_id: 0,    // Application id 
    amount: 0,    // Amount of tokens to transfer
    receiver: ""  // Receiver address
}

Connect to a node:

ts-node connect.ts 

Subscribes to new blocks:

ts-node listen_new_blocks.ts 

Releases

No releases published

Packages