@xyo-network/payload-utils 5.3.24 → 5.3.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.
Files changed (2) hide show
  1. package/README.md +190 -10
  2. package/package.json +16 -16
package/README.md CHANGED
@@ -1,23 +1,203 @@
1
+ [![logo][]](https://xyo.network)
2
+
1
3
  # @xyo-network/payload-utils
2
4
 
3
- [![logo][]](https://xyo.network)
5
+ [![npm][npm-badge]][npm-link]
6
+ [![license][license-badge]][license-link]
7
+
8
+ > Primary SDK for using XYO Protocol 2.0
9
+
10
+ ## Install
4
11
 
5
- Version: 5.0.2
12
+ Using npm:
6
13
 
7
- Primary SDK for using XYO Protocol 2.0
14
+ ```sh
15
+ npm install {{name}}
16
+ ```
8
17
 
9
- ## Documentation
18
+ Using yarn:
10
19
 
11
- [TypeDoc Generated Documentation](https://gitbook.xyo.network/xyo-data-lab/xyo-reference/package-documentation/xyo-network__payload-utils)
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
+ ```
12
35
 
13
- Part of [sdk-xyo-client-js](https://www.npmjs.com/package/@xyo-network/sdk-xyo-client-js)
14
36
 
15
37
  ## License
16
38
 
17
- > See the [LICENSE](LICENSE) file for license details
39
+ See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
40
+
41
+ ## Reference
42
+
43
+ ### packages
44
+
45
+ ### protocol
46
+
47
+ ### packages
48
+
49
+ ### payload
50
+
51
+ ### packages
52
+
53
+ ### utils
54
+
55
+ ### .temp-typedoc
56
+
57
+ ### functions
58
+
59
+ ### <a id="combinationsByBoundwitness"></a>combinationsByBoundwitness
60
+
61
+ [**@xyo-network/payload-utils**](#../README)
62
+
63
+ ***
64
+
65
+ ```ts
66
+ function combinationsByBoundwitness(payloads): Promise<[{
67
+ schema: "network.xyo.boundwitness" & object;
68
+ addresses: Lowercase<string> & object & object[];
69
+ payload_hashes: BrandedHash[];
70
+ payload_schemas: BrandedSchema<string>[];
71
+ previous_hashes: (BrandedHash | null)[];
72
+ $destination?: Lowercase<string> & object & object;
73
+ $sourceQuery?: BrandedHash;
74
+ $signatures: (BrandedHex | null)[];
75
+ }, ...Payload[]][]>;
76
+ ```
77
+
78
+ Returns tuples of bound witnesses and their payloads from the supplied payloads. Omits
79
+ bound witnesses where the payloads were not included in the supplied payloads.
80
+
81
+ ## Parameters
82
+
83
+ ### payloads
84
+
85
+ `Payload`[]
86
+
87
+ An array of bound witnesses and payloads
88
+
89
+ ## Returns
90
+
91
+ `Promise`\<\[\{
92
+ `schema`: `"network.xyo.boundwitness"` & `object`;
93
+ `addresses`: `Lowercase`\<`string`\> & `object` & `object`[];
94
+ `payload_hashes`: `BrandedHash`[];
95
+ `payload_schemas`: `BrandedSchema`\<`string`\>[];
96
+ `previous_hashes`: (`BrandedHash` \| `null`)[];
97
+ `$destination?`: `Lowercase`\<`string`\> & `object` & `object`;
98
+ `$sourceQuery?`: `BrandedHash`;
99
+ `$signatures`: (`BrandedHex` \| `null`)[];
100
+ \}, `...Payload[]`\][]\>
101
+
102
+ An array of tuples of bound witnesses and their payloads
103
+
104
+ ### <a id="combinationsBySchema"></a>combinationsBySchema
105
+
106
+ [**@xyo-network/payload-utils**](#../README)
107
+
108
+ ***
109
+
110
+ ```ts
111
+ function combinationsBySchema(payloads, schemas): Promise<Payload[][]>;
112
+ ```
113
+
114
+ Returns the unique combinations of payloads for the given schemas
115
+
116
+ ## Parameters
117
+
118
+ ### payloads
119
+
120
+ `Payload`[]
121
+
122
+ An array of payloads
123
+
124
+ ### schemas
125
+
126
+ `string`[]
127
+
128
+ An array of schemas
129
+
130
+ ## Returns
131
+
132
+ `Promise`\<`Payload`[][]\>
133
+
134
+ An array of unique combinations of payloads
135
+
136
+ ### <a id="intraBoundwitnessSchemaCombinations"></a>intraBoundwitnessSchemaCombinations
137
+
138
+ [**@xyo-network/payload-utils**](#../README)
139
+
140
+ ***
141
+
142
+ ```ts
143
+ function intraBoundwitnessSchemaCombinations(boundwitness, schemas): BrandedHash[][];
144
+ ```
145
+
146
+ Returns all the possible combinations of payloads for the supplied schemas within the bound witness
147
+
148
+ ## Parameters
149
+
150
+ ### boundwitness
151
+
152
+ The bound witness to search
153
+
154
+ ### schema
155
+
156
+ `"network.xyo.boundwitness"` & `object`
157
+
158
+ ### addresses
159
+
160
+ `Lowercase`\<`string`\> & `object` & `object`[]
161
+
162
+ ### payload_hashes
163
+
164
+ `BrandedHash`[]
165
+
166
+ ### payload_schemas
167
+
168
+ `BrandedSchema`\<`string`\>[]
169
+
170
+ ### previous_hashes
171
+
172
+ (`BrandedHash` \| `null`)[]
173
+
174
+ ### $destination?
175
+
176
+ `Lowercase`\<`string`\> & `object` & `object`
177
+
178
+ ### $sourceQuery?
179
+
180
+ `BrandedHash`
181
+
182
+ ### $signatures
183
+
184
+ (`BrandedHex` \| `null`)[]
185
+
186
+ ### schemas
187
+
188
+ `Schema`[]
189
+
190
+ The schemas to search for unique combinations of
191
+
192
+ ## Returns
193
+
194
+ `BrandedHash`[][]
18
195
 
19
- ## Credits
196
+ The payload hashes corresponding to the unique combinations of the supplied schemas
20
197
 
21
- [Made with 🔥 and ❄️ by XYO](https://xyo.network)
22
198
 
23
- [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
199
+ [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
200
+ [npm-badge]: https://img.shields.io/npm/v/@xyo-network/payload-utils.svg
201
+ [npm-link]: https://www.npmjs.com/package/@xyo-network/payload-utils
202
+ [license-badge]: https://img.shields.io/npm/l/@xyo-network/payload-utils.svg
203
+ [license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/payload-utils",
3
- "version": "5.3.24",
3
+ "version": "5.3.26",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -22,11 +22,11 @@
22
22
  "exports": {
23
23
  ".": {
24
24
  "types": "./dist/neutral/index.d.ts",
25
+ "import": "./dist/neutral/index.mjs",
25
26
  "default": "./dist/neutral/index.mjs"
26
27
  },
27
28
  "./package.json": "./package.json"
28
29
  },
29
- "module": "dist/neutral/index.mjs",
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "files": [
32
32
  "dist",
@@ -36,19 +36,19 @@
36
36
  "README.md"
37
37
  ],
38
38
  "dependencies": {
39
- "@xyo-network/boundwitness-model": "~5.3.24",
40
- "@xyo-network/hash": "~5.3.24",
41
- "@xyo-network/payload-builder": "~5.3.24",
42
- "@xyo-network/payload-model": "~5.3.24"
39
+ "@xyo-network/boundwitness-model": "~5.3.26",
40
+ "@xyo-network/hash": "~5.3.26",
41
+ "@xyo-network/payload-builder": "~5.3.26",
42
+ "@xyo-network/payload-model": "~5.3.26"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@opentelemetry/api": "^1.9.1",
46
- "@types/node": "^25.5.0",
47
- "@xylabs/sdk-js": "^5.0.93",
48
- "@xylabs/ts-scripts-common": "~7.6.16",
49
- "@xylabs/ts-scripts-pnpm": "~7.6.16",
50
- "@xylabs/tsconfig": "~7.6.16",
51
- "@xylabs/vitest-extended": "~5.0.93",
46
+ "@types/node": "^25.5.2",
47
+ "@xylabs/sdk-js": "^5.0.94",
48
+ "@xylabs/ts-scripts-common": "~7.7.5",
49
+ "@xylabs/ts-scripts-pnpm": "~7.7.5",
50
+ "@xylabs/tsconfig": "~7.7.5",
51
+ "@xylabs/vitest-extended": "~5.0.94",
52
52
  "acorn": "^8.16.0",
53
53
  "axios": "^1.14.0",
54
54
  "esbuild": "^0.28.0",
@@ -56,10 +56,10 @@
56
56
  "vite": "^8.0.3",
57
57
  "vitest": "~4.1.2",
58
58
  "zod": "^4.3.6",
59
- "@xyo-network/boundwitness-model": "~5.3.24",
60
- "@xyo-network/payload-builder": "~5.3.24",
61
- "@xyo-network/hash": "~5.3.24",
62
- "@xyo-network/payload-model": "~5.3.24"
59
+ "@xyo-network/boundwitness-model": "~5.3.26",
60
+ "@xyo-network/hash": "~5.3.26",
61
+ "@xyo-network/payload-model": "~5.3.26",
62
+ "@xyo-network/payload-builder": "~5.3.26"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "@xylabs/sdk-js": "^5",