Download the PHP package xrplwin/xumm-sdk-php without Composer
On this page you can find all versions of the php package xrplwin/xumm-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package xumm-sdk-php
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:
Usage
First obtain Xumm API credentials by registering your app.
Initialize the Xumm SDK in your application:
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:
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.
All versions of xumm-sdk-php with dependencies
guzzlehttp/guzzle Version ^7.4
symfony/serializer Version ^6.0
vlucas/phpdotenv Version ^5.4
symfony/property-access Version ^6.0
ratchet/pawl Version ^0.4.1
monolog/monolog Version ^2.3|^3.0
symfony/yaml Version ^6.0|^7.0