Skip to content

Commit 5fa6629

Browse files
committed
added-faucet-option
1 parent dc01810 commit 5fa6629

File tree

5 files changed

+50
-42
lines changed

5 files changed

+50
-42
lines changed

.github/workflows/npm-publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3+
4+
name: Node.js Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 16
18+
- run: npm ci
19+
- run: npm test
20+
21+
publish-npm:
22+
needs: build
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v3
26+
- uses: actions/setup-node@v3
27+
with:
28+
node-version: 16
29+
registry-url: https://registry.npmjs.org/
30+
- run: npm ci
31+
- run: npm publish
32+
env:
33+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

bin/faucet.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#! /usr/bin/env node
2-
export {};
1+
export default function faucet(): void;
2+
export {};

bin/faucet.js

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
#!/usr/bin/env node
2-
31
"use strict";
42
var __importDefault = (this && this.__importDefault) || function (mod) {
5-
return (mod && mod.__esModule) ? mod : { "default": mod };
3+
return (mod && mod.__esModule) ? mod : { "default": mod };
64
};
75
Object.defineProperty(exports, "__esModule", { value: true });
8-
const faucet_1 = __importDefault(require("../faucet"));
9-
10-
const run = async () => {
11-
try {
12-
await faucet_1.default();
13-
} catch (error) {
14-
console.error('An error occurred while running the faucet command:', error);
15-
process.exit(1);
16-
}
17-
};
18-
19-
run();
6+
const chalk_1 = __importDefault(require("chalk"));
7+
const urls = `https://www.alchemy.com/best/crypto-faucets or https://moralis.io/faucets/`;
8+
function faucet() {
9+
console.log(chalk_1.default.magentaBright(`To get faucet claim by this urls through address...`));
10+
console.log(chalk_1.default.greenBright(`Please visit \n ${urls} \n to fund your wallet.`));
11+
}
12+
exports.default = faucet;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "contract-wizard",
3-
"version": "0.0.2",
3+
"version": "0.0.6",
44
"description": "CLI Tool for Contract Creation (ERC20,ERC721,ERC1155,GOVERNANCE) and Deployment and faucet option .",
55
"main": "bin/index.js",
66
"bin": {

src/faucet.ts

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,9 @@
1-
import chalk from 'chalk';
2-
import { execSync } from 'child_process';
3-
import open from 'open';
1+
import chalk from "chalk";
42

5-
const runCommand = (command: string) => {
6-
try {
7-
execSync(command, { stdio: 'inherit' });
8-
} catch (error) {
9-
console.error('Failed to run command: ', error);
10-
return false;
11-
}
12-
return true;
13-
};
143

15-
export default async function () {
16-
const faucetUrl = 'https://www.alchemy.com/best/crypto-faucets'; // faucet URL
4+
const urls = `https://www.alchemy.com/best/crypto-faucets or https://moralis.io/faucets/`;
175

18-
console.log(chalk.magentaBright('Running faucet command...'));
19-
20-
// Perform the faucet operation here...
21-
22-
// Open URL in the browser
23-
console.log(chalk.magentaBright('Opening faucet URL in browser...'));
24-
open(faucetUrl);
25-
26-
console.log(chalk.magentaBright('Faucet command completed successfully.'));
27-
}
6+
export default function faucet() {
7+
console.log(chalk.magentaBright(`To get faucet claim by this urls through address ...`));
8+
console.log(chalk.greenBright(`Please visit \n ${urls} \n to fund your wallet.`));
9+
}

0 commit comments

Comments
 (0)