Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bitgame

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitgame

A simple library for multiplayer betting games using bitcoin and blockchain.info.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Bitgame

Bitgame makes it easy to create a multiplayer game using BTC as a betting currency.

Example Usage:

var BitGame     = require('bitgame');
var buy_in      = 20000; // in satoshi
var num_players = 1;
var fee         = 0.1;

var game = new BitGame({
	guid      : '<guid>',
	password  : '<password>'
	password2 : '<password2>' // optional
}, buy_in, num_players, fee);

game.on('ready', function(addresses) {
	console.log('Awaiting Buy-ins', addresses);
});

game.on('received', function(address, amount) {
	console.log('Received Payment', address, amount);
});

game.on('received_all', function(endGame, balances) {
	var winners = [
		'<winner_address>',
	];

	endGame(winners);
});

game.on('payout_error', function(error) {
	console.log('Failed to send payouts!', error);
});

game.on('payouts_sent', function(payouts) {
	console.log('Sent Payouts', payouts);
});

game.on('consolidated', function(result) {
	console.log('Consolidated Wallets', result);
});

game.on('completed', function() {
	console.log('The game is over.');
});

Feeling generous? Send me a fraction of a bitcoin!

12mDARddJ3fGVncReJvFWNGj5wsSQ2ZNTs

Keywords

FAQs

Package last updated on 27 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc