ODIS page: update the WalletKeySigner example for @celo/identity 6.0
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- documentation
Direzione di ricerca
Start with tooling/libraries-sdks/contractkit/odis.mdx, especially lines 41-48, and compare the example with the social-connect README, lib/odis/query.d.ts, and .changeset/nasty-forks-tell.md. Wait until @celo/identity 6.0.0 is the npm latest release, then verify the page against the stable types; done means the WalletKeySigner example and version wording match 6.0 and the remaining examples still work.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
The example passes a ContractKit instance:
const authSigner: AuthSigner = {
authenticationMethod: OdisUtils.Query.AuthenticationMethod.WALLET_KEY,
contractKit,
};
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:
export interface WalletKeySigner {
authenticationMethod: AuthenticationMethod.WALLET_KEY;
sign191: ({ message, account }: { message: SignableMessage; account: Address }) => Promise<Hex>;
}
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:
const authSigner: AuthSigner = {
authenticationMethod: OdisUtils.Query.AuthenticationMethod.WALLET_KEY,
sign191: ({ message, account }) => viemClient.signMessage({ message, account }),
};
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
contractKitexample with thesign191form and rewrite line 41 to match. - Check the rest of the page against the 6.0 types. The changeset says many fields that were
stringare now0x-string typed. - Change "6.0.0-beta.0 and later" to the stable version.
- Lingua principale
- MDX
- Stelle
- 90
- Fork
- 398
- Merge medio
- 4g 22h
- PR unite (30g)
- 22
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di celo-org/docs
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 4 giorni
-
Document Forno's eth_getLogs 5,000-block limit and how to read longer historyForse già presa @szapelao l’ha presa 6 giorni fa. Apertachore priority:medium status: triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
celo-org/docs#2458 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 4 giorni
-
chore priority:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
celo-org/docs#2362 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di celo-org/docs
Issue simili
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
githubnext/gh-aw-workshop#6332 ·
I maintainer di solito rispondono entro 1 giorno
-
docs: powerpc not supportedAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
Revivedx/SavageWindRecomp#1358 ·
I maintainer di solito rispondono entro 2 giorni
-
link-check link-check:manual
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
scylladb/scylladb-docs-homepage#333 ·
I maintainer di solito rispondono entro 1 giorno