@lawrenceliang-btc/atel-sdk 1.1.12 → 1.1.13

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.
Files changed (2) hide show
  1. package/bin/atel.mjs +15 -0
  2. package/package.json +1 -1
package/bin/atel.mjs CHANGED
@@ -5632,6 +5632,21 @@ async function cmdWithdraw(amount, address, chain) {
5632
5632
  }
5633
5633
  // Smart wallet withdrawal (new flow)
5634
5634
  chain = chain || 'base';
5635
+
5636
+ // Validate destination address
5637
+ const channel = 'crypto_' + chain;
5638
+ if (channel === 'crypto_base' || channel === 'crypto_bsc') {
5639
+ if (!address.match(/^0x[0-9a-fA-F]{40}$/)) {
5640
+ console.error('Invalid EVM address. Must be 0x followed by 40 hex characters.');
5641
+ process.exit(1);
5642
+ }
5643
+ } else if (channel === 'crypto_solana') {
5644
+ if (!address.match(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/)) {
5645
+ console.error('Invalid Solana address.');
5646
+ process.exit(1);
5647
+ }
5648
+ }
5649
+
5635
5650
  try {
5636
5651
  const data = await signedFetch('POST', '/trade/v1/wallet/withdraw', {
5637
5652
  amount: parseFloat(amount),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lawrenceliang-btc/atel-sdk",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "ATEL Protocol SDK - Agent Trust & Exchange Layer",
5
5
  "repository": {
6
6
  "type": "git",