Skip to content

SponsorshipTransfer

[Source]

Create, transfer, or end reserve sponsorship for a ledger object or account. The transaction can be submitted by the sponsor or sponsee, depending on the required operation. See Sponsorship Scenarios for details on each operation.

(Requires the Sponsor amendment )

Example JSON

{
    "TransactionType": "SponsorshipTransfer",
    "Account": "rN7n7otQDd6FczFgLdlqtyMVrn3HMfXpf",
    "ObjectID": "1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF",
    "Flags": 2,
    "Fee": "12",
    "Sequence": 43
}

SponsorshipTransfer Fields

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

Field NameJSON TypeInternal TypeRequired?Description
ObjectIDStringHash256NoThe ID of the ledger object to transfer sponsorship. Required if the transaction is dealing with a sponsored object, rather than a sponsored account. If omitted, the transaction refers to the Account sending the transaction.
SponseeStringAccountIDNoThe wallet address of the sponsee account. Required if the sponsor is ending a sponsorship on behalf of a sponsee. If omitted, the Account field is assumed to be the sponsee.

SponsorshipTransfer Flags

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

Flag NameHex ValueDecimal ValueDescription
tfSponsorshipEnd0x000000011End an existing sponsorship. The reserve burden returns to the object's owner.
tfSponsorshipCreate0x000000022Create a new sponsorship for an unsponsored object or account.
tfSponsorshipReassign0x000000044Transfer an existing sponsorship to a new sponsor.

Sponsorship Scenarios

Use the tfSponsorshipCreate flag to sponsor an object or account. Only the sponsee can submit the transaction with this configuration. The reserve sponsorship transfers to the account specified in the Sponsor field.

To submit a transaction for this scenario:

  • Include the ObjectID field when sponsoring an object. Omit when sponsoring an account.
  • The target object or account must not currently be sponsored.
  • Provide the Sponsor field and the SponsorFlags.spfSponsorReserve flag.
  • Include the SponsorSignature when sponsoring an account. This is optional when sponsoring an object.
  • Do not include the Sponsee field.

When successful:

  • The Sponsor field is set on the object or account.
  • The new sponsor's SponsoringOwnerCount or SponsoringAccountCount is incremented.
  • For objects, the owner's SponsoredOwnerCount is also incremented.

Error Cases

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

Error CodeDescription
tecINSUFFICIENT_RESERVEThe owner or new sponsor does not have sufficient XRP to cover the reserve for this object or account.
tecNO_ENTRYThe ObjectID is specified but does not exist on the ledger.
tecNO_PERMISSIONThe transaction lacks the required permissions. This can occur when:
  • The submitter is not the current sponsor or owner when ending a sponsorship.
  • The submitter is not the owner when creating or reassigning a sponsorship.
  • The object or account is already sponsored when creating a sponsorship.
  • The object or account is not sponsored when reassigning or ending a sponsorship.
  • The Sponsor field is missing when creating or reassigning a sponsorship.
  • The Sponsor field is present when ending a sponsorship.
temINVALID_FLAGThe transaction has invalid flags. This can occur when:
  • The transaction does not have exactly one of tfSponsorshipCreate, tfSponsorshipReassign, or tfSponsorshipEnd set.
  • The spfSponsorReserve flag is missing when creating or reassigning a sponsorship.
  • The spfSponsorReserve flag is present when ending a sponsorship.
temMALFORMEDThe transaction is malformed. This can occur when:
  • The Sponsee field is present when creating or reassigning a sponsorship.
  • The Sponsee field is the same as the Account field.
  • Sponsoring an account without providing the SponsorSignature field.