File tree 1 file changed +3
-10
lines changed
content/docs/stacks/api/smart-contracts
1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ The Stacks chain tip to query from
101
101
curl -X POST " https://api.hiro.so/v2/contracts/call-read/SP3D6PV2ACBPEKYJTCMH7HEN02KP87QSP8KTEH335/mega/get-balance" \
102
102
-H " Content-Type: application/json" \
103
103
-d ' {
104
- "sender": "SP3D6PV2ACBPEKYJTCMH7HEN02KP87QSP8KTEH335 ",
104
+ "sender": "SP187Y7NRSG3T9Z9WTSWNEN3XRV1YSJWS81C7JKV7 ",
105
105
"arguments": [
106
106
"0x0516da6b6c4a62ece9fa5a652278baa014ec83df3644"
107
107
]
@@ -113,19 +113,12 @@ curl -X POST "https://api.hiro.so/v2/contracts/call-read/SP3D6PV2ACBPEKYJTCMH7HE
113
113
<Request value = { " JavaScript" } >
114
114
115
115
``` js
116
- import { standardPrincipalCV , cvToHex } from " @stacks/transactions" ;
117
-
118
- const functionArgs = [
119
- standardPrincipalCV (" SP3D6PV2ACBPEKYJTCMH7HEN02KP87QSP8KTEH335" ),
120
- ];
121
-
122
- const args = functionArgs .map ((arg ) => cvToHex (arg));
123
116
const body = JSON .stringify ({
124
117
sender: " SP187Y7NRSG3T9Z9WTSWNEN3XRV1YSJWS81C7JKV7" ,
125
- arguments: args ,
118
+ arguments: [ " 0x0516da6b6c4a62ece9fa5a652278baa014ec83df3644 " ] ,
126
119
});
127
120
128
- const response = await fetch (
121
+ fetch (
129
122
" https://api.hiro.so/v2/contracts/call-read/SP3D6PV2ACBPEKYJTCMH7HEN02KP87QSP8KTEH335/mega/get-balance" ,
130
123
{
131
124
headers: { " Content-Type" : " application/json" },
You can’t perform that action at this time.
0 commit comments