
Rest API V1
Introduction
JWT Authentication
export function generateIntentXJWTIssueMessage(
account: Address,
scopes: AllowedScopes[],
expiration: AllowedExpiration
): RegisterTypedData {
const message: RegisterTypedData = {
domain: {
name: "IntentX",
version: "1",
},
message: {
userAddress: account,
scope: scopes,
expiration: expiration,
signatureExpiration: parseInt(((Date.now() + 1000 * 60 * 10) / 1000).toFixed(0)), // 10 minutes from now
},
primaryType: "Session",
types: {
Session: [
{ name: "userAddress", type: "address" },
{ name: "scope", type: "string[]" },
{ name: "expiration", type: "string" },
],
},
};
return message;
}Last updated

