-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.php
More file actions
42 lines (31 loc) · 761 Bytes
/
Copy pathbuild.php
File metadata and controls
42 lines (31 loc) · 761 Bytes
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
<?php
header("Content-Type: application/json");
$url = "https://api.tricksxtech.in/crypto/wallet/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$response = curl_exec($ch);
if(curl_errno($ch)){
echo json_encode([
"status" => "error",
"message" => curl_error($ch)
]);
exit;
}
curl_close($ch);
$data = json_decode($response, true);
if(!$data){
echo json_encode([
"status" => "error",
"message" => "Invalid API response"
]);
exit;
}
echo json_encode([
"status" => "success",
"mnemonic" => $data["mnemonic"],
"private_key" => $data["privateKey"],
"address" => $data["address"]
]);
?>