Centralized Auton Exchange (CAX)

Install Package requied

apt install jq -y
curl -SsL https://packages.httpie.io/deb/KEY.gpg | sudo gpg --dearmor -o /usr/share/keyrings/httpie.gpg
sudo echo "deb [arch=amd64 signed-by=/usr/share/keyrings/httpie.gpg] https://packages.httpie.io/deb ./" > /etc/apt/sources.list.d/httpie.list
sudo apt update
apt install snapd
sudo snap install httpie

Config Aut use Wallet.key

CAX

Get API

MESSAGE=$(jq -nc --arg nonce "$(date +%s%N)" '$ARGS.named')

Sign-message

aut account sign-message $MESSAGE message.sig

POST using HTTPie CLI to receive the new API key

echo -n $MESSAGE | https https://cax.piccadilly.autonity.org/api/apikeys api-sig:@message.sig

Save apikey and set KEY, example: KEY=RedtwudQyP98Y2zNxxredxxxx123xxxxxxxxxxmxs=

KEY=<apikey>

Check your balance

https GET https://cax.piccadilly.autonity.org/api/balances/ API-Key:$KEY

Get the CAX orderbooks

https GET https://cax.piccadilly.autonity.org/api/orderbooks/ API-Key:$KEY

Get the current quote price

ATN

https GET https://cax.piccadilly.autonity.org/api/orderbooks/ATN-USD/quote API-Key:$KEY

NTN

https GET https://cax.piccadilly.autonity.org/api/orderbooks/NTN-USD/quote API-Key:$KEY

Buy ATN or NTN

ATN (can change price and amount)

https POST https://cax.piccadilly.autonity.org/api/orders/ API-Key:$KEY pair=ATN-USD side=bid price=1.04  amount=100

NTN (can change price and amount)

https POST https://cax.piccadilly.autonity.org/api/orders/ API-Key:$KEY pair=NTN-USD side=bid price=10.04  amount=100

Withdraw from off-chain (Withdraw to chain piccadilly)

ATN (can change amount)

https POST https://cax.piccadilly.autonity.org/api/withdraws/ API-Key:$KEY symbol=ATN amount=10

NTN (can change amount)

https POST https://cax.piccadilly.autonity.org/api/withdraws/ API-Key:$KEY symbol=NTN amount=10

Deposit to off-chain (send token)

Please "Withdraw from off-chain" before send token.

Can change "--value 1" -> 1-2-3-4 and more

Not change 0x7aa3E52908c1a5792acc4d713Eb416A0c77B6db9, because it of NodeSync :))

NTN

aut tx make --to 0x7aa3E52908c1a5792acc4d713Eb416A0c77B6db9 --value 1 --ntn | aut tx sign - | aut tx send -

ATN

aut tx make --to 0x7aa3E52908c1a5792acc4d713Eb416A0c77B6db9 --value 10 | aut tx sign - | aut tx send -

Last updated