Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

FlagTypeRequiredDescription
--spenderaddressyesAddress authorised to spend up to --amount.
--amountbigintyesAmount 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

FlagDefaultEffect
--wait / --no-wait--waitWait for the transaction receipt before exiting. --no-wait exits after broadcast (returns the hash).

Exit codes

CodeMeaning
0transaction broadcast (with --no-wait) or receipt landed with status: success
1read error, transaction reverted, or receipt wait failed
2usage error (unknown flag, missing required arg, malformed value)