@gholl-studio/pier-connector 0.0.4 ā 0.0.6
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 -11
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.6",
|
|
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,17 +528,27 @@ 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;
|
|
@@ -556,7 +566,7 @@ export default function register(api) {
|
|
|
556
566
|
finalSecretKey = manualAnswers.secretKey;
|
|
557
567
|
finalWallet = manualAnswers.walletAddress;
|
|
558
568
|
currentConfig.pierApiUrl = manualAnswers.pierApiUrl;
|
|
559
|
-
} else {
|
|
569
|
+
} else if (setupMethod === 'auto') {
|
|
560
570
|
const autoAnswers = await inquirer.prompt([
|
|
561
571
|
{ type: 'input', name: 'pierApiUrl', message: 'Pier API URL:', default: currentConfig.pierApiUrl },
|
|
562
572
|
{ type: 'password', name: 'privateKey', message: 'Your Wallet Private Key (Hex, 0x...):', default: finalPrivateKey }
|