@shelby-protocol/sdk 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/browser/index.d.ts +6 -5
  2. package/dist/browser/index.mjs +49 -39
  3. package/dist/{chunk-DI2K6OUG.mjs → chunk-33BZ7KYA.mjs} +1 -1
  4. package/dist/chunk-3NRBHSMQ.mjs +12 -0
  5. package/dist/{chunk-FLLOQZVD.mjs → chunk-4ZOFT75Q.mjs} +12 -2
  6. package/dist/{chunk-W6YL46DT.mjs → chunk-5CES6RPZ.mjs} +33 -10
  7. package/dist/{chunk-YZXIPUVQ.mjs → chunk-7O77OM4T.mjs} +108 -29
  8. package/dist/{chunk-LZSIZJYR.mjs → chunk-AUQDI5BS.mjs} +14 -1
  9. package/dist/{chunk-RLRI2533.mjs → chunk-BXEVML7N.mjs} +4 -4
  10. package/dist/{chunk-3ZL3FSNA.mjs → chunk-CGYJLKBU.mjs} +1 -1
  11. package/dist/{chunk-VRLIOKWG.mjs → chunk-D6GQHO6G.mjs} +5 -1
  12. package/dist/{chunk-ZAM2EUVN.mjs → chunk-EFR6H3RT.mjs} +7 -7
  13. package/dist/chunk-HPPMI7DC.mjs +56 -0
  14. package/dist/{chunk-AGRRYZWV.mjs → chunk-IBAUPQOF.mjs} +37 -24
  15. package/dist/{chunk-67F5YZ25.mjs → chunk-JTXYKO3U.mjs} +10 -0
  16. package/dist/chunk-KTVNKLBT.mjs +207 -0
  17. package/dist/{chunk-PZF2VTGP.mjs → chunk-NHWWORCH.mjs} +3 -1
  18. package/dist/{chunk-UCDAABAS.mjs → chunk-OGKZ575S.mjs} +6 -19
  19. package/dist/{chunk-66GI734H.mjs → chunk-OQNP5QXH.mjs} +87 -75
  20. package/dist/{chunk-4JZO2D7T.mjs → chunk-UEZNZBJO.mjs} +9 -2
  21. package/dist/{chunk-MSCUDBMH.mjs → chunk-W37FZSMA.mjs} +1 -1
  22. package/dist/chunk-Z4FZ7W6L.mjs +39 -0
  23. package/dist/{clay-codes-pdZFxI_B.d.ts → clay-codes-DHP-bYcP.d.ts} +6 -2
  24. package/dist/core/blobs.d.ts +2 -0
  25. package/dist/core/blobs.mjs +2 -1
  26. package/dist/core/chunk.d.ts +10 -1
  27. package/dist/core/chunk.mjs +2 -2
  28. package/dist/core/clients/ShelbyBlobClient.d.ts +5 -1
  29. package/dist/core/clients/ShelbyBlobClient.mjs +11 -11
  30. package/dist/core/clients/ShelbyClient.d.ts +8 -2
  31. package/dist/core/clients/ShelbyClient.mjs +16 -15
  32. package/dist/core/clients/ShelbyMetadataClient.d.ts +123 -0
  33. package/dist/{node → core}/clients/ShelbyMetadataClient.mjs +3 -2
  34. package/dist/core/clients/ShelbyMicropaymentChannelClient.d.ts +39 -34
  35. package/dist/core/clients/ShelbyMicropaymentChannelClient.mjs +6 -5
  36. package/dist/core/clients/ShelbyPlacementGroupClient.mjs +3 -3
  37. package/dist/core/clients/ShelbyRPCClient.d.ts +2 -0
  38. package/dist/core/clients/ShelbyRPCClient.mjs +6 -8
  39. package/dist/core/clients/index.d.ts +4 -2
  40. package/dist/core/clients/index.mjs +27 -23
  41. package/dist/core/commitments.d.ts +1 -1
  42. package/dist/core/commitments.mjs +4 -4
  43. package/dist/core/constants.d.ts +15 -3
  44. package/dist/core/constants.mjs +3 -1
  45. package/dist/core/erasure/clay-codes.d.ts +1 -1
  46. package/dist/core/erasure/clay-codes.mjs +5 -5
  47. package/dist/core/erasure/constants.d.ts +10 -2
  48. package/dist/core/erasure/constants.mjs +1 -1
  49. package/dist/core/erasure/default.d.ts +5 -2
  50. package/dist/core/erasure/default.mjs +12 -6
  51. package/dist/core/erasure/index.d.ts +2 -2
  52. package/dist/core/erasure/index.mjs +15 -9
  53. package/dist/core/erasure/provider.d.ts +1 -1
  54. package/dist/core/erasure/reed-solomon.d.ts +1 -1
  55. package/dist/core/erasure/reed-solomon.mjs +1 -1
  56. package/dist/core/erasure/utils.d.ts +1 -1
  57. package/dist/core/index.d.ts +6 -5
  58. package/dist/core/index.mjs +49 -39
  59. package/dist/core/layout.d.ts +5 -16
  60. package/dist/core/layout.mjs +3 -9
  61. package/dist/core/networks.d.ts +1 -1
  62. package/dist/core/networks.mjs +1 -1
  63. package/dist/core/operations/index.mjs +2 -2
  64. package/dist/core/types/blobs.d.ts +1 -1
  65. package/dist/core/types/encodings.d.ts +1 -1
  66. package/dist/core/types/index.d.ts +1 -1
  67. package/dist/core/types/index.mjs +3 -2
  68. package/dist/core/types/payments.d.ts +82 -9
  69. package/dist/core/types/payments.mjs +2 -1
  70. package/dist/core/types/placement_groups.d.ts +2 -2
  71. package/dist/core/types/storage_providers.d.ts +2 -2
  72. package/dist/core/utils.d.ts +3 -2
  73. package/dist/core/utils.mjs +3 -1
  74. package/dist/node/clients/ShelbyNodeClient.d.ts +5 -3
  75. package/dist/node/clients/ShelbyNodeClient.mjs +17 -16
  76. package/dist/node/clients/index.d.ts +3 -3
  77. package/dist/node/clients/index.mjs +18 -18
  78. package/dist/node/index.d.ts +6 -6
  79. package/dist/node/index.mjs +52 -46
  80. package/package.json +1 -1
  81. package/dist/chunk-4MG4XGY4.mjs +0 -91
  82. package/dist/chunk-OMZOR2ZF.mjs +0 -29
  83. package/dist/chunk-OTBLZL2S.mjs +0 -9
  84. package/dist/chunk-W5NRGZEP.mjs +0 -86
  85. package/dist/core/operations/generated/types.d.ts +0 -908
  86. package/dist/core/operations/generated/types.mjs +0 -63
  87. package/dist/node/clients/ShelbyMetadataClient.d.ts +0 -72
  88. /package/dist/{chunk-FGUK6IBA.mjs → chunk-WTICJPDB.mjs} +0 -0
@@ -0,0 +1,123 @@
1
+ import { Aptos, AccountAddress, AccountAddressInput } from '@aptos-labs/ts-sdk';
2
+ import { StorageProviderInfo } from '../types/storage_providers.js';
3
+ import { ShelbyClientConfig } from './ShelbyClientConfig.js';
4
+ import '../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
+ * Gets the placement group address for a slice.
58
+ *
59
+ * @param sliceAddress - The address of the slice account.
60
+ * @returns The placement group address as a string.
61
+ */
62
+ private getPlacementGroupAddressForSlice;
63
+ /**
64
+ * Retrieves the designated storage providers for a slice.
65
+ *
66
+ * Designated SPs are those appointed to store data for their slots:
67
+ * - Active: Currently serving data
68
+ * - Receiving: Receiving data during slot transfer
69
+ * - Repairing: Repairing data after crash or failed transfer
70
+ * - Reconstructing: Reconstructing data if the repair fails
71
+ *
72
+ * @param params.account - The address of the slice account.
73
+ * @returns An array where result[i] is the designated SP for slot i, or null if no SP is designated.
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * const providers = await client.getDesignatedStorageProvidersForSlice({ account: sliceAddress });
78
+ * ```
79
+ */
80
+ getDesignatedStorageProvidersForSlice(params: {
81
+ account: AccountAddressInput;
82
+ }): Promise<(AccountAddress | null)[]>;
83
+ /**
84
+ * Retrieves the active storage providers for a slice.
85
+ *
86
+ * Active SPs have a complete copy of the data for the slot, and are not in any data transfer/repair/reconstruction phase.
87
+ * Active SP can be audited for the data it contains.
88
+ * Each slot has at most one active SP.
89
+ *
90
+ * @param params.account - The address of the slice account.
91
+ * @returns An array where result[i] is the active SP for slot i, or null if no SP is active.
92
+ *
93
+ * @example
94
+ * ```typescript
95
+ * const providers = await client.getActiveStorageProvidersForSlice({ account: sliceAddress });
96
+ * ```
97
+ */
98
+ getActiveStorageProvidersForSlice(params: {
99
+ account: AccountAddressInput;
100
+ }): Promise<(AccountAddress | null)[]>;
101
+ /**
102
+ * Retrieves the serving storage providers for a slice.
103
+ *
104
+ * Serving SPs are those that can respond to read requests. The serving logic is:
105
+ * - If an Active SP exists for a slot: Only the Active SP is serving
106
+ * - If no Active SP (transition in progress): Both Designated and Vacating SPs serve
107
+ *
108
+ * Each slot may have multiple serving SPs during transitions.
109
+ *
110
+ * @param params.account - The address of the slice account.
111
+ * @returns An array where result[i] contains the serving SPs for slot i.
112
+ *
113
+ * @example
114
+ * ```typescript
115
+ * const providers = await client.getServingStorageProvidersForSlice({ account: sliceAddress });
116
+ * ```
117
+ */
118
+ getServingStorageProvidersForSlice(params: {
119
+ account: AccountAddressInput;
120
+ }): Promise<AccountAddress[][]>;
121
+ }
122
+
123
+ export { ShelbyMetadataClient };
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  ShelbyMetadataClient
3
- } from "../../chunk-YZXIPUVQ.mjs";
3
+ } from "../../chunk-7O77OM4T.mjs";
4
4
  import "../../chunk-AABBONAF.mjs";
5
- import "../../chunk-FLLOQZVD.mjs";
5
+ import "../../chunk-UEZNZBJO.mjs";
6
+ import "../../chunk-4ZOFT75Q.mjs";
6
7
  import "../../chunk-7P6ASYW6.mjs";
7
8
  export {
8
9
  ShelbyMetadataClient
@@ -84,6 +84,7 @@ declare class ShelbyMicropaymentChannelClient {
84
84
  expirationMicros: number;
85
85
  depositAmount: number;
86
86
  fungibleAssetAddress: AccountAddress;
87
+ publicKey?: Uint8Array;
87
88
  options?: InputGenerateTransactionOptions;
88
89
  }): Promise<{
89
90
  transaction: PendingTransactionResponse;
@@ -98,6 +99,7 @@ declare class ShelbyMicropaymentChannelClient {
98
99
  * @param params.expirationMicros - The expiration of the micropayment channel.
99
100
  * @param params.depositAmount - The amount of the asset locked to the channel.
100
101
  * @param params.fungibleAssetAddress - The account address of the fungible asset.
102
+ * @param params.publicKey - The Ed25519 public key bytes for the channel.
101
103
  *
102
104
  * @returns An Aptos transaction payload data object for the create_channel Move function.
103
105
  */
@@ -107,6 +109,7 @@ declare class ShelbyMicropaymentChannelClient {
107
109
  expirationMicros: number;
108
110
  depositAmount: number;
109
111
  fungibleAssetAddress: AccountAddress;
112
+ publicKey: Uint8Array;
110
113
  }): InputGenerateTransactionPayloadData;
111
114
  /**
112
115
  * Withdraws funds from a micropayment channel as the sender.
@@ -152,64 +155,67 @@ declare class ShelbyMicropaymentChannelClient {
152
155
  }): InputGenerateTransactionPayloadData;
153
156
  /**
154
157
  * Creates a micropayment that can be sent to a receiver.
158
+ * The sender signs a WithdrawApproval message that authorizes the receiver
159
+ * to withdraw funds from the micropayment channel.
155
160
  *
156
- * @param params.sender - The account address of the sender.
157
- * @param params.receiver - The account that is withdrawing funds.
158
- * @param params.amount - The amount to withdraw into the receiver's account.
159
- * @param params.paymentChannelId - The id of the payment channel.
160
- * @param params.sequenceNumber - The sequence number of the micropayment. These must be increasing to be able to store on chain.
161
+ * @param params.sender - The account that owns the payment channel and signs the approval.
162
+ * @param params.receiver - The account address that will receive funds.
161
163
  * @param params.fungibleAssetAddress - The account address of the fungible asset.
162
- * @param params.options - Optional transaction generation options.
164
+ * @param params.amount - The cumulative amount to authorize (not incremental).
165
+ * @param params.paymentChannelId - The id of the payment channel.
166
+ * @param params.sequenceNumber - The sequence number of the micropayment. Must be >= channel's next_withdrawn_sequence_number.
163
167
  *
164
- * @returns An object containing the pending transaction and signature.
168
+ * @returns A SenderBuiltMicropayment containing the signed approval.
165
169
  *
166
170
  * @example
167
171
  * ```typescript
168
- * const senderBuiltMicropayment = await client.createMicropayment({
169
- * sender: senderAddress,
170
- * receiver: receiver,
171
- * amount: 1,
172
- * paymentChannelId: channelIdFromLookup,
173
- * sequenceNumber: localSequenceNumber,
172
+ * const senderBuiltMicropayment = client.createMicropayment({
173
+ * sender: senderAccount,
174
+ * receiver: receiverAddress,
174
175
  * fungibleAssetAddress: fungibleAssetAddress,
176
+ * amount: 100,
177
+ * paymentChannelId: channelId,
178
+ * sequenceNumber: 1,
175
179
  * });
176
180
  * ```
177
181
  */
178
182
  createMicropayment(params: {
179
183
  sender: Account;
180
184
  receiver: AccountAddress;
185
+ fungibleAssetAddress: AccountAddress;
181
186
  amount: number;
182
187
  paymentChannelId: number;
183
188
  sequenceNumber: number;
184
- fungibleAssetAddress: AccountAddress;
185
- options?: InputGenerateTransactionOptions;
186
- }): Promise<SenderBuiltMicropayment>;
189
+ }): SenderBuiltMicropayment;
187
190
  /**
188
- * Creates a static payload for the receiver_withdraw Move function. This is what
189
- * constitutes a miropaymet.
190
- * This is a helper method for constructing the transaction payload without signing.
191
+ * Creates a static payload for the receiver_withdraw Move function.
192
+ * This is a helper method for constructing the transaction payload.
191
193
  *
192
194
  * @param params.deployer - Optional deployer account address. Defaults to MICROPAYMENTS_DEPLOYER.
193
- * @param params.amount - The amount of the fungible asset's smallest increment to send.
194
- * @param params.paymentChannelId - The payment channel id.
195
+ * @param params.sender - The sender's account address.
195
196
  * @param params.fungibleAssetAddress - The account address of the fungible asset.
197
+ * @param params.amount - The cumulative amount authorized to withdraw.
198
+ * @param params.paymentChannelId - The payment channel id.
199
+ * @param params.sequenceNumber - The sequence number for this withdrawal.
200
+ * @param params.signature - The Ed25519 signature bytes.
196
201
  *
197
- * @returns An Aptos transaction payload data object for the sender_withdraw Move function.
202
+ * @returns An Aptos transaction payload data object for the receiver_withdraw Move function.
198
203
  */
199
204
  static createMicropaymentTransactionPayload(params: {
200
205
  deployer?: AccountAddress;
201
- amount: number;
202
- paymentChannelId: number;
203
- sequenceNumber: number;
206
+ sender: AccountAddress;
204
207
  fungibleAssetAddress: AccountAddress;
208
+ amount: number | bigint;
209
+ paymentChannelId: number | bigint;
210
+ sequenceNumber: number | bigint;
211
+ signature: Uint8Array;
205
212
  }): InputGenerateTransactionPayloadData;
206
213
  /**
207
- * Withdraws funds from a micropayment channel as the receiver. The receiver
208
- * does this by signing and submitting a signed transaction the sender sent it.
214
+ * Withdraws funds from a micropayment channel as the receiver.
215
+ * The receiver submits the sender's signed approval to claim funds.
209
216
  *
210
- * @param params.receiver - The receiver withdrawing funds.
211
- * @param params.receiverSignature - The fee-paying transaction signature.
212
- * @param params.micropayment - The fee-paying transaction signature.
217
+ * @param params.receiver - The receiver account that will sign and submit the transaction.
218
+ * @param params.micropayment - The sender's signed micropayment approval.
213
219
  * @param params.options - Optional transaction generation options.
214
220
  *
215
221
  * @returns An object containing the pending transaction.
@@ -217,9 +223,8 @@ declare class ShelbyMicropaymentChannelClient {
217
223
  * @example
218
224
  * ```typescript
219
225
  * const { transaction } = await client.receiverWithdraw({
220
- * receiver: receiver,
221
- * micropayment,
222
- * senderSignature,
226
+ * receiver: receiverAccount,
227
+ * micropayment: senderBuiltMicropayment,
223
228
  * });
224
229
  * ```
225
230
  */
@@ -336,7 +341,7 @@ declare class ShelbyMicropaymentChannelClient {
336
341
  * ```typescript
337
342
  * const channelInfoVec = await client.getChannelInfo({
338
343
  * sender: AccountAddress.fromString("0x1"),
339
- * receiver: AccountAddress.fromSTring("0x2"),
344
+ * receiver: AccountAddress.fromString("0x2"),
340
345
  * });
341
346
  * ```
342
347
  */
@@ -1,15 +1,16 @@
1
1
  import {
2
2
  ShelbyMicropaymentChannelClient
3
- } from "../../chunk-66GI734H.mjs";
3
+ } from "../../chunk-OQNP5QXH.mjs";
4
4
  import "../../chunk-QQ57OGQ2.mjs";
5
+ import "../../chunk-MQUVYMNQ.mjs";
5
6
  import "../../chunk-ZHXCVRZX.mjs";
6
7
  import "../../chunk-AD2G3QYD.mjs";
7
- import "../../chunk-MQUVYMNQ.mjs";
8
- import "../../chunk-4MG4XGY4.mjs";
9
- import "../../chunk-3ZL3FSNA.mjs";
8
+ import "../../chunk-KTVNKLBT.mjs";
9
+ import "../../chunk-CGYJLKBU.mjs";
10
10
  import "../../chunk-KJ24NKPH.mjs";
11
11
  import "../../chunk-AABBONAF.mjs";
12
- import "../../chunk-FLLOQZVD.mjs";
12
+ import "../../chunk-UEZNZBJO.mjs";
13
+ import "../../chunk-4ZOFT75Q.mjs";
13
14
  import "../../chunk-7P6ASYW6.mjs";
14
15
  export {
15
16
  ShelbyMicropaymentChannelClient
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ShelbyPlacementGroupClient
3
- } from "../../chunk-MSCUDBMH.mjs";
4
- import "../../chunk-3ZL3FSNA.mjs";
3
+ } from "../../chunk-W37FZSMA.mjs";
4
+ import "../../chunk-CGYJLKBU.mjs";
5
5
  import "../../chunk-KJ24NKPH.mjs";
6
6
  import "../../chunk-AABBONAF.mjs";
7
- import "../../chunk-FLLOQZVD.mjs";
7
+ import "../../chunk-4ZOFT75Q.mjs";
8
8
  import "../../chunk-7P6ASYW6.mjs";
9
9
  export {
10
10
  ShelbyPlacementGroupClient
@@ -5,6 +5,8 @@ import { ShelbyIndexerClient } from '../operations/index.js';
5
5
  import { SenderBuiltMicropayment } from '../types/payments.js';
6
6
  import { ShelbyRPCConfig, ShelbyClientConfig } from './ShelbyClientConfig.js';
7
7
  import 'zod';
8
+ import '../../clay-codes-DHP-bYcP.js';
9
+ import '@shelby-protocol/clay-codes';
8
10
  import 'graphql-request';
9
11
  import '../operations/generated/sdk.js';
10
12
  import 'graphql';
@@ -1,17 +1,15 @@
1
1
  import {
2
2
  ShelbyRPCClient
3
- } from "../../chunk-ZAM2EUVN.mjs";
4
- import "../../chunk-4MG4XGY4.mjs";
5
- import "../../chunk-3ZL3FSNA.mjs";
3
+ } from "../../chunk-EFR6H3RT.mjs";
4
+ import "../../chunk-KTVNKLBT.mjs";
5
+ import "../../chunk-CGYJLKBU.mjs";
6
6
  import "../../chunk-KJ24NKPH.mjs";
7
7
  import "../../chunk-AABBONAF.mjs";
8
- import "../../chunk-W5NRGZEP.mjs";
8
+ import "../../chunk-Z4FZ7W6L.mjs";
9
9
  import "../../chunk-I6NG5GNL.mjs";
10
10
  import "../../chunk-IE6LYVIA.mjs";
11
- import "../../chunk-4JZO2D7T.mjs";
12
- import "../../chunk-67F5YZ25.mjs";
13
- import "../../chunk-LZSIZJYR.mjs";
14
- import "../../chunk-FLLOQZVD.mjs";
11
+ import "../../chunk-UEZNZBJO.mjs";
12
+ import "../../chunk-4ZOFT75Q.mjs";
15
13
  import "../../chunk-7P6ASYW6.mjs";
16
14
  export {
17
15
  ShelbyRPCClient
@@ -1,20 +1,22 @@
1
1
  export { AckTransactionOptions, BuildOptions, MissingTransactionSubmitterError, ShelbyBlobClient, UsdSponsorOptions, WriteBlobCommitmentsOptions } from './ShelbyBlobClient.js';
2
2
  export { ShelbyClient, UploadOptions } from './ShelbyClient.js';
3
3
  export { ShelbyClientConfig, ShelbyIndexerConfig, ShelbyRPCConfig } from './ShelbyClientConfig.js';
4
+ export { ShelbyMetadataClient } from './ShelbyMetadataClient.js';
4
5
  export { ShelbyMicropaymentChannelClient } from './ShelbyMicropaymentChannelClient.js';
5
6
  export { ShelbyPlacementGroupClient } from './ShelbyPlacementGroupClient.js';
6
7
  export { BlobDataSource, PutBlobProgress, ShelbyRPCClient } from './ShelbyRPCClient.js';
7
8
  import '@aptos-labs/ts-sdk';
8
9
  import '../layout.js';
9
10
  import 'zod';
10
- import '../types/blobs.js';
11
- import '../../clay-codes-pdZFxI_B.js';
11
+ import '../../clay-codes-DHP-bYcP.js';
12
12
  import '@shelby-protocol/clay-codes';
13
+ import '../types/blobs.js';
13
14
  import '../operations/index.js';
14
15
  import 'graphql-request';
15
16
  import '../operations/generated/sdk.js';
16
17
  import 'graphql';
17
18
  import '../blobs.js';
18
19
  import '../networks.js';
20
+ import '../types/storage_providers.js';
19
21
  import '../types/payments.js';
20
22
  import '../types/placement_groups.js';
@@ -1,47 +1,51 @@
1
- import "../../chunk-FGUK6IBA.mjs";
1
+ import "../../chunk-WTICJPDB.mjs";
2
+ import {
3
+ ShelbyPlacementGroupClient
4
+ } from "../../chunk-W37FZSMA.mjs";
2
5
  import {
3
6
  ShelbyClient
4
- } from "../../chunk-W6YL46DT.mjs";
7
+ } from "../../chunk-5CES6RPZ.mjs";
8
+ import {
9
+ ShelbyRPCClient
10
+ } from "../../chunk-EFR6H3RT.mjs";
5
11
  import {
6
12
  MissingTransactionSubmitterError,
7
13
  ShelbyBlobClient
8
- } from "../../chunk-AGRRYZWV.mjs";
14
+ } from "../../chunk-IBAUPQOF.mjs";
9
15
  import "../../chunk-XNEIWM4O.mjs";
10
- import "../../chunk-OMZOR2ZF.mjs";
11
- import "../../chunk-UCDAABAS.mjs";
12
- import "../../chunk-PZF2VTGP.mjs";
16
+ import "../../chunk-NHWWORCH.mjs";
17
+ import "../../chunk-HPPMI7DC.mjs";
18
+ import "../../chunk-OGKZ575S.mjs";
13
19
  import "../../chunk-Z7RFCADT.mjs";
20
+ import {
21
+ ShelbyMetadataClient
22
+ } from "../../chunk-7O77OM4T.mjs";
14
23
  import {
15
24
  ShelbyMicropaymentChannelClient
16
- } from "../../chunk-66GI734H.mjs";
25
+ } from "../../chunk-OQNP5QXH.mjs";
17
26
  import "../../chunk-QQ57OGQ2.mjs";
27
+ import "../../chunk-MQUVYMNQ.mjs";
18
28
  import "../../chunk-ZHXCVRZX.mjs";
19
29
  import "../../chunk-AD2G3QYD.mjs";
20
- import "../../chunk-MQUVYMNQ.mjs";
21
- import {
22
- ShelbyPlacementGroupClient
23
- } from "../../chunk-MSCUDBMH.mjs";
24
- import {
25
- ShelbyRPCClient
26
- } from "../../chunk-ZAM2EUVN.mjs";
27
- import "../../chunk-4MG4XGY4.mjs";
28
- import "../../chunk-3ZL3FSNA.mjs";
30
+ import "../../chunk-KTVNKLBT.mjs";
31
+ import "../../chunk-CGYJLKBU.mjs";
29
32
  import "../../chunk-KJ24NKPH.mjs";
30
33
  import "../../chunk-AABBONAF.mjs";
31
- import "../../chunk-W5NRGZEP.mjs";
34
+ import "../../chunk-Z4FZ7W6L.mjs";
32
35
  import "../../chunk-I6NG5GNL.mjs";
33
36
  import "../../chunk-IE6LYVIA.mjs";
34
- import "../../chunk-OTBLZL2S.mjs";
35
- import "../../chunk-RLRI2533.mjs";
36
- import "../../chunk-4JZO2D7T.mjs";
37
- import "../../chunk-67F5YZ25.mjs";
38
- import "../../chunk-LZSIZJYR.mjs";
39
- import "../../chunk-FLLOQZVD.mjs";
37
+ import "../../chunk-3NRBHSMQ.mjs";
38
+ import "../../chunk-BXEVML7N.mjs";
39
+ import "../../chunk-UEZNZBJO.mjs";
40
+ import "../../chunk-JTXYKO3U.mjs";
41
+ import "../../chunk-AUQDI5BS.mjs";
42
+ import "../../chunk-4ZOFT75Q.mjs";
40
43
  import "../../chunk-7P6ASYW6.mjs";
41
44
  export {
42
45
  MissingTransactionSubmitterError,
43
46
  ShelbyBlobClient,
44
47
  ShelbyClient,
48
+ ShelbyMetadataClient,
45
49
  ShelbyMicropaymentChannelClient,
46
50
  ShelbyPlacementGroupClient,
47
51
  ShelbyRPCClient
@@ -1,6 +1,6 @@
1
1
  import { Hex } from '@aptos-labs/ts-sdk';
2
2
  import { z } from 'zod';
3
- import { a as ErasureCodingProvider } from '../clay-codes-pdZFxI_B.js';
3
+ import { a as ErasureCodingProvider } from '../clay-codes-DHP-bYcP.js';
4
4
  import '@shelby-protocol/clay-codes';
5
5
 
6
6
  /**
@@ -5,10 +5,10 @@ import {
5
5
  expectedTotalChunksets,
6
6
  generateCommitments,
7
7
  generateMerkleRoot
8
- } from "../chunk-RLRI2533.mjs";
9
- import "../chunk-4JZO2D7T.mjs";
10
- import "../chunk-67F5YZ25.mjs";
11
- import "../chunk-LZSIZJYR.mjs";
8
+ } from "../chunk-BXEVML7N.mjs";
9
+ import "../chunk-UEZNZBJO.mjs";
10
+ import "../chunk-JTXYKO3U.mjs";
11
+ import "../chunk-AUQDI5BS.mjs";
12
12
  import "../chunk-7P6ASYW6.mjs";
13
13
  export {
14
14
  BlobCommitmentsSchema,
@@ -4,7 +4,7 @@ declare const NetworkToShelbyRPCBaseUrl: {
4
4
  readonly shelbynet: "https://api.shelbynet.shelby.xyz/shelby";
5
5
  readonly netna: undefined;
6
6
  readonly devnet: undefined;
7
- readonly testnet: undefined;
7
+ readonly testnet: "https://api.testnet.shelby.xyz/shelby";
8
8
  readonly mainnet: undefined;
9
9
  readonly local: undefined;
10
10
  readonly custom: undefined;
@@ -16,7 +16,19 @@ declare const NetworkToShelbyBlobIndexerBaseUrl: {
16
16
  readonly shelbynet: "https://api.shelbynet.aptoslabs.com/nocode/v1/public/cmforrguw0042s601fn71f9l2/v1/graphql";
17
17
  readonly netna: undefined;
18
18
  readonly devnet: undefined;
19
- readonly testnet: undefined;
19
+ readonly testnet: "https://api.testnet.aptoslabs.com/nocode/v1/public/cmlfqs5wt00qrs601zt5s4kfj/v1/graphql";
20
+ readonly mainnet: undefined;
21
+ readonly local: undefined;
22
+ readonly custom: undefined;
23
+ };
24
+ /**
25
+ * Mapping of Aptos networks to gas station URL.
26
+ */
27
+ declare const NetworkToGasStationBaseUrl: {
28
+ readonly shelbynet: "https://api.shelbynet.shelby.xyz/gs/v1";
29
+ readonly netna: undefined;
30
+ readonly devnet: undefined;
31
+ readonly testnet: "https://api.testnet.shelby.xyz/gs/v1";
20
32
  readonly mainnet: undefined;
21
33
  readonly local: undefined;
22
34
  readonly custom: undefined;
@@ -30,4 +42,4 @@ declare const SHELBYUSD_TOKEN_MODULE = "shelby_usd";
30
42
  declare const SHELBYUSD_TOKEN_NAME = "ShelbyUSD";
31
43
  declare const SHELBYUSD_FA_METADATA_ADDRESS = "0x1b18363a9f1fe5e6ebf247daba5cc1c18052bb232efdc4c50f556053922d98e1";
32
44
 
33
- 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 };
45
+ export { DEFAULT_PROJECT_DESCRIPTION, DEFAULT_PROJECT_NAME, MICROPAYMENTS_DEPLOYER, NetworkToGasStationBaseUrl, NetworkToShelbyBlobIndexerBaseUrl, NetworkToShelbyRPCBaseUrl, SHELBYUSD_FA_METADATA_ADDRESS, SHELBYUSD_TOKEN_ADDRESS, SHELBYUSD_TOKEN_MODULE, SHELBYUSD_TOKEN_NAME, SHELBY_DEPLOYER, TOKEN_DEPLOYER, TOKEN_OBJECT_ADDRESS };
@@ -2,6 +2,7 @@ import {
2
2
  DEFAULT_PROJECT_DESCRIPTION,
3
3
  DEFAULT_PROJECT_NAME,
4
4
  MICROPAYMENTS_DEPLOYER,
5
+ NetworkToGasStationBaseUrl,
5
6
  NetworkToShelbyBlobIndexerBaseUrl,
6
7
  NetworkToShelbyRPCBaseUrl,
7
8
  SHELBYUSD_FA_METADATA_ADDRESS,
@@ -11,12 +12,13 @@ import {
11
12
  SHELBY_DEPLOYER,
12
13
  TOKEN_DEPLOYER,
13
14
  TOKEN_OBJECT_ADDRESS
14
- } from "../chunk-FLLOQZVD.mjs";
15
+ } from "../chunk-4ZOFT75Q.mjs";
15
16
  import "../chunk-7P6ASYW6.mjs";
16
17
  export {
17
18
  DEFAULT_PROJECT_DESCRIPTION,
18
19
  DEFAULT_PROJECT_NAME,
19
20
  MICROPAYMENTS_DEPLOYER,
21
+ NetworkToGasStationBaseUrl,
20
22
  NetworkToShelbyBlobIndexerBaseUrl,
21
23
  NetworkToShelbyRPCBaseUrl,
22
24
  SHELBYUSD_FA_METADATA_ADDRESS,
@@ -1,2 +1,2 @@
1
1
  import '@shelby-protocol/clay-codes';
2
- export { e as ClayConfig, g as ClayDecodeConfig, f as ClayErasureCodeParams, C as ClayErasureCodingProvider, b as ClayProviderOptions } from '../../clay-codes-pdZFxI_B.js';
2
+ export { b as ClayConfig, g as ClayDecodeConfig, f as ClayErasureCodeParams, C as ClayErasureCodingProvider, c as ClayProviderOptions, h as buildClayConfig } from '../../clay-codes-DHP-bYcP.js';
@@ -1,9 +1,9 @@
1
1
  import {
2
- ClayErasureCodingProvider
3
- } from "../../chunk-UCDAABAS.mjs";
4
- import "../../chunk-67F5YZ25.mjs";
5
- import "../../chunk-LZSIZJYR.mjs";
2
+ ClayErasureCodingProvider,
3
+ buildClayConfig
4
+ } from "../../chunk-OGKZ575S.mjs";
6
5
  import "../../chunk-7P6ASYW6.mjs";
7
6
  export {
8
- ClayErasureCodingProvider
7
+ ClayErasureCodingProvider,
8
+ buildClayConfig
9
9
  };
@@ -6,13 +6,14 @@
6
6
  * Erasure coding schemes supported by Shelby.
7
7
  */
8
8
  declare enum ErasureCodingScheme {
9
- ClayCode_16Total_10Data_13Helper = "ClayCode_16Total_10Data_13Helper"
9
+ ClayCode_16Total_10Data_13Helper = "ClayCode_16Total_10Data_13Helper",
10
+ ClayCode_4Total_2Data_3Helper = "ClayCode_4Total_2Data_3Helper"
10
11
  }
11
12
  /**
12
13
  * Union of all supported erasure coding parameter types.
13
14
  * When new erasure schemes are added, union them to this type.
14
15
  */
15
- type ErasureSchemeParams = (typeof ERASURE_CODE_PARAMS)["ClayCode_16Total_10Data_13Helper"] /** | ReedSolomonErasureCodeParams */;
16
+ type ErasureSchemeParams = (typeof ERASURE_CODE_PARAMS)["ClayCode_16Total_10Data_13Helper"] | (typeof ERASURE_CODE_PARAMS)["ClayCode_4Total_2Data_3Helper"];
16
17
  type ErasureCodeParams = Record<ErasureCodingScheme, ErasureSchemeParams>;
17
18
  /**
18
19
  * Parameters for each supported erasure coding scheme.
@@ -26,6 +27,13 @@ declare const ERASURE_CODE_PARAMS: {
26
27
  readonly erasure_n: 16;
27
28
  readonly erasure_k: 10;
28
29
  readonly erasure_d: 13;
30
+ readonly enumIndex: 0;
31
+ };
32
+ readonly ClayCode_4Total_2Data_3Helper: {
33
+ readonly erasure_n: 4;
34
+ readonly erasure_k: 2;
35
+ readonly erasure_d: 3;
36
+ readonly enumIndex: 1;
29
37
  };
30
38
  };
31
39
  /**
@@ -6,7 +6,7 @@ import {
6
6
  DEFAULT_SAMPLE_SIZE,
7
7
  ERASURE_CODE_PARAMS,
8
8
  ErasureCodingScheme
9
- } from "../../chunk-LZSIZJYR.mjs";
9
+ } from "../../chunk-AUQDI5BS.mjs";
10
10
  import "../../chunk-7P6ASYW6.mjs";
11
11
  export {
12
12
  DEFAULT_ERASURE_D,
@@ -1,6 +1,9 @@
1
- import { C as ClayErasureCodingProvider } from '../../clay-codes-pdZFxI_B.js';
1
+ import { C as ClayErasureCodingProvider, b as ClayConfig } from '../../clay-codes-DHP-bYcP.js';
2
2
  import '@shelby-protocol/clay-codes';
3
3
 
4
4
  declare function createDefaultErasureCodingProvider(): Promise<ClayErasureCodingProvider>;
5
+ declare function defaultErasureCodingConfig(): ClayConfig;
6
+ declare function erasureCodingConfig16Total10Data13Helper(): ClayConfig;
7
+ declare function erasureCodingConfig4Total2Data3Helper(): ClayConfig;
5
8
 
6
- export { createDefaultErasureCodingProvider };
9
+ export { createDefaultErasureCodingProvider, defaultErasureCodingConfig, erasureCodingConfig16Total10Data13Helper, erasureCodingConfig4Total2Data3Helper };
@@ -1,10 +1,16 @@
1
1
  import {
2
- createDefaultErasureCodingProvider
3
- } from "../../chunk-OMZOR2ZF.mjs";
4
- import "../../chunk-UCDAABAS.mjs";
5
- import "../../chunk-67F5YZ25.mjs";
6
- import "../../chunk-LZSIZJYR.mjs";
2
+ createDefaultErasureCodingProvider,
3
+ defaultErasureCodingConfig,
4
+ erasureCodingConfig16Total10Data13Helper,
5
+ erasureCodingConfig4Total2Data3Helper
6
+ } from "../../chunk-HPPMI7DC.mjs";
7
+ import "../../chunk-OGKZ575S.mjs";
8
+ import "../../chunk-JTXYKO3U.mjs";
9
+ import "../../chunk-AUQDI5BS.mjs";
7
10
  import "../../chunk-7P6ASYW6.mjs";
8
11
  export {
9
- createDefaultErasureCodingProvider
12
+ createDefaultErasureCodingProvider,
13
+ defaultErasureCodingConfig,
14
+ erasureCodingConfig16Total10Data13Helper,
15
+ erasureCodingConfig4Total2Data3Helper
10
16
  };
@@ -1,4 +1,4 @@
1
- export { C as ClayErasureCodingProvider, D as DecodeConfig, E as ErasureCodingConfig, a as ErasureCodingProvider, R as ReedSolomonErasureCodingProvider } from '../../clay-codes-pdZFxI_B.js';
1
+ export { C as ClayErasureCodingProvider, D as DecodeConfig, E as ErasureCodingConfig, a as ErasureCodingProvider, R as ReedSolomonErasureCodingProvider } from '../../clay-codes-DHP-bYcP.js';
2
2
  export { DEFAULT_ERASURE_D, DEFAULT_ERASURE_K, DEFAULT_ERASURE_M, DEFAULT_ERASURE_N, DEFAULT_SAMPLE_SIZE, ERASURE_CODE_PARAMS, ErasureCodeParams, ErasureCodingScheme, ErasureSchemeParams } from './constants.js';
3
- export { createDefaultErasureCodingProvider } from './default.js';
3
+ export { createDefaultErasureCodingProvider, defaultErasureCodingConfig, erasureCodingConfig16Total10Data13Helper, erasureCodingConfig4Total2Data3Helper } from './default.js';
4
4
  import '@shelby-protocol/clay-codes';