1.4.10 • Published 6 months ago

@moneypot/hub v1.4.10

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
6 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

6 months ago

1.4.9

6 months ago

1.4.8

6 months ago

1.4.7

6 months ago

1.4.6

6 months ago

1.4.5

6 months ago

1.4.4

6 months ago

1.4.3

6 months ago

1.4.2

6 months ago

1.4.1

6 months ago

1.4.0

6 months ago

1.3.0

6 months ago

1.3.0-dev.16

7 months ago

1.3.0-dev.15

7 months ago

1.3.0-dev.14

7 months ago

1.3.0-dev.13

7 months ago

1.3.0-dev.12

7 months ago

1.3.0-dev.11

7 months ago

1.3.0-dev.10

7 months ago

1.3.0-dev.9

7 months ago

1.3.0-dev.8

7 months ago

1.3.0-dev.7

7 months ago

1.3.0-dev.6

7 months ago

1.3.0-dev.5

7 months ago

1.3.0-dev.4

7 months ago

1.3.0-dev.3

7 months ago

1.3.0-dev.1

7 months ago

1.2.7

7 months ago

1.2.6

7 months ago

1.2.5

7 months ago

1.2.4

7 months ago

1.2.3

8 months ago

1.2.2

8 months ago

1.2.1

8 months ago

1.2.0

8 months ago

1.2.0-dev.2

8 months ago

1.2.0-dev.1

8 months ago

1.1.1

8 months ago

1.1.0

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago