How to call icrc1_ledger’s icrc1_transfer function using the minter principal in rust?

How to call the icrc1_transfer using the minter as caller.
Below is how I am calling the mint_token .

#[ic_cdk::update]
async fn mint_tokens(to: Principal, amount: u128) -> TransferResult {
    let minter = Principal::from_text("r3mbk-e4kxt-qxioi-ogk5c-745nz-zyxx5-sdfmv-6g5nl-vkems-clyfj-jqe").unwrap();
    let ledger_id = Principal::from_text("be2us-64aaa-aaaaa-qaabq-cai").unwrap();

    let args = TransferArgs {
        from_subaccount: None,
        to: Account {
            owner: to,
            subaccount: None,
        },
        amount,
        fee: None,
        memo: None,
        created_at_time: None,
    };

    let result: CallResult<(TransferResult,)> = call::call_with_payment(
        ledger_id,
        "icrc1_transfer",
        (args,),
        5_00_000_000,
    ).await;

    result.map(|r| r.0).unwrap_or_else(|(code, msg)| {
        Err(TransferError::GenericError {
            error_code: code as u128,
            message: msg,
        })
    })
}

You have to make the call using r3mbk-e4kxt-qxioi-ogk5c-745nz-zyxx5-sdfmv-6g5nl-vkems-clyfj-jqe. This looks like a principal from an outside user, so it is not possible to do it via canister. Alternatively, you can update your ledger canister to use your canister’s principal as the minter

But for burning the token , which address to call as if I am assigning canister id as the minter address , it is not accepting .
Also how to handle the mint token from the orchestrator ?

To burn a token you have to send it to the minting account

To mint, you send from the minting account. So if the orchestrator is supposed to mint tokens, you can set it (or one of its subaccounts) as the minter. It can then make transfer to other accounts, which will end up as mint operations

Ok , one more thing I want to make a new icrc token as check log from a canitser.
eg : if a user lock any erc20 token on evm side and then I have to mint same token in icrc standard inside the icp . For that I need to maintain a function that could help me to make a new icrc token ? Right ?

Yes. The ckTokens use a ‘minter’ contract that does the token locking and minting. Later it burns the tokens and unlocks the tokens on the EVM side

This is how I am making a new icrc token

    minting_account_owner: Principal,
    fee_collector_account_owner: Option<Principal>,
    initial_balances: Vec<(Principal, u128)>, // (owner, balance)
    transfer_fee: u128,
    decimals: Option<u8>,
    token_name: String,
    token_symbol: String,
    canister_id: Principal,
    logo: Option<String>, // New parameter for logo
) -> Result<(), String> { ``` 
when it catch a new token arrival with the help of evm_canister .

Can you please share you discord ?

I don’t use discord. I have too many sources of notifications already.

If you want to connect to EVM tokens you will also need a minter canister. Here is more about how this works