Skip to content

Commit da8d89a

Browse files
committed
eoa executor wip
1 parent 4c861a0 commit da8d89a

File tree

17 files changed

+2493
-91
lines changed

17 files changed

+2493
-91
lines changed

.env.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
THIRDWEB_API_SECRET_KEY="test"
2-
POSTGRES_CONNECTION_URL="postgresql://postgres:postgres@localhost:5432/postgres?sslmode=disable"
2+
POSTGRES_CONNECTION_URL="postgresql://postgres:postgres@localhost:5432/postgres?sslmode=disable&timezone=utc"
33
ADMIN_WALLET_ADDRESS="test"
44
ENCRYPTION_PASSWORD="test"
55
ENABLE_KEYPAIR_AUTH="true"
Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ CREATE TABLE "address_subscriptions" (
44
"address" text NOT NULL,
55
"conditions" jsonb[],
66
"webhookId" uuid,
7-
"createdAt" timestamp DEFAULT now() NOT NULL,
8-
"updatedAt" timestamp NOT NULL,
9-
"deletedAt" timestamp
7+
"createdAt" timestamp with time zone DEFAULT now() NOT NULL,
8+
"updatedAt" timestamp with time zone NOT NULL,
9+
"deletedAt" timestamp with time zone
1010
);
1111
--> statement-breakpoint
1212
CREATE TABLE "configuration" (
@@ -28,9 +28,9 @@ CREATE TABLE "eoa_credentials" (
2828
"label" text NOT NULL,
2929
"data" json NOT NULL,
3030
"isDefault" boolean DEFAULT false NOT NULL,
31-
"createdAt" timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
32-
"updatedAt" timestamp NOT NULL,
33-
"deletedAt" timestamp
31+
"createdAt" timestamp with time zone DEFAULT now() NOT NULL,
32+
"updatedAt" timestamp with time zone NOT NULL,
33+
"deletedAt" timestamp with time zone
3434
);
3535
--> statement-breakpoint
3636
CREATE TABLE "eoas" (
@@ -40,19 +40,19 @@ CREATE TABLE "eoas" (
4040
"label" text NOT NULL,
4141
"credentialId" uuid,
4242
"platformIdentifiers" jsonb,
43-
"createdAt" timestamp DEFAULT now() NOT NULL,
44-
"updatedAt" timestamp NOT NULL,
45-
"deletedAt" timestamp
43+
"createdAt" timestamp with time zone DEFAULT now() NOT NULL,
44+
"updatedAt" timestamp with time zone NOT NULL,
45+
"deletedAt" timestamp with time zone
4646
);
4747
--> statement-breakpoint
4848
CREATE TABLE "keypairs" (
4949
"hash" text PRIMARY KEY NOT NULL,
5050
"publicKey" text NOT NULL,
5151
"algorithm" text NOT NULL,
5252
"label" text,
53-
"createdAt" timestamp DEFAULT now() NOT NULL,
54-
"updatedAt" timestamp NOT NULL,
55-
"deletedAt" timestamp
53+
"createdAt" timestamp with time zone DEFAULT now() NOT NULL,
54+
"updatedAt" timestamp with time zone NOT NULL,
55+
"deletedAt" timestamp with time zone
5656
);
5757
--> statement-breakpoint
5858
CREATE TABLE "permissions" (
@@ -77,9 +77,9 @@ CREATE TABLE "smart_accounts" (
7777
"factoryAddress" text NOT NULL,
7878
"entrypointAddress" text NOT NULL,
7979
"accountSalt" text,
80-
"createdAt" timestamp DEFAULT now() NOT NULL,
81-
"updatedAt" timestamp NOT NULL,
82-
"deletedAt" timestamp,
80+
"createdAt" timestamp with time zone DEFAULT now() NOT NULL,
81+
"updatedAt" timestamp with time zone NOT NULL,
82+
"deletedAt" timestamp with time zone,
8383
CONSTRAINT "smart_accounts_address_signerAddress_pk" PRIMARY KEY("address","signerAddress")
8484
);
8585
--> statement-breakpoint
@@ -89,9 +89,9 @@ CREATE TABLE "tokens" (
8989
"accountAddress" text NOT NULL,
9090
"isAccessToken" boolean NOT NULL,
9191
"label" text,
92-
"createdAt" timestamp DEFAULT now() NOT NULL,
93-
"expiresAt" timestamp NOT NULL,
94-
"revokedAt" timestamp
92+
"createdAt" timestamp with time zone DEFAULT now() NOT NULL,
93+
"expiresAt" timestamp with time zone NOT NULL,
94+
"revokedAt" timestamp with time zone
9595
);
9696
--> statement-breakpoint
9797
CREATE TABLE "transactions" (
@@ -101,14 +101,14 @@ CREATE TABLE "transactions" (
101101
"from" text,
102102
"transactionParams" jsonb NOT NULL,
103103
"transactionHash" text,
104-
"confirmedAt" timestamp,
104+
"confirmedAt" timestamp with time zone,
105105
"confirmedAtBlockNumber" text,
106106
"enrichedData" jsonb DEFAULT '[]'::jsonb NOT NULL,
107107
"executionParams" jsonb NOT NULL,
108108
"executionResult" jsonb,
109-
"createdAt" timestamp DEFAULT now() NOT NULL,
109+
"createdAt" timestamp with time zone DEFAULT now() NOT NULL,
110110
"errorMessage" text,
111-
"cancelledAt" timestamp,
111+
"cancelledAt" timestamp with time zone,
112112
CONSTRAINT "transactions_id_batchIndex_pk" PRIMARY KEY("id","batchIndex")
113113
);
114114
--> statement-breakpoint
@@ -118,9 +118,9 @@ CREATE TABLE "webhooks" (
118118
"url" text NOT NULL,
119119
"secret" text NOT NULL,
120120
"eventType" text NOT NULL,
121-
"createdAt" timestamp DEFAULT now() NOT NULL,
122-
"updatedAt" timestamp NOT NULL,
123-
"revokedAt" timestamp
121+
"createdAt" timestamp with time zone DEFAULT now() NOT NULL,
122+
"updatedAt" timestamp with time zone NOT NULL,
123+
"revokedAt" timestamp with time zone
124124
);
125125
--> statement-breakpoint
126126
ALTER TABLE "address_subscriptions" ADD CONSTRAINT "address_subscriptions_webhookId_webhooks_id_fk" FOREIGN KEY ("webhookId") REFERENCES "public"."webhooks"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
@@ -137,4 +137,6 @@ CREATE INDEX "eoas_deleted_at_not_null_idx" ON "eoas" USING btree ("deletedAt")
137137
CREATE INDEX "smart_accounts_signer_address_idx" ON "smart_accounts" USING btree ("signerAddress");--> statement-breakpoint
138138
CREATE INDEX "smart_accounts_deleted_at_not_null_idx" ON "smart_accounts" USING btree ("deletedAt") WHERE "smart_accounts"."deletedAt" IS NOT NULL;--> statement-breakpoint
139139
CREATE INDEX "transaction_hash_idx" ON "transactions" USING btree ("transactionHash");--> statement-breakpoint
140-
CREATE INDEX "from_idx" ON "transactions" USING btree ("from");
140+
CREATE INDEX "from_idx" ON "transactions" USING btree ("from");--> statement-breakpoint
141+
CREATE INDEX "execution_params_idx" ON "transactions" USING gin ("executionParams");--> statement-breakpoint
142+
CREATE INDEX "execution_result_idx" ON "transactions" USING gin ("executionResult");

drizzle/meta/0000_snapshot.json

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "10922fc4-5afc-4508-a4ac-7759d26ba7a8",
2+
"id": "67d61535-ec60-44c0-a6b3-e1aea354e8d3",
33
"prevId": "00000000-0000-0000-0000-000000000000",
44
"version": "7",
55
"dialect": "postgresql",
@@ -41,20 +41,20 @@
4141
},
4242
"createdAt": {
4343
"name": "createdAt",
44-
"type": "timestamp",
44+
"type": "timestamp with time zone",
4545
"primaryKey": false,
4646
"notNull": true,
4747
"default": "now()"
4848
},
4949
"updatedAt": {
5050
"name": "updatedAt",
51-
"type": "timestamp",
51+
"type": "timestamp with time zone",
5252
"primaryKey": false,
5353
"notNull": true
5454
},
5555
"deletedAt": {
5656
"name": "deletedAt",
57-
"type": "timestamp",
57+
"type": "timestamp with time zone",
5858
"primaryKey": false,
5959
"notNull": false
6060
}
@@ -259,20 +259,20 @@
259259
},
260260
"createdAt": {
261261
"name": "createdAt",
262-
"type": "timestamp",
262+
"type": "timestamp with time zone",
263263
"primaryKey": false,
264264
"notNull": true,
265-
"default": "CURRENT_TIMESTAMP"
265+
"default": "now()"
266266
},
267267
"updatedAt": {
268268
"name": "updatedAt",
269-
"type": "timestamp",
269+
"type": "timestamp with time zone",
270270
"primaryKey": false,
271271
"notNull": true
272272
},
273273
"deletedAt": {
274274
"name": "deletedAt",
275-
"type": "timestamp",
275+
"type": "timestamp with time zone",
276276
"primaryKey": false,
277277
"notNull": false
278278
}
@@ -375,20 +375,20 @@
375375
},
376376
"createdAt": {
377377
"name": "createdAt",
378-
"type": "timestamp",
378+
"type": "timestamp with time zone",
379379
"primaryKey": false,
380380
"notNull": true,
381381
"default": "now()"
382382
},
383383
"updatedAt": {
384384
"name": "updatedAt",
385-
"type": "timestamp",
385+
"type": "timestamp with time zone",
386386
"primaryKey": false,
387387
"notNull": true
388388
},
389389
"deletedAt": {
390390
"name": "deletedAt",
391-
"type": "timestamp",
391+
"type": "timestamp with time zone",
392392
"primaryKey": false,
393393
"notNull": false
394394
}
@@ -462,20 +462,20 @@
462462
},
463463
"createdAt": {
464464
"name": "createdAt",
465-
"type": "timestamp",
465+
"type": "timestamp with time zone",
466466
"primaryKey": false,
467467
"notNull": true,
468468
"default": "now()"
469469
},
470470
"updatedAt": {
471471
"name": "updatedAt",
472-
"type": "timestamp",
472+
"type": "timestamp with time zone",
473473
"primaryKey": false,
474474
"notNull": true
475475
},
476476
"deletedAt": {
477477
"name": "deletedAt",
478-
"type": "timestamp",
478+
"type": "timestamp with time zone",
479479
"primaryKey": false,
480480
"notNull": false
481481
}
@@ -613,20 +613,20 @@
613613
},
614614
"createdAt": {
615615
"name": "createdAt",
616-
"type": "timestamp",
616+
"type": "timestamp with time zone",
617617
"primaryKey": false,
618618
"notNull": true,
619619
"default": "now()"
620620
},
621621
"updatedAt": {
622622
"name": "updatedAt",
623-
"type": "timestamp",
623+
"type": "timestamp with time zone",
624624
"primaryKey": false,
625625
"notNull": true
626626
},
627627
"deletedAt": {
628628
"name": "deletedAt",
629-
"type": "timestamp",
629+
"type": "timestamp with time zone",
630630
"primaryKey": false,
631631
"notNull": false
632632
}
@@ -729,20 +729,20 @@
729729
},
730730
"createdAt": {
731731
"name": "createdAt",
732-
"type": "timestamp",
732+
"type": "timestamp with time zone",
733733
"primaryKey": false,
734734
"notNull": true,
735735
"default": "now()"
736736
},
737737
"expiresAt": {
738738
"name": "expiresAt",
739-
"type": "timestamp",
739+
"type": "timestamp with time zone",
740740
"primaryKey": false,
741741
"notNull": true
742742
},
743743
"revokedAt": {
744744
"name": "revokedAt",
745-
"type": "timestamp",
745+
"type": "timestamp with time zone",
746746
"primaryKey": false,
747747
"notNull": false
748748
}
@@ -797,7 +797,7 @@
797797
},
798798
"confirmedAt": {
799799
"name": "confirmedAt",
800-
"type": "timestamp",
800+
"type": "timestamp with time zone",
801801
"primaryKey": false,
802802
"notNull": false
803803
},
@@ -828,7 +828,7 @@
828828
},
829829
"createdAt": {
830830
"name": "createdAt",
831-
"type": "timestamp",
831+
"type": "timestamp with time zone",
832832
"primaryKey": false,
833833
"notNull": true,
834834
"default": "now()"
@@ -841,7 +841,7 @@
841841
},
842842
"cancelledAt": {
843843
"name": "cancelledAt",
844-
"type": "timestamp",
844+
"type": "timestamp with time zone",
845845
"primaryKey": false,
846846
"notNull": false
847847
}
@@ -876,6 +876,36 @@
876876
"concurrently": false,
877877
"method": "btree",
878878
"with": {}
879+
},
880+
"execution_params_idx": {
881+
"name": "execution_params_idx",
882+
"columns": [
883+
{
884+
"expression": "executionParams",
885+
"isExpression": false,
886+
"asc": true,
887+
"nulls": "last"
888+
}
889+
],
890+
"isUnique": false,
891+
"concurrently": false,
892+
"method": "gin",
893+
"with": {}
894+
},
895+
"execution_result_idx": {
896+
"name": "execution_result_idx",
897+
"columns": [
898+
{
899+
"expression": "executionResult",
900+
"isExpression": false,
901+
"asc": true,
902+
"nulls": "last"
903+
}
904+
],
905+
"isUnique": false,
906+
"concurrently": false,
907+
"method": "gin",
908+
"with": {}
879909
}
880910
},
881911
"foreignKeys": {},
@@ -930,20 +960,20 @@
930960
},
931961
"createdAt": {
932962
"name": "createdAt",
933-
"type": "timestamp",
963+
"type": "timestamp with time zone",
934964
"primaryKey": false,
935965
"notNull": true,
936966
"default": "now()"
937967
},
938968
"updatedAt": {
939969
"name": "updatedAt",
940-
"type": "timestamp",
970+
"type": "timestamp with time zone",
941971
"primaryKey": false,
942972
"notNull": true
943973
},
944974
"revokedAt": {
945975
"name": "revokedAt",
946-
"type": "timestamp",
976+
"type": "timestamp with time zone",
947977
"primaryKey": false,
948978
"notNull": false
949979
}

drizzle/meta/_journal.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
{
66
"idx": 0,
77
"version": "7",
8-
"when": 1740233449989,
9-
"tag": "0000_aromatic_kitty_pryde",
8+
"when": 1740357427731,
9+
"tag": "0000_deep_stephen_strange",
1010
"breakpoints": true
1111
}
1212
]

src/db/connection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const primaryDb = drizzle(
77
new pg.Pool({
88
connectionString: env.POSTGRES_CONNECTION_URL,
99
}),
10-
{ schema },
10+
{ schema }
1111
);
1212

1313
export const db = primaryDb;

0 commit comments

Comments
 (0)