@logswap/sdk 0.5.70 → 0.5.71
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/dist/fpool.d.ts +4 -1
- package/dist/fpool.js +4 -8
- package/package.json +1 -1
- package/src/fpool.ts +5 -9
package/dist/fpool.d.ts
CHANGED
|
@@ -1558,11 +1558,14 @@ export declare function fPoolsControlledBy(c: LogswapClient, who: Address, opts?
|
|
|
1558
1558
|
/**
|
|
1559
1559
|
* Every holder of a pool's shares, from the ERC-6909 Transfer stream — the id is an indexed
|
|
1560
1560
|
* topic, so one filtered log query aggregates the whole ledger. The 0xdead entry is the
|
|
1561
|
-
* MIN_SHARES lock from seeding; callers usually label rather than hide it.
|
|
1561
|
+
* MIN_SHARES lock from seeding; callers usually label rather than hide it. Pass `indexer`: a node
|
|
1562
|
+
* prunes its logs (anvil keeps about a day), and a ledger rebuilt from a pruned stream loses every
|
|
1563
|
+
* holder minted before the cut.
|
|
1562
1564
|
*/
|
|
1563
1565
|
export declare function fPoolShareHolders(c: LogswapClient, poolIdHex: Hex, opts?: {
|
|
1564
1566
|
fromBlock?: bigint;
|
|
1565
1567
|
gen?: bigint | number;
|
|
1568
|
+
indexer?: string;
|
|
1566
1569
|
}): Promise<Array<{
|
|
1567
1570
|
holder: Address;
|
|
1568
1571
|
shares: bigint;
|
package/dist/fpool.js
CHANGED
|
@@ -1347,20 +1347,16 @@ export async function fPoolsControlledBy(c, who, opts = {}) {
|
|
|
1347
1347
|
/**
|
|
1348
1348
|
* Every holder of a pool's shares, from the ERC-6909 Transfer stream — the id is an indexed
|
|
1349
1349
|
* topic, so one filtered log query aggregates the whole ledger. The 0xdead entry is the
|
|
1350
|
-
* MIN_SHARES lock from seeding; callers usually label rather than hide it.
|
|
1350
|
+
* MIN_SHARES lock from seeding; callers usually label rather than hide it. Pass `indexer`: a node
|
|
1351
|
+
* prunes its logs (anvil keeps about a day), and a ledger rebuilt from a pruned stream loses every
|
|
1352
|
+
* holder minted before the cut.
|
|
1351
1353
|
*/
|
|
1352
1354
|
export async function fPoolShareHolders(c, poolIdHex, opts = {}) {
|
|
1353
1355
|
const ev = fPoolManagerAbi.find((x) => x.type === "event" && x.name === "Transfer");
|
|
1354
1356
|
if (!ev)
|
|
1355
1357
|
throw new Error("logswap: 6909 Transfer event missing from the generated ABI");
|
|
1356
1358
|
const id = fPoolShareId(poolIdHex, opts.gen ?? (await fPoolGen(c, poolIdHex)));
|
|
1357
|
-
const logs = await c.
|
|
1358
|
-
address: c.addresses.fPoolManager,
|
|
1359
|
-
event: ev,
|
|
1360
|
-
args: { id },
|
|
1361
|
-
fromBlock: opts.fromBlock ?? 0n,
|
|
1362
|
-
toBlock: "latest",
|
|
1363
|
-
});
|
|
1359
|
+
const { logs } = await getEventLogs(c, { indexer: opts.indexer, address: c.addresses.fPoolManager, event: ev, args: { id }, fromBlock: opts.fromBlock });
|
|
1364
1360
|
const bal = new Map();
|
|
1365
1361
|
for (const l of logs) {
|
|
1366
1362
|
const a = l.args;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logswap/sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.71",
|
|
4
4
|
"description": "TypeScript SDK for Logswap, the liquidity primitive introducing the logarithmic invariant — typed wrappers over the CPoolManager / FPoolManager / Router / Lens surface.",
|
|
5
5
|
"license": "GPL-2.0-or-later",
|
|
6
6
|
"type": "module",
|
package/src/fpool.ts
CHANGED
|
@@ -1914,24 +1914,20 @@ export async function fPoolsControlledBy(
|
|
|
1914
1914
|
/**
|
|
1915
1915
|
* Every holder of a pool's shares, from the ERC-6909 Transfer stream — the id is an indexed
|
|
1916
1916
|
* topic, so one filtered log query aggregates the whole ledger. The 0xdead entry is the
|
|
1917
|
-
* MIN_SHARES lock from seeding; callers usually label rather than hide it.
|
|
1917
|
+
* MIN_SHARES lock from seeding; callers usually label rather than hide it. Pass `indexer`: a node
|
|
1918
|
+
* prunes its logs (anvil keeps about a day), and a ledger rebuilt from a pruned stream loses every
|
|
1919
|
+
* holder minted before the cut.
|
|
1918
1920
|
*/
|
|
1919
1921
|
export async function fPoolShareHolders(
|
|
1920
1922
|
c: LogswapClient,
|
|
1921
1923
|
poolIdHex: Hex,
|
|
1922
|
-
opts: { fromBlock?: bigint; gen?: bigint | number } = {},
|
|
1924
|
+
opts: { fromBlock?: bigint; gen?: bigint | number; indexer?: string } = {},
|
|
1923
1925
|
): Promise<Array<{ holder: Address; shares: bigint }>> {
|
|
1924
1926
|
type Ev = Extract<(typeof fPoolManagerAbi)[number], { type: "event"; name: "Transfer" }>;
|
|
1925
1927
|
const ev = fPoolManagerAbi.find((x): x is Ev => x.type === "event" && x.name === "Transfer");
|
|
1926
1928
|
if (!ev) throw new Error("logswap: 6909 Transfer event missing from the generated ABI");
|
|
1927
1929
|
const id = fPoolShareId(poolIdHex, opts.gen ?? (await fPoolGen(c, poolIdHex)));
|
|
1928
|
-
const logs = await c.
|
|
1929
|
-
address: c.addresses.fPoolManager!,
|
|
1930
|
-
event: ev,
|
|
1931
|
-
args: { id },
|
|
1932
|
-
fromBlock: opts.fromBlock ?? 0n,
|
|
1933
|
-
toBlock: "latest",
|
|
1934
|
-
});
|
|
1930
|
+
const { logs } = await getEventLogs(c, { indexer: opts.indexer, address: c.addresses.fPoolManager!, event: ev, args: { id }, fromBlock: opts.fromBlock });
|
|
1935
1931
|
const bal = new Map<string, bigint>();
|
|
1936
1932
|
for (const l of logs) {
|
|
1937
1933
|
const a = l.args as { from: Address; to: Address; amount: bigint };
|