@rainprotocolsdk/sdk 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -30,21 +30,33 @@ export async function buildCloseMarketRawTx(params) {
|
|
|
30
30
|
if (proposedOutcome === undefined) {
|
|
31
31
|
throw new Error("proposedOutcome is required for V2 markets");
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
if (isAiResolver) {
|
|
34
|
+
// AI resolver: closePool() with no args
|
|
35
|
+
txs.push({
|
|
36
|
+
to: contractAddress,
|
|
37
|
+
data: encodeFunctionData({
|
|
38
|
+
abi: TradePoolAbi,
|
|
39
|
+
functionName: CLOSE_POOL,
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
txs.push({
|
|
45
|
+
to: contractAddress,
|
|
46
|
+
data: encodeFunctionData({
|
|
47
|
+
abi: TradePoolAbi,
|
|
48
|
+
functionName: CLOSE_POOL,
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
txs.push({
|
|
52
|
+
to: contractAddress,
|
|
53
|
+
data: encodeFunctionData({
|
|
54
|
+
abi: TradePoolAbi,
|
|
55
|
+
functionName: CHOOSE_WINNER,
|
|
56
|
+
args: [BigInt(proposedOutcome)],
|
|
57
|
+
}),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
48
60
|
}
|
|
49
61
|
else {
|
|
50
62
|
// V3 flow: optional approvals → closePool() or closePool(proposedOutcome)
|
|
@@ -12,7 +12,8 @@ async function fetchExtendTimeSignature(oracleContractAddress, walletAddress, ac
|
|
|
12
12
|
const res = await fetch(`${apiUrl}/pools/sign-oracles-extend-time?contractAddress=${oracleContractAddress}&walletAddress=${walletAddress}`, { headers: { Authorization: `Bearer ${accessToken}` } });
|
|
13
13
|
if (!res.ok)
|
|
14
14
|
throw new Error(`Failed to fetch extend time signature: ${res.status}`);
|
|
15
|
-
const
|
|
15
|
+
const json = await res.json();
|
|
16
|
+
const data = json?.data ?? json;
|
|
16
17
|
if (!data?.epoch || !data?.signature)
|
|
17
18
|
throw new Error("Invalid response from extend time signature endpoint");
|
|
18
19
|
return {
|