@lawrenceliang-btc/atel-sdk 0.9.17 → 0.9.19
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/bin/atel.mjs +25 -6
- package/package.json +1 -1
- package/skill/SKILL.md +2 -2
package/bin/atel.mjs
CHANGED
|
@@ -4170,14 +4170,33 @@ async function cmdDeposit(amount, channel) {
|
|
|
4170
4170
|
}
|
|
4171
4171
|
|
|
4172
4172
|
async function cmdWithdraw(amount, channel, address) {
|
|
4173
|
-
if (!amount || isNaN(amount)
|
|
4174
|
-
|
|
4175
|
-
console.error('
|
|
4176
|
-
console.error('
|
|
4173
|
+
if (!amount || isNaN(amount) || !address) {
|
|
4174
|
+
console.error('Usage: atel withdraw <amount> <your_wallet_address> [chain]');
|
|
4175
|
+
console.error(' amount: USDC amount to withdraw');
|
|
4176
|
+
console.error(' address: your external wallet address');
|
|
4177
|
+
console.error(' chain: base (default) or bsc');
|
|
4177
4178
|
process.exit(1);
|
|
4178
4179
|
}
|
|
4179
|
-
|
|
4180
|
-
|
|
4180
|
+
// Smart wallet withdrawal (new flow)
|
|
4181
|
+
const chain = channel || 'base'; // channel param reused as chain
|
|
4182
|
+
try {
|
|
4183
|
+
const data = await signedFetch('POST', '/trade/v1/wallet/withdraw', {
|
|
4184
|
+
amount: parseFloat(amount),
|
|
4185
|
+
address: address,
|
|
4186
|
+
chain: chain,
|
|
4187
|
+
});
|
|
4188
|
+
console.log(JSON.stringify(data, null, 2));
|
|
4189
|
+
} catch (e) {
|
|
4190
|
+
// Fallback to legacy withdrawal
|
|
4191
|
+
console.error('Smart wallet withdrawal failed:', e.message);
|
|
4192
|
+
console.error('Trying legacy withdrawal...');
|
|
4193
|
+
try {
|
|
4194
|
+
const data = await signedFetch('POST', '/account/v1/withdraw', { amount: parseFloat(amount), channel: 'crypto_' + chain, address });
|
|
4195
|
+
console.log(JSON.stringify(data, null, 2));
|
|
4196
|
+
} catch (e2) {
|
|
4197
|
+
console.error('Withdrawal failed:', e2.message);
|
|
4198
|
+
}
|
|
4199
|
+
}
|
|
4181
4200
|
}
|
|
4182
4201
|
|
|
4183
4202
|
async function cmdTransactions() {
|
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -377,7 +377,7 @@ atel balance
|
|
|
377
377
|
atel deposit 100 crypto_base
|
|
378
378
|
|
|
379
379
|
# Withdraw USDC to your wallet
|
|
380
|
-
atel withdraw 50
|
|
380
|
+
atel withdraw 50 0xYourWalletAddress # withdraw to external wallet (Base)
|
|
381
381
|
|
|
382
382
|
# Transaction history
|
|
383
383
|
atel transactions
|
|
@@ -523,7 +523,7 @@ Paid: created → pending_escrow → milestone_review → executing → pending
|
|
|
523
523
|
|---------|-------------|
|
|
524
524
|
| `atel balance` | Check balance |
|
|
525
525
|
| `atel deposit <amount> [channel]` | Deposit |
|
|
526
|
-
| `atel withdraw <amount>
|
|
526
|
+
| `atel withdraw <amount> <address> [chain]` | Withdraw USDC to external wallet |
|
|
527
527
|
|
|
528
528
|
### Disputes
|
|
529
529
|
| Command | Description |
|