I'm following the guide in polkadot-js/typegen, the github source is shared. I am trying to follow along and decorate the api for my custom node-template called supersig-template
I have successfully created an output of the metadata:
curl -H "Content-Type: application/json" -d '{"id":"1", "jsonrpc":"2.0", "method": "state_getMetadata", "params":[]}' http://localhost:9933 > supersig-template.json
But I am not very clearly in the github source where I should be running yarn build
. I try in the root of forking /docs repo. But I don't think that is the correct place.
Then I went into /docs/api/examples/promise/typegen
separated it into its own repo, changed package json to include --endpoint ./supersig-template.json
then ran yarn build
and got this error:
typegen % yarn build
yarn run v1.22.19
$ yarn generate:defs && yarn generate:meta
$ ts-node --skip-project node_modules/.bin/polkadot-types-from-defs --package sample-polkadotjs-typegen/interfaces --input /src/interfaces --endpoint /Users/ramsey/decentration/typegen/supersig-template.json
Options:
--help Show help [boolean]
--version Show version number [boolean]
--input The directory to use for the user definitions [string] [required]
--package The package name & path to use for the user types
[string] [required]
Unknown argument: endpoint
error Command failed with exit code 1.
A few questions:
- is typegen still up to date and something that can be used to decorate APIs?
- has endpoint been removed as an argument?
- am I going about thing the correct way to decorate the api?
Solution to "unknown endpoint" issue: Make sure to bump the version of both polkadot/api and polkadot/typegen to ^8.13.1 and it will yarn build
successfully.