@shelby-protocol/sdk 0.3.1 → 0.4.0
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/browser/index.d.ts +9 -9
- package/dist/browser/index.mjs +1068 -589
- package/dist/core/clients/ShelbyBlobClient.d.ts +155 -40
- package/dist/core/clients/ShelbyBlobClient.mjs +314 -112
- package/dist/core/clients/ShelbyClient.d.ts +27 -4
- package/dist/core/clients/ShelbyClient.mjs +869 -551
- package/dist/core/clients/ShelbyClientConfig.d.ts +9 -1
- package/dist/core/clients/ShelbyMetadataClient.d.ts +38 -6
- package/dist/core/clients/ShelbyMetadataClient.mjs +95 -13
- package/dist/core/clients/ShelbyMicropaymentChannelClient.d.ts +42 -0
- package/dist/core/clients/ShelbyMicropaymentChannelClient.mjs +62 -7
- package/dist/core/clients/ShelbyPlacementGroupClient.mjs +10 -7
- package/dist/core/clients/ShelbyRPCClient.d.ts +55 -66
- package/dist/core/clients/ShelbyRPCClient.mjs +344 -360
- package/dist/core/clients/index.d.ts +3 -2
- package/dist/core/clients/index.mjs +933 -551
- package/dist/core/clients/utils.mjs +1 -1
- package/dist/core/commitments.d.ts +12 -1
- package/dist/core/commitments.mjs +7 -0
- package/dist/core/constants.d.ts +1 -1
- package/dist/core/constants.mjs +1 -1
- package/dist/core/erasure/constants.d.ts +16 -1
- package/dist/core/erasure/constants.mjs +15 -1
- package/dist/core/erasure/index.d.ts +1 -1
- package/dist/core/erasure/index.mjs +15 -1
- package/dist/core/errors.d.ts +20 -1
- package/dist/core/errors.mjs +29 -0
- package/dist/core/index.d.ts +9 -9
- package/dist/core/index.mjs +1068 -589
- package/dist/core/operations/generated/sdk.d.ts +798 -42
- package/dist/core/operations/generated/sdk.mjs +93 -9
- package/dist/core/operations/index.d.ts +1 -1
- package/dist/core/operations/index.mjs +94 -10
- package/dist/core/rpc-responses.d.ts +1 -57
- package/dist/core/rpc-responses.mjs +1 -21
- package/dist/core/sp/chunk_proof.d.ts +23 -0
- package/dist/core/sp/chunk_proof.mjs +113 -0
- package/dist/core/sp/index.d.ts +3 -0
- package/dist/core/sp/index.mjs +402 -0
- package/dist/core/sp/sp_write_client.d.ts +53 -0
- package/dist/core/sp/sp_write_client.mjs +302 -0
- package/dist/core/types/blobs.d.ts +24 -5
- package/dist/core/types/blobs.mjs +24 -0
- package/dist/core/types/index.d.ts +2 -2
- package/dist/core/types/index.mjs +46 -2
- package/dist/core/types/payments.mjs +1 -1
- package/dist/core/types/storage_providers.d.ts +32 -6
- package/dist/core/types/storage_providers.mjs +22 -0
- package/dist/gen/rpc_server_pb.d.ts +295 -0
- package/dist/gen/rpc_server_pb.mjs +28 -0
- package/dist/node/clients/ShelbyNodeClient.d.ts +1 -0
- package/dist/node/clients/ShelbyNodeClient.mjs +869 -551
- package/dist/node/clients/index.d.ts +1 -0
- package/dist/node/clients/index.mjs +867 -551
- package/dist/node/index.d.ts +9 -9
- package/dist/node/index.mjs +1068 -589
- package/dist/node/parallel/commitment_worker.mjs +36 -249
- package/dist/node/parallel/commitment_worker_pool.mjs +56 -3
- package/dist/node/parallel/coverage_flush.d.ts +16 -0
- package/dist/node/parallel/coverage_flush.mjs +43 -0
- package/dist/node/parallel/default_commitment_worker_pool.mjs +56 -3
- package/dist/node/parallel/index.d.ts +1 -0
- package/dist/node/parallel/index.mjs +72 -4
- package/dist/node/parallel/parallel_commitments.mjs +56 -3
- package/dist/node/parallel/worker_pool.mjs +56 -3
- package/package.json +11 -4
|
@@ -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()`,
|
|
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()`,
|
|
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.
|