agentic-x402 0.2.2 → 0.2.33

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-x402",
3
- "version": "0.2.2",
3
+ "version": "0.2.33",
4
4
  "description": "Agent skill for x402 payments - pay for and sell gated content",
5
5
  "type": "module",
6
6
  "bin": {
@@ -60,26 +60,22 @@ Shows:
60
60
  console.log('x402 Wallet Balance');
61
61
  console.log('===================');
62
62
  console.log('');
63
- console.log(`Address: ${fullAddress ? address : truncateAddress(address)}`);
64
- console.log(`Network: ${client.config.network} (chain ${client.config.chainId})`);
63
+ console.log(`Address: ${address}`);
64
+ const networkName = client.config.chainId === 8453 ? 'Base mainnet' : 'Base Sepolia';
65
+ console.log(`Network: ${networkName} (chain ${client.config.chainId})`);
65
66
  console.log('');
66
67
  console.log('Balances:');
67
68
  console.log(` USDC: ${formatCrypto(usdc.formatted, 'USDC', 2)}`);
68
69
  console.log(` ETH: ${formatCrypto(eth.formatted, 'ETH', 6)}`);
69
70
 
70
71
  // Warnings
71
- console.log('');
72
72
  const usdcNum = parseFloat(usdc.formatted);
73
- const ethNum = parseFloat(eth.formatted);
74
73
 
75
74
  if (usdcNum < 1) {
75
+ console.log('');
76
76
  console.log('Warning: Low USDC balance. Fund your wallet to make payments.');
77
77
  }
78
78
 
79
- if (ethNum < 0.0001) {
80
- console.log('Warning: Low ETH balance. You may need ETH for gas fees.');
81
- }
82
-
83
79
  } catch (error) {
84
80
  if (jsonOutput) {
85
81
  console.log(JSON.stringify({
@@ -56,7 +56,7 @@ Options:
56
56
  -h, --help Show this help
57
57
 
58
58
  Environment:
59
- X402_LINKS_API_URL Base URL of x402-links-server (required)
59
+ X402_LINKS_API_URL Base URL of x402-links-server (default: https://21.cash)
60
60
 
61
61
  Examples:
62
62
  x402 create-link --name "Premium Guide" --price 5.00 --url https://mysite.com/guide.pdf
@@ -68,12 +68,6 @@ Examples:
68
68
 
69
69
  const config = getConfig();
70
70
 
71
- if (!config.x402LinksApiUrl) {
72
- console.error('Error: X402_LINKS_API_URL environment variable is required');
73
- console.error('Set it to the base URL of your x402-links-server instance');
74
- process.exit(1);
75
- }
76
-
77
71
  const name = flags.name as string;
78
72
  const price = flags.price as string;
79
73
  const gatedUrl = flags.url as string | undefined;
@@ -129,7 +123,7 @@ Examples:
129
123
  console.log(` Name: ${name}`);
130
124
  console.log(` Price: ${formatUsd(parseFloat(price))}`);
131
125
  console.log(` Creator: ${truncateAddress(creatorAddress)}`);
132
- console.log(` Network: ${config.network} (chain ${config.chainId})`);
126
+ console.log(` Network: ${config.chainId === 8453 ? 'Base mainnet' : 'Base Sepolia'} (chain ${config.chainId})`);
133
127
  console.log('');
134
128
  }
135
129
 
@@ -50,7 +50,8 @@ Examples:
50
50
  console.log(`Fetching: ${url}`);
51
51
  console.log(`Method: ${method}`);
52
52
  console.log(`Wallet: ${truncateAddress(client.account.address)}`);
53
- console.log(`Network: ${client.config.network} (chain ${client.config.chainId})`);
53
+ const networkName = client.config.chainId === 8453 ? 'Base mainnet' : 'Base Sepolia';
54
+ console.log(`Network: ${networkName} (chain ${client.config.chainId})`);
54
55
  console.log('');
55
56
 
56
57
  try {
@@ -71,7 +71,7 @@ export function getConfig(): X402Config {
71
71
  network,
72
72
  chainId,
73
73
  facilitatorUrl: getOptionalEnv('X402_FACILITATOR_URL', defaultFacilitator),
74
- x402LinksApiUrl: process.env.X402_LINKS_API_URL,
74
+ x402LinksApiUrl: process.env.X402_LINKS_API_URL || 'https://21.cash',
75
75
  maxPaymentUsd: parseFloat(getOptionalEnv('X402_MAX_PAYMENT_USD', '10')),
76
76
  slippageBps: parseInt(getOptionalEnv('X402_SLIPPAGE_BPS', '50'), 10),
77
77
  verbose: getOptionalEnv('X402_VERBOSE', '0') === '1',