"JSON couldn't be used cos there's no Schema " contract init error

I’m trying to initialize my contract but concordium client is saying the parameters can’t be accepted because there’s no schema for it.

The error means that there is no schema for the particular method embedded in the module.

How did you build your contract?

You mean build the module? This is the command I ran -concordium-client path concordium build – out file-path --schema-json --schema-embed --schema-json-out file-path --schemq-base64-out

Hi @John,

The build command you use should ensure that the schema is embedded, but only if you actually annotate your init and receive methods with the types to use.
For example like this: #[init(contract = "my_contract", parameter = "MyInitType"] where you specify that the input parameter is MyInitType.

For more information on this topic, see this guide: Build a contract schema — Concordium documentation

Let us know if you have any further questions.
/ Kasper

I did it just as you have stated, I’ve followed every step in the documentation.

I’m still receiving the same error. No changes.

Can you provide details of which contract/module exactly you are trying to interact with? Maybe we can help better that way.

I’m using the two-step transfer example contract.

#[init(contract = “multi_sig”, parameter = “InitialiseParams”, payable)]
fn init<St: HasStateApi>(_ctx: &InitContext, _state_builder: &mut StateBuilder, _amount: Amount,) → Result<State, Error> {

The Schema Type

#[derive(Serialize, SchemaType, Clone)]
pub struct InitialiseParams{
pub timeout : Duration,
#[concordium(size_length = 2)]
pub signers: BTreeSet,
pub min_signers_req: u16
}