@develit-services/blockchain 0.8.2 → 0.8.3

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.
Files changed (37) hide show
  1. package/dist/database/schema.cjs +5 -1
  2. package/dist/database/schema.d.cts +1 -1
  3. package/dist/database/schema.d.mts +1 -1
  4. package/dist/database/schema.d.ts +1 -1
  5. package/dist/database/schema.mjs +3 -1
  6. package/dist/export/worker.cjs +20 -625
  7. package/dist/export/worker.d.cts +2 -2
  8. package/dist/export/worker.d.mts +2 -2
  9. package/dist/export/worker.d.ts +2 -2
  10. package/dist/export/worker.mjs +20 -625
  11. package/dist/export/workflows.cjs +88 -82
  12. package/dist/export/workflows.mjs +83 -77
  13. package/dist/shared/{blockchain.5Ld6uEay.d.ts → blockchain.7cRY-udH.d.ts} +1 -1
  14. package/dist/shared/blockchain.BUbQBxqd.cjs +335 -0
  15. package/dist/shared/blockchain.BhDiNGPI.mjs +332 -0
  16. package/dist/shared/{blockchain.DTJULMBV.mjs → blockchain.CKh8Fs7w.mjs} +12 -1
  17. package/dist/shared/{blockchain.CtIjPvX8.d.cts → blockchain.CaPQzwns.d.cts} +1 -1
  18. package/dist/shared/blockchain.CbmnjjFl.cjs +70 -0
  19. package/dist/shared/{blockchain.BBjLLe8v.cjs → blockchain.Cjq9eH7Z.cjs} +13 -0
  20. package/dist/shared/{blockchain.DZbyq0JM.d.mts → blockchain.CvNI0YTF.d.mts} +1 -1
  21. package/dist/shared/blockchain.DUhjXgba.d.cts +1107 -0
  22. package/dist/shared/blockchain.DUhjXgba.d.mts +1107 -0
  23. package/dist/shared/blockchain.DUhjXgba.d.ts +1107 -0
  24. package/dist/shared/blockchain._nv3VxNA.mjs +64 -0
  25. package/dist/types.cjs +3 -1
  26. package/dist/types.d.cts +12 -4
  27. package/dist/types.d.mts +12 -4
  28. package/dist/types.d.ts +12 -4
  29. package/dist/types.mjs +1 -1
  30. package/package.json +1 -1
  31. package/dist/shared/blockchain.0tUJ62WT.mjs +0 -6
  32. package/dist/shared/blockchain.BBvwu2_7.cjs +0 -39
  33. package/dist/shared/blockchain.Cx60lJ0c.d.cts +0 -566
  34. package/dist/shared/blockchain.Cx60lJ0c.d.mts +0 -566
  35. package/dist/shared/blockchain.Cx60lJ0c.d.ts +0 -566
  36. package/dist/shared/blockchain.DN735AwB.cjs +0 -8
  37. package/dist/shared/blockchain._wwKu1qP.mjs +0 -35
@@ -0,0 +1,64 @@
1
+ import { base } from '@develit-io/backend-sdk';
2
+ import { sqliteTable, text, integer, blob } from 'drizzle-orm/sqlite-core';
3
+ import { a as CREDENTIALS_TYPES, C as CHAIN_KEYS } from './blockchain.CKh8Fs7w.mjs';
4
+
5
+ const address = sqliteTable("address", {
6
+ ...base,
7
+ number: text("number").notNull(),
8
+ syncIntervalS: integer("sync_interval_s").notNull().default(600),
9
+ lastSyncBlock: blob("last_sync_block", { mode: "bigint" }),
10
+ lastSyncAt: integer("last_sync_at", { mode: "timestamp_ms" }),
11
+ lastSyncMetadata: text("last_sync_metadata", {
12
+ mode: "json"
13
+ }).$type(),
14
+ connector: text("connector").$type()
15
+ });
16
+
17
+ const addressCredentials = sqliteTable("address_credentials", {
18
+ ...base,
19
+ addressId: text("address_id").references(() => address.id, { onDelete: "restrict", onUpdate: "cascade" }).notNull(),
20
+ connector: text("connector", {
21
+ enum: CHAIN_KEYS
22
+ }).$type().notNull(),
23
+ type: text("type", {
24
+ enum: CREDENTIALS_TYPES
25
+ }).$type().notNull(),
26
+ value: text("value").notNull(),
27
+ expiresAt: integer("expires_at", { mode: "timestamp_ms" })
28
+ });
29
+
30
+ const tokens = sqliteTable("tokens", {
31
+ ...base,
32
+ smartContractAddress: text("smart_contract_address").$type().notNull(),
33
+ connector: text("connector").$type(),
34
+ ticker: text("ticker").notNull(),
35
+ decimals: integer("decimals").notNull(),
36
+ name: text("name")
37
+ });
38
+
39
+ const transaction = sqliteTable("transaction", {
40
+ ...base,
41
+ hash: text("hash"),
42
+ from: text("from"),
43
+ to: text("to"),
44
+ value: text("value"),
45
+ blockNumber: text("block_number"),
46
+ blockHash: text("blockHash"),
47
+ gasUsed: text("gasUsed"),
48
+ gasPrice: text("gasPrice"),
49
+ timestamp: integer("timestamp"),
50
+ status: text("status"),
51
+ decimals: integer("decimals"),
52
+ connector: text("connector").$type(),
53
+ ticker: text("ticker")
54
+ });
55
+
56
+ const schema = {
57
+ __proto__: null,
58
+ address: address,
59
+ addressCredentials: addressCredentials,
60
+ tokens: tokens,
61
+ transaction: transaction
62
+ };
63
+
64
+ export { address as a, addressCredentials as b, transaction as c, schema as s, tokens as t };
package/dist/types.cjs CHANGED
@@ -1,11 +1,13 @@
1
1
  'use strict';
2
2
 
3
- const syncAddress = require('./shared/blockchain.BBjLLe8v.cjs');
3
+ const syncAddress = require('./shared/blockchain.Cjq9eH7Z.cjs');
4
4
  require('zod');
5
5
  require('@develit-io/backend-sdk');
6
6
 
7
7
 
8
8
 
9
+ exports.CHAIN_KEYS = syncAddress.CHAIN_KEYS;
10
+ exports.CREDENTIALS_TYPES = syncAddress.CREDENTIALS_TYPES;
9
11
  exports.chainSchema = syncAddress.chainSchema;
10
12
  exports.getBlockInputSchema = syncAddress.getBlockInputSchema;
11
13
  exports.getBlockOutputSchema = syncAddress.getBlockOutputSchema;
package/dist/types.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- export { L as LastSyncMetadata } from './shared/blockchain.Cx60lJ0c.cjs';
1
+ export { C as CHAIN_KEYS, a as CREDENTIALS_TYPES, b as CredentialsType, L as LastSyncMetadata } from './shared/blockchain.DUhjXgba.cjs';
2
2
  import { BaseEvent } from '@develit-io/backend-sdk';
3
- import { t as tables } from './shared/blockchain.CtIjPvX8.cjs';
4
- export { C as Chain, c as GetBlockInput, d as GetBlockOutput, G as GetTransactionInput, b as GetTransactionOutput, S as SyncAddressInput, a as SyncAddressOutput, e as chainSchema, g as getBlockInputSchema, f as getBlockOutputSchema, h as getTransactionInputSchema, i as getTransactionOutputSchema, s as syncAddressInputSchema, j as syncAddressOutputSchema } from './shared/blockchain.CtIjPvX8.cjs';
3
+ import { t as tables } from './shared/blockchain.CaPQzwns.cjs';
4
+ export { C as Chain, c as GetBlockInput, d as GetBlockOutput, G as GetTransactionInput, b as GetTransactionOutput, S as SyncAddressInput, a as SyncAddressOutput, e as chainSchema, g as getBlockInputSchema, f as getBlockOutputSchema, h as getTransactionInputSchema, i as getTransactionOutputSchema, s as syncAddressInputSchema, j as syncAddressOutputSchema } from './shared/blockchain.CaPQzwns.cjs';
5
5
  import { InferInsertModel, InferSelectModel } from 'drizzle-orm';
6
6
  export { a as BlockchainServiceEnv, b as BlockchainServiceEnvironmentConfig, B as BlockchainServiceWranglerConfig } from './shared/blockchain.C1Jdisxn.cjs';
7
7
  import 'drizzle-orm/sqlite-core';
@@ -21,6 +21,9 @@ type BlockchainTransactionEvent = BaseEvent & {
21
21
  gasPrice: string;
22
22
  timestamp: number;
23
23
  status: string;
24
+ decimals: number;
25
+ connector: string | null;
26
+ ticker: string;
24
27
  };
25
28
  };
26
29
 
@@ -32,5 +35,10 @@ interface AddressSelectType extends InferSelectModel<typeof tables.address> {
32
35
  }
33
36
  interface AddressInsertType extends InferInsertModel<typeof tables.address> {
34
37
  }
38
+ interface AddressCredentialsSelectType extends InferSelectModel<typeof tables.addressCredentials> {
39
+ }
40
+ interface AddressCredentialsInsertType extends Omit<InferInsertModel<typeof tables.addressCredentials>, 'id'> {
41
+ id?: string;
42
+ }
35
43
 
36
- export type { AddressInsertType, AddressSelectType, BlockchainTransactionEvent, TransactionInsertType, TransactionSelectType };
44
+ export type { AddressCredentialsInsertType, AddressCredentialsSelectType, AddressInsertType, AddressSelectType, BlockchainTransactionEvent, TransactionInsertType, TransactionSelectType };
package/dist/types.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- export { L as LastSyncMetadata } from './shared/blockchain.Cx60lJ0c.mjs';
1
+ export { C as CHAIN_KEYS, a as CREDENTIALS_TYPES, b as CredentialsType, L as LastSyncMetadata } from './shared/blockchain.DUhjXgba.mjs';
2
2
  import { BaseEvent } from '@develit-io/backend-sdk';
3
- import { t as tables } from './shared/blockchain.DZbyq0JM.mjs';
4
- export { C as Chain, c as GetBlockInput, d as GetBlockOutput, G as GetTransactionInput, b as GetTransactionOutput, S as SyncAddressInput, a as SyncAddressOutput, e as chainSchema, g as getBlockInputSchema, f as getBlockOutputSchema, h as getTransactionInputSchema, i as getTransactionOutputSchema, s as syncAddressInputSchema, j as syncAddressOutputSchema } from './shared/blockchain.DZbyq0JM.mjs';
3
+ import { t as tables } from './shared/blockchain.CvNI0YTF.mjs';
4
+ export { C as Chain, c as GetBlockInput, d as GetBlockOutput, G as GetTransactionInput, b as GetTransactionOutput, S as SyncAddressInput, a as SyncAddressOutput, e as chainSchema, g as getBlockInputSchema, f as getBlockOutputSchema, h as getTransactionInputSchema, i as getTransactionOutputSchema, s as syncAddressInputSchema, j as syncAddressOutputSchema } from './shared/blockchain.CvNI0YTF.mjs';
5
5
  import { InferInsertModel, InferSelectModel } from 'drizzle-orm';
6
6
  export { a as BlockchainServiceEnv, b as BlockchainServiceEnvironmentConfig, B as BlockchainServiceWranglerConfig } from './shared/blockchain.C1Jdisxn.mjs';
7
7
  import 'drizzle-orm/sqlite-core';
@@ -21,6 +21,9 @@ type BlockchainTransactionEvent = BaseEvent & {
21
21
  gasPrice: string;
22
22
  timestamp: number;
23
23
  status: string;
24
+ decimals: number;
25
+ connector: string | null;
26
+ ticker: string;
24
27
  };
25
28
  };
26
29
 
@@ -32,5 +35,10 @@ interface AddressSelectType extends InferSelectModel<typeof tables.address> {
32
35
  }
33
36
  interface AddressInsertType extends InferInsertModel<typeof tables.address> {
34
37
  }
38
+ interface AddressCredentialsSelectType extends InferSelectModel<typeof tables.addressCredentials> {
39
+ }
40
+ interface AddressCredentialsInsertType extends Omit<InferInsertModel<typeof tables.addressCredentials>, 'id'> {
41
+ id?: string;
42
+ }
35
43
 
36
- export type { AddressInsertType, AddressSelectType, BlockchainTransactionEvent, TransactionInsertType, TransactionSelectType };
44
+ export type { AddressCredentialsInsertType, AddressCredentialsSelectType, AddressInsertType, AddressSelectType, BlockchainTransactionEvent, TransactionInsertType, TransactionSelectType };
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { L as LastSyncMetadata } from './shared/blockchain.Cx60lJ0c.js';
1
+ export { C as CHAIN_KEYS, a as CREDENTIALS_TYPES, b as CredentialsType, L as LastSyncMetadata } from './shared/blockchain.DUhjXgba.js';
2
2
  import { BaseEvent } from '@develit-io/backend-sdk';
3
- import { t as tables } from './shared/blockchain.5Ld6uEay.js';
4
- export { C as Chain, c as GetBlockInput, d as GetBlockOutput, G as GetTransactionInput, b as GetTransactionOutput, S as SyncAddressInput, a as SyncAddressOutput, e as chainSchema, g as getBlockInputSchema, f as getBlockOutputSchema, h as getTransactionInputSchema, i as getTransactionOutputSchema, s as syncAddressInputSchema, j as syncAddressOutputSchema } from './shared/blockchain.5Ld6uEay.js';
3
+ import { t as tables } from './shared/blockchain.7cRY-udH.js';
4
+ export { C as Chain, c as GetBlockInput, d as GetBlockOutput, G as GetTransactionInput, b as GetTransactionOutput, S as SyncAddressInput, a as SyncAddressOutput, e as chainSchema, g as getBlockInputSchema, f as getBlockOutputSchema, h as getTransactionInputSchema, i as getTransactionOutputSchema, s as syncAddressInputSchema, j as syncAddressOutputSchema } from './shared/blockchain.7cRY-udH.js';
5
5
  import { InferInsertModel, InferSelectModel } from 'drizzle-orm';
6
6
  export { a as BlockchainServiceEnv, b as BlockchainServiceEnvironmentConfig, B as BlockchainServiceWranglerConfig } from './shared/blockchain.C1Jdisxn.js';
7
7
  import 'drizzle-orm/sqlite-core';
@@ -21,6 +21,9 @@ type BlockchainTransactionEvent = BaseEvent & {
21
21
  gasPrice: string;
22
22
  timestamp: number;
23
23
  status: string;
24
+ decimals: number;
25
+ connector: string | null;
26
+ ticker: string;
24
27
  };
25
28
  };
26
29
 
@@ -32,5 +35,10 @@ interface AddressSelectType extends InferSelectModel<typeof tables.address> {
32
35
  }
33
36
  interface AddressInsertType extends InferInsertModel<typeof tables.address> {
34
37
  }
38
+ interface AddressCredentialsSelectType extends InferSelectModel<typeof tables.addressCredentials> {
39
+ }
40
+ interface AddressCredentialsInsertType extends Omit<InferInsertModel<typeof tables.addressCredentials>, 'id'> {
41
+ id?: string;
42
+ }
35
43
 
36
- export type { AddressInsertType, AddressSelectType, BlockchainTransactionEvent, TransactionInsertType, TransactionSelectType };
44
+ export type { AddressCredentialsInsertType, AddressCredentialsSelectType, AddressInsertType, AddressSelectType, BlockchainTransactionEvent, TransactionInsertType, TransactionSelectType };
package/dist/types.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export { c as chainSchema, g as getBlockInputSchema, a as getBlockOutputSchema, b as getTransactionInputSchema, d as getTransactionOutputSchema, s as syncAddressInputSchema, e as syncAddressOutputSchema } from './shared/blockchain.DTJULMBV.mjs';
1
+ export { C as CHAIN_KEYS, a as CREDENTIALS_TYPES, c as chainSchema, g as getBlockInputSchema, b as getBlockOutputSchema, d as getTransactionInputSchema, e as getTransactionOutputSchema, s as syncAddressInputSchema, f as syncAddressOutputSchema } from './shared/blockchain.CKh8Fs7w.mjs';
2
2
  import 'zod';
3
3
  import '@develit-io/backend-sdk';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/blockchain",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +0,0 @@
1
- import { s as schema } from './blockchain._wwKu1qP.mjs';
2
- import 'drizzle-orm';
3
-
4
- const tables = schema;
5
-
6
- export { tables as t };
@@ -1,39 +0,0 @@
1
- 'use strict';
2
-
3
- const backendSdk = require('@develit-io/backend-sdk');
4
- const sqliteCore = require('drizzle-orm/sqlite-core');
5
-
6
- const address = sqliteCore.sqliteTable("address", {
7
- ...backendSdk.base,
8
- number: sqliteCore.text("number").notNull(),
9
- chain: sqliteCore.text("chain").notNull(),
10
- syncIntervalS: sqliteCore.integer("sync_interval_s").notNull().default(600),
11
- lastSyncAt: sqliteCore.integer("last_sync_at", { mode: "timestamp_ms" }),
12
- lastSyncMetadata: sqliteCore.text("last_sync_metadata", {
13
- mode: "json"
14
- }).$type()
15
- });
16
-
17
- const transaction = sqliteCore.sqliteTable("transaction", {
18
- ...backendSdk.base,
19
- hash: sqliteCore.text("hash"),
20
- from: sqliteCore.text("from"),
21
- to: sqliteCore.text("to"),
22
- value: sqliteCore.text("value"),
23
- blockNumber: sqliteCore.text("blockNumber"),
24
- blockHash: sqliteCore.text("blockHash"),
25
- gasUsed: sqliteCore.text("gasUsed"),
26
- gasPrice: sqliteCore.text("gasPrice"),
27
- timestamp: sqliteCore.integer("timestamp"),
28
- status: sqliteCore.text("status")
29
- });
30
-
31
- const schema = {
32
- __proto__: null,
33
- address: address,
34
- transaction: transaction
35
- };
36
-
37
- exports.address = address;
38
- exports.schema = schema;
39
- exports.transaction = transaction;