GithubHelp home page GithubHelp logo

btuprotocol / btu.js Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 3.0 1.67 MB

BTU.js is a Javascript library for interacting with the BTU Protocol. Using it, you can easily make calls to the BTU smart contracts and API to build a booking app or dapp. Functionality includes searching and booking 2M hotels OR activities and booking them live! With BTU.js, every developer can become a booking company and earn $BTU tokens

JavaScript 100.00%
booking hotel activities ethereum token btu protocol

btu.js's Introduction

BTU.JS

BTU.JS is a javascript library that interacts with BTU Protocol. It allows any developer to build a booking application or a widget.

Getting started

Install BTU.JS

npm install btujs --save

Instantiate BTU.JS

const btujs = require('btujs');

const myBtujs = new btujs();

Components

Dappbar

Documentation for this project

Resources methods

searchResources()

Search for resources regardless of their availabilities.

Prototype

  myBtujs.resources.searchResources(String resourceType, Object body, Function callback)

Usage


getResource()

Query resource by its ID to get its details.

Prototype

  myBtujs.resources.getResource(String resourceType, String resourceId, Object body, Function callback)

Usage


getResourceItem()

Query resource by its ID and its sub-item ID to get sub-item details.

Prototype

  myBtujs.resource.getResourceItem(String resourceType, String resourceId, String itemId, Object body, Function callback)

Usage


Availabilities methods

searchAvailableResources()

Search for availables resources only.

Prototype

  myBtujs.availabilities.searchAvailableResources(String resourceType, Object body, Function callback)

Usage


getResourceAvailabilities()

Query a resource by its ID and get its availabilities.

Prototype

  myBtujs.availabilities.getResourceAvailabilities(String resourceType, String resourceId, Object body, Function callback)

isResourceAvailable()

Check if a resource is available under different conditions.

Prototype

  myBtujs.availabilities.isResourceAvailable(String resourceType, String resourceId, Object body, Function callback)

Usage

Response

  {
    isAvailable: true // or false
  }

bookResource()

Book a resource availability.

Prototype

  myBtujs.availabilities.bookResource(String resourceType, String resourceId, Object body, Function callback)

Usage


getBookingDetails()

Get informations about a booking you made.

Prototype

  myBtujs.availabilities.getBookingDetails(String resourceType, String bookingId, Object body, Function callback)

Usage


cancelBooking()

Cancel a reservation you booked through the bookResource method.

Prototype

  myBtujs.availabilities.cancelBooking(String resourceType, String bookingId, Object body, Function callback)

Usage

btu.js's People

Contributors

ragiri avatar flerunigo avatar dosbtup avatar capitainekas avatar trakercookie avatar vbrizion avatar gadazeraf avatar pelluro avatar appyhour770 avatar btu-admin avatar

Stargazers

Vivien avatar

Watchers

James Cloos avatar  avatar Aurelien avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.