Skip to content

Instantly share code, notes, and snippets.

@robertuniqid
Last active January 13, 2018 19:59
Show Gist options
  • Select an option

  • Save robertuniqid/29f4e7bce8e6c66521e4334df8a6e2fa to your computer and use it in GitHub Desktop.

Select an option

Save robertuniqid/29f4e7bce8e6c66521e4334df8a6e2fa to your computer and use it in GitHub Desktop.
PHP - Detect your CounterParty Wallet
<?php
//$information = file_get_contents( 'information.txt' );
// or
$information = "
public-key-address
public-key-address
public-key-address
public-key-address
";
// Do not edit from here.
$information = explode( "\n", trim( $information ) );
foreach( $information as $wallet ) {
$wallet = trim( $wallet );
$data = json_decode( file_get_contents( 'https://xchain.io/api/address/' . $wallet ) );
if( intval( $data->estimated_value->usd ) < 1 )
continue;
echo $wallet;
echo "\n";
foreach( $data->estimated_value as $pair => $value )
echo ' | ' . $pair . ' ' . $value;
echo "\n";
}
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment