Loading...
Loading...
Compare original and translation side by side
KARMA_API_KEY/setup-agentKARMA_API_KEY/setup-agent| Field | Required | Description |
|---|---|---|
| Yes | Chain where the project lives |
| Yes | The project's attestation UID |
| Yes | The community/program UID (bytes32) that funded the project |
| Yes | Grant title (1-200 chars) |
| No | Grant description (max 5000 chars) |
| No | Funding amount as string (e.g., "50000") |
| No | Link to the grant proposal |
| No | Program identifier (see below) |
| 字段 | 必填 | 描述 |
|---|---|---|
| 是 | 项目所在的链 |
| 是 | 项目的证明UID |
| 是 | 为项目提供资助的社区/项目UID(bytes32格式) |
| 是 | 资助标题(1-200个字符) |
| 否 | 资助描述(最多5000个字符) |
| 否 | 资助金额,字符串格式(例如:"50000") |
| 否 | 资助提案的链接 |
| 否 | 项目标识符(见下文) |
programIdundefinedprogramIdundefined
Use the matching `programId` value in the request params.
使用请求参数中匹配的`programId`值。curl -s "${BASE_URL}/v2/projects?q=PROJECT_NAME&limit=5&page=1" | python3 -c "
import sys, json
data = json.load(sys.stdin)
for p in data.get('payload', []):
d = p.get('details', {})
print(f'Title: {d.get(\"title\", \"N/A\")} | Chain: {p[\"chainID\"]} | UID: {p[\"uid\"]}')
"curl -s "${BASE_URL}/v2/communities/?limit=10&page=1" | python3 -c "
import sys, json
data = json.load(sys.stdin)
for c in data if isinstance(data, list) else data.get('payload', data.get('data', [])):
d = c.get('details', {})
name = d.get('name', 'N/A') if isinstance(d, dict) else 'N/A'
print(f'Name: {name} | Chain: {c.get(\"chainID\", \"?\")} | UID: {c[\"uid\"]}')
"curl -s "${BASE_URL}/v2/projects?q=PROJECT_NAME&limit=5&page=1" | python3 -c "
import sys, json
data = json.load(sys.stdin)
for p in data.get('payload', []):
d = p.get('details', {})
print(f'Title: {d.get(\"title\", \"N/A\")} | Chain: {p[\"chainID\"]} | UID: {p[\"uid\"]}')
"curl -s "${BASE_URL}/v2/communities/?limit=10&page=1" | python3 -c "
import sys, json
data = json.load(sys.stdin)
for c in data if isinstance(data, list) else data.get('payload', data.get('data', [])):
d = c.get('details', {})
name = d.get('name', 'N/A') if isinstance(d, dict) else 'N/A'
print(f'Name: {name} | Chain: {c.get(\"chainID\", \"?\")} | UID: {c[\"uid\"]}')
"| User says | Action |
|---|---|
| "add a grant from the Offchain Super Chain program to project X" | Look up project UID, community UID, and programId from programs list |
| "add a grant to project X" | Look up project UID, ask for community and grant details |
| "project X received $50K from Optimism" | Look up project + community UIDs, ask if it's a specific program or generic grant |
| "add funding from program Y to project X" | Look up community UID + programId for program Y, then create grant |
| "create a grant for 0xabc... from 0xdef..." | Use UIDs directly |
Important: When the user mentions a specific program name, always look up thevia the programs API and include it. WithoutprogramId, the grant won't appear under that program on the website.programId
| 用户表述 | 执行操作 |
|---|---|
| "给项目X添加来自Offchain Super Chain项目的资助" | 从项目列表中查询项目UID、社区UID以及programId |
| "给项目X添加一笔资助" | 查询项目UID,向用户询问社区和资助详情 |
| "项目X从Optimism获得了5万美元资助" | 查询项目和社区UID,询问用户该资助属于特定项目还是通用资助 |
| "给项目X添加来自Y项目的资金" | 查询Y项目的社区UID和programId,然后创建资助 |
| "为0xabc...创建一笔来自0xdef...的资助" | 直接使用提供的UID |
重要提示:当用户提及具体的项目名称时,务必通过项目API查询并将其包含在内。缺少programId的资助不会在网站的对应项目下展示。programId
BASE_URL="${KARMA_API_URL:-https://gapapi.karmahq.xyz}"
curl -s -X POST "${BASE_URL}/v2/agent/execute" \
-H "Content-Type: application/json" \
-H "x-api-key: ${KARMA_API_KEY}" \
-d '{
"action": "createGrant",
"params": {
"chainId": 10,
"projectUID": "0xproject...",
"communityUID": "0xcommunity...",
"title": "Optimism Builder Grant",
"description": "Funding for protocol development",
"amount": "50000",
"proposalURL": "https://gov.optimism.io/proposal/123"
}
}'BASE_URL="${KARMA_API_URL:-https://gapapi.karmahq.xyz}"
curl -s -X POST "${BASE_URL}/v2/agent/execute" \
-H "Content-Type: application/json" \
-H "x-api-key: ${KARMA_API_KEY}" \
-d '{
"action": "createGrant",
"params": {
"chainId": 10,
"projectUID": "0xproject...",
"communityUID": "0xcommunity...",
"title": "Optimism Builder Grant",
"description": "Funding for protocol development",
"amount": "50000",
"proposalURL": "https://gov.optimism.io/proposal/123"
}
}'| Scenario | Response |
|---|---|
| Project or community name given instead of UID | Look up UIDs via the APIs |
| Community not found | "Could not find that community/program. Provide the community UID directly." |
| Amount with currency symbol | Strip the symbol and convert (e.g., "$50K" → "50000") |
| Missing community UID | This is required — ask the user which program/community funded the project |
| 场景 | 响应内容 |
|---|---|
| 提供了项目或社区名称而非UID | 通过API查询对应的UID |
| 未找到对应社区 | "无法找到该社区/项目。请直接提供社区UID。" |
| 金额带有货币符号 | 去除符号并转换格式(例如:"$50K" → "50000") |
| 缺少社区UID | 该字段为必填项 — 询问用户是哪个项目/社区为该项目提供了资助 |