Classes

RoomNightAdmin

RoomNightAdmin

RoomNightCustomer

RoomNightCustomer

RoomNightVendor

RoomNightVendor




RoomNightAdmin
RoomNightAdmin

Kind: global class




roomNightAdmin.getVendorIds(offset, limit, options) ⇒ Promise
Get Vendor ids by page

Kind: instance method of RoomNightAdmin
Returns: Promise - {vendorIds: Number, nextVendorId: Number }

  • vendorIds: Vendor ids,
  • nextVendorId: The next id of vendor, if id = 0 the next vendor is null
Param Type Description
offset Number The begin id, if id = 0 search from the begin
limit Number The limit of one page
options Object




roomNightAdmin.getVendor(vendorId, options) ⇒ Promise
Get the vendor info by id

Kind: instance method of RoomNightAdmin
Returns: Promise - {name: String, address: String, createTime: Number, isValid: Boolean}

  • name: Vendor name
  • address: Vendor address
  • createTime: Create time: UTC timestamp(s)
  • isValid: Vendor is valid or not
Param Type Description
vendorId Number Vendor id
options Object




roomNightAdmin.getVendorByAddress(address, options) ⇒ Promise
Get vendor info by vendor address

Kind: instance method of RoomNightAdmin
Returns: Promise - {name: String, address: String, createTime: Number, isValid: Boolean}

  • name: Vendor name
  • address: Vendor address
  • createTime: Create time: UTC timestamp(s)
  • isValid: Vendor is valid or not
Param Type Description
address String Vendor address
options Object




roomNightAdmin.supportedTokens(offset, limit, options) ⇒ Promise
Get all supported tokens ids

Kind: instance method of RoomNightAdmin
Returns: Promise - {tokenIds: Number, nextVendorId: Number}

  • tokenIds: Token ids
  • nextVendorId: The next id of vendor, if id = 0 the next vendor is null
Param Type Description
offset Number The begin id, if id = 0 search from the begin
limit Number The limit of one page
options Object




roomNightAdmin.getToken(tokenId, options) ⇒ Promise
Get token information by token id

Kind: instance method of RoomNightAdmin
Returns: Promise - {symbole: String, name: String, decimal: Number, address: String}

  • symbole: Token symbole
  • name: Token name
  • decimal: Token decimal
  • address: Token address
Param Type Description
tokenId Number Token id
options Object




roomNightAdmin.updateBaseTokenURI(uri, options) ⇒ Promise
Update the base URI of token

Kind: instance method of RoomNightAdmin
Returns: Promise - {tx: String, uri: String}

  • tx: Transaction address
  • uri: The base URI of token
Param Type Description
uri String The base URI of token
options Object




roomNightAdmin.addVendor(address, name, options) ⇒ Promise
Add vendor

Kind: instance method of RoomNightAdmin
Returns: Promise - {tx: String, address: String, name: String}

  • tx: Transaction address
  • address: Vendor address
  • name: Vendor name
Param Type Description
address String Vendor address
name String Vendor name
options Object




roomNightAdmin.removeVendorByAddress(address, options) ⇒ Promise
Remove vendor by vendor address

Kind: instance method of RoomNightAdmin
Returns: Promise - {tx: String, address: String}

  • tx: Transaction address
  • address: Vendor address
Param Type Description
address String Vendor address
options Object




roomNightAdmin.removeVendorById(vendorId, options) ⇒ Promise
Remove vendor by vendor id

Kind: instance method of RoomNightAdmin
Returns: Promise - {tx: String, address: String}

  • tx: Transaction address
  • address: Vendor address
Param Type Description
vendorId Number Vendor id
options Object




roomNightAdmin.makeVendorValid(vendorId, valid, options) ⇒ Promise
Make vendor valid or invalid

Kind: instance method of RoomNightAdmin
Returns: Promise - {tx: String, address: String, valid: Boolean}

  • tx: Transaction address
  • address: Vendor address
  • valid: Vendor is valid or not
Param Type Description
vendorId Number Vendor id
valid Boolean Vendor is valid or not
options Object




roomNightAdmin.addToken(contractAddress, options) ⇒ Promise
Add token

Kind: instance method of RoomNightAdmin
Returns: Promise - {tx: String, address: String}

  • tx: Transaction address
  • address: Token contract address
Param Type Description
contractAddress String Token contract address
options Object




roomNightAdmin.removeToken(tokenId, options) ⇒ Promise
Remove token

Kind: instance method of RoomNightAdmin
Returns: Promise - {tx: String, id: Number}

  • tx: Transaction address
  • id: Token id
Param Type Description
tokenId Number Token id
options Object




RoomNightCustomer
RoomNightCustomer

Kind: global class




roomNightCustomer.ipfsBase58ToHex(ipfs) ⇒ String
Convert IPFS address from base58 to hex format(begin with 0x)

Kind: instance method of RoomNightCustomer
Returns: String - IPFS with hex format(begin with 0x)

Param Type Description
ipfs String IPFS address with base58 encoded




roomNightCustomer.ipfsHexToBase58(ipfs) ⇒ String
Conver IPFS address from hex format to base58 format

Kind: instance method of RoomNightCustomer
Returns: String - IPFS with base58 format

Param Type Description
ipfs String IPFS address with hex format




roomNightCustomer._getTokenContractInstance(token) ⇒ Promise
Kind: instance method of RoomNightCustomer
Returns: Promise - {Contract instance}

Param Type
token token




roomNightCustomer.name() ⇒ Promise
The name of current room night token

Kind: instance method of RoomNightCustomer
Returns: Promise - {String} The name of current room night token




roomNightCustomer.symbol() ⇒ Promise
The symbol of current room night token

Kind: instance method of RoomNightCustomer
Returns: Promise - {String} The symbol of current room night token




roomNightCustomer.tokenURI(tokenId) ⇒ Promise
The URI of token's information

Kind: instance method of RoomNightCustomer
Returns: Promise - {String} The URI of token. E.g: http://ipfs.tripiochina.cn/api/v0/cat/Qmaj8UWNjTzBMBHkkaqSiyax2nFgiwYP2ewxnhGBucn6S8

Param Type Description
tokenId Number Token id




roomNightCustomer.balanceOf(owner) ⇒ Promise
The balance of any address

Kind: instance method of RoomNightCustomer
Returns: Promise - {BigNumber} The token balance

Param Type Description
owner String The owner address of some token




roomNightCustomer.ownerOf(tokenId) ⇒ Promise
Get the owner of any token

Kind: instance method of RoomNightCustomer
Returns: Promise - {String} The token's owner address

Param Type Description
tokenId Number The room night token id




roomNightCustomer.getApproved(tokenId) ⇒ Promise
Get the approved address for a single room night token

Kind: instance method of RoomNightCustomer
Returns: Promise - {String} The approved address for this token, or the zero address if there is none

Param Type Description
tokenId Number The room night token id




roomNightCustomer.isApprovedForAll(owner, operator) ⇒ Promise
Query if an address is an authorized operator for another address

Kind: instance method of RoomNightCustomer
Returns: Promise - {Boolean} True if operator is an approved operator for owner, false otherwise

Param Type Description
owner String The address that owns the token
operator String The address that acts on behalf of the owner




roomNightCustomer.isRefundApplied(rnid) ⇒ Promise
Whether the token is in refund applications

Kind: instance method of RoomNightCustomer
Returns: Promise - {Boolean} True if token in refund applications, false otherwise

Param Type Description
rnid Number The room night token id




roomNightCustomer.roomNight(rnid) ⇒ Promise
Get the room night infomation in detail

Kind: instance method of RoomNightCustomer
Returns: Promise - {vendorId: BigNumber, rateplanId: BigNumber, tokenId: BigNumber, price: BigNumber, timestamp: BigNumber, date: BigNumber, ipfs: Hex String, rateplanName: String}

  • vendorId: Vendor id
  • rateplanId: Rateplan id
  • tokenId: ERC2.0 Token id
  • price: ERC2.0 price of RP
  • timestamp: Create time: UTC timestamp(s)
  • date: Order date E.g: 20180621
  • ipfs: The IPFS's address of rateplan's desc(Hex String)
  • rateplanName: Rateplan name
Param Type Description
rnid Number The room night token id




roomNightCustomer.roomNightsOfOwner(from, limit, isVendor, options) ⇒ Promise
Get all the room nights of the msg.sender(Customer or Vendor)

Kind: instance method of RoomNightCustomer
Returns: Promise - {roomnightIds: BigNumber|Array, nextId: BigNumber}

  • roomnightIds: Room night token ids
  • nextId: The next id of token, if id = 0 the next token is null
Param Type Description
from Number The begin id, if id = 0 search from the begin
limit Number The limit of one page
isVendor Boolean Is vendor or not
options Dict {from: msg.sender}




roomNightCustomer.safeTransferFrom(from, to, tokenId, data, {tx:)
Transfers the ownership of an room night token from one address to another address. When transfer is complete, this function checks if _to is a smart contract (code size > 0). If so, it calls onERC721Received on _to and throws if the return value is not bytes4(keccak256("onERC721Received(address,uint256,bytes)")).

Kind: instance method of RoomNightCustomer

Param Type Description
from String The current owner of the room night token
to String The new owner
tokenId Number The token to transfer
data String Additional data with no specified format, sent in call to to
{tx: Promise String, from: BigNumber, to: BigNumber, tokenId: BigNumber} tx: Transaction number from: The current owner of the room night token to: The new owner tokenId: The token to transfer




roomNightCustomer.transferFrom(from, to, tokenId, {tx:)
Transfers the ownership of an room night token from one address to another address

Kind: instance method of RoomNightCustomer

Param Type Description
from String The current owner of the room night token
to String The new owner
tokenId Number The token to transfer
{tx: Promise String, from: BigNumber, to: BigNumber, tokenId: BigNumber} tx: Transaction number from: The current owner of the room night token to: The new owner tokenId: The token to transfer




roomNightCustomer.transferFromInBatch(from, to, tokenIds, {tx:)
Transfers the ownership of tokens from one address to another address

Kind: instance method of RoomNightCustomer

Param Type Description
from String The current owner of the room night token
to String The new owner
tokenIds Number \ Array The tokens to transfer
{tx: Promise String, from: BigNumber, to: BigNumber, tokenIds: Number Array} tx: Transaction number from: The current owner of the room night token to: The new owner tokenIds: The token to transfer




roomNightCustomer.approve(approved, tokenId, {tx:)
Set or reaffirm the approved address for an room night token

Kind: instance method of RoomNightCustomer

Param Type Description
approved String The new approved token controller
tokenId Number The token to approve
{tx: Promise String, owner: String, approved: String, tokenId: BigNumber} tx: Transaction number owner: The current owner of the room night token approved: The new approved token controller tokenId: The token to approve




roomNightCustomer.setApprovalForAll(operator, approved, {tx:)
Enable or disable approval for a third party ("operator") to manage all of msg.sender's assets

Kind: instance method of RoomNightCustomer

Param Type Description
operator String The new approved token controller
approved Boolean The token to approve
{tx: Promise String, owner: String, operator: String, approved: Boolean} tx: Transaction number owner: The current owner of the room night token operator: The new approved token controller approved: The token to approve




roomNightCustomer.buyInBatch(vendorId, rpid, dates, token, options, {tx:)
By room nigth in batch through ETH(token == 0) or other digital token(token != 0)

Kind: instance method of RoomNightCustomer

Param Type Description
vendorId Number The vendor Id
rpid Number The vendor's rate plan id
dates Number \ Array The booking dates
token Number The digital currency token
options Dict {from: msg.sender}
{tx: Promise String, customer: String, vendor: String, rpid: BigNumber, dates: Number Array, token: BigNumber} tx: Transaction number customer: The customer address vendor: Then vendor address rpid: The rateplan id dates: The booking dates token: The digital currency token




roomNightCustomer.applyRefund(rnid, isRefund, options, {tx:)
Apply room night refund

Kind: instance method of RoomNightCustomer

Param Type Description
rnid Number Room night token id
isRefund Boolean if true the rnid can refund else not
options Dict {from: msg.sender}
{tx: Promise String, customer: String, rnid: BigNumber, isRefund: Boolean} tx: Transaction number customer: The customer address rnid: The rateplan id isRefund: if true the rnid can refund else not




roomNightCustomer.refund(rnid, options, {tx:)
Refund through ETH or other digital token, give the room night ETH/TOKEN to customer and take back inventory

Kind: instance method of RoomNightCustomer

Param Type Description
rnid Number Room night token id
options Dict {from: msg.sender}
{tx: Promise String, vendor: String, rnid: BigNumber} tx: Transaction number vendor: Then vendor address * rnid: Room night token id




RoomNightVendor
RoomNightVendor

Kind: global class




roomNightVendor.inventoriesOfDate(vendorId, rpid, dates, options) ⇒ Promise
Get inventories of dates

Kind: instance method of RoomNightVendor

Param Type Description
vendorId Number Vendor id
rpid Number Rateplan id
dates Number Dates E.g: [20180610,20180611]
options Object




roomNightVendor.pricesOfDate(vendorId, rpid, dates, token, options) ⇒ Promise
Get prices of dates

Kind: instance method of RoomNightVendor

Param Type Description
vendorId Number Vendor id
rpid Number Rateplan id
dates Number Dates E.g: [20180610,20180611]
token Number Token id
options Object




roomNightVendor.priceOfDate(vendorId, rpid, date, token, options) ⇒ Promise
Get price and inventory of date

Kind: instance method of RoomNightVendor
Returns: Promise - {inventory: Number, price: Number}

  • inventory: Inventory
  • price: Price
Param Type Description
vendorId Number Vendor id
rpid Number Rateplan id
date Number Date E.g: 20180630
token Number Token id
options Object




roomNightVendor.ratePlansOfVendor(vendorId, offset, limit, options) ⇒ Promise
Get rateplans of vendor by vendor id

Kind: instance method of RoomNightVendor
Returns: Promise - {rateplanIds: Number, nextRateplanId: Number}

  • rateplanIds: Rateplan ids
  • nextRateplanId: The next id of rateplan, if id = 0 the next rateplan is null
Param Type Description
vendorId Number Vendor id
offset Number The begin id, if id = 0 search from the begin
limit Number The limit of one page
options Object




roomNightVendor.ratePlanOfVendor(vendorId, rpid, options) ⇒ Promise
Get rateplan information by vendor id and rateplan id

Kind: instance method of RoomNightVendor
Returns: Promise - {name: String, createTime: Number, ipfsAddress: String}

  • name: Rateplan name
  • createTime: Create time: UTC timestamp(s)
  • ipfsAddress: IPFS file address
Param Type Description
vendorId Number Vendor id
rpid Number Rateplan id
options Object




roomNightVendor.pricesAndInventoriesOfDate(vendorId, rpid, dates, token, options) ⇒ Promise
Get prices and inventories by vendor id, rateplan id, dates, token id

Kind: instance method of RoomNightVendor
Returns: Promise - {prices: Array, inventorys: Array}

  • prices: Prices
  • inventorys: Inventories
Param Type Description
vendorId Number Vendor id
rpid Number Rateplan Id
dates Array Date E.g: [20180610,20180611]
token Number Token id
options Object




roomNightVendor.updatePrices(rpid, dates, inventory, tokens, prices, options) ⇒ Promise
Update prices and inventory of rateplan

Kind: instance method of RoomNightVendor
Returns: Promise - {tx: String, rpid: Number}

  • tx: Transaction address
  • rpid: Rateplan Id
Param Type Description
rpid Number Rateplan Id
dates Array Date E.g: [20180610,20180611]
inventory Number Inventory
tokens Array Token ids
prices Array Prices of tokens
options Object




roomNightVendor.updateInventories(rpid, dates, inventory, options) ⇒ Promise
Update inventories of rateplan

Kind: instance method of RoomNightVendor
Returns: Promise - {tx: String, rpid: Number}

  • tx: Transaction address
  • rpid: Rateplan Id
Param Type Description
rpid Number Rateplan Id
dates Array Date E.g: [20180610,20180611]
inventory Number Inventory
options Object




roomNightVendor.updateBasePrice(rpid, tokens, prices, inventory, options) ⇒ Promise
Update the base price of all rateplans

Kind: instance method of RoomNightVendor
Returns: Promise - {tx: String, rpid: Number}

  • tx: Transaction address
  • rpid: Rateplan Id
Param Type Description
rpid Number Rateplan Id
tokens Array Token ids
prices Array Prices of tokens
inventory Number Inventory
options Object




roomNightVendor.createRatePlan(name, ipfs, options) ⇒ Promise
Create new rateplan

Kind: instance method of RoomNightVendor
Returns: Promise - {tx: String, vendorId: String, name: String, ipfs: String}

  • tx: Transaction address
  • vendorId: Vendor Id
  • name: Rateplan name
  • ipfs: The IPFS's address of rateplan's desc
Param Type Description
name String Rateplan name
ipfs String The IPFS's address of rateplan's desc
options Object




roomNightVendor.removeRatePlan(rpid, options) ⇒ Promise
Remove rateplan

Kind: instance method of RoomNightVendor
Returns: Promise - {tx: String, vendorId: String, rpid: Number}

  • tx: Transaction address
  • vendorId: Vendor Id
  • rpid: Rateplan Id
Param Type Description
rpid Number Rateplan Id
options Object




roomNightVendor.modifyRatePlan(rpid, name, ipfs, options) ⇒ Promise
Modify rateplan

Kind: instance method of RoomNightVendor
Returns: Promise - {tx: String, vendorId: String, rpid: Number, name: String, ipfs: String}

  • tx: Transaction address
  • vendorId: Vendor Id
  • rpid: Rateplan Id
  • name: Rateplan name
  • ipfs: The IPFS's address of rateplan's desc
Param Type
rpid Number
name String
ipfs String
options Object

results matching ""

    No results matching ""