-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from BirthdayResearch/harsh/finalize-bot
feat(bot): save SC logs
- Loading branch information
Showing
22 changed files
with
735 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
apps/server/prisma/migrations/20240712074917_sc_save_logs/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
-- CreateTable | ||
CREATE TABLE "ScDepositEvents" ( | ||
"id" SERIAL NOT NULL, | ||
"txnHash" TEXT NOT NULL, | ||
"network" "Network" NOT NULL, | ||
"owner" TEXT NOT NULL, | ||
"receiver" TEXT NOT NULL, | ||
"assets" TEXT NOT NULL, | ||
"shares" TEXT NOT NULL, | ||
"fees" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3), | ||
|
||
CONSTRAINT "ScDepositEvents_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "ScWithdrawalRequestEvents" ( | ||
"id" SERIAL NOT NULL, | ||
"txnHash" TEXT NOT NULL, | ||
"network" "Network" NOT NULL, | ||
"requestId" TEXT NOT NULL, | ||
"owner" TEXT NOT NULL, | ||
"receiver" TEXT NOT NULL, | ||
"assets" TEXT NOT NULL, | ||
"shares" TEXT NOT NULL, | ||
"fees" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3), | ||
|
||
CONSTRAINT "ScWithdrawalRequestEvents_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "ScWithdrawalFinalizeEvents" ( | ||
"id" SERIAL NOT NULL, | ||
"txnHash" TEXT NOT NULL, | ||
"network" "Network" NOT NULL, | ||
"from" TEXT NOT NULL, | ||
"to" TEXT NOT NULL, | ||
"assets" TEXT NOT NULL, | ||
"shares" TEXT NOT NULL, | ||
"timestamp" TIMESTAMP(3) NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3), | ||
|
||
CONSTRAINT "ScWithdrawalFinalizeEvents_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "ScWithdrawalClaimEvents" ( | ||
"id" SERIAL NOT NULL, | ||
"txnHash" TEXT NOT NULL, | ||
"network" "Network" NOT NULL, | ||
"requestId" TEXT NOT NULL, | ||
"owner" TEXT NOT NULL, | ||
"receiver" TEXT NOT NULL, | ||
"assets" TEXT NOT NULL, | ||
"shares" TEXT NOT NULL, | ||
"fees" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3), | ||
|
||
CONSTRAINT "ScWithdrawalClaimEvents_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "ScRewardEvents" ( | ||
"id" SERIAL NOT NULL, | ||
"txnHash" TEXT NOT NULL, | ||
"network" "Network" NOT NULL, | ||
"owner" TEXT NOT NULL, | ||
"assets" TEXT NOT NULL, | ||
"fees" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3), | ||
|
||
CONSTRAINT "ScRewardEvents_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "ScUpdateEvents" ( | ||
"id" SERIAL NOT NULL, | ||
"txnHash" TEXT NOT NULL, | ||
"network" "Network" NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"oldValue" TEXT NOT NULL, | ||
"newValue" TEXT NOT NULL, | ||
"owner" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3), | ||
|
||
CONSTRAINT "ScUpdateEvents_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "ScEventLastSyncedBlock" ( | ||
"id" SERIAL NOT NULL, | ||
"network" "Network" NOT NULL, | ||
"blockNumber" TEXT NOT NULL, | ||
|
||
CONSTRAINT "ScEventLastSyncedBlock_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "ScDepositEvents_txnHash_network_key" ON "ScDepositEvents"("txnHash", "network"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "ScWithdrawalRequestEvents_txnHash_network_key" ON "ScWithdrawalRequestEvents"("txnHash", "network"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "ScWithdrawalFinalizeEvents_txnHash_network_key" ON "ScWithdrawalFinalizeEvents"("txnHash", "network"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "ScWithdrawalClaimEvents_txnHash_network_key" ON "ScWithdrawalClaimEvents"("txnHash", "network"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "ScRewardEvents_txnHash_network_key" ON "ScRewardEvents"("txnHash", "network"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "ScUpdateEvents_txnHash_network_key" ON "ScUpdateEvents"("txnHash", "network"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "ScEventLastSyncedBlock_network_key" ON "ScEventLastSyncedBlock"("network"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.