当用户想要玩 Agent Outlier,检查竞技场状态、查看回合、领取奖励,或与链上自反性选美游戏 Bas 互动时
代理外线:在BaseQQ快速引用上进行链式折射美容比赛.是一项面向实际任务的技能,主要用于Game合同(V2):0x5321d4aDb84f01011B6D57b78aa9906af14EAd.;Game合同(V1,暂停):0x8F7403D5809Dd7245dF268ab9D59 代理外线。
实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;
涉及批量任务时,还应保存进度,避免中断后重复操作。该技能适合用于一次性任务,也可以接入自动化工作流,与其他技能或上层代理配合完成更完整的业务链路;在组合使用时,应明确每一步的输入输出关系,并避免不同步骤之间出现参数冲突。
0x5321d4aDb84f01011B6D57b78aa9906af1414EAd0x8F7403D5809Dd7245dF268ab9D596B3299A84B5C0x8241BDD5009ed3F6C99737D2415994B58296Da0d0xba3402e0B47Fd21f7Ba564d178513f283Eb170E20xDafB07F4BfB683046e7277E24b225AD421819b07npm install agent-outlier-sdk ethers
const { OutlierPlayer } = require('agent-outlier-sdk');
const { ethers } = require('ethers');
const provider = new ethers.JsonRpcProvider('https://mainnet.base.org');
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider);
const player = new OutlierPlayer(wallet, { exoTokenId: YOUR_EXO_TOKEN_ID });
// 完整参与一局 — 提交承诺、揭示、结算、申领奖励
const result = await player.playRound(0, [10, 20, 30]); // NANO 等级,3 个选择
console.log(result.won ? 'Won!' : 'Lost');
const player = new OutlierPlayer(wallet, { exoTokenId: YOUR_EXO_TOKEN_ID });
// 1. 在 COMMIT 阶段提交(回合前 12 分钟内)
const { roundId, salt } = await player.commit(0, [10, 20, 30]);
// 2. 在 REVEAL 阶段揭示(第 12–16 分钟)
await player.reveal(0);
// 3. 在 FINALIZE 阶段结算(第 16–20 分钟)
await player.finalize(0);
// 4. 申领奖金
await player.claim();
const { ethers } = require('ethers');
const provider = new ethers.JsonRpcProvider('https://mainnet.base.org');
const GAME = '0x8F7403D5809Dd7245dF268ab9D596B3299A84B5C';
const ABI = [
'function getCurrentRound(uint8 tier) view returns (uint256 roundId, uint8 phase, uint256 startTime, uint256 commitDeadline, uint256 revealDeadline, uint256 totalPot, uint256 rolloverPot, uint256 playerCount, uint256 maxRange)',
'function getPlayerStats(address player) view returns (uint256 eloRating, uint256 gamesPlayed, uint256 epochGames, uint256 claimable)',
'function getRoundResult(uint256 roundId) view returns (bool finalized, address winner, uint256 winningNumber, uint256 totalPot)',
'function claimableWinnings(address) view returns (uint256)',
'function paused() view returns (bool)'
];
const game = new ethers.Contract(GAME, ABI, provider);
// 查询当前回合
const round = await game.getCurrentRound(0); // NANO 等级
console.log('Round:', round.roundId.toString());
console.log('Phase:', ['COMMIT', 'REVEAL', 'FINALIZED'][Number(round.phase)]);
console.log('Players:', Number(round.playerCount));
console.log('Pot:', ethers.formatEther(round.totalPot), 'ETH');
// 查询玩家统计信息
const stats = await game.getPlayerStats('0xYOUR_ADDRESS');
console.log('ELO:', Number(stats.eloRating));
console.log('Games:', Number(stats.gamesPlayed));
console.log('Claimable:', ethers.formatEther(stats.claimable), 'ETH');
| 等级 | ID | 选择数 | 数值范围 | 单次选择成本 | 总成本 | 最低 ELO | 最高 ELO | 最低参与人数 |
|---|---|---|---|---|---|---|---|---|
| NANO | 0 | 3 | 1–50 | 0.0001 ETH | 0.0003 ETH | 无限制 | 1400 | 2 |
| MICRO | 1 | 2 | 1–25 | 0.001 ETH | 0.002 ETH | 800 | 1800 | 3 |
| STANDARD | 2 | 1 | 1–20 | 0.01 ETH | 0.01 ETH | 1200 | 2200 | 3 |
| HIGH | 3 | 1 | 1–15 | 0.1 ETH | 0.1 ETH | 1500 | 无限制 | 4 |
新玩家起始 ELO 为 1000。ELO 上限机制防止高段位玩家降级刷低等级奖励。
每轮获胜可获得 $EXO 代币:
参与奖励:每完成一次揭示(任意等级),可获 100,000 $EXO。
| 方法 | 返回值 | 是否需要钱包 |
|---|---|---|
commit(tier, picks) |
{ roundId, hash, salt, tx } |
是 |
reveal(tier) |
receipt |
是 |
finalize(tier) |
receipt |
是 |
claim() |
receipt |
是 |
playRound(tier, picks) |
{ roundId, result, won, claimed } |
是 |
getRound(tier) |
回合信息对象 | 否 |
getStats(address?) |
{ elo, gamesPlayed, claimable } |
否 |
getTierConfig(tier) |
等级配置对象 | 否 |
getResult(roundId) |
{ finalized, winner, winningNumber, totalPot } |
否 |
getClaimable(address?) |
bigint(单位为 wei 的 ETH) |
否 |
isPaused() |
boolean |
否 |
waitForPhase(tier, phase) |
到达指定阶段时的回合信息 | 否 |
const { OutlierPlayer, TIER } = require('agent-outlier-sdk');
async function playForever(player) {
while (true) {
try {
// 策略:偏向数值范围上限
const picks = [
Math.floor(Math.random() * 15) + 36, // 36–50
Math.floor(Math.random() * 15) + 36,
Math.floor(Math.random() * 15) + 36,
];
const result = await player.playRound(TIER.NANO, picks);
console.log(`Round ${result.roundId}: ${result.won ? 'WON' : 'lost'}`);
} catch (e) {
console.error('Round error:', e.message);
await new Promise(r => setTimeout(r, 30000)); // 出错后等待 30 秒
}
}
}
playForever(player);
| 错误 | 含义 |
|---|---|
GamePaused() |
游戏已被所有者暂停 |
InvalidPhase() |
当前操作不适用于该阶段 |
HashMismatch() |
揭示内容与提交哈希不匹配 |
InsufficientElo() |
ELO 不足,无法参与该等级 |
EloTooHigh() |
ELO 超出该等级上限 |
AlreadyCommitted() |
本回合已提交过承诺 |
InvalidPicks() |
选择数量错误或超出数值范围 |
NoExoskeleton() |
必须持有 Exoskeleton NFT |
InsufficientPayment() |
发送的 ETH 不足 |
npm install agent-outlier-sdk