xrpl
    Preparing search index...

    Function signAsSponsor

    • Signs a transaction as the sponsor.

      This function adds a sponsor signature to a transaction that has already been signed by the account. The sponsor uses their wallet to sign the transaction, which allows them to pay the transaction fees and/or reserves on behalf of the sponsee (the Account field).

      Parameters

      • wallet: Wallet

        The sponsor's wallet used for signing the transaction.

      • transaction: string | Transaction

        The transaction to sign as sponsor. Can be either:

        • A transaction object that has been signed by the account
        • A serialized transaction blob (string) in hex format
      • opts: { multisign?: string | boolean } = {}

        (Optional) Options for signing the transaction.

        • Optionalmultisign?: string | boolean

          Specify true/false to use multisign or actual address (classic/x-address) to make multisign tx request. The actual address is only needed in the case of regular key usage.

      Returns { hash: string; tx: Transaction; tx_blob: string }

      An object containing:

      • tx: The signed transaction object with SponsorSignature
      • tx_blob: The serialized transaction blob (hex string) ready to submit to the ledger
      • hash: The transaction hash (useful for tracking the transaction)

      If:

      • The transaction is already signed by the sponsor
      • The transaction has not been signed by the account yet
      • The transaction fails validation