Skip to content

Init improvements#7

Merged
MastaP merged 5 commits into
mainfrom
init_improvements
Mar 18, 2026
Merged

Init improvements#7
MastaP merged 5 commits into
mainfrom
init_improvements

Conversation

@MastaP
Copy link
Copy Markdown
Member

@MastaP MastaP commented Mar 18, 2026

No description provided.

@MastaP MastaP requested a review from Copilot March 18, 2026 20:12
@MastaP MastaP self-assigned this Mar 18, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Sphere wallet initialization to improve DM backfill behavior and handle configured nametag changes by switching (or deriving) addresses within the same wallet, along with updating the Sphere SDK dependency needed for the new address APIs.

Changes:

  • Pass a dmSince timestamp into Sphere.init to control DM history/backfill.
  • When configured nametag differs from the current wallet address nametag, switch to an existing address that owns the nametag or derive a new address and mint it there.
  • Update unit tests to cover the new nametag-switching behavior and bump @unicitylabs/sphere-sdk to 0.6.8-dev.2.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
test/sphere.test.ts Adds mocks/tests validating the new address switching + mint-on-new-address behavior.
src/sphere.ts Adds dmSince init option and implements nametag-aware address switching/minting logic.
package.json Pins Sphere SDK to a dev build to access new wallet/address APIs.
package-lock.json Updates lockfile to reflect the new package version and dependency resolution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/sphere.ts
Comment on lines 116 to 120
...(existingMnemonic ? { mnemonic: existingMnemonic } : { autoGenerate: true }),
...(cfg.nametag ? { nametag: cfg.nametag } : {}),
...(groupChat ? { groupChat: groupChatRelays ? { relays: groupChatRelays } : true } : {}),
dmSince: Math.floor(Date.now() / 1000) - 86400,
});
Comment thread src/sphere.ts
Comment on lines 114 to 120
const result = await Sphere.init({
...providers,
...(existingMnemonic ? { mnemonic: existingMnemonic } : { autoGenerate: true }),
...(cfg.nametag ? { nametag: cfg.nametag } : {}),
...(groupChat ? { groupChat: groupChatRelays ? { relays: groupChatRelays } : true } : {}),
dmSince: Math.floor(Date.now() / 1000) - 86400,
});
Comment thread package.json
"@clack/prompts": "^0.10.0",
"@sinclair/typebox": "^0.34.48",
"@unicitylabs/sphere-sdk": "^0.6.7"
"@unicitylabs/sphere-sdk": "0.6.8-dev.2"
@MastaP MastaP merged commit 1d152ea into main Mar 18, 2026
1 check passed
@MastaP MastaP deleted the init_improvements branch March 18, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants