Skip to main content

Data Structures

Request Params

interface RequestParams {
chainId: string;
domain: string;
aud: string;
nonce: string;
type?: string;
nbf?: string;
exp?: string;
statement?: string;
requestId?: string;
resources?: string[];
}

Respond Params

type RespondParams = ResultResponse | ErrorResponse;

Payload Params (partial Cacao)

Used for requester to authenticate wallet

interface PayloadParams {
type: string; // same as Cacao Header type (t)
chainId: string;
domain: string;
aud: string;
version: string;
nonce: string;
iat: string;
nbf?: string;
exp?: string;
statement?: string;
requestId?: string;
resources?: string[];
}

Response

type Response = Cacao | ErrorResponse;

Pending Request

interface PendingRequest {
id: number;
pairingTopic: String;
payloadParams: PayloadParams;
}

Cacao Header (CAIP-74)

interface CacaoHeader {
t: string;
}

Cacao Payload (CAIP-74)

interface CacaoPayload {
iss: string;
domain: string;
aud: string;
version: string;
nonce: string;
iat: string;
nbf?: string;
exp?: string;
statement?: string;
requestId?: string;
resources?: string[];
}

Cacao Signature (CAIP-74)

interface CacaoSignature {
t: string;
s: string;
m?: string;
}

Cacao (CAIP-74)

interface Cacao {
h: CacaoHeader;
p: CacaoPayload;
s: CacaoSignature;
}

Result Response

interface ResultResponse {
id: number;
signature: CacaoSignature;
}

Error Response

interface ErrorResponse {
id: number;
error: {
code: number;
message: string;
};
}

Verify Context

Verify Context is appended to Auth Requests to provide metadata that was constructed internally by the client that is relevant to the specific request

{
"verified": {
"origin": string,
"validation": "UNKNOWN" | "VALID" | "INVALID",
"verifyUrl": string
}
}