@shelby-protocol/sdk 0.0.8 → 0.1.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 +13 -7
- package/dist/browser/index.mjs +102 -49
- package/dist/{chunk-HFGEQP5N.mjs → chunk-3ZL3FSNA.mjs} +4 -4
- package/dist/chunk-4MG4XGY4.mjs +91 -0
- package/dist/chunk-66GI734H.mjs +493 -0
- package/dist/chunk-AABBONAF.mjs +34 -0
- package/dist/{chunk-BBOG5JSX.mjs → chunk-AGRRYZWV.mjs} +215 -44
- package/dist/chunk-CQ6QPIZK.mjs +37 -0
- package/dist/{chunk-LGNWAXBG.mjs → chunk-DI2K6OUG.mjs} +1 -1
- package/dist/{chunk-SEXQTDX6.mjs → chunk-FLLOQZVD.mjs} +4 -0
- package/dist/chunk-IE6LYVIA.mjs +26 -0
- package/dist/{chunk-WJKSPJSS.mjs → chunk-KJ24NKPH.mjs} +46 -0
- package/dist/{chunk-ZPW742E7.mjs → chunk-LZSIZJYR.mjs} +3 -1
- package/dist/chunk-MSCUDBMH.mjs +83 -0
- package/dist/{chunk-CPNZAQVY.mjs → chunk-OMZOR2ZF.mjs} +2 -2
- package/dist/chunk-QQ57OGQ2.mjs +0 -0
- package/dist/{chunk-XWAPNLU6.mjs → chunk-RLRI2533.mjs} +4 -2
- package/dist/{chunk-NLPIHQ7K.mjs → chunk-UCDAABAS.mjs} +1 -1
- package/dist/{chunk-GY5DCVVL.mjs → chunk-W5NRGZEP.mjs} +1 -1
- package/dist/{chunk-MGAN2SBA.mjs → chunk-W6YL46DT.mjs} +28 -14
- package/dist/{chunk-CTGCK3H2.mjs → chunk-YZXIPUVQ.mjs} +32 -8
- package/dist/{chunk-QRGZJBAG.mjs → chunk-ZAM2EUVN.mjs} +165 -36
- package/dist/core/chunk.mjs +1 -1
- package/dist/core/clients/ShelbyBlobClient.d.ts +160 -11
- package/dist/core/clients/ShelbyBlobClient.mjs +11 -9
- package/dist/core/clients/ShelbyClient.d.ts +14 -3
- package/dist/core/clients/ShelbyClient.mjs +15 -13
- package/dist/core/clients/ShelbyClientConfig.d.ts +7 -2
- package/dist/core/clients/ShelbyMicropaymentChannelClient.d.ts +349 -0
- package/dist/core/clients/ShelbyMicropaymentChannelClient.mjs +16 -0
- package/dist/core/clients/ShelbyPlacementGroupClient.d.ts +73 -0
- package/dist/core/clients/ShelbyPlacementGroupClient.mjs +11 -0
- package/dist/core/clients/ShelbyRPCClient.d.ts +28 -4
- package/dist/core/clients/ShelbyRPCClient.mjs +9 -7
- package/dist/core/clients/index.d.ts +7 -3
- package/dist/core/clients/index.mjs +33 -17
- package/dist/core/clients/utils.d.ts +54 -0
- package/dist/core/clients/utils.mjs +1 -1
- package/dist/core/commitments.d.ts +5 -1
- package/dist/core/commitments.mjs +4 -2
- package/dist/core/constants.d.ts +4 -1
- package/dist/core/constants.mjs +3 -1
- package/dist/core/erasure/clay-codes.mjs +2 -2
- package/dist/core/erasure/constants.d.ts +5 -1
- package/dist/core/erasure/constants.mjs +3 -1
- package/dist/core/erasure/default.mjs +3 -3
- package/dist/core/erasure/index.d.ts +1 -1
- package/dist/core/erasure/index.mjs +8 -6
- package/dist/core/errors.d.ts +58 -0
- package/dist/core/errors.mjs +15 -0
- package/dist/core/index.d.ts +13 -7
- package/dist/core/index.mjs +102 -49
- package/dist/core/layout.mjs +2 -2
- package/dist/core/operations/generated/sdk.d.ts +207 -17
- package/dist/core/operations/generated/sdk.mjs +7 -1
- package/dist/core/operations/generated/types.d.ts +908 -0
- package/dist/core/operations/generated/types.mjs +63 -0
- package/dist/core/operations/index.d.ts +9 -3
- package/dist/core/operations/index.mjs +10 -4
- package/dist/core/rpc-responses.d.ts +69 -0
- package/dist/core/rpc-responses.mjs +15 -0
- package/dist/core/types/blobs.d.ts +7 -3
- package/dist/core/types/index.d.ts +3 -1
- package/dist/core/types/index.mjs +12 -2
- package/dist/core/types/payments.d.ts +94 -0
- package/dist/core/types/payments.mjs +9 -0
- package/dist/core/types/placement_groups.d.ts +30 -1
- package/dist/core/types/placement_groups.mjs +1 -0
- package/dist/core/types/storage_providers.d.ts +32 -2
- package/dist/node/clients/ShelbyMetadataClient.mjs +3 -3
- package/dist/node/clients/ShelbyNodeClient.d.ts +4 -3
- package/dist/node/clients/ShelbyNodeClient.mjs +16 -14
- package/dist/node/clients/index.d.ts +4 -3
- package/dist/node/clients/index.mjs +19 -17
- package/dist/node/index.d.ts +13 -7
- package/dist/node/index.mjs +106 -53
- package/package.json +3 -2
- package/dist/chunk-RBFWGDMY.mjs +0 -30
- /package/dist/{chunk-DJJD2AXO.mjs → chunk-AD2G3QYD.mjs} +0 -0
- /package/dist/{chunk-MWDW4ROU.mjs → chunk-EM67QTMR.mjs} +0 -0
- /package/dist/{chunk-RNXGC54D.mjs → chunk-FGUK6IBA.mjs} +0 -0
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
export { getAptosAccountExplorerUrl, getAptosTransactionExplorerUrl } from '../core/aptos-explorer.js';
|
|
2
2
|
export { ShelbyBlob, createBlobKey } from '../core/blobs.js';
|
|
3
3
|
export { CHUNK_SIZE_PARAMS, ChunkSizeScheme, DEFAULT_CHUNKSET_SIZE_BYTES, DEFAULT_CHUNK_SIZE_BYTES, ERASURE_CODE_AND_CHUNK_MAPPING } from '../core/chunk.js';
|
|
4
|
-
export { ShelbyBlobClient } from '../core/clients/ShelbyBlobClient.js';
|
|
4
|
+
export { AckTransactionOptions, BuildOptions, MissingTransactionSubmitterError, ShelbyBlobClient, UsdSponsorOptions, WriteBlobCommitmentsOptions } from '../core/clients/ShelbyBlobClient.js';
|
|
5
5
|
export { ShelbyClient, UploadOptions } from '../core/clients/ShelbyClient.js';
|
|
6
6
|
export { ShelbyClientConfig, ShelbyIndexerConfig, ShelbyRPCConfig } from '../core/clients/ShelbyClientConfig.js';
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
7
|
+
export { ShelbyMicropaymentChannelClient } from '../core/clients/ShelbyMicropaymentChannelClient.js';
|
|
8
|
+
export { ShelbyPlacementGroupClient } from '../core/clients/ShelbyPlacementGroupClient.js';
|
|
9
|
+
export { BlobDataSource, PutBlobProgress, ShelbyRPCClient } from '../core/clients/ShelbyRPCClient.js';
|
|
10
|
+
export { BlobCommitments, BlobCommitmentsSchema, COMMITMENT_SCHEMA_VERSION, ChunksetCommitment, ChunksetCommitmentSchema, GenerateCommitmentsOptions, expectedTotalChunksets, generateCommitments, generateMerkleRoot } from '../core/commitments.js';
|
|
11
|
+
export { DEFAULT_PROJECT_DESCRIPTION, DEFAULT_PROJECT_NAME, MICROPAYMENTS_DEPLOYER, NetworkToShelbyBlobIndexerBaseUrl, NetworkToShelbyRPCBaseUrl, SHELBYUSD_FA_METADATA_ADDRESS, SHELBYUSD_TOKEN_ADDRESS, SHELBYUSD_TOKEN_MODULE, SHELBYUSD_TOKEN_NAME, SHELBY_DEPLOYER, TOKEN_DEPLOYER, TOKEN_OBJECT_ADDRESS } from '../core/constants.js';
|
|
10
12
|
export { C as ClayErasureCodingProvider, D as DecodeConfig, E as ErasureCodingConfig, a as ErasureCodingProvider, R as ReedSolomonErasureCodingProvider } from '../clay-codes-pdZFxI_B.js';
|
|
11
|
-
export { DEFAULT_ERASURE_D, DEFAULT_ERASURE_K, DEFAULT_ERASURE_M, DEFAULT_ERASURE_N, ERASURE_CODE_PARAMS, ErasureCodeParams, ErasureCodingScheme, ErasureSchemeParams } from '../core/erasure/constants.js';
|
|
13
|
+
export { DEFAULT_ERASURE_D, DEFAULT_ERASURE_K, DEFAULT_ERASURE_M, DEFAULT_ERASURE_N, DEFAULT_SAMPLE_SIZE, ERASURE_CODE_PARAMS, ErasureCodeParams, ErasureCodingScheme, ErasureSchemeParams } from '../core/erasure/constants.js';
|
|
12
14
|
export { createDefaultErasureCodingProvider } from '../core/erasure/default.js';
|
|
15
|
+
export { ShelbyErrorCodes, isAccessDeniedError, isBlobAlreadyExistsError, isBlobExpiredError, isBlobNotFoundError } from '../core/errors.js';
|
|
13
16
|
export { BlobName, BlobNameSchema, ChunkKey, allChunksForBlob, roundSize } from '../core/layout.js';
|
|
14
17
|
export { ShelbyNetwork, isShelbyNetwork, shelbyNetworks } from '../core/networks.js';
|
|
15
18
|
export { ShelbyIndexerClient, createShelbyIndexerClient, getShelbyIndexerClient } from '../core/operations/index.js';
|
|
19
|
+
export { CompleteMultipartUploadResponse, CompleteMultipartUploadResponseSchema, RPCErrorResponse, RPCErrorResponseSchema, StaleMicropaymentErrorResponse, StaleMicropaymentErrorResponseSchema, StartMultipartUploadResponse, StartMultipartUploadResponseSchema, UploadPartResponse, UploadPartResponseSchema } from '../core/rpc-responses.js';
|
|
16
20
|
export { getShelbyAccountBlobsExplorerUrl, getShelbyAccountExplorerUrl, getShelbyBlobExplorerUrl } from '../core/shelby-explorer.js';
|
|
17
21
|
export { BlobActivity, BlobActivityType, BlobEncoding, BlobMetadata, ClayEncoding, StorageProviderAck } from '../core/types/blobs.js';
|
|
18
|
-
export {
|
|
22
|
+
export { ChannelInfo, SenderBuiltMicropayment, StaleChannelStateError } from '../core/types/payments.js';
|
|
23
|
+
export { PlacementGroupInfo, PlacementGroupSlot, PlacementGroupSlotStatus } from '../core/types/placement_groups.js';
|
|
24
|
+
export { ActiveStateDetails, FrozenStateDetails, StorageProviderInfo, StorageProviderStateDetails, WaitlistedStateDetails } from '../core/types/storage_providers.js';
|
|
19
25
|
export { buildRequestUrl, concatHashes, getBlobNameSuffix, readInChunks, zeroPadBytes } from '../core/utils.js';
|
|
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 '../core/operations/generated/sdk.js';
|
|
26
|
+
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, GetBlobActivitiesCountQuery, GetBlobActivitiesCountQueryVariables, GetBlobActivitiesDocument, GetBlobActivitiesQuery, GetBlobActivitiesQueryVariables, GetBlobsCountDocument, GetBlobsCountQuery, GetBlobsCountQueryVariables, GetBlobsDocument, GetBlobsQuery, GetBlobsQueryVariables, GetPlacementGroupSlotsCountDocument, GetPlacementGroupSlotsCountQuery, GetPlacementGroupSlotsCountQueryVariables, GetPlacementGroupSlotsDocument, GetPlacementGroupSlotsQuery, GetPlacementGroupSlotsQueryVariables, GetProcessorStatusDocument, GetProcessorStatusQuery, GetProcessorStatusQueryVariables, 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 '../core/operations/generated/sdk.js';
|
|
21
27
|
import '@aptos-labs/ts-sdk';
|
|
22
28
|
import 'zod';
|
|
23
29
|
import '@shelby-protocol/clay-codes';
|
package/dist/browser/index.mjs
CHANGED
|
@@ -1,36 +1,44 @@
|
|
|
1
|
-
import "../chunk-
|
|
2
|
-
import "../chunk-
|
|
3
|
-
import "../chunk-MQUVYMNQ.mjs";
|
|
4
|
-
import "../chunk-ZHXCVRZX.mjs";
|
|
5
|
-
import "../chunk-RNXGC54D.mjs";
|
|
1
|
+
import "../chunk-EM67QTMR.mjs";
|
|
2
|
+
import "../chunk-FGUK6IBA.mjs";
|
|
6
3
|
import {
|
|
7
4
|
ShelbyClient
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-Z7RFCADT.mjs";
|
|
10
|
-
import {
|
|
11
|
-
ShelbyRPCClient
|
|
12
|
-
} from "../chunk-QRGZJBAG.mjs";
|
|
13
|
-
import {
|
|
14
|
-
isShelbyNetwork,
|
|
15
|
-
shelbyNetworks
|
|
16
|
-
} from "../chunk-VRLIOKWG.mjs";
|
|
17
|
-
import "../chunk-I6NG5GNL.mjs";
|
|
18
|
-
import {
|
|
19
|
-
getShelbyAccountBlobsExplorerUrl,
|
|
20
|
-
getShelbyAccountExplorerUrl,
|
|
21
|
-
getShelbyBlobExplorerUrl
|
|
22
|
-
} from "../chunk-BDSW5PHM.mjs";
|
|
5
|
+
} from "../chunk-W6YL46DT.mjs";
|
|
23
6
|
import {
|
|
7
|
+
MissingTransactionSubmitterError,
|
|
24
8
|
ShelbyBlobClient
|
|
25
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-AGRRYZWV.mjs";
|
|
26
10
|
import "../chunk-XNEIWM4O.mjs";
|
|
11
|
+
import {
|
|
12
|
+
createDefaultErasureCodingProvider
|
|
13
|
+
} from "../chunk-OMZOR2ZF.mjs";
|
|
14
|
+
import {
|
|
15
|
+
ClayErasureCodingProvider
|
|
16
|
+
} from "../chunk-UCDAABAS.mjs";
|
|
27
17
|
import {
|
|
28
18
|
ReedSolomonErasureCodingProvider
|
|
29
19
|
} from "../chunk-PZF2VTGP.mjs";
|
|
20
|
+
import "../chunk-Z7RFCADT.mjs";
|
|
21
|
+
import {
|
|
22
|
+
ShelbyMicropaymentChannelClient
|
|
23
|
+
} from "../chunk-66GI734H.mjs";
|
|
24
|
+
import "../chunk-QQ57OGQ2.mjs";
|
|
25
|
+
import "../chunk-ZHXCVRZX.mjs";
|
|
26
|
+
import "../chunk-AD2G3QYD.mjs";
|
|
27
|
+
import "../chunk-MQUVYMNQ.mjs";
|
|
28
|
+
import {
|
|
29
|
+
ShelbyPlacementGroupClient
|
|
30
|
+
} from "../chunk-MSCUDBMH.mjs";
|
|
31
|
+
import {
|
|
32
|
+
ShelbyRPCClient
|
|
33
|
+
} from "../chunk-ZAM2EUVN.mjs";
|
|
34
|
+
import {
|
|
35
|
+
SenderBuiltMicropayment,
|
|
36
|
+
StaleChannelStateError
|
|
37
|
+
} from "../chunk-4MG4XGY4.mjs";
|
|
30
38
|
import {
|
|
31
39
|
createShelbyIndexerClient,
|
|
32
40
|
getShelbyIndexerClient
|
|
33
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-3ZL3FSNA.mjs";
|
|
34
42
|
import {
|
|
35
43
|
Blob_Activities_Select_Column,
|
|
36
44
|
Blobs_Select_Column,
|
|
@@ -39,18 +47,38 @@ import {
|
|
|
39
47
|
GetBlobActivitiesDocument,
|
|
40
48
|
GetBlobsCountDocument,
|
|
41
49
|
GetBlobsDocument,
|
|
50
|
+
GetPlacementGroupSlotsCountDocument,
|
|
51
|
+
GetPlacementGroupSlotsDocument,
|
|
52
|
+
GetProcessorStatusDocument,
|
|
42
53
|
Order_By,
|
|
43
54
|
Placement_Group_Slots_Select_Column,
|
|
44
55
|
Processor_Status_Select_Column,
|
|
45
56
|
getSdk
|
|
46
|
-
} from "../chunk-
|
|
47
|
-
import "../chunk-
|
|
57
|
+
} from "../chunk-KJ24NKPH.mjs";
|
|
58
|
+
import "../chunk-AABBONAF.mjs";
|
|
48
59
|
import {
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
BlobNameSchema,
|
|
61
|
+
ChunkKey,
|
|
62
|
+
allChunksForBlob,
|
|
63
|
+
roundSize
|
|
64
|
+
} from "../chunk-W5NRGZEP.mjs";
|
|
51
65
|
import {
|
|
52
|
-
|
|
53
|
-
|
|
66
|
+
isShelbyNetwork,
|
|
67
|
+
shelbyNetworks
|
|
68
|
+
} from "../chunk-VRLIOKWG.mjs";
|
|
69
|
+
import "../chunk-I6NG5GNL.mjs";
|
|
70
|
+
import {
|
|
71
|
+
CompleteMultipartUploadResponseSchema,
|
|
72
|
+
RPCErrorResponseSchema,
|
|
73
|
+
StaleMicropaymentErrorResponseSchema,
|
|
74
|
+
StartMultipartUploadResponseSchema,
|
|
75
|
+
UploadPartResponseSchema
|
|
76
|
+
} from "../chunk-IE6LYVIA.mjs";
|
|
77
|
+
import {
|
|
78
|
+
getShelbyAccountBlobsExplorerUrl,
|
|
79
|
+
getShelbyAccountExplorerUrl,
|
|
80
|
+
getShelbyBlobExplorerUrl
|
|
81
|
+
} from "../chunk-BDSW5PHM.mjs";
|
|
54
82
|
import {
|
|
55
83
|
getAptosAccountExplorerUrl,
|
|
56
84
|
getAptosTransactionExplorerUrl
|
|
@@ -60,11 +88,12 @@ import {
|
|
|
60
88
|
} from "../chunk-OTBLZL2S.mjs";
|
|
61
89
|
import {
|
|
62
90
|
BlobCommitmentsSchema,
|
|
91
|
+
COMMITMENT_SCHEMA_VERSION,
|
|
63
92
|
ChunksetCommitmentSchema,
|
|
64
93
|
expectedTotalChunksets,
|
|
65
94
|
generateCommitments,
|
|
66
95
|
generateMerkleRoot
|
|
67
|
-
} from "../chunk-
|
|
96
|
+
} from "../chunk-RLRI2533.mjs";
|
|
68
97
|
import {
|
|
69
98
|
buildRequestUrl,
|
|
70
99
|
concatHashes,
|
|
@@ -72,25 +101,6 @@ import {
|
|
|
72
101
|
readInChunks,
|
|
73
102
|
zeroPadBytes
|
|
74
103
|
} from "../chunk-4JZO2D7T.mjs";
|
|
75
|
-
import {
|
|
76
|
-
DEFAULT_PROJECT_DESCRIPTION,
|
|
77
|
-
DEFAULT_PROJECT_NAME,
|
|
78
|
-
NetworkToShelbyBlobIndexerBaseUrl,
|
|
79
|
-
NetworkToShelbyRPCBaseUrl,
|
|
80
|
-
SHELBYUSD_FA_METADATA_ADDRESS,
|
|
81
|
-
SHELBYUSD_TOKEN_ADDRESS,
|
|
82
|
-
SHELBYUSD_TOKEN_MODULE,
|
|
83
|
-
SHELBYUSD_TOKEN_NAME,
|
|
84
|
-
SHELBY_DEPLOYER,
|
|
85
|
-
TOKEN_DEPLOYER,
|
|
86
|
-
TOKEN_OBJECT_ADDRESS
|
|
87
|
-
} from "../chunk-SEXQTDX6.mjs";
|
|
88
|
-
import {
|
|
89
|
-
BlobNameSchema,
|
|
90
|
-
ChunkKey,
|
|
91
|
-
allChunksForBlob,
|
|
92
|
-
roundSize
|
|
93
|
-
} from "../chunk-GY5DCVVL.mjs";
|
|
94
104
|
import {
|
|
95
105
|
CHUNK_SIZE_PARAMS,
|
|
96
106
|
ChunkSizeScheme,
|
|
@@ -103,9 +113,31 @@ import {
|
|
|
103
113
|
DEFAULT_ERASURE_K,
|
|
104
114
|
DEFAULT_ERASURE_M,
|
|
105
115
|
DEFAULT_ERASURE_N,
|
|
116
|
+
DEFAULT_SAMPLE_SIZE,
|
|
106
117
|
ERASURE_CODE_PARAMS,
|
|
107
118
|
ErasureCodingScheme
|
|
108
|
-
} from "../chunk-
|
|
119
|
+
} from "../chunk-LZSIZJYR.mjs";
|
|
120
|
+
import {
|
|
121
|
+
DEFAULT_PROJECT_DESCRIPTION,
|
|
122
|
+
DEFAULT_PROJECT_NAME,
|
|
123
|
+
MICROPAYMENTS_DEPLOYER,
|
|
124
|
+
NetworkToShelbyBlobIndexerBaseUrl,
|
|
125
|
+
NetworkToShelbyRPCBaseUrl,
|
|
126
|
+
SHELBYUSD_FA_METADATA_ADDRESS,
|
|
127
|
+
SHELBYUSD_TOKEN_ADDRESS,
|
|
128
|
+
SHELBYUSD_TOKEN_MODULE,
|
|
129
|
+
SHELBYUSD_TOKEN_NAME,
|
|
130
|
+
SHELBY_DEPLOYER,
|
|
131
|
+
TOKEN_DEPLOYER,
|
|
132
|
+
TOKEN_OBJECT_ADDRESS
|
|
133
|
+
} from "../chunk-FLLOQZVD.mjs";
|
|
134
|
+
import {
|
|
135
|
+
ShelbyErrorCodes,
|
|
136
|
+
isAccessDeniedError,
|
|
137
|
+
isBlobAlreadyExistsError,
|
|
138
|
+
isBlobExpiredError,
|
|
139
|
+
isBlobNotFoundError
|
|
140
|
+
} from "../chunk-CQ6QPIZK.mjs";
|
|
109
141
|
import "../chunk-7P6ASYW6.mjs";
|
|
110
142
|
export {
|
|
111
143
|
BlobCommitmentsSchema,
|
|
@@ -113,10 +145,12 @@ export {
|
|
|
113
145
|
Blob_Activities_Select_Column,
|
|
114
146
|
Blobs_Select_Column,
|
|
115
147
|
CHUNK_SIZE_PARAMS,
|
|
148
|
+
COMMITMENT_SCHEMA_VERSION,
|
|
116
149
|
ChunkKey,
|
|
117
150
|
ChunkSizeScheme,
|
|
118
151
|
ChunksetCommitmentSchema,
|
|
119
152
|
ClayErasureCodingProvider,
|
|
153
|
+
CompleteMultipartUploadResponseSchema,
|
|
120
154
|
Cursor_Ordering,
|
|
121
155
|
DEFAULT_CHUNKSET_SIZE_BYTES,
|
|
122
156
|
DEFAULT_CHUNK_SIZE_BYTES,
|
|
@@ -126,6 +160,7 @@ export {
|
|
|
126
160
|
DEFAULT_ERASURE_N,
|
|
127
161
|
DEFAULT_PROJECT_DESCRIPTION,
|
|
128
162
|
DEFAULT_PROJECT_NAME,
|
|
163
|
+
DEFAULT_SAMPLE_SIZE,
|
|
129
164
|
ERASURE_CODE_AND_CHUNK_MAPPING,
|
|
130
165
|
ERASURE_CODE_PARAMS,
|
|
131
166
|
ErasureCodingScheme,
|
|
@@ -133,22 +168,36 @@ export {
|
|
|
133
168
|
GetBlobActivitiesDocument,
|
|
134
169
|
GetBlobsCountDocument,
|
|
135
170
|
GetBlobsDocument,
|
|
171
|
+
GetPlacementGroupSlotsCountDocument,
|
|
172
|
+
GetPlacementGroupSlotsDocument,
|
|
173
|
+
GetProcessorStatusDocument,
|
|
174
|
+
MICROPAYMENTS_DEPLOYER,
|
|
175
|
+
MissingTransactionSubmitterError,
|
|
136
176
|
NetworkToShelbyBlobIndexerBaseUrl,
|
|
137
177
|
NetworkToShelbyRPCBaseUrl,
|
|
138
178
|
Order_By,
|
|
139
179
|
Placement_Group_Slots_Select_Column,
|
|
140
180
|
Processor_Status_Select_Column,
|
|
181
|
+
RPCErrorResponseSchema,
|
|
141
182
|
ReedSolomonErasureCodingProvider,
|
|
142
183
|
SHELBYUSD_FA_METADATA_ADDRESS,
|
|
143
184
|
SHELBYUSD_TOKEN_ADDRESS,
|
|
144
185
|
SHELBYUSD_TOKEN_MODULE,
|
|
145
186
|
SHELBYUSD_TOKEN_NAME,
|
|
146
187
|
SHELBY_DEPLOYER,
|
|
188
|
+
SenderBuiltMicropayment,
|
|
147
189
|
ShelbyBlobClient,
|
|
148
190
|
ShelbyClient,
|
|
191
|
+
ShelbyErrorCodes,
|
|
192
|
+
ShelbyMicropaymentChannelClient,
|
|
193
|
+
ShelbyPlacementGroupClient,
|
|
149
194
|
ShelbyRPCClient,
|
|
195
|
+
StaleChannelStateError,
|
|
196
|
+
StaleMicropaymentErrorResponseSchema,
|
|
197
|
+
StartMultipartUploadResponseSchema,
|
|
150
198
|
TOKEN_DEPLOYER,
|
|
151
199
|
TOKEN_OBJECT_ADDRESS,
|
|
200
|
+
UploadPartResponseSchema,
|
|
152
201
|
allChunksForBlob,
|
|
153
202
|
buildRequestUrl,
|
|
154
203
|
concatHashes,
|
|
@@ -166,6 +215,10 @@ export {
|
|
|
166
215
|
getShelbyAccountExplorerUrl,
|
|
167
216
|
getShelbyBlobExplorerUrl,
|
|
168
217
|
getShelbyIndexerClient,
|
|
218
|
+
isAccessDeniedError,
|
|
219
|
+
isBlobAlreadyExistsError,
|
|
220
|
+
isBlobExpiredError,
|
|
221
|
+
isBlobNotFoundError,
|
|
169
222
|
isShelbyNetwork,
|
|
170
223
|
readInChunks,
|
|
171
224
|
roundSize,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getSdk
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KJ24NKPH.mjs";
|
|
4
4
|
import {
|
|
5
5
|
getAptosConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AABBONAF.mjs";
|
|
7
7
|
import {
|
|
8
8
|
NetworkToShelbyBlobIndexerBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FLLOQZVD.mjs";
|
|
10
10
|
|
|
11
11
|
// src/core/operations/index.ts
|
|
12
12
|
import { Network } from "@aptos-labs/ts-sdk";
|
|
@@ -16,7 +16,7 @@ function createShelbyIndexerClient(baseUrl, options) {
|
|
|
16
16
|
return getSdk(graphqlClient);
|
|
17
17
|
}
|
|
18
18
|
function getShelbyIndexerClient(config) {
|
|
19
|
-
const aptosConfig =
|
|
19
|
+
const aptosConfig = getAptosConfig(config);
|
|
20
20
|
let { apiKey: indexerApiKey, baseUrl } = config.indexer ?? {};
|
|
21
21
|
if (!baseUrl) {
|
|
22
22
|
switch (aptosConfig?.network) {
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// src/core/types/payments.ts
|
|
2
|
+
import {
|
|
3
|
+
AccountAuthenticator,
|
|
4
|
+
Deserializer,
|
|
5
|
+
Hex,
|
|
6
|
+
MultiAgentTransaction,
|
|
7
|
+
Serializer
|
|
8
|
+
} from "@aptos-labs/ts-sdk";
|
|
9
|
+
var StaleChannelStateError = class _StaleChannelStateError extends Error {
|
|
10
|
+
/**
|
|
11
|
+
* The last valid micropayment stored by the server.
|
|
12
|
+
* Clients can use this to reset their local channel state.
|
|
13
|
+
*/
|
|
14
|
+
storedMicropayment;
|
|
15
|
+
constructor(storedMicropayment, message) {
|
|
16
|
+
super(
|
|
17
|
+
message ?? "Client has stale channel state. Use the returned micropayment to reset local state."
|
|
18
|
+
);
|
|
19
|
+
this.name = "StaleChannelStateError";
|
|
20
|
+
this.storedMicropayment = storedMicropayment;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns the stored micropayment as a base64-encoded string.
|
|
24
|
+
*/
|
|
25
|
+
toBase64() {
|
|
26
|
+
const bytes = this.storedMicropayment.bcsToBytes();
|
|
27
|
+
const binaryString = Array.from(
|
|
28
|
+
bytes,
|
|
29
|
+
(byte) => String.fromCharCode(byte)
|
|
30
|
+
).join("");
|
|
31
|
+
return btoa(binaryString);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates a StaleChannelStateError from a base64-encoded micropayment string.
|
|
35
|
+
*/
|
|
36
|
+
static fromBase64(base64, message) {
|
|
37
|
+
const binaryString = atob(base64);
|
|
38
|
+
const bytes = Uint8Array.from(binaryString, (char) => char.charCodeAt(0));
|
|
39
|
+
const micropayment = SenderBuiltMicropayment.deserialize(bytes);
|
|
40
|
+
return new _StaleChannelStateError(micropayment, message);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var SenderBuiltMicropayment = class _SenderBuiltMicropayment {
|
|
44
|
+
/**
|
|
45
|
+
* The actual micropayment transaction. It is built with the receiver address as fee payer and also requires a signature from the receiver to submit.
|
|
46
|
+
*/
|
|
47
|
+
micropayment;
|
|
48
|
+
/**
|
|
49
|
+
* The sender's signature.
|
|
50
|
+
*/
|
|
51
|
+
senderSignature;
|
|
52
|
+
constructor(micropayment, senderSignature) {
|
|
53
|
+
this.micropayment = micropayment;
|
|
54
|
+
this.senderSignature = senderSignature;
|
|
55
|
+
}
|
|
56
|
+
serialize(serializer) {
|
|
57
|
+
this.micropayment.serialize(serializer);
|
|
58
|
+
this.senderSignature.serialize(serializer);
|
|
59
|
+
}
|
|
60
|
+
bcsToBytes() {
|
|
61
|
+
const serializer = new Serializer();
|
|
62
|
+
this.serialize(serializer);
|
|
63
|
+
return serializer.toUint8Array();
|
|
64
|
+
}
|
|
65
|
+
bcsToHex() {
|
|
66
|
+
return Hex.fromHexInput(this.bcsToBytes());
|
|
67
|
+
}
|
|
68
|
+
toStringWithoutPrefix() {
|
|
69
|
+
return this.bcsToHex().toStringWithoutPrefix();
|
|
70
|
+
}
|
|
71
|
+
toString() {
|
|
72
|
+
return this.bcsToHex().toString();
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Deserializes a SenderBuiltMicropayment from BCS bytes.
|
|
76
|
+
* @param bytes - The bytes to deserialize from (Uint8Array or hex string).
|
|
77
|
+
* @returns A new SenderBuiltMicropayment instance.
|
|
78
|
+
*/
|
|
79
|
+
static deserialize(bytes) {
|
|
80
|
+
const bytesArray = typeof bytes === "string" ? Hex.fromHexInput(bytes).toUint8Array() : bytes;
|
|
81
|
+
const deserializer = new Deserializer(bytesArray);
|
|
82
|
+
const micropayment = MultiAgentTransaction.deserialize(deserializer);
|
|
83
|
+
const senderSignature = AccountAuthenticator.deserialize(deserializer);
|
|
84
|
+
return new _SenderBuiltMicropayment(micropayment, senderSignature);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
StaleChannelStateError,
|
|
90
|
+
SenderBuiltMicropayment
|
|
91
|
+
};
|