Registry / database / xrpl-gaming-db-mongodb

xrpl-gaming-db-mongodb

JSON →
library0.2.0jsnpmunverified

MongoDB storage adapter for the Kinesis XRPL DynamicNFT Gaming SDK (v0.2.0). Persists NFT records and ownership history to a single auto-indexed MongoDB collection using NFTokenID as document _id for O(1) reads. Requires peer dependency xrpl-gaming-core ^0.2.0. Self-hosted adapter; managed tier planned. Key differentiator: designed specifically for XRPL gaming with automatic indexes on playerId, ownerAddress, and collection. Ships TypeScript types. Release cadence: early-stage, minor version bumps expected.

npm install xrpl-gaming-db-mongodb
INSTALL
IMPORT
SIG · XRPL-GAMING-DB-MON
X
xrpl-gaming-db-mongodb
databasejavascriptv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MongoAdapter
import { MongoAdapter } from 'xrpl-gaming-db-mongodb'
import MongoAdapter from 'xrpl-gaming-db-mongodb'
Named export only; default export is not provided.
MongoAdapterOptions
import type { MongoAdapterOptions } from 'xrpl-gaming-db-mongodb'
import { MongoAdapterOptions } from 'xrpl-gaming-db-mongodb'
Type only import; not a runtime value.

Initializes the XRPL Gaming SDK with MongoDB adapter for storing NFT records.

import { XRPLGamingSDK } from 'xrpl-gaming-core'; import { MongoAdapter } from 'xrpl-gaming-db-mongodb'; const sdk = new XRPLGamingSDK({ xrpl: { nodeUrl: 'wss://xrplcluster.com', issuerWallet: { seed: process.env.XRPL_ISSUER_SEED ?? '' }, }, db: new MongoAdapter({ connectionString: process.env.MONGODB_URL ?? '', databaseName: 'my_game', collectionName: 'characters', }), ipfs: undefined, }); await sdk.init(); console.log('SDK initialized');
Debug
Known issues
gotchaWhen passing a custom MongoClient, the adapter's close() method does NOT disconnect the client; the application is responsible for client lifecycle.
fix
Ensure you manually call client.close() when shutting down your application.
affects: >=0.1.0
gotchaThe connectionString field is required even when providing a custom client; if left empty and no client provided, adapter will fail.
fix
Either provide both client and empty connectionString, or provide connectionString.
affects: >=0.1.0
deprecatedThis adapter is self-hosted; a managed storage tier is planned which may deprecate direct use of MongoAdapter.
fix
Monitor release notes for managed tier availability.
affects: >=0.1.0 <1.0.0
Errors
Common errors & fixes
Cannot find module 'xrpl-gaming-core' or its corresponding type declarations.
Missing peer dependency xrpl-gaming-core.
fix
Run pnpm add xrpl-gaming-core@^0.2.0
TypeError: MongoAdapter is not a constructor
Using default import instead of named import.
fix
import { MongoAdapter } from 'xrpl-gaming-db-mongodb'
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
xrpl-gaming-corerequiredPeer dependency required for XRPLGamingSDK and core types
Agent activity
39 hits · last 30 days
node
34
Amazon
1
OpenAI (training)
1
Resources
xrpl-gaming-db-mongodb — npm install xrpl-gaming-db-mongodb · libregistry