forked from input-output-hk/plutus-pioneer-program
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mint-token-curl.sh
executable file
·38 lines (35 loc) · 1.07 KB
/
mint-token-curl.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
#!/bin/bash
amt=$1
tn=$2
echo "minting $1 coins of token $2"
pkh=$(cabal exec payment-key-hash -- $ADDRESS)
skh=$(cabal exec stake-key-hash -- $ADDRESS)
echo "payment key hash: $pkh"
echo "stake key hash: $skh"
curl -X 'POST' \
'http://localhost:9080/api/contract/activate' \
-H 'accept: application/json;charset=utf-8' \
-H 'Content-Type: application/json;charset=utf-8' \
-d '{
"caWallet": {"getWalletId": "'"$WALLETID"'"},
"caID": {
"contents": {
"tpToken": {"unTokenName": "'"$tn"'"},
"tpAddress": {
"addressCredential": {
"contents": {"getPubKeyHash": "'"$pkh"'"},
"tag": "PubKeyCredential"
},
"addressStakingCredential": {
"contents": {
"contents": {"getPubKeyHash": "'"$skh"'"},
"tag": "PubKeyCredential"
},
"tag": "StakingHash"
}
},
"tpAmount": '"$amt"'
},
"tag": "Mint"
}
}'