Fix four content-drift items flagged in #21#22
Conversation
- standards/SKILL.md: point dangling ../security/SKILL.md link at ../soroban/SKILL.md#part-3-security (security was merged into the soroban skill during the 7-skill restructure)
- soroban/SKILL.md: normalize 12 deprecated env.register_contract(_wasm) call sites to env.register(X, ()); both old forms are #[deprecated] in soroban-sdk
- soroban/SKILL.md: rename `stellar contract install` to `stellar contract upload` (install is now a deprecated alias in the current CLI)
- dapp/SKILL.md + soroban/SKILL.md pitfalls: switch Freighter examples to the v3 API surface (getAddress / requestAccess, isConnected/isAllowed/signTransaction now return object shapes with { ..., error? })
|
There was a problem hiding this comment.
Pull request overview
Fixes documentation/content drift across the restructured skill set by updating broken cross-skill links and modernizing Soroban/Freighter API snippets to current usage.
Changes:
- Updates the Standards skill security reference to point at Soroban Part 3 (Security) instead of a removed
security/skill. - Normalizes deprecated Soroban SDK test registration examples to
env.register(..., ())and updates CLI docs fromstellar contract installtostellar contract upload. - Updates Freighter wallet integration snippets to the v3 API surface (
getAddress/requestAccess, object-shaped returns, and newsignTransactionresult).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| skills/standards/SKILL.md | Fixes a dangling link by pointing security guidance at Soroban’s Security section. |
| skills/soroban/SKILL.md | Updates Soroban test examples and CLI docs; modernizes one Freighter troubleshooting snippet. |
| skills/dapp/SKILL.md | Updates the Freighter hook example to use the v3 Freighter API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const { isAllowed: granted } = await isAllowed(); | ||
| if (!granted) { | ||
| // requestAccess prompts the user and returns { address, error } | ||
| await requestAccess(); |
There was a problem hiding this comment.
Fixed in 9abdab8. The snippet now captures requestAccess() result and throws when error is returned.
| import { isConnected, isAllowed, requestAccess } from "@stellar/freighter-api"; | ||
|
|
||
| async function checkFreighter() { | ||
| // Check if extension is installed | ||
| const connected = await isConnected(); | ||
| if (!connected) { | ||
| const { isConnected: installed, error } = await isConnected(); | ||
| if (error || !installed) { | ||
| // Prompt user to install |
There was a problem hiding this comment.
Fixed in 9abdab8. Updated the network mismatch snippet to use Freighter v3 getNetwork() object return shape and handle error.
| const { isConnected: installed, error } = await isConnected(); | ||
| if (error || !installed) return; | ||
|
|
||
| // getAddress returns address: "" until the app has been granted access, | ||
| // so a non-empty address means we're already authorized. | ||
| const { address: addr } = await getAddress(); | ||
| if (!addr) return; | ||
|
|
||
| const { network: net } = await getNetwork(); | ||
| setConnected(true); | ||
| setAddress(addr); | ||
| setNetwork(net); |
There was a problem hiding this comment.
Fixed in 9abdab8. The hook snippet now handles error from getAddress()/getNetwork() and validates address/network before setting connected state.
Agent-Logs-Url: https://github.com/stellar/stellar-dev-skill/sessions/9c753e1a-6068-4574-9159-8969aed852a0 Co-authored-by: kaankacar <103106776+kaankacar@users.noreply.github.com>
Closes #21.
../security/SKILL.mdlink →../soroban/SKILL.md#part-3-security(security was merged into the soroban skill in refactor: restructure skill into 7 thematic sub-skills #17)env.register_contract(_wasm)(None, X)call sites toenv.register(X, ())— both old forms are#[deprecated(note = "use \register`")]` in soroban-sdkstellar contract install→stellar contract upload(the current CLI keepsinstallas a deprecated alias that emits a warning)getPublicKeyreplaced withgetAddress,setAllowed + getPublicKeyflow replaced withrequestAccess, andisConnected/isAllowed/signTransactiondestructured for their new{ ..., error? }return shapes