1.4.10 • Published 10 months ago

@moneypot/hub v1.4.10

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
10 months ago

@moneypot/hub

@moneypot/hub is our official game server that integrates with any number of Moneypot casinos.

  • Extend it with custom tables and game logic.
  • Give it an api key for each controller you've registered on each casino.
  • It will automatically sync users, their balances, deposits, and withdrawals.

Example implementations:

  1. https://github.com/moneypot/wheel-controller/: A wheel of fortune game (frontend)
  2. https://github.com/moneypot/dice-controller/: A dice game (frontend)

Manual

View our docs: https://moneypot.com/docs/hub

Install

$ npm install @moneypot/hub

Usage

import {
  type ServerOptions,
  defaultPlugins,
  startAndListen,
  MakeOutcomeBetPlugin,
} from "@moneypot/hub";
import path from "path";

const options: ServerOptions = {
  // PostgreSQL schemas to expose to the GraphQL API
  // This allows your application-specific tables to be accessible through GraphQL
  extraPgSchemas: ["app"],

  plugins: [
    // These are required for the hub server to function
    ...defaultPlugins,
    // Add your custom plugins here to extend server functionality
    MakeOutcomeBetPlugin({
      houseEdge: 0.01,
    }),
  ],

  // File path where the generated GraphQL schema definition will be saved
  exportSchemaSDLPath: path.join(import.meta.dirname, "../schema.graphql"),

  // Optional: Directory containing migration files for your database
  // When enabled, the server will automatically apply pending migrations on startup
  userDatabaseMigrationsPath: path.join(
    import.meta.dirname,
    "../automigrations"
  ),
};

startAndListen(options)
  .then(({ port }) => {
    console.log(`Listening on ${port}`);
  })
  .catch(console.error);

Dashboard

When the server is running, visit its admin dashboard at the /dashboard route.

You'll need an api key from your hub database:

insert into hub.api_key default values returning key;

Changelog

(Waiting for launch to begin publishing to changelog)

1.4.10

10 months ago

1.4.9

10 months ago

1.4.8

10 months ago

1.4.7

10 months ago

1.4.6

10 months ago

1.4.5

10 months ago

1.4.4

10 months ago

1.4.3

11 months ago

1.4.2

11 months ago

1.4.1

11 months ago

1.4.0

11 months ago

1.3.0

11 months ago

1.3.0-dev.16

11 months ago

1.3.0-dev.15

11 months ago

1.3.0-dev.14

11 months ago

1.3.0-dev.13

11 months ago

1.3.0-dev.12

11 months ago

1.3.0-dev.11

11 months ago

1.3.0-dev.10

11 months ago

1.3.0-dev.9

11 months ago

1.3.0-dev.8

11 months ago

1.3.0-dev.7

11 months ago

1.3.0-dev.6

11 months ago

1.3.0-dev.5

11 months ago

1.3.0-dev.4

11 months ago

1.3.0-dev.3

11 months ago

1.3.0-dev.1

11 months ago

1.2.7

11 months ago

1.2.6

11 months ago

1.2.5

12 months ago

1.2.4

12 months ago

1.2.3

12 months ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.2.0-dev.2

1 year ago

1.2.0-dev.1

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago