> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portalhq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# transferAndSubmit

> Transfers tokens using delegated authority and signs and broadcasts the resulting transaction(s) in one call, returning the submitted transaction hashes.

**Function Signature**

```swift theme={null}
public func transferAndSubmit(
    request: TransferFromRequest,
    options: DelegationSubmitOptions
) async throws -> DelegationSubmitResult

// Convenience overload, using the signer Portal already installed for you
public func transferAndSubmit(
    request: TransferFromRequest
) async throws -> DelegationSubmitResult
```

**Description**

Builds the transfer transaction(s) for a delegated transfer, then signs and broadcasts each one sequentially and returns the resulting transaction hashes. Your wallet must already be an approved delegate for `fromAddress`, and the amount must not exceed the approved allowance. This replaces calling `transferFrom` and signing the returned transactions yourself.

<Warning>
  `transferAndSubmit` broadcasts each transaction and returns as soon as it is accepted by the network. It **does not wait for on-chain confirmation**. A hash in `DelegationSubmitResult.hashes` means the transaction was submitted, not that it succeeded — the transfer can still revert, for example if the allowance is insufficient. Wait for the receipt yourself before treating the tokens as moved.
</Warning>

**Parameters**

| Parameter | Type                      | Required | Description                                                                                                 |
| --------- | ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------- |
| `request` | `TransferFromRequest`     | Yes      | The delegated transfer to build and submit.                                                                 |
| `options` | `DelegationSubmitOptions` | No       | Per-call signer override and progress callback. Omit the argument entirely to use the convenience overload. |

`TransferFromRequest`:

| Parameter     | Type     | Required | Description                                                                                  |
| ------------- | -------- | -------- | -------------------------------------------------------------------------------------------- |
| `chain`       | `String` | Yes      | CAIP-2 chain ID, for example `eip155:11155111` or `solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1`. |
| `token`       | `String` | Yes      | Token symbol or contract address, for example `USDC`.                                        |
| `fromAddress` | `String` | Yes      | The token owner's address — the account that approved the delegation.                        |
| `toAddress`   | `String` | Yes      | The recipient's address.                                                                     |
| `amount`      | `String` | Yes      | The amount to transfer, for example `0.01`.                                                  |

`DelegationSubmitOptions`:

| Parameter                | Type                                    | Required | Description                                                                                                                                               |
| ------------------------ | --------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `signAndSendTransaction` | `DelegationSignAndSend?`                | No       | Per-call signer override. Takes priority over the instance signer set with `setSignAndSendTransaction(_:)`.                                               |
| `onProgress`             | `((DelegationSubmitProgress) -> Void)?` | No       | Called as each transaction is signed and submitted. `progress.step` is `.signing` or `.submitted`, and `progress.hash` is populated only on `.submitted`. |

**Returns**

A `DelegationSubmitResult` containing:

| Field    | Type       | Description                                                                        |
| -------- | ---------- | ---------------------------------------------------------------------------------- |
| `hashes` | `[String]` | One hash per broadcast transaction, in submission order. Submitted, not confirmed. |

**Throws**

| Error                                                     | When                                                                                                                                                |
| --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DelegationsError.noSignerConfigured`                     | No signer was available. This cannot happen on `portal.delegations`, which `Portal` wires for you — only when you construct `Delegations` yourself. |
| `DelegationsError.noTransactions`                         | The transfer response contained no transactions to submit.                                                                                          |
| `DelegationsError.invalidTransactionHash(index:chainId:)` | The signer returned a value that is not a usable hash for that chain. `index` identifies which transaction in the sequence it was.                  |
| `URLError` and decoding errors                            | The request to build the transfer failed.                                                                                                           |

**Example Usage**

```swift theme={null}
import PortalSwift

Task {
    do {
        let request = TransferFromRequest(
            chain: "eip155:11155111",
            token: "USDC",
            fromAddress: "0x099699ed181517d4ce0ba4487bea671d31bb1db5", // Token owner
            toAddress: "0xdFd8302f44727A6348F702fF7B594f127dE3A902", // Recipient
            amount: "0.01"
        )

        let result = try await portal.delegations.transferAndSubmit(request: request)

        // These are broadcast, not confirmed.
        print("Transfer submitted: \(result.hashes)")
    } catch DelegationsError.noTransactions {
        print("The transfer response contained no transactions to submit.")
    } catch DelegationsError.invalidTransactionHash(let index, let chainId) {
        print("Signer returned an unusable hash for transaction \(index) on \(chainId)")
    } catch {
        print("Error transferring delegated tokens: \(error)")
    }
}

// Solana, with progress reporting
Task {
    do {
        let request = TransferFromRequest(
            chain: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
            token: "USDC",
            fromAddress: "ARttPLesu9RiX6H111Pfdc9Y2DhGy1B8P8jyyrD8Cj5b", // Token owner
            toAddress: "GPsPXxoQA51aTJJkNHtFDFYui5hN5UxcFPnheJEHa5Du", // Recipient
            amount: "0.01"
        )

        let result = try await portal.delegations.transferAndSubmit(
            request: request,
            options: DelegationSubmitOptions(
                onProgress: { progress in
                    switch progress.step {
                    case .signing:
                        print("Signing \(progress.index + 1)/\(progress.total)")
                    case .submitted:
                        print("Submitted: \(progress.hash ?? "")")
                    }
                }
            )
        )

        print("Transfer submitted: \(result.hashes)")
    } catch {
        print("Error transferring delegated tokens: \(error)")
    }
}
```

<Note>
  **Delegation roles**: `fromAddress` is the token owner who approved the delegation. Your wallet — the delegate — signs the transaction that moves tokens from the owner to `toAddress`.
</Note>

**Related Documentation**

* [Manage Token Delegations](../guide/delegations)
* [Token delegations](/resources/delegations)
