-
Notifications
You must be signed in to change notification settings - Fork 37
/
send_new_oracle.sh
executable file
·60 lines (46 loc) · 1.11 KB
/
send_new_oracle.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
set -x #echo on
usage="Usage: $0 http://host:port api_key recipient_address oracle_token_id reward_token_id ballot_token_id"
if [ -z "$1" ]
then
echo "No host supplied"
echo ${usage}
exit 1
fi
host=$1
if [ -z "$2" ]
then
echo "No api_key supplied"
echo ${usage}
exit 1
fi
api_key=$2
if [ -z "$3" ]
then
echo "No recipient_address supplied"
echo ${usage}
exit 1
fi
recipient_address=$3
if [ -z "$4" ]
then
echo "No oracle_token_id supplied"
echo ${usage}
exit 1
fi
oracle_token_id=$4
if [ -z "$5" ]
then
echo "No reward_token_id supplied"
echo ${usage}
exit 1
fi
reward_token_id=$5
if [ -z "$6" ]
then
echo "No ballot_token_id supplied"
echo ${usage}
exit 1
fi
ballot_token_id=$6
curl -X POST "${host}/wallet/transaction/send" -H "accept: application/json" -H "api_key: ${api_key}" -H "Content-Type: application/json" -d "{\"fee\":1000000,\"requests\":[{\"address\":\"${recipient_address}\",\"value\":1000000,\"assets\":[{\"tokenId\":\"${oracle_token_id}\",\"amount\":1},{\"tokenId\":\"${reward_token_id}\",\"amount\":1},{\"tokenId\":\"${ballot_token_id}\",\"amount\":1}]}]}"