create-ponder 0.1.2 → 0.2.0-next.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/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import { default as prompts } from "prompts";
|
|
|
16
16
|
// package.json
|
|
17
17
|
var package_default = {
|
|
18
18
|
name: "create-ponder",
|
|
19
|
-
version: "0.1
|
|
19
|
+
version: "0.2.0-next.1",
|
|
20
20
|
type: "module",
|
|
21
21
|
description: "A CLI tool to create Ponder apps",
|
|
22
22
|
license: "MIT",
|
|
@@ -25,10 +25,7 @@ var package_default = {
|
|
|
25
25
|
url: "https://github.com/ponder-sh/ponder",
|
|
26
26
|
directory: "packages/create-ponder"
|
|
27
27
|
},
|
|
28
|
-
files: [
|
|
29
|
-
"dist",
|
|
30
|
-
"templates"
|
|
31
|
-
],
|
|
28
|
+
files: ["dist", "templates"],
|
|
32
29
|
bin: {
|
|
33
30
|
"create-ponder": "./dist/index.js"
|
|
34
31
|
},
|
|
@@ -411,7 +408,11 @@ async function notifyUpdate({ options }) {
|
|
|
411
408
|
const updateMessage = packageManager === "bun" ? "bun install --global create-ponder" : packageManager === "pnpm" ? "pnpm add -g create-ponder" : packageManager === "npm" ? "npm install -g create-ponder" : "yarn global add create-ponder";
|
|
412
409
|
log(
|
|
413
410
|
pico2.bold(
|
|
414
|
-
pico2.yellow(
|
|
411
|
+
`${pico2.yellow(
|
|
412
|
+
"A new version of `create-ponder` is available!"
|
|
413
|
+
)}
|
|
414
|
+
You can update by running: ${pico2.cyan(updateMessage)}
|
|
415
|
+
`
|
|
415
416
|
)
|
|
416
417
|
);
|
|
417
418
|
}
|
|
@@ -421,8 +422,8 @@ async function notifyUpdate({ options }) {
|
|
|
421
422
|
}
|
|
422
423
|
|
|
423
424
|
// src/helpers/validate.ts
|
|
424
|
-
import fs from "fs-extra";
|
|
425
425
|
import path2 from "path";
|
|
426
|
+
import fs from "fs-extra";
|
|
426
427
|
import pico3 from "picocolors";
|
|
427
428
|
import validatePackageName from "validate-npm-package-name";
|
|
428
429
|
async function validateProjectName({
|
|
@@ -460,7 +461,7 @@ async function validateTemplateName({
|
|
|
460
461
|
if (isNameRequired && !templateId)
|
|
461
462
|
return {
|
|
462
463
|
valid: false,
|
|
463
|
-
message:
|
|
464
|
+
message: "\u{1F648} no template provided.",
|
|
464
465
|
problems: "\u{1F449} select a template or provide one using --template."
|
|
465
466
|
};
|
|
466
467
|
if (templateId && !templates2.find((template) => template.id === templateId))
|
|
@@ -562,7 +563,7 @@ async function run({
|
|
|
562
563
|
projectPath = args[0].trim();
|
|
563
564
|
const splitPath = projectPath.split("/");
|
|
564
565
|
projectName = splitPath[splitPath.length - 1]?.trim() || "";
|
|
565
|
-
log2(pico4.green("\u2714"), pico4.bold(
|
|
566
|
+
log2(pico4.green("\u2714"), pico4.bold("Using project name:"), projectName);
|
|
566
567
|
} else {
|
|
567
568
|
const res = await prompts({
|
|
568
569
|
initial: "my-app",
|
|
@@ -642,7 +643,7 @@ async function run({
|
|
|
642
643
|
import { createConfig${Object.values(config.contracts).some((c) => Array.isArray(c.abi)) ? ", mergeAbis" : ""} } from "@ponder/core";
|
|
643
644
|
import { http } from "viem";
|
|
644
645
|
|
|
645
|
-
${Object.values(config.contracts).
|
|
646
|
+
${Object.values(config.contracts).flatMap((c) => c.abi).map(
|
|
646
647
|
(abi) => `import {${abi.name}} from "${abi.dir.slice(
|
|
647
648
|
0,
|
|
648
649
|
abi.dir.length - 3
|
|
@@ -659,7 +660,7 @@ async function run({
|
|
|
659
660
|
(acc, [name, c]) => {
|
|
660
661
|
acc[name] = {
|
|
661
662
|
...c,
|
|
662
|
-
abi: Array.isArray(c.abi) ? `mergeAbis(${c.abi.map((a) => a.name).join(",")})` : c.abi.name
|
|
663
|
+
abi: Array.isArray(c.abi) ? `mergeAbis([${c.abi.map((a) => a.name).join(",")}])` : c.abi.name
|
|
663
664
|
};
|
|
664
665
|
return acc;
|
|
665
666
|
},
|
package/package.json
CHANGED
|
@@ -10,9 +10,10 @@ ponder.on("FriendtechSharesV1:Trade", async ({ event, context }) => {
|
|
|
10
10
|
|
|
11
11
|
const subjectId = event.args.subject;
|
|
12
12
|
const traderId = event.args.trader;
|
|
13
|
-
const shareId = event.args.subject
|
|
14
|
-
const tradeEventId =
|
|
15
|
-
event.transaction.hash
|
|
13
|
+
const shareId = `${event.args.subject}-${event.args.trader}`;
|
|
14
|
+
const tradeEventId = `${
|
|
15
|
+
event.transaction.hash
|
|
16
|
+
}-${event.log.logIndex.toString()}`;
|
|
16
17
|
|
|
17
18
|
const feeAmount = event.args.protocolEthAmount + event.args.subjectEthAmount;
|
|
18
19
|
|