@ocap/indexdb-sqlite 1.30.24 → 1.30.26
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/esm/db/base.mjs +14 -2
- package/esm/db/index.d.mts +1 -0
- package/esm/db/index.mjs +21 -1
- package/esm/index.d.mts +2 -1
- package/esm/index.mjs +2 -1
- package/esm/interfaces.d.mts +18 -2
- package/esm/kysely.d.mts +67 -7
- package/esm/kysely.mjs +1526 -16
- package/esm/migrations/001-genesis.mjs +1 -1
- package/esm/migrations/007-token-factory-feerate-integer.d.mts +7 -0
- package/esm/migrations/007-token-factory-feerate-integer.mjs +126 -0
- package/esm/migrations/008-index-failure.d.mts +14 -0
- package/esm/migrations/008-index-failure.mjs +25 -0
- package/esm/migrations/index.mjs +5 -1
- package/esm/package.mjs +1 -1
- package/lib/db/base.cjs +14 -2
- package/lib/db/index.cjs +21 -1
- package/lib/db/index.d.cts +1 -0
- package/lib/index.cjs +4 -1
- package/lib/index.d.cts +2 -1
- package/lib/interfaces.d.cts +18 -2
- package/lib/kysely.cjs +1528 -15
- package/lib/kysely.d.cts +67 -7
- package/lib/migrations/001-genesis.cjs +1 -1
- package/lib/migrations/007-token-factory-feerate-integer.cjs +133 -0
- package/lib/migrations/007-token-factory-feerate-integer.d.cts +7 -0
- package/lib/migrations/008-index-failure.cjs +32 -0
- package/lib/migrations/008-index-failure.d.cts +14 -0
- package/lib/migrations/index.cjs +5 -1
- package/lib/package.cjs +1 -1
- package/package.json +8 -6
|
@@ -41,7 +41,7 @@ async function up(db) {
|
|
|
41
41
|
await sql`CREATE INDEX IF NOT EXISTS idx_factory_minted ON factory(numMinted)`.execute(db);
|
|
42
42
|
await sql`CREATE INDEX IF NOT EXISTS idx_factory_limit ON factory(limit_)`.execute(db);
|
|
43
43
|
await sql`CREATE INDEX IF NOT EXISTS idx_factory_name ON factory(name)`.execute(db);
|
|
44
|
-
await db.schema.createTable("tokenFactory").ifNotExists().addColumn("address", "text", (col) => col.primaryKey()).addColumn("owner", "text").addColumn("name", "text").addColumn("description", "text").addColumn("moniker", "text").addColumn("status", "text").addColumn("curve", "text").addColumn("tokenAddress", "text").addColumn("reserveAddress", "text").addColumn("reserveBalance", "text").addColumn("reserveBalanceNum", "text").addColumn("currentSupply", "text").addColumn("currentSupplyNum", "text").addColumn("feeRate", "
|
|
44
|
+
await db.schema.createTable("tokenFactory").ifNotExists().addColumn("address", "text", (col) => col.primaryKey()).addColumn("owner", "text").addColumn("name", "text").addColumn("description", "text").addColumn("moniker", "text").addColumn("status", "text").addColumn("curve", "text").addColumn("tokenAddress", "text").addColumn("reserveAddress", "text").addColumn("reserveBalance", "text").addColumn("reserveBalanceNum", "text").addColumn("currentSupply", "text").addColumn("currentSupplyNum", "text").addColumn("feeRate", "integer").addColumn("token", "text").addColumn("reserveToken", "text").addColumn("input", "text").addColumn("output", "text").addColumn("data", "text").addColumn("genesisTime", "text").addColumn("renaissanceTime", "text").execute();
|
|
45
45
|
await sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_owner ON tokenFactory(owner)`.execute(db);
|
|
46
46
|
await sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_token ON tokenFactory(tokenAddress)`.execute(db);
|
|
47
47
|
await sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_reserve ON tokenFactory(reserveAddress)`.execute(db);
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { sql } from "kysely";
|
|
3
|
+
|
|
4
|
+
//#region src/migrations/007-token-factory-feerate-integer.ts
|
|
5
|
+
var _007_token_factory_feerate_integer_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
down: () => down,
|
|
7
|
+
up: () => up
|
|
8
|
+
});
|
|
9
|
+
async function assertTokenFactoryTableExists(db) {
|
|
10
|
+
if ((await sql`
|
|
11
|
+
SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'tokenFactory'
|
|
12
|
+
`.execute(db)).rows.length === 0) throw new Error("Cannot migrate tokenFactory.feeRate: source table tokenFactory is missing. Refusing to create an empty tokenFactory index table; restore or reindex tokenFactory before rerunning this migration.");
|
|
13
|
+
}
|
|
14
|
+
async function getTokenFactoryCount(db, table) {
|
|
15
|
+
const result = table === "tokenFactory" ? await sql`SELECT COUNT(*) AS count FROM tokenFactory`.execute(db) : await sql`SELECT COUNT(*) AS count FROM tokenFactory_new`.execute(db);
|
|
16
|
+
return Number(result.rows[0]?.count ?? 0);
|
|
17
|
+
}
|
|
18
|
+
async function createTokenFactoryIndexes(db) {
|
|
19
|
+
await sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_owner ON tokenFactory(owner)`.execute(db);
|
|
20
|
+
await sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_token ON tokenFactory(tokenAddress)`.execute(db);
|
|
21
|
+
await sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_reserve ON tokenFactory(reserveAddress)`.execute(db);
|
|
22
|
+
await sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_genesis ON tokenFactory(genesisTime)`.execute(db);
|
|
23
|
+
await sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_renaissance ON tokenFactory(renaissanceTime)`.execute(db);
|
|
24
|
+
await sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_reserve_balance ON tokenFactory(reserveBalanceNum)`.execute(db);
|
|
25
|
+
await sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_supply ON tokenFactory(currentSupplyNum)`.execute(db);
|
|
26
|
+
await sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_owner_renaissance ON tokenFactory(owner, renaissanceTime DESC)`.execute(db);
|
|
27
|
+
await sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_name ON tokenFactory(name) WHERE name IS NOT NULL`.execute(db);
|
|
28
|
+
}
|
|
29
|
+
async function up(db) {
|
|
30
|
+
await assertTokenFactoryTableExists(db);
|
|
31
|
+
const beforeCount = await getTokenFactoryCount(db, "tokenFactory");
|
|
32
|
+
await sql`DROP TABLE IF EXISTS tokenFactory_new`.execute(db);
|
|
33
|
+
await sql`DROP INDEX IF EXISTS idx_tokenfactory_owner`.execute(db);
|
|
34
|
+
await sql`DROP INDEX IF EXISTS idx_tokenfactory_token`.execute(db);
|
|
35
|
+
await sql`DROP INDEX IF EXISTS idx_tokenfactory_reserve`.execute(db);
|
|
36
|
+
await sql`DROP INDEX IF EXISTS idx_tokenfactory_genesis`.execute(db);
|
|
37
|
+
await sql`DROP INDEX IF EXISTS idx_tokenfactory_renaissance`.execute(db);
|
|
38
|
+
await sql`DROP INDEX IF EXISTS idx_tokenfactory_reserve_balance`.execute(db);
|
|
39
|
+
await sql`DROP INDEX IF EXISTS idx_tokenfactory_supply`.execute(db);
|
|
40
|
+
await sql`DROP INDEX IF EXISTS idx_tokenfactory_owner_renaissance`.execute(db);
|
|
41
|
+
await sql`DROP INDEX IF EXISTS idx_tokenfactory_name`.execute(db);
|
|
42
|
+
await sql`
|
|
43
|
+
CREATE TABLE tokenFactory_new (
|
|
44
|
+
address TEXT PRIMARY KEY,
|
|
45
|
+
owner TEXT,
|
|
46
|
+
name TEXT,
|
|
47
|
+
description TEXT,
|
|
48
|
+
moniker TEXT,
|
|
49
|
+
status TEXT,
|
|
50
|
+
curve TEXT,
|
|
51
|
+
tokenAddress TEXT,
|
|
52
|
+
reserveAddress TEXT,
|
|
53
|
+
reserveBalance TEXT,
|
|
54
|
+
reserveBalanceNum TEXT,
|
|
55
|
+
currentSupply TEXT,
|
|
56
|
+
currentSupplyNum TEXT,
|
|
57
|
+
feeRate INTEGER,
|
|
58
|
+
token TEXT,
|
|
59
|
+
reserveToken TEXT,
|
|
60
|
+
input TEXT,
|
|
61
|
+
output TEXT,
|
|
62
|
+
data TEXT,
|
|
63
|
+
genesisTime TEXT,
|
|
64
|
+
renaissanceTime TEXT
|
|
65
|
+
)
|
|
66
|
+
`.execute(db);
|
|
67
|
+
await sql`
|
|
68
|
+
INSERT INTO tokenFactory_new (
|
|
69
|
+
address,
|
|
70
|
+
owner,
|
|
71
|
+
name,
|
|
72
|
+
description,
|
|
73
|
+
moniker,
|
|
74
|
+
status,
|
|
75
|
+
curve,
|
|
76
|
+
tokenAddress,
|
|
77
|
+
reserveAddress,
|
|
78
|
+
reserveBalance,
|
|
79
|
+
reserveBalanceNum,
|
|
80
|
+
currentSupply,
|
|
81
|
+
currentSupplyNum,
|
|
82
|
+
feeRate,
|
|
83
|
+
token,
|
|
84
|
+
reserveToken,
|
|
85
|
+
input,
|
|
86
|
+
output,
|
|
87
|
+
data,
|
|
88
|
+
genesisTime,
|
|
89
|
+
renaissanceTime
|
|
90
|
+
)
|
|
91
|
+
SELECT
|
|
92
|
+
address,
|
|
93
|
+
owner,
|
|
94
|
+
name,
|
|
95
|
+
description,
|
|
96
|
+
moniker,
|
|
97
|
+
status,
|
|
98
|
+
curve,
|
|
99
|
+
tokenAddress,
|
|
100
|
+
reserveAddress,
|
|
101
|
+
reserveBalance,
|
|
102
|
+
reserveBalanceNum,
|
|
103
|
+
currentSupply,
|
|
104
|
+
currentSupplyNum,
|
|
105
|
+
CASE WHEN feeRate IS NULL OR feeRate = '' THEN NULL ELSE CAST(feeRate AS INTEGER) END,
|
|
106
|
+
token,
|
|
107
|
+
reserveToken,
|
|
108
|
+
input,
|
|
109
|
+
output,
|
|
110
|
+
data,
|
|
111
|
+
genesisTime,
|
|
112
|
+
renaissanceTime
|
|
113
|
+
FROM tokenFactory
|
|
114
|
+
`.execute(db);
|
|
115
|
+
const stagedCount = await getTokenFactoryCount(db, "tokenFactory_new");
|
|
116
|
+
if (stagedCount !== beforeCount) throw new Error(`Cannot migrate tokenFactory.feeRate: staged row count mismatch before replacing table (${stagedCount} !== ${beforeCount})`);
|
|
117
|
+
await sql`DROP TABLE tokenFactory`.execute(db);
|
|
118
|
+
await sql`ALTER TABLE tokenFactory_new RENAME TO tokenFactory`.execute(db);
|
|
119
|
+
await createTokenFactoryIndexes(db);
|
|
120
|
+
const afterCount = await getTokenFactoryCount(db, "tokenFactory");
|
|
121
|
+
if (afterCount !== beforeCount) throw new Error(`Cannot migrate tokenFactory.feeRate: row count mismatch after replacing table (${afterCount} !== ${beforeCount})`);
|
|
122
|
+
}
|
|
123
|
+
async function down(_db) {}
|
|
124
|
+
|
|
125
|
+
//#endregion
|
|
126
|
+
export { _007_token_factory_feerate_integer_exports, down, up };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Kysely } from "kysely";
|
|
2
|
+
|
|
3
|
+
//#region src/migrations/008-index-failure.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Adds the indexFailure table: a durable log of failed indexdb writes from
|
|
7
|
+
* connectIndexDB()'s statedb event listeners (see #67). `table` is a reserved SQL
|
|
8
|
+
* keyword, so the column is `table_` (mapped from the `table` JS field via columnMapping,
|
|
9
|
+
* matching the existing `index`/`limit`/`from`/`to` convention in this schema).
|
|
10
|
+
*/
|
|
11
|
+
declare function up(db: Kysely<unknown>): Promise<void>;
|
|
12
|
+
declare function down(db: Kysely<unknown>): Promise<void>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { down, up };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { sql } from "kysely";
|
|
3
|
+
|
|
4
|
+
//#region src/migrations/008-index-failure.ts
|
|
5
|
+
var _008_index_failure_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
down: () => down,
|
|
7
|
+
up: () => up
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* Adds the indexFailure table: a durable log of failed indexdb writes from
|
|
11
|
+
* connectIndexDB()'s statedb event listeners (see #67). `table` is a reserved SQL
|
|
12
|
+
* keyword, so the column is `table_` (mapped from the `table` JS field via columnMapping,
|
|
13
|
+
* matching the existing `index`/`limit`/`from`/`to` convention in this schema).
|
|
14
|
+
*/
|
|
15
|
+
async function up(db) {
|
|
16
|
+
await db.schema.createTable("indexFailure").ifNotExists().addColumn("id", "text", (col) => col.primaryKey()).addColumn("table_", "text", (col) => col.notNull()).addColumn("event", "text", (col) => col.notNull()).addColumn("entityId", "text").addColumn("payload", "text").addColumn("attempts", "integer", (col) => col.notNull().defaultTo(0)).addColumn("lastError", "text").addColumn("createdAt", "text", (col) => col.notNull()).addColumn("lastAttemptAt", "text", (col) => col.notNull()).execute();
|
|
17
|
+
await sql`CREATE INDEX IF NOT EXISTS idx_indexFailure_table ON indexFailure(table_)`.execute(db);
|
|
18
|
+
await sql`CREATE INDEX IF NOT EXISTS idx_indexFailure_createdAt ON indexFailure(createdAt)`.execute(db);
|
|
19
|
+
}
|
|
20
|
+
async function down(db) {
|
|
21
|
+
await db.schema.dropTable("indexFailure").ifExists().execute();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { _008_index_failure_exports, down, up };
|
package/esm/migrations/index.mjs
CHANGED
|
@@ -4,6 +4,8 @@ import { _003_delegation_extensions_exports } from "./003-delegation-extensions.
|
|
|
4
4
|
import { _004_search_indexes_exports } from "./004-search-indexes.mjs";
|
|
5
5
|
import { _005_rollup_missing_columns_exports } from "./005-rollup-missing-columns.mjs";
|
|
6
6
|
import { _006_rollup_block_height_integer_exports } from "./006-rollup-block-height-integer.mjs";
|
|
7
|
+
import { _007_token_factory_feerate_integer_exports } from "./007-token-factory-feerate-integer.mjs";
|
|
8
|
+
import { _008_index_failure_exports } from "./008-index-failure.mjs";
|
|
7
9
|
import { Migrator } from "kysely";
|
|
8
10
|
|
|
9
11
|
//#region src/migrations/index.ts
|
|
@@ -19,7 +21,9 @@ var InMemoryMigrationProvider = class {
|
|
|
19
21
|
"003-delegation-extensions": _003_delegation_extensions_exports,
|
|
20
22
|
"004-search-indexes": _004_search_indexes_exports,
|
|
21
23
|
"005-rollup-missing-columns": _005_rollup_missing_columns_exports,
|
|
22
|
-
"006-rollup-block-height-integer": _006_rollup_block_height_integer_exports
|
|
24
|
+
"006-rollup-block-height-integer": _006_rollup_block_height_integer_exports,
|
|
25
|
+
"007-token-factory-feerate-integer": _007_token_factory_feerate_integer_exports,
|
|
26
|
+
"008-index-failure": _008_index_failure_exports
|
|
23
27
|
};
|
|
24
28
|
}
|
|
25
29
|
};
|
package/esm/package.mjs
CHANGED
|
@@ -10,7 +10,7 @@ var package_default = {
|
|
|
10
10
|
},
|
|
11
11
|
publishConfig: { "access": "public" },
|
|
12
12
|
contributors: ["wangshijun <shijun@arcblock.io> (https://www.arcblock.io)"],
|
|
13
|
-
devDependencies: {},
|
|
13
|
+
devDependencies: { "@ocap/indexdb-test": "workspace:*" },
|
|
14
14
|
homepage: "https://github.com/ArcBlock/blockchain/tree/master/indexdb/sqlite",
|
|
15
15
|
keywords: [
|
|
16
16
|
"ocap",
|
package/lib/db/base.cjs
CHANGED
|
@@ -54,7 +54,14 @@ var SqliteBaseIndexDB = class extends _ocap_indexdb.BaseIndexDB {
|
|
|
54
54
|
const { tokenFactories = [] } = tokenFactoryFilter;
|
|
55
55
|
const pagination = (0, _ocap_indexdb.formatPagination)({
|
|
56
56
|
paging,
|
|
57
|
-
defaultSortField: "time"
|
|
57
|
+
defaultSortField: "time",
|
|
58
|
+
supportedSortFields: [
|
|
59
|
+
"genesisTime",
|
|
60
|
+
"renaissanceTime",
|
|
61
|
+
"time",
|
|
62
|
+
"sender",
|
|
63
|
+
"receiver"
|
|
64
|
+
]
|
|
58
65
|
});
|
|
59
66
|
debug$1("listTransactions", {
|
|
60
67
|
sender,
|
|
@@ -241,7 +248,12 @@ var SqliteBaseIndexDB = class extends _ocap_indexdb.BaseIndexDB {
|
|
|
241
248
|
const { ownerAddress, factoryAddress, paging, timeFilter = {} } = params;
|
|
242
249
|
const pagination = (0, _ocap_indexdb.formatPagination)({
|
|
243
250
|
paging,
|
|
244
|
-
defaultSortField: "renaissanceTime"
|
|
251
|
+
defaultSortField: "renaissanceTime",
|
|
252
|
+
supportedSortFields: [
|
|
253
|
+
"genesisTime",
|
|
254
|
+
"renaissanceTime",
|
|
255
|
+
"address"
|
|
256
|
+
]
|
|
245
257
|
});
|
|
246
258
|
let qb = this.db.selectFrom("asset").selectAll();
|
|
247
259
|
if (ownerAddress) {
|
package/lib/db/index.cjs
CHANGED
|
@@ -502,6 +502,25 @@ var SqliteIndexDB = class extends require_db_base.default {
|
|
|
502
502
|
]
|
|
503
503
|
}
|
|
504
504
|
});
|
|
505
|
+
this.indexFailure = new require_table_base.default({
|
|
506
|
+
name: "indexFailure",
|
|
507
|
+
uniqIndex: "id",
|
|
508
|
+
db: this.db,
|
|
509
|
+
schema: {
|
|
510
|
+
columnMapping: { table: "table_" },
|
|
511
|
+
knownColumns: [
|
|
512
|
+
"id",
|
|
513
|
+
"table",
|
|
514
|
+
"event",
|
|
515
|
+
"entityId",
|
|
516
|
+
"payload",
|
|
517
|
+
"attempts",
|
|
518
|
+
"lastError",
|
|
519
|
+
"createdAt",
|
|
520
|
+
"lastAttemptAt"
|
|
521
|
+
]
|
|
522
|
+
}
|
|
523
|
+
});
|
|
505
524
|
this.attachReadyListeners();
|
|
506
525
|
}
|
|
507
526
|
/**
|
|
@@ -539,7 +558,8 @@ var SqliteIndexDB = class extends require_db_base.default {
|
|
|
539
558
|
"rollupBlock",
|
|
540
559
|
"rollupValidator",
|
|
541
560
|
"tokenDistribution",
|
|
542
|
-
"balance"
|
|
561
|
+
"balance",
|
|
562
|
+
"indexFailure"
|
|
543
563
|
]) {
|
|
544
564
|
const tableInstance = this[table];
|
|
545
565
|
if (tableInstance?.reset) await tableInstance.reset();
|
package/lib/db/index.d.cts
CHANGED
|
@@ -29,6 +29,7 @@ declare class SqliteIndexDB extends SqliteBaseIndexDB implements IIndexDB {
|
|
|
29
29
|
tokenDistribution: IIndexTable<IndexTableTypeMap['tokenDistribution']>;
|
|
30
30
|
tokenFactory: IIndexTable<IndexTableTypeMap['tokenFactory']>;
|
|
31
31
|
balance: IIndexTable<IndexTableTypeMap['tokenDistribution']>;
|
|
32
|
+
indexFailure: IIndexTable<IndexTableTypeMap['indexFailure']>;
|
|
32
33
|
/**
|
|
33
34
|
* Creates an instance of SqliteIndexDB
|
|
34
35
|
*
|
package/lib/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
const require_kysely = require('./kysely.cjs');
|
|
2
3
|
const require_db_base = require('./db/base.cjs');
|
|
3
4
|
const require_db_index = require('./db/index.cjs');
|
|
4
5
|
|
|
@@ -6,5 +7,7 @@ const require_db_index = require('./db/index.cjs');
|
|
|
6
7
|
var src_default = require_db_index.default;
|
|
7
8
|
|
|
8
9
|
//#endregion
|
|
10
|
+
exports.DurableObjectSqliteDialect = require_kysely.DurableObjectSqliteDialect;
|
|
9
11
|
exports.SqliteBaseIndexDB = require_db_base.default;
|
|
10
|
-
exports.default = src_default;
|
|
12
|
+
exports.default = src_default;
|
|
13
|
+
exports.getRawDatabase = require_kysely.getRawDatabase;
|
package/lib/index.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import SqliteBaseIndexDB from "./db/base.cjs";
|
|
2
|
+
import { DurableObjectSqliteDialect, DurableObjectSqliteDialectConfig, IDurableObjectSqlStorage, IDurableObjectSqlStorageCursor, SqliteConfig, getRawDatabase } from "./kysely.cjs";
|
|
2
3
|
import SqliteIndexDB from "./db/index.cjs";
|
|
3
|
-
export { SqliteBaseIndexDB, SqliteIndexDB as default };
|
|
4
|
+
export { DurableObjectSqliteDialect, type DurableObjectSqliteDialectConfig, type IDurableObjectSqlStorage, type IDurableObjectSqlStorageCursor, SqliteBaseIndexDB, type SqliteConfig, SqliteIndexDB as default, getRawDatabase };
|
package/lib/interfaces.d.cts
CHANGED
|
@@ -21,6 +21,7 @@ interface Database {
|
|
|
21
21
|
tokenFactory: TokenFactoryTable;
|
|
22
22
|
balance: BalanceTable;
|
|
23
23
|
tx_ref: TxRefTable;
|
|
24
|
+
indexFailure: IndexFailureTable;
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
27
|
* Transaction table for indexed transactions
|
|
@@ -161,7 +162,7 @@ interface TokenFactoryTable {
|
|
|
161
162
|
reserveBalanceNum: string | null;
|
|
162
163
|
currentSupply: string | null;
|
|
163
164
|
currentSupplyNum: string | null;
|
|
164
|
-
feeRate:
|
|
165
|
+
feeRate: number | null;
|
|
165
166
|
token: string | null;
|
|
166
167
|
reserveToken: string | null;
|
|
167
168
|
input: string | null;
|
|
@@ -331,6 +332,21 @@ interface TxRefTable {
|
|
|
331
332
|
value: string;
|
|
332
333
|
time: string | null;
|
|
333
334
|
}
|
|
335
|
+
/**
|
|
336
|
+
* IndexFailure table: durable log of failed indexdb writes from connectIndexDB() (see #67).
|
|
337
|
+
* `table_` avoids colliding with the SQL keyword `table`.
|
|
338
|
+
*/
|
|
339
|
+
interface IndexFailureTable {
|
|
340
|
+
id: string;
|
|
341
|
+
table_: string;
|
|
342
|
+
event: string;
|
|
343
|
+
entityId: string;
|
|
344
|
+
payload: string | null;
|
|
345
|
+
attempts: number;
|
|
346
|
+
lastError: string | null;
|
|
347
|
+
createdAt: string;
|
|
348
|
+
lastAttemptAt: string;
|
|
349
|
+
}
|
|
334
350
|
/**
|
|
335
351
|
* SQLite-specific operation context with optional transaction
|
|
336
352
|
*/
|
|
@@ -338,4 +354,4 @@ interface SqliteOperationContext {
|
|
|
338
354
|
txn?: Transaction<Database>;
|
|
339
355
|
}
|
|
340
356
|
//#endregion
|
|
341
|
-
export { AccountTable, AssetTable, BalanceTable, Database, DelegationTable, FactoryTable, RollupBlockTable, RollupTable, RollupValidatorTable, SqliteOperationContext, StakeTable, TokenDistributionTable, TokenFactoryTable, TokenTable, TxRefTable, TxTable };
|
|
357
|
+
export { AccountTable, AssetTable, BalanceTable, Database, DelegationTable, FactoryTable, IndexFailureTable, RollupBlockTable, RollupTable, RollupValidatorTable, SqliteOperationContext, StakeTable, TokenDistributionTable, TokenFactoryTable, TokenTable, TxRefTable, TxTable };
|