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.

Warning

This transaction cannot be delegated to another account.

(Requires the Sponsor amendment )

Example JSON

{
    "TransactionType": "SponsorshipTransfer",
    "Account": "rN7n7otQDd6FczFgLdlqtyMVrn3HMfXpf",
    "ObjectID": "1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF",
    "Sponsor": "rfkDkFai4jUfCvAJiZ5Vm7XvvWjYvDqeYo",
    "SponsorFlags": 2,        // spfSponsorReserve
    "Flags": 131072,          // tfSponsorshipCreate
    "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.
Note

Which of these fields you must include, and whether they are required, depends on the operation. See Sponsorship Scenarios for the exact fields each operation needs.

SponsorshipTransfer Flags

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

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

Sponsorship Scenarios

A SponsorshipTransfer transaction performs one of three operations: create, reassign, or end a sponsorship. Each is selected by its own flag (tfSponsorshipCreate, tfSponsorshipReassign, or tfSponsorshipEnd), and the fields you include and who can submit the transaction differ for each.

The tabs below describe the requirements for each operation.

Use the tfSponsorshipCreate flag to sponsor an object or account that isn't currently sponsored. 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 must be a ledger entry type that supports sponsorship. Sponsoring any other object type fails with tecNO_PERMISSION.
  • 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 object is a ledger entry type that does not support sponsorship.
  • 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.
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 SponsorFlags field is present when ending a sponsorship.
temMALFORMEDThe transaction is malformed. This can occur when:
  • The Sponsor field is missing when creating or reassigning a sponsorship.
  • The Sponsor field is present when ending a sponsorship.
  • 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.
terNO_ACCOUNTThe Sponsee field is specified when ending a sponsorship, but that account does not exist on the ledger.