apyx apxUSD approve
Set the ERC-20 allowance for a spender. Required before apyUSD deposit can pull funds.
Synopsis
apyx apxUSD approve --spender <address> --amount <bigint>
Arguments
| Flag | Type | Required | Description |
|---|---|---|---|
--spender | address | yes | Address authorised to spend up to --amount. |
--amount | bigint | yes | Amount in apxUSD raw units (6 decimals). 1e6 = 1 apxUSD. |
Example
$ apyx apxUSD approve \
--spender 0x38EEb52F0771140d10c4E9A9a72349A329Fe8a6A \
--amount 1e6
hash: 0x3c6a…a9e1
waiting for receipt…
status: success
block: 19884112
gas: 48201
SDK equivalent
apyx.apxUSD.approve({ spender, amount })
Reference: apxUSD module.
Flags
Inherits all session-start flags: --profile, --rpc-url, --chain, --key-path, --address-apxusd, --address-apyusd, --address-rate-view.
Write-specific flags
| Flag | Default | Effect |
|---|---|---|
--wait / --no-wait | --wait | Wait for the transaction receipt before exiting. --no-wait exits after broadcast (returns the hash). |
Exit codes
| Code | Meaning |
|---|---|
| 0 | transaction broadcast (with --no-wait) or receipt landed with status: success |
| 1 | read error, transaction reverted, or receipt wait failed |
| 2 | usage error (unknown flag, missing required arg, malformed value) |