Stellar PHP SDK API Documentation

FeeBumpTransaction extends AbstractTransaction
in package

Represents a fee bump transaction

Fee bump transactions allow an account to retroactively increase the fee on a previously submitted transaction. This is useful when a transaction is stuck in the queue due to insufficient fees or when network congestion requires higher fees.

The fee bump transaction wraps an existing transaction (the inner transaction) and specifies a new, higher fee. The fee account pays the additional fee, which must be at least the minimum network fee plus the original transaction's fee.

Key Characteristics:

  • Contains an inner transaction that must already be signed
  • Specifies a fee account (can be different from inner transaction's source)
  • New fee must be higher than the inner transaction's fee
  • Fee account must sign the fee bump transaction

Use Cases:

  • Unstick transactions with low fees
  • Priority transaction processing
  • Third-party fee sponsorship

Usage: // Create a fee bump transaction $feeBump = new FeeBumpTransaction( $feeAccount, 200000, // New higher fee in stroops $innerTransaction );

// Sign and submit $feeBump->sign($feeAccountKeyPair, $network); $response = $sdk->submitTransaction($feeBump);

Tags
see
AbstractTransaction

Base transaction functionality

Transaction

The inner transaction type

FeeBumpTransactionBuilder

For building fee bump transactions

https://developers.stellar.org

Stellar developer docs

since
1.0.0

Table of Contents

Methods

__construct()  : mixed
Constructs a new FeeBumpTransaction
addSignature()  : void
Adds a signature to the transaction
fromEnvelopeBase64XdrString()  : AbstractTransaction
Creates a transaction from a base64-encoded XDR string
fromEnvelopeXdr()  : AbstractTransaction
Creates a transaction from an XDR transaction envelope
fromFeeBumpTransactionEnvelope()  : FeeBumpTransaction
Creates a fee bump transaction from its XDR envelope
getFee()  : int
Gets the fee in stroops
getFeeAccount()  : MuxedAccount
Gets the fee account
getInnerTx()  : Transaction
Gets the inner transaction
getSignatures()  : array<string|int, XdrDecoratedSignature>
Gets all signatures attached to this transaction
hash()  : string
Calculates the hash of the transaction for signing
setSignatures()  : void
Sets the signatures for this transaction
sign()  : void
Signs the transaction with the provided keypair
signatureBase()  : string
Returns the signature base for this fee bump transaction
toEnvelopeXdr()  : XdrTransactionEnvelope
Converts the fee bump transaction to XDR envelope format
toEnvelopeXdrBase64()  : string
Converts the transaction to base64-encoded XDR envelope format
toXdr()  : XdrFeeBumpTransaction
Converts the fee bump transaction to XDR format

Methods

__construct()

Constructs a new FeeBumpTransaction

public __construct(MuxedAccount $feeAccount, int $fee, Transaction $innerTx) : mixed
Parameters
$feeAccount : MuxedAccount

The account paying the fee (can be muxed)

$fee : int

The new fee in stroops (must be higher than inner transaction fee)

$innerTx : Transaction

The inner transaction to bump

fromEnvelopeBase64XdrString()

Creates a transaction from a base64-encoded XDR string

public static fromEnvelopeBase64XdrString(string $envelope) : AbstractTransaction
Parameters
$envelope : string

Base64-encoded XDR transaction envelope

Tags
throws
InvalidArgumentException

If the XDR is invalid or the envelope cannot be converted to a transaction

Return values
AbstractTransaction —

The decoded transaction (Transaction or FeeBumpTransaction)

fromFeeBumpTransactionEnvelope()

Creates a fee bump transaction from its XDR envelope

public static fromFeeBumpTransactionEnvelope(XdrFeeBumpTransactionEnvelope $envelope) : FeeBumpTransaction
Parameters
$envelope : XdrFeeBumpTransactionEnvelope

The fee bump envelope to convert

Tags
throws
InvalidArgumentException

If the envelope carries no ENVELOPE_TYPE_TX inner transaction

Return values
FeeBumpTransaction —

The fee bump transaction with its inner transaction and signatures

getFee()

Gets the fee in stroops

public getFee() : int
Return values
int —

The fee amount in stroops

hash()

Calculates the hash of the transaction for signing

public hash(Network $network) : string
Parameters
$network : Network

The network for which to calculate the hash

Return values
string —

The transaction hash

sign()

Signs the transaction with the provided keypair

public sign(KeyPair $signer, Network $network) : void
Parameters
$signer : KeyPair

The keypair used to sign the transaction (must have private key)

$network : Network

The network for which this transaction is intended

Tags
throws
InvalidArgumentException

If the signer does not have a private key

signatureBase()

Returns the signature base for this fee bump transaction

public signatureBase(Network $network) : string
Parameters
$network : Network

The network for which to generate the signature base

Tags
throws
Exception

If inner transaction is not signed

Return values
string —

The signature base bytes

toEnvelopeXdrBase64()

Converts the transaction to base64-encoded XDR envelope format

public toEnvelopeXdrBase64() : string
Return values
string —

Base64-encoded XDR transaction envelope

On this page

Search results