@shelby-protocol/sdk 0.0.1-experimental.4 → 0.0.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/README.md +41 -0
- package/dist/browser/index.d.ts +17 -8
- package/dist/browser/index.mjs +83 -34
- package/dist/chunk-3ZDXWPYC.mjs +65 -0
- package/dist/chunk-6MDQI7PW.mjs +177 -0
- package/dist/chunk-75VHXY5P.mjs +48 -0
- package/dist/chunk-APML3CGJ.mjs +176 -0
- package/dist/chunk-DLMDDEWF.mjs +112 -0
- package/dist/{chunk-C33H3C3N.mjs → chunk-EAPAG4L7.mjs} +1 -1
- package/dist/{chunk-GGYTHP5F.mjs → chunk-FIFKKWXV.mjs} +19 -17
- package/dist/chunk-HPVCKAN2.mjs +41 -0
- package/dist/{chunk-2FF5FICZ.mjs → chunk-JSR44EDC.mjs} +96 -42
- package/dist/chunk-KBUWZXFA.mjs +92 -0
- package/dist/chunk-LTV26KU4.mjs +141 -0
- package/dist/chunk-NTJSNNA7.mjs +175 -0
- package/dist/{chunk-QEMIORTL.mjs → chunk-OTBLZL2S.mjs} +1 -1
- package/dist/chunk-RBFWGDMY.mjs +30 -0
- package/dist/chunk-VRLIOKWG.mjs +11 -0
- package/dist/chunk-XGMJ4CG4.mjs +384 -0
- package/dist/chunk-Z7RFCADT.mjs +0 -0
- package/dist/chunk-ZPW742E7.mjs +28 -0
- package/dist/clay-codes-Ce9EmXfa.d.ts +129 -0
- package/dist/core/blobs.mjs +1 -1
- package/dist/core/chunk.d.ts +34 -0
- package/dist/core/chunk.mjs +17 -0
- package/dist/core/clients/ShelbyBlobClient.d.ts +121 -89
- package/dist/core/clients/ShelbyBlobClient.mjs +11 -3
- package/dist/core/clients/ShelbyClient.d.ts +71 -30
- package/dist/core/clients/ShelbyClient.mjs +14 -9
- package/dist/core/clients/ShelbyClientConfig.d.ts +43 -9
- package/dist/core/clients/ShelbyClientConfig.mjs +1 -0
- package/dist/core/clients/ShelbyRPCClient.d.ts +47 -20
- package/dist/core/clients/ShelbyRPCClient.mjs +10 -3
- package/dist/core/clients/index.d.ts +10 -5
- package/dist/core/clients/index.mjs +16 -10
- package/dist/core/clients/utils.d.ts +7 -0
- package/dist/core/clients/utils.mjs +7 -0
- package/dist/core/commitments.d.ts +18 -18
- package/dist/core/commitments.mjs +7 -5
- package/dist/core/constants.d.ts +24 -19
- package/dist/core/constants.mjs +15 -15
- package/dist/core/erasure/clay-codes.d.ts +2 -0
- package/dist/core/erasure/clay-codes.mjs +9 -0
- package/dist/core/erasure/constants.d.ts +48 -0
- package/dist/core/erasure/constants.mjs +17 -0
- package/dist/core/erasure/default.d.ts +6 -0
- package/dist/core/erasure/default.mjs +9 -0
- package/dist/core/erasure/index.d.ts +4 -0
- package/dist/core/erasure/index.mjs +27 -0
- package/dist/core/erasure/provider.d.ts +2 -0
- package/dist/core/erasure/provider.mjs +0 -0
- package/dist/core/erasure/reed-solomon.d.ts +2 -0
- package/dist/core/erasure/reed-solomon.mjs +7 -0
- package/dist/core/erasure/utils.d.ts +12 -0
- package/dist/core/erasure/utils.mjs +33 -0
- package/dist/core/index.d.ts +17 -8
- package/dist/core/index.mjs +83 -34
- package/dist/core/layout.mjs +4 -2
- package/dist/core/networks.d.ts +7 -0
- package/dist/core/networks.mjs +9 -0
- package/dist/core/operations/generated/sdk.d.ts +686 -0
- package/dist/core/operations/generated/sdk.mjs +23 -0
- package/dist/core/operations/index.d.ts +31 -0
- package/dist/core/operations/index.mjs +12 -0
- package/dist/core/strings.d.ts +6 -0
- package/dist/core/strings.mjs +9 -0
- package/dist/core/types/blobs.d.ts +49 -79
- package/dist/core/types/encodings.d.ts +5 -13
- package/dist/core/types/encodings.mjs +0 -1
- package/dist/core/types/index.d.ts +4 -2
- package/dist/core/types/index.mjs +1 -1
- package/dist/core/types/placement_groups.d.ts +15 -0
- package/dist/core/types/placement_groups.mjs +0 -0
- package/dist/core/types/storage_providers.d.ts +31 -0
- package/dist/core/types/storage_providers.mjs +1 -0
- package/dist/core/utils.d.ts +15 -3
- package/dist/core/utils.mjs +5 -3
- package/dist/node/clients/ShelbyMetadataClient.d.ts +72 -0
- package/dist/node/clients/ShelbyMetadataClient.mjs +9 -0
- package/dist/node/clients/ShelbyNodeClient.d.ts +8 -3
- package/dist/node/clients/ShelbyNodeClient.mjs +15 -10
- package/dist/node/clients/index.d.ts +12 -5
- package/dist/node/clients/index.mjs +20 -11
- package/dist/node/index.d.ts +18 -8
- package/dist/node/index.mjs +89 -36
- package/package.json +25 -12
- package/dist/chunk-5Z3RVWU3.mjs +0 -67
- package/dist/chunk-B3CB2YEO.mjs +0 -318
- package/dist/chunk-D2FERD4A.mjs +0 -39
- package/dist/chunk-G263DBCY.mjs +0 -105
- package/dist/chunk-P7BVGLTV.mjs +0 -32
- package/dist/chunk-QM5BVKLD.mjs +0 -109
- package/dist/core/erasure.d.ts +0 -6
- package/dist/core/erasure.mjs +0 -7
- /package/dist/{chunk-7S6RVKYB.mjs → chunk-MB7C7VQF.mjs} +0 -0
- /package/dist/{chunk-IHTPXUYI.mjs → chunk-MQUVYMNQ.mjs} +0 -0
- /package/dist/{chunk-PLUDE5C3.mjs → chunk-RNXGC54D.mjs} +0 -0
- /package/dist/{chunk-QKT5R735.mjs → chunk-TUANYVZQ.mjs} +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Blob_Activities_Select_Column,
|
|
3
|
+
Blobs_Select_Column,
|
|
4
|
+
Cursor_Ordering,
|
|
5
|
+
GetBlobActivitiesDocument,
|
|
6
|
+
GetBlobsDocument,
|
|
7
|
+
Order_By,
|
|
8
|
+
Placement_Group_Slots_Select_Column,
|
|
9
|
+
Processor_Status_Select_Column,
|
|
10
|
+
getSdk
|
|
11
|
+
} from "../../../chunk-DLMDDEWF.mjs";
|
|
12
|
+
import "../../../chunk-7P6ASYW6.mjs";
|
|
13
|
+
export {
|
|
14
|
+
Blob_Activities_Select_Column,
|
|
15
|
+
Blobs_Select_Column,
|
|
16
|
+
Cursor_Ordering,
|
|
17
|
+
GetBlobActivitiesDocument,
|
|
18
|
+
GetBlobsDocument,
|
|
19
|
+
Order_By,
|
|
20
|
+
Placement_Group_Slots_Select_Column,
|
|
21
|
+
Processor_Status_Select_Column,
|
|
22
|
+
getSdk
|
|
23
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { GetBlobsQueryVariables, GetBlobsQuery, GetBlobActivitiesQueryVariables, GetBlobActivitiesQuery } from './generated/sdk.js';
|
|
2
|
+
import { GraphQLClient } from 'graphql-request';
|
|
3
|
+
import { ShelbyClientConfig } from '../clients/ShelbyClientConfig.js';
|
|
4
|
+
import 'graphql';
|
|
5
|
+
import '@aptos-labs/ts-sdk';
|
|
6
|
+
import '../networks.js';
|
|
7
|
+
|
|
8
|
+
declare function createShelbyIndexerClient(baseUrl: string, options?: ConstructorParameters<typeof GraphQLClient>[1]): {
|
|
9
|
+
getBlobs(variables?: GetBlobsQueryVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<GetBlobsQuery>;
|
|
10
|
+
getBlobActivities(variables?: GetBlobActivitiesQueryVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<GetBlobActivitiesQuery>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Creates a Shelby indexer client from a Shelby client config.
|
|
14
|
+
*
|
|
15
|
+
* @param config - The Shelby client config.
|
|
16
|
+
* @returns The Shelby indexer client.
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const client = getShelbyIndexerClient({
|
|
20
|
+
* baseUrl: "https://api.shelbynet.aptoslabs.com/nocode/v1/api/cmforrguw0042s601fn71f9l2/v1/graphql",
|
|
21
|
+
* apiKey: "AG-***",
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare function getShelbyIndexerClient(config: ShelbyClientConfig): {
|
|
26
|
+
getBlobs(variables?: GetBlobsQueryVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<GetBlobsQuery>;
|
|
27
|
+
getBlobActivities(variables?: GetBlobActivitiesQueryVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<GetBlobActivitiesQuery>;
|
|
28
|
+
};
|
|
29
|
+
type ShelbyIndexerClient = ReturnType<typeof createShelbyIndexerClient>;
|
|
30
|
+
|
|
31
|
+
export { type ShelbyIndexerClient, createShelbyIndexerClient, getShelbyIndexerClient };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createShelbyIndexerClient,
|
|
3
|
+
getShelbyIndexerClient
|
|
4
|
+
} from "../../chunk-75VHXY5P.mjs";
|
|
5
|
+
import "../../chunk-DLMDDEWF.mjs";
|
|
6
|
+
import "../../chunk-RBFWGDMY.mjs";
|
|
7
|
+
import "../../chunk-HPVCKAN2.mjs";
|
|
8
|
+
import "../../chunk-7P6ASYW6.mjs";
|
|
9
|
+
export {
|
|
10
|
+
createShelbyIndexerClient,
|
|
11
|
+
getShelbyIndexerClient
|
|
12
|
+
};
|
|
@@ -1,91 +1,30 @@
|
|
|
1
1
|
import { AccountAddress } from '@aptos-labs/ts-sdk';
|
|
2
|
+
import { b as ClayProviderOptions } from '../../clay-codes-Ce9EmXfa.js';
|
|
2
3
|
import { BlobName } from '../layout.js';
|
|
4
|
+
import '@shelby-protocol/clay-codes';
|
|
3
5
|
import 'zod';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
|
-
* The
|
|
8
|
+
* The parameters required for using Clay codes to erasure code a Blob.
|
|
7
9
|
*
|
|
8
|
-
* @link https://github.com/
|
|
10
|
+
* @link https://github.com/shelby/shelby/blob/e08e84742cf2b80ad8bb7227deb3013398076d53/move/shelby_contract/sources/common_types.move#L32
|
|
9
11
|
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The chunk is stored on a storage provider.
|
|
13
|
-
*/
|
|
14
|
-
variant: "stored";
|
|
15
|
-
/**
|
|
16
|
-
* The address of the storage provider that stores the chunk.
|
|
17
|
-
*/
|
|
18
|
-
provider: AccountAddress;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The chunk is waiting to be stored by a storage provider.
|
|
22
|
-
*
|
|
23
|
-
* @link https://github.com/JumpCrypto/shelby/blob/e009607aad330ccddb08d80bf9addfaadae7972b/move/prototype/move/sources/prototype_interface.move#L50-L58
|
|
24
|
-
*/
|
|
25
|
-
interface PendingChunkLocation {
|
|
26
|
-
/**
|
|
27
|
-
* The chunk is waiting to be stored by a storage provider.
|
|
28
|
-
*/
|
|
29
|
-
variant: "pending";
|
|
30
|
-
/**
|
|
31
|
-
* The address of the storage provider that will store the chunk.
|
|
32
|
-
*/
|
|
33
|
-
provider: AccountAddress;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* The status of the chunk and what storage provider is responsible for storing it.
|
|
37
|
-
*
|
|
38
|
-
* @link https://github.com/JumpCrypto/shelby/blob/e009607aad330ccddb08d80bf9addfaadae7972b/move/prototype/move/sources/prototype_interface.move#L50-L58
|
|
39
|
-
*/
|
|
40
|
-
type ChunkLocation = StoredChunkLocation | PendingChunkLocation;
|
|
41
|
-
/**
|
|
42
|
-
* A chunk of a blob.
|
|
43
|
-
*
|
|
44
|
-
* @link https://github.com/JumpCrypto/shelby/blob/e009607aad330ccddb08d80bf9addfaadae7972b/move/prototype/move/sources/prototype_interface.move#L45-L48
|
|
45
|
-
*/
|
|
46
|
-
interface BlobChunk {
|
|
47
|
-
/**
|
|
48
|
-
* The commitment of the chunk.
|
|
49
|
-
*/
|
|
50
|
-
commitment: Uint8Array;
|
|
51
|
-
/**
|
|
52
|
-
* The location of the chunk.
|
|
53
|
-
*/
|
|
54
|
-
location: ChunkLocation;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* The encoding of a blob.
|
|
58
|
-
*
|
|
59
|
-
* @link https://github.com/JumpCrypto/shelby/blob/e009607aad330ccddb08d80bf9addfaadae7972b/move/prototype/move/sources/prototype_interface.move#L28-L34
|
|
60
|
-
*/
|
|
61
|
-
interface ClayEncoding {
|
|
12
|
+
type ClayEncoding = Required<ClayProviderOptions & {
|
|
62
13
|
/**
|
|
63
14
|
* The variant of the encoding.
|
|
64
15
|
*/
|
|
65
16
|
variant: "clay";
|
|
66
|
-
|
|
67
|
-
* The number of data chunks in the erasure coding scheme.
|
|
68
|
-
*/
|
|
69
|
-
erasureK: number;
|
|
70
|
-
/**
|
|
71
|
-
* The number of parity chunks in the erasure coding scheme.
|
|
72
|
-
*/
|
|
73
|
-
erasureM: number;
|
|
74
|
-
/**
|
|
75
|
-
* The size of the chunkset in bytes.
|
|
76
|
-
*/
|
|
77
|
-
chunksetSize: number;
|
|
78
|
-
}
|
|
17
|
+
}>;
|
|
79
18
|
/**
|
|
80
19
|
* The encoding of a blob.
|
|
81
20
|
*
|
|
82
|
-
* @link https://github.com/
|
|
21
|
+
* @link https://github.com/shelby/shelby/blob/e08e84742cf2b80ad8bb7227deb3013398076d53/move/shelby_contract/sources/common_types.move#L32
|
|
83
22
|
*/
|
|
84
23
|
type BlobEncoding = ClayEncoding;
|
|
85
24
|
/**
|
|
86
25
|
* The metadata of a blob that describes the blob and its properties.
|
|
87
26
|
*
|
|
88
|
-
* @link https://github.com/
|
|
27
|
+
* @link https://github.com/shelby/shelby/blob/e08e84742cf2b80ad8bb7227deb3013398076d53/move/shelby_contract/sources/global_metadata.move#L185
|
|
89
28
|
*/
|
|
90
29
|
interface BlobMetadata {
|
|
91
30
|
/**
|
|
@@ -112,21 +51,52 @@ interface BlobMetadata {
|
|
|
112
51
|
* The expiration timestamp of the blob in microseconds.
|
|
113
52
|
*/
|
|
114
53
|
expirationMicros: number;
|
|
54
|
+
/**
|
|
55
|
+
* The slice address of the blob.
|
|
56
|
+
*/
|
|
57
|
+
sliceAddress: AccountAddress;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the blob is written.
|
|
60
|
+
*/
|
|
61
|
+
isWritten: boolean;
|
|
115
62
|
}
|
|
63
|
+
type BlobActivityType = "register_blob" | "delete_blob" | "extend_blob_expiration" | "write_blob" | "unknown";
|
|
116
64
|
/**
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* @link https://github.com/JumpCrypto/shelby/blob/e009607aad330ccddb08d80bf9addfaadae7972b/move/prototype/move/sources/prototype_interface.move#L346-L347
|
|
65
|
+
* The activity of a blob.
|
|
120
66
|
*/
|
|
121
|
-
|
|
67
|
+
interface BlobActivity {
|
|
122
68
|
/**
|
|
123
|
-
* The
|
|
69
|
+
* The name of the blob.
|
|
124
70
|
*/
|
|
125
|
-
|
|
71
|
+
blobName: BlobName;
|
|
126
72
|
/**
|
|
127
|
-
* The address of the
|
|
73
|
+
* The account address of the activity.
|
|
128
74
|
*/
|
|
129
|
-
|
|
130
|
-
|
|
75
|
+
accountAddress: AccountAddress;
|
|
76
|
+
/**
|
|
77
|
+
* The type of the activity.
|
|
78
|
+
*/
|
|
79
|
+
type: BlobActivityType;
|
|
80
|
+
/**
|
|
81
|
+
* The event type of the activity.
|
|
82
|
+
*/
|
|
83
|
+
eventType: string;
|
|
84
|
+
/**
|
|
85
|
+
* The event index of the activity.
|
|
86
|
+
*/
|
|
87
|
+
eventIndex: number;
|
|
88
|
+
/**
|
|
89
|
+
* The transaction hash of the activity.
|
|
90
|
+
*/
|
|
91
|
+
transactionHash: string;
|
|
92
|
+
/**
|
|
93
|
+
* The transaction version of the activity.
|
|
94
|
+
*/
|
|
95
|
+
transactionVersion: number;
|
|
96
|
+
/**
|
|
97
|
+
* The timestamp of the activity.
|
|
98
|
+
*/
|
|
99
|
+
timestamp: number;
|
|
100
|
+
}
|
|
131
101
|
|
|
132
|
-
export type {
|
|
102
|
+
export type { BlobActivity, BlobActivityType, BlobEncoding, BlobMetadata, ClayEncoding };
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
+
import { a as ErasureCodingProvider } from '../../clay-codes-Ce9EmXfa.js';
|
|
2
|
+
import '@shelby-protocol/clay-codes';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
5
|
+
* Optional encoding customization when generating commitments or writing blobs.
|
|
3
6
|
*/
|
|
4
7
|
type EncodingOptions = {
|
|
5
|
-
|
|
6
|
-
* The number of data chunks.
|
|
7
|
-
*/
|
|
8
|
-
erasureK: number;
|
|
9
|
-
/**
|
|
10
|
-
* The number of parity chunks.
|
|
11
|
-
*/
|
|
12
|
-
erasureM: number;
|
|
13
|
-
/**
|
|
14
|
-
* The size of the chunkset in bytes.
|
|
15
|
-
*/
|
|
16
|
-
chunksetSize: number;
|
|
8
|
+
provider?: ErasureCodingProvider;
|
|
17
9
|
};
|
|
18
10
|
|
|
19
11
|
export type { EncodingOptions };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../../chunk-IHTPXUYI.mjs";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { BlobActivity, BlobActivityType, BlobEncoding, BlobMetadata, ClayEncoding } from './blobs.js';
|
|
2
|
+
export { StorageProviderInfo } from './storage_providers.js';
|
|
3
3
|
import '@aptos-labs/ts-sdk';
|
|
4
|
+
import '../../clay-codes-Ce9EmXfa.js';
|
|
5
|
+
import '@shelby-protocol/clay-codes';
|
|
4
6
|
import '../layout.js';
|
|
5
7
|
import 'zod';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AccountAddress } from '@aptos-labs/ts-sdk';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The metadata of a placement group.
|
|
5
|
+
*
|
|
6
|
+
* https://github.com/shelby/shelby/blob/e08e84742cf2b80ad8bb7227deb3013398076d53/move/shelby_contract/sources/placement_group.move#L76
|
|
7
|
+
*/
|
|
8
|
+
interface PlacementGroupInfo {
|
|
9
|
+
/**
|
|
10
|
+
* The addresses of the storage providers. The order is important, as it maps to the exact slot index of the storage provider.
|
|
11
|
+
*/
|
|
12
|
+
members: AccountAddress[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type { PlacementGroupInfo };
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AccountAddress } from '@aptos-labs/ts-sdk';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The metadata of a storage provider.
|
|
5
|
+
*
|
|
6
|
+
* @link https://github.com/shelby/shelby/blob/da805cff8f0f55a0837cf43586eb4eaa04ad3f1f/move/shelby_contract/sources/storage_provider.move#L103
|
|
7
|
+
*/
|
|
8
|
+
interface StorageProviderInfo {
|
|
9
|
+
/**
|
|
10
|
+
* The address of the storage provider.
|
|
11
|
+
*/
|
|
12
|
+
address: AccountAddress;
|
|
13
|
+
/**
|
|
14
|
+
* The IP address of the storage provider.
|
|
15
|
+
*/
|
|
16
|
+
ipAddress: string;
|
|
17
|
+
/**
|
|
18
|
+
* The port of the storage provider.
|
|
19
|
+
*/
|
|
20
|
+
port: string;
|
|
21
|
+
/**
|
|
22
|
+
* The BLS public key of the storage provider.
|
|
23
|
+
*/
|
|
24
|
+
blsPublicKey: Uint8Array;
|
|
25
|
+
/**
|
|
26
|
+
* The failure domain of the storage provider.
|
|
27
|
+
*/
|
|
28
|
+
failureDomain: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type { StorageProviderInfo };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../chunk-MQUVYMNQ.mjs";
|
package/dist/core/utils.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { HexInput, Hex } from '@aptos-labs/ts-sdk';
|
|
2
2
|
|
|
3
|
+
type ByteStream = ReadableStream<Uint8Array>;
|
|
4
|
+
type ChunkSource = ByteStream | ArrayBufferView;
|
|
3
5
|
/**
|
|
4
6
|
* Read a stream or buffer into chunks of a given size.
|
|
5
7
|
*
|
|
@@ -8,7 +10,7 @@ import { HexInput, Hex } from '@aptos-labs/ts-sdk';
|
|
|
8
10
|
*
|
|
9
11
|
* @returns A generator of chunks.
|
|
10
12
|
*/
|
|
11
|
-
declare function readInChunks(input:
|
|
13
|
+
declare function readInChunks(input: ChunkSource, chunkSize: number): AsyncGenerator<[number, Uint8Array]>;
|
|
12
14
|
/**
|
|
13
15
|
* Zero pad a buffer to a desired length.
|
|
14
16
|
*
|
|
@@ -17,7 +19,7 @@ declare function readInChunks(input: ReadableStream | Buffer, chunkSize: number)
|
|
|
17
19
|
*
|
|
18
20
|
* @returns The zero padded buffer.
|
|
19
21
|
*/
|
|
20
|
-
declare function
|
|
22
|
+
declare function zeroPadBytes(buffer: Uint8Array, desiredLength: number): Uint8Array;
|
|
21
23
|
/**
|
|
22
24
|
* Concatenates a list of hashes into a single hash.
|
|
23
25
|
*
|
|
@@ -26,5 +28,15 @@ declare function zeroPadBuffer(buffer: Buffer, desiredLength: number): Buffer;
|
|
|
26
28
|
* @returns A hash of the concatenated hashes.
|
|
27
29
|
*/
|
|
28
30
|
declare function concatHashes(parts: HexInput[]): Promise<Hex>;
|
|
31
|
+
/**
|
|
32
|
+
* Correctly constructs a full URL string by appending the specified path to the base URL string.
|
|
33
|
+
*
|
|
34
|
+
* This function accepts baseUrl strings with and without ending forward slashes and paths with and without beginning forward slashes.
|
|
35
|
+
*
|
|
36
|
+
*
|
|
37
|
+
* @param path - The path to append to the base URL string.
|
|
38
|
+
* @returns The full request URL.
|
|
39
|
+
*/
|
|
40
|
+
declare function buildRequestUrl(path: string, baseUrl: string): URL;
|
|
29
41
|
|
|
30
|
-
export { concatHashes, readInChunks,
|
|
42
|
+
export { buildRequestUrl, concatHashes, readInChunks, zeroPadBytes };
|
package/dist/core/utils.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
buildRequestUrl,
|
|
2
3
|
concatHashes,
|
|
3
4
|
readInChunks,
|
|
4
|
-
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
zeroPadBytes
|
|
6
|
+
} from "../chunk-KBUWZXFA.mjs";
|
|
6
7
|
import "../chunk-7P6ASYW6.mjs";
|
|
7
8
|
export {
|
|
9
|
+
buildRequestUrl,
|
|
8
10
|
concatHashes,
|
|
9
11
|
readInChunks,
|
|
10
|
-
|
|
12
|
+
zeroPadBytes
|
|
11
13
|
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Aptos, AccountAddress, AccountAddressInput } from '@aptos-labs/ts-sdk';
|
|
2
|
+
import { ShelbyClientConfig } from '../../core/clients/ShelbyClientConfig.js';
|
|
3
|
+
import { StorageProviderInfo } from '../../core/types/storage_providers.js';
|
|
4
|
+
import '../../core/networks.js';
|
|
5
|
+
|
|
6
|
+
declare class ShelbyMetadataClient {
|
|
7
|
+
readonly aptos: Aptos;
|
|
8
|
+
readonly deployer: AccountAddress;
|
|
9
|
+
/**
|
|
10
|
+
* The ShelbyMetadataClient is used to interact with the Shelby contract on the Aptos blockchain. This
|
|
11
|
+
* includes functions like gathering basic details about the Shelby system, including storage provider information.
|
|
12
|
+
*
|
|
13
|
+
* @param config.aptos.config - The Aptos config.
|
|
14
|
+
* @param config.shelbyDeployer - The deployer account address of the Shelby contract. If not provided, the default deployer address will be used.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const aptos = new Aptos(new AptosConfig({ network: Network.TESTNET }));
|
|
19
|
+
* const metadataClient = new ShelbyMetadataClient({ aptos });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
constructor(config: ShelbyClientConfig);
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves storage provider list from the blockchain.
|
|
25
|
+
*
|
|
26
|
+
* @returns A list of storage providers, or empty array if none exist.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const spList = await client.getStorageProviders();
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
getStorageProviders(): Promise<StorageProviderInfo[]>;
|
|
34
|
+
/**
|
|
35
|
+
* Retrieves the list of placement group addresses.
|
|
36
|
+
*
|
|
37
|
+
* @returns The placement group address list, or an empty array if none exist.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const pgList = await client.getPlacementGroupAddresses();
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
getPlacementGroupAddresses(): Promise<AccountAddress[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Retrieves the list of slice addresses.
|
|
47
|
+
*
|
|
48
|
+
* @returns The slice group list, or an empty array if none exist.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const pgList = await client.getSliceAddresses();
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
getSliceAddresses(): Promise<AccountAddress[]>;
|
|
56
|
+
/**
|
|
57
|
+
* Retrieves the storage providers assigned to a slice, through a placement group.
|
|
58
|
+
*
|
|
59
|
+
* @param params.account - The address of the slice account.
|
|
60
|
+
* @returns The list of storage providers for the slice, or an empty array if none exist.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const pgInfo = await client.getStorageProvidersForSlice();
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
getStorageProvidersForSlice(params: {
|
|
68
|
+
account: AccountAddressInput;
|
|
69
|
+
}): Promise<AccountAddress[]>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { ShelbyMetadataClient };
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { ShelbyClient } from '../../core/clients/ShelbyClient.js';
|
|
2
2
|
import '../../core/clients/ShelbyBlobClient.js';
|
|
3
3
|
import '@aptos-labs/ts-sdk';
|
|
4
|
-
import '../../core/commitments.js';
|
|
5
|
-
import 'zod';
|
|
6
|
-
import '../../core/types/encodings.js';
|
|
7
4
|
import '../../core/layout.js';
|
|
5
|
+
import 'zod';
|
|
8
6
|
import '../../core/types/blobs.js';
|
|
7
|
+
import '../../clay-codes-Ce9EmXfa.js';
|
|
8
|
+
import '@shelby-protocol/clay-codes';
|
|
9
|
+
import '../../core/operations/index.js';
|
|
10
|
+
import '../../core/operations/generated/sdk.js';
|
|
11
|
+
import 'graphql';
|
|
12
|
+
import 'graphql-request';
|
|
9
13
|
import '../../core/clients/ShelbyClientConfig.js';
|
|
14
|
+
import '../../core/networks.js';
|
|
10
15
|
import '../../core/blobs.js';
|
|
11
16
|
import '../../core/clients/ShelbyRPCClient.js';
|
|
12
17
|
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ShelbyNodeClient
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-P7BVGLTV.mjs";
|
|
11
|
-
import "../../chunk-GGYTHP5F.mjs";
|
|
12
|
-
import "../../chunk-D2FERD4A.mjs";
|
|
3
|
+
} from "../../chunk-EAPAG4L7.mjs";
|
|
4
|
+
import "../../chunk-6MDQI7PW.mjs";
|
|
5
|
+
import "../../chunk-XGMJ4CG4.mjs";
|
|
6
|
+
import "../../chunk-JSR44EDC.mjs";
|
|
7
|
+
import "../../chunk-75VHXY5P.mjs";
|
|
8
|
+
import "../../chunk-DLMDDEWF.mjs";
|
|
9
|
+
import "../../chunk-RBFWGDMY.mjs";
|
|
13
10
|
import "../../chunk-I6NG5GNL.mjs";
|
|
11
|
+
import "../../chunk-OTBLZL2S.mjs";
|
|
12
|
+
import "../../chunk-LTV26KU4.mjs";
|
|
13
|
+
import "../../chunk-KBUWZXFA.mjs";
|
|
14
|
+
import "../../chunk-HPVCKAN2.mjs";
|
|
15
|
+
import "../../chunk-FIFKKWXV.mjs";
|
|
16
|
+
import "../../chunk-APML3CGJ.mjs";
|
|
17
|
+
import "../../chunk-3ZDXWPYC.mjs";
|
|
18
|
+
import "../../chunk-ZPW742E7.mjs";
|
|
14
19
|
import "../../chunk-7P6ASYW6.mjs";
|
|
15
20
|
export {
|
|
16
21
|
ShelbyNodeClient
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
+
export { ShelbyMetadataClient } from './ShelbyMetadataClient.js';
|
|
1
2
|
export { ShelbyNodeClient } from './ShelbyNodeClient.js';
|
|
3
|
+
import '@aptos-labs/ts-sdk';
|
|
4
|
+
import '../../core/clients/ShelbyClientConfig.js';
|
|
5
|
+
import '../../core/networks.js';
|
|
6
|
+
import '../../core/types/storage_providers.js';
|
|
2
7
|
import '../../core/clients/ShelbyClient.js';
|
|
3
8
|
import '../../core/clients/ShelbyBlobClient.js';
|
|
4
|
-
import '@aptos-labs/ts-sdk';
|
|
5
|
-
import '../../core/commitments.js';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import '../../core/types/encodings.js';
|
|
8
9
|
import '../../core/layout.js';
|
|
10
|
+
import 'zod';
|
|
9
11
|
import '../../core/types/blobs.js';
|
|
10
|
-
import '../../
|
|
12
|
+
import '../../clay-codes-Ce9EmXfa.js';
|
|
13
|
+
import '@shelby-protocol/clay-codes';
|
|
14
|
+
import '../../core/operations/index.js';
|
|
15
|
+
import '../../core/operations/generated/sdk.js';
|
|
16
|
+
import 'graphql';
|
|
17
|
+
import 'graphql-request';
|
|
11
18
|
import '../../core/blobs.js';
|
|
12
19
|
import '../../core/clients/ShelbyRPCClient.js';
|
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
import "../../chunk-
|
|
1
|
+
import "../../chunk-MB7C7VQF.mjs";
|
|
2
|
+
import {
|
|
3
|
+
ShelbyMetadataClient
|
|
4
|
+
} from "../../chunk-NTJSNNA7.mjs";
|
|
2
5
|
import {
|
|
3
6
|
ShelbyNodeClient
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-P7BVGLTV.mjs";
|
|
12
|
-
import "../../chunk-GGYTHP5F.mjs";
|
|
13
|
-
import "../../chunk-D2FERD4A.mjs";
|
|
7
|
+
} from "../../chunk-EAPAG4L7.mjs";
|
|
8
|
+
import "../../chunk-6MDQI7PW.mjs";
|
|
9
|
+
import "../../chunk-XGMJ4CG4.mjs";
|
|
10
|
+
import "../../chunk-JSR44EDC.mjs";
|
|
11
|
+
import "../../chunk-75VHXY5P.mjs";
|
|
12
|
+
import "../../chunk-DLMDDEWF.mjs";
|
|
13
|
+
import "../../chunk-RBFWGDMY.mjs";
|
|
14
14
|
import "../../chunk-I6NG5GNL.mjs";
|
|
15
|
+
import "../../chunk-OTBLZL2S.mjs";
|
|
16
|
+
import "../../chunk-LTV26KU4.mjs";
|
|
17
|
+
import "../../chunk-KBUWZXFA.mjs";
|
|
18
|
+
import "../../chunk-HPVCKAN2.mjs";
|
|
19
|
+
import "../../chunk-FIFKKWXV.mjs";
|
|
20
|
+
import "../../chunk-APML3CGJ.mjs";
|
|
21
|
+
import "../../chunk-3ZDXWPYC.mjs";
|
|
22
|
+
import "../../chunk-ZPW742E7.mjs";
|
|
15
23
|
import "../../chunk-7P6ASYW6.mjs";
|
|
16
24
|
export {
|
|
25
|
+
ShelbyMetadataClient,
|
|
17
26
|
ShelbyNodeClient
|
|
18
27
|
};
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
export { ShelbyBlob, createBlobKey } from '../core/blobs.js';
|
|
2
|
+
export { CHUNK_SIZE_PARAMS, ChunkSizeScheme, DEFAULT_CHUNKSET_SIZE_BYTES, DEFAULT_CHUNK_SIZE_BYTES, ERASURE_CODE_AND_CHUNK_MAPPING } from '../core/chunk.js';
|
|
2
3
|
export { ShelbyBlobClient } from '../core/clients/ShelbyBlobClient.js';
|
|
3
|
-
export { ShelbyClient } from '../core/clients/ShelbyClient.js';
|
|
4
|
-
export { ShelbyClientConfig } from '../core/clients/ShelbyClientConfig.js';
|
|
4
|
+
export { ShelbyClient, UploadOptions } from '../core/clients/ShelbyClient.js';
|
|
5
|
+
export { ShelbyClientConfig, ShelbyIndexerConfig, ShelbyRPCConfig } from '../core/clients/ShelbyClientConfig.js';
|
|
5
6
|
export { ShelbyRPCClient } from '../core/clients/ShelbyRPCClient.js';
|
|
6
|
-
export { BlobCommitments, BlobCommitmentsSchema, ChunksetCommitment, ChunksetCommitmentSchema, generateCommitments } from '../core/commitments.js';
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
7
|
+
export { BlobCommitments, BlobCommitmentsSchema, ChunksetCommitment, ChunksetCommitmentSchema, GenerateCommitmentsOptions, expectedTotalChunksets, generateCommitments } from '../core/commitments.js';
|
|
8
|
+
export { DEFAULT_PROJECT_DESCRIPTION, DEFAULT_PROJECT_NAME, NetworkToShelbyBlobIndexerBaseUrl, NetworkToShelbyRPCBaseUrl, SHELBYUSD_TOKEN_ADDRESS, SHELBYUSD_TOKEN_MODULE, SHELBYUSD_TOKEN_NAME, SHELBYUSD_TOKEN_TYPE, SHELBY_DEPLOYER, TOKEN_DEPLOYER, TOKEN_OBJECT_ADDRESS } from '../core/constants.js';
|
|
9
|
+
export { C as ClayErasureCodingProvider, D as DecodeConfig, E as ErasureCodingConfig, a as ErasureCodingProvider, R as ReedSolomonErasureCodingProvider } from '../clay-codes-Ce9EmXfa.js';
|
|
10
|
+
export { DEFAULT_ERASURE_D, DEFAULT_ERASURE_K, DEFAULT_ERASURE_M, DEFAULT_ERASURE_N, ERASURE_CODE_PARAMS, ErasureCodeParams, ErasureCodingScheme, ErasureSchemeParams } from '../core/erasure/constants.js';
|
|
11
|
+
export { createDefaultErasureCodingProvider } from '../core/erasure/default.js';
|
|
9
12
|
export { BlobName, BlobNameSchema, ChunkKey, allChunksForBlob, roundSize } from '../core/layout.js';
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
+
export { ShelbyNetwork, isShelbyNetwork, shelbyNetworks } from '../core/networks.js';
|
|
14
|
+
export { ShelbyIndexerClient, createShelbyIndexerClient, getShelbyIndexerClient } from '../core/operations/index.js';
|
|
15
|
+
export { BlobActivity, BlobActivityType, BlobEncoding, BlobMetadata, ClayEncoding } from '../core/types/blobs.js';
|
|
16
|
+
export { StorageProviderInfo } from '../core/types/storage_providers.js';
|
|
17
|
+
export { buildRequestUrl, concatHashes, readInChunks, zeroPadBytes } from '../core/utils.js';
|
|
18
|
+
export { ShelbyMetadataClient } from './clients/ShelbyMetadataClient.js';
|
|
13
19
|
export { ShelbyNodeClient } from './clients/ShelbyNodeClient.js';
|
|
14
20
|
export { t as testUtil } from '../testUtil-BnxAchIN.js';
|
|
15
21
|
import '@aptos-labs/ts-sdk';
|
|
22
|
+
import '../core/operations/generated/sdk.js';
|
|
23
|
+
import 'graphql';
|
|
24
|
+
import 'graphql-request';
|
|
16
25
|
import 'zod';
|
|
26
|
+
import '@shelby-protocol/clay-codes';
|