akashic / akashic-pay
A library to interact with the AkashicChain network, written in PHP.
Installs: 150
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
pkg:composer/akashic/akashic-pay
Requires
- php: >=7.2
- ext-curl: *
- ext-gmp: *
- ext-json: *
- ext-openssl: *
- fgrosse/phpasn1: ^2.5.0
- guzzlehttp/guzzle: ^7.9
- monolog/monolog: ^2.9
- protonlabs/bitcoin: ^1.0
- simplito/elliptic-php: ^1.0
Requires (Dev)
- dev-main
- v1.17.0
- v1.16.0
- v1.15.3
- v1.15.2
- v1.15.1
- v1.15.0
- v1.14.0
- v1.13.1
- v1.13.0
- v1.12.0
- v1.11.4
- v1.11.3
- v1.11.2
- v1.11.1
- v1.11.0
- v1.10.0
- v1.9.1
- v1.9.0
- v1.8.0
- v1.7.0
- v1.6.0
- v1.5.0
- v1.4.1
- v1.4.0
- v1.3.2
- v1.3.1
- v1.3.0
- v1.1.0
- v1.0.1
- v1.0.0
- v0.0.11
- v0.0.10
- v0.0.9
- v0.0.8
- v0.0.7
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
This package is auto-updated.
Last update: 2025-09-26 14:49:10 UTC
README
A library to interact with the AkashicChain network, written in PHP.
Installing
composer require akashic/akashic-pay
Usage
use Akashic\AkashicPay;
Features
- Send crypto via Layer 1 and Layer 2 (Akashic Chain)
- Create wallets for your users into which they can deposit crypto
- Fetch balance and transaction details
- Completely Web3: No login or API-key necessary. Just supply your Akashic private key, which stays on your server. The SDK signs your transactions with your key and sends them to Akashic Chain.
- Supports Ethereum and Tron
Getting Started
- Create an account on AkashicLink (Google Chrome Extension or iPhone/Android App)
- Visit AkashicPay and connect with AkashicLink. Set up the URL you wish to receive callbacks for.
- Integrate the SDK in your code. This example configuration uses many optional build arguments, for illustration purposes:
use Akashic\AkashicPay; use Akashic\Constants\Environment; use Akashic\Constants\ACNode; use Akashic\Constants\ACDevNode; $akashicPay = new AkashicPay([ // in development, you will use our testnet and testnet L1 chains 'environment' => getenv('environment') === 'production' ? Environment::PRODUCTION : Environment::DEVELOPMENT, // optional, the SDK will try to find the fastest node if omitted 'targetNode' => getenv('environment') === 'production' ? ACNode::SINGAPORE_1 : ACDevNode::SINGAPORE_1, // use whatever secret management tool you prefer to load the private key // from your AkashicLink account. It should be of the form: // `"0x2d99270559d7702eadd1c5a483d0a795566dc76c18ad9d426c932de41bfb78b7"` // In development, each developer could have their own, or omit this (and // the l2Address), in which case the SDK will create and use a new pair. // you can instead use your Akashic Link account's 12-word phrase, using the // argument `recoveryPhrase` 'privateKey' => getenv('akashicKey'), // this is the address of your AkashicLink account. Of the form "AS1234..." 'l2Address' => getenv('l2Address'), ]);
AkashicPay is now fully setup and ready to use.
Testing
You can also use AkashicPay with the AkashicChain Testnet & Sepolia (Ethereum) and Shasta (Tron) testnets, useful for local development and staging environments. To do this, no AkashicLink is necessary; you can build an AkashicPay instance as follows, and the SDK will create a "test otk" for you:
use Akashic\AkashicPay; use Akashic\Constants\Environment; $akashicPay = new AkashicPay([ 'environment' => Environment::DEVELOPMENT, 'privateKey' => getenv('akashicTestKey'), // this is the address of your AkashicLink account. Of the form "AS1234..." 'l2Address' => getenv('testL2Address'), ]);
You can now create an L1-wallet on a testnet:
use Akashic\Constants\NetworkSymbol; $address = $akashicPay->getDepositAddress(NetworkSymbol::TRON_SHASTA, 'EndUser123');
Use a faucet (e.g. via the Tron Discord) to deposit some coin into the created wallet.
You can check to see if your balance has increased with:
$balances = $akashicPay->getBalance(); // -> [{networkSymbol: 'TRX-SHASTA', balance: '5000'}, ...]
Documentation
For more in-depth documentation describing the SDKs functions in detail, explanations of terminology, and guides on how to use AkashicPay.com, see https://docs.akashicpay.com/
Contributing
See CONTRIBUTING.md for information
License
This project is licensed under the MIT License