@shelby-protocol/sdk 0.3.1 → 0.4.1

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 (66) hide show
  1. package/dist/browser/index.d.ts +9 -9
  2. package/dist/browser/index.mjs +1068 -589
  3. package/dist/core/clients/ShelbyBlobClient.d.ts +155 -40
  4. package/dist/core/clients/ShelbyBlobClient.mjs +314 -112
  5. package/dist/core/clients/ShelbyClient.d.ts +27 -4
  6. package/dist/core/clients/ShelbyClient.mjs +869 -551
  7. package/dist/core/clients/ShelbyClientConfig.d.ts +9 -1
  8. package/dist/core/clients/ShelbyMetadataClient.d.ts +38 -6
  9. package/dist/core/clients/ShelbyMetadataClient.mjs +95 -13
  10. package/dist/core/clients/ShelbyMicropaymentChannelClient.d.ts +42 -0
  11. package/dist/core/clients/ShelbyMicropaymentChannelClient.mjs +62 -7
  12. package/dist/core/clients/ShelbyPlacementGroupClient.mjs +10 -7
  13. package/dist/core/clients/ShelbyRPCClient.d.ts +55 -66
  14. package/dist/core/clients/ShelbyRPCClient.mjs +344 -360
  15. package/dist/core/clients/index.d.ts +3 -2
  16. package/dist/core/clients/index.mjs +933 -551
  17. package/dist/core/clients/utils.mjs +1 -1
  18. package/dist/core/commitments.d.ts +12 -1
  19. package/dist/core/commitments.mjs +7 -0
  20. package/dist/core/constants.d.ts +1 -1
  21. package/dist/core/constants.mjs +1 -1
  22. package/dist/core/erasure/constants.d.ts +16 -1
  23. package/dist/core/erasure/constants.mjs +15 -1
  24. package/dist/core/erasure/index.d.ts +1 -1
  25. package/dist/core/erasure/index.mjs +15 -1
  26. package/dist/core/errors.d.ts +20 -1
  27. package/dist/core/errors.mjs +29 -0
  28. package/dist/core/index.d.ts +9 -9
  29. package/dist/core/index.mjs +1068 -589
  30. package/dist/core/operations/generated/sdk.d.ts +798 -42
  31. package/dist/core/operations/generated/sdk.mjs +93 -9
  32. package/dist/core/operations/index.d.ts +1 -1
  33. package/dist/core/operations/index.mjs +94 -10
  34. package/dist/core/rpc-responses.d.ts +1 -57
  35. package/dist/core/rpc-responses.mjs +1 -21
  36. package/dist/core/sp/chunk_proof.d.ts +23 -0
  37. package/dist/core/sp/chunk_proof.mjs +113 -0
  38. package/dist/core/sp/index.d.ts +3 -0
  39. package/dist/core/sp/index.mjs +402 -0
  40. package/dist/core/sp/sp_write_client.d.ts +53 -0
  41. package/dist/core/sp/sp_write_client.mjs +302 -0
  42. package/dist/core/types/blobs.d.ts +24 -5
  43. package/dist/core/types/blobs.mjs +24 -0
  44. package/dist/core/types/index.d.ts +2 -2
  45. package/dist/core/types/index.mjs +46 -2
  46. package/dist/core/types/payments.mjs +1 -1
  47. package/dist/core/types/storage_providers.d.ts +32 -6
  48. package/dist/core/types/storage_providers.mjs +22 -0
  49. package/dist/gen/rpc_server_pb.d.ts +295 -0
  50. package/dist/gen/rpc_server_pb.mjs +28 -0
  51. package/dist/node/clients/ShelbyNodeClient.d.ts +1 -0
  52. package/dist/node/clients/ShelbyNodeClient.mjs +869 -551
  53. package/dist/node/clients/index.d.ts +1 -0
  54. package/dist/node/clients/index.mjs +867 -551
  55. package/dist/node/index.d.ts +9 -9
  56. package/dist/node/index.mjs +1068 -589
  57. package/dist/node/parallel/commitment_worker.mjs +36 -249
  58. package/dist/node/parallel/commitment_worker_pool.mjs +56 -3
  59. package/dist/node/parallel/coverage_flush.d.ts +16 -0
  60. package/dist/node/parallel/coverage_flush.mjs +43 -0
  61. package/dist/node/parallel/default_commitment_worker_pool.mjs +56 -3
  62. package/dist/node/parallel/index.d.ts +1 -0
  63. package/dist/node/parallel/index.mjs +72 -4
  64. package/dist/node/parallel/parallel_commitments.mjs +56 -3
  65. package/dist/node/parallel/worker_pool.mjs +56 -3
  66. package/package.json +10 -3
@@ -15,6 +15,7 @@ import '../operations/generated/sdk.js';
15
15
  import 'graphql';
16
16
  import '../networks.js';
17
17
  import '../types/storage_providers.js';
18
+ import '../commitments.js';
18
19
  import '../rpc-responses.js';
19
20
  import '../types/payments.js';
20
21
 
@@ -91,6 +92,28 @@ declare class ShelbyClient {
91
92
  * This allows lazy initialization for users who don't provide a provider.
92
93
  */
93
94
  private getProvider;
95
+ /**
96
+ * Build orderless transaction options (a random replay-protection nonce) for
97
+ * the per-blob commit transactions. batchUpload finalizes blobs
98
+ * concurrently, so without orderless replay protection the parallel
99
+ * same-account submissions collide on the sequence number ("transaction
100
+ * already in mempool with a different payload"). The nonce makes each commit
101
+ * independent regardless of the client's `orderless` config flag.
102
+ */
103
+ private orderlessCommitOptions;
104
+ /**
105
+ * Resolve the on-chain UID assigned to `blobName` from a committed register
106
+ * transaction. `register_blob` only publishes the uid -> name mapping via
107
+ * `BlobRegisteredEvent` (a pending blob is not yet in the `objects` map, so it
108
+ * cannot be read back by name), so the upload flow must parse it here before
109
+ * uploading bytes or committing.
110
+ */
111
+ private uidFromRegisterTx;
112
+ /**
113
+ * Await a blob-registration transaction, rephrasing on-chain location
114
+ * failures into a human-readable message.
115
+ */
116
+ private waitForRegistration;
94
117
  /**
95
118
  * The base URL for the Shelby RPC node.
96
119
  */
@@ -102,8 +125,8 @@ declare class ShelbyClient {
102
125
  *
103
126
  * Note: This method accepts only `Uint8Array` and buffers the entire blob in memory.
104
127
  * For streaming uploads of large files (e.g. >2 GiB), orchestrate the steps manually
105
- * using `generateCommitments()`, `coordination.registerBlob()`, and `rpc.putBlob()`
106
- * with a `ReadableStream`.
128
+ * using `generateCommitments()`, `coordination.registerBlob()`, `rpc.putBlobChunksets()`,
129
+ * and `coordination.commitObject()` with a `ReadableStream`.
107
130
  *
108
131
  * @param params.blobData - The raw data to upload as a Uint8Array.
109
132
  * @param params.signer - The account that signs and pays for the transaction.
@@ -139,8 +162,8 @@ declare class ShelbyClient {
139
162
  *
140
163
  * Note: This method accepts only `Uint8Array` and buffers each blob in memory.
141
164
  * For streaming uploads of large files, orchestrate the steps manually using
142
- * `generateCommitments()`, `coordination.registerBlob()`, and `rpc.putBlob()`
143
- * with a `ReadableStream`.
165
+ * `generateCommitments()`, `coordination.registerBlob()`, `rpc.putBlobChunksets()`,
166
+ * and `coordination.commitObject()` with a `ReadableStream`.
144
167
  *
145
168
  * @param params.blobs - The blobs to upload.
146
169
  * @param params.blobs.blobData - The raw data to upload as a Uint8Array.