@net-protocol/cli 0.1.43 → 0.1.45
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/dist/chat/index.mjs +24 -3
- package/dist/chat/index.mjs.map +1 -1
- package/dist/cli/index.mjs +469 -129
- package/dist/cli/index.mjs.map +1 -1
- package/dist/feed/index.mjs +413 -98
- package/dist/feed/index.mjs.map +1 -1
- package/dist/profile/index.mjs +17 -1
- package/dist/profile/index.mjs.map +1 -1
- package/dist/upvote/index.mjs +24 -1
- package/dist/upvote/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/profile/index.mjs
CHANGED
|
@@ -2,10 +2,10 @@ import { Command } from 'commander';
|
|
|
2
2
|
import chalk3 from 'chalk';
|
|
3
3
|
import { StorageClient, chunkDataForStorage, CHUNKED_STORAGE_CONTRACT } from '@net-protocol/storage';
|
|
4
4
|
import { PROFILE_PICTURE_STORAGE_KEY, PROFILE_METADATA_STORAGE_KEY, parseProfileMetadata, PROFILE_CANVAS_STORAGE_KEY, PROFILE_CSS_STORAGE_KEY, isValidUrl, getProfilePictureStorageArgs, STORAGE_CONTRACT, isValidXUsername, getProfileMetadataStorageArgs, isValidBio, isValidDisplayName, isValidTokenAddress, DEMO_THEMES, MAX_CSS_SIZE, isValidCSS, getProfileCSSStorageArgs, buildCSSPrompt } from '@net-protocol/profiles';
|
|
5
|
+
import { getChainRpcUrls, getBaseDataSuffix, toBytes32, getChainSlug } from '@net-protocol/core';
|
|
5
6
|
import { createWalletClient, http, publicActions, encodeFunctionData, concat } from 'viem';
|
|
6
7
|
import { privateKeyToAccount } from 'viem/accounts';
|
|
7
8
|
import { base } from 'viem/chains';
|
|
8
|
-
import { getChainRpcUrls, getBaseDataSuffix, toBytes32 } from '@net-protocol/core';
|
|
9
9
|
import * as fs from 'fs';
|
|
10
10
|
import * as path from 'path';
|
|
11
11
|
|
|
@@ -67,6 +67,20 @@ function exitWithError(message) {
|
|
|
67
67
|
console.error(chalk3.red(`Error: ${message}`));
|
|
68
68
|
process.exit(1);
|
|
69
69
|
}
|
|
70
|
+
var WEBSITE_BASE = "https://netprotocol.app";
|
|
71
|
+
function chainSlug(chainId) {
|
|
72
|
+
return getChainSlug({ chainId }) ?? null;
|
|
73
|
+
}
|
|
74
|
+
function walletUrl(chainId, address) {
|
|
75
|
+
const slug = chainSlug(chainId);
|
|
76
|
+
if (!slug) return null;
|
|
77
|
+
return `${WEBSITE_BASE}/app/feed/${slug}/${address.toLowerCase()}`;
|
|
78
|
+
}
|
|
79
|
+
function profileUrl(chainId, address) {
|
|
80
|
+
const slug = chainSlug(chainId);
|
|
81
|
+
if (!slug) return null;
|
|
82
|
+
return `${WEBSITE_BASE}/app/profile/${slug}/${address.toLowerCase()}`;
|
|
83
|
+
}
|
|
70
84
|
|
|
71
85
|
// src/commands/profile/get.ts
|
|
72
86
|
async function executeProfileGet(options) {
|
|
@@ -153,6 +167,8 @@ async function executeProfileGet(options) {
|
|
|
153
167
|
const output = {
|
|
154
168
|
address: options.address,
|
|
155
169
|
chainId: readOnlyOptions.chainId,
|
|
170
|
+
profileUrl: profileUrl(readOnlyOptions.chainId, options.address),
|
|
171
|
+
walletUrl: walletUrl(readOnlyOptions.chainId, options.address),
|
|
156
172
|
profilePicture: profilePicture || null,
|
|
157
173
|
displayName: displayName || null,
|
|
158
174
|
xUsername: xUsername || null,
|