Skip to content

feat(wallets): add deployImmediately flag to EVM addSigner with default true#1925

Open
maxsch-xmint wants to merge 4 commits into
mainfrom
devin/1781628100-add-deploy-immediately-flag
Open

feat(wallets): add deployImmediately flag to EVM addSigner with default true#1925
maxsch-xmint wants to merge 4 commits into
mainfrom
devin/1781628100-add-deploy-immediately-flag

Conversation

@maxsch-xmint

Copy link
Copy Markdown
Contributor

Description

Adds deployImmediately option to addSigner() for EVM wallets, matching the new backend flag from crossbit-main#26626. When true, the API returns an on-chain registration transaction (installed immediately) instead of the default lazy signature-request flow.

SDK defaults to true for EVM chains — signer registration now goes on-chain immediately by default. Callers can opt out with { deployImmediately: false }. Non-EVM chains (Solana/Stellar) are unaffected.

Changes:

  • RegisterSignerParams.deployImmediately?: boolean — new API param
  • AddSignerOptions.deployImmediately?: boolean — new user-facing option
  • wallet.addSigner() sends deployImmediately: true by default for EVM, omits it for Solana/Stellar
  • getPendingSignerOperation detects transaction chain entries (via onChain field) and returns type: "transaction" so the SDK approves the install tx instead of a signature
  • AddSignerReturnType for EVM gains optional transactionId (returned in prepareOnly mode for the transaction flow)

Test plan

  • Unit tests in signer-mapping.test.ts: new test for EVM deployImmediately chain entry with onChain field returning type: "transaction"
  • Unit tests in wallet.test.ts:
    • Verifies deployImmediately: true is sent by default for EVM
    • Verifies explicit deployImmediately: false override is forwarded
    • Verifies transaction approval flow when response has onChain field
    • Verifies prepareOnly returns transactionId for the transaction flow
  • All 398 existing tests continue to pass

Package updates

  • @crossmint/wallets-sdk: minor (changeset added)

Link to Devin session: https://crossmint.devinenterprise.com/sessions/1ca455c73e85421ca99667fda69b0cee
Requested by: @maxsch-xmint

devin-ai-integration Bot and others added 2 commits June 16, 2026 16:46
…lt true

Co-Authored-By: max@paella.dev <max@paella.dev>
Co-Authored-By: max@paella.dev <max@paella.dev>
@devin-ai-integration

Copy link
Copy Markdown
Contributor
Original prompt from Max

given the context of this PR: https://github.com/Paella-Labs/crossbit-main/pull/26626 can you add this flag to our SDKs with a default true value?

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@changeset-bot

changeset-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b4b7030

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@crossmint/wallets-sdk Minor
@crossmint/wallets-quickstart-devkit Patch
@crossmint/wallets-playground-react Patch
@crossmint/client-sdk-react-base Patch
@crossmint/client-sdk-react-native-ui Patch
@crossmint/client-sdk-react-ui Patch
@crossmint/wallets-playground-expo Patch
@crossmint/auth-ssr-nextjs-demo Patch
@crossmint/client-sdk-nextjs-starter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@greptile-apps

greptile-apps Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
packages/wallets/src/wallets/wallet.ts:777-778
Non-EVM chains still forward an explicit `deployImmediately: false` to the API. The PR states Solana/Stellar are unaffected, and the default path (`options` not set) correctly omits the field for those chains. However, when a caller passes `{ deployImmediately: false }` on a Solana/Stellar wallet, `options?.deployImmediately` resolves to `false`, `false ?? undefined` stays `false`, and `false != null` is truthy — so `deployImmediately: false` is included in the request body. If the backend validates this field on non-EVM signers it will either error or silently diverge from the stated behaviour.

```suggestion
            const isEvm = this.chain !== "solana" && this.chain !== "stellar";
            const deployImmediately = isEvm ? (options?.deployImmediately ?? true) : undefined;
```

Reviews (1): Last reviewed commit: "chore: add changeset for deployImmediate..." | Re-trigger Greptile

Comment thread packages/wallets/src/wallets/wallet.ts Outdated
Comment on lines +777 to +778
const isEvm = this.chain !== "solana" && this.chain !== "stellar";
const deployImmediately = options?.deployImmediately ?? (isEvm ? true : undefined);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Non-EVM chains still forward an explicit deployImmediately: false to the API. The PR states Solana/Stellar are unaffected, and the default path (options not set) correctly omits the field for those chains. However, when a caller passes { deployImmediately: false } on a Solana/Stellar wallet, options?.deployImmediately resolves to false, false ?? undefined stays false, and false != null is truthy — so deployImmediately: false is included in the request body. If the backend validates this field on non-EVM signers it will either error or silently diverge from the stated behaviour.

Suggested change
const isEvm = this.chain !== "solana" && this.chain !== "stellar";
const deployImmediately = options?.deployImmediately ?? (isEvm ? true : undefined);
const isEvm = this.chain !== "solana" && this.chain !== "stellar";
const deployImmediately = isEvm ? (options?.deployImmediately ?? true) : undefined;
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/wallets/src/wallets/wallet.ts
Line: 777-778

Comment:
Non-EVM chains still forward an explicit `deployImmediately: false` to the API. The PR states Solana/Stellar are unaffected, and the default path (`options` not set) correctly omits the field for those chains. However, when a caller passes `{ deployImmediately: false }` on a Solana/Stellar wallet, `options?.deployImmediately` resolves to `false`, `false ?? undefined` stays `false`, and `false != null` is truthy — so `deployImmediately: false` is included in the request body. If the backend validates this field on non-EVM signers it will either error or silently diverge from the stated behaviour.

```suggestion
            const isEvm = this.chain !== "solana" && this.chain !== "stellar";
            const deployImmediately = isEvm ? (options?.deployImmediately ?? true) : undefined;
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch from the cold-blooded code reviewer 🦎 — applied the suggested fix in 163b381. Non-EVM chains now always get undefined regardless of what the caller passes.

devin-ai-integration Bot and others added 2 commits June 16, 2026 16:50
Co-Authored-By: max@paella.dev <max@paella.dev>
Co-Authored-By: max@paella.dev <max@paella.dev>
@greptile-apps

greptile-apps Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Reviews (2): Last reviewed commit: "style: remove redundant parentheses for ..." | Re-trigger Greptile

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.

1 participant