@moneypot/hub v1.4.10
@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:
- https://github.com/moneypot/wheel-controller/: A wheel of fortune game (frontend)
- https://github.com/moneypot/dice-controller/: A dice game (frontend)
Manual
View our docs: https://moneypot.com/docs/hub
Install
$ npm install @moneypot/hubUsage
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)
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago