@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.
- package/dist/database/schema.cjs +5 -1
- package/dist/database/schema.d.cts +1 -1
- package/dist/database/schema.d.mts +1 -1
- package/dist/database/schema.d.ts +1 -1
- package/dist/database/schema.mjs +3 -1
- package/dist/export/worker.cjs +20 -625
- package/dist/export/worker.d.cts +2 -2
- package/dist/export/worker.d.mts +2 -2
- package/dist/export/worker.d.ts +2 -2
- package/dist/export/worker.mjs +20 -625
- package/dist/export/workflows.cjs +88 -82
- package/dist/export/workflows.mjs +83 -77
- package/dist/shared/{blockchain.5Ld6uEay.d.ts → blockchain.7cRY-udH.d.ts} +1 -1
- package/dist/shared/blockchain.BUbQBxqd.cjs +335 -0
- package/dist/shared/blockchain.BhDiNGPI.mjs +332 -0
- package/dist/shared/{blockchain.DTJULMBV.mjs → blockchain.CKh8Fs7w.mjs} +12 -1
- package/dist/shared/{blockchain.CtIjPvX8.d.cts → blockchain.CaPQzwns.d.cts} +1 -1
- package/dist/shared/blockchain.CbmnjjFl.cjs +70 -0
- package/dist/shared/{blockchain.BBjLLe8v.cjs → blockchain.Cjq9eH7Z.cjs} +13 -0
- package/dist/shared/{blockchain.DZbyq0JM.d.mts → blockchain.CvNI0YTF.d.mts} +1 -1
- package/dist/shared/blockchain.DUhjXgba.d.cts +1107 -0
- package/dist/shared/blockchain.DUhjXgba.d.mts +1107 -0
- package/dist/shared/blockchain.DUhjXgba.d.ts +1107 -0
- package/dist/shared/blockchain._nv3VxNA.mjs +64 -0
- package/dist/types.cjs +3 -1
- package/dist/types.d.cts +12 -4
- package/dist/types.d.mts +12 -4
- package/dist/types.d.ts +12 -4
- package/dist/types.mjs +1 -1
- package/package.json +1 -1
- package/dist/shared/blockchain.0tUJ62WT.mjs +0 -6
- package/dist/shared/blockchain.BBvwu2_7.cjs +0 -39
- package/dist/shared/blockchain.Cx60lJ0c.d.cts +0 -566
- package/dist/shared/blockchain.Cx60lJ0c.d.mts +0 -566
- package/dist/shared/blockchain.Cx60lJ0c.d.ts +0 -566
- package/dist/shared/blockchain.DN735AwB.cjs +0 -8
- package/dist/shared/blockchain._wwKu1qP.mjs +0 -35
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
|
+
const sqliteCore = require('drizzle-orm/sqlite-core');
|
|
5
|
+
const syncAddress = require('./blockchain.Cjq9eH7Z.cjs');
|
|
6
|
+
|
|
7
|
+
const address = sqliteCore.sqliteTable("address", {
|
|
8
|
+
...backendSdk.base,
|
|
9
|
+
number: sqliteCore.text("number").notNull(),
|
|
10
|
+
syncIntervalS: sqliteCore.integer("sync_interval_s").notNull().default(600),
|
|
11
|
+
lastSyncBlock: sqliteCore.blob("last_sync_block", { mode: "bigint" }),
|
|
12
|
+
lastSyncAt: sqliteCore.integer("last_sync_at", { mode: "timestamp_ms" }),
|
|
13
|
+
lastSyncMetadata: sqliteCore.text("last_sync_metadata", {
|
|
14
|
+
mode: "json"
|
|
15
|
+
}).$type(),
|
|
16
|
+
connector: sqliteCore.text("connector").$type()
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const addressCredentials = sqliteCore.sqliteTable("address_credentials", {
|
|
20
|
+
...backendSdk.base,
|
|
21
|
+
addressId: sqliteCore.text("address_id").references(() => address.id, { onDelete: "restrict", onUpdate: "cascade" }).notNull(),
|
|
22
|
+
connector: sqliteCore.text("connector", {
|
|
23
|
+
enum: syncAddress.CHAIN_KEYS
|
|
24
|
+
}).$type().notNull(),
|
|
25
|
+
type: sqliteCore.text("type", {
|
|
26
|
+
enum: syncAddress.CREDENTIALS_TYPES
|
|
27
|
+
}).$type().notNull(),
|
|
28
|
+
value: sqliteCore.text("value").notNull(),
|
|
29
|
+
expiresAt: sqliteCore.integer("expires_at", { mode: "timestamp_ms" })
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const tokens = sqliteCore.sqliteTable("tokens", {
|
|
33
|
+
...backendSdk.base,
|
|
34
|
+
smartContractAddress: sqliteCore.text("smart_contract_address").$type().notNull(),
|
|
35
|
+
connector: sqliteCore.text("connector").$type(),
|
|
36
|
+
ticker: sqliteCore.text("ticker").notNull(),
|
|
37
|
+
decimals: sqliteCore.integer("decimals").notNull(),
|
|
38
|
+
name: sqliteCore.text("name")
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const transaction = sqliteCore.sqliteTable("transaction", {
|
|
42
|
+
...backendSdk.base,
|
|
43
|
+
hash: sqliteCore.text("hash"),
|
|
44
|
+
from: sqliteCore.text("from"),
|
|
45
|
+
to: sqliteCore.text("to"),
|
|
46
|
+
value: sqliteCore.text("value"),
|
|
47
|
+
blockNumber: sqliteCore.text("block_number"),
|
|
48
|
+
blockHash: sqliteCore.text("blockHash"),
|
|
49
|
+
gasUsed: sqliteCore.text("gasUsed"),
|
|
50
|
+
gasPrice: sqliteCore.text("gasPrice"),
|
|
51
|
+
timestamp: sqliteCore.integer("timestamp"),
|
|
52
|
+
status: sqliteCore.text("status"),
|
|
53
|
+
decimals: sqliteCore.integer("decimals"),
|
|
54
|
+
connector: sqliteCore.text("connector").$type(),
|
|
55
|
+
ticker: sqliteCore.text("ticker")
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const schema = {
|
|
59
|
+
__proto__: null,
|
|
60
|
+
address: address,
|
|
61
|
+
addressCredentials: addressCredentials,
|
|
62
|
+
tokens: tokens,
|
|
63
|
+
transaction: transaction
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
exports.address = address;
|
|
67
|
+
exports.addressCredentials = addressCredentials;
|
|
68
|
+
exports.schema = schema;
|
|
69
|
+
exports.tokens = tokens;
|
|
70
|
+
exports.transaction = transaction;
|
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
const zod = require('zod');
|
|
4
4
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
5
5
|
|
|
6
|
+
const CHAIN_KEYS = [
|
|
7
|
+
"ARBITRUM",
|
|
8
|
+
"AVALANCHE",
|
|
9
|
+
"BASE",
|
|
10
|
+
"ETHEREUM",
|
|
11
|
+
"GNOSIS",
|
|
12
|
+
"OPTIMISM",
|
|
13
|
+
"SCROLL"
|
|
14
|
+
];
|
|
15
|
+
const CREDENTIALS_TYPES = ["PRIVATE_KEY"];
|
|
16
|
+
|
|
6
17
|
const chainSchema = zod.z.enum([
|
|
7
18
|
"ARBITRUM",
|
|
8
19
|
"AVALANCHE",
|
|
@@ -86,6 +97,8 @@ const syncAddressOutputSchema = zod.z.object({
|
|
|
86
97
|
details: backendSdk.workflowInstanceStatusSchema
|
|
87
98
|
});
|
|
88
99
|
|
|
100
|
+
exports.CHAIN_KEYS = CHAIN_KEYS;
|
|
101
|
+
exports.CREDENTIALS_TYPES = CREDENTIALS_TYPES;
|
|
89
102
|
exports.chainSchema = chainSchema;
|
|
90
103
|
exports.getBlockInputSchema = getBlockInputSchema;
|
|
91
104
|
exports.getBlockOutputSchema = getBlockOutputSchema;
|