vault.ensureTransferFeeAllowance(EnsureTransferFeeAllowance)
Ensure an ERC20 allowance is set to pay the vault transfer fee for a given token transfer. If the allowance is insufficient, it submits an approval transaction.
EnsureTransferFeeAllowance Type Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| allowanceSigner | Signer | Required | Signer that pays the transfer fee. Must be connected to a provider. |
| vault | string | Required | Vault address that computes the transfer fee. |
| token | string | Required | Security token address being transferred. |
| erc20 | string | Required | ERC20 token address used to pay the fee. |
| transferAmountHuman | string | Required | Transfer amount in human-readable units (e.g., "2"). |
Returns
| Field | Type | Description |
|---|---|---|
| status | already_sufficient or approved | Whether an approval was sent. |
| vault | string | Vault address. |
| feeToken | string | ERC20 token address used for fees. |
| transfer | { token: string; amountHuman: string; amountUnits: bigint; tokenDecimals: number } | Transfer amount details. |
| fee | { requiredAllowance: bigint; allowanceBefore: bigint; allowanceAfter: bigint } | Fee allowance details. |
| approvedBy | string | Address that submitted the approval (or current allowance owner). |
| receipt | TransactionReceipt | Only present when status is 'approved'. |

