soneso/stellar-php-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

soneso/stellar-php-sdk

Composer 安装命令:

composer require soneso/stellar-php-sdk

包简介

Stellar PHP SDK for the Stellar Network

README 文档

README

Latest Stable Version Total Downloads codecov Ask DeepWiki

Build and sign Stellar transactions, query Horizon, and interact with Soroban smart contracts via RPC. Communicate with anchors and external services using built-in support for 19 SEPs.

Installation

composer require soneso/stellar-php-sdk

Requires PHP 8.0+.

Quick examples

Send a payment

Transfer XLM between accounts:

$payment = (new PaymentOperationBuilder($receiverId, Asset::native(), '100'))->build();
$tx = (new TransactionBuilder($account))->addOperation($payment)->build();
$tx->sign($senderKeyPair, Network::testnet());
$sdk->submitTransaction($tx);

Trust an asset

Enable your account to receive a token (like USDC):

$asset = Asset::createNonNativeAsset('USDC', $issuerAccountId);
$trustOp = (new ChangeTrustOperationBuilder($asset))->build();
$tx = (new TransactionBuilder($account))->addOperation($trustOp)->build();
$tx->sign($accountKeyPair, Network::testnet());
$sdk->submitTransaction($tx);

Call a smart contract

Invoke a Soroban contract method:

$client = SorobanClient::forClientOptions(new ClientOptions(
    sourceAccountKeyPair: $keyPair,
    contractId: 'CABC...',
    network: Network::testnet(),
    rpcUrl: 'https://soroban-testnet.stellar.org'
));
$result = $client->invokeMethod('hello', [XdrSCVal::forSymbol('World')]);

For complete walkthroughs, see the documentation.

Agent Skill

This repository includes an Agent Skill that teaches AI coding agents how to use this SDK. See skills/ for installation instructions.

Documentation

Guide Description
Quick start Your first transaction in 15 minutes
Getting started Keys, accounts, and fundamentals
SDK usage Transactions, operations, Horizon queries, streaming
Soroban Smart contract deployment and interaction
SEPs Anchor integration, authentication, KYC, etc.

API reference

Compatibility

Feedback

If you're using this SDK, feedback helps improve it:

Contributing

See CONTRIBUTING.md for guidelines.

License

Apache 2.0. See LICENSE.

统计信息

  • 总下载量: 53.51k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 41
  • 点击次数: 9
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 41
  • Watchers: 12
  • Forks: 20
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2021-12-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固