Skip to content

Instantly share code, notes, and snippets.

@rohasnagpal
Last active October 21, 2022 08:59
Show Gist options
  • Save rohasnagpal/c791fd4573e84088437688a4859ae673 to your computer and use it in GitHub Desktop.
Save rohasnagpal/c791fd4573e84088437688a4859ae673 to your computer and use it in GitHub Desktop.
<?php
//Requires libcurl
$curl = curl_init();
$payload = array(
"index" => 0,
"mnemonic" => "urge pulp usage sister evidence arrest palm math please chief egg abuse"
);
curl_setopt_array($curl, [
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: YOUR_API_KEY"
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_URL => "https://api-eu1.tatum.io/v3/bitcoin/wallet/priv",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$error = curl_error($curl);
curl_close($curl);
if ($error) {
echo "cURL Error #:" . $error;
} else {
echo $response;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment