# Error "InsufficientFeeAmount" when I'm trying to transfer some asset using rust sdk

**URL:** <https://forum.fuel.network/t/error-insufficientfeeamount-when-im-trying-to-transfer-some-asset-using-rust-sdk/907>\
**Category:** Rust SDK\
**Created:** [December 16, 2022, 12:20pm UTC](https://forum.fuel.network/t/error-insufficientfeeamount-when-im-trying-to-transfer-some-asset-using-rust-sdk/907 "2022-12-16T12:20:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/fuel/32/1677_2.png) [@fuel](https://forum.fuel.network/u/fuel)\
**Post date:** [December 16, 2022, 12:20pm UTC](https://forum.fuel.network/t/error-insufficientfeeamount-when-im-trying-to-transfer-some-asset-using-rust-sdk/907/1 "2022-12-16T12:20:21Z")

</div>

Trying to transfer my token from `wallet` to `recipient ` using [this tutorial](https://fuellabs.github.io/fuels-rs/v0.32.2/cookbook/transfer-all-assets.html?highlight=transfer#transfer-all-assets)

```auto
#[tokio::test]
async fn _transfer() {
    let (wallet, dapp, provider) = setup().await;
    let decimals = dapp.methods().decimals().simulate().await.unwrap().value;
    let symbol = dapp.methods().symbol().simulate().await.unwrap().value;
    let asset_id = AssetId::from_str(USDT_ADDRESS).unwrap();

    println!("Decimals: {decimals}\nSymbol: {symbol}");

    let balance = wallet.get_asset_balance(&asset_id).await.unwrap();
    println!(
        "Wallet balance: {} {symbol}",
        format_units(balance, decimals)
    );

    let recipient = Bech32Address::from_str(RECIPIEND_ADDRES).unwrap();
    let recipient = Wallet::from_address(recipient, Some(provider.clone()));

    let amount = parse_units(10, decimals);
    let mut inputs = vec![];
    let mut outputs = vec![];

    let input = wallet
        .get_asset_inputs_for_amount(asset_id, amount, 0)
        .await
        .unwrap();
    inputs.extend(input);

    let output = wallet.get_asset_outputs_for_amount(recipient.address(), asset_id, amount);
    outputs.extend(output);

    let mut tx = Wallet::build_transfer_tx(
        &inputs,
        &outputs,
        TxParameters::new(Some(1), Some(1000000), None),
    );
    wallet.sign_transaction(&mut tx).await.unwrap();

    let _receipts = provider.send_transaction(&tx).await.unwrap();

    let recipient_balance = recipient.get_asset_balance(&asset_id).await.unwrap();
    let balance = wallet.get_asset_balance(&asset_id).await.unwrap();
    println!(
        "Wallet balance: {} {symbol}\nRecipient balance: {} {symbol}",
        format_units(balance, decimals),
        format_units(recipient_balance, decimals),
    )
}

```

But I have this error:

```auto
thread 'actions::transfer::transfer' panicked at 'called `Result::unwrap()` on an `Err` value: ProviderError("Response errors; InsufficientFeeAmount { expected: 1, provided: 0 }")', tests/actions/transfer.rs:49:58
stack backtrace:...

```

Please help me the fee amount correct

---

<div class="post-metadata">

**Author:** ![fuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/fuel/32/1677_2.png) [@fuel](https://forum.fuel.network/u/fuel)\
**Post date:** [December 16, 2022, 12:44pm UTC](https://forum.fuel.network/t/error-insufficientfeeamount-when-im-trying-to-transfer-some-asset-using-rust-sdk/907/2 "2022-12-16T12:44:16Z")

</div>

I used `wallet.transfer` and it worked

Just replaced that

```auto
    let amount = parse_units(10, decimals);
    let mut inputs = vec![];
    let mut outputs = vec![];

    let input = wallet
        .get_asset_inputs_for_amount(asset_id, amount, 0)
        .await
        .unwrap();
    inputs.extend(input);

    let output = wallet.get_asset_outputs_for_amount(recipient.address(), asset_id, amount);
    outputs.extend(output);

    let mut tx = Wallet::build_transfer_tx(
        &inputs,
        &outputs,
        TxParameters::new(Some(1), Some(1000000), None),
    );
    wallet.sign_transaction(&mut tx).await.unwrap();

    let _receipts = provider.send_transaction(&tx).await.unwrap();

```

to this

```auto
    let _receipts = wallet
        .transfer(
            recipient.address(),
            amount,
            asset_id,
            TxParameters::new(Some(1), Some(1000000), None),
        )
        .await
        .unwrap();

```

The working version of the code:

> <https://github.com/sway-gang/fuel-token-standard/blob/master/tests/actions/transfer.rs>

---

<div class="post-metadata">

**Author:** ![fuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/fuel/32/1677_2.png) [@fuel](https://forum.fuel.network/u/fuel)\
**Post date:** [December 16, 2022, 12:44pm UTC](https://forum.fuel.network/t/error-insufficientfeeamount-when-im-trying-to-transfer-some-asset-using-rust-sdk/907/3 "2022-12-16T12:44:49Z")

</div>

Admin, please fix this article  
[https://fuellabs.github.io/fuels-rs/v0.32.2/cookbook/transfer-all-assets.html?highlight=transfer#transfer-all-assets](https://fuellabs.github.io/fuels-rs/v0.32.2/cookbook/transfer-all-assets.html?highlight=transfer#transfer-all-assets)

---

<div class="post-metadata">

**Author:** ![sarah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/sarah/32/13_2.png) [@sarah](https://forum.fuel.network/u/sarah)\
**Post date:** [December 16, 2022, 9:23pm UTC](https://forum.fuel.network/t/error-insufficientfeeamount-when-im-trying-to-transfer-some-asset-using-rust-sdk/907/4 "2022-12-16T21:23:25Z")

</div>

You can see the full test here: [fuels-rs/lib.rs at master · FuelLabs/fuels-rs · GitHub](https://github.com/FuelLabs/fuels-rs/blob/master/examples/cookbook/src/lib.rs#L118) . You might have a version mismatch that is causing the error.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/5/57d5a345cc15a64b636e0d56e042857f8a0e80b1.png) [@system](https://forum.fuel.network/u/system)\
**Post date:** [January 6, 2023, 5:23pm UTC](https://forum.fuel.network/t/error-insufficientfeeamount-when-im-trying-to-transfer-some-asset-using-rust-sdk/907/5 "2023-01-06T17:23:41Z")

</div>

Closed on January 6, 2023, 5:23pm UTC

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
