Skip to content

AMLKYCTECH/php-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AMLKYC PHP SDK

PHP SDK for https://amlkyc.tech API. Provides convenient access to:

  • Fast Checks (быстрые проверки)
  • Investigations (расследования)
  • User Balance (баланс)

The SDK is built on top of Guzzle and follows PSR conventions. Ready for publication on Packagist.

Installation

Install via Composer (after publishing to Packagist):

composer require amlkyc/sdk

For local development, clone the repo and run:

composer install

Authentication

Use your API key (Bearer token) when creating the client:

use AmlKyc\Client;

$client = new Client('YOUR_API_KEY');

The base URI defaults to https://amlkyc.tech. You can override it with the second constructor argument.

Usage

Fast Checks

$fast = $client->fastChecks();

// Create a new fast check
$created = $fast->create('TLWKepDBC8RZjAhtWyNqASyzgyVyHUuS7o', 'USDT', 'trx');

// Run the fast check
$run = $fast->run($created['id']);

// Get details
$detail = $fast->getById($created['id']);

// List fast checks
$list = $fast->list();

Investigations

$inv = $client->investigations();

// Create investigation (target is address id or transaction hash)
$created = $inv->create('1', 'USDT');

// Run investigation
$inv->run($created['id']);

// Get graph (optionally for a specific item)
$graph = $inv->graph($created['id'], 123);

// Request deep analysis for an address within the investigation
$deep = $inv->deep($created['id'], 'TLWKepDBC8RZjAhtWyNqASyzgyVyHUuS7o');

Balance

$balanceApi = $client->balance();

$balance = $balanceApi->get();
$fiat = $balanceApi->allowedFiat();
$invoice = $balanceApi->createInvoice(300, 'rub');

Errors

All network and API errors are thrown as AmlKyc\\Exception\\ApiException with methods:

  • getStatusCode() — HTTP status code when available
  • getBody() — decoded JSON response body when available

Testing

Unit tests (mocked, no network):

vendor/bin/phpunit

Integration tests (real network):

Set your API key as env var and enable integration tests:

export AMLKYC_API_KEY="7500|V7Yz2LcScGI2HtfbGNc08e2huNI6XOv6ppR7tc7L"
export AMLKYC_TEST_ADDRESS="TLWKepDBC8RZjAhtWyNqASyzgyVyHUuS7o"
export AMLKYC_RUN_INTEGRATION=true
vendor/bin/phpunit --testsuite "AmlKyc SDK Test Suite"

Note: running integration tests may consume your balance.

License

MIT License. See LICENSE file.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages