@xyo-network/payload-utils 7.0.5 → 7.0.7
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 +1 -47
- package/dist/neutral/index.d.ts +5 -1
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +2 -38
- package/dist/neutral/index.mjs.map +3 -3
- package/package.json +15 -21
- package/dist/neutral/combinationsBySchema.d.ts +0 -9
- package/dist/neutral/combinationsBySchema.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,49 +1,3 @@
|
|
|
1
|
-
[![logo][]](https://xyo.network)
|
|
2
|
-
|
|
3
1
|
# @xyo-network/payload-utils
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
[![license][license-badge]][license-link]
|
|
7
|
-
|
|
8
|
-
> Primary SDK for using XYO Protocol 2.0
|
|
9
|
-
|
|
10
|
-
## Install
|
|
11
|
-
|
|
12
|
-
Using npm:
|
|
13
|
-
|
|
14
|
-
```sh
|
|
15
|
-
npm install {{name}}
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Using yarn:
|
|
19
|
-
|
|
20
|
-
```sh
|
|
21
|
-
yarn add {{name}}
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Using pnpm:
|
|
25
|
-
|
|
26
|
-
```sh
|
|
27
|
-
pnpm add {{name}}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Using bun:
|
|
31
|
-
|
|
32
|
-
```sh
|
|
33
|
-
bun add {{name}}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
## License
|
|
38
|
-
|
|
39
|
-
See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
|
|
40
|
-
|
|
41
|
-
## Credits
|
|
42
|
-
|
|
43
|
-
[Made with 🔥 and ❄️ by XYO Foundation](https://xyo.network)
|
|
44
|
-
|
|
45
|
-
[npm-badge]: https://img.shields.io/npm/v/@xyo-network/payload-utils.svg
|
|
46
|
-
[npm-link]: https://www.npmjs.com/package/@xyo-network/payload-utils
|
|
47
|
-
[license-badge]: https://img.shields.io/npm/l/@xyo-network/payload-utils.svg
|
|
48
|
-
[license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
|
|
49
|
-
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
3
|
+
Deprecated compatibility stub. Use `@xyo-network/sdk-protocol/payload-utils` instead.
|
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use `@xyo-network/sdk-protocol/payload-utils` instead.
|
|
3
|
+
* `@xyo-network/payload-utils` is a backward-compatibility re-export stub.
|
|
4
|
+
*/
|
|
5
|
+
export * from '@xyo-network/sdk-protocol/payload-utils';
|
|
2
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,yCAAyC,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -1,39 +1,3 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
|
|
3
|
-
var generateKeyForTuple = async (payloads) => {
|
|
4
|
-
await Promise.resolve();
|
|
5
|
-
return payloads.map((p) => ObjectHasher.stringifyHashFields(p)).join("|");
|
|
6
|
-
};
|
|
7
|
-
var combinationsBySchema = async (payloads, schemas) => {
|
|
8
|
-
const groupedPayloads = Object.fromEntries(schemas.map((schema) => [schema, []]));
|
|
9
|
-
for (const payload of payloads) {
|
|
10
|
-
if (schemas.includes(payload.schema)) {
|
|
11
|
-
groupedPayloads[payload.schema].push(payload);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
const seen = /* @__PURE__ */ new Set();
|
|
15
|
-
let combinations = [[]];
|
|
16
|
-
for (const schema of schemas) {
|
|
17
|
-
const newCombinations = [];
|
|
18
|
-
for (const combination of combinations) {
|
|
19
|
-
for (const payload of groupedPayloads[schema]) {
|
|
20
|
-
const newPerm = [...combination, payload];
|
|
21
|
-
if (newPerm.length === schemas.length) {
|
|
22
|
-
const serialized = await generateKeyForTuple(newPerm);
|
|
23
|
-
if (!seen.has(serialized)) {
|
|
24
|
-
seen.add(serialized);
|
|
25
|
-
newCombinations.push(newPerm);
|
|
26
|
-
}
|
|
27
|
-
} else {
|
|
28
|
-
newCombinations.push(newPerm);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
combinations = newCombinations;
|
|
33
|
-
}
|
|
34
|
-
return combinations;
|
|
35
|
-
};
|
|
36
|
-
export {
|
|
37
|
-
combinationsBySchema
|
|
38
|
-
};
|
|
1
|
+
// src/index.ts
|
|
2
|
+
export * from "@xyo-network/sdk-protocol/payload-utils";
|
|
39
3
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @deprecated Use `@xyo-network/sdk-protocol/payload-utils` instead.\n * `@xyo-network/payload-utils` is a backward-compatibility re-export stub.\n */\nexport * from '@xyo-network/sdk-protocol/payload-utils'\n"],
|
|
5
|
+
"mappings": ";AAIA,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/payload-utils",
|
|
3
|
-
"version": "7.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "7.0.7",
|
|
4
|
+
"description": "DEPRECATED - use @xyo-network/sdk-protocol/payload-utils. Backward-compatibility re-export stub for @xyo-network/payload-utils.",
|
|
5
|
+
"deprecated": "Use @xyo-network/sdk-protocol/payload-utils instead. @xyo-network/payload-utils is a backward-compatibility re-export stub and will not receive further updates.",
|
|
5
6
|
"homepage": "https://xyo.network",
|
|
6
7
|
"bugs": {
|
|
7
8
|
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues",
|
|
@@ -34,39 +35,32 @@
|
|
|
34
35
|
"README.md"
|
|
35
36
|
],
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"@xyo-network/
|
|
38
|
-
"@xyo-network/hash": "~7.0.5"
|
|
38
|
+
"@xyo-network/sdk-protocol": "~7.0.7"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"@scure/base": "~2.2.0",
|
|
44
|
-
"@xylabs/sdk": "^7.0.1",
|
|
45
|
-
"@xylabs/threads": "~7.0.1",
|
|
46
|
-
"@xylabs/toolchain": "~8.5.3",
|
|
47
|
-
"@xylabs/tsconfig": "~8.5.3",
|
|
48
|
-
"@xylabs/vitest-extended": "^7.0.1",
|
|
49
|
-
"async-mutex": "^0.5.0",
|
|
41
|
+
"@xylabs/toolchain": "~8.5.13",
|
|
42
|
+
"@xylabs/tsconfig": "~8.5.13",
|
|
50
43
|
"browserslist": "4.28.4",
|
|
51
|
-
"debug": "^4.4.3",
|
|
52
44
|
"eslint": "^10.6.0",
|
|
53
45
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
54
|
-
"
|
|
55
|
-
"observable-fns": "^0.6.1",
|
|
56
|
-
"typescript": "~6.0.3",
|
|
57
|
-
"vite": "^8.1.0",
|
|
58
|
-
"vitest": "~4.1.9",
|
|
59
|
-
"zod": "^4.4.3"
|
|
46
|
+
"typescript": "~6.0.3"
|
|
60
47
|
},
|
|
61
48
|
"peerDependencies": {
|
|
49
|
+
"@ariestools/sdk": "^7.0.4",
|
|
50
|
+
"@bitauth/libauth": "~3.0",
|
|
51
|
+
"@noble/post-quantum": "~0.6.1",
|
|
62
52
|
"@opentelemetry/api": "^1.9",
|
|
63
53
|
"@opentelemetry/sdk-trace-base": "^2.7",
|
|
64
54
|
"@scure/base": "~2.2",
|
|
65
|
-
"@
|
|
55
|
+
"@scure/bip39": "~2.2",
|
|
56
|
+
"@xylabs/geo": "^7.0",
|
|
66
57
|
"@xylabs/threads": "^7.0",
|
|
58
|
+
"ajv": "^8.20",
|
|
67
59
|
"async-mutex": "^0.5",
|
|
68
60
|
"debug": "^4.4",
|
|
61
|
+
"ethers": "^6.16",
|
|
69
62
|
"hash-wasm": "~4.12",
|
|
63
|
+
"idb": "^8.0",
|
|
70
64
|
"observable-fns": "^0.6",
|
|
71
65
|
"zod": "^4.4"
|
|
72
66
|
},
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Payload } from '@xyo-network/payload-model';
|
|
2
|
-
/**
|
|
3
|
-
* Returns the unique combinations of payloads for the given schemas
|
|
4
|
-
* @param payloads An array of payloads
|
|
5
|
-
* @param schemas An array of schemas
|
|
6
|
-
* @returns An array of unique combinations of payloads
|
|
7
|
-
*/
|
|
8
|
-
export declare const combinationsBySchema: (payloads: Payload[], schemas: string[]) => Promise<Payload[][]>;
|
|
9
|
-
//# sourceMappingURL=combinationsBySchema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combinationsBySchema.d.ts","sourceRoot":"","sources":["../../src/combinationsBySchema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAazD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAU,UAAU,OAAO,EAAE,EAAE,SAAS,MAAM,EAAE,KAAG,OAAO,CAAC,OAAO,EAAE,EAAE,CA8CtG,CAAA"}
|