-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add did rpc decorations #32
Conversation
|
We don't use this anymore in the SDK. The RPC info is populated directly from the runtime definition. |
The RPC information is not part of the runtime metadata and cannot be inferred. It has to be setup manually. (see blockoverflow) |
weichweich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love to approve my on PR. But GitHub seems to be against that for what ever reason... 🙄
ntn-x2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
|
I have tested it with a local instance of the PolkadotJS Apps against both our latest develop and with Spiritnet and it seems to be working fine. To avoid any unnecessary risk with the official PolkadotJS Apps, I will leave this PR open and we will wait to merge it until we have started the release process for 1.8.0, at which point we will merge and release, and test the new types against Peregrine Staging. |
|
There is currently a limitation in how public keys are serialized in Substrate. They are ss58-encoded, and this means that there is need for some custom decoding logic on the client side. Commit 11eb4f8 fixes this by declaring the DID public verification keys as Anyway, that was the last limitation for fully supporting the new RPC endpoints, hence we can now move on and test the new type definitions. |
|
This PR has been re-scoped to support the 1.7.2 release, which adds support for the DID RPC endpoints, but does not include neither public credentials nor the new Ethereum account linking. Hence, those two features have been removed from this PR, and will be tracked in different ticekts. The goal of this PR is to make the type definitions ready for the next release. |
wischli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I have one minor question though.
Fixes https://github.com/KILTprotocol/ticket/issues/1953
It adds type augmentation for the runtime APIs (callable with
api.call.didApi...),but it has on hold the generation of types for the DID RPC stuff, as decoding is currently failing when fetching data using a Typescript script.Checklist
AccountId33as in https://github.com/polkadot-js/api/pull/5197/filesHow to test
After #33 is merged into this, you can spin up a local instance of polkadotJS apps, where you replace the KILT type definition with a locally published version of this package (e.g. with
yalc). You should now be able to see the pubilc credential RPCs among the possible RPC methods, and also the runtime calls for both the DID and the public credentials runtime APIs.One screenshot for the RPC and one for the runtime calls attached.
How to integrate into the SDK
For usage with the SDK, the
typegenpackage must be used, by first pulling in the metadata from an up-to-date chain that has these features (e.g. fromdevelop), then updatingpackages/augment-api/src/interfaces/extraDefs/definitions.tsto use therpc,types, andruntimedefinitions by pulling them in from this package, and the runbuild:types. The result should be an up-to-date typescript definition of all RPC andstate_callstuff.