abeltranp9476/cripto-generador

用于生成加密货币地址的PHP库

1.1.0 2021-09-19 21:51 UTC

This package is auto-updated.

Last update: 2024-09-20 04:06:30 UTC


README

支持的加密货币

支持3种类型的地址:旧版兼容性segwit

  • 比特币
  • 达世币
  • 狗狗币
  • 莱特币
  • 维卡币
  • 门罗币

要求

  • PHP版本 >= 7.3
  • Composer

安装

  • 通过Composer安装此包
composer require abeltranp9476/cripto-generador

使用示例

  • 比特币案例
require_once __DIR__ . '/vendor/autoload.php';

use CriptoGenerador\HD;


$criptoGen = new HD(); /* Crear nueva instancia de la clase HD */

try {
$criptoGen->set_network('bitcoin');
} catch(\Exception $ex) {
    echo $ex->getMessage();
}

try {
$criptoGen->set_pub('Tu Master Public Key'); /* Escriba la clave maestra publica de su wallet Bitcoin */
} catch(\Exception $ex) {
    echo $ex->getMessage();
}

try {
echo $criptoGen->address_from_master_pub('0/0'); /* Genera la primera direccion BTC para depositos */
} catch(\Exception $ex) {
    echo $ex->getMessage();
}

在其他情况下,请确保将指定加密货币钱包的xpub、ypub或zpub放置在 set_network 中。要选择其他网络,请参考支持的加密货币列表。