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.
Set up
Section titled “Set up”You need Node 20 or newer on the robot.
- Download the tool and install its one dependency:
mkdir mova-robot && cd mova-robotcurl -O https://docs.mova.build/mova-robot/mova-robot.mjscurl -O https://docs.mova.build/mova-robot/package.jsonnpm install- Create a
.envfile next to it:
# The robot's private key, saved when the robot was registeredMOVA_ROBOT_KEY=0x...# The robot's ID: the long number in its page address in the Mova appMOVA_ROBOT_ID=7609796266404622865478520861685648070859553970607516824731969204689381529297- Make sure the key’s address has a little ETH on Robinhood Chain for fees.
Check status
Section titled “Check status”node mova-robot.mjs statusSpending account 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512Balance 100 USDGDaily limit 25 USDGSpent today 0 USDGCan spend now 25 USDGRobot key 0x70997970C51812dc3A010C7d01b50e0d17dc79C8Gas 0.002 ETHnode mova-robot.mjs pay <address> <amount> [note]For example:
node mova-robot.mjs pay 0xChargerAddress 1.10 Charging pad 14Paid 1.1 USDG to 0xChargerAddress (Charging pad 14)https://robinhoodchain.blockscout.com/tx/0x1f63…Left today: 23.9 USDGThe note is stored on-chain with the payment and shows in the app under Paid by the robot.
When a payment is refused
Section titled “When a payment is refused”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. |
Settings
Section titled “Settings”| 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 |
From your own code
Section titled “From your own code”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.