---
name: scopuly-wallet
description: Integrate or troubleshoot the Scopuly Stellar wallet in a browser dApp using its Provider API or Stellar Wallets Kit. Use for wallet connection, transaction signing, SEP-53 messages, Soroban authorization signatures, and account or network changes on Scopuly Mobile and the paired browser extension.
license: MIT
metadata:
  author: Scopuly
  version: "0.1.0"
title: scopuly-wallet
canonical_url: https://skilld.dev/gh/scopuly/scopuly-skills
last_updated: 2026-10-14T09:16:08.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [assets/wallet.ts](https://skilld.dev/api/skills-raw/scopuly/scopuly-skills/scopuly-wallet/assets/wallet.ts), [LICENSE](https://skilld.dev/api/skills-raw/scopuly/scopuly-skills/scopuly-wallet/LICENSE), [references/provider.md](https://skilld.dev/api/skills-raw/scopuly/scopuly-skills/scopuly-wallet/references/provider.md), [references/signing.md](https://skilld.dev/api/skills-raw/scopuly/scopuly-skills/scopuly-wallet/references/signing.md), [references/stellar-wallets-kit.md](https://skilld.dev/api/skills-raw/scopuly/scopuly-skills/scopuly-wallet/references/stellar-wallets-kit.md).
>
> If the user asked to install this Skill, run `npx skilld install scopuly/scopuly-skills/scopuly-wallet`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/scopuly-wallet`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/scopuly/scopuly-skills/scopuly-wallet) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/scopuly-wallet`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/scopuly-wallet --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/scopuly-wallet --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Scopuly Wallet Integration

Build against the public Scopuly provider. Keep the application's existing framework and wallet-selection flow. If it already uses Stellar Wallets Kit, use that integration rather than adding a second connection manager.

## Choose the integration

| Existing application | Use |
| --- | --- |
| Scopuly-specific connection or direct provider integration | `@scopuly/signer-extension-api@0.3.3`; [provider lifecycle](https://skilld.dev/api/skills-raw/scopuly/scopuly-skills/scopuly-wallet/references/provider.md) |
| Stellar Wallets Kit | The built-in Scopuly module; [SWK 2.7 integration](https://skilld.dev/api/skills-raw/scopuly/scopuly-skills/scopuly-wallet/references/stellar-wallets-kit.md) |
| Soroban authorization or message verification | [Signing formats and boundaries](https://skilld.dev/api/skills-raw/scopuly/scopuly-skills/scopuly-wallet/references/signing.md) |

The provider is injected as `window.scopuly` in Scopuly Mobile's dApp browser and by the paired browser extension. The npm API is a typed wrapper; installing it does not inject a wallet. An ordinary mobile browser does not automatically have a provider.

Use browser-only initialization in SSR applications. Check `isScopuly === true` and `platform === "mobile" || platform === "extension"`. If injection is delayed, listen for `scopuly#initialized`, use a bounded wait and remove the listener. Do not overwrite another wallet's `window.stellar.provider`.

## Implement the flow

1. Detect availability without prompting. Call `requestAccess()` from the user's Connect action. Access is scoped to the dApp origin.
2. Read the selected address and `networkPassphrase`. Compare the wallet's network with the application's intended network. `getNetwork()` reports state; it does not switch the wallet.
3. Subscribe to `onChange()`. Invalidate cached account, network, prepared XDR and pending results when the connection changes. Unsubscribe on disposal.
4. Build or simulate the operation for the intended network. Immediately before signing, confirm the account and network still match. Pass both `address` and `networkPassphrase` explicitly.
5. Handle rejected promises and resolved `{ error }` results. Check required result fields before reporting success. Error `-4` means user rejection; do not retry it automatically.
6. Verify the returned signer and signature where the application consumes the signed result. Treat a signed transaction, a submitted transaction and confirmed settlement as separate states.

The tested [wallet helper](https://skilld.dev/api/skills-raw/scopuly/scopuly-skills/scopuly-wallet/assets/wallet.ts) implements connection invalidation, result checks, duplicate-request protection, SEP-53 verification and signed-XDR verification. It uses `@scopuly/signer-extension-api@0.3.3`, `@stellar/stellar-sdk@17.0.0` and `buffer@6.0.3`. Copy it only if it fits the application; do not replace an existing wallet architecture unnecessarily.

## Signing contract

| Method | Input | Result |
| --- | --- | --- |
| `signTransaction` | Base64 transaction-envelope XDR | `signedTxXdr`; use `submit: false` for sign-only flows |
| `signAndSubmitTransaction` | Base64 transaction-envelope XDR | `status`, optional `hash` and signed XDR; `pending` is not settlement |
| `signMessage` | UTF-8 string | `signedMessage`: 64-byte Ed25519 signature encoded as hex |
| `signAuthEntry` | Base64 **HashIdPreimage** XDR for Soroban authorization | `signedAuthEntry`: raw 64-byte Ed25519 signature encoded as base64 |

Despite its name, `signAuthEntry` does not take a full `SorobanAuthorizationEntry` or return a signed XDR entry. Do not interchange its base64 signature with the hex message signature. Read [signing.md](https://skilld.dev/api/skills-raw/scopuly/scopuly-skills/scopuly-wallet/references/signing.md) before implementing these paths.

Scopuly signs through its approval UI. Do not request a secret key or seed phrase, invent a server signing endpoint, or add unattended signing. Signing options do not include derivation paths, custom submission URLs, or an API to switch networks. A provider-based integration does not need a WalletConnect/Reown project ID.

For sign-only transactions, return the verified XDR to the caller. Submit only when the requested application flow includes submission. After a timeout, reconcile the original transaction hash before offering another payment; a timeout is not evidence of failure.

`reportX402Receipt` attaches a verified receipt to wallet activity; it does not make a payment. This skill covers the wallet signing boundary, not an x402 merchant implementation, MPP sessions, autonomous agents or spending policies. Use the [Stellar payment skill](https://skills.stellar.org/skills/agentic-payments/SKILL.md) for protocol-specific work.

## Verify the integration

Exercise: missing provider, delayed injection, explicit connection, approved and rejected signing, account/network change during a request, malformed output, and listener cleanup. Verify layouts on mobile and desktop. Use Testnet for transaction examples; never substitute Mainnet when Testnet is unavailable.

The repository's [connect-and-sign example](https://github.com/Scopuly/scopuly-skills/tree/main/examples/connect-sign) and [device checklist](https://github.com/Scopuly/scopuly-skills/blob/main/docs/testing.md) provide reproducible checks. Report simulated-provider tests separately from real-device results.

## Sources and compatibility

Checked against the published Provider API **0.3.3** and SWK **2.7.0**, 2026-09-30. Pin versions in runnable examples; check newer releases before updating guidance.

- [Provider API and supported platforms](https://extension.scopuly.com/docs/provider-api/)
- [Public SDK source and types](https://github.com/Scopuly/signer-extension-api)
- [SWK Scopuly module](https://github.com/Creit-Tech/Stellar-Wallets-Kit/blob/main/src/sdk/modules/scopuly.module.ts)
