Skip to content

TON-1789 Generator and iOS bridge fixes#482

Open
ProudOfZiggy wants to merge 2 commits into
mainfrom
feat/TON-843-generator-fixes
Open

TON-1789 Generator and iOS bridge fixes#482
ProudOfZiggy wants to merge 2 commits into
mainfrom
feat/TON-843-generator-fixes

Conversation

@ProudOfZiggy

@ProudOfZiggy ProudOfZiggy commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Wallet adapters now support optional walletId and workchain parameters alongside existing domain configuration.
    • Enhanced JSON schema generation to properly handle generic type instantiations.
  • Updates

    • getWallet() method parameter clarified for improved consistency.
  • Tests

    • Added test fixtures for generic type instantiation scenarios.

@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
appkit-minter Ready Ready Preview, Comment Jun 19, 2026 7:59am
kit-demo-wallet Ready Ready Preview, Comment Jun 19, 2026 7:59am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bf8ae985-e252-4f18-826f-8545556108d2

📥 Commits

Reviewing files that changed from the base of the PR and between db00ed0 and a9152dc.

📒 Files selected for processing (4)
  • packages/walletkit-ios-bridge/src/main.ts
  • packages/walletkit-ios-bridge/src/types.ts
  • packages/walletkit/src/api/scripts/generate-json-schema.js
  • packages/walletkit/src/api/scripts/generation-fixtures.ts

📝 Walkthrough

Walkthrough

Two independent changes: the iOS bridge package extends createV4R2WalletAdapter and createV5R1WalletAdapter with optional walletId and workchain parameters (forwarded to the underlying adapters) and renames getWallet's parameter from address to walletId. Separately, the JSON schema generation script adds detection and serialization of x-generic-instance-type vendor extensions for generic interface properties, with three new fixture interfaces covering the new code path.

Changes

iOS Bridge Wallet Adapter Parameter Extensions

Layer / File(s) Summary
SwiftWalletKit type contract updates
packages/walletkit-ios-bridge/src/types.ts
SignatureDomain added to imports; createV4R2WalletAdapter and createV5R1WalletAdapter parameters expanded with optional domain, walletId, and workchain; getWallet parameter renamed from address to walletId.
Adapter creation and getWallet implementation
packages/walletkit-ios-bridge/src/main.ts
Inline parameter types for both createV4R2WalletAdapter and createV5R1WalletAdapter are widened; new walletId and workchain values forwarded into WalletV4R2Adapter.create and WalletV5R1Adapter.create; getWallet logs and passes walletId instead of address.

JSON Schema Generator: x-generic-instance-type Support

Layer / File(s) Summary
GenericInterfaceNodeParser: genericInstanceType detection
packages/walletkit/src/api/scripts/generate-json-schema.js
createType detects property types that are TypeReference instantiations parameterized entirely by the interface's own type parameters, computes the instantiated type string, and stores it as genericInstanceType in property metadata.
Formatters: x-generic-instance-type serialization
packages/walletkit/src/api/scripts/generate-json-schema.js
GenericInterfaceTypeFormatter and GenericPropertiesObjectTypeFormatter each gain a branch emitting x-generic-instance-type when genericInstanceType is set, suppressing $ref for those properties, while preserving existing x-generic-type-ref and normal $ref paths.
Fixture interfaces for Cases 25–27
packages/walletkit/src/api/scripts/generation-fixtures.ts
GenericInstanceContainer, GenericInstanceMultiArg, and GenericInstanceSubsetArg are added to cover single-argument, multi-argument, and subset-argument generic instantiation cases respectively.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hoppity-hop through the bridge I go,
walletId passed where address used to flow.
The schema knows its generics now,
x-generic-instance-type — oh wow!
Each fixture nibbled, each formatter right,
This bunny ships clean code tonight. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references a ticket number (TON-1789) and broadly describes the changes as 'fixes' to the generator and iOS bridge, which aligns with the actual modifications across both areas.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/TON-843-generator-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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