Stellar PHP SDK API Documentation

DeploySACWithSourceAccountHostFunction extends HostFunction
in package

Represents a Soroban host function for deploying a Stellar Asset Contract from a source account

This host function deploys a Stellar Asset Contract (SAC) for the native asset (XLM) controlled by a specific source account. Unlike DeploySACWithAssetHostFunction which deploys for existing Stellar assets, this variant creates a SAC tied to an account's identity.

The deployment uses:

  • A source account address (the account that controls the asset)
  • A salt value for deterministic address generation

This is useful for creating wrapped native asset contracts where the issuing account wants control over the SAC deployment.

Usage: // Deploy SAC with source account $address = Address::fromAccountId("GABC..."); $hostFunction = new DeploySACWithSourceAccountHostFunction($address);

// Deploy with specific salt for reproducibility $hostFunction = new DeploySACWithSourceAccountHostFunction($address, $salt);

// Use in an InvokeHostFunctionOperation $operation = (new InvokeHostFunctionOperationBuilder($hostFunction))->build();

Tags
see
HostFunction

Base class for all host functions

see
DeploySACWithAssetHostFunction

For deploying SACs for existing assets

see
Address

For address handling

see
https://developers.stellar.org

Stellar developer docs

since
1.0.0

Table of Contents

Properties

$address  : Address
$salt  : string

Methods

__construct()  : mixed
Constructs a new DeploySACWithSourceAccountHostFunction
fromXdr()  : DeploySACWithSourceAccountHostFunction
Creates a DeploySACWithSourceAccountHostFunction from XDR format
getAddress()  : Address
Gets the source account address
getSalt()  : string
Gets the salt value
setAddress()  : void
Sets the source account address
setSalt()  : void
Sets the salt value
toXdr()  : XdrHostFunction
Converts the deploy SAC host function to XDR format

Properties

Methods

__construct()

Constructs a new DeploySACWithSourceAccountHostFunction

public __construct(Address $address[, string|null $salt = null ]) : mixed
Parameters
$address : Address

The source account address

$salt : string|null = null

Optional salt (32 random bytes generated if not provided)

Tags
throws
Exception

If random bytes generation fails


        
On this page

Search results