@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,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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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,
|
|
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,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;
|