@gholl-studio/pier-connector 0.0.4 ā 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +21 -13
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gholl-studio/pier-connector",
|
|
3
3
|
"author": "gholl",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"description": "OpenClaw plugin that connects to the Pier job marketplace. Automatically fetches, executes, and reports distributed tasks for rewards.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "src/index.js",
|
package/src/index.js
CHANGED
|
@@ -528,23 +528,31 @@ export default function register(api) {
|
|
|
528
528
|
console.log('\nš¢ \x1b[1m\x1b[36mPier Connector Setup (V1.1)\x1b[0m');
|
|
529
529
|
console.log('You can register manually or let the Auto-Host (Advanced) feature do it for you using a Wallet Private Key.\n');
|
|
530
530
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
531
|
+
let setupMethod = 'manual';
|
|
532
|
+
try {
|
|
533
|
+
const answer = await inquirer.prompt([
|
|
534
|
+
{
|
|
535
|
+
type: 'list',
|
|
536
|
+
name: 'method',
|
|
537
|
+
message: 'How would you like to configure your node credentials?',
|
|
538
|
+
choices: [
|
|
539
|
+
{ name: 'Manual Entry (Recommended) - I have a Node ID and Secret Key', value: 'manual' },
|
|
540
|
+
{ name: 'Auto-Host (Advanced) - Register automatically using my Wallet Private Key', value: 'auto' }
|
|
541
|
+
],
|
|
542
|
+
default: 'manual'
|
|
543
|
+
}
|
|
544
|
+
]);
|
|
545
|
+
if (answer.method) {
|
|
546
|
+
setupMethod = answer.method;
|
|
540
547
|
}
|
|
541
|
-
|
|
548
|
+
} catch (err) {
|
|
549
|
+
console.log('\n\x1b[33mFalling back to Manual Entry mode due to terminal configuration.\x1b[0m');
|
|
550
|
+
setupMethod = 'manual';
|
|
551
|
+
}
|
|
542
552
|
|
|
543
553
|
let finalNodeId = currentConfig.nodeId;
|
|
544
554
|
let finalSecretKey = currentConfig.secretKey;
|
|
545
555
|
let finalPrivateKey = currentConfig.privateKey;
|
|
546
|
-
let finalWallet = currentConfig.walletAddress;
|
|
547
|
-
|
|
548
556
|
if (setupMethod === 'manual') {
|
|
549
557
|
const manualAnswers = await inquirer.prompt([
|
|
550
558
|
{ type: 'input', name: 'pierApiUrl', message: 'Pier API URL:', default: currentConfig.pierApiUrl },
|
|
@@ -556,7 +564,7 @@ export default function register(api) {
|
|
|
556
564
|
finalSecretKey = manualAnswers.secretKey;
|
|
557
565
|
finalWallet = manualAnswers.walletAddress;
|
|
558
566
|
currentConfig.pierApiUrl = manualAnswers.pierApiUrl;
|
|
559
|
-
} else {
|
|
567
|
+
} else if (setupMethod === 'auto') {
|
|
560
568
|
const autoAnswers = await inquirer.prompt([
|
|
561
569
|
{ type: 'input', name: 'pierApiUrl', message: 'Pier API URL:', default: currentConfig.pierApiUrl },
|
|
562
570
|
{ type: 'password', name: 'privateKey', message: 'Your Wallet Private Key (Hex, 0x...):', default: finalPrivateKey }
|