import { Grantex } from '@grantex/sdk';const grantex = new Grantex({ apiKey: process.env.GRANTEX_API_KEY });// Issue a passport for your agentconst passport = await grantex.passports.issue({ agentId: 'ag_01HXYZ...', grantId: 'grnt_01HXYZ...', allowedMPPCategories: ['inference', 'compute'], maxTransactionAmount: { amount: 50, currency: 'USDC' }, paymentRails: ['tempo'], expiresIn: '24h', // max: 720h (30 days)});console.log(passport.passportId);// "urn:grantex:passport:01HXYZ..."
The grant must include the corresponding payments:mpp:* scopes for each category.
For example, requesting ['inference', 'compute'] requires the grant to have
payments:mpp:inference and payments:mpp:compute scopes.