@ocap/statedb-sqlite 1.29.5
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/README.md +66 -0
- package/esm/_virtual/rolldown_runtime.mjs +21 -0
- package/esm/db.d.mts +92 -0
- package/esm/db.mjs +257 -0
- package/esm/index.d.mts +4 -0
- package/esm/index.mjs +7 -0
- package/esm/interfaces.d.mts +201 -0
- package/esm/interfaces.mjs +1 -0
- package/esm/kysely.d.mts +43 -0
- package/esm/kysely.mjs +62 -0
- package/esm/migrations/001-genesis.d.mts +14 -0
- package/esm/migrations/001-genesis.mjs +52 -0
- package/esm/migrations/index.d.mts +24 -0
- package/esm/migrations/index.mjs +60 -0
- package/esm/package.mjs +70 -0
- package/esm/table/account.d.mts +40 -0
- package/esm/table/account.mjs +99 -0
- package/esm/table/balance.d.mts +39 -0
- package/esm/table/balance.mjs +69 -0
- package/esm/table/base.d.mts +84 -0
- package/esm/table/base.mjs +217 -0
- package/esm/table/rollup.d.mts +22 -0
- package/esm/table/rollup.mjs +44 -0
- package/esm/table/token.d.mts +23 -0
- package/esm/table/token.mjs +42 -0
- package/lib/_virtual/rolldown_runtime.cjs +43 -0
- package/lib/db.cjs +259 -0
- package/lib/db.d.cts +92 -0
- package/lib/index.cjs +9 -0
- package/lib/index.d.cts +4 -0
- package/lib/interfaces.cjs +0 -0
- package/lib/interfaces.d.cts +201 -0
- package/lib/kysely.cjs +63 -0
- package/lib/kysely.d.cts +43 -0
- package/lib/migrations/001-genesis.cjs +59 -0
- package/lib/migrations/001-genesis.d.cts +14 -0
- package/lib/migrations/index.cjs +62 -0
- package/lib/migrations/index.d.cts +24 -0
- package/lib/package.cjs +76 -0
- package/lib/table/account.cjs +101 -0
- package/lib/table/account.d.cts +40 -0
- package/lib/table/balance.cjs +71 -0
- package/lib/table/balance.d.cts +39 -0
- package/lib/table/base.cjs +221 -0
- package/lib/table/base.d.cts +84 -0
- package/lib/table/rollup.cjs +45 -0
- package/lib/table/rollup.d.cts +22 -0
- package/lib/table/token.cjs +43 -0
- package/lib/table/token.d.cts +23 -0
- package/package.json +75 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import SqliteTable, { SqliteTableConfig } from "./base.cjs";
|
|
2
|
+
import { IOperationContext, ITokenState } from "@ocap/types";
|
|
3
|
+
|
|
4
|
+
//#region src/table/token.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Token Table
|
|
8
|
+
* Extends base table with symbol-based existence check
|
|
9
|
+
*/
|
|
10
|
+
declare class TokenTable extends SqliteTable<ITokenState> {
|
|
11
|
+
constructor(config: Omit<SqliteTableConfig, 'name' | 'uniqIndex' | 'schema'>);
|
|
12
|
+
/**
|
|
13
|
+
* Check if a token with the given symbol exists
|
|
14
|
+
*
|
|
15
|
+
* @param symbol - Token symbol to check
|
|
16
|
+
* @param context - Operation context with optional transaction
|
|
17
|
+
* @returns true if token with symbol exists
|
|
18
|
+
* @throws Error if symbol is empty
|
|
19
|
+
*/
|
|
20
|
+
existBySymbol(symbol: string, context?: IOperationContext): Promise<boolean>;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { TokenTable as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ocap/statedb-sqlite",
|
|
3
|
+
"description": "OCAP statedb adapter that uses SQLite as backend",
|
|
4
|
+
"version": "1.29.5",
|
|
5
|
+
"author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/ArcBlock/blockchain/issues",
|
|
8
|
+
"email": "shijun@arcblock.io"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"contributors": [
|
|
14
|
+
"wangshijun <shijun@arcblock.io> (https://www.arcblock.io)"
|
|
15
|
+
],
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@ocap/statedb-test": "1.29.5"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/ArcBlock/blockchain/tree/master/statedb/sqlite",
|
|
20
|
+
"keywords": [
|
|
21
|
+
"ocap",
|
|
22
|
+
"statedb",
|
|
23
|
+
"sqlite",
|
|
24
|
+
"kysely"
|
|
25
|
+
],
|
|
26
|
+
"license": "Apache-2.0",
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "./lib/index.cjs",
|
|
29
|
+
"module": "./esm/index.mjs",
|
|
30
|
+
"types": "./esm/index.d.mts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./esm/index.d.mts",
|
|
34
|
+
"import": "./esm/index.mjs",
|
|
35
|
+
"default": "./lib/index.cjs"
|
|
36
|
+
},
|
|
37
|
+
"./lib/*.js": {
|
|
38
|
+
"types": "./esm/*.d.mts",
|
|
39
|
+
"import": "./esm/*.mjs",
|
|
40
|
+
"default": "./lib/*.cjs"
|
|
41
|
+
},
|
|
42
|
+
"./lib/*": {
|
|
43
|
+
"types": "./esm/*.d.mts",
|
|
44
|
+
"import": "./esm/*.mjs",
|
|
45
|
+
"default": "./lib/*.cjs"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"lib",
|
|
50
|
+
"esm"
|
|
51
|
+
],
|
|
52
|
+
"repository": {
|
|
53
|
+
"type": "git",
|
|
54
|
+
"url": "https://github.com/ArcBlock/blockchain/tree/master/statedb/sqlite"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsdown",
|
|
58
|
+
"prebuild": "rm -rf lib esm",
|
|
59
|
+
"lint": "biome check",
|
|
60
|
+
"lint:fix": "biome check --write",
|
|
61
|
+
"test": "bun test",
|
|
62
|
+
"coverage": "npm run test -- --coverage"
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@ocap/state": "1.29.5",
|
|
66
|
+
"@ocap/statedb": "1.29.5",
|
|
67
|
+
"@ocap/types": "1.29.5",
|
|
68
|
+
"@ocap/util": "1.29.5",
|
|
69
|
+
"debug": "^4.4.3",
|
|
70
|
+
"better-sqlite3": "^11.8.1",
|
|
71
|
+
"kysely": "^0.27.0",
|
|
72
|
+
"kysely-bun-sqlite": "^0.4.0",
|
|
73
|
+
"lodash": "^4.17.23"
|
|
74
|
+
}
|
|
75
|
+
}
|