@net-protocol/cli 0.1.22 → 0.1.23

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.
@@ -2549,8 +2549,19 @@ async function executeProfileSetUsername(options) {
2549
2549
  chainId: options.chainId,
2550
2550
  rpcUrl: options.rpcUrl
2551
2551
  });
2552
+ let existing = {};
2553
+ if (options.address) {
2554
+ const storageClient = new StorageClient({
2555
+ chainId: readOnlyOptions.chainId,
2556
+ overrides: options.rpcUrl ? { rpcUrls: [options.rpcUrl] } : void 0
2557
+ });
2558
+ existing = await readExistingMetadata(options.address, storageClient);
2559
+ }
2552
2560
  const storageArgs = getProfileMetadataStorageArgs({
2553
- x_username: usernameForStorage
2561
+ x_username: usernameForStorage,
2562
+ bio: existing.bio,
2563
+ display_name: existing.display_name,
2564
+ token_address: existing.token_address
2554
2565
  });
2555
2566
  const encoded = encodeTransaction(
2556
2567
  {
@@ -2639,7 +2650,20 @@ async function executeProfileSetBio(options) {
2639
2650
  chainId: options.chainId,
2640
2651
  rpcUrl: options.rpcUrl
2641
2652
  });
2642
- const storageArgs = getProfileMetadataStorageArgs({ bio: options.bio });
2653
+ let existing = {};
2654
+ if (options.address) {
2655
+ const storageClient = new StorageClient({
2656
+ chainId: readOnlyOptions.chainId,
2657
+ overrides: options.rpcUrl ? { rpcUrls: [options.rpcUrl] } : void 0
2658
+ });
2659
+ existing = await readExistingMetadata(options.address, storageClient);
2660
+ }
2661
+ const storageArgs = getProfileMetadataStorageArgs({
2662
+ bio: options.bio,
2663
+ x_username: existing.x_username,
2664
+ display_name: existing.display_name,
2665
+ token_address: existing.token_address
2666
+ });
2643
2667
  const encoded = encodeTransaction(
2644
2668
  {
2645
2669
  to: STORAGE_CONTRACT.address,
@@ -2727,8 +2751,19 @@ async function executeProfileSetDisplayName(options) {
2727
2751
  chainId: options.chainId,
2728
2752
  rpcUrl: options.rpcUrl
2729
2753
  });
2754
+ let existing = {};
2755
+ if (options.address) {
2756
+ const storageClient = new StorageClient({
2757
+ chainId: readOnlyOptions.chainId,
2758
+ overrides: options.rpcUrl ? { rpcUrls: [options.rpcUrl] } : void 0
2759
+ });
2760
+ existing = await readExistingMetadata(options.address, storageClient);
2761
+ }
2730
2762
  const storageArgs = getProfileMetadataStorageArgs({
2731
- display_name: options.name
2763
+ display_name: options.name,
2764
+ bio: existing.bio,
2765
+ x_username: existing.x_username,
2766
+ token_address: existing.token_address
2732
2767
  });
2733
2768
  const encoded = encodeTransaction(
2734
2769
  {
@@ -2818,8 +2853,19 @@ async function executeProfileSetTokenAddress(options) {
2818
2853
  chainId: options.chainId,
2819
2854
  rpcUrl: options.rpcUrl
2820
2855
  });
2856
+ let existing = {};
2857
+ if (options.address) {
2858
+ const storageClient = new StorageClient({
2859
+ chainId: readOnlyOptions.chainId,
2860
+ overrides: options.rpcUrl ? { rpcUrls: [options.rpcUrl] } : void 0
2861
+ });
2862
+ existing = await readExistingMetadata(options.address, storageClient);
2863
+ }
2821
2864
  const storageArgs = getProfileMetadataStorageArgs({
2822
- token_address: normalizedAddress
2865
+ token_address: normalizedAddress,
2866
+ x_username: existing.x_username,
2867
+ bio: existing.bio,
2868
+ display_name: existing.display_name
2823
2869
  });
2824
2870
  const encoded = encodeTransaction(
2825
2871
  {
@@ -3199,13 +3245,17 @@ function registerProfileCommand(program2) {
3199
3245
  ).option(
3200
3246
  "--encode-only",
3201
3247
  "Output transaction data as JSON instead of executing"
3248
+ ).option(
3249
+ "--address <address>",
3250
+ "Wallet address to preserve existing metadata for (used with --encode-only)"
3202
3251
  ).action(async (options) => {
3203
3252
  await executeProfileSetUsername({
3204
3253
  username: options.username,
3205
3254
  privateKey: options.privateKey,
3206
3255
  chainId: options.chainId,
3207
3256
  rpcUrl: options.rpcUrl,
3208
- encodeOnly: options.encodeOnly
3257
+ encodeOnly: options.encodeOnly,
3258
+ address: options.address
3209
3259
  });
3210
3260
  });
3211
3261
  const setBioCommand = new Command("set-bio").description("Set your profile bio").requiredOption("--bio <bio>", "Your profile bio (max 280 characters)").option(
@@ -3221,13 +3271,17 @@ function registerProfileCommand(program2) {
3221
3271
  ).option(
3222
3272
  "--encode-only",
3223
3273
  "Output transaction data as JSON instead of executing"
3274
+ ).option(
3275
+ "--address <address>",
3276
+ "Wallet address to preserve existing metadata for (used with --encode-only)"
3224
3277
  ).action(async (options) => {
3225
3278
  await executeProfileSetBio({
3226
3279
  bio: options.bio,
3227
3280
  privateKey: options.privateKey,
3228
3281
  chainId: options.chainId,
3229
3282
  rpcUrl: options.rpcUrl,
3230
- encodeOnly: options.encodeOnly
3283
+ encodeOnly: options.encodeOnly,
3284
+ address: options.address
3231
3285
  });
3232
3286
  });
3233
3287
  const setDisplayNameCommand = new Command("set-display-name").description("Set your profile display name").requiredOption("--name <name>", "Your display name (max 25 characters)").option(
@@ -3243,13 +3297,17 @@ function registerProfileCommand(program2) {
3243
3297
  ).option(
3244
3298
  "--encode-only",
3245
3299
  "Output transaction data as JSON instead of executing"
3300
+ ).option(
3301
+ "--address <address>",
3302
+ "Wallet address to preserve existing metadata for (used with --encode-only)"
3246
3303
  ).action(async (options) => {
3247
3304
  await executeProfileSetDisplayName({
3248
3305
  name: options.name,
3249
3306
  privateKey: options.privateKey,
3250
3307
  chainId: options.chainId,
3251
3308
  rpcUrl: options.rpcUrl,
3252
- encodeOnly: options.encodeOnly
3309
+ encodeOnly: options.encodeOnly,
3310
+ address: options.address
3253
3311
  });
3254
3312
  });
3255
3313
  const setTokenAddressCommand = new Command("set-token-address").description("Set your profile token address (ERC-20 token that represents you)").requiredOption(
@@ -3268,13 +3326,17 @@ function registerProfileCommand(program2) {
3268
3326
  ).option(
3269
3327
  "--encode-only",
3270
3328
  "Output transaction data as JSON instead of executing"
3329
+ ).option(
3330
+ "--address <address>",
3331
+ "Wallet address to preserve existing metadata for (used with --encode-only)"
3271
3332
  ).action(async (options) => {
3272
3333
  await executeProfileSetTokenAddress({
3273
3334
  tokenAddress: options.tokenAddress,
3274
3335
  privateKey: options.privateKey,
3275
3336
  chainId: options.chainId,
3276
3337
  rpcUrl: options.rpcUrl,
3277
- encodeOnly: options.encodeOnly
3338
+ encodeOnly: options.encodeOnly,
3339
+ address: options.address
3278
3340
  });
3279
3341
  });
3280
3342
  const setCanvasCommand = new Command("set-canvas").description("Set your profile canvas (HTML content)").option("--file <path>", "Path to file containing canvas content").option("--content <html>", "HTML content for canvas (inline)").option(