Error: use of undeclared type `VariableOutputPolicy`

Refer to: Deposit and Withdraw - The Fuel Rust SDK
How to fix the following codes:

    pub async fn withdraw(
        contract: &Exchange<WalletUnlocked>,
        amount: u64,
        asset: AssetId,
    ) -> CallResponse<()> {
        contract
            .methods()
            .withdraw(Asset { id: asset, amount })
            .with_variable_output_policy(VariableOutputPolicy::Exactly(1)) //Error: use of undeclared type `VariableOutputPolicy`
            .call()
            .await
            .unwrap()
    }

The error: Error: use of undeclared type VariableOutputPolicy

If it is not in scope you can import it with use fuels::types::transaction_builders::VariableOutputPolicy;

2 Likes