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 )
{
"TransactionType": "SponsorshipTransfer",
"Account": "rN7n7otQDd6FczFgLdlqtyMVrn3HMfXpf",
"ObjectID": "1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF",
"Flags": 2,
"Fee": "12",
"Sequence": 43
}In addition to the common fields, SponsorshipTransfer transactions use the following fields:
| Field Name | JSON Type | Internal Type | Required? | Description |
|---|---|---|---|---|
ObjectID | String | Hash256 | No | The 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. |
Sponsee | String | AccountID | No | The 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 transactions support additional values in the Flags field, as follows:
| Flag Name | Hex Value | Decimal Value | Description |
|---|---|---|---|
tfSponsorshipEnd | 0x00000001 | 1 | End an existing sponsorship. The reserve burden returns to the object's owner. |
tfSponsorshipCreate | 0x00000002 | 2 | Create a new sponsorship for an unsponsored object or account. |
tfSponsorshipReassign | 0x00000004 | 4 | Transfer an existing sponsorship to a new sponsor. |
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
ObjectIDfield when sponsoring an object. Omit when sponsoring an account. - The target object or account must not currently be sponsored.
- Provide the
Sponsorfield and theSponsorFlags.spfSponsorReserveflag. - Include the
SponsorSignaturewhen sponsoring an account. This is optional when sponsoring an object. - Do not include the
Sponseefield.
When successful:
- The
Sponsorfield is set on the object or account. - The new sponsor's
SponsoringOwnerCountorSponsoringAccountCountis incremented. - For objects, the owner's
SponsoredOwnerCountis also incremented.
Besides errors that can occur for all transactions, SponsorshipTransfer transactions can result in the following transaction result codes:
| Error Code | Description |
|---|---|
tecINSUFFICIENT_RESERVE | The owner or new sponsor does not have sufficient XRP to cover the reserve for this object or account. |
tecNO_ENTRY | The ObjectID is specified but does not exist on the ledger. |
tecNO_PERMISSION | The transaction lacks the required permissions. This can occur when:
|
temINVALID_FLAG | The transaction has invalid flags. This can occur when:
|
temMALFORMED | The transaction is malformed. This can occur when:
|