1

Trying to follow these examples:

https://polkadot.js.org/docs/api-contract/start/code#create-a-blueprint

which fails with:

createBlueprint is not a function

Seems like the examples in the documentation are diverged from the implementation? Is there a more up-to-date example, or better yet API documentation?

1 Answer 1

5

The current api-contract documentation is very outdated. We are working on updating it as we speak.

The createBlueprint is no longer available. You can use CodePromise to upload and instantiate new code and BlueprintPromise to instantiate code that is already on-chain.

The 2 classes respectively map to the instantiate_with_code and instantiate dispatchables in the Substrate FRAME contracts pallet

In both cases you would instantiate by calling tx[constructorName] on the resulting object (code or blueprint) with the right arguments.

You can read more about the arguments in the metadata section and also refer to the implementation in Polkadot.js Apps for Blueprint and Code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.