@bsv/overlay 0.1.7 → 0.1.9
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/cjs/package.json +2 -2
- package/dist/cjs/src/Engine.js +185 -496
- package/dist/cjs/src/Engine.js.map +1 -1
- package/dist/cjs/src/GASP/OverlayGASPRemote.js +6 -4
- package/dist/cjs/src/GASP/OverlayGASPRemote.js.map +1 -1
- package/dist/cjs/src/GASP/OverlayGASPStorage.js +152 -77
- package/dist/cjs/src/GASP/OverlayGASPStorage.js.map +1 -1
- package/dist/cjs/src/storage/knex/KnexStorage.js +106 -38
- package/dist/cjs/src/storage/knex/KnexStorage.js.map +1 -1
- package/dist/cjs/src/storage/knex/all-migrations.js +5 -1
- package/dist/cjs/src/storage/knex/all-migrations.js.map +1 -1
- package/dist/cjs/src/storage/knex/migrations/2024-07-17-001-transactions.js +39 -0
- package/dist/cjs/src/storage/knex/migrations/2024-07-17-001-transactions.js.map +1 -0
- package/dist/cjs/src/storage/knex/migrations/2024-07-18-001-indexes.js +34 -0
- package/dist/cjs/src/storage/knex/migrations/2024-07-18-001-indexes.js.map +1 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/Engine.js +183 -495
- package/dist/esm/src/Engine.js.map +1 -1
- package/dist/esm/src/GASP/OverlayGASPRemote.js +7 -4
- package/dist/esm/src/GASP/OverlayGASPRemote.js.map +1 -1
- package/dist/esm/src/GASP/OverlayGASPStorage.js +151 -77
- package/dist/esm/src/GASP/OverlayGASPStorage.js.map +1 -1
- package/dist/esm/src/storage/knex/KnexStorage.js +106 -38
- package/dist/esm/src/storage/knex/KnexStorage.js.map +1 -1
- package/dist/esm/src/storage/knex/all-migrations.js +5 -1
- package/dist/esm/src/storage/knex/all-migrations.js.map +1 -1
- package/dist/esm/src/storage/knex/migrations/2024-07-17-001-transactions.js +34 -0
- package/dist/esm/src/storage/knex/migrations/2024-07-17-001-transactions.js.map +1 -0
- package/dist/esm/src/storage/knex/migrations/2024-07-18-001-indexes.js +29 -0
- package/dist/esm/src/storage/knex/migrations/2024-07-18-001-indexes.js.map +1 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/Engine.d.ts +9 -116
- package/dist/types/src/Engine.d.ts.map +1 -1
- package/dist/types/src/GASP/OverlayGASPRemote.d.ts +3 -2
- package/dist/types/src/GASP/OverlayGASPRemote.d.ts.map +1 -1
- package/dist/types/src/GASP/OverlayGASPStorage.d.ts +29 -3
- package/dist/types/src/GASP/OverlayGASPStorage.d.ts.map +1 -1
- package/dist/types/src/Output.d.ts +2 -2
- package/dist/types/src/Output.d.ts.map +1 -1
- package/dist/types/src/SyncConfiguration.d.ts +1 -1
- package/dist/types/src/SyncConfiguration.d.ts.map +1 -1
- package/dist/types/src/storage/Storage.d.ts +6 -8
- package/dist/types/src/storage/Storage.d.ts.map +1 -1
- package/dist/types/src/storage/knex/KnexStorage.d.ts +4 -4
- package/dist/types/src/storage/knex/KnexStorage.d.ts.map +1 -1
- package/dist/types/src/storage/knex/all-migrations.d.ts.map +1 -1
- package/dist/types/src/storage/knex/migrations/2024-07-17-001-transactions.d.ts +4 -0
- package/dist/types/src/storage/knex/migrations/2024-07-17-001-transactions.d.ts.map +1 -0
- package/dist/types/src/storage/knex/migrations/2024-07-18-001-indexes.d.ts +4 -0
- package/dist/types/src/storage/knex/migrations/2024-07-18-001-indexes.d.ts.map +1 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/Engine.ts +191 -555
- package/src/GASP/OverlayGASPRemote.ts +107 -0
- package/src/GASP/OverlayGASPStorage.ts +331 -0
- package/src/Output.ts +2 -2
- package/src/SyncConfiguration.ts +1 -1
- package/src/__tests/Engine.test.ts +105 -26
- package/src/__tests/OverlayGASPRemote.test.ts +1 -1
- package/src/__tests/OverlayGASPStorage.test.ts +4 -3
- package/src/storage/Storage.ts +6 -8
- package/src/storage/knex/KnexStorage.ts +119 -41
- package/src/storage/knex/all-migrations.ts +10 -6
- package/src/storage/knex/migrations/2024-07-17-001-transactions.ts +40 -0
- package/src/storage/knex/migrations/2024-07-18-001-indexes.ts +30 -0
- package/dist/cjs/src/GASP.js +0 -275
- package/dist/cjs/src/GASP.js.map +0 -1
- package/dist/cjs/src/SHIPAdvertisement.js +0 -3
- package/dist/cjs/src/SHIPAdvertisement.js.map +0 -1
- package/dist/cjs/src/SLAPAdvertisement.js +0 -3
- package/dist/cjs/src/SLAPAdvertisement.js.map +0 -1
- package/dist/esm/src/GASP.js +0 -279
- package/dist/esm/src/GASP.js.map +0 -1
- package/dist/esm/src/SHIPAdvertisement.js +0 -2
- package/dist/esm/src/SHIPAdvertisement.js.map +0 -1
- package/dist/esm/src/SLAPAdvertisement.js +0 -2
- package/dist/esm/src/SLAPAdvertisement.js.map +0 -1
- package/dist/types/src/GASP.d.ts +0 -215
- package/dist/types/src/GASP.d.ts.map +0 -1
- package/dist/types/src/SHIPAdvertisement.d.ts +0 -9
- package/dist/types/src/SHIPAdvertisement.d.ts.map +0 -1
- package/dist/types/src/SLAPAdvertisement.d.ts +0 -9
- package/dist/types/src/SLAPAdvertisement.d.ts.map +0 -1
|
@@ -5,7 +5,6 @@ import { Engine } from '../Engine.js';
|
|
|
5
5
|
*/
|
|
6
6
|
export interface GraphNode {
|
|
7
7
|
txid: string;
|
|
8
|
-
time: number;
|
|
9
8
|
graphID: string;
|
|
10
9
|
rawTx: string;
|
|
11
10
|
outputIndex: number;
|
|
@@ -34,6 +33,14 @@ export declare class OverlayGASPStorage implements GASPStorage {
|
|
|
34
33
|
txid: string;
|
|
35
34
|
outputIndex: number;
|
|
36
35
|
}>>;
|
|
36
|
+
/**
|
|
37
|
+
* For a given txid and output index, returns the associated transaction, a merkle proof if the transaction is in a block, and metadata if if requested. If no metadata is requested, metadata hashes on inputs are not returned.
|
|
38
|
+
* @param graphID
|
|
39
|
+
* @param txid
|
|
40
|
+
* @param outputIndex
|
|
41
|
+
* @param metadata
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
37
44
|
hydrateGASPNode(graphID: string, txid: string, outputIndex: number, metadata: boolean): Promise<GASPNode>;
|
|
38
45
|
/**
|
|
39
46
|
* For a given node, returns the inputs needed to complete the graph, including whether updated metadata is requested for those inputs.
|
|
@@ -41,6 +48,11 @@ export declare class OverlayGASPStorage implements GASPStorage {
|
|
|
41
48
|
* @returns A promise for a mapping of requested input transactions and whether metadata should be provided for each.
|
|
42
49
|
*/
|
|
43
50
|
findNeededInputs(tx: GASPNode): Promise<GASPNodeResponse | undefined>;
|
|
51
|
+
/**
|
|
52
|
+
* Ensures that no inputs are requested from foreign nodes before sending any GASP response
|
|
53
|
+
* Also terminates graphs if the response would be empty.
|
|
54
|
+
*/
|
|
55
|
+
private stripAlreadyKnownInputs;
|
|
44
56
|
/**
|
|
45
57
|
* Appends a new node to a temporary graph.
|
|
46
58
|
* @param tx The node to append to this graph.
|
|
@@ -50,8 +62,10 @@ export declare class OverlayGASPStorage implements GASPStorage {
|
|
|
50
62
|
appendToGraph(tx: GASPNode, spentBy?: string | undefined): Promise<void>;
|
|
51
63
|
/**
|
|
52
64
|
* Checks whether the given graph, in its current state, makes reference only to transactions that are proven in the blockchain, or already known by the recipient to be valid.
|
|
65
|
+
* Additionally, in a breadth-first manner (ensuring that all inputs for any given node are processed before nodes that spend them), it ensures that the root node remains valid according to the rules of the overlay's topic manager,
|
|
66
|
+
* while considering any coins which the Manager had previously indicated were either valid or invalid.
|
|
53
67
|
* @param graphID The TXID and output index (in 36-byte format) for the UTXO at the tip of this graph.
|
|
54
|
-
* @throws If the graph is not well-anchored.
|
|
68
|
+
* @throws If the graph is not well-anchored, according to the rules of Bitcoin or the rules of the Overlay Topic Manager.
|
|
55
69
|
*/
|
|
56
70
|
validateGraphAnchor(graphID: string): Promise<void>;
|
|
57
71
|
/**
|
|
@@ -61,8 +75,20 @@ export declare class OverlayGASPStorage implements GASPStorage {
|
|
|
61
75
|
discardGraph(graphID: string): Promise<void>;
|
|
62
76
|
/**
|
|
63
77
|
* Finalizes a graph, solidifying the new UTXO and its ancestors so that it will appear in the list of known UTXOs.
|
|
64
|
-
* @param graphID The TXID and output index (in 36-byte format) for the UTXO at the
|
|
78
|
+
* @param graphID The TXID and output index (in 36-byte format) for the UTXO at the root of this graph.
|
|
65
79
|
*/
|
|
66
80
|
finalizeGraph(graphID: string): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Computes an ordered set of BEEFs for the graph with the given graph IDs
|
|
83
|
+
* @param {string} graphID — The ID of the graph for which BEEFs are required
|
|
84
|
+
* @returns Ordered BEEFs for the graph
|
|
85
|
+
*/
|
|
86
|
+
private computeOrderedBEEFsForGraph;
|
|
87
|
+
/**
|
|
88
|
+
* Computes a full BEEF for a given graph node, based on the temporary graph store.
|
|
89
|
+
* @param node Graph node for which BEEF is needed.
|
|
90
|
+
* @returns BEEF array, including all proofs on inputs.
|
|
91
|
+
*/
|
|
92
|
+
private getBEEFForNode;
|
|
67
93
|
}
|
|
68
94
|
//# sourceMappingURL=OverlayGASPStorage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayGASPStorage.d.ts","sourceRoot":"","sources":["../../../../src/GASP/OverlayGASPStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEnE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,
|
|
1
|
+
{"version":3,"file":"OverlayGASPStorage.d.ts","sourceRoot":"","sources":["../../../../src/GASP/OverlayGASPStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEnE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc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,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IA2C9E;;;;;;QAMI;IACE,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgDzD;;;OAGG;IACG,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUlD;;;OAGG;IACG,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYnD;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;IAuBnC;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAuBvB"}
|
|
@@ -14,8 +14,6 @@ export type Output = {
|
|
|
14
14
|
topic: string;
|
|
15
15
|
/** Whether the output is spent */
|
|
16
16
|
spent: boolean;
|
|
17
|
-
/** The transaction data for the output */
|
|
18
|
-
beef: number[];
|
|
19
17
|
/** Outputs consumed by the transaction associated with the output */
|
|
20
18
|
outputsConsumed: Array<{
|
|
21
19
|
txid: string;
|
|
@@ -26,6 +24,8 @@ export type Output = {
|
|
|
26
24
|
txid: string;
|
|
27
25
|
outputIndex: number;
|
|
28
26
|
}>;
|
|
27
|
+
/** The transaction data for the output */
|
|
28
|
+
beef?: number[];
|
|
29
29
|
blockHeight?: number;
|
|
30
30
|
};
|
|
31
31
|
//# sourceMappingURL=Output.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Output.d.ts","sourceRoot":"","sources":["../../../src/Output.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,2BAA2B;IAC3B,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAA;IAChB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,kCAAkC;IAClC,KAAK,EAAE,OAAO,CAAA;IACd,
|
|
1
|
+
{"version":3,"file":"Output.d.ts","sourceRoot":"","sources":["../../../src/Output.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,2BAA2B;IAC3B,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAA;IAChB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,kCAAkC;IAClC,KAAK,EAAE,OAAO,CAAA;IACd,qEAAqE;IACrE,eAAe,EAAE,KAAK,CAAC;QACrB,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,EAAE,MAAM,CAAA;KACpB,CAAC,CAAA;IACF,oCAAoC;IACpC,UAAU,EAAE,KAAK,CAAC;QAChB,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,EAAE,MAAM,CAAA;KACpB,CAAC,CAAA;IACF,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SyncConfiguration.d.ts","sourceRoot":"","sources":["../../../src/SyncConfiguration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"SyncConfiguration.d.ts","sourceRoot":"","sources":["../../../src/SyncConfiguration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,KAAK,CAAC,CAAA"}
|
|
@@ -24,19 +24,19 @@ export interface Storage {
|
|
|
24
24
|
* @param topic — The topic in which the output is stored
|
|
25
25
|
* @param spent — Whether the output must be spent to be returned
|
|
26
26
|
*/
|
|
27
|
-
findOutput: (txid: string, outputIndex: number, topic?: string, spent?: boolean) => Promise<Output | null>;
|
|
27
|
+
findOutput: (txid: string, outputIndex: number, topic?: string, spent?: boolean, includeBEEF?: boolean) => Promise<Output | null>;
|
|
28
28
|
/**
|
|
29
29
|
* Finds outputs with a matching transaction ID from storage
|
|
30
30
|
* @param txid — TXID of the outputs to find
|
|
31
31
|
*/
|
|
32
|
-
findOutputsForTransaction: (txid: string) => Promise<Output[]>;
|
|
32
|
+
findOutputsForTransaction: (txid: string, includeBEEF?: boolean) => Promise<Output[]>;
|
|
33
33
|
/**
|
|
34
34
|
* Finds current UTXOs that have been admitted into a given topic
|
|
35
35
|
* @param topic - The topic for which we want to find Unspent Transaction Outputs (UTXOs).
|
|
36
36
|
* @param since - Optional parameter indicating the minimum date (timestamp? block height?) to retrieve matching UTXOs from. TODO: We need to decide about which time format to use for synchronization.
|
|
37
37
|
* @returns A promise that resolves to an array of matching UTXOs.
|
|
38
38
|
*/
|
|
39
|
-
findUTXOsForTopic: (topic: string, since?: number) => Promise<Output[]>;
|
|
39
|
+
findUTXOsForTopic: (topic: string, since?: number, includeBEEF?: boolean) => Promise<Output[]>;
|
|
40
40
|
/**
|
|
41
41
|
* Deletes an output from storage
|
|
42
42
|
* @param txid — The TXID of the output to delete
|
|
@@ -63,13 +63,11 @@ export interface Storage {
|
|
|
63
63
|
outputIndex: number;
|
|
64
64
|
}>) => Promise<void>;
|
|
65
65
|
/**
|
|
66
|
-
* Updates the beef data
|
|
67
|
-
* @param txid — TXID of the
|
|
68
|
-
* @param outputIndex — Index of the output to update
|
|
69
|
-
* @param topic — Topic in which the output should be updated
|
|
66
|
+
* Updates the beef data for a transaction
|
|
67
|
+
* @param txid — TXID of the transaction to update
|
|
70
68
|
* @param beef - BEEF data to update
|
|
71
69
|
*/
|
|
72
|
-
|
|
70
|
+
updateTransactionBEEF: (txid: string, beef: number[]) => Promise<void>;
|
|
73
71
|
/**
|
|
74
72
|
* Updates the block height on an output
|
|
75
73
|
* @param txid — TXID of the output to update
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Storage.d.ts","sourceRoot":"","sources":["../../../../src/storage/Storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB;;;OAGG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7C;;;;;;OAMG;IACH,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"Storage.d.ts","sourceRoot":"","sources":["../../../../src/storage/Storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB;;;OAGG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7C;;;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AM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAElH;;;OAGG;IACH,wBAAwB,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnE;;;;OAIG;IACH,2BAA2B,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAC1E"}
|
|
@@ -4,9 +4,9 @@ import type { Output } from '../../Output.js';
|
|
|
4
4
|
export declare class KnexStorage implements Storage {
|
|
5
5
|
knex: Knex;
|
|
6
6
|
constructor(knex: Knex);
|
|
7
|
-
findOutput(txid: string, outputIndex: number, topic?: string, spent?: boolean): Promise<Output | null>;
|
|
8
|
-
findOutputsForTransaction(txid: string): Promise<Output[]>;
|
|
9
|
-
findUTXOsForTopic(topic: string, since?: number): Promise<Output[]>;
|
|
7
|
+
findOutput(txid: string, outputIndex: number, topic?: string, spent?: boolean, includeBEEF?: boolean): Promise<Output | null>;
|
|
8
|
+
findOutputsForTransaction(txid: string, includeBEEF?: boolean): Promise<Output[]>;
|
|
9
|
+
findUTXOsForTopic(topic: string, since?: number, includeBEEF?: boolean): Promise<Output[]>;
|
|
10
10
|
deleteOutput(txid: string, outputIndex: number, topic: string): Promise<void>;
|
|
11
11
|
insertOutput(output: Output): Promise<void>;
|
|
12
12
|
markUTXOAsSpent(txid: string, outputIndex: number, topic?: string): Promise<void>;
|
|
@@ -14,7 +14,7 @@ export declare class KnexStorage implements Storage {
|
|
|
14
14
|
txid: string;
|
|
15
15
|
outputIndex: number;
|
|
16
16
|
}>): Promise<void>;
|
|
17
|
-
|
|
17
|
+
updateTransactionBEEF(txid: string, beef: number[]): Promise<void>;
|
|
18
18
|
updateOutputBlockHeight(txid: string, outputIndex: number, topic: string, blockHeight: number): Promise<void>;
|
|
19
19
|
insertAppliedTransaction(tx: {
|
|
20
20
|
txid: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KnexStorage.d.ts","sourceRoot":"","sources":["../../../../../src/storage/knex/KnexStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,qBAAa,WAAY,YAAW,OAAO;IACzC,IAAI,EAAE,IAAI,CAAA;gBAEE,IAAI,EAAE,IAAI;IAIhB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"KnexStorage.d.ts","sourceRoot":"","sources":["../../../../../src/storage/knex/KnexStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,qBAAa,WAAY,YAAW,OAAO;IACzC,IAAI,EAAE,IAAI,CAAA;gBAEE,IAAI,EAAE,IAAI;IAIhB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,WAAW,GAAE,OAAe,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAkDpI,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,GAAE,OAAe,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAsCxF,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,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E,IAAI,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"all-migrations.d.ts","sourceRoot":"","sources":["../../../../../src/storage/knex/all-migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAM3B;;GAEG;AACH,KAAK,SAAS,GAAG;IACf,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACjC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACpC,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,SAAS,EAK7B,CAAA;AACD,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"2024-07-17-001-transactions.d.ts","sourceRoot":"","sources":["../../../../../../src/storage/knex/migrations/2024-07-17-001-transactions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAEhC,wBAAsB,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBlD;AAED,wBAAsB,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAepD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"2024-07-18-001-indexes.d.ts","sourceRoot":"","sources":["../../../../../../src/storage/knex/migrations/2024-07-18-001-indexes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAChC,wBAAsB,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAalD;AAED,wBAAsB,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAapD"}
|