FRE-600: Fix code review blockers

- Consolidated duplicate UndoManagers to single instance
- Fixed connection promise to only resolve on 'connected' status
- Fixed WebSocketProvider import (WebsocketProvider)
- Added proper doc.destroy() cleanup
- Renamed isPresenceInitialized property to avoid conflict

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-25 00:08:01 -04:00
parent 65b552bb08
commit 7c684a42cc
48450 changed files with 5679671 additions and 383 deletions

79
node_modules/viem/tempo/zones/Abis.ts generated vendored Normal file
View File

@@ -0,0 +1,79 @@
export const zonePortal = [
{
name: 'deposit',
type: 'function',
stateMutability: 'nonpayable',
inputs: [
{ name: '_token', type: 'address' },
{ name: 'to', type: 'address' },
{ name: 'amount', type: 'uint128' },
{ name: 'memo', type: 'bytes32' },
],
outputs: [{ name: '', type: 'bytes32' }],
},
{
name: 'depositEncrypted',
type: 'function',
stateMutability: 'nonpayable',
inputs: [
{ name: 'token', type: 'address' },
{ name: 'amount', type: 'uint128' },
{ name: 'keyIndex', type: 'uint256' },
{
name: 'encrypted',
type: 'tuple',
components: [
{ name: 'ephemeralPubkeyX', type: 'bytes32' },
{ name: 'ephemeralPubkeyYParity', type: 'uint8' },
{ name: 'ciphertext', type: 'bytes' },
{ name: 'nonce', type: 'bytes12' },
{ name: 'tag', type: 'bytes16' },
],
},
],
outputs: [{ name: '', type: 'bytes32' }],
},
{
name: 'sequencerEncryptionKey',
type: 'function',
stateMutability: 'view',
inputs: [],
outputs: [
{ name: 'x', type: 'bytes32' },
{ name: 'yParity', type: 'uint8' },
],
},
{
name: 'encryptionKeyCount',
type: 'function',
stateMutability: 'view',
inputs: [],
outputs: [{ name: '', type: 'uint256' }],
},
] as const
export const zoneOutbox = [
{
name: 'requestWithdrawal',
type: 'function',
stateMutability: 'nonpayable',
inputs: [
{ name: 'token', type: 'address' },
{ name: 'to', type: 'address' },
{ name: 'amount', type: 'uint128' },
{ name: 'memo', type: 'bytes32' },
{ name: 'gasLimit', type: 'uint64' },
{ name: 'fallbackRecipient', type: 'address' },
{ name: 'data', type: 'bytes' },
{ name: 'revealTo', type: 'bytes' },
],
outputs: [],
},
{
name: 'calculateWithdrawalFee',
type: 'function',
stateMutability: 'view',
inputs: [{ name: 'gasLimit', type: 'uint64' }],
outputs: [{ name: 'fee', type: 'uint128' }],
},
] as const

10
node_modules/viem/tempo/zones/index.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
// biome-ignore lint/performance/noBarrelFile: entrypoint module
export * as Abis from './Abis.js'
export { http, type ZoneHttpConfig } from './transport.js'
export {
from,
getPortalAddress,
portalAddresses,
zone,
zoneModerato,
} from './zone.js'

6
node_modules/viem/tempo/zones/package.json generated vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"type": "module",
"types": "../../_types/tempo/zones/index.d.ts",
"module": "../../_esm/tempo/zones/index.js",
"main": "../../_cjs/tempo/zones/index.js"
}

58
node_modules/viem/tempo/zones/transport.ts generated vendored Normal file
View File

@@ -0,0 +1,58 @@
import {
type HttpTransport,
type HttpTransportConfig,
http as http_,
} from '../../clients/transports/http.js'
import type { Storage } from '../Storage.js'
import * as Storage_ from '../Storage.js'
export type ZoneHttpConfig = Omit<
HttpTransportConfig,
'batch' | 'raw' | 'rpcSchema'
> & {
/** Storage for reading zone authorization tokens. Defaults to sessionStorage (web) or memory (server). */
storage?: Storage | undefined
}
/**
* Creates an HTTP transport with support for Zone authentication tokens.
*
* Reads the authorization token from Storage and injects the
* `X-Authorization-Token` header on every request. Batching is disabled
* by default because zone tokens are account-scoped.
*
* @example
* ```ts
* import { createPublicClient } from 'viem'
* import { http, zone } from 'viem/tempo/zones' // or zoneModerato
*
* const client = createPublicClient({
* chain: zone(6),
* transport: http(),
* })
* ```
*/
export function http(
url?: string | undefined,
config: ZoneHttpConfig = {},
): HttpTransport {
const { storage: storage_, onFetchRequest, ...rest } = config
const storage = storage_ ?? Storage_.defaultStorage()
return (config) =>
http_(url, {
...rest,
async onFetchRequest(request, init) {
const next = (await onFetchRequest?.(request, init)) ?? init
const headers = new Headers(next.headers)
const chainId = config.chain?.id
if (chainId) {
const token = (await storage.getItem(`auth:token:${chainId}`)) ?? null
if (token) headers.set('X-Authorization-Token', token)
}
return { ...next, headers }
},
})(config)
}

70
node_modules/viem/tempo/zones/zone.ts generated vendored Normal file
View File

@@ -0,0 +1,70 @@
import { ZoneId } from 'ox/tempo'
import { tempo } from '../../chains/definitions/tempo.js'
import { tempoModerato } from '../../chains/definitions/tempoModerato.js'
import { defineChain } from '../../utils/chain/defineChain.js'
import { chainConfig } from '../chainConfig.js'
export const portalAddresses = {
[tempoModerato.id]: {
6: '0x7069DeC4E64Fd07334A0933eDe836C17259c9B23',
7: '0x3F5296303400B56271b476F5A0B9cBF74350D6Ac',
},
} as const satisfies Record<number, Record<number, `0x${string}`>>
export function getPortalAddress(
chainId: number,
zoneId: number,
): `0x${string}` {
const address = (
portalAddresses as Record<number, Record<number, `0x${string}`>>
)[chainId]?.[zoneId]
if (!address)
throw new Error(
`No portal address configured for zone ${zoneId} on chain ${chainId}.`,
)
return address
}
export const zone = /*#__PURE__*/ from({
sourceId: tempo.id,
rpcHost: 'tempo.xyz',
})
export const zoneModerato = /*#__PURE__*/ from({
sourceId: tempoModerato.id,
rpcHost: 'tempoxyz.dev',
})
/** Creates a zone chain factory for a given Tempo network. */
export function from(options: from.Options) {
return (id: number) => {
const chainId = ZoneId.toChainId(id)
const paddedId = String(id).padStart(3, '0')
return defineChain({
...chainConfig,
id: chainId,
name: `Tempo Zone ${paddedId}`,
nativeCurrency: {
name: 'USD',
symbol: 'USD',
decimals: 6,
},
rpcUrls: {
default: {
http: [`https://rpc-zone-${paddedId}.${options.rpcHost}`],
},
},
sourceId: options.sourceId,
})
}
}
declare namespace from {
type Options = {
/** RPC hostname used to construct zone RPC URLs (e.g. `tempo.xyz`). */
rpcHost: string
/** Chain ID of the parent Tempo chain (e.g. `4217` for mainnet, `42431` for moderato). */
sourceId: number
}
}