@shelby-protocol/sdk 0.0.6 → 0.0.8

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 (48) hide show
  1. package/dist/browser/index.d.ts +3 -3
  2. package/dist/browser/index.mjs +21 -14
  3. package/dist/chunk-67F5YZ25.mjs +28 -0
  4. package/dist/{chunk-HDYY6NS4.mjs → chunk-BBOG5JSX.mjs} +71 -4
  5. package/dist/chunk-CPNZAQVY.mjs +29 -0
  6. package/dist/{chunk-FIFKKWXV.mjs → chunk-GY5DCVVL.mjs} +1 -1
  7. package/dist/{chunk-2JMRK5PM.mjs → chunk-LGNWAXBG.mjs} +1 -1
  8. package/dist/{chunk-CQZZRXA6.mjs → chunk-MGAN2SBA.mjs} +83 -7
  9. package/dist/{chunk-APML3CGJ.mjs → chunk-NLPIHQ7K.mjs} +17 -44
  10. package/dist/{chunk-3ZDXWPYC.mjs → chunk-PZF2VTGP.mjs} +5 -0
  11. package/dist/{chunk-7P3P3D3X.mjs → chunk-QRGZJBAG.mjs} +1 -1
  12. package/dist/chunk-XNEIWM4O.mjs +0 -0
  13. package/dist/{chunk-PCNLFNAT.mjs → chunk-XWAPNLU6.mjs} +39 -13
  14. package/dist/{clay-codes-Ce9EmXfa.d.ts → clay-codes-pdZFxI_B.d.ts} +7 -0
  15. package/dist/core/chunk.mjs +1 -2
  16. package/dist/core/clients/ShelbyBlobClient.d.ts +51 -3
  17. package/dist/core/clients/ShelbyBlobClient.mjs +7 -4
  18. package/dist/core/clients/ShelbyClient.d.ts +40 -1
  19. package/dist/core/clients/ShelbyClient.mjs +10 -7
  20. package/dist/core/clients/ShelbyClientConfig.d.ts +2 -0
  21. package/dist/core/clients/ShelbyRPCClient.mjs +3 -4
  22. package/dist/core/clients/index.d.ts +1 -1
  23. package/dist/core/clients/index.mjs +10 -7
  24. package/dist/core/commitments.d.ts +30 -29
  25. package/dist/core/commitments.mjs +6 -5
  26. package/dist/core/erasure/clay-codes.d.ts +1 -1
  27. package/dist/core/erasure/clay-codes.mjs +2 -2
  28. package/dist/core/erasure/default.d.ts +1 -1
  29. package/dist/core/erasure/default.mjs +3 -2
  30. package/dist/core/erasure/index.d.ts +1 -1
  31. package/dist/core/erasure/index.mjs +8 -4
  32. package/dist/core/erasure/provider.d.ts +1 -1
  33. package/dist/core/erasure/reed-solomon.d.ts +1 -1
  34. package/dist/core/erasure/reed-solomon.mjs +1 -1
  35. package/dist/core/erasure/utils.d.ts +1 -1
  36. package/dist/core/index.d.ts +3 -3
  37. package/dist/core/index.mjs +21 -14
  38. package/dist/core/layout.mjs +2 -3
  39. package/dist/core/types/blobs.d.ts +19 -2
  40. package/dist/core/types/encodings.d.ts +1 -1
  41. package/dist/core/types/index.d.ts +2 -2
  42. package/dist/node/clients/ShelbyNodeClient.d.ts +1 -1
  43. package/dist/node/clients/ShelbyNodeClient.mjs +11 -8
  44. package/dist/node/clients/index.d.ts +1 -1
  45. package/dist/node/clients/index.mjs +11 -8
  46. package/dist/node/index.d.ts +3 -3
  47. package/dist/node/index.mjs +22 -15
  48. package/package.json +2 -2
@@ -8,6 +8,7 @@ declare class ReedSolomonErasureCodingProvider implements ErasureCodingProvider
8
8
  constructor(options?: ReedSolomonProviderOptions);
9
9
  encode(data: Uint8Array): ChunkCollection;
10
10
  decode(_available: Uint8Array[], _config: DecodeConfig): ChunkCollection;
11
+ getChunkMerkleRoots(): Uint8Array[];
11
12
  }
12
13
 
13
14
  /**
@@ -72,6 +73,10 @@ interface ErasureCodingProvider {
72
73
  * @throws Error if fewer than k chunks are available
73
74
  */
74
75
  decode(available: Uint8Array[], config: DecodeConfig): ChunkCollection;
76
+ /**
77
+ * Get chunk roots.
78
+ */
79
+ getChunkMerkleRoots(): Uint8Array[];
75
80
  }
76
81
 
77
82
  interface ClayConfig extends ErasureCodingConfig, ClayErasureCodeParams {
@@ -107,6 +112,7 @@ declare class ClayErasureCodingProvider implements ErasureCodingProvider {
107
112
  readonly config: ClayConfig;
108
113
  private encoderCache?;
109
114
  private decoderCache?;
115
+ private lastFunction;
110
116
  private constructor();
111
117
  /**
112
118
  * Static factory method to create an initialized ClayErasureCodingProvider
@@ -114,6 +120,7 @@ declare class ClayErasureCodingProvider implements ErasureCodingProvider {
114
120
  static create<T extends ClayProviderOptions>(options?: T): Promise<ClayErasureCodingProvider>;
115
121
  encode(data: Uint8Array): ChunkCollection;
116
122
  decode(available: Uint8Array[], config: ClayDecodeConfig): ChunkCollection;
123
+ getChunkMerkleRoots(): Uint8Array[];
117
124
  /**
118
125
  * Determines if data can be erasure coded as-is or requires padding.
119
126
  *
@@ -4,8 +4,7 @@ import {
4
4
  DEFAULT_CHUNKSET_SIZE_BYTES,
5
5
  DEFAULT_CHUNK_SIZE_BYTES,
6
6
  ERASURE_CODE_AND_CHUNK_MAPPING
7
- } from "../chunk-APML3CGJ.mjs";
8
- import "../chunk-3ZDXWPYC.mjs";
7
+ } from "../chunk-67F5YZ25.mjs";
9
8
  import "../chunk-ZPW742E7.mjs";
10
9
  import "../chunk-7P6ASYW6.mjs";
11
10
  export {
@@ -1,11 +1,11 @@
1
1
  import { Aptos, AccountAddress, AccountAddressInput, Account, InputGenerateTransactionOptions, PendingTransactionResponse, InputGenerateTransactionPayloadData } from '@aptos-labs/ts-sdk';
2
2
  import { BlobName } from '../layout.js';
3
- import { BlobMetadata, BlobActivity } from '../types/blobs.js';
3
+ import { BlobMetadata, BlobActivity, StorageProviderAck } from '../types/blobs.js';
4
4
  import { ShelbyIndexerClient } from '../operations/index.js';
5
5
  import { Blobs_Order_By, Blobs_Bool_Exp, Blob_Activities_Bool_Exp, Blob_Activities_Order_By } from '../operations/generated/sdk.js';
6
6
  import { ShelbyClientConfig } from './ShelbyClientConfig.js';
7
7
  import 'zod';
8
- import '../../clay-codes-Ce9EmXfa.js';
8
+ import '../../clay-codes-pdZFxI_B.js';
9
9
  import '@shelby-protocol/clay-codes';
10
10
  import 'graphql-request';
11
11
  import 'graphql';
@@ -17,6 +17,11 @@ interface WriteBlobCommitmentsOptions {
17
17
  };
18
18
  chunksetSizeBytes?: number;
19
19
  }
20
+ interface AckTransactionOptions {
21
+ build?: {
22
+ options?: InputGenerateTransactionOptions;
23
+ };
24
+ }
20
25
  declare class ShelbyBlobClient {
21
26
  readonly aptos: Aptos;
22
27
  readonly deployer: AccountAddress;
@@ -185,6 +190,42 @@ declare class ShelbyBlobClient {
185
190
  }): Promise<{
186
191
  transaction: PendingTransactionResponse;
187
192
  }>;
193
+ /**
194
+ * Acks the blob chunksets on-chain. If each chunkset meets the necessary threshold, the entire blob will be marked as written.
195
+ *
196
+ * @param params.account - The account that is signing the transaction.
197
+ * @param params.blobOwner - The account that owns the blob.
198
+ * @param params.blobName - The name of the blob (e.g. "foo/bar")
199
+ * @param params.creationMicros - The creation time of the blob in microseconds.
200
+ * @param params.chunksetIdx - The index of the chunkset being acknowledged.
201
+ * @param params.storageProviderChunksetAcks - The signatures
202
+ * @param params.options - Additional options for transaction building and encoding.
203
+ *
204
+ * @returns The blob commitments and the pending transaction.
205
+ *
206
+ * @example
207
+ * ```typescript
208
+ * const { transaction } = await client.addChunksetAcknowledgements({
209
+ * account: signer,
210
+ * blobOwner: owner,
211
+ * blobName: "foo/bar.txt",
212
+ * creationMicros, // Taken from the blob metadata at registration time.
213
+ * chunksetIdx,
214
+ * storageProviderAcks: An array of StorageProviderAck types, each having the slot index and signature from the SP.
215
+ * });
216
+ * ```
217
+ */
218
+ addChunksetAcknowledgements(params: {
219
+ account: Account;
220
+ blobOwner: AccountAddress;
221
+ blobName: BlobName;
222
+ creationMicros: number;
223
+ chunksetIdx: number;
224
+ storageProviderAcks: StorageProviderAck[];
225
+ options?: AckTransactionOptions;
226
+ }): Promise<{
227
+ transaction: PendingTransactionResponse;
228
+ }>;
188
229
  /**
189
230
  * Registers multiple blobs on the blockchain by writing their merkle roots and metadata.
190
231
  *
@@ -298,6 +339,13 @@ declare class ShelbyBlobClient {
298
339
  deployer?: AccountAddress;
299
340
  blobNameSuffix: string;
300
341
  }): InputGenerateTransactionPayloadData;
342
+ static createChunksetAcknowledgementsPayload(params: {
343
+ blobOwner: AccountAddress;
344
+ blobName: BlobName;
345
+ creationMicros: number;
346
+ chunksetIdx: number;
347
+ storageProviderAcks: StorageProviderAck[];
348
+ }): InputGenerateTransactionPayloadData;
301
349
  }
302
350
 
303
- export { ShelbyBlobClient, type WriteBlobCommitmentsOptions };
351
+ export { type AckTransactionOptions, ShelbyBlobClient, type WriteBlobCommitmentsOptions };
@@ -1,15 +1,18 @@
1
1
  import {
2
2
  ShelbyBlobClient
3
- } from "../../chunk-HDYY6NS4.mjs";
3
+ } from "../../chunk-BBOG5JSX.mjs";
4
+ import "../../chunk-XNEIWM4O.mjs";
5
+ import "../../chunk-PZF2VTGP.mjs";
4
6
  import "../../chunk-HFGEQP5N.mjs";
5
7
  import "../../chunk-WJKSPJSS.mjs";
6
8
  import "../../chunk-RBFWGDMY.mjs";
9
+ import "../../chunk-CPNZAQVY.mjs";
10
+ import "../../chunk-NLPIHQ7K.mjs";
7
11
  import "../../chunk-OTBLZL2S.mjs";
8
- import "../../chunk-PCNLFNAT.mjs";
12
+ import "../../chunk-XWAPNLU6.mjs";
9
13
  import "../../chunk-4JZO2D7T.mjs";
10
14
  import "../../chunk-SEXQTDX6.mjs";
11
- import "../../chunk-APML3CGJ.mjs";
12
- import "../../chunk-3ZDXWPYC.mjs";
15
+ import "../../chunk-67F5YZ25.mjs";
13
16
  import "../../chunk-ZPW742E7.mjs";
14
17
  import "../../chunk-7P6ASYW6.mjs";
15
18
  export {
@@ -1,7 +1,7 @@
1
1
  import { WriteBlobCommitmentsOptions, ShelbyBlobClient } from './ShelbyBlobClient.js';
2
2
  import { Aptos, Account, AccountAddressInput } from '@aptos-labs/ts-sdk';
3
3
  import { ShelbyBlob } from '../blobs.js';
4
- import { a as ErasureCodingProvider } from '../../clay-codes-Ce9EmXfa.js';
4
+ import { a as ErasureCodingProvider } from '../../clay-codes-pdZFxI_B.js';
5
5
  import { BlobName } from '../layout.js';
6
6
  import { ShelbyClientConfig } from './ShelbyClientConfig.js';
7
7
  import { ShelbyRPCClient } from './ShelbyRPCClient.js';
@@ -171,6 +171,45 @@ declare class ShelbyClient {
171
171
  end?: number;
172
172
  };
173
173
  }): Promise<ShelbyBlob>;
174
+ /**
175
+ *
176
+ * Funds an account with ShelbyUSD tokens.
177
+ *
178
+ * @param params.address - The address to fund.
179
+ * @param params.amount - The amount to fund.
180
+ * @returns The transaction hash of the funded account.
181
+ *
182
+ * @example
183
+ * ```typescript
184
+ * const hash = await client.fundAccountWithShelbyUSD({
185
+ * address: "0x1",
186
+ * amount: 100000000,
187
+ * });
188
+ * ```
189
+ */
190
+ fundAccountWithShelbyUSD(params: {
191
+ address: AccountAddressInput;
192
+ amount: number;
193
+ }): Promise<string>;
194
+ /**
195
+ * Fund an account with APT tokens
196
+ *
197
+ * @param params.address - The address to fund
198
+ * @param params.amount - The amount to fund
199
+ * @returns The transaction hash of the funded account
200
+ *
201
+ * @example
202
+ * ```typescript
203
+ * const hash = await client.fundAccountWithAPT({
204
+ * address: "0x1",
205
+ * amount: 100000000,
206
+ * });
207
+ * ```
208
+ */
209
+ fundAccountWithAPT(params: {
210
+ address: AccountAddressInput;
211
+ amount: number;
212
+ }): Promise<string>;
174
213
  }
175
214
 
176
215
  export { ShelbyClient, type UploadOptions };
@@ -1,19 +1,22 @@
1
1
  import {
2
2
  ShelbyClient
3
- } from "../../chunk-CQZZRXA6.mjs";
4
- import "../../chunk-7P3P3D3X.mjs";
3
+ } from "../../chunk-MGAN2SBA.mjs";
4
+ import "../../chunk-QRGZJBAG.mjs";
5
5
  import "../../chunk-I6NG5GNL.mjs";
6
- import "../../chunk-HDYY6NS4.mjs";
6
+ import "../../chunk-BBOG5JSX.mjs";
7
+ import "../../chunk-XNEIWM4O.mjs";
8
+ import "../../chunk-PZF2VTGP.mjs";
7
9
  import "../../chunk-HFGEQP5N.mjs";
8
10
  import "../../chunk-WJKSPJSS.mjs";
9
11
  import "../../chunk-RBFWGDMY.mjs";
12
+ import "../../chunk-CPNZAQVY.mjs";
13
+ import "../../chunk-NLPIHQ7K.mjs";
10
14
  import "../../chunk-OTBLZL2S.mjs";
11
- import "../../chunk-PCNLFNAT.mjs";
15
+ import "../../chunk-XWAPNLU6.mjs";
12
16
  import "../../chunk-4JZO2D7T.mjs";
13
17
  import "../../chunk-SEXQTDX6.mjs";
14
- import "../../chunk-FIFKKWXV.mjs";
15
- import "../../chunk-APML3CGJ.mjs";
16
- import "../../chunk-3ZDXWPYC.mjs";
18
+ import "../../chunk-GY5DCVVL.mjs";
19
+ import "../../chunk-67F5YZ25.mjs";
17
20
  import "../../chunk-ZPW742E7.mjs";
18
21
  import "../../chunk-7P6ASYW6.mjs";
19
22
  export {
@@ -42,6 +42,8 @@ interface ShelbyClientConfig {
42
42
  rpc?: ShelbyRPCConfig;
43
43
  /** An optional indexer configuration for GraphQL queries. If not provided, the default indexer will be used. */
44
44
  indexer?: ShelbyIndexerConfig;
45
+ /** An optional faucet URL for funding accounts. If not provided, the default faucet will be used. */
46
+ faucet?: string;
45
47
  }
46
48
 
47
49
  export type { ShelbyClientConfig, ShelbyIndexerConfig, ShelbyRPCConfig };
@@ -1,15 +1,14 @@
1
1
  import {
2
2
  ShelbyRPCClient
3
- } from "../../chunk-7P3P3D3X.mjs";
3
+ } from "../../chunk-QRGZJBAG.mjs";
4
4
  import "../../chunk-I6NG5GNL.mjs";
5
5
  import "../../chunk-HFGEQP5N.mjs";
6
6
  import "../../chunk-WJKSPJSS.mjs";
7
7
  import "../../chunk-RBFWGDMY.mjs";
8
8
  import "../../chunk-4JZO2D7T.mjs";
9
9
  import "../../chunk-SEXQTDX6.mjs";
10
- import "../../chunk-FIFKKWXV.mjs";
11
- import "../../chunk-APML3CGJ.mjs";
12
- import "../../chunk-3ZDXWPYC.mjs";
10
+ import "../../chunk-GY5DCVVL.mjs";
11
+ import "../../chunk-67F5YZ25.mjs";
13
12
  import "../../chunk-ZPW742E7.mjs";
14
13
  import "../../chunk-7P6ASYW6.mjs";
15
14
  export {
@@ -6,7 +6,7 @@ import '@aptos-labs/ts-sdk';
6
6
  import '../layout.js';
7
7
  import 'zod';
8
8
  import '../types/blobs.js';
9
- import '../../clay-codes-Ce9EmXfa.js';
9
+ import '../../clay-codes-pdZFxI_B.js';
10
10
  import '@shelby-protocol/clay-codes';
11
11
  import '../operations/index.js';
12
12
  import 'graphql-request';
@@ -1,25 +1,28 @@
1
1
  import "../../chunk-RNXGC54D.mjs";
2
2
  import {
3
3
  ShelbyClient
4
- } from "../../chunk-CQZZRXA6.mjs";
4
+ } from "../../chunk-MGAN2SBA.mjs";
5
5
  import "../../chunk-Z7RFCADT.mjs";
6
6
  import {
7
7
  ShelbyRPCClient
8
- } from "../../chunk-7P3P3D3X.mjs";
8
+ } from "../../chunk-QRGZJBAG.mjs";
9
9
  import "../../chunk-I6NG5GNL.mjs";
10
10
  import {
11
11
  ShelbyBlobClient
12
- } from "../../chunk-HDYY6NS4.mjs";
12
+ } from "../../chunk-BBOG5JSX.mjs";
13
+ import "../../chunk-XNEIWM4O.mjs";
14
+ import "../../chunk-PZF2VTGP.mjs";
13
15
  import "../../chunk-HFGEQP5N.mjs";
14
16
  import "../../chunk-WJKSPJSS.mjs";
15
17
  import "../../chunk-RBFWGDMY.mjs";
18
+ import "../../chunk-CPNZAQVY.mjs";
19
+ import "../../chunk-NLPIHQ7K.mjs";
16
20
  import "../../chunk-OTBLZL2S.mjs";
17
- import "../../chunk-PCNLFNAT.mjs";
21
+ import "../../chunk-XWAPNLU6.mjs";
18
22
  import "../../chunk-4JZO2D7T.mjs";
19
23
  import "../../chunk-SEXQTDX6.mjs";
20
- import "../../chunk-FIFKKWXV.mjs";
21
- import "../../chunk-APML3CGJ.mjs";
22
- import "../../chunk-3ZDXWPYC.mjs";
24
+ import "../../chunk-GY5DCVVL.mjs";
25
+ import "../../chunk-67F5YZ25.mjs";
23
26
  import "../../chunk-ZPW742E7.mjs";
24
27
  import "../../chunk-7P6ASYW6.mjs";
25
28
  export {
@@ -1,45 +1,39 @@
1
+ import { Hex } from '@aptos-labs/ts-sdk';
1
2
  import { z } from 'zod';
2
- import { a as ErasureCodingProvider } from '../clay-codes-Ce9EmXfa.js';
3
+ import { a as ErasureCodingProvider } from '../clay-codes-pdZFxI_B.js';
3
4
  import '@shelby-protocol/clay-codes';
4
5
 
5
6
  /**
6
7
  * Defines the schema for the commitment format in commitments.json
7
8
  * This is used for `shelby encode` and oher commands
8
9
  *
9
- * We use a k-ary merkle tree
10
- *
11
- * ```text
12
- * blob_merkle_root
13
- * / \
14
- * chunkset_root_0 chunkset_root_1
15
- * / / | \ \ / / | \ \
16
- * H(c0) ... H(c4) H(c5) ... H(c9)
10
+ * We use a binary merkle tree of the samples of the blob's chunksets.
17
11
  *
18
12
  * Definitions:
19
- * - c0...c9 = chunk_0 ... chunk_9
20
- * - H(c0) = SHA-256(c0) // TODO if this should be SHA3-256 or other hash
21
- * - chunkset_root_0 = H( H(c0) ... H(c4) )
22
- * - blob_merkle_root = H( chunkset_root_0 chunkset_root_1 )
23
- * - indicates binary concatenation
13
+ * - P = H(C0//C1) (concatenate the two children, and use H to form a parent node)
14
+ * H currently SHA256
15
+ * - If the right child doesn't exist, use zeros.
16
+ * - blob_merkle_root = the P of the final two children
17
+ * - // indicates binary concatenation
24
18
  * ```
25
19
  */
26
20
  /**
27
21
  * Represents the (serializable) commitment schema for a single chunkset.
28
22
  */
29
23
  declare const ChunksetCommitmentSchema: z.ZodEffects<z.ZodObject<{
30
- chunkset_root: z.ZodNullable<z.ZodString>;
24
+ chunkset_root: z.ZodString;
31
25
  chunk_commitments: z.ZodArray<z.ZodString, "many">;
32
26
  }, "strip", z.ZodTypeAny, {
33
- chunkset_root: string | null;
27
+ chunkset_root: string;
34
28
  chunk_commitments: string[];
35
29
  }, {
36
- chunkset_root: string | null;
30
+ chunkset_root: string;
37
31
  chunk_commitments: string[];
38
32
  }>, {
39
- chunkset_root: string | null;
33
+ chunkset_root: string;
40
34
  chunk_commitments: string[];
41
35
  }, {
42
- chunkset_root: string | null;
36
+ chunkset_root: string;
43
37
  chunk_commitments: string[];
44
38
  }>;
45
39
  type ChunksetCommitment = z.infer<typeof ChunksetCommitmentSchema>;
@@ -52,19 +46,19 @@ declare const BlobCommitmentsSchema: z.ZodEffects<z.ZodObject<{
52
46
  raw_data_size: z.ZodNumber;
53
47
  blob_merkle_root: z.ZodString;
54
48
  chunkset_commitments: z.ZodArray<z.ZodEffects<z.ZodObject<{
55
- chunkset_root: z.ZodNullable<z.ZodString>;
49
+ chunkset_root: z.ZodString;
56
50
  chunk_commitments: z.ZodArray<z.ZodString, "many">;
57
51
  }, "strip", z.ZodTypeAny, {
58
- chunkset_root: string | null;
52
+ chunkset_root: string;
59
53
  chunk_commitments: string[];
60
54
  }, {
61
- chunkset_root: string | null;
55
+ chunkset_root: string;
62
56
  chunk_commitments: string[];
63
57
  }>, {
64
- chunkset_root: string | null;
58
+ chunkset_root: string;
65
59
  chunk_commitments: string[];
66
60
  }, {
67
- chunkset_root: string | null;
61
+ chunkset_root: string;
68
62
  chunk_commitments: string[];
69
63
  }>, "many">;
70
64
  }, "strip", z.ZodTypeAny, {
@@ -72,7 +66,7 @@ declare const BlobCommitmentsSchema: z.ZodEffects<z.ZodObject<{
72
66
  raw_data_size: number;
73
67
  blob_merkle_root: string;
74
68
  chunkset_commitments: {
75
- chunkset_root: string | null;
69
+ chunkset_root: string;
76
70
  chunk_commitments: string[];
77
71
  }[];
78
72
  }, {
@@ -80,7 +74,7 @@ declare const BlobCommitmentsSchema: z.ZodEffects<z.ZodObject<{
80
74
  raw_data_size: number;
81
75
  blob_merkle_root: string;
82
76
  chunkset_commitments: {
83
- chunkset_root: string | null;
77
+ chunkset_root: string;
84
78
  chunk_commitments: string[];
85
79
  }[];
86
80
  }>, {
@@ -88,7 +82,7 @@ declare const BlobCommitmentsSchema: z.ZodEffects<z.ZodObject<{
88
82
  raw_data_size: number;
89
83
  blob_merkle_root: string;
90
84
  chunkset_commitments: {
91
- chunkset_root: string | null;
85
+ chunkset_root: string;
92
86
  chunk_commitments: string[];
93
87
  }[];
94
88
  }, {
@@ -96,7 +90,7 @@ declare const BlobCommitmentsSchema: z.ZodEffects<z.ZodObject<{
96
90
  raw_data_size: number;
97
91
  blob_merkle_root: string;
98
92
  chunkset_commitments: {
99
- chunkset_root: string | null;
93
+ chunkset_root: string;
100
94
  chunk_commitments: string[];
101
95
  }[];
102
96
  }>;
@@ -109,6 +103,13 @@ interface GenerateCommitmentsOptions {
109
103
  */
110
104
  pad?: boolean;
111
105
  }
106
+ /**
107
+ * Create the merkle root of the tree based on the hashes in the parameter. Non-existent siblings use the zero hash.
108
+ *
109
+ * @param leafHashes The hashes forming the leaves of the merkle tree.
110
+ * @returns The root of the Merkle tree.
111
+ */
112
+ declare function generateMerkleRoot(leafHashes: Hex[]): Promise<Hex>;
112
113
  /**
113
114
  * Generates the blob commitments for a given data stream.
114
115
  *
@@ -128,4 +129,4 @@ interface GenerateCommitmentsOptions {
128
129
  */
129
130
  declare function generateCommitments(provider: ErasureCodingProvider, fullData: ReadableStream<Uint8Array> | Uint8Array, onChunk?: (chunksetIdx: number, chunkIdx: number, chunkData: Uint8Array) => Promise<void> | void, options?: GenerateCommitmentsOptions): Promise<BlobCommitments>;
130
131
 
131
- export { type BlobCommitments, BlobCommitmentsSchema, type ChunksetCommitment, ChunksetCommitmentSchema, type GenerateCommitmentsOptions, expectedTotalChunksets, generateCommitments };
132
+ export { type BlobCommitments, BlobCommitmentsSchema, type ChunksetCommitment, ChunksetCommitmentSchema, type GenerateCommitmentsOptions, expectedTotalChunksets, generateCommitments, generateMerkleRoot };
@@ -2,16 +2,17 @@ import {
2
2
  BlobCommitmentsSchema,
3
3
  ChunksetCommitmentSchema,
4
4
  expectedTotalChunksets,
5
- generateCommitments
6
- } from "../chunk-PCNLFNAT.mjs";
5
+ generateCommitments,
6
+ generateMerkleRoot
7
+ } from "../chunk-XWAPNLU6.mjs";
7
8
  import "../chunk-4JZO2D7T.mjs";
8
- import "../chunk-APML3CGJ.mjs";
9
- import "../chunk-3ZDXWPYC.mjs";
9
+ import "../chunk-67F5YZ25.mjs";
10
10
  import "../chunk-ZPW742E7.mjs";
11
11
  import "../chunk-7P6ASYW6.mjs";
12
12
  export {
13
13
  BlobCommitmentsSchema,
14
14
  ChunksetCommitmentSchema,
15
15
  expectedTotalChunksets,
16
- generateCommitments
16
+ generateCommitments,
17
+ generateMerkleRoot
17
18
  };
@@ -1,2 +1,2 @@
1
1
  import '@shelby-protocol/clay-codes';
2
- export { e as ClayConfig, g as ClayDecodeConfig, f as ClayErasureCodeParams, C as ClayErasureCodingProvider, b as ClayProviderOptions } from '../../clay-codes-Ce9EmXfa.js';
2
+ export { e as ClayConfig, g as ClayDecodeConfig, f as ClayErasureCodeParams, C as ClayErasureCodingProvider, b as ClayProviderOptions } from '../../clay-codes-pdZFxI_B.js';
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ClayErasureCodingProvider
3
- } from "../../chunk-APML3CGJ.mjs";
4
- import "../../chunk-3ZDXWPYC.mjs";
3
+ } from "../../chunk-NLPIHQ7K.mjs";
4
+ import "../../chunk-67F5YZ25.mjs";
5
5
  import "../../chunk-ZPW742E7.mjs";
6
6
  import "../../chunk-7P6ASYW6.mjs";
7
7
  export {
@@ -1,4 +1,4 @@
1
- import { C as ClayErasureCodingProvider } from '../../clay-codes-Ce9EmXfa.js';
1
+ import { C as ClayErasureCodingProvider } from '../../clay-codes-pdZFxI_B.js';
2
2
  import '@shelby-protocol/clay-codes';
3
3
 
4
4
  declare function createDefaultErasureCodingProvider(): Promise<ClayErasureCodingProvider>;
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  createDefaultErasureCodingProvider
3
- } from "../../chunk-APML3CGJ.mjs";
4
- import "../../chunk-3ZDXWPYC.mjs";
3
+ } from "../../chunk-CPNZAQVY.mjs";
4
+ import "../../chunk-NLPIHQ7K.mjs";
5
+ import "../../chunk-67F5YZ25.mjs";
5
6
  import "../../chunk-ZPW742E7.mjs";
6
7
  import "../../chunk-7P6ASYW6.mjs";
7
8
  export {
@@ -1,4 +1,4 @@
1
- export { C as ClayErasureCodingProvider, D as DecodeConfig, E as ErasureCodingConfig, a as ErasureCodingProvider, R as ReedSolomonErasureCodingProvider } from '../../clay-codes-Ce9EmXfa.js';
1
+ export { C as ClayErasureCodingProvider, D as DecodeConfig, E as ErasureCodingConfig, a as ErasureCodingProvider, R as ReedSolomonErasureCodingProvider } from '../../clay-codes-pdZFxI_B.js';
2
2
  export { DEFAULT_ERASURE_D, DEFAULT_ERASURE_K, DEFAULT_ERASURE_M, DEFAULT_ERASURE_N, ERASURE_CODE_PARAMS, ErasureCodeParams, ErasureCodingScheme, ErasureSchemeParams } from './constants.js';
3
3
  export { createDefaultErasureCodingProvider } from './default.js';
4
4
  import '@shelby-protocol/clay-codes';
@@ -1,10 +1,14 @@
1
+ import "../../chunk-XNEIWM4O.mjs";
2
+ import {
3
+ ReedSolomonErasureCodingProvider
4
+ } from "../../chunk-PZF2VTGP.mjs";
1
5
  import {
2
- ClayErasureCodingProvider,
3
6
  createDefaultErasureCodingProvider
4
- } from "../../chunk-APML3CGJ.mjs";
7
+ } from "../../chunk-CPNZAQVY.mjs";
5
8
  import {
6
- ReedSolomonErasureCodingProvider
7
- } from "../../chunk-3ZDXWPYC.mjs";
9
+ ClayErasureCodingProvider
10
+ } from "../../chunk-NLPIHQ7K.mjs";
11
+ import "../../chunk-67F5YZ25.mjs";
8
12
  import {
9
13
  DEFAULT_ERASURE_D,
10
14
  DEFAULT_ERASURE_K,
@@ -1,2 +1,2 @@
1
1
  import '@shelby-protocol/clay-codes';
2
- export { D as DecodeConfig, E as ErasureCodingConfig, a as ErasureCodingProvider, I as InitConfig } from '../../clay-codes-Ce9EmXfa.js';
2
+ export { D as DecodeConfig, E as ErasureCodingConfig, a as ErasureCodingProvider, I as InitConfig } from '../../clay-codes-pdZFxI_B.js';
@@ -1,2 +1,2 @@
1
1
  import '@shelby-protocol/clay-codes';
2
- export { c as ReedSolomonConfig, R as ReedSolomonErasureCodingProvider, d as ReedSolomonProviderOptions } from '../../clay-codes-Ce9EmXfa.js';
2
+ export { c as ReedSolomonConfig, R as ReedSolomonErasureCodingProvider, d as ReedSolomonProviderOptions } from '../../clay-codes-pdZFxI_B.js';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ReedSolomonErasureCodingProvider
3
- } from "../../chunk-3ZDXWPYC.mjs";
3
+ } from "../../chunk-PZF2VTGP.mjs";
4
4
  import "../../chunk-7P6ASYW6.mjs";
5
5
  export {
6
6
  ReedSolomonErasureCodingProvider
@@ -1,4 +1,4 @@
1
- import { a as ErasureCodingProvider } from '../../clay-codes-Ce9EmXfa.js';
1
+ import { a as ErasureCodingProvider } from '../../clay-codes-pdZFxI_B.js';
2
2
  import '@shelby-protocol/clay-codes';
3
3
 
4
4
  declare function allocateAndCopy(data: Uint8Array, desiredLength: number): Uint8Array;
@@ -5,16 +5,16 @@ export { ShelbyBlobClient } from './clients/ShelbyBlobClient.js';
5
5
  export { ShelbyClient, UploadOptions } from './clients/ShelbyClient.js';
6
6
  export { ShelbyClientConfig, ShelbyIndexerConfig, ShelbyRPCConfig } from './clients/ShelbyClientConfig.js';
7
7
  export { ShelbyRPCClient } from './clients/ShelbyRPCClient.js';
8
- export { BlobCommitments, BlobCommitmentsSchema, ChunksetCommitment, ChunksetCommitmentSchema, GenerateCommitmentsOptions, expectedTotalChunksets, generateCommitments } from './commitments.js';
8
+ export { BlobCommitments, BlobCommitmentsSchema, ChunksetCommitment, ChunksetCommitmentSchema, GenerateCommitmentsOptions, expectedTotalChunksets, generateCommitments, generateMerkleRoot } from './commitments.js';
9
9
  export { DEFAULT_PROJECT_DESCRIPTION, DEFAULT_PROJECT_NAME, NetworkToShelbyBlobIndexerBaseUrl, NetworkToShelbyRPCBaseUrl, SHELBYUSD_FA_METADATA_ADDRESS, SHELBYUSD_TOKEN_ADDRESS, SHELBYUSD_TOKEN_MODULE, SHELBYUSD_TOKEN_NAME, SHELBY_DEPLOYER, TOKEN_DEPLOYER, TOKEN_OBJECT_ADDRESS } from './constants.js';
10
- export { C as ClayErasureCodingProvider, D as DecodeConfig, E as ErasureCodingConfig, a as ErasureCodingProvider, R as ReedSolomonErasureCodingProvider } from '../clay-codes-Ce9EmXfa.js';
10
+ export { C as ClayErasureCodingProvider, D as DecodeConfig, E as ErasureCodingConfig, a as ErasureCodingProvider, R as ReedSolomonErasureCodingProvider } from '../clay-codes-pdZFxI_B.js';
11
11
  export { DEFAULT_ERASURE_D, DEFAULT_ERASURE_K, DEFAULT_ERASURE_M, DEFAULT_ERASURE_N, ERASURE_CODE_PARAMS, ErasureCodeParams, ErasureCodingScheme, ErasureSchemeParams } from './erasure/constants.js';
12
12
  export { createDefaultErasureCodingProvider } from './erasure/default.js';
13
13
  export { BlobName, BlobNameSchema, ChunkKey, allChunksForBlob, roundSize } from './layout.js';
14
14
  export { ShelbyNetwork, isShelbyNetwork, shelbyNetworks } from './networks.js';
15
15
  export { ShelbyIndexerClient, createShelbyIndexerClient, getShelbyIndexerClient } from './operations/index.js';
16
16
  export { getShelbyAccountBlobsExplorerUrl, getShelbyAccountExplorerUrl, getShelbyBlobExplorerUrl } from './shelby-explorer.js';
17
- export { BlobActivity, BlobActivityType, BlobEncoding, BlobMetadata, ClayEncoding } from './types/blobs.js';
17
+ export { BlobActivity, BlobActivityType, BlobEncoding, BlobMetadata, ClayEncoding, StorageProviderAck } from './types/blobs.js';
18
18
  export { StorageProviderInfo } from './types/storage_providers.js';
19
19
  export { buildRequestUrl, concatHashes, getBlobNameSuffix, readInChunks, zeroPadBytes } from './utils.js';
20
20
  export { Bigint_Comparison_Exp, Blob_Activities, Blob_Activities_Aggregate, Blob_Activities_Aggregate_Fields, Blob_Activities_Aggregate_FieldsCountArgs, Blob_Activities_Avg_Fields, Blob_Activities_Bool_Exp, Blob_Activities_Max_Fields, Blob_Activities_Min_Fields, Blob_Activities_Order_By, Blob_Activities_Select_Column, Blob_Activities_Stddev_Fields, Blob_Activities_Stddev_Pop_Fields, Blob_Activities_Stddev_Samp_Fields, Blob_Activities_Stream_Cursor_Input, Blob_Activities_Stream_Cursor_Value_Input, Blob_Activities_Sum_Fields, Blob_Activities_Var_Pop_Fields, Blob_Activities_Var_Samp_Fields, Blob_Activities_Variance_Fields, Blobs, BlobsPlacement_Group_SlotsArgs, Blobs_Aggregate, Blobs_Aggregate_Fields, Blobs_Aggregate_FieldsCountArgs, Blobs_Avg_Fields, Blobs_Bool_Exp, Blobs_Max_Fields, Blobs_Min_Fields, Blobs_Order_By, Blobs_Select_Column, Blobs_Stddev_Fields, Blobs_Stddev_Pop_Fields, Blobs_Stddev_Samp_Fields, Blobs_Stream_Cursor_Input, Blobs_Stream_Cursor_Value_Input, Blobs_Sum_Fields, Blobs_Var_Pop_Fields, Blobs_Var_Samp_Fields, Blobs_Variance_Fields, Cursor_Ordering, Exact, GetBlobActivitiesCountDocument, GetBlobActivitiesCountQuery, GetBlobActivitiesCountQueryVariables, GetBlobActivitiesDocument, GetBlobActivitiesQuery, GetBlobActivitiesQueryVariables, GetBlobsCountDocument, GetBlobsCountQuery, GetBlobsCountQueryVariables, GetBlobsDocument, GetBlobsQuery, GetBlobsQueryVariables, Incremental, InputMaybe, MakeEmpty, MakeMaybe, MakeOptional, Maybe, Numeric_Comparison_Exp, Order_By, Placement_Group_Slots, Placement_Group_Slots_Aggregate_Order_By, Placement_Group_Slots_Avg_Order_By, Placement_Group_Slots_Bool_Exp, Placement_Group_Slots_Max_Order_By, Placement_Group_Slots_Min_Order_By, Placement_Group_Slots_Order_By, Placement_Group_Slots_Select_Column, Placement_Group_Slots_Stddev_Order_By, Placement_Group_Slots_Stddev_Pop_Order_By, Placement_Group_Slots_Stddev_Samp_Order_By, Placement_Group_Slots_Stream_Cursor_Input, Placement_Group_Slots_Stream_Cursor_Value_Input, Placement_Group_Slots_Sum_Order_By, Placement_Group_Slots_Var_Pop_Order_By, Placement_Group_Slots_Var_Samp_Order_By, Placement_Group_Slots_Variance_Order_By, Processor_Status, Processor_Status_Bool_Exp, Processor_Status_Order_By, Processor_Status_Select_Column, Processor_Status_Stream_Cursor_Input, Processor_Status_Stream_Cursor_Value_Input, Query_Root, Query_RootBlob_ActivitiesArgs, Query_RootBlob_Activities_AggregateArgs, Query_RootBlob_Activities_By_PkArgs, Query_RootBlobsArgs, Query_RootBlobs_AggregateArgs, Query_RootBlobs_By_PkArgs, Query_RootPlacement_Group_SlotsArgs, Query_RootPlacement_Group_Slots_By_PkArgs, Query_RootProcessor_StatusArgs, Scalars, Sdk, SdkFunctionWrapper, String_Comparison_Exp, Subscription_Root, Subscription_RootBlob_ActivitiesArgs, Subscription_RootBlob_Activities_AggregateArgs, Subscription_RootBlob_Activities_By_PkArgs, Subscription_RootBlob_Activities_StreamArgs, Subscription_RootBlobsArgs, Subscription_RootBlobs_AggregateArgs, Subscription_RootBlobs_By_PkArgs, Subscription_RootBlobs_StreamArgs, Subscription_RootPlacement_Group_SlotsArgs, Subscription_RootPlacement_Group_Slots_By_PkArgs, Subscription_RootPlacement_Group_Slots_StreamArgs, Subscription_RootProcessor_StatusArgs, Subscription_RootProcessor_Status_StreamArgs, Timestamp_Comparison_Exp, getSdk } from './operations/generated/sdk.js';