Download the PHP package soneso/stellar-php-sdk without Composer

On this page you can find all versions of the php package soneso/stellar-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?
soneso/stellar-php-sdk
Rate from 1 - 5
Rated 5.00 based on 1 reviews

Informations about the package stellar-php-sdk

Stellar SDK for PHP

v1.6.1

The Soneso open source Stellar SDK for PHP provides APIs to build and sign transactions, connect and query Horizon.

Installation

Quick Start

1. Create a Stellar key pair

Random generation

2. Create an account

After the key pair generation, you have already got the address, but it is not activated until someone transfers at least 1 lumen into it.

2.1 Testnet

If you want to play in the Stellar test network, the SDK can ask Friendbot to create an account for you as shown below:

2.2 Public net

On the other hand, if you would like to create an account in the public net, you should buy some Stellar Lumens (XLM) from an exchange. When you withdraw the Lumens into your new account, the exchange will automatically create the account for you. However, if you want to create an account from another account of your own, you may run the following code:

3. Check account

3.1 Basic info

After creating the account, we may check the basic information of the account.

3.2 Check payments

You can check the payments connected to an account:

You can use:limit, order, and cursor to customize the query. Get the most recent payments for accounts, ledgers and transactions.

Horizon has SSE support for push data. You can use it like this:

see also stream payments example

3.3 Check others

Just like payments, you can check assets, transactions, effects, offers, operations, ledgers etc.

4. Building and submitting transactions

Example "send native payment":

Documentation and Examples

Examples

Example Description Documentation
Create a new account A new account is created by another account. In the testnet we can also use Freindbot. Create account
Send native payment A sender sends 100 XLM (Stellar Lumens) native payment to a receiver. Payments
Trustlines Creates, updates, and deletes a trustline. Change Trust and Assets documentation
Send tokens - non native payment Two accounts trust the same issuer account and custom token. They can now send this custom tokens to each other. Assets & Trustlines and Change trust and Payments
Path payments Two accounts trust different custom tokens. The sender wants to send token "IOM" but the receiver wants to receive token "ECO". Path payment strict send and Path payment strict receive
Merge accounts Merge one account into another. The first account is removed, the second receives the funds. Account merge
Bump sequence number In this example we will bump the sequence number of an account to a higher number. Bump sequence number
Manage data Sets, modifies, or deletes a data entry (name/value pair) that is attached to a particular account. Manage data
Manage buy offer Creates, updates, or deletes an offer to buy one asset for another, otherwise known as a "bid" order on a traditional orderbook. Manage buy offer
Manage sell offer Creates, updates, or deletes an offer to sell one asset for another, otherwise known as a "ask" order or “offer” on a traditional orderbook. Manage sell offer
Create passive sell offer Creates, updates and deletes an offer to sell one asset for another, otherwise known as a "ask" order or “offer” on a traditional orderbook, without taking a reverse offer of equal price. Create passive sell offer
Allow trust Updates the authorized flag of an existing trustline. Allow trust and Assets documentation
Fee bump transaction Fee bump transactions allow an arbitrary account to pay the fee for a transaction. Fee bump transactions
Muxed accounts In this example we will see how to use a muxed account in a payment operation. First-class multiplexed accounts
Stream payments Listens for payments received by a given account. Streaming
SEP-0001: stellar.toml In this example you can find out how to obtain data about an organization’s Stellar integration. SEP-0001
SEP-0002: Federation This example shows how to resolve a stellar address, a stellar account id, a transaction id and a forward by using the federation protocol. SEP-0002
SEP-0005: Key derivation In this examples you can see how to generate 12 or 24 words mnemonics for different languages using the PHP SDK, how to generate key pairs from a mnemonic (with and without BIP 39 passphrase) and how to generate key pairs from a BIP 39 seed. SEP-0005
SEP-0006: Deposit and Withdrawal API In this examples you can see how to use the sdk to communicate with anchors. SEP-0006
SEP-0007: URI Scheme to facilitate delegated signing In this examples you can see how to use the sdk to support SEP-0007 in your wallet or server. SEP-0007
SEP-0008: Regulated Assets In this example you can see how to use the sdk to support Regulated Assets in your wallet. SEP-0008
SEP-0010: Stellar Web Authentication This example shows how to authenticate with any web service which requires a Stellar account ownership verification. SEP-0010
SEP-0011: Txrep This example shows how to to generate Txrep (human-readable low-level representation of Stellar transactions) from a transaction and how to create a transaction object from a Txrep string. SEP-0011
SEP-0012: KYC API In this examples you can see how to use the sdk to send KYC data to anchors and other services. SEP-0012
SEP-0024: Hosted Deposit and Withdrawal In this examples you can see how to interact with anchors in a standard way defined by SEP-0024. SEP-0024
SEP-0030: Account Recovery In this examples you can see how to recover accounts as defined by SEP-0030. SEP-0030
SEP-0038: Quotes In this examples you can learn how to get quotes as defined by SEP-0038. SEP-0038
SEP-0031: Cross Border Payments In this examples you can learn how to make cross border payments as a Sending Anchor as defined by SEP-0031 SEP-0031

More examples can be found in the tests.

SEPs implemented

Soroban support

This SDK provides support for Soroban.


All versions of stellar-php-sdk with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ~7.3
christian-riesen/base32 Version ~1.6
paragonie/sodium_compat Version ~1.17
phpseclib/phpseclib Version ^3.0
yosymfony/toml Version ~1.0
ext-bcmath Version *
ext-pcntl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package soneso/stellar-php-sdk contains the following files

Loading the files please wait ....