@logswap/sdk 0.5.91 → 0.5.93
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 +61 -18
- package/dist/admin.d.ts +48 -871
- package/dist/admin.js +55 -110
- package/dist/chains.d.ts +4 -4
- package/dist/chains.js +2 -3
- package/dist/client.d.ts +6 -7
- package/dist/client.js +12 -1
- package/dist/fpool.d.ts +298 -801
- package/dist/fpool.js +312 -336
- package/dist/generated.d.ts +1707 -3843
- package/dist/generated.js +982 -2248
- package/dist/history.js +7 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/write.js +2 -2
- package/package.json +1 -1
- package/src/admin.ts +66 -169
- package/src/chains.ts +6 -7
- package/src/client.ts +17 -7
- package/src/fpool.ts +449 -510
- package/src/generated.ts +938 -2210
- package/src/history.ts +5 -7
- package/src/index.ts +1 -1
- package/src/write.ts +2 -2
package/src/history.ts
CHANGED
|
@@ -83,8 +83,8 @@ export async function getEventLogs<A = Record<string, unknown>>(
|
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* What the rindexer deployment calls each contract — the prefix of a table two contracts share
|
|
86
|
-
* (logswap-be `devnet/indexer/rindexer.yaml`). Every policy is one factory-tracked contract, `Policy`:
|
|
87
|
-
*
|
|
86
|
+
* (logswap-be `devnet/indexer/rindexer.yaml`). Every policy is one factory-tracked contract, `Policy`: the four F policies are
|
|
87
|
+
* one contract (`PolicyF`, F 41) and share its events, so no policy event needs a prefix.
|
|
88
88
|
*/
|
|
89
89
|
function contractName(c: LogswapClient, address: Address, event: string): string | null {
|
|
90
90
|
const a = address.toLowerCase();
|
|
@@ -96,10 +96,8 @@ function contractName(c: LogswapClient, address: Address, event: string): string
|
|
|
96
96
|
if (is(d.routerF) || is(d.routerC)) return "LogswapRouter";
|
|
97
97
|
if (is(d.policyRegistry)) return "PolicyRegistry";
|
|
98
98
|
if (is(d.tokenFactory)) return "TokenFactory";
|
|
99
|
-
if (is(d.publicPolicy) || is(d.privatePolicy) || is(d.
|
|
100
|
-
if (is(d.
|
|
101
|
-
if (is(d.padPolicy)) return indexedContractOf("pad", event);
|
|
102
|
-
if (is(d.orphanPolicy)) return indexedContractOf("orphan", event);
|
|
99
|
+
if (is(d.publicPolicy) || is(d.privatePolicy) || is(d.polPolicy) || is(d.padPolicy)) return indexedContractOf("public", event);
|
|
100
|
+
if (is(d.publicPolicyC)) return indexedContractOf("public", event);
|
|
103
101
|
return null;
|
|
104
102
|
}
|
|
105
103
|
|
|
@@ -107,7 +105,7 @@ function contractName(c: LogswapClient, address: Address, event: string): string
|
|
|
107
105
|
* A policy's name in the indexer for one of its events: `Policy`. Pass it as {@link EventLogsQuery.contract} for a policy outside the artifact.
|
|
108
106
|
*/
|
|
109
107
|
export function indexedContractOf(kind: FPoolKind, event: string): string {
|
|
110
|
-
void kind; //
|
|
108
|
+
void kind; // one contract serves every F kind (F 41) and the C sponsored policy's events do not clash with its: every policy event is unshared
|
|
111
109
|
return "Policy";
|
|
112
110
|
}
|
|
113
111
|
|
package/src/index.ts
CHANGED
|
@@ -23,5 +23,5 @@ export * from "./fpool.js";
|
|
|
23
23
|
export * from "./fees.js";
|
|
24
24
|
export * from "./history.js";
|
|
25
25
|
export * from "./views.js";
|
|
26
|
-
export { managerCAbi, managerFAbi, lensCAbi, lensFAbi, routerCAbi, routerFAbi, routerActionsAbi,
|
|
26
|
+
export { managerCAbi, managerFAbi, lensCAbi, lensFAbi, routerCAbi, routerFAbi, routerActionsAbi, policyFAbi, policyRegistryAbi, sponsorPolicyCAbi } from "./generated.js";
|
|
27
27
|
export * from "./admin.js";
|
package/src/write.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
import type { Address, Hash, Hex } from "viem";
|
|
17
17
|
import { routerOf, type LogswapClient, type Side } from "./client.js";
|
|
18
|
-
import { managerCAbi, managerFAbi,
|
|
18
|
+
import { managerCAbi, managerFAbi, policyFAbi } from "./generated.js";
|
|
19
19
|
|
|
20
20
|
/** Disables the deadline check. Deliberate opt-out, never a default. */
|
|
21
21
|
export const NEVER = (1n << 256n) - 1n;
|
|
@@ -110,7 +110,7 @@ const errorKey = (e: AbiError) => `${e.name}(${e.inputs.map((i) => i.type).join(
|
|
|
110
110
|
export const routerRevertErrors: readonly AbiError[] = (() => {
|
|
111
111
|
const seen = new Set<string>();
|
|
112
112
|
const out: AbiError[] = [];
|
|
113
|
-
for (const x of [...managerCAbi, ...managerFAbi, ...
|
|
113
|
+
for (const x of [...managerCAbi, ...managerFAbi, ...policyFAbi, ...permit2Errors] as readonly { type: string }[]) {
|
|
114
114
|
if (x.type !== "error") continue;
|
|
115
115
|
const e = x as AbiError;
|
|
116
116
|
if (!seen.has(errorKey(e))) {
|