refactor: improve wallet-integration skill for agent consumption#67
Open
refactor: improve wallet-integration skill for agent consumption#67
Conversation
- Rename H1 to match skill name (Wallet Integration) - Rename "Mistakes That Break Your Build" to "Pitfalls" - Fix pitfall #5: clarify that requestPermissionsNotGranted() is a UX optimization, not a requirement (verified against library source) - Make IcpWallet/IcrcWallet code blocks self-contained (add connect + accounts so agents get copy-paste correct code) - Add error class imports to import map (RelyingPartyResponseError, RelyingPartyDisconnectedError) - Remove "Build Your Project" section (generic TS commands) - Replace "Verify It Works" with condensed "Expected Behavior" section focused on return types and behavioral facts not stated elsewhere
marc0olo
commented
Mar 4, 2026
| // Classes and errors — from dedicated subpaths | ||
| import {Signer} from '@dfinity/oisy-wallet-signer/signer'; | ||
| import {RelyingParty} from '@dfinity/oisy-wallet-signer/relying-party'; | ||
| import {RelyingParty, RelyingPartyResponseError, RelyingPartyDisconnectedError} from '@dfinity/oisy-wallet-signer/relying-party'; |
Collaborator
There was a problem hiding this comment.
Correct, the latest release v4.1.1 exports those types
Member
Author
There was a problem hiding this comment.
@AntonioVentilii as discussed on Slack, the export currently misses the runtime values which is why the advertised instanceof check would still not work
Member
There was a problem hiding this comment.
Ah yeah my bad, I missed it when I reviewed dfinity/oisy-wallet-signer#817.
@AntonioVentilii we should not have exported those as type but, plain.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors the wallet-integration skill (merged via #16) to be more efficient for agent consumption.
#5accuracy:requestPermissionsNotGranted()is a UX optimization (batch permissions upfront), not a requirement — the signer prompts on demand viaask_on_usedefault. Verified against library source and e2e tests.connect()+accounts()so agents get copy-paste correct code without needing to reference other sectionsRelyingPartyResponseErrorandRelyingPartyDisconnectedErroradded to the import map — these are used in the error handling block but were missing (not yet exported by the library; import path is a draft pending dfinity/oisy-wallet-signer update)