wallet-integration

Integrate IC wallets with dApps using ICRC signer standards and oisy-wallet-signer.

Updated Apr 3, 2026
One-click install
npx skills add https://github.com/phukrit7171/Relationship-Smart-Contract-ICP --skill wallet-integration-phukrit7171
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wallet-integration
Source: https://github.com/phukrit7171/Relationship-Smart-Contract-ICP/tree/main/.agents/skills/wallet-integration
Command: npx skills add https://github.com/phukrit7171/Relationship-Smart-Contract-ICP --skill wallet-integration-phukrit7171

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @dfinity/oisy-wallet-signer, @dfinity/utils, @dfinity/zod-schemas, @icp-sdk/canisters, @icp-sdk/core, zod.

What problem does it solve? Connecting an Internet Computer dApp to a user wallet requires implementing the ICRC signer standards (ICRC-21/25/27/29/49) correctly — popup-based communication over window.postMessage, consent messages, permission lifecycles, and per-action approval flows. This Skill provides the complete integration pattern using @dfinity/oisy-wallet-signer so developers avoid common pitfalls like wrong import paths, missing prompt handlers, and concurrent request errors. ## Core Features & Use Cases - Relying Party Integration: Connect a dApp to a wallet with IcpWallet or IcrcWallet, request permissions, fetch accounts, and execute ICP/ICRC-1/ICRC-2 transfers and approvals with consent messages. - Signer (Wallet) Implementation: Initialize a Signer, register all four prompt handlers (permissions, accounts, consent message, call canister), and handle the consent message state machine including Ok vs Warn variants. - Error Handling & Lifecycle: Covers the full error code table (500-4000), permission states and 7-day expiration, disconnect cleanup, and local/mainnet deployment configurations. - Use Case: A developer building a DeFi dApp needs a "Deposit ICP" button. This Skill shows how to connect via IcpWallet, request permissions upfront, and call icrc1Transfer so the user approves the transfer in the wallet popup and the dApp receives the block index. ## Quick Start Ask the AI to integrate wallet connection into your IC dApp using @dfinity/oisy-wallet-signer with an ICP transfer button that requests permissions and shows the consent message flow.

Frequently Asked Questions about wallet-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate a wallet with an Internet Computer dApp?

Use @dfinity/oisy-wallet-signer to connect via IcpWallet.connect() or IcrcWallet.connect() with the wallet's signer URL. Then call requestPermissionsNotGranted(), fetch accounts(), and execute transfers — each action triggers a user approval popup over window.postMessage.

What is the difference between IcpWallet and IcrcWallet in oisy-wallet-signer?

IcpWallet targets the ICP ledger and defaults ledgerCanisterId to ryjl3-tyaaa-aaaaa-aaaba-cai, while IcrcWallet works with any ICRC ledger and requires ledgerCanisterId on transfer, approve, and transferFrom calls. Omitting it on IcrcWallet causes a runtime error.

Why do I get error 503 BUSY from the IC wallet signer?

Error 503 means a second request was sent while the signer was still processing one. The signer handles one request at a time, so serialize your calls and wait for each response before sending the next. Read-only methods like icrc29_status are exempt.

Does oisy-wallet-signer support session-based delegation like ICRC-34 or ICRC-46?

No, the signer model is explicit per-action approval and does not implement ICRC-46 session delegation. If your app needs sign-once-act-many behavior, background execution, or high-frequency writes, use a delegation-capable model instead.

Why is Signer undefined when importing from @dfinity/oisy-wallet-signer?

Signer, RelyingParty, IcpWallet, and IcrcWallet are not exported from the main entry point. Import them from dedicated subpaths such as @dfinity/oisy-wallet-signer/signer and @dfinity/oisy-wallet-signer/icrc-wallet.

How do I test wallet integration locally without a production wallet?

Clone the dfinity/oisy-wallet-signer repository and run the demo pseudo wallet with npm run dev:wallet on port 5174. Connect your dApp to http://localhost:5174/sign with host set to your local network, typically http://localhost:8000.