When to use
- - You need to create a funded Linkdrop claim link from a local wallet.
- You need to redeem a Linkdrop claim link to a destination address.
- You need stdout to be exactly one JSON object for automation.
Files in this skill
- -
linkdrop-agent.js is the strict JSON CLI entrypoint. - INLINECODE1 contains the Linkdrop and chain logic used by the CLI.
- INLINECODE2 shows the supported runtime configuration.
Setup
- 1. Run
npm install. - Set secrets in your shell or
.env:
- Required:
PRIVATE_KEY,
LINKDROP_API_KEY
- Recommended for Base:
RPC_URL_BASE
- Optional fallback:
RPC_URL
- 3. Keep secrets out of git history.
Supported chains
- -
base default - INLINECODE10
- INLINECODE11
- INLINECODE12
- INLINECODE13
Send a claimable transfer
- 1. Native token on Base:
-
node linkdrop-agent.js send --amount 0.01 --token native --chain base
- 2. ERC20 on Polygon:
-
node linkdrop-agent.js send --amount 5 --token 0xTokenAddress --chain polygon
- 3. Read these JSON fields from stdout:
-
claimUrl
-
transferId
- INLINECODE18
Claim a transfer
- 1. Run:
-
node linkdrop-agent.js claim --url "https://..." --to 0xRecipient --chain base
- 2. Read
redeemTx from stdout.
JSON contract
- - Success returns
{ ok: true, ... }. - Failure returns
{ ok: false, error: { code, name, message, details? } }. - The CLI writes one JSON object to stdout per invocation.
Troubleshooting
- -
Missing PRIVATE_KEY: set a 32-byte hex private key with 0x prefix. - INLINECODE25 : set a valid Linkdrop API key with the
zpka_ prefix. - INLINECODE27 : set
RPC_URL_BASE for Base or the matching RPC_URL_<CHAIN>. - INLINECODE30 : use one of the supported chain names above.
技能名称: linkdrop-agent-cli
详细描述:
何时使用
- - 你需要从本地钱包创建一个已注资的Linkdrop申领链接。
- 你需要将Linkdrop申领链接兑换到目标地址。
- 你需要标准输出严格为一个JSON对象以实现自动化。
本技能包含的文件
- - linkdrop-agent.js 是严格的JSON命令行入口点。
- agentdrop-core.js 包含命令行使用的Linkdrop和链逻辑。
- .env.example 展示支持的运行时配置。
设置步骤
- 1. 运行 npm install。
- 在shell或.env文件中设置密钥:
- 必需项:PRIVATE
KEY、LINKDROPAPI_KEY
- Base链推荐项:RPC
URLBASE
- 可选回退项:RPC_URL
- 3. 确保密钥不进入git历史记录。
支持的链
- - base 默认
- polygon
- arbitrum
- optimism
- avalanche
发送可申领转账
- 1. Base链上的原生代币:
- node linkdrop-agent.js send --amount 0.01 --token native --chain base
- 2. Polygon链上的ERC20代币:
- node linkdrop-agent.js send --amount 5 --token 0xTokenAddress --chain polygon
- 3. 从标准输出读取以下JSON字段:
- claimUrl
- transferId
- depositTx
申领转账
- 1. 运行:
- node linkdrop-agent.js claim --url https://... --to 0xRecipient --chain base
- 2. 从标准输出读取 redeemTx。
JSON协议
- - 成功返回 { ok: true, ... }。
- 失败返回 { ok: false, error: { code, name, message, details? } }。
- 命令行每次调用向标准输出写入一个JSON对象。
故障排除
- - Missing PRIVATEKEY:设置一个以0x为前缀的32字节十六进制私钥。
- Missing LINKDROPAPIKEY:设置一个以zpka为前缀的有效Linkdrop API密钥。
- No RPC URL available:为Base链设置RPCURLBASE或匹配的RPCURL。
- Unsupported chain:使用上述支持的链名称之一。