stoa/packages/contracts/abi/SubscriptionManager.json
stoa 606076ab64 feat(web+abi): wallet connect, agents/contracts APIs, real ABI artifacts
- 13 contract ABIs generated via forge inspect -> packages/contracts/abi/*.json
- apps/web: lib/wallet.ts (viem injected wallet), /connect page (connect + add Pharos network + PHRS balance), /agents page, /api/agents (registry events + demo fallback), /api/contracts (contract set + addresses)
- packages/contracts/deployments/{pharos-atlantic,localhost}.json
- web app now: 6 pages + 6 API routes
2026-06-12 01:10:33 +03:00

344 lines
6.2 KiB
JSON

[
{
"type": "function",
"name": "cancel",
"inputs": [
{
"name": "subId",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "charge",
"inputs": [
{
"name": "subId",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "createPlan",
"inputs": [
{
"name": "price",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "period",
"type": "uint64",
"internalType": "uint64"
}
],
"outputs": [
{
"name": "planId",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "nextPlanId",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "nextSubId",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "plans",
"inputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "provider",
"type": "address",
"internalType": "address"
},
{
"name": "price",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "period",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "active",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "subs",
"inputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "planId",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "subscriber",
"type": "address",
"internalType": "address"
},
{
"name": "balance",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "nextCharge",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "active",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "subscribe",
"inputs": [
{
"name": "planId",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "subId",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "payable"
},
{
"type": "function",
"name": "topUp",
"inputs": [
{
"name": "subId",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "event",
"name": "Cancelled",
"inputs": [
{
"name": "subId",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
},
{
"name": "refunded",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Charged",
"inputs": [
{
"name": "subId",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "nextCharge",
"type": "uint64",
"indexed": false,
"internalType": "uint64"
}
],
"anonymous": false
},
{
"type": "event",
"name": "PlanCreated",
"inputs": [
{
"name": "planId",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
},
{
"name": "provider",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "price",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "period",
"type": "uint64",
"indexed": false,
"internalType": "uint64"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Subscribed",
"inputs": [
{
"name": "subId",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
},
{
"name": "planId",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
},
{
"name": "subscriber",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "funded",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "ToppedUp",
"inputs": [
{
"name": "subId",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "error",
"name": "BadParams",
"inputs": []
},
{
"type": "error",
"name": "InsufficientBalance",
"inputs": []
},
{
"type": "error",
"name": "NotActive",
"inputs": []
},
{
"type": "error",
"name": "NotSubscriber",
"inputs": []
},
{
"type": "error",
"name": "TooEarly",
"inputs": []
},
{
"type": "error",
"name": "TransferFailed",
"inputs": []
},
{
"type": "error",
"name": "UnknownPlan",
"inputs": []
}
]