Skip to content

SponsorshipSet

[Source]

Create, update, or delete a Sponsorship ledger entry on the XRP Ledger.

Warning

This transaction requires that you specify either the CounterpartySponsor or Sponsee, but not both.

(Requires the Sponsor amendment )

Example JSON

{
  "TransactionType": "SponsorshipSet",
  "Account": "rN7n7otQDd6FczFgLdlqtyMVrn3HMfXpf",
  "Sponsee": "rfkDkFai4jUfCvAJiZ5Vm7XvvWjYvDqeYo",
  "FeeAmount": "1000000",
  "MaxFee": "1000",
  "RemainingOwnerCount": 5,
  "Fee": "12",
  "Sequence": 42
}

SponsorshipSet Fields

In addition to the common fields, SponsorshipSet transactions use the following fields:

Field NameJSON TypeInternal TypeRequired?Description
CounterpartySponsorStringAccountIDNoThe sponsor associated with this relationship. This account also pays for the reserve of this entry. If this field is included, the Account is assumed to be the sponsee.
FeeAmountStringAmountNoThe remaining amount of XRP that the sponsor has provided for the sponsee to use for fees. This value replaces what is currently in the Sponsorship.FeeAmount field, if it exists, rather than adding to it. Raising FeeAmount deducts the additional XRP from the sponsor, while lowering it refunds the difference back to the sponsor.
MaxFeeStringAmountNoThe maximum fee per transaction that will be sponsored. This prevents abuse or excessive draining of the sponsored fee pool.
RemainingOwnerCountNumberUInt32NoThe remaining amount of reserves that the sponsor has provided for the sponsee to use. This value replaces what is currently in the Sponsorship.RemainingOwnerCount field, if it exists.
SponseeStringAccountIDNoThe sponsee associated with this relationship. If this field is included, the Account is assumed to be the sponsor.

A sponsorship entry must keep at least some fee budget (FeeAmount) or reserve budget (RemainingOwnerCount). If you try to create or update the entry with neither, the transaction fails, because an empty entry still consumes an owner reserve while giving the sponsee nothing to draw on.

SponsorshipSet Flags

SponsorshipSet transactions support additional values in the Flags field, as follows:

Flag NameHex ValueDecimal ValueDescription
tfSponsorshipSetRequireSignForFee0x0001000065536Adds the restriction that every use of this sponsor for sponsoring fees requires a signature from the sponsor.
tfSponsorshipClearRequireSignForFee0x00020000131072Removes the restriction that every use of this sponsor for sponsoring fees requires a signature from the sponsor.
tfSponsorshipSetRequireSignForReserve0x00040000262144Adds the restriction that every use of this sponsor for sponsoring reserves requires a signature from the sponsor.
tfSponsorshipClearRequireSignForReserve0x00080000524288Removes the restriction that every use of this sponsor for sponsoring reserves requires a signature from the sponsor.
tfDeleteObject0x001000001048576Deletes the Sponsorship ledger entry. When enabled, no other fields (except Sponsee and CounterpartySponsor) or flag-setting fields may be specified. Deleting returns any remaining XRP in FeeAmount to the sponsor's account.

Deleting a Sponsorship Ledger Entry

To delete a Sponsorship ledger entry, the sponsor or sponsee submits a SponsorshipSet transaction with the tfDeleteObject flag enabled. Any remaining XRP in FeeAmount is returned to the sponsor's account upon deletion.

Deleting the Sponsorship entry only removes the pre-funded fee and reserve arrangement between the sponsor and sponsee. Ledger entries that were previously created using sponsored reserves retain their Sponsor field and remain sponsored. To transfer or dissolve sponsorship for those existing ledger entries, use the SponsorshipTransfer transaction.

Error Cases

Besides errors that can occur for all transactions, SponsorshipSet transactions can result in the following transaction result codes:

Error CodeDescription
tecNO_DSTThe sponsor or sponsee account does not exist on the ledger.
tecNO_ENTRYThe tfDeleteObject flag is enabled but the Sponsorship ledger entry does not exist.
tecNO_PERMISSIONThe transaction is not permitted. This can occur when:
  • Creating or updating the entry would leave it with no budget (neither a positive FeeAmount nor a positive RemainingOwnerCount). Empty Sponsorship ledger entries are not allowed.
  • The sponsor or sponsee is a pseudo-account, which cannot participate in sponsorship.
tecUNFUNDEDThe sponsor does not have sufficient XRP to fund the FeeAmount or to cover the reserve for the Sponsorship ledger entry.
temBAD_AMOUNTAn amount field is invalid. This can occur when:
  • FeeAmount is negative or not denominated in XRP.
  • MaxFee is negative or not denominated in XRP.
temINVALID_FLAGThe transaction has invalid flags. This can occur when:
  • Conflicting flags are enabled, such as both tfSponsorshipSetRequireSignForFee and tfSponsorshipClearRequireSignForFee.
  • The tfDeleteObject flag is enabled along with additional flags. tfDeleteObject must be the only flag.
temMALFORMEDThe transaction is malformed. This can occur when:
  • The Account is not equal to either the sponsor or sponsee.
  • Both CounterpartySponsor and Sponsee are specified.
  • Neither CounterpartySponsor nor Sponsee is specified.
  • The sponsee attempts to create or update the entry. Only the sponsor can create or update.
  • The tfDeleteObject flag is enabled and FeeAmount, MaxFee, or RemainingOwnerCount is specified.
  • The sponsor and sponsee are the same account.