DeployFromExternalRefRequest

public final class DeployFromExternalRefRequest : Sendable

Request parameters for deploying a Soroban smart contract instance from a CAP-85 external reference (protocol >= 28).

The executable is not a wasm hash: it names an owner contract and a tag, and the owner holds a persistent contract data entry under that tag whose value is the 32-byte hash of an already uploaded wasm. The created instance runs that code. Nothing is installed as part of the deployment; the owner contract already holds the tag entry.

See also:

  • [SorobanClient.deployFromExternalRef] for the deployment method that uses this request
  • [DeployRequest] for deploying from an installed wasm hash
  • The URL of the RPC instance that will be used to deploy the contract.

    Declaration

    Swift

    public let rpcUrl: String
  • The Stellar network this contract is to be deployed

    Declaration

    Swift

    public let network: Network
  • Keypair of the Stellar account that will send this transaction. The keypair must contain the private key for signing.

    Declaration

    Swift

    public let sourceAccountKeyPair: KeyPair
  • The contract holding the executable tag entry the new instance runs (“C…” strkey or the 64 character hex of the 32 byte id).

    Declaration

    Swift

    public let executableOwner: String
  • tag

    The tag the owner holds the executable entry under; matched byte for byte. An executable tag is an XDR string and may carry arbitrary bytes, so the canonical representation is Data; for a text tag use the tag: String initializer, which stores the tag as the UTF-8 bytes of the text.

    Declaration

    Swift

    public let tag: Data
  • Constructor/Initialization Args for the contract’s __constructor method.

    Declaration

    Swift

    public let constructorArgs: [SCValXDR]?
  • Salt used to generate the contract’s ID. Default: random.

    Declaration

    Swift

    public let salt: WrappedData32?
  • Method options used to fine tune the transaction.

    Declaration

    Swift

    public let methodOptions: MethodOptions
  • Enable soroban server logging (helpful for debugging). Default: false.

    Declaration

    Swift

    public let enableServerLogging: Bool
  • Optional URL session used for every RPC request of the deployment. Defaults to URLSession/shared when nil; see init(endpoint:urlSession:). The SDK does not invalidate an injected session.

    Declaration

    Swift

    public let urlSession: URLSession?
  • Constructor

    Declaration

    Swift

    public init(rpcUrl: String, network: Network, sourceAccountKeyPair: KeyPair, executableOwner: String, tag: Data, constructorArgs: [SCValXDR]? = nil, salt: WrappedData32? = nil, methodOptions: MethodOptions = MethodOptions(), enableServerLogging: Bool, urlSession: URLSession? = nil)

    Parameters

    rpcUrl

    The URL of the RPC instance that will be used to deploy the contract.

    network

    The Stellar network this contract is to be deployed.

    sourceAccountKeyPair

    Keypair of the Stellar account that will send this transaction. The keypair must contain the private key for signing.

    executableOwner

    The contract holding the executable tag entry (“C…” strkey or the 64 character hex of the 32 byte id).

    tag

    The tag the owner holds the executable entry under; matched byte for byte.

    constructorArgs

    Constructor/Initialization Args for the contract’s __constructor method.

    salt

    Salt used to generate the contract’s ID. Default: random.

    methodOptions

    Method options used to fine tune the transaction.

    enableServerLogging

    Enable soroban server logging (helpful for debugging). Default: false.

    urlSession

    Optional URL session used for every RPC request. Defaults to URLSession/shared when nil; see init(endpoint:urlSession:).

  • Constructor for a text tag. Stores tag as the UTF-8 bytes of the given text; the entry is still matched byte for byte against those bytes.

    Declaration

    Swift

    public convenience init(rpcUrl: String, network: Network, sourceAccountKeyPair: KeyPair, executableOwner: String, tag: String, constructorArgs: [SCValXDR]? = nil, salt: WrappedData32? = nil, methodOptions: MethodOptions = MethodOptions(), enableServerLogging: Bool, urlSession: URLSession? = nil)

    Parameters

    rpcUrl

    The URL of the RPC instance that will be used to deploy the contract.

    network

    The Stellar network this contract is to be deployed.

    sourceAccountKeyPair

    Keypair of the Stellar account that will send this transaction. The keypair must contain the private key for signing.

    executableOwner

    The contract holding the executable tag entry (“C…” strkey or the 64 character hex of the 32 byte id).

    tag

    The tag the owner holds the executable entry under, stored as its UTF-8 bytes.

    constructorArgs

    Constructor/Initialization Args for the contract’s __constructor method.

    salt

    Salt used to generate the contract’s ID. Default: random.

    methodOptions

    Method options used to fine tune the transaction.

    enableServerLogging

    Enable soroban server logging (helpful for debugging). Default: false.

    urlSession

    Optional URL session used for every RPC request. Defaults to URLSession/shared when nil; see init(endpoint:urlSession:).