stellar-php-sdk

Generate PHP code for Stellar transactions, Horizon queries, and Soroban RPC calls.

41|20|Updated Aug 15, 2021
One-click install
npx skills add https://github.com/Soneso/stellar-php-sdk --skill stellar-php-sdk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stellar-php-sdk
Source: https://github.com/Soneso/stellar-php-sdk/tree/main/skills/stellar-php-sdk
Command: npx skills add https://github.com/Soneso/stellar-php-sdk --skill stellar-php-sdk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It removes the repetitive work of wiring together Stellar transaction building, XDR encoding, Horizon queries, and Soroban RPC calls so you can focus on application logic.

Core Features & Use Cases

  • Transaction lifecycle automation in PHP: build transactions and operations, sign with network passphrases, serialize to XDR/base64, and submit to Horizon synchronously.
  • Horizon API coverage + streaming: query accounts, transactions, operations, effects, offers, trades, and ledgers with pagination, plus SSE streaming for real-time updates.
  • Soroban contract workflows via RPC: deploy and invoke smart contracts with typed RPC methods, simulation, and event/ledger introspection.
  • SEP protocol integrations: support key SEP flows such as SEP-01 discovery, SEP-02 federation, SEP-05 derivation, SEP-07 URI scheme signing, and SEP-08 regulated-asset approval flows.

Quick Start

Ask the AI to generate PHP code that builds a testnet payment from a provided source account to a destination account, signs it, submits it to Horizon, and prints the transaction hash.

Frequently Asked Questions about stellar-php-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build and submit a Stellar transaction in PHP?

You can build a Stellar transaction in PHP by using typed builders to create operations, sign with network passphrases, serialize to XDR/base64, and submit it synchronously to Horizon. This generates production-ready code for the full transaction lifecycle.

Can I use PHP to query accounts and stream transactions from the Horizon API?

Yes, you can query accounts, transactions, and ledgers from the Horizon API in PHP with pagination support. It enables SSE streaming consumption for real-time Stellar network updates using synchronous Guzzle-based HTTP patterns.

Does the PHP Stellar SDK support Soroban smart contract RPC calls?

Yes, the PHP Stellar SDK supports Soroban smart contract workflows via RPC. You can deploy and invoke smart contracts using typed RPC methods, simulation, and event or ledger introspection for Soroban network interactions.

What PHP environment is required for Stellar transaction building and XDR serialization?

Stellar transaction building and XDR serialization require PHP 8.0+ with specific extensions installed. The implementation uses synchronous Guzzle-based HTTP patterns within the soneso/stellar-php-sdk namespace for transaction, query, and RPC lifecycles.

How do SEP integrations like federation and URI scheme signing work in PHP?

SEP integrations in PHP support key Stellar flows including SEP-01 discovery, SEP-02 federation, SEP-05 key derivation, SEP-07 URI scheme signing, and SEP-08 regulated-asset approval. These protocols are implemented using typed builders within the SDK.

What is the best way to handle XDR base64 roundtrips for Stellar operations in PHP?

The best way to handle XDR base64 roundtrips for Stellar operations in PHP is using typed builders that serialize and deserialize transaction data. This ensures production-ready encoding for submitting operations synchronously to Horizon.