@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/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`: since decision
87
- * 098 `Listed` has one signature (the sponsored policies', F and C), so no policy event needs a prefix.
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.publicPolicyC)) return indexedContractOf("sponsor", event);
100
- if (is(d.polPolicy)) return indexedContractOf("pol", event);
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; // `Listed` was two contracts' (the public and the private policy) until decision 098; now every policy event is unshared
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, orphanPolicyFAbi, padPolicyAbi, polPolicyAbi, policyRegistryAbi, sponsorPolicyCAbi, sponsorPolicyFAbi } from "./generated.js";
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, padPolicyAbi } from "./generated.js";
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, ...padPolicyAbi, ...permit2Errors] as readonly { type: string }[]) {
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))) {