# How to setup ledger locally (using \`icrc1\_transfer \` with \`ic\_ledger\_types\`) to make a transfer?

**URL:** <https://forum.dfinity.org/t/how-to-setup-ledger-locally-using-icrc1-transfer-with-ic-ledger-types-to-make-a-transfer/22353>\
**Category:** Rust\
**Created:** [August 23, 2023, 4:16pm UTC](https://forum.dfinity.org/t/how-to-setup-ledger-locally-using-icrc1-transfer-with-ic-ledger-types-to-make-a-transfer/22353 "2023-08-23T16:16:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Damz](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Damz](https://forum.dfinity.org/u/Damz)\
**Post date:** [August 23, 2023, 4:16pm UTC](https://forum.dfinity.org/t/how-to-setup-ledger-locally-using-icrc1-transfer-with-ic-ledger-types-to-make-a-transfer/22353/1 "2023-08-23T16:16:15Z")

</div>

Following these [docs](https://internetcomputer.org/docs/current/developer-docs/integrations/ledger/ledger-local-setup), but the provided candid/wasm files don’t have `transfer` or `account_balance` in them.

I found [this](https://forum.dfinity.org/t/questions-about-accountidentifier-and-subaccount-in-icpledger/22284/7) related post to try another commit hash, but now I can’t deploy it.

`Invalid data: Unable to serialize Candid values: record field send_whitelist not found`.

I’ve tried other deploy commands from various docs/forum posts (including with `send_whitelist`), but can’t get it to work. **Question one:** which combination of ledger candid/wasm/deploy commands should I be using?

I also found [this](https://forum.dfinity.org/t/difference-between-nnsledger-container-icrc1-transfer-and-transfer/20535) forum post which suggests `icrc1_transfer` should be used instead of `transfer` anyway. I’m using the Rust library `ic_ledger_types`, which doesn’t seem to call the new `icrc1_transfer`. **Question two:** Does this mean `ic_ledger_types` isn’t compatible with the latest ledger candid/wasm? If not, how can I call this to do a transfer in Rust?

---

<div class="post-metadata">

**Author:** ![Damz](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Damz](https://forum.dfinity.org/u/Damz)\
**Post date:** [August 24, 2023, 9:59am UTC](https://forum.dfinity.org/t/how-to-setup-ledger-locally-using-icrc1-transfer-with-ic-ledger-types-to-make-a-transfer/22353/2 "2023-08-24T09:59:14Z")

</div>

A version that works, with a deploy command, here: [Questions about accountIdentifier and subaccount in ICPledger? - #12 by Damz](https://forum.dfinity.org/t/questions-about-accountidentifier-and-subaccount-in-icpledger/22284/12)

**Question 2** remains: how to use the new `icrc1_transfer` with the `ic_ledger_types`? Or is sticking with the old `transfer` way fine?

---

<div class="post-metadata">

**Author:** ![roman-kashitsyn](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/roman-kashitsyn/32/3802_2.png) [@roman-kashitsyn](https://forum.dfinity.org/u/roman-kashitsyn)\
**Post date:** [August 24, 2023, 12:44pm UTC](https://forum.dfinity.org/t/how-to-setup-ledger-locally-using-icrc1-transfer-with-ic-ledger-types-to-make-a-transfer/22353/3 "2023-08-24T12:44:47Z")

</div>

Hi @Damz!

The `ic-ledger-types` package covers the original ICP ledger interface based on `AccountIdentifier`s, it doesn’t contain ICRC-1 endpoints. If you target only the ICP ledger, you can still use the `ic-ledger-types` directly (`transfer` and friends) and not worry about the ICRC-1 endpoints.

---

<div class="post-metadata">

**Author:** ![mariop](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/mariop/32/5114_2.png) [@mariop](https://forum.dfinity.org/u/mariop)\
**Post date:** [August 24, 2023, 12:52pm UTC](https://forum.dfinity.org/t/how-to-setup-ledger-locally-using-icrc1-transfer-with-ic-ledger-types-to-make-a-transfer/22353/4 "2023-08-24T12:52:45Z")

</div>

Hi @Damz ,

If you want to use icrc\* types then I suggest to use the library [https://crates.io/crates/icrc-ledger-types](https://crates.io/crates/icrc-ledger-types) instead. It is like `ic_ledger_types` but for icrc.  
In general I would suggest to use the icrc interface over the old icp one because it is supported by icp and all the icrc ledgers.

Best

---

<div class="post-metadata">

**Author:** ![Dustin](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@Dustin](https://forum.dfinity.org/u/Dustin)\
**Post date:** [August 24, 2023, 4:50pm UTC](https://forum.dfinity.org/t/how-to-setup-ledger-locally-using-icrc1-transfer-with-ic-ledger-types-to-make-a-transfer/22353/5 "2023-08-24T16:50:30Z")

</div>

Is there a `transfer` function available in the `icrc-ledger-types` crate? Similar to how previously the `transfer` function could be called with `ic_ledger_types::transfer()`, can it be called with something like `icrc-ledger-types::icrc1::transfer()`. I can’t find any direct transfer method in the [crate](https://docs.rs/icrc-ledger-types/0.1.0/icrc_ledger_types/icrc1/transfer/index.html), only the type definitions and only see the way to implement the function myself and calling it via `api::call`.

---

<div class="post-metadata">

**Author:** ![mariop](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/mariop/32/5114_2.png) [@mariop](https://forum.dfinity.org/u/mariop)\
**Post date:** [August 25, 2023, 8:37am UTC](https://forum.dfinity.org/t/how-to-setup-ledger-locally-using-icrc1-transfer-with-ic-ledger-types-to-make-a-transfer/22353/6 "2023-08-25T08:37:10Z")

</div>

The crate only defines the types at the moment. You’ll have to implement the function yourself but for the input and output types you can use the ones from the crate.
