NAV
Javascript

Introduction

Welcome to the Breeze Blockchain Developer Portal!

This site is designed to aid those interested in development and improvement of breeze blockchain and its dApps, tipmeacoffee.com and TMAC.Finance.

If you don’t know about breeze blockchain, visit breeze.foundation.

The code for this site is on github. If you’d like to see a specific improvement you can either submit a pull request or file an issue. Please follow our contribution guidelines

Our tutorials section will take you through the basics of interacting with Breeze apis in Javascript.

You can find community resources, libraries, and more ‘human’ ways to get help and education in the social media channels of breeze.

QuickStart

Breeze currently have its javascript library available so tutorials here are given for JS library only. In future we will add python and go libraries too.

To interface with Breeze blockchain, developers need a node connection. You can choose to use one of the available API nodes or run your own node.

Public Nodes

Currently available breeze nodes are following

api.breezechain.org

Private Nodes

To run a private node, follow the guidelines available on breeze github docs

Accounts

Details for accounts api

Account Info

const breej = require('breej');

The above command returns JSON structured like this:

[
{
   "_id":"61f143836eb6b51fbd4ef5f1",
   "name":"breeze",
   "pub":"25ZroSRojDVJxsVDs4nU9E6zZkXttYp73ykRF6ymtvyG8",
   "pub_witness":"25ZroSRojDVJxsVDs4nU9E6zZkXttYp73ykRF6ymtvyG8",
   "balance":20998127369340,
   "bw":{
      "v":64000,
      "t":1643960335575
   },
   "vp":{
      "v":30245486792,
      "t":1643960335575
   },
   "approves":[
      "breeze"
   ],
   "node_appr":20998127369340,
   "follows":[
      
   ],
   "followers":[
      
   ],
   "keys":[
      {
         "id":"signup",
         "pub":"2BKrP6P5dUMAxzJ4qP9QmA5DK2J3ZCkvMPobG5e91fhp3",
         "types":[
            0,
            14,
            15
         ]
      }
   ],
   "recentVotes":[
      
   ],
   "created":{
      "by":"",
      "ts":1621522223702
   },
   "refCount":7,
   "unread":1
}
]

This endpoint gives account information of specific user

HTTP Request

GET https://api.breezechain.org/account/:name

Query Parameters

Field Type Description
name String Username of account
pub String Master public key of account
balance Integer Account balance in terms of 10e6
bw Object Bandwidth object
vp Object Voting Power (VP) object
follows Array List of following accounts
followers Array List of follower accounts
keys Object[] List of account custom keys
id String Custom key identifier
pub String Custom public key
types Integer[] Allowed transaction types for the custom key
weight Integer Custom key weight
json Object Account metadata JSON
approves Array List of witnesses the account has approved
node_appr Integer witness approval
pub_witness String Witness signing public key of account

Blockchain

Transaction Info by Hash

const breej = require('breej');

The above command returns JSON structured like this:

{
   "type":0,
   "data":{
      "pub":"n2mRQvDRhcYxYm2Vm9songcNpXGVhck58L9AD4HWLuEF",
      "name":"alienbird",
      "ref":"breeze"
   },
   "sender":"breeze",
   "ts":1643281127798,
   "hash":"cfa96ef056cad51239794aae1d631971dc861a24014de3c4c716734f416a00db",
   "signature":"5AY9QEhj2BXW9ZgsH8JxqvqE7JXzTFvYmSogLUkzSo2f4dM88DZ39BCACAUCcepNMFnC4LYhnwViwQ3UcSP88u2f",
   "includedInBlock":26383
}

This endpoint gives details of a specific transaction on breeze blockchain

HTTP Request

GET http://api.breezechain.org/tx/:txhash

URL Parameters Required

Field Type Description
txhash String Hash of transaction to query

SUCCESS 200

Field Type Description
type Integer Transaction type
data Object Transaction payload
sender String Transacting account username
ts Integer Transaction expiration timestamp
hash String Transaction hash
signature String/Array Transaction signature
includedInBlock Integer Block number in which the transaction is included

Content

Get content info

const breej = require('breej');

The above command returns JSON structured like this:

{
   "_id":"badar/rafael-nadal-wins-australian-open-in-a-record-breaking-21st-grand-slam",
   "author":"badar",
   "link":"rafael-nadal-wins-australian-open-in-a-record-breaking-21st-grand-slam",
   "pa":null,
   "pp":null,
   "json":{
      "title":"Rafael Nadal wins Australian Open in a record-breaking 21st Grand Slam",
      "body":"Nadal went down two sets to his opponent, Russia's Daniil Medvedev, but managed to stage a comeback to snatch the reco",
      "category":"sports",
      "url":"https://www.euronews.com/2022/01/30/rafael-nadal-wins-australian-open-final-collects-record-breaking-21st-grand-slam-title",
      "image":"https://static.euronews.com/articles/stories/06/43/92/44/1000x563_cmsv2_c0137362-6951-5cb5-9c7d-38158f571277-6439244.jpg",
      "tags":[
         "rafaelnadal",
         "australianopen"
      ]
   },
   "child":[
      
   ],
   "votes":[
      {
         "u":"redbull",
         "ts":1643568799176,
         "vp":277
      },
      {
         "u":"coinhunt",
         "ts":1643601726363,
         "vp":89
      },
      {
         "u":"jennifer",
         "ts":1643603348412,
         "vp":118
      },
      {
         "u":"jacky",
         "ts":1643605405434,
         "vp":277
      }
   ],
   "likes":4,
   "ts":1643556040136,
   "dist":600000
}

This endpoint gives details of content called by specific parameters

HTTP Request

GET http://api.breezechain.org/:author/:link

URL Parameters Required

Field Type Description
author String Content author
link String Content permlink

SUCCESS 200

Field Type Description
_id String Content identifier
author String Content author
link String Content permlink
votes Array Content votes
u String Username of voter
vp Integer VP spent on vote
ts Integer Timestamp of when the vote was casted
likes String Total number of upvotes
ts Integer Timestamp at content creation

Witness

Get witness info

const breej = require('breej');

The above command returns JSON structured like this:

{
   "name":"breeze",
   "balance":20998127429340,
   "node_appr":20998127429340,
   "pub_witness":"25ZroSRojDVJxsVDs4nU9E6zZkXttYp73ykRF6ymtvyG8",
   "subs":0,
   "subbed":0,
   "produced":71912,
   "missed":0,
   "voters":2,
   "last":255118
}

This endpoint gives details of a specific witness

HTTP Request

GET http://api.breezechain.org/witness/:account

URL Parameters Required

Field Type Description
account String Username to query

SUCCESS 200

Field Type Description
name String Username of witness
balance Integer Witness account balance
node_appr Integer Witness approval
pub_leader String Witness signing public key of account
subs Integer Subscriber count of witness
subbed Integer Subscribed count of witness
sinceTs Integer Timestamp of first block produced
sinceBlock Integer Block number of block produced
produced Integer Number of blocks produced
missed Integer Number of blocks missed
voters Integer Number of voters for the witness
last Integer Block number of last block produced

Votes

Get votes info

const breej = require('breej');

The above command returns JSON structured like this:

[
   {
      "author":"charles",
      "link":"beijing-olympics-winter-games-start-amid-covid-and-boycotts",
      "vp":1152,
      "ts":1643962613071,
      "contentTs":1643959912693,
      "likes":3,
      "json":{
         "title":"Beijing Olympics: Winter Games start amid Covid and boycotts",
         "body":"The Winter Games begin amid tight Covid-19 restrictions and allegations of human rights abuses.",
         "category":"news",
         "url":"https://www.bbc.com/news/world-asia-china-60242083",
         "image":"https://ichef.bbci.co.uk/news/1024/branded_news/BD39/production/_123114484_hi073499437.jpg",
         "tags":[
            "beijing",
            "olympics",
            "games",
            "covid"
         ]
      }
   }
]

This endpoint gives votes of a user from specific time

HTTP Request

GET http://api.breezechain.org/votes/:voter/:lastTs

URL Parameters Required

Field Type Description
voter String Username to voter
lastTs Integer Last timestamp of votes to be queried

SUCCESS 200

Field Type Description
author String Author of vote
link String Permlink of vote
vp Integer VP spent on vote
ts Integer Timestamp of when the vote was casted
contentTs Integer Timestamp of the content being voted on
json array upvoted content details