@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.
- 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 +10 -3
|
@@ -1,30 +1,79 @@
|
|
|
1
1
|
// src/core/operations/generated/sdk.ts
|
|
2
2
|
import gql from "graphql-tag";
|
|
3
|
+
var Blob_Activities_Constraint = /* @__PURE__ */ ((Blob_Activities_Constraint2) => {
|
|
4
|
+
Blob_Activities_Constraint2["BlobActivitiesPkey"] = "blob_activities_pkey";
|
|
5
|
+
return Blob_Activities_Constraint2;
|
|
6
|
+
})(Blob_Activities_Constraint || {});
|
|
3
7
|
var Blob_Activities_Select_Column = /* @__PURE__ */ ((Blob_Activities_Select_Column2) => {
|
|
4
|
-
Blob_Activities_Select_Column2["BlobName"] = "blob_name";
|
|
5
8
|
Blob_Activities_Select_Column2["EventIndex"] = "event_index";
|
|
6
9
|
Blob_Activities_Select_Column2["EventType"] = "event_type";
|
|
10
|
+
Blob_Activities_Select_Column2["ObjectName"] = "object_name";
|
|
7
11
|
Blob_Activities_Select_Column2["Owner"] = "owner";
|
|
8
12
|
Blob_Activities_Select_Column2["Timestamp"] = "timestamp";
|
|
9
13
|
Blob_Activities_Select_Column2["TransactionHash"] = "transaction_hash";
|
|
10
14
|
Blob_Activities_Select_Column2["TransactionVersion"] = "transaction_version";
|
|
15
|
+
Blob_Activities_Select_Column2["Uid"] = "uid";
|
|
11
16
|
return Blob_Activities_Select_Column2;
|
|
12
17
|
})(Blob_Activities_Select_Column || {});
|
|
18
|
+
var Blob_Activities_Update_Column = /* @__PURE__ */ ((Blob_Activities_Update_Column2) => {
|
|
19
|
+
Blob_Activities_Update_Column2["EventIndex"] = "event_index";
|
|
20
|
+
Blob_Activities_Update_Column2["EventType"] = "event_type";
|
|
21
|
+
Blob_Activities_Update_Column2["ObjectName"] = "object_name";
|
|
22
|
+
Blob_Activities_Update_Column2["Owner"] = "owner";
|
|
23
|
+
Blob_Activities_Update_Column2["Timestamp"] = "timestamp";
|
|
24
|
+
Blob_Activities_Update_Column2["TransactionHash"] = "transaction_hash";
|
|
25
|
+
Blob_Activities_Update_Column2["TransactionVersion"] = "transaction_version";
|
|
26
|
+
Blob_Activities_Update_Column2["Uid"] = "uid";
|
|
27
|
+
return Blob_Activities_Update_Column2;
|
|
28
|
+
})(Blob_Activities_Update_Column || {});
|
|
29
|
+
var Blobs_Constraint = /* @__PURE__ */ ((Blobs_Constraint2) => {
|
|
30
|
+
Blobs_Constraint2["BlobsPkey"] = "blobs_pkey";
|
|
31
|
+
return Blobs_Constraint2;
|
|
32
|
+
})(Blobs_Constraint || {});
|
|
13
33
|
var Blobs_Select_Column = /* @__PURE__ */ ((Blobs_Select_Column2) => {
|
|
14
34
|
Blobs_Select_Column2["BlobCommitment"] = "blob_commitment";
|
|
15
|
-
Blobs_Select_Column2["BlobName"] = "blob_name";
|
|
16
35
|
Blobs_Select_Column2["CreatedAt"] = "created_at";
|
|
36
|
+
Blobs_Select_Column2["DeletionReason"] = "deletion_reason";
|
|
37
|
+
Blobs_Select_Column2["Encoding"] = "encoding";
|
|
38
|
+
Blobs_Select_Column2["Encryption"] = "encryption";
|
|
39
|
+
Blobs_Select_Column2["Etag"] = "etag";
|
|
17
40
|
Blobs_Select_Column2["ExpiresAt"] = "expires_at";
|
|
41
|
+
Blobs_Select_Column2["IsCommitted"] = "is_committed";
|
|
18
42
|
Blobs_Select_Column2["IsDeleted"] = "is_deleted";
|
|
19
|
-
Blobs_Select_Column2["
|
|
43
|
+
Blobs_Select_Column2["IsPersisted"] = "is_persisted";
|
|
20
44
|
Blobs_Select_Column2["NumChunksets"] = "num_chunksets";
|
|
45
|
+
Blobs_Select_Column2["ObjectName"] = "object_name";
|
|
21
46
|
Blobs_Select_Column2["Owner"] = "owner";
|
|
47
|
+
Blobs_Select_Column2["PaymentAmount"] = "payment_amount";
|
|
22
48
|
Blobs_Select_Column2["PlacementGroup"] = "placement_group";
|
|
23
49
|
Blobs_Select_Column2["Size"] = "size";
|
|
24
50
|
Blobs_Select_Column2["SliceAddress"] = "slice_address";
|
|
51
|
+
Blobs_Select_Column2["Uid"] = "uid";
|
|
25
52
|
Blobs_Select_Column2["UpdatedAt"] = "updated_at";
|
|
26
53
|
return Blobs_Select_Column2;
|
|
27
54
|
})(Blobs_Select_Column || {});
|
|
55
|
+
var Blobs_Update_Column = /* @__PURE__ */ ((Blobs_Update_Column2) => {
|
|
56
|
+
Blobs_Update_Column2["BlobCommitment"] = "blob_commitment";
|
|
57
|
+
Blobs_Update_Column2["CreatedAt"] = "created_at";
|
|
58
|
+
Blobs_Update_Column2["DeletionReason"] = "deletion_reason";
|
|
59
|
+
Blobs_Update_Column2["Encoding"] = "encoding";
|
|
60
|
+
Blobs_Update_Column2["Encryption"] = "encryption";
|
|
61
|
+
Blobs_Update_Column2["Etag"] = "etag";
|
|
62
|
+
Blobs_Update_Column2["ExpiresAt"] = "expires_at";
|
|
63
|
+
Blobs_Update_Column2["IsCommitted"] = "is_committed";
|
|
64
|
+
Blobs_Update_Column2["IsDeleted"] = "is_deleted";
|
|
65
|
+
Blobs_Update_Column2["IsPersisted"] = "is_persisted";
|
|
66
|
+
Blobs_Update_Column2["NumChunksets"] = "num_chunksets";
|
|
67
|
+
Blobs_Update_Column2["ObjectName"] = "object_name";
|
|
68
|
+
Blobs_Update_Column2["Owner"] = "owner";
|
|
69
|
+
Blobs_Update_Column2["PaymentAmount"] = "payment_amount";
|
|
70
|
+
Blobs_Update_Column2["PlacementGroup"] = "placement_group";
|
|
71
|
+
Blobs_Update_Column2["Size"] = "size";
|
|
72
|
+
Blobs_Update_Column2["SliceAddress"] = "slice_address";
|
|
73
|
+
Blobs_Update_Column2["Uid"] = "uid";
|
|
74
|
+
Blobs_Update_Column2["UpdatedAt"] = "updated_at";
|
|
75
|
+
return Blobs_Update_Column2;
|
|
76
|
+
})(Blobs_Update_Column || {});
|
|
28
77
|
var Cursor_Ordering = /* @__PURE__ */ ((Cursor_Ordering2) => {
|
|
29
78
|
Cursor_Ordering2["Asc"] = "ASC";
|
|
30
79
|
Cursor_Ordering2["Desc"] = "DESC";
|
|
@@ -39,6 +88,10 @@ var Order_By = /* @__PURE__ */ ((Order_By2) => {
|
|
|
39
88
|
Order_By2["DescNullsLast"] = "desc_nulls_last";
|
|
40
89
|
return Order_By2;
|
|
41
90
|
})(Order_By || {});
|
|
91
|
+
var Placement_Group_Slots_Constraint = /* @__PURE__ */ ((Placement_Group_Slots_Constraint2) => {
|
|
92
|
+
Placement_Group_Slots_Constraint2["PlacementGroupSlotsPkey"] = "placement_group_slots_pkey";
|
|
93
|
+
return Placement_Group_Slots_Constraint2;
|
|
94
|
+
})(Placement_Group_Slots_Constraint || {});
|
|
42
95
|
var Placement_Group_Slots_Select_Column = /* @__PURE__ */ ((Placement_Group_Slots_Select_Column2) => {
|
|
43
96
|
Placement_Group_Slots_Select_Column2["PlacementGroup"] = "placement_group";
|
|
44
97
|
Placement_Group_Slots_Select_Column2["SlotIndex"] = "slot_index";
|
|
@@ -47,27 +100,49 @@ var Placement_Group_Slots_Select_Column = /* @__PURE__ */ ((Placement_Group_Slot
|
|
|
47
100
|
Placement_Group_Slots_Select_Column2["UpdatedAt"] = "updated_at";
|
|
48
101
|
return Placement_Group_Slots_Select_Column2;
|
|
49
102
|
})(Placement_Group_Slots_Select_Column || {});
|
|
103
|
+
var Placement_Group_Slots_Update_Column = /* @__PURE__ */ ((Placement_Group_Slots_Update_Column2) => {
|
|
104
|
+
Placement_Group_Slots_Update_Column2["PlacementGroup"] = "placement_group";
|
|
105
|
+
Placement_Group_Slots_Update_Column2["SlotIndex"] = "slot_index";
|
|
106
|
+
Placement_Group_Slots_Update_Column2["Status"] = "status";
|
|
107
|
+
Placement_Group_Slots_Update_Column2["StorageProvider"] = "storage_provider";
|
|
108
|
+
Placement_Group_Slots_Update_Column2["UpdatedAt"] = "updated_at";
|
|
109
|
+
return Placement_Group_Slots_Update_Column2;
|
|
110
|
+
})(Placement_Group_Slots_Update_Column || {});
|
|
111
|
+
var Processor_Status_Constraint = /* @__PURE__ */ ((Processor_Status_Constraint2) => {
|
|
112
|
+
Processor_Status_Constraint2["ProcessorStatusPkey"] = "processor_status_pkey";
|
|
113
|
+
return Processor_Status_Constraint2;
|
|
114
|
+
})(Processor_Status_Constraint || {});
|
|
50
115
|
var Processor_Status_Select_Column = /* @__PURE__ */ ((Processor_Status_Select_Column2) => {
|
|
51
116
|
Processor_Status_Select_Column2["LastSuccessVersion"] = "last_success_version";
|
|
52
117
|
Processor_Status_Select_Column2["LastTransactionTimestamp"] = "last_transaction_timestamp";
|
|
53
118
|
Processor_Status_Select_Column2["LastUpdated"] = "last_updated";
|
|
119
|
+
Processor_Status_Select_Column2["Processor"] = "processor";
|
|
54
120
|
return Processor_Status_Select_Column2;
|
|
55
121
|
})(Processor_Status_Select_Column || {});
|
|
122
|
+
var Processor_Status_Update_Column = /* @__PURE__ */ ((Processor_Status_Update_Column2) => {
|
|
123
|
+
Processor_Status_Update_Column2["LastSuccessVersion"] = "last_success_version";
|
|
124
|
+
Processor_Status_Update_Column2["LastTransactionTimestamp"] = "last_transaction_timestamp";
|
|
125
|
+
Processor_Status_Update_Column2["LastUpdated"] = "last_updated";
|
|
126
|
+
Processor_Status_Update_Column2["Processor"] = "processor";
|
|
127
|
+
return Processor_Status_Update_Column2;
|
|
128
|
+
})(Processor_Status_Update_Column || {});
|
|
56
129
|
var GetBlobsDocument = gql`
|
|
57
130
|
query getBlobs($where: blobs_bool_exp, $orderBy: [blobs_order_by!], $limit: Int, $offset: Int) {
|
|
58
131
|
blobs(where: $where, order_by: $orderBy, limit: $limit, offset: $offset) {
|
|
132
|
+
uid
|
|
133
|
+
object_name
|
|
59
134
|
owner
|
|
60
135
|
blob_commitment
|
|
61
|
-
blob_name
|
|
62
136
|
created_at
|
|
63
137
|
expires_at
|
|
138
|
+
updated_at
|
|
64
139
|
num_chunksets
|
|
65
|
-
is_deleted
|
|
66
|
-
is_written
|
|
67
|
-
placement_group
|
|
68
140
|
size
|
|
69
|
-
updated_at
|
|
70
141
|
slice_address
|
|
142
|
+
placement_group
|
|
143
|
+
is_persisted
|
|
144
|
+
is_committed
|
|
145
|
+
is_deleted
|
|
71
146
|
}
|
|
72
147
|
}
|
|
73
148
|
`;
|
|
@@ -79,7 +154,8 @@ var GetBlobActivitiesDocument = gql`
|
|
|
79
154
|
limit: $limit
|
|
80
155
|
offset: $offset
|
|
81
156
|
) {
|
|
82
|
-
|
|
157
|
+
uid
|
|
158
|
+
object_name
|
|
83
159
|
event_index
|
|
84
160
|
event_type
|
|
85
161
|
transaction_hash
|
|
@@ -182,8 +258,12 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
182
258
|
};
|
|
183
259
|
}
|
|
184
260
|
export {
|
|
261
|
+
Blob_Activities_Constraint,
|
|
185
262
|
Blob_Activities_Select_Column,
|
|
263
|
+
Blob_Activities_Update_Column,
|
|
264
|
+
Blobs_Constraint,
|
|
186
265
|
Blobs_Select_Column,
|
|
266
|
+
Blobs_Update_Column,
|
|
187
267
|
Cursor_Ordering,
|
|
188
268
|
GetBlobActivitiesCountDocument,
|
|
189
269
|
GetBlobActivitiesDocument,
|
|
@@ -194,7 +274,11 @@ export {
|
|
|
194
274
|
GetProcessorStatusDocument,
|
|
195
275
|
GetTotalBlobsSizeDocument,
|
|
196
276
|
Order_By,
|
|
277
|
+
Placement_Group_Slots_Constraint,
|
|
197
278
|
Placement_Group_Slots_Select_Column,
|
|
279
|
+
Placement_Group_Slots_Update_Column,
|
|
280
|
+
Processor_Status_Constraint,
|
|
198
281
|
Processor_Status_Select_Column,
|
|
282
|
+
Processor_Status_Update_Column,
|
|
199
283
|
getSdk
|
|
200
284
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GraphQLClient } from 'graphql-request';
|
|
2
2
|
import { ShelbyClientConfig } from '../clients/ShelbyClientConfig.js';
|
|
3
3
|
import { GetBlobsQueryVariables, GetBlobsQuery, GetBlobActivitiesQueryVariables, GetBlobActivitiesQuery, GetBlobsCountQueryVariables, GetBlobsCountQuery, GetBlobActivitiesCountQueryVariables, GetBlobActivitiesCountQuery, GetTotalBlobsSizeQueryVariables, GetTotalBlobsSizeQuery, GetPlacementGroupSlotsQueryVariables, GetPlacementGroupSlotsQuery, GetPlacementGroupSlotsCountQueryVariables, GetPlacementGroupSlotsCountQuery, GetProcessorStatusQueryVariables, GetProcessorStatusQuery } from './generated/sdk.js';
|
|
4
|
-
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, BlobsPlacement_Group_Slots_AggregateArgs, 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, GetBlobActivitiesDocument, GetBlobsCountDocument, GetBlobsDocument, GetPlacementGroupSlotsCountDocument, GetPlacementGroupSlotsDocument, GetProcessorStatusDocument, GetTotalBlobsSizeDocument, Incremental, InputMaybe, Int_Comparison_Exp, MakeEmpty, MakeMaybe, MakeOptional, Maybe, Numeric_Comparison_Exp, Order_By, Placement_Group_Slots, Placement_Group_Slots_Aggregate, Placement_Group_Slots_Aggregate_Bool_Exp, Placement_Group_Slots_Aggregate_Bool_Exp_Count, Placement_Group_Slots_Aggregate_Fields, Placement_Group_Slots_Aggregate_FieldsCountArgs, Placement_Group_Slots_Aggregate_Order_By, Placement_Group_Slots_Avg_Fields, Placement_Group_Slots_Avg_Order_By, Placement_Group_Slots_Bool_Exp, Placement_Group_Slots_Max_Fields, Placement_Group_Slots_Max_Order_By, Placement_Group_Slots_Min_Fields, Placement_Group_Slots_Min_Order_By, Placement_Group_Slots_Order_By, Placement_Group_Slots_Select_Column, Placement_Group_Slots_Stddev_Fields, Placement_Group_Slots_Stddev_Order_By, Placement_Group_Slots_Stddev_Pop_Fields, Placement_Group_Slots_Stddev_Pop_Order_By, Placement_Group_Slots_Stddev_Samp_Fields, Placement_Group_Slots_Stddev_Samp_Order_By, Placement_Group_Slots_Stream_Cursor_Input, Placement_Group_Slots_Stream_Cursor_Value_Input, Placement_Group_Slots_Sum_Fields, Placement_Group_Slots_Sum_Order_By, Placement_Group_Slots_Var_Pop_Fields, Placement_Group_Slots_Var_Pop_Order_By, Placement_Group_Slots_Var_Samp_Fields, Placement_Group_Slots_Var_Samp_Order_By, Placement_Group_Slots_Variance_Fields, 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_AggregateArgs, 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_AggregateArgs, Subscription_RootPlacement_Group_Slots_By_PkArgs, Subscription_RootPlacement_Group_Slots_StreamArgs, Subscription_RootProcessor_StatusArgs, Subscription_RootProcessor_Status_StreamArgs, Timestamp_Comparison_Exp, getSdk } from './generated/sdk.js';
|
|
4
|
+
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_Constraint, Blob_Activities_Inc_Input, Blob_Activities_Insert_Input, Blob_Activities_Max_Fields, Blob_Activities_Min_Fields, Blob_Activities_Mutation_Response, Blob_Activities_On_Conflict, Blob_Activities_Order_By, Blob_Activities_Pk_Columns_Input, Blob_Activities_Select_Column, Blob_Activities_Set_Input, 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_Update_Column, Blob_Activities_Updates, Blob_Activities_Var_Pop_Fields, Blob_Activities_Var_Samp_Fields, Blob_Activities_Variance_Fields, Blobs, BlobsPlacement_Group_SlotsArgs, BlobsPlacement_Group_Slots_AggregateArgs, Blobs_Aggregate, Blobs_Aggregate_Fields, Blobs_Aggregate_FieldsCountArgs, Blobs_Avg_Fields, Blobs_Bool_Exp, Blobs_Constraint, Blobs_Inc_Input, Blobs_Insert_Input, Blobs_Max_Fields, Blobs_Min_Fields, Blobs_Mutation_Response, Blobs_On_Conflict, Blobs_Order_By, Blobs_Pk_Columns_Input, Blobs_Select_Column, Blobs_Set_Input, Blobs_Stddev_Fields, Blobs_Stddev_Pop_Fields, Blobs_Stddev_Samp_Fields, Blobs_Stream_Cursor_Input, Blobs_Stream_Cursor_Value_Input, Blobs_Sum_Fields, Blobs_Update_Column, Blobs_Updates, Blobs_Var_Pop_Fields, Blobs_Var_Samp_Fields, Blobs_Variance_Fields, Cursor_Ordering, Exact, GetBlobActivitiesCountDocument, GetBlobActivitiesDocument, GetBlobsCountDocument, GetBlobsDocument, GetPlacementGroupSlotsCountDocument, GetPlacementGroupSlotsDocument, GetProcessorStatusDocument, GetTotalBlobsSizeDocument, Incremental, InputMaybe, Int_Comparison_Exp, MakeEmpty, MakeMaybe, MakeOptional, Maybe, Mutation_Root, Mutation_RootDelete_Blob_ActivitiesArgs, Mutation_RootDelete_Blob_Activities_By_PkArgs, Mutation_RootDelete_BlobsArgs, Mutation_RootDelete_Blobs_By_PkArgs, Mutation_RootDelete_Placement_Group_SlotsArgs, Mutation_RootDelete_Placement_Group_Slots_By_PkArgs, Mutation_RootDelete_Processor_StatusArgs, Mutation_RootDelete_Processor_Status_By_PkArgs, Mutation_RootInsert_Blob_ActivitiesArgs, Mutation_RootInsert_Blob_Activities_OneArgs, Mutation_RootInsert_BlobsArgs, Mutation_RootInsert_Blobs_OneArgs, Mutation_RootInsert_Placement_Group_SlotsArgs, Mutation_RootInsert_Placement_Group_Slots_OneArgs, Mutation_RootInsert_Processor_StatusArgs, Mutation_RootInsert_Processor_Status_OneArgs, Mutation_RootUpdate_Blob_ActivitiesArgs, Mutation_RootUpdate_Blob_Activities_By_PkArgs, Mutation_RootUpdate_Blob_Activities_ManyArgs, Mutation_RootUpdate_BlobsArgs, Mutation_RootUpdate_Blobs_By_PkArgs, Mutation_RootUpdate_Blobs_ManyArgs, Mutation_RootUpdate_Placement_Group_SlotsArgs, Mutation_RootUpdate_Placement_Group_Slots_By_PkArgs, Mutation_RootUpdate_Placement_Group_Slots_ManyArgs, Mutation_RootUpdate_Processor_StatusArgs, Mutation_RootUpdate_Processor_Status_By_PkArgs, Mutation_RootUpdate_Processor_Status_ManyArgs, Numeric_Comparison_Exp, Order_By, Placement_Group_Slots, Placement_Group_Slots_Aggregate, Placement_Group_Slots_Aggregate_Bool_Exp, Placement_Group_Slots_Aggregate_Bool_Exp_Count, Placement_Group_Slots_Aggregate_Fields, Placement_Group_Slots_Aggregate_FieldsCountArgs, Placement_Group_Slots_Aggregate_Order_By, Placement_Group_Slots_Arr_Rel_Insert_Input, Placement_Group_Slots_Avg_Fields, Placement_Group_Slots_Avg_Order_By, Placement_Group_Slots_Bool_Exp, Placement_Group_Slots_Constraint, Placement_Group_Slots_Inc_Input, Placement_Group_Slots_Insert_Input, Placement_Group_Slots_Max_Fields, Placement_Group_Slots_Max_Order_By, Placement_Group_Slots_Min_Fields, Placement_Group_Slots_Min_Order_By, Placement_Group_Slots_Mutation_Response, Placement_Group_Slots_On_Conflict, Placement_Group_Slots_Order_By, Placement_Group_Slots_Pk_Columns_Input, Placement_Group_Slots_Select_Column, Placement_Group_Slots_Set_Input, Placement_Group_Slots_Stddev_Fields, Placement_Group_Slots_Stddev_Order_By, Placement_Group_Slots_Stddev_Pop_Fields, Placement_Group_Slots_Stddev_Pop_Order_By, Placement_Group_Slots_Stddev_Samp_Fields, Placement_Group_Slots_Stddev_Samp_Order_By, Placement_Group_Slots_Stream_Cursor_Input, Placement_Group_Slots_Stream_Cursor_Value_Input, Placement_Group_Slots_Sum_Fields, Placement_Group_Slots_Sum_Order_By, Placement_Group_Slots_Update_Column, Placement_Group_Slots_Updates, Placement_Group_Slots_Var_Pop_Fields, Placement_Group_Slots_Var_Pop_Order_By, Placement_Group_Slots_Var_Samp_Fields, Placement_Group_Slots_Var_Samp_Order_By, Placement_Group_Slots_Variance_Fields, Placement_Group_Slots_Variance_Order_By, Processor_Status, Processor_Status_Aggregate, Processor_Status_Aggregate_Fields, Processor_Status_Aggregate_FieldsCountArgs, Processor_Status_Avg_Fields, Processor_Status_Bool_Exp, Processor_Status_Constraint, Processor_Status_Inc_Input, Processor_Status_Insert_Input, Processor_Status_Max_Fields, Processor_Status_Min_Fields, Processor_Status_Mutation_Response, Processor_Status_On_Conflict, Processor_Status_Order_By, Processor_Status_Pk_Columns_Input, Processor_Status_Select_Column, Processor_Status_Set_Input, Processor_Status_Stddev_Fields, Processor_Status_Stddev_Pop_Fields, Processor_Status_Stddev_Samp_Fields, Processor_Status_Stream_Cursor_Input, Processor_Status_Stream_Cursor_Value_Input, Processor_Status_Sum_Fields, Processor_Status_Update_Column, Processor_Status_Updates, Processor_Status_Var_Pop_Fields, Processor_Status_Var_Samp_Fields, Processor_Status_Variance_Fields, 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_AggregateArgs, Query_RootPlacement_Group_Slots_By_PkArgs, Query_RootProcessor_StatusArgs, Query_RootProcessor_Status_AggregateArgs, Query_RootProcessor_Status_By_PkArgs, 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_AggregateArgs, Subscription_RootPlacement_Group_Slots_By_PkArgs, Subscription_RootPlacement_Group_Slots_StreamArgs, Subscription_RootProcessor_StatusArgs, Subscription_RootProcessor_Status_AggregateArgs, Subscription_RootProcessor_Status_By_PkArgs, Subscription_RootProcessor_Status_StreamArgs, Timestamp_Comparison_Exp, getSdk } from './generated/sdk.js';
|
|
5
5
|
import '@aptos-labs/ts-sdk';
|
|
6
6
|
import '../networks.js';
|
|
7
7
|
import 'graphql';
|
|
@@ -8,7 +8,7 @@ import { AptosConfig } from "@aptos-labs/ts-sdk";
|
|
|
8
8
|
// src/core/constants.ts
|
|
9
9
|
import { Network } from "@aptos-labs/ts-sdk";
|
|
10
10
|
var NetworkToShelbyRPCBaseUrl = {
|
|
11
|
-
[Network.SHELBYNET]: "https://
|
|
11
|
+
[Network.SHELBYNET]: "https://shelby.shelbynet.shelby.xyz/shelby",
|
|
12
12
|
[Network.NETNA]: void 0,
|
|
13
13
|
[Network.DEVNET]: void 0,
|
|
14
14
|
[Network.TESTNET]: "https://api.testnet.shelby.xyz/shelby",
|
|
@@ -67,31 +67,80 @@ var getAptosConfig = (config) => {
|
|
|
67
67
|
|
|
68
68
|
// src/core/operations/generated/sdk.ts
|
|
69
69
|
import gql from "graphql-tag";
|
|
70
|
+
var Blob_Activities_Constraint = /* @__PURE__ */ ((Blob_Activities_Constraint2) => {
|
|
71
|
+
Blob_Activities_Constraint2["BlobActivitiesPkey"] = "blob_activities_pkey";
|
|
72
|
+
return Blob_Activities_Constraint2;
|
|
73
|
+
})(Blob_Activities_Constraint || {});
|
|
70
74
|
var Blob_Activities_Select_Column = /* @__PURE__ */ ((Blob_Activities_Select_Column2) => {
|
|
71
|
-
Blob_Activities_Select_Column2["BlobName"] = "blob_name";
|
|
72
75
|
Blob_Activities_Select_Column2["EventIndex"] = "event_index";
|
|
73
76
|
Blob_Activities_Select_Column2["EventType"] = "event_type";
|
|
77
|
+
Blob_Activities_Select_Column2["ObjectName"] = "object_name";
|
|
74
78
|
Blob_Activities_Select_Column2["Owner"] = "owner";
|
|
75
79
|
Blob_Activities_Select_Column2["Timestamp"] = "timestamp";
|
|
76
80
|
Blob_Activities_Select_Column2["TransactionHash"] = "transaction_hash";
|
|
77
81
|
Blob_Activities_Select_Column2["TransactionVersion"] = "transaction_version";
|
|
82
|
+
Blob_Activities_Select_Column2["Uid"] = "uid";
|
|
78
83
|
return Blob_Activities_Select_Column2;
|
|
79
84
|
})(Blob_Activities_Select_Column || {});
|
|
85
|
+
var Blob_Activities_Update_Column = /* @__PURE__ */ ((Blob_Activities_Update_Column2) => {
|
|
86
|
+
Blob_Activities_Update_Column2["EventIndex"] = "event_index";
|
|
87
|
+
Blob_Activities_Update_Column2["EventType"] = "event_type";
|
|
88
|
+
Blob_Activities_Update_Column2["ObjectName"] = "object_name";
|
|
89
|
+
Blob_Activities_Update_Column2["Owner"] = "owner";
|
|
90
|
+
Blob_Activities_Update_Column2["Timestamp"] = "timestamp";
|
|
91
|
+
Blob_Activities_Update_Column2["TransactionHash"] = "transaction_hash";
|
|
92
|
+
Blob_Activities_Update_Column2["TransactionVersion"] = "transaction_version";
|
|
93
|
+
Blob_Activities_Update_Column2["Uid"] = "uid";
|
|
94
|
+
return Blob_Activities_Update_Column2;
|
|
95
|
+
})(Blob_Activities_Update_Column || {});
|
|
96
|
+
var Blobs_Constraint = /* @__PURE__ */ ((Blobs_Constraint2) => {
|
|
97
|
+
Blobs_Constraint2["BlobsPkey"] = "blobs_pkey";
|
|
98
|
+
return Blobs_Constraint2;
|
|
99
|
+
})(Blobs_Constraint || {});
|
|
80
100
|
var Blobs_Select_Column = /* @__PURE__ */ ((Blobs_Select_Column2) => {
|
|
81
101
|
Blobs_Select_Column2["BlobCommitment"] = "blob_commitment";
|
|
82
|
-
Blobs_Select_Column2["BlobName"] = "blob_name";
|
|
83
102
|
Blobs_Select_Column2["CreatedAt"] = "created_at";
|
|
103
|
+
Blobs_Select_Column2["DeletionReason"] = "deletion_reason";
|
|
104
|
+
Blobs_Select_Column2["Encoding"] = "encoding";
|
|
105
|
+
Blobs_Select_Column2["Encryption"] = "encryption";
|
|
106
|
+
Blobs_Select_Column2["Etag"] = "etag";
|
|
84
107
|
Blobs_Select_Column2["ExpiresAt"] = "expires_at";
|
|
108
|
+
Blobs_Select_Column2["IsCommitted"] = "is_committed";
|
|
85
109
|
Blobs_Select_Column2["IsDeleted"] = "is_deleted";
|
|
86
|
-
Blobs_Select_Column2["
|
|
110
|
+
Blobs_Select_Column2["IsPersisted"] = "is_persisted";
|
|
87
111
|
Blobs_Select_Column2["NumChunksets"] = "num_chunksets";
|
|
112
|
+
Blobs_Select_Column2["ObjectName"] = "object_name";
|
|
88
113
|
Blobs_Select_Column2["Owner"] = "owner";
|
|
114
|
+
Blobs_Select_Column2["PaymentAmount"] = "payment_amount";
|
|
89
115
|
Blobs_Select_Column2["PlacementGroup"] = "placement_group";
|
|
90
116
|
Blobs_Select_Column2["Size"] = "size";
|
|
91
117
|
Blobs_Select_Column2["SliceAddress"] = "slice_address";
|
|
118
|
+
Blobs_Select_Column2["Uid"] = "uid";
|
|
92
119
|
Blobs_Select_Column2["UpdatedAt"] = "updated_at";
|
|
93
120
|
return Blobs_Select_Column2;
|
|
94
121
|
})(Blobs_Select_Column || {});
|
|
122
|
+
var Blobs_Update_Column = /* @__PURE__ */ ((Blobs_Update_Column2) => {
|
|
123
|
+
Blobs_Update_Column2["BlobCommitment"] = "blob_commitment";
|
|
124
|
+
Blobs_Update_Column2["CreatedAt"] = "created_at";
|
|
125
|
+
Blobs_Update_Column2["DeletionReason"] = "deletion_reason";
|
|
126
|
+
Blobs_Update_Column2["Encoding"] = "encoding";
|
|
127
|
+
Blobs_Update_Column2["Encryption"] = "encryption";
|
|
128
|
+
Blobs_Update_Column2["Etag"] = "etag";
|
|
129
|
+
Blobs_Update_Column2["ExpiresAt"] = "expires_at";
|
|
130
|
+
Blobs_Update_Column2["IsCommitted"] = "is_committed";
|
|
131
|
+
Blobs_Update_Column2["IsDeleted"] = "is_deleted";
|
|
132
|
+
Blobs_Update_Column2["IsPersisted"] = "is_persisted";
|
|
133
|
+
Blobs_Update_Column2["NumChunksets"] = "num_chunksets";
|
|
134
|
+
Blobs_Update_Column2["ObjectName"] = "object_name";
|
|
135
|
+
Blobs_Update_Column2["Owner"] = "owner";
|
|
136
|
+
Blobs_Update_Column2["PaymentAmount"] = "payment_amount";
|
|
137
|
+
Blobs_Update_Column2["PlacementGroup"] = "placement_group";
|
|
138
|
+
Blobs_Update_Column2["Size"] = "size";
|
|
139
|
+
Blobs_Update_Column2["SliceAddress"] = "slice_address";
|
|
140
|
+
Blobs_Update_Column2["Uid"] = "uid";
|
|
141
|
+
Blobs_Update_Column2["UpdatedAt"] = "updated_at";
|
|
142
|
+
return Blobs_Update_Column2;
|
|
143
|
+
})(Blobs_Update_Column || {});
|
|
95
144
|
var Cursor_Ordering = /* @__PURE__ */ ((Cursor_Ordering2) => {
|
|
96
145
|
Cursor_Ordering2["Asc"] = "ASC";
|
|
97
146
|
Cursor_Ordering2["Desc"] = "DESC";
|
|
@@ -106,6 +155,10 @@ var Order_By = /* @__PURE__ */ ((Order_By2) => {
|
|
|
106
155
|
Order_By2["DescNullsLast"] = "desc_nulls_last";
|
|
107
156
|
return Order_By2;
|
|
108
157
|
})(Order_By || {});
|
|
158
|
+
var Placement_Group_Slots_Constraint = /* @__PURE__ */ ((Placement_Group_Slots_Constraint2) => {
|
|
159
|
+
Placement_Group_Slots_Constraint2["PlacementGroupSlotsPkey"] = "placement_group_slots_pkey";
|
|
160
|
+
return Placement_Group_Slots_Constraint2;
|
|
161
|
+
})(Placement_Group_Slots_Constraint || {});
|
|
109
162
|
var Placement_Group_Slots_Select_Column = /* @__PURE__ */ ((Placement_Group_Slots_Select_Column2) => {
|
|
110
163
|
Placement_Group_Slots_Select_Column2["PlacementGroup"] = "placement_group";
|
|
111
164
|
Placement_Group_Slots_Select_Column2["SlotIndex"] = "slot_index";
|
|
@@ -114,27 +167,49 @@ var Placement_Group_Slots_Select_Column = /* @__PURE__ */ ((Placement_Group_Slot
|
|
|
114
167
|
Placement_Group_Slots_Select_Column2["UpdatedAt"] = "updated_at";
|
|
115
168
|
return Placement_Group_Slots_Select_Column2;
|
|
116
169
|
})(Placement_Group_Slots_Select_Column || {});
|
|
170
|
+
var Placement_Group_Slots_Update_Column = /* @__PURE__ */ ((Placement_Group_Slots_Update_Column2) => {
|
|
171
|
+
Placement_Group_Slots_Update_Column2["PlacementGroup"] = "placement_group";
|
|
172
|
+
Placement_Group_Slots_Update_Column2["SlotIndex"] = "slot_index";
|
|
173
|
+
Placement_Group_Slots_Update_Column2["Status"] = "status";
|
|
174
|
+
Placement_Group_Slots_Update_Column2["StorageProvider"] = "storage_provider";
|
|
175
|
+
Placement_Group_Slots_Update_Column2["UpdatedAt"] = "updated_at";
|
|
176
|
+
return Placement_Group_Slots_Update_Column2;
|
|
177
|
+
})(Placement_Group_Slots_Update_Column || {});
|
|
178
|
+
var Processor_Status_Constraint = /* @__PURE__ */ ((Processor_Status_Constraint2) => {
|
|
179
|
+
Processor_Status_Constraint2["ProcessorStatusPkey"] = "processor_status_pkey";
|
|
180
|
+
return Processor_Status_Constraint2;
|
|
181
|
+
})(Processor_Status_Constraint || {});
|
|
117
182
|
var Processor_Status_Select_Column = /* @__PURE__ */ ((Processor_Status_Select_Column2) => {
|
|
118
183
|
Processor_Status_Select_Column2["LastSuccessVersion"] = "last_success_version";
|
|
119
184
|
Processor_Status_Select_Column2["LastTransactionTimestamp"] = "last_transaction_timestamp";
|
|
120
185
|
Processor_Status_Select_Column2["LastUpdated"] = "last_updated";
|
|
186
|
+
Processor_Status_Select_Column2["Processor"] = "processor";
|
|
121
187
|
return Processor_Status_Select_Column2;
|
|
122
188
|
})(Processor_Status_Select_Column || {});
|
|
189
|
+
var Processor_Status_Update_Column = /* @__PURE__ */ ((Processor_Status_Update_Column2) => {
|
|
190
|
+
Processor_Status_Update_Column2["LastSuccessVersion"] = "last_success_version";
|
|
191
|
+
Processor_Status_Update_Column2["LastTransactionTimestamp"] = "last_transaction_timestamp";
|
|
192
|
+
Processor_Status_Update_Column2["LastUpdated"] = "last_updated";
|
|
193
|
+
Processor_Status_Update_Column2["Processor"] = "processor";
|
|
194
|
+
return Processor_Status_Update_Column2;
|
|
195
|
+
})(Processor_Status_Update_Column || {});
|
|
123
196
|
var GetBlobsDocument = gql`
|
|
124
197
|
query getBlobs($where: blobs_bool_exp, $orderBy: [blobs_order_by!], $limit: Int, $offset: Int) {
|
|
125
198
|
blobs(where: $where, order_by: $orderBy, limit: $limit, offset: $offset) {
|
|
199
|
+
uid
|
|
200
|
+
object_name
|
|
126
201
|
owner
|
|
127
202
|
blob_commitment
|
|
128
|
-
blob_name
|
|
129
203
|
created_at
|
|
130
204
|
expires_at
|
|
205
|
+
updated_at
|
|
131
206
|
num_chunksets
|
|
132
|
-
is_deleted
|
|
133
|
-
is_written
|
|
134
|
-
placement_group
|
|
135
207
|
size
|
|
136
|
-
updated_at
|
|
137
208
|
slice_address
|
|
209
|
+
placement_group
|
|
210
|
+
is_persisted
|
|
211
|
+
is_committed
|
|
212
|
+
is_deleted
|
|
138
213
|
}
|
|
139
214
|
}
|
|
140
215
|
`;
|
|
@@ -146,7 +221,8 @@ var GetBlobActivitiesDocument = gql`
|
|
|
146
221
|
limit: $limit
|
|
147
222
|
offset: $offset
|
|
148
223
|
) {
|
|
149
|
-
|
|
224
|
+
uid
|
|
225
|
+
object_name
|
|
150
226
|
event_index
|
|
151
227
|
event_type
|
|
152
228
|
transaction_hash
|
|
@@ -283,8 +359,12 @@ function getShelbyIndexerClient(config) {
|
|
|
283
359
|
});
|
|
284
360
|
}
|
|
285
361
|
export {
|
|
362
|
+
Blob_Activities_Constraint,
|
|
286
363
|
Blob_Activities_Select_Column,
|
|
364
|
+
Blob_Activities_Update_Column,
|
|
365
|
+
Blobs_Constraint,
|
|
287
366
|
Blobs_Select_Column,
|
|
367
|
+
Blobs_Update_Column,
|
|
288
368
|
Cursor_Ordering,
|
|
289
369
|
GetBlobActivitiesCountDocument,
|
|
290
370
|
GetBlobActivitiesDocument,
|
|
@@ -295,8 +375,12 @@ export {
|
|
|
295
375
|
GetProcessorStatusDocument,
|
|
296
376
|
GetTotalBlobsSizeDocument,
|
|
297
377
|
Order_By,
|
|
378
|
+
Placement_Group_Slots_Constraint,
|
|
298
379
|
Placement_Group_Slots_Select_Column,
|
|
380
|
+
Placement_Group_Slots_Update_Column,
|
|
381
|
+
Processor_Status_Constraint,
|
|
299
382
|
Processor_Status_Select_Column,
|
|
383
|
+
Processor_Status_Update_Column,
|
|
300
384
|
createShelbyIndexerClient,
|
|
301
385
|
getSdk,
|
|
302
386
|
getShelbyIndexerClient
|
|
@@ -21,62 +21,6 @@ declare const ChallengeResponseSchema: z.ZodObject<{
|
|
|
21
21
|
expiresAt: number;
|
|
22
22
|
}>;
|
|
23
23
|
type ChallengeResponse = z.infer<typeof ChallengeResponseSchema>;
|
|
24
|
-
/**
|
|
25
|
-
* Response from GET /v1/multipart-uploads?account=X&blobName=Y
|
|
26
|
-
*/
|
|
27
|
-
declare const MultipartUploadStatusResponseSchema: z.ZodObject<{
|
|
28
|
-
uploadId: z.ZodString;
|
|
29
|
-
completedParts: z.ZodArray<z.ZodNumber, "many">;
|
|
30
|
-
partSize: z.ZodNumber;
|
|
31
|
-
nParts: z.ZodNumber;
|
|
32
|
-
uploadedBytes: z.ZodNumber;
|
|
33
|
-
}, "strip", z.ZodTypeAny, {
|
|
34
|
-
uploadId: string;
|
|
35
|
-
completedParts: number[];
|
|
36
|
-
partSize: number;
|
|
37
|
-
nParts: number;
|
|
38
|
-
uploadedBytes: number;
|
|
39
|
-
}, {
|
|
40
|
-
uploadId: string;
|
|
41
|
-
completedParts: number[];
|
|
42
|
-
partSize: number;
|
|
43
|
-
nParts: number;
|
|
44
|
-
uploadedBytes: number;
|
|
45
|
-
}>;
|
|
46
|
-
type MultipartUploadStatusResponse = z.infer<typeof MultipartUploadStatusResponseSchema>;
|
|
47
|
-
/**
|
|
48
|
-
* Response from POST /v1/multipart-uploads
|
|
49
|
-
*/
|
|
50
|
-
declare const StartMultipartUploadResponseSchema: z.ZodObject<{
|
|
51
|
-
uploadId: z.ZodString;
|
|
52
|
-
}, "strip", z.ZodTypeAny, {
|
|
53
|
-
uploadId: string;
|
|
54
|
-
}, {
|
|
55
|
-
uploadId: string;
|
|
56
|
-
}>;
|
|
57
|
-
type StartMultipartUploadResponse = z.infer<typeof StartMultipartUploadResponseSchema>;
|
|
58
|
-
/**
|
|
59
|
-
* Response from PUT /v1/multipart-uploads/:uploadId/parts/:partIdx
|
|
60
|
-
*/
|
|
61
|
-
declare const UploadPartResponseSchema: z.ZodObject<{
|
|
62
|
-
success: z.ZodLiteral<true>;
|
|
63
|
-
}, "strip", z.ZodTypeAny, {
|
|
64
|
-
success: true;
|
|
65
|
-
}, {
|
|
66
|
-
success: true;
|
|
67
|
-
}>;
|
|
68
|
-
type UploadPartResponse = z.infer<typeof UploadPartResponseSchema>;
|
|
69
|
-
/**
|
|
70
|
-
* Response from POST /v1/multipart-uploads/:uploadId/complete
|
|
71
|
-
*/
|
|
72
|
-
declare const CompleteMultipartUploadResponseSchema: z.ZodObject<{
|
|
73
|
-
success: z.ZodLiteral<true>;
|
|
74
|
-
}, "strip", z.ZodTypeAny, {
|
|
75
|
-
success: true;
|
|
76
|
-
}, {
|
|
77
|
-
success: true;
|
|
78
|
-
}>;
|
|
79
|
-
type CompleteMultipartUploadResponse = z.infer<typeof CompleteMultipartUploadResponseSchema>;
|
|
80
24
|
/**
|
|
81
25
|
* Error response returned by RPC endpoints on failure.
|
|
82
26
|
*/
|
|
@@ -103,4 +47,4 @@ declare const StaleMicropaymentErrorResponseSchema: z.ZodObject<{
|
|
|
103
47
|
}>;
|
|
104
48
|
type StaleMicropaymentErrorResponse = z.infer<typeof StaleMicropaymentErrorResponseSchema>;
|
|
105
49
|
|
|
106
|
-
export { type ChallengeResponse, ChallengeResponseSchema, type
|
|
50
|
+
export { type ChallengeResponse, ChallengeResponseSchema, type RPCErrorResponse, RPCErrorResponseSchema, type StaleMicropaymentErrorResponse, StaleMicropaymentErrorResponseSchema };
|
|
@@ -4,22 +4,6 @@ var ChallengeResponseSchema = z.object({
|
|
|
4
4
|
challenge: z.string(),
|
|
5
5
|
expiresAt: z.number()
|
|
6
6
|
});
|
|
7
|
-
var MultipartUploadStatusResponseSchema = z.object({
|
|
8
|
-
uploadId: z.string(),
|
|
9
|
-
completedParts: z.array(z.number()),
|
|
10
|
-
partSize: z.number(),
|
|
11
|
-
nParts: z.number(),
|
|
12
|
-
uploadedBytes: z.number()
|
|
13
|
-
});
|
|
14
|
-
var StartMultipartUploadResponseSchema = z.object({
|
|
15
|
-
uploadId: z.string()
|
|
16
|
-
});
|
|
17
|
-
var UploadPartResponseSchema = z.object({
|
|
18
|
-
success: z.literal(true)
|
|
19
|
-
});
|
|
20
|
-
var CompleteMultipartUploadResponseSchema = z.object({
|
|
21
|
-
success: z.literal(true)
|
|
22
|
-
});
|
|
23
7
|
var RPCErrorResponseSchema = z.object({
|
|
24
8
|
error: z.string()
|
|
25
9
|
});
|
|
@@ -29,10 +13,6 @@ var StaleMicropaymentErrorResponseSchema = z.object({
|
|
|
29
13
|
});
|
|
30
14
|
export {
|
|
31
15
|
ChallengeResponseSchema,
|
|
32
|
-
CompleteMultipartUploadResponseSchema,
|
|
33
|
-
MultipartUploadStatusResponseSchema,
|
|
34
16
|
RPCErrorResponseSchema,
|
|
35
|
-
StaleMicropaymentErrorResponseSchema
|
|
36
|
-
StartMultipartUploadResponseSchema,
|
|
37
|
-
UploadPartResponseSchema
|
|
17
|
+
StaleMicropaymentErrorResponseSchema
|
|
38
18
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Hex } from '@aptos-labs/ts-sdk';
|
|
2
|
+
|
|
3
|
+
/** CAV_ERROR_CODE_SUCCESS from src/communication/cav_error_codes.h */
|
|
4
|
+
declare const SP_WRITE_SUCCESS_ERROR_CODE = 1n;
|
|
5
|
+
/**
|
|
6
|
+
* Concatenate two 32-byte hashes and compute SHA-256 of the result.
|
|
7
|
+
*/
|
|
8
|
+
declare function concatHashesSync(left: Uint8Array, right: Uint8Array): Uint8Array;
|
|
9
|
+
/**
|
|
10
|
+
* Generates an inclusion proof (array of sibling hashes) from a chunkset
|
|
11
|
+
* index to the blob merkle root.
|
|
12
|
+
*/
|
|
13
|
+
declare function generateChunksetInclusionProof(chunksetRoots: Hex[], chunksetIndex: number): Promise<Uint8Array[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Serialize chunkset-to-blob inclusion proof siblings into a flat byte array.
|
|
16
|
+
*/
|
|
17
|
+
declare function serializeInclusionProofSiblings(siblings: Uint8Array[]): Uint8Array;
|
|
18
|
+
/**
|
|
19
|
+
* Build the full chunk-to-blob proof (chunk->chunkset siblings + chunkset->blob siblings).
|
|
20
|
+
*/
|
|
21
|
+
declare function buildChunkProof(chunkIndex: number, chunkRoots: Uint8Array[], chunksetToBlobProof: Uint8Array): Uint8Array;
|
|
22
|
+
|
|
23
|
+
export { SP_WRITE_SUCCESS_ERROR_CODE, buildChunkProof, concatHashesSync, generateChunksetInclusionProof, serializeInclusionProofSiblings };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// src/core/sp/chunk_proof.ts
|
|
2
|
+
import { createHash } from "crypto";
|
|
3
|
+
|
|
4
|
+
// src/core/utils.ts
|
|
5
|
+
import {
|
|
6
|
+
AccountAddress,
|
|
7
|
+
Hex
|
|
8
|
+
} from "@aptos-labs/ts-sdk";
|
|
9
|
+
async function concatHashes(parts) {
|
|
10
|
+
const chunks = parts.map((part) => Hex.fromHexInput(part).toUint8Array());
|
|
11
|
+
const totalLength = chunks.reduce((sum, chunk) => sum + chunk.byteLength, 0);
|
|
12
|
+
const combined = new Uint8Array(totalLength);
|
|
13
|
+
let offset = 0;
|
|
14
|
+
for (const chunk of chunks) {
|
|
15
|
+
combined.set(chunk, offset);
|
|
16
|
+
offset += chunk.byteLength;
|
|
17
|
+
}
|
|
18
|
+
return Hex.fromHexInput(
|
|
19
|
+
new Uint8Array(await crypto.subtle.digest("SHA-256", combined))
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// src/core/sp/chunk_proof.ts
|
|
24
|
+
var SP_WRITE_SUCCESS_ERROR_CODE = 1n;
|
|
25
|
+
function concatHashesSync(left, right) {
|
|
26
|
+
const combined = new Uint8Array(64);
|
|
27
|
+
combined.set(left, 0);
|
|
28
|
+
combined.set(right, 32);
|
|
29
|
+
const hash = createHash("sha256");
|
|
30
|
+
hash.update(combined);
|
|
31
|
+
return new Uint8Array(hash.digest());
|
|
32
|
+
}
|
|
33
|
+
async function generateChunksetInclusionProof(chunksetRoots, chunksetIndex) {
|
|
34
|
+
if (chunksetRoots.length === 0) {
|
|
35
|
+
throw new Error("Cannot generate inclusion proof for empty chunkset roots");
|
|
36
|
+
}
|
|
37
|
+
if (chunksetIndex < 0 || chunksetIndex >= chunksetRoots.length) {
|
|
38
|
+
throw new Error(
|
|
39
|
+
`Chunkset index ${chunksetIndex} out of range [0, ${chunksetRoots.length})`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
if (chunksetRoots.length === 1) {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
const zeroHash = new Uint8Array(32);
|
|
46
|
+
const siblings = [];
|
|
47
|
+
let currentLeaves = chunksetRoots.map((h) => h.toUint8Array());
|
|
48
|
+
let currentIdx = chunksetIndex;
|
|
49
|
+
while (currentLeaves.length > 1) {
|
|
50
|
+
if (currentLeaves.length % 2 !== 0) {
|
|
51
|
+
currentLeaves.push(zeroHash);
|
|
52
|
+
}
|
|
53
|
+
const siblingIdx = currentIdx % 2 === 0 ? currentIdx + 1 : currentIdx - 1;
|
|
54
|
+
siblings.push(currentLeaves[siblingIdx]);
|
|
55
|
+
const nextLeaves = [];
|
|
56
|
+
for (let i = 0; i < currentLeaves.length; i += 2) {
|
|
57
|
+
const combined = await concatHashes([
|
|
58
|
+
currentLeaves[i],
|
|
59
|
+
currentLeaves[i + 1]
|
|
60
|
+
]);
|
|
61
|
+
nextLeaves.push(combined.toUint8Array());
|
|
62
|
+
}
|
|
63
|
+
currentLeaves = nextLeaves;
|
|
64
|
+
currentIdx = Math.floor(currentIdx / 2);
|
|
65
|
+
}
|
|
66
|
+
return siblings;
|
|
67
|
+
}
|
|
68
|
+
function serializeInclusionProofSiblings(siblings) {
|
|
69
|
+
const totalLength = siblings.reduce((sum, s) => sum + s.length, 0);
|
|
70
|
+
const proof = new Uint8Array(totalLength);
|
|
71
|
+
let offset = 0;
|
|
72
|
+
for (const sibling of siblings) {
|
|
73
|
+
proof.set(sibling, offset);
|
|
74
|
+
offset += sibling.length;
|
|
75
|
+
}
|
|
76
|
+
return proof;
|
|
77
|
+
}
|
|
78
|
+
function buildChunkProof(chunkIndex, chunkRoots, chunksetToBlobProof) {
|
|
79
|
+
const chunkToChunksetSiblings = [];
|
|
80
|
+
let currentIdx = chunkIndex;
|
|
81
|
+
let currentLevel = [...chunkRoots];
|
|
82
|
+
while (currentLevel.length > 1) {
|
|
83
|
+
if (currentLevel.length % 2 !== 0) {
|
|
84
|
+
currentLevel.push(new Uint8Array(32));
|
|
85
|
+
}
|
|
86
|
+
const siblingIdx = currentIdx % 2 === 0 ? currentIdx + 1 : currentIdx - 1;
|
|
87
|
+
if (siblingIdx < currentLevel.length) {
|
|
88
|
+
chunkToChunksetSiblings.push(currentLevel[siblingIdx]);
|
|
89
|
+
}
|
|
90
|
+
const nextLevel = [];
|
|
91
|
+
for (let i = 0; i < currentLevel.length; i += 2) {
|
|
92
|
+
nextLevel.push(concatHashesSync(currentLevel[i], currentLevel[i + 1]));
|
|
93
|
+
}
|
|
94
|
+
currentLevel = nextLevel;
|
|
95
|
+
currentIdx = Math.floor(currentIdx / 2);
|
|
96
|
+
}
|
|
97
|
+
const totalLength = chunkToChunksetSiblings.reduce((sum, s) => sum + s.length, 0) + chunksetToBlobProof.length;
|
|
98
|
+
const fullProof = new Uint8Array(totalLength);
|
|
99
|
+
let offset = 0;
|
|
100
|
+
for (const sibling of chunkToChunksetSiblings) {
|
|
101
|
+
fullProof.set(sibling, offset);
|
|
102
|
+
offset += sibling.length;
|
|
103
|
+
}
|
|
104
|
+
fullProof.set(chunksetToBlobProof, offset);
|
|
105
|
+
return fullProof;
|
|
106
|
+
}
|
|
107
|
+
export {
|
|
108
|
+
SP_WRITE_SUCCESS_ERROR_CODE,
|
|
109
|
+
buildChunkProof,
|
|
110
|
+
concatHashesSync,
|
|
111
|
+
generateChunksetInclusionProof,
|
|
112
|
+
serializeInclusionProofSiblings
|
|
113
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { SP_WRITE_SUCCESS_ERROR_CODE, buildChunkProof, concatHashesSync, generateChunksetInclusionProof, serializeInclusionProofSiblings } from './chunk_proof.js';
|
|
2
|
+
export { SpReadChunkParams, SpReadResult, SpWriteChunkParams, SpWriteClient, SpWriteResult } from './sp_write_client.js';
|
|
3
|
+
import '@aptos-labs/ts-sdk';
|