eliza plugin add payid-eliza-plugin
{
"dependencies": {
"payid-eliza-plugin": "^1.0.0"
}
}
Add the PayID plugin to your Eliza character definition:
{
"plugins": [
{
"name": "payid-eliza-plugin",
"config": {
"apiKey": "your-payid-api-key",
"baseUrl": "<https://api.reveel.id/v1>" // Optional, defaults to production
}
}
]
}
// Claim a PayID for a user
const result = await agent.actions.claimPayId({
userId: "123e4567-e89b-12d3-a456-426614174000",
name: "username"
});
console.log(`PayID claimed: ${result.name}`);
// Search for PayIDs
const results = await agent.actions.searchPayIds({
query: "john",
limit: 10,
activeOnly: true
});
console.log(`Found ${results.length} PayIDs`);
// Initialize a transaction to a PayID recipient
const transaction = await agent.actions.initTransaction({
userId: "123e4567-e89b-12d3-a456-426614174000",
recipientPayId: "johndoe", // Either recipientPayId or walletAddress is required
amount: 0.5,
token: "USDT", // USDT, USDC, ETH, BNB, or POL
network: "POL", // ETH, POL, OP, BNB, or BASE
message: "Payment for services" // Optional
});
console.log("Transaction initialized:", transaction.tx);