Dynamically create a canister from wasm module

Is there a typescript example for this ? I want to deploy icrc-1 ledger dynamically using from a main canister

I donā€™t know, Iā€™m not familiar with Azle. Maybe you can find something here?

Yeah went through them but it doesnā€™t have and example which will be suitable for my project .

Generally speaking how would the code for .wasm module be stored on icp? Is it even possible to do that to store a wasm module of icrc-1 ledger

here is the example of dynamically creating the canister in ts: https://github.com/demergent-labs/azle/blob/main/examples/management_canister/src/management_canister.ts#L29

1 Like

seeing their example: https://github.com/demergent-labs/azle/blob/main/examples/management_canister/src/management_canister.ts#L76C21-L76C21

they are wasm as argument:

$update;
export async function executeInstallCode(
    canisterId: Principal,
    wasmModule: blob
): Promise<Result<boolean, string>>{
             ...
}```

Yeah went through that. But my issue is with on how to store the wasm module of my child canister in my main canister

How do I do that

in rust, I do like this:

const WALLET_WASM: &[u8] = std::include_bytes!("./../../../wasm_files/wallet.wasm.gz");

maybe you can do something similar in ts, if possibleā€¦