gamechanger-dapp-cli
Version:
Command line interface for creating ready to use dApps for Cardano with GameChanger Wallet (https://gamechanger.finance/)
66 lines (55 loc) • 3.14 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.usageMessage = exports.escapeShellArg = exports.demoPacked = exports.demoGCS = exports.networks = exports.cliName = void 0;
exports.cliName = 'gamechanger-dapp-cli';
exports.networks = ['mainnet', 'testnet'];
exports.demoGCS = {
type: 'tx',
title: 'Demo',
description: 'created with ' + exports.cliName,
metadata: {
'123': {
message: 'Hello World!',
},
},
};
exports.demoPacked = 'woTCpHR5cGXConR4wqV0aXRsZcKkRGVtb8KrZGVzY3JpcMSKb27DmSHEmGVhdGVkIHfEi2ggZ2FtZWNoYW5nZXItZGFwcC1jbGnCqMSudGHEuMWCwoHCozEyM8KBwqfErnNzYcS0wqxIZWxsbyBXb3JsZCE';
const escapeShellArg = (arg) =>
// eslint-disable-next-line quotes
`'${arg.replace(/'/g, "'\\''")}'`;
exports.escapeShellArg = escapeShellArg;
exports.usageMessage = `
GameChanger Wallet CLI:
Harness the power of Cardano with this simple dApp connector generator for GameChanger Wallet.
Build GCscripts, JSON-based scripts that gets packed into ready to use URL dApp connectors!
Usage
$ ${exports.cliName} [network] [action] [subaction]
Networks: ${exports.networks.map((x) => `'${x}'`).join(' | ')}
Actions:
'build':
'url' : generates a ready to use URL dApp connector from a valid GCScript
'qr' : generates a ready to use URL dApp connector encoded into a QR code image from a valid GCScript
'html' : generates a ready to use HTML dApp with a URL connector from a valid GCScript
'button' : generates a ready to use HTML embeddable button snippet with a URL connector from a valid GCScript
'nodejs' : generates a ready to use Node JS dApp with a URL connector from a valid GCScript
'react' : generates a ready to use React dApp with a URL connector from a valid GCScript
Options:
--args [gcscript] | -a [gcscript]: Load GCScript from arguments
--file [filename] | -a [filename]: Load GCScript from file
without --args or --file : Load GCScript from stdin
--outputFile [filename] -o [filename]: The QR Code, HTML, button, nodejs, or react output filename
without --outputFile : Sends the QR Code, HTML, button, nodejs, or react output file to stdin
--template [template name] | -t [template name]: default, boxed or printable
Examples
$ ${exports.cliName} mainnet build url -f demo.gcs
https://wallet.gamechanger.finance/api/1/tx/${exports.demoPacked}
$ ${exports.cliName} testnet build url -a ${(0, exports.escapeShellArg)(JSON.stringify(exports.demoGCS))}
https://testnet-wallet.gamechanger.finance/api/1/tx/${exports.demoPacked}
$ cat demo.gcs | ${exports.cliName} mainnet build url
https://wallet.gamechanger.finance/api/1/tx/${exports.demoPacked}
$ ${exports.cliName} testnet build qr -a ${(0, exports.escapeShellArg)(JSON.stringify(exports.demoGCS))}
https://testnet-wallet.gamechanger.finance/api/1/tx/${exports.demoPacked} > qr_output.png
$ ${exports.cliName} testnet build qr -a ${(0, exports.escapeShellArg)(JSON.stringify(exports.demoGCS))}
https://testnet-wallet.gamechanger.finance/api/1/tx/${exports.demoPacked} -o qr_output.png
`;
//# sourceMappingURL=index.js.map