{"_id":"402-trinity-gaming","_rev":"3-31c9040f2713026c7323bc88ed84aa84","name":"402-trinity-gaming","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"402-trinity-gaming","version":"0.1.0","keywords":["unity","unreal-engine","ue5","blueprints","csharp-unity","secp256k1","eip-3009","eip-712","gasless-usdc","meta-transactions","rpg-cosmetics","sandbox-economy","prepaid-tabs","off-chain-batching","game-storefront","in-game-purchases","microtransactions","white-label-payments","npc-economy","http-402","x402","base","usdc"],"license":"BUSL-1.1","_id":"402-trinity-gaming@0.1.0","maintainers":[{"name":"neverdoubtme","email":"noahdoesmusic@yahoo.com"}],"dist":{"shasum":"378c39885e18b1921b1a59233b29cfeed4ee2f9a","tarball":"https://registry.npmjs.org/402-trinity-gaming/-/402-trinity-gaming-0.1.0.tgz","fileCount":36,"integrity":"sha512-gNhhsYwbIaX0IxOmXPpzu9KEkbX00UmDwEn/SldVjTbrRf9s+e6K62mD87MrG9c5CjFjxT7F4RhJarguZbs0JQ==","signatures":[{"sig":"MEUCICERF2mDwzwMz+uErw0WaefFGZUVw1GvMTgGxEX+K32dAiEA6/JKwf51Bwl0lisJSbwR8R7Cudx18Rb39u4HhmwBFec=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":321229},"main":"./dist/x402.js","type":"module","types":"./dist/x402.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/x402.d.ts","default":"./dist/x402.js"},"./evm-tx":{"types":"./dist/evm-tx.d.ts","default":"./dist/evm-tx.js"},"./seller":{"types":"./dist/seller.d.ts","default":"./dist/seller.js"},"./signer":{"types":"./dist/signer.d.ts","default":"./dist/signer.js"},"./storefront":{"types":"./dist/storefront.d.ts","default":"./dist/storefront.js"},"./budget-file":{"types":"./dist/budget-file.d.ts","default":"./dist/budget-file.js"},"./proceeds-fee":{"types":"./dist/proceeds-fee.d.ts","default":"./dist/proceeds-fee.js"},"./batch-manager":{"types":"./dist/batch-manager.d.ts","default":"./dist/batch-manager.js"}},"gitHead":"cb32736d0fc48c074e27b970da5d859c843e825a","scripts":{"build":"node tools/build.mjs","typecheck":"tsc --noEmit","prepublishOnly":"npm run build && npm run typecheck"},"_npmUser":{"name":"neverdoubtme","email":"noahdoesmusic@yahoo.com"},"_npmVersion":"11.6.2","description":"Headless x402 payment backend for game storefronts. No UI, no overlay, no console output - a call in, an event out.","directories":{},"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.25.0","typescript":"^7.0.2","@types/node":"^26.2.0","@noble/curves":"^2.3.0","@noble/hashes":"^2.3.0"},"_npmOperationalInternal":{"tmp":"tmp/402-trinity-gaming_0.1.0_1788901247889_0.42285149345901973","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to x402-trinity-gaming - install that instead."},"0.1.1":{"name":"402-trinity-gaming","version":"0.1.1","keywords":["unity","unreal-engine","ue5","blueprints","csharp-unity","secp256k1","eip-3009","eip-712","gasless-usdc","meta-transactions","rpg-cosmetics","sandbox-economy","prepaid-tabs","off-chain-batching","game-storefront","in-game-purchases","microtransactions","white-label-payments","npc-economy","http-402","x402","base","usdc"],"license":"BUSL-1.1","_id":"402-trinity-gaming@0.1.1","maintainers":[{"name":"neverdoubtme","email":"noahdoesmusic@yahoo.com"}],"dist":{"shasum":"2f917fad292bf9cfc8b9f0e7ee796e49eca9d38f","tarball":"https://registry.npmjs.org/402-trinity-gaming/-/402-trinity-gaming-0.1.1.tgz","fileCount":36,"integrity":"sha512-oUgUvwteRtvO7LUIf4wvPY/GGjM3hUApK6y+gWsG6baviOnH+2+leQSdI7opTgykD6Ec+39GacRpfb5kqZbBsg==","signatures":[{"sig":"MEQCIGwv+h2VVGx/hXuHg35Fi0VimgqB/VBlNTNz6EazbKUCAiBdIRmH+1SMHddCUrg6Gw6NmGG8CPSe710qRMVw6yudTA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":321369},"main":"./dist/x402.js","type":"module","types":"./dist/x402.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/x402.d.ts","default":"./dist/x402.js"},"./min":{"types":"./dist/x402.d.ts","default":"./dist/x402.min.js"},"./evm-tx":{"types":"./dist/evm-tx.d.ts","default":"./dist/evm-tx.js"},"./seller":{"types":"./dist/seller.d.ts","default":"./dist/seller.js"},"./signer":{"types":"./dist/signer.d.ts","default":"./dist/signer.js"},"./storefront":{"types":"./dist/storefront.d.ts","default":"./dist/storefront.js"},"./budget-file":{"types":"./dist/budget-file.d.ts","default":"./dist/budget-file.js"},"./package.json":"./package.json","./proceeds-fee":{"types":"./dist/proceeds-fee.d.ts","default":"./dist/proceeds-fee.js"},"./batch-manager":{"types":"./dist/batch-manager.d.ts","default":"./dist/batch-manager.js"}},"gitHead":"7dcb49e424fe8678b8523a786d6b527edf83de6a","scripts":{"build":"node tools/build.mjs","typecheck":"tsc --noEmit","prepublishOnly":"npm run build && npm run typecheck"},"_npmUser":{"name":"neverdoubtme","email":"noahdoesmusic@yahoo.com"},"_npmVersion":"11.6.2","description":"Headless x402 payment backend for game storefronts. No UI, no overlay, no console output - a call in, an event out.","directories":{},"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.25.0","typescript":"^7.0.2","@types/node":"^26.2.0","@noble/curves":"^2.3.0","@noble/hashes":"^2.3.0"},"_npmOperationalInternal":{"tmp":"tmp/402-trinity-gaming_0.1.1_1788901526671_0.9467878256800439","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to x402-trinity-gaming - install that instead."}},"time":{"created":"2026-09-08T21:00:47.807Z","modified":"2026-09-08T22:59:23.659Z","0.1.0":"2026-09-08T21:00:48.064Z","0.1.1":"2026-09-08T21:05:26.808Z"},"license":"BUSL-1.1","keywords":["unity","unreal-engine","ue5","blueprints","csharp-unity","secp256k1","eip-3009","eip-712","gasless-usdc","meta-transactions","rpg-cosmetics","sandbox-economy","prepaid-tabs","off-chain-batching","game-storefront","in-game-purchases","microtransactions","white-label-payments","npc-economy","http-402","x402","base","usdc"],"description":"Headless x402 payment backend for game storefronts. No UI, no overlay, no console output - a call in, an event out.","maintainers":[{"name":"neverdoubtme","email":"noahdoesmusic@yahoo.com"}],"readme":"# 402-trinity-gaming\r\n\r\n**A payment backend for game storefronts that your players never see.**\r\n\r\nNo UI. No overlay. No browser handoff. No console output. Your button, your art, your unlock\r\nanimation — this handles the money and gets out of the way.\r\n\r\n```bash\r\nnpm install 402-trinity-gaming\r\n```\r\n\r\n## How it fits\r\n\r\n```\r\nYour storefront UI  ──▶  your backend  ──▶  chain\r\n   (Unreal/Unity)         (this package)\r\n        ▲                       │\r\n        └────── events ─────────┘\r\n```\r\n\r\nThe player's client signs one authorization with their own key. Your server does everything\r\nelse. **You never hold the player's key**, and for direct purchases you hold no balance\r\neither. (Tabs are the exception - see `INTEGRATION.md`.)\r\n\r\n## Use\r\n\r\n```js\r\nimport { createStorefront } from '402-trinity-gaming/storefront';\r\n\r\nconst store = createStorefront({\r\n  payTo: '0xYourStudioWallet',\r\n  network: 'base',\r\n  facilitator: 'https://your-facilitator.example',   // REQUIRED - no default\r\n  nonceStore,                                        // REQUIRED - must survive restarts\r\n  catalog: {\r\n    vanguard_skin_01: '1500000',   // atomic units: 1.50 USDC (6 decimals)\r\n    season_pass_04:  '9990000',    // 9.99\r\n  },\r\n  surcharge: { proceedsKey },      // the key for payTo\r\n});\r\n\r\nstore.on('settled',  e => grantItem(e.playerId, e.itemId));\r\nstore.on('declined', e => showRefusal(e.playerId, e.code));\r\n```\r\n\r\nServe the quote, take the signature, redeem it:\r\n\r\n```js\r\n// 1. the client asks what it must sign\r\nconst quote = store.quote('vanguard_skin_01');\r\n\r\n// 2. the client signs it and posts back { authorization, signature }\r\nconst result = await store.purchase({\r\n  itemId: 'vanguard_skin_01',\r\n  playerId: 'player-8823',\r\n  playerAddress: '0xPlayerWallet',\r\n  authorization,\r\n  signature,\r\n});\r\n```\r\n\r\n## Events\r\n\r\n| event | when | what to do |\r\n|---|---|---|\r\n| `accepted` | the request is well formed, the item is real, settlement is underway | grant optimistically if you want the item to appear instantly |\r\n| `settled` | the money has moved, with an on-chain transaction hash | grant, or reconcile an optimistic grant |\r\n| `declined` | it was refused | read `code`, not `message` |\r\n\r\nDecline codes are `unknown_item`, `already_used`, `rejected`, `settlement_failed` and\r\n`malformed`. Each carries `retryable` — **true** means the same authorization may be presented\r\nagain unchanged, **false** means mint a fresh one. Re-sending when `retryable` is false risks\r\npaying twice.\r\n\r\n## Prices are strings\r\n\r\nAtomic units of the asset, as a decimal string. USDC has 6 decimals, so `1.50` is\r\n`'1500000'`. A float cannot represent money exactly, and this value goes inside a signature.\r\n\r\n## Nothing is printed\r\n\r\nThis library never writes to `stdout` or `stderr` — that is enforced by its build, not by\r\nconvention. Diagnostics reach you through `onDiagnostic`, and the fee disclosure is exported\r\nas `NOTICE` for you to place wherever disclosure belongs in your product.\r\n\r\n## Scope\r\n\r\n**Base mainnet + USDC.** Other EVM chains work by passing `customChains`. Check any entry\r\nagainst the deployed contract first: call `DOMAIN_SEPARATOR()` and confirm it matches what\r\nthis library computes. A wrong `name` or `version` produces a signature that looks valid and\r\nthe contract rejects.\r\n\r\n## Before you use it with real money\r\n\r\nThis software signs payment authorizations. You are responsible for the funds in any wallet\r\nyou configure it with and for the limits you set. `nonceStore` must be durable — an in-memory\r\nreplay guard forgets every settled payment on restart, which means selling the same item twice\r\nfor free.\r\n\r\n## License\r\n\r\nBusiness Source License 1.1. Source-available; converts to MIT on 2029-08-25. See\r\n[LICENSE](LICENSE).\r\n\r\nNetwork fee: 0.1% of merchant proceeds and 1 cent every 100 sales.\r\n","readmeFilename":"README.md"}