create-ponder 0.2.0-next.3 → 0.2.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 +5 -2
- package/package.json +1 -1
- package/templates/feature-filter/ponder.schema.ts +2 -2
- package/templates/feature-multichain/ponder.schema.ts +1 -1
- package/templates/feature-proxy/ponder.schema.ts +2 -2
- package/templates/project-friendtech/ponder.schema.ts +6 -6
- package/templates/project-uniswap-v3-flash/ponder.schema.ts +2 -2
- package/templates/reference-erc20/ponder.schema.ts +10 -10
- package/templates/reference-erc20/src/index.ts +5 -6
- package/templates/reference-erc721/ponder.schema.ts +4 -4
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.2.
|
|
19
|
+
version: "0.2.1",
|
|
20
20
|
type: "module",
|
|
21
21
|
description: "A CLI tool to create Ponder apps",
|
|
22
22
|
license: "MIT",
|
|
@@ -25,7 +25,10 @@ var package_default = {
|
|
|
25
25
|
url: "https://github.com/ponder-sh/ponder",
|
|
26
26
|
directory: "packages/create-ponder"
|
|
27
27
|
},
|
|
28
|
-
files: [
|
|
28
|
+
files: [
|
|
29
|
+
"dist",
|
|
30
|
+
"templates"
|
|
31
|
+
],
|
|
29
32
|
bin: {
|
|
30
33
|
"create-ponder": "./dist/index.js"
|
|
31
34
|
},
|
package/package.json
CHANGED
|
@@ -3,10 +3,10 @@ import { createSchema } from "@ponder/core";
|
|
|
3
3
|
export default createSchema((p) => ({
|
|
4
4
|
LiquidationEvent: p.createTable({
|
|
5
5
|
id: p.string(),
|
|
6
|
-
liquidator: p.
|
|
6
|
+
liquidator: p.hex(),
|
|
7
7
|
}),
|
|
8
8
|
OwnershipTransferredEvent: p.createTable({
|
|
9
9
|
id: p.string(),
|
|
10
|
-
newOwner: p.
|
|
10
|
+
newOwner: p.hex(),
|
|
11
11
|
}),
|
|
12
12
|
}));
|
|
@@ -5,8 +5,8 @@ export default createSchema((p) => ({
|
|
|
5
5
|
Share: p.createTable({
|
|
6
6
|
id: p.string(),
|
|
7
7
|
|
|
8
|
-
subjectId: p.
|
|
9
|
-
traderId: p.
|
|
8
|
+
subjectId: p.hex().references("Subject.id"),
|
|
9
|
+
traderId: p.hex().references("Trader.id"),
|
|
10
10
|
|
|
11
11
|
subject: p.one("subjectId"),
|
|
12
12
|
trader: p.one("traderId"),
|
|
@@ -16,8 +16,8 @@ export default createSchema((p) => ({
|
|
|
16
16
|
TradeEvent: p.createTable({
|
|
17
17
|
id: p.string(),
|
|
18
18
|
|
|
19
|
-
subjectId: p.
|
|
20
|
-
traderId: p.
|
|
19
|
+
subjectId: p.hex().references("Subject.id"),
|
|
20
|
+
traderId: p.hex().references("Trader.id"),
|
|
21
21
|
|
|
22
22
|
subject: p.one("subjectId"),
|
|
23
23
|
trader: p.one("traderId"),
|
|
@@ -32,7 +32,7 @@ export default createSchema((p) => ({
|
|
|
32
32
|
timestamp: p.int(),
|
|
33
33
|
}),
|
|
34
34
|
Subject: p.createTable({
|
|
35
|
-
id: p.
|
|
35
|
+
id: p.hex(),
|
|
36
36
|
totalShares: p.bigint(),
|
|
37
37
|
totalTrades: p.bigint(),
|
|
38
38
|
lastPrice: p.bigint(),
|
|
@@ -44,7 +44,7 @@ export default createSchema((p) => ({
|
|
|
44
44
|
trades: p.many("TradeEvent.subjectId"),
|
|
45
45
|
}),
|
|
46
46
|
Trader: p.createTable({
|
|
47
|
-
id: p.
|
|
47
|
+
id: p.hex(),
|
|
48
48
|
totalTrades: p.bigint(),
|
|
49
49
|
spend: p.bigint(),
|
|
50
50
|
earnings: p.bigint(),
|
|
@@ -2,11 +2,11 @@ import { createSchema } from "@ponder/core";
|
|
|
2
2
|
|
|
3
3
|
export default createSchema((p) => ({
|
|
4
4
|
TokenPaid: p.createTable({
|
|
5
|
-
id: p.
|
|
5
|
+
id: p.hex(),
|
|
6
6
|
amount: p.bigint(),
|
|
7
7
|
}),
|
|
8
8
|
TokenBorrowed: p.createTable({
|
|
9
|
-
id: p.
|
|
9
|
+
id: p.hex(),
|
|
10
10
|
amount: p.bigint(),
|
|
11
11
|
}),
|
|
12
12
|
}));
|
|
@@ -2,22 +2,22 @@ import { createSchema } from "@ponder/core";
|
|
|
2
2
|
|
|
3
3
|
export default createSchema((p) => ({
|
|
4
4
|
Account: p.createTable({
|
|
5
|
-
id: p.
|
|
5
|
+
id: p.hex(),
|
|
6
6
|
balance: p.bigint(),
|
|
7
7
|
isOwner: p.boolean(),
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
allowances: p.many("Allowance.ownerId"),
|
|
10
10
|
approvalOwnerEvents: p.many("ApprovalEvent.ownerId"),
|
|
11
11
|
approvalSpenderEvents: p.many("ApprovalEvent.spenderId"),
|
|
12
12
|
transferFromEvents: p.many("TransferEvent.fromId"),
|
|
13
13
|
transferToEvents: p.many("TransferEvent.toId"),
|
|
14
14
|
}),
|
|
15
|
-
|
|
16
|
-
id: p.
|
|
15
|
+
Allowance: p.createTable({
|
|
16
|
+
id: p.string(),
|
|
17
17
|
amount: p.bigint(),
|
|
18
18
|
|
|
19
|
-
ownerId: p.
|
|
20
|
-
spenderId: p.
|
|
19
|
+
ownerId: p.hex().references("Account.id"),
|
|
20
|
+
spenderId: p.hex().references("Account.id"),
|
|
21
21
|
|
|
22
22
|
owner: p.one("ownerId"),
|
|
23
23
|
spender: p.one("spenderId"),
|
|
@@ -27,8 +27,8 @@ export default createSchema((p) => ({
|
|
|
27
27
|
amount: p.bigint(),
|
|
28
28
|
timestamp: p.int(),
|
|
29
29
|
|
|
30
|
-
fromId: p.
|
|
31
|
-
toId: p.
|
|
30
|
+
fromId: p.hex().references("Account.id"),
|
|
31
|
+
toId: p.hex().references("Account.id"),
|
|
32
32
|
|
|
33
33
|
from: p.one("fromId"),
|
|
34
34
|
to: p.one("toId"),
|
|
@@ -38,8 +38,8 @@ export default createSchema((p) => ({
|
|
|
38
38
|
amount: p.bigint(),
|
|
39
39
|
timestamp: p.int(),
|
|
40
40
|
|
|
41
|
-
ownerId: p.
|
|
42
|
-
spenderId: p.
|
|
41
|
+
ownerId: p.hex().references("Account.id"),
|
|
42
|
+
spenderId: p.hex().references("Account.id"),
|
|
43
43
|
|
|
44
44
|
owner: p.one("ownerId"),
|
|
45
45
|
spender: p.one("spenderId"),
|
|
@@ -40,14 +40,13 @@ ponder.on("ERC20:Transfer", async ({ event, context }) => {
|
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
ponder.on("ERC20:Approval", async ({ event, context }) => {
|
|
43
|
-
const {
|
|
43
|
+
const { Allowance, ApprovalEvent } = context.db;
|
|
44
44
|
|
|
45
|
-
const
|
|
46
|
-
`${event.args.owner}-${event.args.spender}` as `0x${string}`;
|
|
45
|
+
const allowanceId = `${event.args.owner}-${event.args.spender}`;
|
|
47
46
|
|
|
48
|
-
// Create or update the
|
|
49
|
-
await
|
|
50
|
-
id:
|
|
47
|
+
// Create or update the Allowance.
|
|
48
|
+
await Allowance.upsert({
|
|
49
|
+
id: allowanceId,
|
|
51
50
|
create: {
|
|
52
51
|
ownerId: event.args.owner,
|
|
53
52
|
spenderId: event.args.spender,
|
|
@@ -2,7 +2,7 @@ import { createSchema } from "@ponder/core";
|
|
|
2
2
|
|
|
3
3
|
export default createSchema((p) => ({
|
|
4
4
|
Account: p.createTable({
|
|
5
|
-
id: p.
|
|
5
|
+
id: p.hex(),
|
|
6
6
|
tokens: p.many("Token.ownerId"),
|
|
7
7
|
|
|
8
8
|
transferFromEvents: p.many("TransferEvent.fromId"),
|
|
@@ -10,7 +10,7 @@ export default createSchema((p) => ({
|
|
|
10
10
|
}),
|
|
11
11
|
Token: p.createTable({
|
|
12
12
|
id: p.bigint(),
|
|
13
|
-
ownerId: p.
|
|
13
|
+
ownerId: p.hex().references("Account.id"),
|
|
14
14
|
|
|
15
15
|
owner: p.one("ownerId"),
|
|
16
16
|
transferEvents: p.many("TransferEvent.tokenId"),
|
|
@@ -18,8 +18,8 @@ export default createSchema((p) => ({
|
|
|
18
18
|
TransferEvent: p.createTable({
|
|
19
19
|
id: p.string(),
|
|
20
20
|
timestamp: p.int(),
|
|
21
|
-
fromId: p.
|
|
22
|
-
toId: p.
|
|
21
|
+
fromId: p.hex().references("Account.id"),
|
|
22
|
+
toId: p.hex().references("Account.id"),
|
|
23
23
|
tokenId: p.bigint().references("Token.id"),
|
|
24
24
|
|
|
25
25
|
from: p.one("fromId"),
|