-
Notifications
You must be signed in to change notification settings - Fork 0
/
WEM_APIs_V1-00
307 lines (182 loc) · 7.85 KB
/
WEM_APIs_V1-00
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
WEM PROJECT
www.wemhub.com
/// API DOC ///
Last update: May 09, 2022
Ver: 1.1
=====================================
<<< INTRODUCTION >>>
=====================================
The WEM API will allow you to send & receive WEM, query JSON data on nodes and transactions, and get information regarding the WEM Network. Almost all functionality and data you see on this website is available through API calls.
=====================================
<<< Simple Lookups >>>
=====================================
# Exchange Rate
https://wemhub.com/api/wem_get_price_rate
<!-- Response -->
{"status":"success","wem_in_usd":"0.989898989"}
# WEM Count
https://wemhub.com/api/wem_GetWEMCount_total
<!-- Response -->
{"status":"success","TotalWalletsSUM":"1,075,418.153305021","TotalCIDsSum":"0.000000000","TotalWEMsSum":"1,075,418.153305021"}
"TotalWalletsSUM": Total balance available at Node's Wallets and Paper Wallets.
"TotalCIDsSum": Total amount active smart contracts at WEM network.
"TotalWEMsSum": Total amount of WEMs generated by WEM network.
# Generate Paper Wallet
https://wemhub.com/api/wem_generate_PaperWallet
# Get Country Code
https://wemhub.com/api/get_country
=====================================
<<< GET/POST cURL Lookups >>>
=====================================
## Generate Node
<!-- Request -->
curl -X POST https://wemhub.com/api/regit
-H 'Content-Type: application/json'
-d '{"pin":"123456","sponsornode":"016-000-0000-501", "country":"840"}'
"pin": Your 6 digit Numeric PIN - Example: 123456
"sponsornode": Your Sponsor Node Account Number - Example: 000-000-0000-000
"country":"Country code for Account number" <!-- Get Country code by https://wemhub.com/api/get_country -->
<!-- Response -->
{
"success": "true",
"Account No.": "000-000-0000-000",
"Private key": "b7cad3ad374f2a9b750651449dd2268045ee295f30beada07856fc89ca584a6a",
"PassPhrase": "terrorful fossilological numerant gurdy raven tinctorious cryptoproselyte convictional procursive overagitating microbarograph cunjer",
"PPubHash": "ef5386d1d86b8c2c65a1db0b2d7e8a5582ab723f0cdecf0220df192ed5a347ed",
"StringHash": "e464j5a4x214235413h564w22434z2t2f48454j5r2c444a4w2s2p2i5z2z2f4a4c4x2f4c453v2k5b403x2l5d4g57414b4v274b4y27454a4e4235494i584a4b4e40566d4a4w2y3u2s2u20464v21434o2r263z2w48674e4t28403w25424741333a4437484k51303g564d47444k544m5v2d4w2h59413b4r2g5k50374y2j534b4d4n5b4k55484y214a4a4v2c484c4h58444t2131394k5"
}
## Get Node Summary by Private Key
<!-- Request -->
curl -X POST https://wemhub.com/api/wem_get_node_summary
-H 'Content-Type: application/json'
-d '{"private_key":"f29abf5f72fd0bf297d5823c77e52082d1625680535da1ed1f13ddfae87a06b1"}'
"private_key": Node Private Key
<!-- Response -->
{
"status": "success",
"balance": "24,562.407311451",
"total_deposit": "0.000000000",
"total_withdrawn": "0.000000000",
"total_transfers": 0,
"total_contracts": 3,
"balance_in_contracts": "0.000000000",
"total_referrals": 2
}
## Get Transaction Summary by Transaction ID
<!-- Request -->
curl -X POST https://wemhub.com/api/wem_get_transaction_summary
-H 'Content-Type: application/json'
-d '{"transactionid":"61276d9cd702746a90b8e9f67f3bd8267ac6ed3c"}'
"transactionid": WEM Transaction ID
<!-- Response -->
{
"status": "success",
"data": {
"_transaction_height": "000150",
"_timestamp": "20210928150549",
"_transaction_id": "61276d9cd702746a90b8e9f67f3bd8267ac6ed3c",
"_account_out": "840-000-0000-135",
"_account_in": "777-000-0000-488, 777-000-0000-467",
"_amount": "1.123456789",
"_fee": "0.002246914",
"_total_amount": "1.125703703",
"_description": "Internal Transfer",
"_transaction_type": "0x003, 0x010",
"_wem_pp": "1.028837442"
}
}
## Get NODEs/Contracts Balance
<!-- Request -->
curl -X POST https://wemhub.com/api/wem_get_node_balance
-H 'Content-Type: application/json'
-d '{"accountno":"CID-000-0000-000"}'
"accountno": Node Account No., Paper Wallet No., CID or Contract ID
<!-- Response -->
{
"status": "success",
"balance": "1.123456789"
}
## Generate Paper Wallet
<!-- Request -->
curl -X POST https://wemhub.com/api/wem_generate_PaperWallet
-H 'Content-Type: application/json'
-d '{"private_key":"Private Key","amount":"1.123456789"}'
"private_key": Private key of the Node or Paper Wallet that requested amount should be deducted.
"amount": Requested amount.
NOTE: Generate wallet with 0 balance
<!--Request-->
curl -X POST https://wemhub.com/api/wem_generate_PaperWallet
-H 'Content-Type: application/json'
<!-- Response -->
{
"success": "true",
"Account No.": "777-000-0000-483",
"PrivateKey": "a3c9cda4e546066fd46e603ca92440a5a3d004df37a528f51527945a08c9aacd",
"Balance": "0.123456789"
}
## Generate Smart Contract
<!-- Request -->
curl -X POST https://wemhub.com/api/wem_contract
-H 'Content-Type: application/json'
-d '{"amount":"100.123456789","account":"840-000-0000-308", "private_key":"16288384543461994bb4ddd65f48050d563d97dff55114b6e572bdb9820c70f1", "contract":"CID-658-383-9912"}'
"amount": The amount needs to be assigned to the Smart contract.
"account": The Node needs to be assigned to the Smart Contract.
"private_key": Private key of the Node that amount needs to be withdrawn.
"contract": The CID that needs to transfer amount to.
<!-- Response -->
{
"status": "success",
"CID": "CID-658-383-9912",
"ContractID": "CID-361-311-5217",
"plan_type": "Plan Type : Hourly"
}
"CID": The main Smart Contract ID
"ContractID": The sub Smart Contract under the CID.
"plan_type": The investiture plan term.
## Transfer
<!-- Request -->
curl -X POST https://wemhub.com/api/wem_transfer
-H 'Content-Type: application/json'
-d '{"amount":"1000.123456789","receiver":"000-000-0000-000", "private_key":"private Key"}'
"amount": The amount needs to be transfered.
"receiver": Receiver Node Account number
"private_key": Private key of the Node that amount needs to be withdrawn.
<!-- Response -->
{
"status": "success",
"message": "30000WEM successfully sent from 840-000-0000-404 to 840-000-0000-445. Tx_id: 0d951beaa9113fceaa028ffaa3b4c487f24b2552"
}
## Generate IN
<!-- Request -->
curl -X POST https://wemhub.com/api/wem_gen_in
-H 'Content-Type: application/json'
-d '{"addr":"Wallet Address",
"txid":"Transaction Id BTC/ETH/LTC", "amount":"Amount(WEM)", "type":"BTC/ETH/LTC", "account":"000-000-0000-0000"}'
"addr": WEM Crosschain Wallet address (see line 277 -## Calculate WEM to BTC/ETH/LTC)
"txid": Crosschain transaction id for BTC, ETH, or LTC
"amount": Amount of WEM needs to be transfered
"type": The crosschain, BTC/ETH/LTC
"account": WEM Node ID / Account number
## Calculate WEM to BTC/ETH/LTC
<!-- Request -->
curl -X POST https://wemhub.com/api/wem_genin_calculate
-H 'Content-Type: application/json'
-d '{"wemcount":"369"}'
"wemcount": The amount of WEM needs to be exchanged
<!-- Response -->
{
"BTC": {
"amount": 0.0117340175004279310966293081719413748942315578460693359375,
"to": "bc1q2qj48yn3txa2srrpydzlhu7dn23l8xc4vsazt5"
},
"ETH": {
"amount": 0.1563351309670943101171047828756854869425296783447265625,
"to": "0xb31ae96e0eb0311c30f79ccdb1f99d92cca1141f"
},
"LTC": {
"amount": 4.55158900726349013865501547115854918956756591796875,
"to": "ltc1qfy5j69d3lm9tqfgkypcpu7gea7pg9lph5r3vl4"
},
"status": "success",
"WEMPrice": "0.9906181928816555$"
}