> ## 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.

# delegations.approveAndSubmit

> Approve a token delegation, then sign and broadcast it in one call.

## Function Signature

```dart theme={null}
Future<List<String>> approveAndSubmit({
  required String chain,
  required String token,
  required String delegateAddress,
  required String amount,
  void Function(DelegationSubmitProgress)? onProgress,
})
```

## Description

Builds the approval transaction(s), then signs and broadcasts each one in order and returns the resulting hashes. The wallet's signer is wired up for you, and EVM and Solana chains are routed to `eth_sendTransaction` and `sol_signAndSendTransaction` respectively.

<Warning>
  This method returns as soon as each transaction is accepted by the network. It **does not wait for on-chain confirmation** — a returned hash means the transaction was submitted, not that it succeeded. If your flow depends on the delegation being active, wait for the receipt yourself, or poll [`delegations.getStatus`](./delegations-getstatus) before proceeding.
</Warning>

Use [`delegations.approve`](./delegations-approve) instead when you need to inspect, modify, or sign the transaction yourself.

## Parameters

| Parameter         | Type                                       | Required | Description                                                                                                     |
| ----------------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------- |
| `chain`           | `String`                                   | Yes      | CAIP-2 chain ID (e.g., `"eip155:11155111"` for Sepolia, `"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"` for Solana) |
| `token`           | `String`                                   | Yes      | Token symbol or address (e.g., `"USDC"`)                                                                        |
| `delegateAddress` | `String`                                   | Yes      | The address to delegate to                                                                                      |
| `amount`          | `String`                                   | Yes      | The amount to delegate (e.g., `"100.0"`)                                                                        |
| `onProgress`      | `void Function(DelegationSubmitProgress)?` | No       | Called as each transaction is signed and submitted                                                              |

### DelegationSubmitProgress

| Property | Type                   | Description                                                            |
| -------- | ---------------------- | ---------------------------------------------------------------------- |
| `step`   | `DelegationSubmitStep` | `signing` or `submitted`                                               |
| `index`  | `int`                  | The 0-based index of this transaction in the sequence                  |
| `total`  | `int`                  | The total number of transactions in the sequence                       |
| `hash`   | `String?`              | `null` on `signing`, and the broadcast transaction hash on `submitted` |

## Returns

**`List<String>`** — One transaction hash per broadcast transaction, in submission order. Most delegation flows produce a single transaction, so the list usually has one element.

## Example

### EVM

```dart theme={null}
import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

final hashes = await portal.delegations.approveAndSubmit(
  chain: 'eip155:11155111',
  token: 'USDC',
  delegateAddress: '0x1234...',
  amount: '100.0',
  onProgress: (progress) {
    print('${progress.step.value} ${progress.index + 1}/${progress.total}');
  },
);

print('Tx hashes: $hashes');
```

### Solana

```dart theme={null}
final hashes = await portal.delegations.approveAndSubmit(
  chain: 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1',
  token: 'USDC',
  delegateAddress: '7smgSuU5mjP7QY5yWGdaTfgKn8hUWwvQgfvgcZB3HmJi',
  amount: '100.0',
);

print('Tx signatures: $hashes');
```

## Errors

All failures throw a `PortalException`.

| Code                                  | Description                                                                                                               |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `NOT_INITIALIZED`                     | Portal was not initialized                                                                                                |
| `DELEGATION_APPROVE_AND_SUBMIT_ERROR` | Building, signing, or broadcasting failed. The `message` carries the reason — usually the API, or Native SDK's own error. |

## Related

* [Manage Token Delegations guide](../guide/delegations)
* [delegations.approve](./delegations-approve)
* [delegations.revokeAndSubmit](./delegations-revokeandsubmit)
* [delegations.transferAndSubmit](./delegations-transferandsubmit)
