@varla/sdk 1.0.1 → 1.1.1
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.
- package/README.md +112 -1
- package/dist/batch.d.ts +26 -0
- package/dist/batch.d.ts.map +1 -0
- package/dist/batch.js +34 -0
- package/dist/contracts.d.ts +37676 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +139 -0
- package/dist/events/decode.d.ts +14 -0
- package/dist/events/decode.d.ts.map +1 -0
- package/dist/events/decode.js +26 -0
- package/dist/events/defs.d.ts +24 -0
- package/dist/events/defs.d.ts.map +1 -0
- package/dist/events/defs.js +61 -0
- package/dist/events/index.d.ts +6 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +6 -0
- package/dist/events/logs.d.ts +17 -0
- package/dist/events/logs.d.ts.map +1 -0
- package/dist/events/logs.js +25 -0
- package/dist/events/oracleRegistrySync.d.ts +33 -0
- package/dist/events/oracleRegistrySync.d.ts.map +1 -0
- package/dist/events/oracleRegistrySync.js +157 -0
- package/dist/events/recent.d.ts +19 -0
- package/dist/events/recent.d.ts.map +1 -0
- package/dist/events/recent.js +24 -0
- package/dist/generated.d.ts +8499 -0
- package/dist/generated.d.ts.map +1 -0
- package/dist/generated.js +22 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/views/accessManager.d.ts +51 -0
- package/dist/views/accessManager.d.ts.map +1 -0
- package/dist/views/accessManager.js +44 -0
- package/dist/views/adapters.d.ts +19 -0
- package/dist/views/adapters.d.ts.map +1 -0
- package/dist/views/adapters.js +11 -0
- package/dist/views/admin.d.ts +13606 -0
- package/dist/views/admin.d.ts.map +1 -0
- package/dist/views/admin.js +25 -0
- package/dist/views/core.d.ts +33 -0
- package/dist/views/core.d.ts.map +1 -0
- package/dist/views/core.js +50 -0
- package/dist/views/index.d.ts +8 -0
- package/dist/views/index.d.ts.map +1 -0
- package/dist/views/index.js +8 -0
- package/dist/views/liquidators.d.ts +40 -0
- package/dist/views/liquidators.d.ts.map +1 -0
- package/dist/views/liquidators.js +20 -0
- package/dist/views/oracle.d.ts +26 -0
- package/dist/views/oracle.d.ts.map +1 -0
- package/dist/views/oracle.js +41 -0
- package/dist/views/pool.d.ts +16 -0
- package/dist/views/pool.d.ts.map +1 -0
- package/dist/views/pool.js +32 -0
- package/package.json +14 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,MAAM,CAAC;AACpE,OAAO,EAAoC,KAAK,qBAAqB,EAAE,MAAM,MAAM,CAAC;AAEpF,OAAO,EAAE,IAAI,EAAa,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAExD;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,CAAC,IAAI,SAAS,SAAS,OAAO,EAAE,IAAI,qBAAqB,CACnF,IAAI,EACJ,YAAY,CACb,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,QAAQ,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IAEzB,aAAa,EAAE,gBAAgB,CAAC,OAAO,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACpE,MAAM,EAAE,gBAAgB,CAAC,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC;IACtD,IAAI,EAAE,gBAAgB,CAAC,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC;IAClD,IAAI,EAAE,gBAAgB,CAAC,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC;IAGlD,oBAAoB,CAAC,EAAE,gBAAgB,CAAC,OAAO,IAAI,CAAC,6BAA6B,CAAC,CAAC;IACnF,UAAU,CAAC,EAAE,gBAAgB,CAAC,OAAO,I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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE5E"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// Note: explicit .js extension is required for Node ESM resolution.
|
|
2
|
+
import { getContract } from "viem";
|
|
3
|
+
import { erc1155Abi, erc20Abi, erc4626Abi } from "viem";
|
|
4
|
+
import { abis, addresses } from "./generated.js";
|
|
5
|
+
export function getAddressBook(chain) {
|
|
6
|
+
if (chain === "polygon")
|
|
7
|
+
return addresses.polygon;
|
|
8
|
+
if (chain === "bsc")
|
|
9
|
+
return addresses.bsc;
|
|
10
|
+
// TypeScript should make this unreachable, but keep a runtime guard.
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
12
|
+
throw new Error(`Unsupported chain key: ${chain}`);
|
|
13
|
+
}
|
|
14
|
+
function mustAddress(book, key) {
|
|
15
|
+
const v = book[key];
|
|
16
|
+
if (!v) {
|
|
17
|
+
throw new Error(`Missing required deployment address for '${String(key)}'`);
|
|
18
|
+
}
|
|
19
|
+
return v;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Returns typed readonly viem contract instances for all known Varla deployments on a chain.
|
|
23
|
+
*
|
|
24
|
+
* Optional deployments are returned as `undefined`.
|
|
25
|
+
*/
|
|
26
|
+
export function getVarlaContracts({ chain, client }) {
|
|
27
|
+
const book = getAddressBook(chain);
|
|
28
|
+
const accessManager = getContract({
|
|
29
|
+
address: mustAddress(book, "accessManager"),
|
|
30
|
+
abi: abis.VARLAACCESSMANAGER_ABI,
|
|
31
|
+
client,
|
|
32
|
+
});
|
|
33
|
+
const oracle = getContract({
|
|
34
|
+
address: mustAddress(book, "oracle"),
|
|
35
|
+
abi: abis.VARLAORACLE_ABI,
|
|
36
|
+
client,
|
|
37
|
+
});
|
|
38
|
+
const core = getContract({
|
|
39
|
+
address: mustAddress(book, "core"),
|
|
40
|
+
abi: abis.VARLACORE_ABI,
|
|
41
|
+
client,
|
|
42
|
+
});
|
|
43
|
+
const pool = getContract({
|
|
44
|
+
address: mustAddress(book, "pool"),
|
|
45
|
+
abi: abis.VARLAPOOL_ABI,
|
|
46
|
+
client,
|
|
47
|
+
});
|
|
48
|
+
const interestRateStrategy = book.interestRateStrategy
|
|
49
|
+
? getContract({
|
|
50
|
+
address: book.interestRateStrategy,
|
|
51
|
+
abi: abis.VARLAINTERESTRATESTRATEGY_ABI,
|
|
52
|
+
client,
|
|
53
|
+
})
|
|
54
|
+
: undefined;
|
|
55
|
+
const proxyAdmin = book.proxyAdmin
|
|
56
|
+
? getContract({
|
|
57
|
+
address: book.proxyAdmin,
|
|
58
|
+
abi: abis.VARLAPROXYADMIN_ABI,
|
|
59
|
+
client,
|
|
60
|
+
})
|
|
61
|
+
: undefined;
|
|
62
|
+
const liquidator = book.liquidator
|
|
63
|
+
? getContract({
|
|
64
|
+
address: book.liquidator,
|
|
65
|
+
abi: abis.VARLALIQUIDATOR_ABI,
|
|
66
|
+
client,
|
|
67
|
+
})
|
|
68
|
+
: undefined;
|
|
69
|
+
const mergeLiquidator = book.mergeLiquidator
|
|
70
|
+
? getContract({
|
|
71
|
+
address: book.mergeLiquidator,
|
|
72
|
+
abi: abis.VARLAMERGELIQUIDATOR_ABI,
|
|
73
|
+
client,
|
|
74
|
+
})
|
|
75
|
+
: undefined;
|
|
76
|
+
const convertLiquidator = book.convertLiquidator
|
|
77
|
+
? getContract({
|
|
78
|
+
address: book.convertLiquidator,
|
|
79
|
+
abi: abis.VARLACONVERTLIQUIDATOR_ABI,
|
|
80
|
+
client,
|
|
81
|
+
})
|
|
82
|
+
: undefined;
|
|
83
|
+
const polymarketCtfAdapter = book.polymarketCtfAdapter
|
|
84
|
+
? getContract({
|
|
85
|
+
address: book.polymarketCtfAdapter,
|
|
86
|
+
abi: abis.POLYMARKETCTFADAPTER_ABI,
|
|
87
|
+
client,
|
|
88
|
+
})
|
|
89
|
+
: undefined;
|
|
90
|
+
const opinionCtfExecutionEngineAdapter = book.opinionCtfExecutionEngineAdapter
|
|
91
|
+
? getContract({
|
|
92
|
+
address: book.opinionCtfExecutionEngineAdapter,
|
|
93
|
+
abi: abis.OPINIONCTFEXECUTIONENGINEADAPTER_ABI,
|
|
94
|
+
client,
|
|
95
|
+
})
|
|
96
|
+
: undefined;
|
|
97
|
+
return {
|
|
98
|
+
chain,
|
|
99
|
+
addressBook: book,
|
|
100
|
+
accessManager,
|
|
101
|
+
oracle,
|
|
102
|
+
core,
|
|
103
|
+
pool,
|
|
104
|
+
interestRateStrategy,
|
|
105
|
+
proxyAdmin,
|
|
106
|
+
liquidator,
|
|
107
|
+
mergeLiquidator,
|
|
108
|
+
convertLiquidator,
|
|
109
|
+
polymarketCtfAdapter,
|
|
110
|
+
opinionCtfExecutionEngineAdapter,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Same as `getVarlaContracts`, but throws if any optional deployment addresses are missing.
|
|
115
|
+
* Useful for backend services that assume a fully-featured deployment.
|
|
116
|
+
*/
|
|
117
|
+
export function getRequiredVarlaContracts(params) {
|
|
118
|
+
const c = getVarlaContracts(params);
|
|
119
|
+
const require = params.require ?? [];
|
|
120
|
+
// Convert the optional keys into a runtime check while preserving a nice signature.
|
|
121
|
+
for (const k of require) {
|
|
122
|
+
if (!c[k]) {
|
|
123
|
+
throw new Error(`Missing required deployment: '${k}' on chain '${c.chain}'`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return c;
|
|
127
|
+
}
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
// Generic helpers (for UIs): ERC20 / ERC1155 / ERC4626
|
|
130
|
+
// ---------------------------------------------------------------------------
|
|
131
|
+
export function getErc20(params) {
|
|
132
|
+
return getContract({ address: params.address, abi: erc20Abi, client: params.client });
|
|
133
|
+
}
|
|
134
|
+
export function getErc1155(params) {
|
|
135
|
+
return getContract({ address: params.address, abi: erc1155Abi, client: params.client });
|
|
136
|
+
}
|
|
137
|
+
export function getErc4626(params) {
|
|
138
|
+
return getContract({ address: params.address, abi: erc4626Abi, client: params.client });
|
|
139
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AbiEvent, Log } from "viem";
|
|
2
|
+
export type DecodedEvent<TArgs = Record<string, unknown>> = {
|
|
3
|
+
args: TArgs;
|
|
4
|
+
eventName: string;
|
|
5
|
+
log: Log;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Decode logs for a single event definition. Returns only successfully decoded entries.
|
|
9
|
+
*/
|
|
10
|
+
export declare function decodeEventLogs(params: {
|
|
11
|
+
event: AbiEvent;
|
|
12
|
+
logs: Log[];
|
|
13
|
+
}): DecodedEvent[];
|
|
14
|
+
//# sourceMappingURL=decode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../src/events/decode.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAG1C,MAAM,MAAM,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IAC1D,IAAI,EAAE,KAAK,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,GAAG,CAAC;CACV,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE;IACtC,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,GAAG,EAAE,CAAC;CACb,GAAG,YAAY,EAAE,CAsBjB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Note: explicit .js extension is required for Node ESM resolution.
|
|
2
|
+
import { decodeEventLog } from "viem";
|
|
3
|
+
/**
|
|
4
|
+
* Decode logs for a single event definition. Returns only successfully decoded entries.
|
|
5
|
+
*/
|
|
6
|
+
export function decodeEventLogs(params) {
|
|
7
|
+
const out = [];
|
|
8
|
+
for (const log of params.logs) {
|
|
9
|
+
try {
|
|
10
|
+
const decoded = decodeEventLog({
|
|
11
|
+
abi: [params.event],
|
|
12
|
+
data: log.data,
|
|
13
|
+
topics: log.topics,
|
|
14
|
+
});
|
|
15
|
+
out.push({
|
|
16
|
+
args: decoded.args,
|
|
17
|
+
eventName: decoded.eventName,
|
|
18
|
+
log,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
// ignore logs that don't decode cleanly (RPCs can return unrelated logs when address is omitted)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AbiEvent } from "viem";
|
|
2
|
+
export declare const ORACLE_EVENTS: {
|
|
3
|
+
readonly PositionConfigured: AbiEvent;
|
|
4
|
+
readonly OppositePositionsConfigured: AbiEvent;
|
|
5
|
+
readonly NegRiskPositionConfigured: AbiEvent;
|
|
6
|
+
readonly NegRiskPositionsBatchConfigured: AbiEvent;
|
|
7
|
+
readonly PriceUpdated: AbiEvent;
|
|
8
|
+
readonly PositionInvalidated: AbiEvent;
|
|
9
|
+
readonly PositionValidated: AbiEvent;
|
|
10
|
+
};
|
|
11
|
+
export declare const CORE_EVENTS: {
|
|
12
|
+
readonly Deposit: AbiEvent;
|
|
13
|
+
readonly Withdraw: AbiEvent;
|
|
14
|
+
readonly Borrow: AbiEvent;
|
|
15
|
+
readonly Repay: AbiEvent;
|
|
16
|
+
readonly Liquidate: AbiEvent;
|
|
17
|
+
readonly LiquidationDebtRepaid: AbiEvent;
|
|
18
|
+
};
|
|
19
|
+
export declare const POOL_EVENTS: {
|
|
20
|
+
readonly Draw: AbiEvent;
|
|
21
|
+
readonly Repay: AbiEvent;
|
|
22
|
+
readonly AccrueInterest: AbiEvent;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=defs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../src/events/defs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AASrC,eAAO,MAAM,aAAa;iCAIlB,QAAQ;0CAIR,QAAQ;wCAIR,QAAQ;8CAIR,QAAQ;2BAIR,QAAQ;kCAIR,QAAQ;gCAIR,QAAQ;CACN,CAAC;AAMX,eAAO,MAAM,WAAW;sBAC+C,QAAQ;uBACN,QAAQ;qBACZ,QAAQ;oBACV,QAAQ;wBACA,QAAQ;oCAI3E,QAAQ;CACN,CAAC;AAMX,eAAO,MAAM,WAAW;mBACyC,QAAQ;oBACN,QAAQ;6BAInE,QAAQ;CACN,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Note: explicit .js extension is required for Node ESM resolution.
|
|
2
|
+
import { getAbiItem } from "viem";
|
|
3
|
+
import { abis } from "../generated.js";
|
|
4
|
+
// ---------------------------------------------------------------------------
|
|
5
|
+
// Oracle
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
export const ORACLE_EVENTS = {
|
|
8
|
+
PositionConfigured: getAbiItem({
|
|
9
|
+
abi: abis.VARLAORACLE_ABI,
|
|
10
|
+
name: "PositionConfigured",
|
|
11
|
+
}),
|
|
12
|
+
OppositePositionsConfigured: getAbiItem({
|
|
13
|
+
abi: abis.VARLAORACLE_ABI,
|
|
14
|
+
name: "OppositePositionsConfigured",
|
|
15
|
+
}),
|
|
16
|
+
NegRiskPositionConfigured: getAbiItem({
|
|
17
|
+
abi: abis.VARLAORACLE_ABI,
|
|
18
|
+
name: "NegRiskPositionConfigured",
|
|
19
|
+
}),
|
|
20
|
+
NegRiskPositionsBatchConfigured: getAbiItem({
|
|
21
|
+
abi: abis.VARLAORACLE_ABI,
|
|
22
|
+
name: "NegRiskPositionsBatchConfigured",
|
|
23
|
+
}),
|
|
24
|
+
PriceUpdated: getAbiItem({
|
|
25
|
+
abi: abis.VARLAORACLE_ABI,
|
|
26
|
+
name: "PriceUpdated",
|
|
27
|
+
}),
|
|
28
|
+
PositionInvalidated: getAbiItem({
|
|
29
|
+
abi: abis.VARLAORACLE_ABI,
|
|
30
|
+
name: "PositionInvalidated",
|
|
31
|
+
}),
|
|
32
|
+
PositionValidated: getAbiItem({
|
|
33
|
+
abi: abis.VARLAORACLE_ABI,
|
|
34
|
+
name: "PositionValidated",
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// Core
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
export const CORE_EVENTS = {
|
|
41
|
+
Deposit: getAbiItem({ abi: abis.VARLACORE_ABI, name: "Deposit" }),
|
|
42
|
+
Withdraw: getAbiItem({ abi: abis.VARLACORE_ABI, name: "Withdraw" }),
|
|
43
|
+
Borrow: getAbiItem({ abi: abis.VARLACORE_ABI, name: "Borrow" }),
|
|
44
|
+
Repay: getAbiItem({ abi: abis.VARLACORE_ABI, name: "Repay" }),
|
|
45
|
+
Liquidate: getAbiItem({ abi: abis.VARLACORE_ABI, name: "Liquidate" }),
|
|
46
|
+
LiquidationDebtRepaid: getAbiItem({
|
|
47
|
+
abi: abis.VARLACORE_ABI,
|
|
48
|
+
name: "LiquidationDebtRepaid",
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
// Pool
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
export const POOL_EVENTS = {
|
|
55
|
+
Draw: getAbiItem({ abi: abis.VARLAPOOL_ABI, name: "Draw" }),
|
|
56
|
+
Repay: getAbiItem({ abi: abis.VARLAPOOL_ABI, name: "Repay" }),
|
|
57
|
+
AccrueInterest: getAbiItem({
|
|
58
|
+
abi: abis.VARLAPOOL_ABI,
|
|
59
|
+
name: "AccrueInterest",
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAEA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AbiEvent, Address, Log, PublicClient } from "viem";
|
|
2
|
+
export type GetEventLogsChunkedParams = {
|
|
3
|
+
client: PublicClient;
|
|
4
|
+
address?: Address | Address[];
|
|
5
|
+
event: AbiEvent;
|
|
6
|
+
args?: Record<string, unknown> | readonly unknown[];
|
|
7
|
+
strict?: boolean;
|
|
8
|
+
fromBlock: bigint;
|
|
9
|
+
toBlock: bigint;
|
|
10
|
+
/** Max number of blocks per request. */
|
|
11
|
+
blockRange?: bigint;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Fetch logs in block-range chunks to avoid RPC limits/timeouts.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getEventLogsChunked(params: GetEventLogsChunkedParams): Promise<Log[]>;
|
|
17
|
+
//# sourceMappingURL=logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/events/logs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEjE,MAAM,MAAM,yBAAyB,GAAG;IACtC,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,EAAE,CAAC;IAC9B,KAAK,EAAE,QAAQ,CAAC;IAGhB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,OAAO,EAAE,CAAC;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAoB3F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Note: explicit .js extension is required for Node ESM resolution.
|
|
2
|
+
/**
|
|
3
|
+
* Fetch logs in block-range chunks to avoid RPC limits/timeouts.
|
|
4
|
+
*/
|
|
5
|
+
export async function getEventLogsChunked(params) {
|
|
6
|
+
const range = params.blockRange ?? 10000n;
|
|
7
|
+
if (range <= 0n)
|
|
8
|
+
throw new Error(`blockRange must be > 0 (got ${range})`);
|
|
9
|
+
const out = [];
|
|
10
|
+
let start = params.fromBlock;
|
|
11
|
+
while (start <= params.toBlock) {
|
|
12
|
+
const end = start + range - 1n <= params.toBlock ? start + range - 1n : params.toBlock;
|
|
13
|
+
const logs = await params.client.getLogs({
|
|
14
|
+
address: params.address,
|
|
15
|
+
event: params.event,
|
|
16
|
+
args: params.args,
|
|
17
|
+
strict: params.strict,
|
|
18
|
+
fromBlock: start,
|
|
19
|
+
toBlock: end,
|
|
20
|
+
});
|
|
21
|
+
out.push(...logs);
|
|
22
|
+
start = end + 1n;
|
|
23
|
+
}
|
|
24
|
+
return out;
|
|
25
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Address, PublicClient } from "viem";
|
|
2
|
+
/**
|
|
3
|
+
* Production-friendly registry sync for VarlaOracle.
|
|
4
|
+
*
|
|
5
|
+
* - Discovers configured `positionIds` from `PositionConfigured` events.
|
|
6
|
+
* - Optionally enriches opposites / negRisk info from events (cheap), then hydrates
|
|
7
|
+
* canonical state from contract views via multicall.
|
|
8
|
+
*/
|
|
9
|
+
export type OracleRegistryEntry = {
|
|
10
|
+
positionId: bigint;
|
|
11
|
+
conditionId: `0x${string}`;
|
|
12
|
+
resolutionTime: bigint;
|
|
13
|
+
riskTier: number;
|
|
14
|
+
isNegRisk: boolean;
|
|
15
|
+
negRiskMarketId: `0x${string}`;
|
|
16
|
+
oppositePositionId: bigint;
|
|
17
|
+
};
|
|
18
|
+
export type SyncOracleRegistryViaEventsParams = {
|
|
19
|
+
client: PublicClient;
|
|
20
|
+
oracleAddress: Address;
|
|
21
|
+
fromBlock: bigint;
|
|
22
|
+
toBlock: bigint;
|
|
23
|
+
/** Max number of blocks per request. */
|
|
24
|
+
blockRange?: bigint;
|
|
25
|
+
multicallChunkSize?: number;
|
|
26
|
+
/** Limit how many discovered ids to hydrate (useful for testing). */
|
|
27
|
+
maxIds?: number;
|
|
28
|
+
};
|
|
29
|
+
export declare function syncOracleRegistryViaEvents(params: SyncOracleRegistryViaEventsParams): Promise<{
|
|
30
|
+
positionIds: bigint[];
|
|
31
|
+
entries: OracleRegistryEntry[];
|
|
32
|
+
}>;
|
|
33
|
+
//# sourceMappingURL=oracleRegistrySync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oracleRegistrySync.d.ts","sourceRoot":"","sources":["../../src/events/oracleRegistrySync.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAQlD;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,MAAM,EAAE,YAAY,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAcF,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,mBAAmB,EAAE,CAAA;CAAE,CAAC,CAuJpE"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// Note: explicit .js extension is required for Node ESM resolution.
|
|
2
|
+
import { multicallChunks } from "../batch.js";
|
|
3
|
+
import { abis } from "../generated.js";
|
|
4
|
+
import { decodeEventLogs } from "./decode.js";
|
|
5
|
+
import { ORACLE_EVENTS } from "./defs.js";
|
|
6
|
+
import { getEventLogsChunked } from "./logs.js";
|
|
7
|
+
function uniqBigints(values) {
|
|
8
|
+
const set = new Set();
|
|
9
|
+
const out = [];
|
|
10
|
+
for (const v of values) {
|
|
11
|
+
const k = v.toString();
|
|
12
|
+
if (set.has(k))
|
|
13
|
+
continue;
|
|
14
|
+
set.add(k);
|
|
15
|
+
out.push(v);
|
|
16
|
+
}
|
|
17
|
+
return out;
|
|
18
|
+
}
|
|
19
|
+
export async function syncOracleRegistryViaEvents(params) {
|
|
20
|
+
const abi = abis.VARLAORACLE_ABI;
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
// 1) Discover ids (PositionConfigured)
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
const configuredLogs = await getEventLogsChunked({
|
|
25
|
+
client: params.client,
|
|
26
|
+
address: params.oracleAddress,
|
|
27
|
+
event: ORACLE_EVENTS.PositionConfigured,
|
|
28
|
+
fromBlock: params.fromBlock,
|
|
29
|
+
toBlock: params.toBlock,
|
|
30
|
+
blockRange: params.blockRange,
|
|
31
|
+
});
|
|
32
|
+
const configuredDecoded = decodeEventLogs({
|
|
33
|
+
event: ORACLE_EVENTS.PositionConfigured,
|
|
34
|
+
logs: configuredLogs,
|
|
35
|
+
});
|
|
36
|
+
let ids = uniqBigints(configuredDecoded.map((d) => d.args.positionId));
|
|
37
|
+
if (params.maxIds)
|
|
38
|
+
ids = ids.slice(0, params.maxIds);
|
|
39
|
+
if (ids.length === 0)
|
|
40
|
+
return { positionIds: [], entries: [] };
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
// 2) Optional enrichment from events (non-authoritative)
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
const oppositeById = new Map();
|
|
45
|
+
{
|
|
46
|
+
const logs = await getEventLogsChunked({
|
|
47
|
+
client: params.client,
|
|
48
|
+
address: params.oracleAddress,
|
|
49
|
+
event: ORACLE_EVENTS.OppositePositionsConfigured,
|
|
50
|
+
fromBlock: params.fromBlock,
|
|
51
|
+
toBlock: params.toBlock,
|
|
52
|
+
blockRange: params.blockRange,
|
|
53
|
+
});
|
|
54
|
+
const decoded = decodeEventLogs({ event: ORACLE_EVENTS.OppositePositionsConfigured, logs });
|
|
55
|
+
for (const d of decoded) {
|
|
56
|
+
const yes = d.args.yesPositionId;
|
|
57
|
+
const no = d.args.noPositionId;
|
|
58
|
+
oppositeById.set(yes.toString(), no);
|
|
59
|
+
oppositeById.set(no.toString(), yes);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const negRiskMarketById = new Map();
|
|
63
|
+
{
|
|
64
|
+
const logs = await getEventLogsChunked({
|
|
65
|
+
client: params.client,
|
|
66
|
+
address: params.oracleAddress,
|
|
67
|
+
event: ORACLE_EVENTS.NegRiskPositionConfigured,
|
|
68
|
+
fromBlock: params.fromBlock,
|
|
69
|
+
toBlock: params.toBlock,
|
|
70
|
+
blockRange: params.blockRange,
|
|
71
|
+
});
|
|
72
|
+
const decoded = decodeEventLogs({ event: ORACLE_EVENTS.NegRiskPositionConfigured, logs });
|
|
73
|
+
for (const d of decoded) {
|
|
74
|
+
const pid = d.args.positionId;
|
|
75
|
+
const marketId = d.args.marketId;
|
|
76
|
+
negRiskMarketById.set(pid.toString(), marketId);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
// 3) Hydrate canonical state from views (authoritative)
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
const calls = ids.flatMap((pid) => [
|
|
83
|
+
{
|
|
84
|
+
address: params.oracleAddress,
|
|
85
|
+
abi,
|
|
86
|
+
functionName: "getConditionId",
|
|
87
|
+
args: [pid],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
address: params.oracleAddress,
|
|
91
|
+
abi,
|
|
92
|
+
functionName: "getResolutionTime",
|
|
93
|
+
args: [pid],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
address: params.oracleAddress,
|
|
97
|
+
abi,
|
|
98
|
+
functionName: "getRiskTier",
|
|
99
|
+
args: [pid],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
address: params.oracleAddress,
|
|
103
|
+
abi,
|
|
104
|
+
functionName: "getOppositePositionId",
|
|
105
|
+
args: [pid],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
address: params.oracleAddress,
|
|
109
|
+
abi,
|
|
110
|
+
functionName: "isNegRisk",
|
|
111
|
+
args: [pid],
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
address: params.oracleAddress,
|
|
115
|
+
abi,
|
|
116
|
+
functionName: "getNegRiskMarketId",
|
|
117
|
+
args: [pid],
|
|
118
|
+
},
|
|
119
|
+
]);
|
|
120
|
+
const chunkSize = params.multicallChunkSize ?? 128;
|
|
121
|
+
const res = await multicallChunks({
|
|
122
|
+
client: params.client,
|
|
123
|
+
contracts: calls,
|
|
124
|
+
chunkSize,
|
|
125
|
+
});
|
|
126
|
+
const entries = [];
|
|
127
|
+
for (let i = 0; i < ids.length; i++) {
|
|
128
|
+
const base = i * 6;
|
|
129
|
+
const r0 = res[base + 0];
|
|
130
|
+
const r1 = res[base + 1];
|
|
131
|
+
const r2 = res[base + 2];
|
|
132
|
+
const r3 = res[base + 3];
|
|
133
|
+
const r4 = res[base + 4];
|
|
134
|
+
const r5 = res[base + 5];
|
|
135
|
+
for (const r of [r0, r1, r2, r3, r4, r5]) {
|
|
136
|
+
if (r.status !== "success") {
|
|
137
|
+
throw new Error(`Oracle registry multicall failed: ${String(r.error)}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
const pid = ids[i];
|
|
141
|
+
const pidKey = pid.toString();
|
|
142
|
+
// Prefer on-chain view results (authoritative), but fall back to event-enriched values
|
|
143
|
+
// if they look more complete.
|
|
144
|
+
const opposite = r3.result || (oppositeById.get(pidKey) ?? 0n);
|
|
145
|
+
const market = r5.result || (negRiskMarketById.get(pidKey) ?? "0x" + "0".repeat(64));
|
|
146
|
+
entries.push({
|
|
147
|
+
positionId: pid,
|
|
148
|
+
conditionId: r0.result,
|
|
149
|
+
resolutionTime: r1.result,
|
|
150
|
+
riskTier: Number(r2.result),
|
|
151
|
+
oppositePositionId: opposite,
|
|
152
|
+
isNegRisk: r4.result,
|
|
153
|
+
negRiskMarketId: market,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
return { positionIds: ids, entries };
|
|
157
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Address, AbiEvent, PublicClient } from "viem";
|
|
2
|
+
export type GetRecentEventsParams = {
|
|
3
|
+
client: PublicClient;
|
|
4
|
+
address: Address;
|
|
5
|
+
event: AbiEvent;
|
|
6
|
+
/** Look back N blocks from the current head. */
|
|
7
|
+
lookbackBlocks?: bigint;
|
|
8
|
+
/** Chunk size for log fetching. */
|
|
9
|
+
blockRange?: bigint;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Frontend-friendly helper: fetch and decode recent events by looking back from head.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getRecentEvents(params: GetRecentEventsParams): Promise<{
|
|
15
|
+
fromBlock: bigint;
|
|
16
|
+
toBlock: bigint;
|
|
17
|
+
decoded: import("./decode.js").DecodedEvent<Record<string, unknown>>[];
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=recent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recent.d.ts","sourceRoot":"","sources":["../../src/events/recent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAO,MAAM,MAAM,CAAC;AAKjE,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,QAAQ,CAAC;IAChB,gDAAgD;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,qBAAqB;;;;GAmBlE"}
|