zone.signAuthorizationToken
Signs a zone authorization token and stores it for the zone HTTP transport. The token is used to authenticate all subsequent zone RPC requests via the X-Authorization-Token header.
Usage
import { } from './zones.config'
const = await ..()
.('Token:', .)
Token: 0x...import { } from 'viem'
import { , , } from 'viem/tempo'
export const = .({
: .('0x...'),
: .,
: (),
})Return Type
type ReturnType = {
authentication: Authentication
token: string
}The signed authentication object and the serialized token string.
Parameters
account (optional)
- Type:
Account
Account to sign the authorization token with. Defaults to the client's account.
chain (optional)
- Type:
Chain
Zone chain to sign the token for. Defaults to the client's chain.
expiresAt (optional)
- Type:
number
Unix timestamp when the token expires.
issuedAt (optional)
- Type:
number
Unix timestamp when the token was issued.
store (optional)
- Type:
Store.Store
Store used to persist the signed token. Defaults to
Store.defaultStore.