These example files are meant for local exploration of the library and CLI outputs.
Install dependencies and build the library:
pnpm install
pnpm run buildServe the examples locally to run web based examples:
$ pnpm run examplesTo run the backend example and consume it's endpoints:
$ pnpm run examples:express
Then open:
http://127.0.0.1:3000/examples/index.html(kitchen sink dapp)http://127.0.0.1:3000/examples/htmlDapp.htmlhttp://127.0.0.1:3000/examples/htmlZeroDapp.htmlhttp://127.0.0.1:3000/examples/reactDapp.html
examples/res/ is a convenience copy of the current root dist/ folder. It is
refreshed by scripts/postbuild.mjs after builds so the example HTML files can
be opened and tested from the examples/ folder without changing their import
paths.
For real projects, prefer installing and importing the package normally:
pnpm add @gamechanger-finance/gcBrowser/CDN usage:
<script src="https://cdn.jsdelivr.net/npm/@gamechanger-finance/gc/dist/browser.min.js"></script>Node / bundlers:
import gc from '@gamechanger-finance/gc'The kitchen sink example also exposes the handler-only URL options:
refAddress: appendsref=<address>to generated wallet URLs and QRsdisableNetworkRouter: when enabled, skips the defaultnetworkTag=<network>query string
Those options are applied by the handlers. The lower-level encoders remain generic.
connect.gcscript: a simple intent to showcase GCScript DSL in order to connect a user wallet. This is the default sample script used by all the examplesindex.html: Kitchen Sink dapp> 100% in-browser playground for testing ALL the library outputs, including html, html-zero, react, button, URL, QR, and expresshtmlDapp.html: multi-intent HTML example with shared app state and auto-rendered intent argument UIhtmlZeroDapp.html: zero-dependency resilient HTML example for offline-ready and small-footprint deployments.reactDapp.html: multi-intent React example with shared app state and auto-rendered intent argument UIexpressBackend.js: minimal Node/Express backend examplebutton.html: minimal button HTML fragment redirecting users to the intent URLQR.png: Intent URL encoded as a QR codeQR.svg: Intent URL encoded as a QR codeURL.txt: Intent URL in plain textres/: library filesproject/: A modular, GCScript multi-file NPM (dummy) project with auto frontend generation
html-zero: highly resilient, offline-ready, small-footprint frontend intended for on-chain storage, and mission-critical use cases with no external runtime importshtml: richer HTML boilerplate with shared app state, multiple actions, and dynamic UI generation from intent codereact: richer React boilerplate with shared app state, multiple actions, and dynamic UI generation from intent codeexpress: minimal Node/Express backend example