Defined in: sdk-js/src/v4/resources/auth.ts:14
client.auth.* — JWT exchange for the REST API.
The aggregator's POST /auth:exchange takes (ownerAddress, signature, message) and returns a JWT bound to the EOA. The SDK keeps the JWT on the shared transport so subsequent requests carry it as a Bearer token automatically.
new AuthResource(transport: Transport): AuthResource;
Defined in: sdk-js/src/v4/resources/auth.ts:15
| Parameter | Type |
|---|---|
transport | Transport |
AuthResource
exchange(req: object): Promise<{
token: string;
expiresAt: string;
subject?: string;
}>;
Defined in: sdk-js/src/v4/resources/auth.ts:23
POST /auth:exchange — verify an EIP-191 signature and stash the returned JWT on the transport. Returns the raw response so callers can persist the token externally (browser localStorage, keychain, etc.).
| Parameter | Type | Description |
|---|---|---|
req | { ownerAddress: string; signature: string; message: string; } | - |
req.ownerAddress | string | - |
req.signature | string | Description EIP-191 personal_sign signature of message. |
req.message | string | Description The plain-text message that was signed. Must use the canonical format with the EigenLayer registration chain ID (NOT the workflow target chain). SDKs generate this locally. |
Promise<{
token: string;
expiresAt: string;
subject?: string;
}>
exchangeWithKey(privateKey: string, opts?: object): Promise<{
token: string;
expiresAt: string;
subject?: string;
}>;
Defined in: sdk-js/src/v4/resources/auth.ts:42
Convenience wrapper: sign the canonical message with a private
key, exchange it, and return the JWT. The exchanged token is
stashed on the transport. Designed for Node tooling — browser
callers should use buildAuthMessage + a wallet's
personal_sign and then call exchange() directly.
| Parameter | Type |
|---|---|
privateKey | string |
opts? | { ownerAddress?: string; chainId?: number; version?: string; } |
opts.ownerAddress? | string |
opts.chainId? | number |
opts.version? | string |
Promise<{
token: string;
expiresAt: string;
subject?: string;
}>
clear(): void;
Defined in: sdk-js/src/v4/resources/auth.ts:58
Forget the currently-stored JWT. Future requests fall back to anonymous and most endpoints will return 401.
void