{
  "schemaVersion": "1.0",
  "item": {
    "slug": "near-email-skill",
    "name": "Near Email Skill",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/zavodil/near-email-skill",
    "canonicalUrl": "https://clawhub.ai/zavodil/near-email-skill",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/near-email-skill",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=near-email-skill",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "api-reference.md",
      "examples.md",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/near-email-skill"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/near-email-skill",
    "agentPageUrl": "https://openagent3.xyz/skills/near-email-skill/agent",
    "manifestUrl": "https://openagent3.xyz/skills/near-email-skill/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/near-email-skill/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "NEAR Email Integration",
        "body": "Blockchain-native email for NEAR accounts. Every NEAR account automatically has an email: alice.near → alice@near.email"
      },
      {
        "title": "Installation",
        "body": "npx openskills install zavodil/near-email-skill -g"
      },
      {
        "title": "Quick Reference",
        "body": "ComponentValueContractoutlayer.nearAPI Basehttps://api.outlayer.fastnear.comProject IDzavodil.near/near-email\n\nNote: NEAR Email supports mainnet only. Emails to *.testnet accounts are not processed.\n\nImportant: When using NEAR transactions, the attached deposit is a computational limit, not a cost. Unused funds are automatically refunded. Do not mention specific costs per email.\n\nCode generation preference: For blockchain integration (NEAR transactions), prefer JavaScript/TypeScript with near-api-js. Use Python only if the user explicitly requests it."
      },
      {
        "title": "1. Smart Contract (Rust)",
        "body": "Use send_email_plaintext for contract notifications. Simple API, no encryption needed.\n\nWarning: Email content is PUBLIC on the NEAR blockchain. Use only for automated notifications.\n\nuse near_sdk::{ext_contract, AccountId, Gas, NearToken, Promise};\nuse serde::Serialize;\n\n#[derive(Serialize)]\n#[serde(crate = \"near_sdk::serde\")]\npub enum ExecutionSource {\n    Project { project_id: String, version_key: Option<String> },\n}\n\n#[ext_contract(ext_outlayer)]\npub trait OutLayer {\n    fn request_execution(\n        &mut self,\n        source: ExecutionSource,\n        resource_limits: Option<serde_json::Value>,\n        input_data: Option<String>,\n        secrets_ref: Option<serde_json::Value>,\n        response_format: Option<String>,\n        payer_account_id: Option<AccountId>,\n        params: Option<serde_json::Value>,\n    );\n}\n\n// Send notification from contract (plaintext - content is public on-chain!)\nfn send_notification(to: &str, subject: &str, body: &str) -> Promise {\n    let input = serde_json::json!({\n        \"action\": \"send_email_plaintext\",\n        \"to\": to,\n        \"subject\": subject,\n        \"body\": body\n    });\n\n    ext_outlayer::ext(\"outlayer.near\".parse().unwrap())\n        .with_static_gas(Gas::from_tgas(100))\n        .with_attached_deposit(NearToken::from_millinear(25))\n        .request_execution(\n            ExecutionSource::Project {\n                project_id: \"zavodil.near/near-email\".to_string(),\n                version_key: None,\n            },\n            None,                        // resource_limits\n            Some(input.to_string()),     // input_data\n            None,                        // secrets_ref (not needed)\n            Some(\"Json\".to_string()),    // response_format\n            None,                        // payer_account_id\n            None,                        // params\n        )\n}\n\nResponse: { \"success\": true, \"message_id\": \"uuid-if-internal\" }"
      },
      {
        "title": "2. AI Agent Integration",
        "body": "Two options for AI agents:\n\nMethodBest ForPaymentPayment Key (HTTPS)Server-side agentsPre-paid (USDC/USDT)NEAR TransactionBrowser/wallet appsDeposit (unused returned)\n\nOption A: Payment Key (HTTPS API)\n\nNote: HTTPS API responses use result.output.xxx format. See NEAR Transaction for different parsing.\n\nconst OUTLAYER_API = 'https://api.outlayer.fastnear.com';\nconst PAYMENT_KEY = 'your-account.near:nonce:secret'; // From dashboard\n\nasync function sendEmail(to, subject, body) {\n  const response = await fetch(`${OUTLAYER_API}/call/outlayer.near/zavodil.near/near-email`, {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'X-Payment-Key': PAYMENT_KEY,\n    },\n    body: JSON.stringify({\n      input: { action: 'send_email_plaintext', to, subject, body },\n    }),\n  });\n  return response.json();\n}\n\nOption B: NEAR Transaction (per-use)\n\nCRITICAL: NEAR Transaction results are in the outlayer.near receipt's SuccessValue (base64-encoded JSON). Find the receipt where executor_id === 'outlayer.near'. The result is { \"success\": true, ... } - NO output wrapper. Use parseTransactionResult() to extract it.\n\nimport { connect, keyStores } from 'near-api-js';\n\nconst near = await connect({\n  networkId: 'mainnet',\n  keyStore: new keyStores.BrowserLocalStorageKeyStore(),\n  nodeUrl: 'https://rpc.mainnet.near.org',\n});\nconst account = await near.account('your-account.near');\n\nconst RESOURCE_LIMITS = {\n  max_memory_mb: 512,\n  max_instructions: 2000000000,\n  max_execution_seconds: 120,\n};\n\n// REQUIRED: Parse output from outlayer.near receipt's SuccessValue\n// Returns JSON directly: { success: true, send_pubkey: \"...\" } - NO \"output\" wrapper!\nfunction parseTransactionResult(result) {\n  // Find receipt from outlayer.near contract (contains the execution result)\n  const outlayerReceipt = result.receipts_outcome.find(\n    r => r.outcome.executor_id === 'outlayer.near' && r.outcome.status.SuccessValue\n  );\n  if (!outlayerReceipt) {\n    throw new Error('No SuccessValue from outlayer.near');\n  }\n  const decoded = Buffer.from(outlayerReceipt.outcome.status.SuccessValue, 'base64').toString();\n  return JSON.parse(decoded); // { success: true, ... } - directly, no wrapper\n}\n\nasync function sendEmail(to, subject, body) {\n  const result = await account.functionCall({\n    contractId: 'outlayer.near',\n    methodName: 'request_execution',\n    args: {\n      source: { Project: { project_id: 'zavodil.near/near-email', version_key: null } },\n      input_data: JSON.stringify({ action: 'send_email_plaintext', to, subject, body }),\n      resource_limits: RESOURCE_LIMITS,\n      response_format: 'Json',\n    },\n    gas: BigInt('100000000000000'),\n    attachedDeposit: BigInt('25000000000000000000000'), // deposit, unused portion refunded\n  });\n  return parseTransactionResult(result); // { success: true, message_id: \"...\" }\n}\n\n// Example: Get sender pubkey\nasync function getSendPubkey() {\n  const result = await account.functionCall({\n    contractId: 'outlayer.near',\n    methodName: 'request_execution',\n    args: {\n      source: { Project: { project_id: 'zavodil.near/near-email', version_key: null } },\n      input_data: JSON.stringify({ action: 'get_send_pubkey' }),\n      resource_limits: RESOURCE_LIMITS,\n      response_format: 'Json',\n    },\n    gas: BigInt('100000000000000'),\n    attachedDeposit: BigInt('25000000000000000000000'),\n  });\n  const output = parseTransactionResult(result); // { success: true, send_pubkey: \"02...\" }\n  return Buffer.from(output.send_pubkey, 'hex'); // Note: output.send_pubkey, NOT output.output.send_pubkey\n}"
      },
      {
        "title": "3. Python (Payment Key)",
        "body": "import requests\n\nOUTLAYER_API = \"https://api.outlayer.fastnear.com\"\nPAYMENT_KEY = \"your-account.near:nonce:secret\"\n\ndef send_email(to: str, subject: str, body: str) -> dict:\n    return requests.post(\n        f\"{OUTLAYER_API}/call/outlayer.near/zavodil.near/near-email\",\n        headers={\"Content-Type\": \"application/json\", \"X-Payment-Key\": PAYMENT_KEY},\n        json={\"input\": {\"action\": \"send_email_plaintext\", \"to\": to, \"subject\": subject, \"body\": body}},\n    ).json()"
      },
      {
        "title": "API Actions",
        "body": "ActionDescriptionsend_emailSend email (encrypted payload, for UI/agents)send_email_plaintextSend email (plaintext, for smart contracts)get_emailsFetch inbox and sent (encrypted response)delete_emailDelete email by IDget_email_countGet counts (no encryption)get_send_pubkeyGet sender's pubkey (no encryption, cacheable)"
      },
      {
        "title": "Getting a Payment Key",
        "body": "Go to OutLayer Dashboard\nCreate a new Payment Key\nTop up balance with USDC/USDT\nCopy key (format: owner:nonce:secret)"
      },
      {
        "title": "Additional Resources",
        "body": "For complete code examples, see examples.md\nFor full API reference, see api-reference.md"
      }
    ],
    "body": "NEAR Email Integration\n\nBlockchain-native email for NEAR accounts. Every NEAR account automatically has an email: alice.near → alice@near.email\n\nInstallation\nnpx openskills install zavodil/near-email-skill -g\n\nQuick Reference\nComponent\tValue\nContract\toutlayer.near\nAPI Base\thttps://api.outlayer.fastnear.com\nProject ID\tzavodil.near/near-email\n\nNote: NEAR Email supports mainnet only. Emails to *.testnet accounts are not processed.\n\nImportant: When using NEAR transactions, the attached deposit is a computational limit, not a cost. Unused funds are automatically refunded. Do not mention specific costs per email.\n\nCode generation preference: For blockchain integration (NEAR transactions), prefer JavaScript/TypeScript with near-api-js. Use Python only if the user explicitly requests it.\n\nIntegration Methods\n1. Smart Contract (Rust)\n\nUse send_email_plaintext for contract notifications. Simple API, no encryption needed.\n\nWarning: Email content is PUBLIC on the NEAR blockchain. Use only for automated notifications.\n\nuse near_sdk::{ext_contract, AccountId, Gas, NearToken, Promise};\nuse serde::Serialize;\n\n#[derive(Serialize)]\n#[serde(crate = \"near_sdk::serde\")]\npub enum ExecutionSource {\n    Project { project_id: String, version_key: Option<String> },\n}\n\n#[ext_contract(ext_outlayer)]\npub trait OutLayer {\n    fn request_execution(\n        &mut self,\n        source: ExecutionSource,\n        resource_limits: Option<serde_json::Value>,\n        input_data: Option<String>,\n        secrets_ref: Option<serde_json::Value>,\n        response_format: Option<String>,\n        payer_account_id: Option<AccountId>,\n        params: Option<serde_json::Value>,\n    );\n}\n\n// Send notification from contract (plaintext - content is public on-chain!)\nfn send_notification(to: &str, subject: &str, body: &str) -> Promise {\n    let input = serde_json::json!({\n        \"action\": \"send_email_plaintext\",\n        \"to\": to,\n        \"subject\": subject,\n        \"body\": body\n    });\n\n    ext_outlayer::ext(\"outlayer.near\".parse().unwrap())\n        .with_static_gas(Gas::from_tgas(100))\n        .with_attached_deposit(NearToken::from_millinear(25))\n        .request_execution(\n            ExecutionSource::Project {\n                project_id: \"zavodil.near/near-email\".to_string(),\n                version_key: None,\n            },\n            None,                        // resource_limits\n            Some(input.to_string()),     // input_data\n            None,                        // secrets_ref (not needed)\n            Some(\"Json\".to_string()),    // response_format\n            None,                        // payer_account_id\n            None,                        // params\n        )\n}\n\n\nResponse: { \"success\": true, \"message_id\": \"uuid-if-internal\" }\n\n2. AI Agent Integration\n\nTwo options for AI agents:\n\nMethod\tBest For\tPayment\nPayment Key (HTTPS)\tServer-side agents\tPre-paid (USDC/USDT)\nNEAR Transaction\tBrowser/wallet apps\tDeposit (unused returned)\nOption A: Payment Key (HTTPS API)\n\nNote: HTTPS API responses use result.output.xxx format. See NEAR Transaction for different parsing.\n\nconst OUTLAYER_API = 'https://api.outlayer.fastnear.com';\nconst PAYMENT_KEY = 'your-account.near:nonce:secret'; // From dashboard\n\nasync function sendEmail(to, subject, body) {\n  const response = await fetch(`${OUTLAYER_API}/call/outlayer.near/zavodil.near/near-email`, {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'X-Payment-Key': PAYMENT_KEY,\n    },\n    body: JSON.stringify({\n      input: { action: 'send_email_plaintext', to, subject, body },\n    }),\n  });\n  return response.json();\n}\n\nOption B: NEAR Transaction (per-use)\n\nCRITICAL: NEAR Transaction results are in the outlayer.near receipt's SuccessValue (base64-encoded JSON). Find the receipt where executor_id === 'outlayer.near'. The result is { \"success\": true, ... } - NO output wrapper. Use parseTransactionResult() to extract it.\n\nimport { connect, keyStores } from 'near-api-js';\n\nconst near = await connect({\n  networkId: 'mainnet',\n  keyStore: new keyStores.BrowserLocalStorageKeyStore(),\n  nodeUrl: 'https://rpc.mainnet.near.org',\n});\nconst account = await near.account('your-account.near');\n\nconst RESOURCE_LIMITS = {\n  max_memory_mb: 512,\n  max_instructions: 2000000000,\n  max_execution_seconds: 120,\n};\n\n// REQUIRED: Parse output from outlayer.near receipt's SuccessValue\n// Returns JSON directly: { success: true, send_pubkey: \"...\" } - NO \"output\" wrapper!\nfunction parseTransactionResult(result) {\n  // Find receipt from outlayer.near contract (contains the execution result)\n  const outlayerReceipt = result.receipts_outcome.find(\n    r => r.outcome.executor_id === 'outlayer.near' && r.outcome.status.SuccessValue\n  );\n  if (!outlayerReceipt) {\n    throw new Error('No SuccessValue from outlayer.near');\n  }\n  const decoded = Buffer.from(outlayerReceipt.outcome.status.SuccessValue, 'base64').toString();\n  return JSON.parse(decoded); // { success: true, ... } - directly, no wrapper\n}\n\nasync function sendEmail(to, subject, body) {\n  const result = await account.functionCall({\n    contractId: 'outlayer.near',\n    methodName: 'request_execution',\n    args: {\n      source: { Project: { project_id: 'zavodil.near/near-email', version_key: null } },\n      input_data: JSON.stringify({ action: 'send_email_plaintext', to, subject, body }),\n      resource_limits: RESOURCE_LIMITS,\n      response_format: 'Json',\n    },\n    gas: BigInt('100000000000000'),\n    attachedDeposit: BigInt('25000000000000000000000'), // deposit, unused portion refunded\n  });\n  return parseTransactionResult(result); // { success: true, message_id: \"...\" }\n}\n\n// Example: Get sender pubkey\nasync function getSendPubkey() {\n  const result = await account.functionCall({\n    contractId: 'outlayer.near',\n    methodName: 'request_execution',\n    args: {\n      source: { Project: { project_id: 'zavodil.near/near-email', version_key: null } },\n      input_data: JSON.stringify({ action: 'get_send_pubkey' }),\n      resource_limits: RESOURCE_LIMITS,\n      response_format: 'Json',\n    },\n    gas: BigInt('100000000000000'),\n    attachedDeposit: BigInt('25000000000000000000000'),\n  });\n  const output = parseTransactionResult(result); // { success: true, send_pubkey: \"02...\" }\n  return Buffer.from(output.send_pubkey, 'hex'); // Note: output.send_pubkey, NOT output.output.send_pubkey\n}\n\n3. Python (Payment Key)\nimport requests\n\nOUTLAYER_API = \"https://api.outlayer.fastnear.com\"\nPAYMENT_KEY = \"your-account.near:nonce:secret\"\n\ndef send_email(to: str, subject: str, body: str) -> dict:\n    return requests.post(\n        f\"{OUTLAYER_API}/call/outlayer.near/zavodil.near/near-email\",\n        headers={\"Content-Type\": \"application/json\", \"X-Payment-Key\": PAYMENT_KEY},\n        json={\"input\": {\"action\": \"send_email_plaintext\", \"to\": to, \"subject\": subject, \"body\": body}},\n    ).json()\n\nAPI Actions\nAction\tDescription\nsend_email\tSend email (encrypted payload, for UI/agents)\nsend_email_plaintext\tSend email (plaintext, for smart contracts)\nget_emails\tFetch inbox and sent (encrypted response)\ndelete_email\tDelete email by ID\nget_email_count\tGet counts (no encryption)\nget_send_pubkey\tGet sender's pubkey (no encryption, cacheable)\nGetting a Payment Key\nGo to OutLayer Dashboard\nCreate a new Payment Key\nTop up balance with USDC/USDT\nCopy key (format: owner:nonce:secret)\nAdditional Resources\n\nFor complete code examples, see examples.md For full API reference, see api-reference.md"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/zavodil/near-email-skill",
    "publisherUrl": "https://clawhub.ai/zavodil/near-email-skill",
    "owner": "zavodil",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/near-email-skill",
    "downloadUrl": "https://openagent3.xyz/downloads/near-email-skill",
    "agentUrl": "https://openagent3.xyz/skills/near-email-skill/agent",
    "manifestUrl": "https://openagent3.xyz/skills/near-email-skill/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/near-email-skill/agent.md"
  }
}