mtigdemir/ava-php

AVA Labs Gecko PHP 客户端

v0.1 2020-06-20 23:09 UTC

This package is auto-updated.

Last update: 2024-09-16 18:38:30 UTC


README

Build Status

AVA 节点的 PHP 客户端包装 https://docs.avax.network/build/avalanchego-apis

需求

  • 启动并运行 AVA 节点以使用 PHP 客户端
$ composer require mtigdemir/ava-php

初始化 AVA 客户端

// Default Connection (127.0.0.1:9650)
$client = new \AVA\AVAClient();

$username = "php-ava";
$password = "ava-password";

密钥存储

$client->keyStore->createUser($username, $password);
$client->keyStore->deleteUser($username, $password);

X-Chain

$client->xchain->createAddress($username, $password);
$client->xchain->listAddresses($username, $password);
$client->xchain->send($username, $password, $receiverAddress); // Default Asset AVA
$client->xchain->getBalance($address); // Default Asset AVA

P-Chain

$client->pchain->createAccount($username, $password);

管理员

$client->admin->nodeID();
$client->admin->networkName();