Skip to content

feat: add tempo mainnet chain support#1604

Open
albertoelias-crossmint wants to merge 5 commits intomainfrom
devin/1771955425-add-tempo-mainnet
Open

feat: add tempo mainnet chain support#1604
albertoelias-crossmint wants to merge 5 commits intomainfrom
devin/1771955425-add-tempo-mainnet

Conversation

@albertoelias-crossmint
Copy link
Collaborator

@albertoelias-crossmint albertoelias-crossmint commented Feb 24, 2026

Description

Adds Tempo mainnet support to the SDK, mirroring the backend addition and following the same pattern as the testnet PR (#1547).

Changes across common-sdk-base and wallets-sdk:

  • Register "tempo" as an EVM mainnet chain (chain ID 4217)
  • Add viem chain definition (rpc.tempo.xyz, explorer explore.mainnet.tempo.xyz, no native currency)
  • Add to production AA chains, toViemChain, display name map, and mainnet→testnet mapping
  • Update openapi.json to include "tempo" in all chain enum arrays (35 enums) so the auto-generated types.gen.ts includes it in union types
  • Remove nativeCurrency from both Tempo mainnet and testnet viem chain definitions (Tempo has no native currency)

Note: The openapi.json was manually edited to add "tempo" to chain enums. This will need to be reconciled when the backend API spec is regenerated to include tempo mainnet. Until then, this manual edit is necessary for the SDK build to compile.

Human review checklist

  • Verify chain ID 4217 is correct for Tempo mainnet
  • Verify RPC URL https://rpc.tempo.xyz is the correct mainnet endpoint
  • Verify explorer URL https://explore.mainnet.tempo.xyz is correct
  • Verify no SDK code paths access .nativeCurrency on Tempo chains — both mainnet and testnet use nativeCurrency: undefined as never to satisfy viem's required Chain type while reflecting that Tempo has no native currency. Any code that dereferences this (e.g. .nativeCurrency.decimals) will fail at runtime
  • Confirm the tempoTestnet nativeCurrency removal is acceptable (changes existing published chain definition)
  • Confirm the manual openapi.json edits are acceptable as a temporary measure, or whether the backend spec should be updated first

Test plan

Relying on CI/CD — simple config addition following established patterns. Build verified locally with pnpm build:libs passing.

Package updates

  • @crossmint/common-sdk-base: patch
  • @crossmint/wallets-sdk: patch

Changeset added via .changeset/add-tempo-mainnet.md.


Link to Devin run: https://crossmint.devinenterprise.com/sessions/ad25a8ddaeca477e8d33fb6368060ed0
Requested by: @albertoelias-crossmint

Last reviewed commit: 5aeea1b

Greptile also left 2 inline comments on this PR.

Co-Authored-By: Alberto Elias <alberto.elias@paella.dev>
@devin-ai-integration
Copy link
Contributor

Original prompt from Alberto Elias
we want to add tempo mainnet to the sdk. this is how we added it the testnet https://github.com/Crossmint/crossmint-sdk/pull/1547 and this is how we added mainnet to backend: https://github.com/Paella-Labs/crossbit-main/pull/23625

@devin-ai-integration
Copy link
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 and CI monitoring

@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2026

🦋 Changeset detected

Latest commit: 5aeea1b

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

This PR includes changesets to release 17 packages
Name Type
@crossmint/common-sdk-base Patch
@crossmint/wallets-sdk Patch
@crossmint/client-sdk-auth Patch
@crossmint/client-sdk-base Patch
@crossmint/client-sdk-react-base Patch
@crossmint/client-sdk-react-native-ui Patch
@crossmint/client-sdk-react-ui Patch
@crossmint/client-sdk-verifiable-credentials Patch
@crossmint/client-sdk-smart-wallet Patch
@crossmint/client-sdk-walletconnect Patch
@crossmint/common-sdk-auth Patch
@crossmint/server-sdk Patch
expo-demo Patch
@crossmint/client-sdk-nextjs-starter Patch
@crossmint/auth-ssr-nextjs-demo Patch
@crossmint/wallets-quickstart-devkit Patch
crossmint-auth-node 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

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@github-actions
Copy link
Contributor

github-actions bot commented Feb 24, 2026

🔥 Smoke Test Results

Status: Passed

Statistics

  • Total Tests: 5
  • Passed: 5 ✅
  • Failed: 0
  • Skipped: 0
  • Duration: 5.14 min

✅ All smoke tests passed!

All critical flows are working correctly.


This is a non-blocking smoke test. Full regression tests run separately.

greptile-apps[bot]

This comment was marked as resolved.

Co-Authored-By: Alberto Elias <alberto.elias@paella.dev>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

7 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Co-Authored-By: Alberto Elias <alberto.elias@paella.dev>
@devin-ai-integration
Copy link
Contributor

Good catch on the alphabetical ordering, you cold-blooded code reviewer 🦎 — fixed in 46e8aaf. TEMPO now slithers into its rightful place between STORY and WORLDCHAIN. Thanks for not letting that one shed past!

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

7 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

…itions

Co-Authored-By: Alberto Elias <alberto.elias@paella.dev>
devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

name: "pathUSD",
symbol: "pathUSD",
},
nativeCurrency: undefined as never,
Copy link
Contributor

Choose a reason for hiding this comment

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

Breaking change to a published chain definition

Replacing nativeCurrency (previously { decimals: 6, name: "pathUSD", symbol: "pathUSD" }) with undefined as never is a breaking change for any existing consumers of @crossmint/wallets-sdk who reference tempoTestnet.nativeCurrency.decimals, .symbol, or .name. At runtime these accesses will throw TypeError: Cannot read properties of undefined.

The changeset marks this as a patch bump, but since it removes an existing field from a published type, it should be at least minor (or major under strict semver). Consider bumping the changeset to reflect the breaking nature of this change, or add a prominent callout in the release notes.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/wallets/src/chains/definitions/tempoTestnet.ts
Line: 6

Comment:
**Breaking change to a published chain definition**

Replacing `nativeCurrency` (previously `{ decimals: 6, name: "pathUSD", symbol: "pathUSD" }`) with `undefined as never` is a breaking change for any existing consumers of `@crossmint/wallets-sdk` who reference `tempoTestnet.nativeCurrency.decimals`, `.symbol`, or `.name`. At runtime these accesses will throw `TypeError: Cannot read properties of undefined`.

The changeset marks this as a `patch` bump, but since it removes an existing field from a published type, it should be at least `minor` (or `major` under strict semver). Consider bumping the changeset to reflect the breaking nature of this change, or add a prominent callout in the release notes.

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

export const tempo = defineChain({
id: 4217,
name: "Tempo",
nativeCurrency: undefined as never,
Copy link
Contributor

Choose a reason for hiding this comment

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

Runtime risk with nativeCurrency: undefined as never

undefined as never satisfies the TypeScript compiler, but at runtime tempo.nativeCurrency is undefined. While no code in this repository currently dereferences .nativeCurrency.decimals etc., downstream consumers and viem-integrated tooling (e.g., wallet clients that display token balances or format gas amounts) may access this field and throw TypeError: Cannot read properties of undefined.

Consider providing a sentinel value that makes the "no native currency" contract explicit, for example:

nativeCurrency: undefined as never,  // Tempo has no native currency — do not access

Or document this constraint in a JSDoc comment on the exported constant so consumers are warned at the IDE level:

/**
 * @note Tempo has no native currency. `nativeCurrency` is intentionally `undefined`.
 * Do not access `.nativeCurrency.*` properties — they will throw at runtime.
 */
export const tempo = defineChain({
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/wallets/src/chains/definitions/tempo.ts
Line: 6

Comment:
**Runtime risk with `nativeCurrency: undefined as never`**

`undefined as never` satisfies the TypeScript compiler, but at runtime `tempo.nativeCurrency` is `undefined`. While no code in this repository currently dereferences `.nativeCurrency.decimals` etc., downstream consumers and viem-integrated tooling (e.g., wallet clients that display token balances or format gas amounts) may access this field and throw `TypeError: Cannot read properties of undefined`.

Consider providing a sentinel value that makes the "no native currency" contract explicit, for example:

```ts
nativeCurrency: undefined as never,  // Tempo has no native currency — do not access
```

Or document this constraint in a JSDoc comment on the exported constant so consumers are warned at the IDE level:

```ts
/**
 * @note Tempo has no native currency. `nativeCurrency` is intentionally `undefined`.
 * Do not access `.nativeCurrency.*` properties — they will throw at runtime.
 */
export const tempo = defineChain({
```

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

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