@bananapus/nana-sdk-core 2.24.3 → 2.24.4
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/activityGroups.d.ts +24 -0
- package/dist/cjs/activityGroups.d.ts.map +1 -0
- package/dist/cjs/activityGroups.js +36 -0
- package/dist/cjs/activityGroups.js.map +1 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/activityGroups.d.ts +24 -0
- package/dist/esm/activityGroups.d.ts.map +1 -0
- package/dist/esm/activityGroups.js +33 -0
- package/dist/esm/activityGroups.js.map +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fold matching project activity across distinct chains, preserving input order
|
|
3
|
+
* and the first representative value. The caller supplies the display signature,
|
|
4
|
+
* including actor identity, after same-transaction grouping and filtering.
|
|
5
|
+
*
|
|
6
|
+
* Each row joins the first matching group within six hours of that group's first
|
|
7
|
+
* row, provided its chain is not already present. Every original chain/hash link
|
|
8
|
+
* is retained. This display heuristic does not prove shared transaction intent
|
|
9
|
+
* or membership in a Relayr bundle.
|
|
10
|
+
*/
|
|
11
|
+
export declare function mergeCrossChainActivityGroups<T>(rows: readonly {
|
|
12
|
+
value: T;
|
|
13
|
+
signature: string;
|
|
14
|
+
chainId: number;
|
|
15
|
+
txHash: string;
|
|
16
|
+
timestamp: number;
|
|
17
|
+
}[]): {
|
|
18
|
+
value: T;
|
|
19
|
+
chains: {
|
|
20
|
+
chainId: number;
|
|
21
|
+
txHash: string;
|
|
22
|
+
}[];
|
|
23
|
+
}[];
|
|
24
|
+
//# sourceMappingURL=activityGroups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activityGroups.d.ts","sourceRoot":"","sources":["../../src/activityGroups.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAC7C,IAAI,EAAE,SAAS;IACb,KAAK,EAAE,CAAC,CAAC;IACT,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,EAAE,GACF;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,EAAE,CA0B/D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeCrossChainActivityGroups = mergeCrossChainActivityGroups;
|
|
4
|
+
/** Display matching may span six hours of chain confirmation delays. Timestamps are seconds. */
|
|
5
|
+
const CROSS_CHAIN_MERGE_WINDOW = 6 * 3600;
|
|
6
|
+
/**
|
|
7
|
+
* Fold matching project activity across distinct chains, preserving input order
|
|
8
|
+
* and the first representative value. The caller supplies the display signature,
|
|
9
|
+
* including actor identity, after same-transaction grouping and filtering.
|
|
10
|
+
*
|
|
11
|
+
* Each row joins the first matching group within six hours of that group's first
|
|
12
|
+
* row, provided its chain is not already present. Every original chain/hash link
|
|
13
|
+
* is retained. This display heuristic does not prove shared transaction intent
|
|
14
|
+
* or membership in a Relayr bundle.
|
|
15
|
+
*/
|
|
16
|
+
function mergeCrossChainActivityGroups(rows) {
|
|
17
|
+
const merged = [];
|
|
18
|
+
for (const row of rows) {
|
|
19
|
+
const host = merged.find((entry) => entry.signature === row.signature &&
|
|
20
|
+
Math.abs(entry.timestamp - row.timestamp) <= CROSS_CHAIN_MERGE_WINDOW &&
|
|
21
|
+
!entry.chains.some((chain) => chain.chainId === row.chainId));
|
|
22
|
+
if (host) {
|
|
23
|
+
host.chains.push({ chainId: row.chainId, txHash: row.txHash });
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
merged.push({
|
|
27
|
+
value: row.value,
|
|
28
|
+
signature: row.signature,
|
|
29
|
+
timestamp: row.timestamp,
|
|
30
|
+
chains: [{ chainId: row.chainId, txHash: row.txHash }],
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return merged.map(({ value, chains }) => ({ value, chains }));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=activityGroups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activityGroups.js","sourceRoot":"","sources":["../../src/activityGroups.ts"],"names":[],"mappings":";;AAaA,sEAkCC;AA/CD,gGAAgG;AAChG,MAAM,wBAAwB,GAAG,CAAC,GAAG,IAAI,CAAC;AAE1C;;;;;;;;;GASG;AACH,SAAgB,6BAA6B,CAC3C,IAMG;IAEH,MAAM,MAAM,GAKN,EAAE,CAAC;IACT,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CACtB,CAAC,KAAK,EAAE,EAAE,CACR,KAAK,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS;YACjC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC,IAAI,wBAAwB;YACrE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC,CAC/D,CAAC;QACF,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,GAAG,CAAC,KAAK;gBAChB,SAAS,EAAE,GAAG,CAAC,SAAS;gBACxB,SAAS,EAAE,GAAG,CAAC,SAAS;gBACxB,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;aACvD,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;AAChE,CAAC"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./actions/dataHook.js";
|
|
2
2
|
export * from "./actions/projectMetadata.js";
|
|
3
3
|
export * from "./actions/suckerPairs.js";
|
|
4
|
+
export * from "./activityGroups.js";
|
|
4
5
|
export * from "./constants.js";
|
|
5
6
|
export * from "./contracts.js";
|
|
6
7
|
export * from "./generated/juicebox.js";
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./actions/dataHook.js"), exports);
|
|
18
18
|
__exportStar(require("./actions/projectMetadata.js"), exports);
|
|
19
19
|
__exportStar(require("./actions/suckerPairs.js"), exports);
|
|
20
|
+
__exportStar(require("./activityGroups.js"), exports);
|
|
20
21
|
__exportStar(require("./constants.js"), exports);
|
|
21
22
|
__exportStar(require("./contracts.js"), exports);
|
|
22
23
|
__exportStar(require("./generated/juicebox.js"), exports);
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,+DAA6C;AAC7C,2DAAyC;AACzC,iDAA+B;AAC/B,iDAA+B;AAC/B,0DAAwC;AACxC,gDAA8B;AAC9B,6CAA2B;AAC3B,mDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,+DAA6C;AAC7C,2DAAyC;AACzC,sDAAoC;AACpC,iDAA+B;AAC/B,iDAA+B;AAC/B,0DAAwC;AACxC,gDAA8B;AAC9B,6CAA2B;AAC3B,mDAAiC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fold matching project activity across distinct chains, preserving input order
|
|
3
|
+
* and the first representative value. The caller supplies the display signature,
|
|
4
|
+
* including actor identity, after same-transaction grouping and filtering.
|
|
5
|
+
*
|
|
6
|
+
* Each row joins the first matching group within six hours of that group's first
|
|
7
|
+
* row, provided its chain is not already present. Every original chain/hash link
|
|
8
|
+
* is retained. This display heuristic does not prove shared transaction intent
|
|
9
|
+
* or membership in a Relayr bundle.
|
|
10
|
+
*/
|
|
11
|
+
export declare function mergeCrossChainActivityGroups<T>(rows: readonly {
|
|
12
|
+
value: T;
|
|
13
|
+
signature: string;
|
|
14
|
+
chainId: number;
|
|
15
|
+
txHash: string;
|
|
16
|
+
timestamp: number;
|
|
17
|
+
}[]): {
|
|
18
|
+
value: T;
|
|
19
|
+
chains: {
|
|
20
|
+
chainId: number;
|
|
21
|
+
txHash: string;
|
|
22
|
+
}[];
|
|
23
|
+
}[];
|
|
24
|
+
//# sourceMappingURL=activityGroups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activityGroups.d.ts","sourceRoot":"","sources":["../../src/activityGroups.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAC7C,IAAI,EAAE,SAAS;IACb,KAAK,EAAE,CAAC,CAAC;IACT,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,EAAE,GACF;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,EAAE,CA0B/D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Display matching may span six hours of chain confirmation delays. Timestamps are seconds. */
|
|
2
|
+
const CROSS_CHAIN_MERGE_WINDOW = 6 * 3600;
|
|
3
|
+
/**
|
|
4
|
+
* Fold matching project activity across distinct chains, preserving input order
|
|
5
|
+
* and the first representative value. The caller supplies the display signature,
|
|
6
|
+
* including actor identity, after same-transaction grouping and filtering.
|
|
7
|
+
*
|
|
8
|
+
* Each row joins the first matching group within six hours of that group's first
|
|
9
|
+
* row, provided its chain is not already present. Every original chain/hash link
|
|
10
|
+
* is retained. This display heuristic does not prove shared transaction intent
|
|
11
|
+
* or membership in a Relayr bundle.
|
|
12
|
+
*/
|
|
13
|
+
export function mergeCrossChainActivityGroups(rows) {
|
|
14
|
+
const merged = [];
|
|
15
|
+
for (const row of rows) {
|
|
16
|
+
const host = merged.find((entry) => entry.signature === row.signature &&
|
|
17
|
+
Math.abs(entry.timestamp - row.timestamp) <= CROSS_CHAIN_MERGE_WINDOW &&
|
|
18
|
+
!entry.chains.some((chain) => chain.chainId === row.chainId));
|
|
19
|
+
if (host) {
|
|
20
|
+
host.chains.push({ chainId: row.chainId, txHash: row.txHash });
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
merged.push({
|
|
24
|
+
value: row.value,
|
|
25
|
+
signature: row.signature,
|
|
26
|
+
timestamp: row.timestamp,
|
|
27
|
+
chains: [{ chainId: row.chainId, txHash: row.txHash }],
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return merged.map(({ value, chains }) => ({ value, chains }));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=activityGroups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activityGroups.js","sourceRoot":"","sources":["../../src/activityGroups.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,MAAM,wBAAwB,GAAG,CAAC,GAAG,IAAI,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,UAAU,6BAA6B,CAC3C,IAMG;IAEH,MAAM,MAAM,GAKN,EAAE,CAAC;IACT,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CACtB,CAAC,KAAK,EAAE,EAAE,CACR,KAAK,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS;YACjC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC,IAAI,wBAAwB;YACrE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC,CAC/D,CAAC;QACF,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,GAAG,CAAC,KAAK;gBAChB,SAAS,EAAE,GAAG,CAAC,SAAS;gBACxB,SAAS,EAAE,GAAG,CAAC,SAAS;gBACxB,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;aACvD,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;AAChE,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./actions/dataHook.js";
|
|
2
2
|
export * from "./actions/projectMetadata.js";
|
|
3
3
|
export * from "./actions/suckerPairs.js";
|
|
4
|
+
export * from "./activityGroups.js";
|
|
4
5
|
export * from "./constants.js";
|
|
5
6
|
export * from "./contracts.js";
|
|
6
7
|
export * from "./generated/juicebox.js";
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./actions/dataHook.js";
|
|
2
2
|
export * from "./actions/projectMetadata.js";
|
|
3
3
|
export * from "./actions/suckerPairs.js";
|
|
4
|
+
export * from "./activityGroups.js";
|
|
4
5
|
export * from "./constants.js";
|
|
5
6
|
export * from "./contracts.js";
|
|
6
7
|
export * from "./generated/juicebox.js";
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|