# validate_apply_transfer · FT4 Rell API · Chromia Docs (concept)

> function validate_ apply_ transfer(init_ transfer_ tx: gtx_ transaction, init_ tx_ op_ index: integer, previous_ hop_ tx: gtx_ transaction, op_ index: inte

Source: https://docs.chromia.com/pages/ft4-rell/-f-t4-library/lib.ft4.external.crosschain/validate_apply_transfer/

FUNCTION

# validate\_apply\_transfer

```signature
function validate_apply_transfer(init_transfer_tx: gtx_transaction, init_tx_op_index: integer, previous_hop_tx: gtx_transaction, op_index: integer, hop_index: integer): ((tx_rid: byte_array, args: immutable_mirror_struct<init_transfer>, sender_account_id: byte_array), byte_array)
```

[Source](https://gitlab.com/chromaway/ft4-lib/-/blob/development/rell/src/lib/ft4/external/crosschain/operations.rell#lines-994)

Validates that the parameters are correct for an `apply_transfer` operation. Also used in
other operations that require the same validation to occur (e.g. `cancel_transfer`)
It does not verify whether the transfer expired.

Among other things, this function validates that:

* Transfer was not already applied on this chain
* Transfer was not already canceled on this chain
* Transfer was not already unapplied on this chain
* That the `init_transfer` details are correct
* The `iccf_proof` that states that this transfer was applied on the previous hop

Throws `"INVALID TRANSACTION"` if the transfer has already been applied, canceled or
unapplied on this chain.

Throws `"INPUT ERROR"` if the input is malformed. Common scenarios include:

* arguments found in `init_transfer_tx` and `previous_hop_tx` do not match
* `hop_index` is out of bounds
* `previous_hop_tx` has not been sent to the chain that comes before this one on the
  transfer hops

Throws `"WRONG BLOCKCHAIN"` if the chain at `hop_index` on the init transaction is not this
chain

Throws if the `op_index` does not point to `apply_transfer`

Throws if the `init_tx_op_index` does not point to `init_transfer` on its `init_transfer_tx`

Throws if the operation preceding `init_transfer` is not an auth operation

Throws if the transaction is missing the `iccf_proof` operation, which demonstrates that
the block containing the `previous_hop_tx` has been anchored from the previous chain.

**Parameters**

* **init\_transfer\_tx** — the init transaction, which contains `init_transfer`, as it was submitted to the starting chain
* **init\_tx\_op\_index** — the index of the `init_transfer` operation in `init_transfer_tx`
* **previous\_hop\_tx** — the transaction that applied the transfer in the chain that comes before this one. Same as `init_transfer_tx` if this is the first chain where the transfer is applied.
* **op\_index** — the index of the `apply_transfer` operation in `previous_hop_tx`
* **hop\_index** — which index in the hops array provided in the original transaction this chain represents.

**See Also**

* `core.auth.is_auth_op` — for information on auth operations

[View this page on docs.chromia.com](https://docs.chromia.com/pages/ft4-rell/-f-t4%20-library/lib.ft4.external.crosschain/validate_apply_transfer.html)Generated API reference, mirrored from the live docs
