feat: add tempo mainnet chain support#1604
feat: add tempo mainnet chain support#1604albertoelias-crossmint wants to merge 5 commits intomainfrom
Conversation
Co-Authored-By: Alberto Elias <alberto.elias@paella.dev>
Original prompt from Alberto Elias |
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
🦋 Changeset detectedLatest commit: 5aeea1b The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
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 |
🔥 Smoke Test Results✅ Status: Passed Statistics
✅ All smoke tests passed!All critical flows are working correctly. This is a non-blocking smoke test. Full regression tests run separately. |
Co-Authored-By: Alberto Elias <alberto.elias@paella.dev>
Co-Authored-By: Alberto Elias <alberto.elias@paella.dev>
|
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! |
…itions Co-Authored-By: Alberto Elias <alberto.elias@paella.dev>
| name: "pathUSD", | ||
| symbol: "pathUSD", | ||
| }, | ||
| nativeCurrency: undefined as never, |
There was a problem hiding this 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.
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, |
There was a problem hiding this 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:
nativeCurrency: undefined as never, // Tempo has no native currency — do not accessOr 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.
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-baseandwallets-sdk:"tempo"as an EVM mainnet chain (chain ID4217)rpc.tempo.xyz, explorerexplore.mainnet.tempo.xyz, no native currency)toViemChain, display name map, and mainnet→testnet mappingopenapi.jsonto include"tempo"in all chain enum arrays (35 enums) so the auto-generatedtypes.gen.tsincludes it in union typesnativeCurrencyfrom both Tempo mainnet and testnet viem chain definitions (Tempo has no native currency)Human review checklist
4217is correct for Tempo mainnethttps://rpc.tempo.xyzis the correct mainnet endpointhttps://explore.mainnet.tempo.xyzis correct.nativeCurrencyon Tempo chains — both mainnet and testnet usenativeCurrency: undefined as neverto satisfy viem's requiredChaintype while reflecting that Tempo has no native currency. Any code that dereferences this (e.g..nativeCurrency.decimals) will fail at runtimetempoTestnetnativeCurrency removal is acceptable (changes existing published chain definition)openapi.jsonedits are acceptable as a temporary measure, or whether the backend spec should be updated firstTest plan
Relying on CI/CD — simple config addition following established patterns. Build verified locally with
pnpm build:libspassing.Package updates
@crossmint/common-sdk-base: patch@crossmint/wallets-sdk: patchChangeset 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