@net-protocol/cli 0.1.33 → 0.1.34

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.
@@ -7,7 +7,7 @@ import chalk4 from 'chalk';
7
7
  import * as fs6 from 'fs';
8
8
  import { readFileSync, existsSync, mkdirSync, writeFileSync } from 'fs';
9
9
  import { OPTIMAL_CHUNK_SIZE, StorageClient, detectFileTypeFromBase64, base64ToDataUri, shouldSuggestXmlStorage, getStorageKeyBytes, encodeStorageKeyForUrl, chunkDataForStorage, CHUNKED_STORAGE_CONTRACT, STORAGE_CONTRACT as STORAGE_CONTRACT$1 } from '@net-protocol/storage';
10
- import { stringToHex, createWalletClient, http, hexToString, parseEther, encodeFunctionData, publicActions, defineChain, createPublicClient } from 'viem';
10
+ import { stringToHex, createWalletClient, http, hexToString, parseEther, encodeFunctionData, publicActions, concat, defineChain, createPublicClient } from 'viem';
11
11
  import { privateKeyToAccount } from 'viem/accounts';
12
12
  import { getNetContract, getChainName, getPublicClient, getChainRpcUrls, getBaseDataSuffix, NetClient, toBytes32, NULL_ADDRESS } from '@net-protocol/core';
13
13
  import { createRelayX402Client, createRelaySession, checkBackendWalletBalance, fundBackendWallet, batchTransactions, submitTransactionsViaRelay, waitForConfirmations, retryFailedTransactions as retryFailedTransactions$1 } from '@net-protocol/relay';
@@ -1236,9 +1236,11 @@ function encodeTransaction(config, chainId) {
1236
1236
  functionName: config.functionName,
1237
1237
  args: config.args
1238
1238
  });
1239
+ const suffix = getBaseDataSuffix(chainId);
1240
+ const data = suffix ? concat([calldata, suffix]) : calldata;
1239
1241
  return {
1240
1242
  to: config.to,
1241
- data: calldata,
1243
+ data,
1242
1244
  chainId,
1243
1245
  value: config.value?.toString() ?? "0"
1244
1246
  };
@@ -2062,20 +2064,20 @@ async function executeEncodeOnly2(options) {
2062
2064
  },
2063
2065
  saltResult.salt
2064
2066
  );
2065
- const calldata = encodeFunctionData({
2066
- abi: txConfig.abi,
2067
- functionName: txConfig.functionName,
2068
- args: txConfig.args
2069
- });
2067
+ const encoded = encodeTransaction(
2068
+ {
2069
+ to: txConfig.address,
2070
+ abi: txConfig.abi,
2071
+ functionName: txConfig.functionName,
2072
+ args: txConfig.args,
2073
+ value: txConfig.value
2074
+ },
2075
+ readOnlyOptions.chainId
2076
+ );
2070
2077
  const result = {
2071
2078
  predictedAddress: saltResult.predictedAddress,
2072
2079
  salt: saltResult.salt,
2073
- transaction: {
2074
- to: txConfig.address,
2075
- data: calldata,
2076
- chainId: readOnlyOptions.chainId,
2077
- value: txConfig.value?.toString() ?? "0"
2078
- },
2080
+ transaction: encoded,
2079
2081
  config: {
2080
2082
  name: options.name,
2081
2083
  symbol: options.symbol,