You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ODIS page: update the WalletKeySigner example for @celo/identity 6.0 #2365
The WalletKeySigner example in tooling/libraries-sdks/contractkit/odis.mdx (prose on line 41, code on lines 43-48) uses the @celo/identity 5.x API. It does not work with 6.0.
In 6.0, WalletKeySigner has no contractKit field. It takes a sign191 function that signs the message with EIP-191 and returns the signature. From lib/odis/query.d.ts in 6.0.0-beta.0:
The types come from viem, and @celo/contractkit is now an optional peer dependency. The social-connect changeset .changeset/nasty-forks-tell.md describes the change, and the social-connect README uses the new form:
Copied into a 6.0 project, the current example fails to type-check. Plain JavaScript gets further and then fails when the library calls signer.sign191. The sentence on line 41 ("passing in a contractkit instance with the account unlocked") is wrong for 6.0 too. The EncryptionKeySigner example on lines 34-39 works in both versions.
This can't change yet. npm latest is still 5.1.2, and 6.0 is published only as 6.0.0-beta.0 under the beta tag, so switching the example now would break it for everyone on the stable release. #2346 left it alone for that reason, although the page already says the Celo Sepolia contexts need 6.0.0-beta.0 or later.
When @celo/identity 6.0.0 ships as latest:
Replace the contractKit example with the sign191 form and rewrite line 41 to match.
Check the rest of the page against the 6.0 types. The changeset says many fields that were string are now 0x-string typed.
Change "6.0.0-beta.0 and later" to the stable version.
Activity