Skip to content

Pay from the robot

mova-robot is a small command-line tool. The robot runs it with its own key to pay from its spending account.

You need Node 20 or newer on the robot.

  1. Download the tool and install its one dependency:
Terminal window
mkdir mova-robot && cd mova-robot
curl -O https://docs.mova.build/mova-robot/mova-robot.mjs
curl -O https://docs.mova.build/mova-robot/package.json
npm install
  1. Create a .env file next to it:
Terminal window
# The robot's private key, saved when the robot was registered
MOVA_ROBOT_KEY=0x...
# The robot's ID: the long number in its page address in the Mova app
MOVA_ROBOT_ID=7609796266404622865478520861685648070859553970607516824731969204689381529297
  1. Make sure the key’s address has a little ETH on Robinhood Chain for fees.
Terminal window
node mova-robot.mjs status
Spending account 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
Balance 100 USDG
Daily limit 25 USDG
Spent today 0 USDG
Can spend now 25 USDG
Robot key 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
Gas 0.002 ETH
Terminal window
node mova-robot.mjs pay <address> <amount> [note]

For example:

Terminal window
node mova-robot.mjs pay 0xChargerAddress 1.10 Charging pad 14
Paid 1.1 USDG to 0xChargerAddress (Charging pad 14)
https://robinhoodchain.blockscout.com/tx/0x1f63…
Left today: 23.9 USDG

The note is stored on-chain with the payment and shows in the app under Paid by the robot.

The tool checks the rules before sending, so a refused payment costs no fee. It exits with code 1 and a reason:

Message Meaning
Over today's limit: 23.9 USDG left of 25 USDG. The payment would pass the daily limit.
Not enough money: the account holds … The spending account’s balance is too low.
The owner has paused spending. The owner paused the account.
This key … isn't the robot key for this account Wrong key, or the owner replaced it.
The robot key has no ETH for gas. Send ETH to the key’s address.
… is a plain address, not a spending account. The owner hasn’t set up spending yet.
Variable Required Purpose
MOVA_ROBOT_KEY For pay The robot’s private key
MOVA_ROBOT_ID Yes, unless MOVA_WALLET is set Looks up the spending account
MOVA_WALLET No The spending account’s address, to skip the lookup
MOVA_RPC No A different Robinhood Chain node

The tool is a thin wrapper around one contract call. To pay from your own software, call pay(to, amount, memo) on the spending account with the robot’s key. See the RobotWallet contract.