xrplwin/xumm-sdk-php
Composer 安装命令:
composer require xrplwin/xumm-sdk-php
包简介
A PHP SDK for Xumm by XRPLabs.
README 文档
README
Xumm SDK (PHP)
This is fork of this repo
Requirements
- PHP 8.2 or higher
- Composer
- Docker and docker compose if you want to run acceptance tests
Installation
To install, run:
composer require xrplwin/xumm-sdk-php
Usage
First obtain Xumm API credentials by registering your app.
Initialize the Xumm SDK in your application:
// Either pass API credentials through the constructor $sdk = new XummSdk($apiKey, $apiSecret); // Or set them as environment variables. See .env.example for the expected variable names. // Note: the .env file is mostly applicable when contributing to the SDK itself. $sdk = XummSdk();
Each call on the SDK object will return a corresponding value object implementing the XummResponse interface.
Create a payload
To create a payload, pass an instance of Xrpl\XummSdkPhp\Payload to XummSdk::createPayload(). This instance
should hold an associative array transactionBody, and can hold some options and custom metadata. For more
elaborate documentation on how to construct a payload, please refer to
the API docs.
A simple example could look like this:
$sdk->createPayload( new Payload( transactionBody: [ 'TransactionType' => 'Payment', 'Destination' => 'rPdvC6ccq8hCdPKSPJkPmyZ4Mi1oG2FFkT', 'Fee' => '12' ], customMeta: new CustomMeta(identifier: 'my-custom-identifier'), ) );
This will return an instance of Xrpl\XummSdkPhp\Response\CreatePayload\CreatedPayload.
Subscribe to a payload
After you create a payload, you can pass the returned CreatedPayload to XummSdk::subscribe() to subscribe to live
payload status changes. This returns an instance of Xrpl\XummSdkPhp\Subscriber\Subscription.
Changes to a payload status include:
- The payload was by a XUMM App user (web page)
- The payload was by a XUMM App user (in the app)
- Payload expiration updates (remaining time in seconds)
- The payload was resolved by rejecting
- The payload was resolved by accepting (signing)
Status updates can be handled by passing a callback function as a second argument to XummSdk::subscribe.
The subscription ends by either:
- returning non-void from the callback function, or
- explicitly calling
Subscription::end().
Other methods
The SDK also supports the XUMM API's helper methods, such as ping, getCuratedAssets, and getRates. Again, these
will all return corresponding implementations of XummResponse.
Contributing
For contributing to development of this package, refer to CONTRIBUTING.md.
xrplwin/xumm-sdk-php 适用场景与选型建议
xrplwin/xumm-sdk-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 01 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「ripple」 「xrp」 「xrpl」 「xumm」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 xrplwin/xumm-sdk-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 xrplwin/xumm-sdk-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 xrplwin/xumm-sdk-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Bitcoin and Altcoin Payment Gateway for Magento 2 via CoinGate
PHP SDK / Client for the XRP Ledger
Parse XRPL transaction and extracts all participating accounts.
Transaction Hook parser for hook-enabled XRPL/Xahau networks.
Parse XRPL transaction to context aware object.
Parse XRPL NFT transaction to context aware object providing direction, token id and roles.
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 31
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-12