public function buildDataAddr($toaddr, $currency, $amount) { $decoded = base58check_decode($toaddr); $seqnum = hexdec(bin2hex($decoded[1])) - 1; if ($seqnum < 0) { $seqnum = $seqnum + 256; } $datahex = dechex($seqnum); // seqence number $datahex = $datahex . $this->int32ToHexLittle(0); // tx type $datahex = $datahex . $this->int32ToHexLittle($currency); // currency id $datahex = $datahex . $this->int64ToHexLittle($amount); // amount $datahex = $datahex . "000000"; $encoded = base58check_encode(hex2bin($datahex)); return $encoded; }
function getVerifiedAddress($signature, $message) { $derivedAddress = getVerifiedAddress160Bin($signature, $message); $encoded = base58check_encode($derivedAddress); return $encoded; }