@evergonlabs/tmi-protocol-indexer 0.1.2 → 0.7.0

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.
@@ -1,4 +1,4 @@
1
- import { onchainTable, primaryKey, index, relations, onchainEnum } from "ponder";
1
+ import { index, onchainEnum, onchainTable, primaryKey, relations } from "ponder";
2
2
  export const diamonds = onchainTable("diamond", (t) => ({
3
3
  contractAddress: t.hex().notNull(),
4
4
  adminAddress: t.hex().notNull(),
@@ -34,6 +34,9 @@ export type IFractionEventData<TEvent extends FractionSaleEventEnum = FractionSa
34
34
  purchaser: Address;
35
35
  priceId: bigint;
36
36
  amountOfFractions: bigint;
37
+ usdValue: bigint;
38
+ pricePerFraction: bigint;
39
+ fundingValue: bigint;
37
40
  amountPaid: bigint;
38
41
  amountBurnt: bigint;
39
42
  };
@@ -742,6 +745,23 @@ export declare const fractionsSale: import("ponder").OnchainTable<{
742
745
  identity: undefined;
743
746
  generated: undefined;
744
747
  }, {}, {}>;
748
+ discountBp: import("drizzle-orm/pg-core").PgColumn<{
749
+ name: "discount_percentage";
750
+ tableName: "fractions_sale";
751
+ dataType: "bigint";
752
+ columnType: "PgEvmBigint";
753
+ data: bigint;
754
+ driverParam: string;
755
+ notNull: true;
756
+ hasDefault: true;
757
+ isPrimaryKey: false;
758
+ isAutoincrement: false;
759
+ hasRuntimeDefault: false;
760
+ enumValues: undefined;
761
+ baseColumn: never;
762
+ identity: undefined;
763
+ generated: undefined;
764
+ }, {}, {}>;
745
765
  softCap: import("drizzle-orm/pg-core").PgColumn<{
746
766
  name: "soft_cap";
747
767
  tableName: "fractions_sale";
@@ -903,7 +923,7 @@ export declare const fractionsSale: import("ponder").OnchainTable<{
903
923
  data: bigint;
904
924
  driverParam: string;
905
925
  notNull: true;
906
- hasDefault: true;
926
+ hasDefault: false;
907
927
  isPrimaryKey: false;
908
928
  isAutoincrement: false;
909
929
  hasRuntimeDefault: false;
@@ -1268,6 +1288,57 @@ export declare const fractionsPurchase: import("ponder").OnchainTable<{
1268
1288
  identity: undefined;
1269
1289
  generated: undefined;
1270
1290
  }, {}, {}>;
1291
+ usdValue: import("drizzle-orm/pg-core").PgColumn<{
1292
+ name: "usd_value";
1293
+ tableName: "fractions_purchase";
1294
+ dataType: "bigint";
1295
+ columnType: "PgEvmBigint";
1296
+ data: bigint;
1297
+ driverParam: string;
1298
+ notNull: true;
1299
+ hasDefault: false;
1300
+ isPrimaryKey: false;
1301
+ isAutoincrement: false;
1302
+ hasRuntimeDefault: false;
1303
+ enumValues: undefined;
1304
+ baseColumn: never;
1305
+ identity: undefined;
1306
+ generated: undefined;
1307
+ }, {}, {}>;
1308
+ fundingValue: import("drizzle-orm/pg-core").PgColumn<{
1309
+ name: "funding_value";
1310
+ tableName: "fractions_purchase";
1311
+ dataType: "bigint";
1312
+ columnType: "PgEvmBigint";
1313
+ data: bigint;
1314
+ driverParam: string;
1315
+ notNull: true;
1316
+ hasDefault: false;
1317
+ isPrimaryKey: false;
1318
+ isAutoincrement: false;
1319
+ hasRuntimeDefault: false;
1320
+ enumValues: undefined;
1321
+ baseColumn: never;
1322
+ identity: undefined;
1323
+ generated: undefined;
1324
+ }, {}, {}>;
1325
+ pricePerFraction: import("drizzle-orm/pg-core").PgColumn<{
1326
+ name: "price_per_fraction";
1327
+ tableName: "fractions_purchase";
1328
+ dataType: "bigint";
1329
+ columnType: "PgEvmBigint";
1330
+ data: bigint;
1331
+ driverParam: string;
1332
+ notNull: true;
1333
+ hasDefault: false;
1334
+ isPrimaryKey: false;
1335
+ isAutoincrement: false;
1336
+ hasRuntimeDefault: false;
1337
+ enumValues: undefined;
1338
+ baseColumn: never;
1339
+ identity: undefined;
1340
+ generated: undefined;
1341
+ }, {}, {}>;
1271
1342
  amountOfFractions: import("drizzle-orm/pg-core").PgColumn<{
1272
1343
  name: "amount_of_fractions";
1273
1344
  tableName: "fractions_purchase";
@@ -1,4 +1,4 @@
1
- import { onchainTable, primaryKey, index, relations, onchainEnum } from "ponder";
1
+ import { index, onchainEnum, onchainTable, primaryKey, relations } from "ponder";
2
2
  export var FractionSaleStatusEnum;
3
3
  (function (FractionSaleStatusEnum) {
4
4
  FractionSaleStatusEnum["CREATED"] = "created";
@@ -119,6 +119,7 @@ export const fractionsSale = onchainTable("fractions_sale", (t) => ({
119
119
  status: t.varchar("status").notNull().default("created"),
120
120
  fractionPrice: t.bigint("fraction_price").notNull().default(0n),
121
121
  otcPrice: t.bigint("otc_price").notNull().default(0n),
122
+ discountBp: t.bigint("discount_percentage").notNull().default(0n),
122
123
  softCap: t.bigint("soft_cap"),
123
124
  hardCap: t.bigint("hard_cap"),
124
125
  softCapPerAccount: t.bigint("soft_cap_per_account"),
@@ -128,7 +129,7 @@ export const fractionsSale = onchainTable("fractions_sale", (t) => ({
128
129
  portionPeriod: t.bigint("portion_period"),
129
130
  startDate: t.timestamp("start_date"),
130
131
  endDate: t.timestamp("end_date"),
131
- fractionsCreated: t.bigint("fractions_created").notNull().default(0n),
132
+ fractionsCreated: t.bigint("fractions_created").notNull(),
132
133
  fractionsAddress: t.hex("fractions_addres").notNull(),
133
134
  createdAt: t.timestamp("created_at").notNull(),
134
135
  updatedAt: t.timestamp("updated_at").notNull(),
@@ -163,7 +164,9 @@ export const fractionsWrappedAsset = onchainTable("fractions_wrapped_asset", (t)
163
164
  tokenAddress: t.hex("token_address").notNull(),
164
165
  wrappedAmount: t.bigint("wrapped_amount").notNull(),
165
166
  }), (table) => ({
166
- pk: primaryKey({ columns: [table.chainId, table.saleId, table.diamondAddress, table.tokenAddress] }),
167
+ pk: primaryKey({
168
+ columns: [table.chainId, table.saleId, table.diamondAddress, table.tokenAddress],
169
+ }),
167
170
  }));
168
171
  export const wrappedAssetsRelations = relations(fractionsWrappedAsset, ({ one }) => ({
169
172
  asset: one(asset, {
@@ -181,7 +184,11 @@ export const fractionsFundingAsset = onchainTable("fractions_funding_asset", (t)
181
184
  diamondAddress: t.hex("diamond_address").notNull(),
182
185
  tokenAddress: t.hex("token_address").notNull(),
183
186
  amountPerPacket: t.bigint("amount_per_packet").notNull(),
184
- }), (table) => ({ pk: primaryKey({ columns: [table.chainId, table.saleId, table.diamondAddress, table.tokenAddress] }) }));
187
+ }), (table) => ({
188
+ pk: primaryKey({
189
+ columns: [table.chainId, table.saleId, table.diamondAddress, table.tokenAddress],
190
+ }),
191
+ }));
185
192
  export const fundingAssetsRelations = relations(fractionsFundingAsset, ({ one }) => ({
186
193
  asset: one(asset, {
187
194
  fields: [fractionsFundingAsset.chainId, fractionsFundingAsset.tokenAddress],
@@ -197,6 +204,9 @@ export const fractionsPurchase = onchainTable("fractions_purchase", (t) => ({
197
204
  saleId: t.bigint("sale_id").notNull(),
198
205
  diamondAddress: t.hex("diamond_address").notNull(),
199
206
  buyerAddress: t.hex("buyer_address").notNull(),
207
+ usdValue: t.bigint("usd_value").notNull(),
208
+ fundingValue: t.bigint("funding_value").notNull(),
209
+ pricePerFraction: t.bigint("price_per_fraction").notNull(),
200
210
  amountOfFractions: t.bigint("amount_of_fractions").notNull(),
201
211
  amountPaid: t.bigint("amount_paid").notNull(),
202
212
  amountBurnt: t.bigint("amount_burnt").notNull(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evergonlabs/tmi-protocol-indexer",
3
- "version": "0.1.2",
3
+ "version": "0.7.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -17,24 +17,25 @@
17
17
  "@evergonlabs/tmi-contracts-fractions-sdk": "npm:@evergonlabs/tmi-contracts-fractions-sdk@1.1.0",
18
18
  "@evergonlabs/fraction-protocol-sdk-next": "npm:@evergonlabs/fraction-protocol-sdk@2.0.0-beta",
19
19
  "@evergonlabs/tmi-contracts-staking-sdk": "^0.1.0",
20
- "@evergonlabs/tmi-evm-contracts": "0.6.0",
20
+ "@evergonlabs/tmi-evm-contracts": "0.6.7",
21
+ "bignumber.js": "^9.3.1",
21
22
  "drizzle-orm": "0.41.0",
22
23
  "hono": "^4.9.7",
23
24
  "kysely": "^0.26.3",
24
25
  "ponder": "^0.11.4",
25
- "type-fest": "^4.33.0",
26
- "zod": "^3.25.0",
27
- "@evergonlabs/tmi-protocol-fractions-sdk": "0.2.1",
28
- "@evergonlabs/tmi-protocol-staking-sdk": "0.2.1",
29
- "@evergonlabs/tmi-protocol-types": "0.2.1",
30
- "@evergonlabs/tmi-protocol-utils": "0.2.1"
26
+ "type-fest": "^5.0.0",
27
+ "zod": "^4.3.6",
28
+ "@evergonlabs/tmi-protocol-types": "0.7.0",
29
+ "@evergonlabs/tmi-protocol-fractions-sdk": "0.7.0",
30
+ "@evergonlabs/tmi-protocol-utils": "0.7.0",
31
+ "@evergonlabs/tmi-protocol-staking-sdk": "0.7.0"
31
32
  },
32
33
  "devDependencies": {
33
- "@evergonlabs/tmi-eslint-config": "^0.1.3",
34
- "@evergonlabs/tmi-typescript-config": "^0.2.0",
34
+ "@evergonlabs/tmi-eslint-config": "0.3.0",
35
+ "@evergonlabs/tmi-typescript-config": "0.2.1",
35
36
  "abitype": "^1.0.8",
36
37
  "dotenv": "^17.2.2",
37
- "eslint": "^9.21.0",
38
+ "eslint": "^9.39.2",
38
39
  "jiti": "^2.4.2",
39
40
  "kleur": "^4.1.5",
40
41
  "npm-run-all": "^4.1.5",
@@ -60,6 +61,7 @@
60
61
  "codegen": "ponder codegen",
61
62
  "db": "ponder db",
62
63
  "lint": "eslint .",
64
+ "lint:fix": "eslint . --fix",
63
65
  "serve": "ponder serve",
64
66
  "start": "ponder start --schema=${DATABASE_SCHEMA} --views-schema=v3 -- --network=${ENVIRONMENT}",
65
67
  "start:local": "ponder dev -v -- --network=local --schema=v01"