承接 akashic/akashic-pay 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

akashic/akashic-pay

最新稳定版本:v1.19.1

Composer 安装命令:

composer require akashic/akashic-pay

包简介

A library to interact with the AkashicChain network, written in PHP.

README 文档

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

  1. Create an account on AkashicLink (Google Chrome Extension or iPhone/Android App)
  2. Visit AkashicPay and connect with AkashicLink. Set up the URL you wish to receive callbacks for.
  3. 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 preprod 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

统计信息

  • 总下载量: 158
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-09-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固