polytown 0.1.1 → 0.1.3

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.
Files changed (2) hide show
  1. package/dist/index.js +12 -24
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env bun
2
- #!/usr/bin/env node
3
2
 
4
3
  // src/index.ts
5
4
  import { program } from "commander";
@@ -1453,7 +1452,7 @@ var DataClient = class {
1453
1452
  // Market data
1454
1453
  async getHolders(conditionId, params) {
1455
1454
  return fetchJson2(
1456
- buildUrl2(this.baseUrl, "/holders", { conditionId, ...params })
1455
+ buildUrl2(this.baseUrl, "/holders", { market: conditionId, ...params })
1457
1456
  );
1458
1457
  }
1459
1458
  async getOpenInterest(conditionId) {
@@ -1467,7 +1466,7 @@ var DataClient = class {
1467
1466
  // Leaderboards
1468
1467
  async getLeaderboard(params) {
1469
1468
  return fetchJson2(
1470
- buildUrl2(this.baseUrl, "/leaderboard", {
1469
+ buildUrl2(this.baseUrl, "/v1/leaderboard", {
1471
1470
  period: params?.period,
1472
1471
  order_by: params?.orderBy,
1473
1472
  limit: params?.limit,
@@ -1477,20 +1476,10 @@ var DataClient = class {
1477
1476
  }
1478
1477
  async getBuilderLeaderboard(params) {
1479
1478
  return fetchJson2(
1480
- buildUrl2(
1481
- this.baseUrl,
1482
- "/leaderboard/builders",
1483
- params
1484
- )
1485
- );
1486
- }
1487
- async getBuilderVolume(params) {
1488
- return fetchJson2(
1489
- buildUrl2(
1490
- this.baseUrl,
1491
- "/leaderboard/builders/volume",
1492
- params
1493
- )
1479
+ buildUrl2(this.baseUrl, "/v1/leaderboard", {
1480
+ builders: true,
1481
+ ...params
1482
+ })
1494
1483
  );
1495
1484
  }
1496
1485
  };
@@ -1530,10 +1519,14 @@ dataCommand.command("traded [address]").description("Check if address has traded
1530
1519
  const result = await client.getTraded(addr);
1531
1520
  out5(result);
1532
1521
  });
1533
- dataCommand.command("trades [address]").description("Get trade history (defaults to your wallet)").option("--private-key <key>", "Private key").option("--limit <n>", "Limit results", parseInt).option("--offset <n>", "Offset results", parseInt).action(async (address, opts) => {
1522
+ dataCommand.command("trades [address]").description("Get trade history (defaults to your wallet)").option("--private-key <key>", "Private key").option("--market <condition_id>", "Filter by market condition ID").option("--limit <n>", "Limit results", parseInt).option("--offset <n>", "Offset results", parseInt).action(async (address, opts) => {
1534
1523
  const addr = resolveAddr(address, opts);
1535
1524
  const client = new DataClient();
1536
- const result = await client.getTrades(addr, opts);
1525
+ const result = await client.getTrades(addr, {
1526
+ limit: opts.limit,
1527
+ offset: opts.offset,
1528
+ market: opts.market
1529
+ });
1537
1530
  out5(result);
1538
1531
  });
1539
1532
  dataCommand.command("activity [address]").description("Get activity history (defaults to your wallet)").option("--private-key <key>", "Private key").option("--limit <n>", "Limit results", parseInt).option("--offset <n>", "Offset results", parseInt).action(async (address, opts) => {
@@ -1572,11 +1565,6 @@ dataCommand.command("builder-leaderboard").description("Get builder leaderboard"
1572
1565
  const result = await client.getBuilderLeaderboard(opts);
1573
1566
  out5(result);
1574
1567
  });
1575
- dataCommand.command("builder-volume").description("Get builder volume").option("--period <period>", "Time period").action(async (opts) => {
1576
- const client = new DataClient();
1577
- const result = await client.getBuilderVolume(opts);
1578
- out5(result);
1579
- });
1580
1568
 
1581
1569
  // src/commands/approve.ts
1582
1570
  import { Command as Command12 } from "commander";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polytown",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "polytown": "./dist/index.js"