β©Nostr Assets Commands
Last updated
Last updated
Unlike most protocols, the Nostr Assets Protocol is a natural language protocol where all sub-protocols interact through commands expressed in natural language.
As an illustration, in the Nostr Assets Protocol, the command "balance of npubxxx" allows users to inquire about the balance of a particular address. This command resembles the input format of ERC20's "balanceOf()" function, which is widely used for retrieving token balances.
This unique approach enables a more intuitive and user-friendly interaction experience within the Nostr Assets ecosystem.
Users may send commands through any Nostr Client (e.g. Damus) to Nostr Asset Daemon(NAD)'s nostr address. Commands are written in small caps.
Users can input the following basic commands:
Query the list of supported tokens.
Check the account balance for a specific token (SATS).
balance for (token)
Check the account balance for a specific account address.
balance of (npub address)
Check the account balance for a specific token in an account address.
balance of (npub address) for (token)
transfer (quantity) (token) to (npub address)
Approves a single token to an operator's account address. The operator will be able to use the approved amount of tokens for transactions on behalf of the asset owner.
approve (quantity) (token) to (npub address)
For approving multiple tokens to an operator's account address.
Transfer a single token to a receiving address on behalf of the asset owner.
transfer (quantity) (token) from (sending address) to (receiving address)
Transfer multiple tokens to receiving address on behalf of the asset owner.
transfer (quantity) (token 1) from (sending address) to (receiving address); transfer (quantity) (token 2) from (sending address) to (receiving address)
Check the allowance of a specific token approved to a specific operator by a specific owner.
allowance to (operator's npub address) by (owner's npub address) for (token)
The Asset Owner can check the allowance of a specific token approved for a specific operator.
allowance to (operator's npub address) for (token)
The Approved Operator can check the allowance of a specific token approved by the Asset Owner.
allowance by (owner's npub address) for (token)
Check nonce of the last executed order.
Check nonce of the last executed order by a specific npub address.
nonce of (npub address)
Get deposit info.
Withdrawal of tokens from Nostr Assets Protocol to a designated wallet would cost network fees
Withdraw token to a specific account address.
withdraw (quantity) (token) to (wallet address)
Withdraw multiple tokens to different account addresses.
withdraw (quantity) (token 1) to (wallet address 1); withdraw (quantity) (token 2) to (wallet address 2); withdraw (quantity) (token 1) to (wallet address 2)
Query the list of names and addresses in the user's address book
Add name and npub address as a key-value pair to address.
add address (npub address) name (name to be shown on address book)
Subsequently, users can execute commands with names in the address instead of using long npub address. example:
Delete name from address book.
delete (name) from address book
Query the system for help, which returns a list of available commands
Tell users what is the current mode they are using
Change to Pro mode
Change to Normal mode