zone.getEncryptionKey
Gets the active sequencer encryption key and its zero-based index from a zone portal. This action uses a parent Tempo chain client.
Usage
import { client } from './viem.config'
const { keyIndex, publicKey } = await client.zone.getEncryptionKey({
zoneId: 7,
})
console.log('Key index:', keyIndex)
console.log('Public key:', publicKey)import { Account, createClient } from 'viem/tempo'
export const client = createClient({
account: Account.fromSecp256k1('0x...'),
})The key count and public key are read in one deployless multicall snapshot, keeping the key paired with its index during rotation.
Return Type
type ReturnType = {
keyIndex: bigint
publicKey: {
// SEC1 compressed public key prefix.
prefix: 2 | 3
x: Hex
}
}Parameters
zoneId
- Type:
number
Zone ID whose portal contains the encryption key.
portalAddress (optional)
- Type:
Address - Default: Resolved from the client chain and
zoneId.
Explicit zone portal address.