Resolution
Error codes
Self-indexing with events
ResolutionReceived(bytes32 indexed questionId, uint256[2] payouts, uint256 disputeDeadline)
RewardDeposited(bytes32 indexed questionId, address indexed stakeToken, uint256 amount)
DisputeFiled(bytes32 indexed questionId, address indexed disputor, uint256 stakeAmount, uint8 reason, uint256 reVoteDeadline)
DisputeResolved(bytes32 indexed questionId, bool overturned, uint256[2] finalPayouts)
DisputeTimedOut(bytes32 indexed questionId)
ResolutionFinalized(bytes32 indexed questionId, uint256[2] payouts)
StakeClaimed(bytes32 indexed questionId, address indexed recipient, uint256 amount)Filter by phase
Filter by category label id — same ids as GET /label
Page number
1Number of items per page (max 20)
10Successful response
Envelope used by the Resolution endpoints. The outcome is reported in errno / errmsg with HTTP 200; see the Resolution section for the error-code list.
Business result code (0 for success)
0Error message (empty on success)
Successful response
Disputing on-chain
const DR_ABI = [
"function dispute(bytes32 questionId, uint8 reason) external",
"function claim(bytes32 questionId) external",
"function isDisputable(bytes32 questionId) external view returns (bool)",
];
const ERC20_ABI = ["function approve(address spender, uint256 amount) returns (bool)"];
const dr = new ethers.Contract(dispute.disputeResolver, DR_ABI, wallet);
const opn = new ethers.Contract(dispute.stakeToken, ERC20_ABI, wallet);
if (!(await dr.isDisputable(questionId))) throw new Error("not disputable");
const stake = ethers.parseUnits(dispute.requiredStake, dispute.stakeTokenDecimals);
await (await opn.approve(dispute.disputeResolver, stake)).wait();
await (await dr.dispute(questionId, 0 /* 0 = WrongResult, 1 = TooEarly */)).wait();
// after finalization, when claimStatus = "claimable":
await (await dr.claim(questionId)).wait();Numeric market id, or a 0x-prefixed question id
Successful response
Envelope used by the Resolution endpoints. The outcome is reported in errno / errmsg with HTTP 200; see the Resolution section for the error-code list.
Business result code (0 for success)
0Error message (empty on success)
Successful response
Filter by disputor wallet address
Filter by outcome (pending = review in progress)
Page number
1Number of items per page (max 20)
10Successful response
Envelope used by the Resolution endpoints. The outcome is reported in errno / errmsg with HTTP 200; see the Resolution section for the error-code list.
Business result code (0 for success)
0Error message (empty on success)
Successful response
const domain = { name: "Opinion OpenAPI", version: "1", chainId: 56 };
const types = {
OpinionDisputeRationale: [
{ name: "walletAddress", type: "address" },
{ name: "questionId", type: "string" },
{ name: "rationale", type: "string" },
{ name: "timestamp", type: "uint256" },
],
};
const timestamp = Math.floor(Date.now() / 1000).toString();
const message = {
walletAddress: wallet.address.toLowerCase(),
questionId,
rationale: "Final score was 3-2 per MLB.com; the proposal resolves the wrong side.",
timestamp,
};
const signature = await wallet.signTypedData(domain, types, message);0x-prefixed question id, exactly as returned by the API
Disputor wallet address (must equal the on-chain disputor)
EIP-712 signature over the OpinionDisputeRationale typed data (see the endpoint description)
Unix timestamp in seconds; must equal the signed timestamp field. Valid for 5 minutes.
Public statement explaining the dispute — must equal the signed rationale; at most 2000 bytes (UTF-8). Surrounding whitespace is stripped server-side
Final score was 3-2 per MLB.com; the proposal resolves the wrong side.Successful response (check errno in the body)
Envelope used by the Resolution endpoints. The outcome is reported in errno / errmsg with HTTP 200; see the Resolution section for the error-code list.
Business result code (0 for success)
0Error message (empty on success)
Successful response (check errno in the body)
Last updated