@daocasino/dc-webapi
This package stores files for DAO.Casino protocol implementation. The webapit functionality is integrated with a specific game in the SDK via an asynchronous initiatilizaton pattern: ```javascript await new DCWebapi(params).start() ``` The ``start()`` fu
Last updated 2 years ago by altvnv .
MIT · Original npm · Tarball · package.json
$ cnpm install @daocasino/dc-webapi 
SYNC missed versions from official npm registry.

This package stores files for DAO.Casino protocol implementation. The webapit functionality is integrated with a specific game in the SDK via an asynchronous initiatilizaton pattern:

const webapi = new DCWebapi(params)
webapi.on('ready', async instance => {
  await instance.game.createGame(gameParams)
  await instance.game.connect(connectParams)
  await instance.game.play(playParams)
  await instance.game.disconnect()
})

Example

new DCWebapi({
  platformId 'example_id',
  blockchainNetwork: 'local',
  privateKey: 'your_private_key'
}).on('ready', async instance => {
  await instance.game.createGame({
    name: manifest.slug,
    gameContractAddress: manifest.getContract(blockchainNetwork).address,
    gameLogicFunction: dapp_logic,
    rules: manifest.rules
  })

  await instance.game.connect({ playerDeposit: deposit })
  await instance.game.play({
    userBets: [ betAmount ],
    gameData: {
      randomRanges: [ randomRange ],
      custom: { playerNumbers: { t: 'uint256', v: [ userNum ] } }
    }
  })

  await instance.game.disconnect()
})

Current Tags

  • 0.2.8                                ...           latest (2 years ago)

8 Versions

  • 0.2.8                                ...           2 years ago
  • 0.2.6                                ...           2 years ago
  • 0.2.5                                ...           2 years ago
  • 0.2.4                                ...           2 years ago
  • 0.2.3                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 0
Last Month 2
Dev Dependencies (3)

Copyright 2014 - 2017 © taobao.org |