@shelby-protocol/sdk 0.2.0 → 0.2.2
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 +1 -1
- package/dist/browser/index.mjs +31 -29
- package/dist/chunk-3NRBHSMQ.mjs +12 -0
- package/dist/{chunk-W37FZSMA.mjs → chunk-57RQAVKL.mjs} +1 -1
- package/dist/{chunk-4ZOFT75Q.mjs → chunk-7OV5ZYW6.mjs} +2 -2
- package/dist/{chunk-2WEX3K7C.mjs → chunk-BXEVML7N.mjs} +1 -1
- package/dist/{chunk-PJVWGMVI.mjs → chunk-E5PP7BZJ.mjs} +9 -9
- package/dist/{chunk-CGYJLKBU.mjs → chunk-EZPZAUIV.mjs} +1 -1
- package/dist/{chunk-ZEDD2MPU.mjs → chunk-FMPOGFDW.mjs} +1 -1
- package/dist/{chunk-MV6FNYAU.mjs → chunk-H53O23I7.mjs} +99 -20
- package/dist/{chunk-E5QCRTBU.mjs → chunk-H5YZHUSJ.mjs} +87 -75
- package/dist/{chunk-7PN65RDX.mjs → chunk-ONOOCOQ5.mjs} +16 -14
- package/dist/{chunk-SRV4YWFH.mjs → chunk-PESSW3FK.mjs} +52 -17
- package/dist/chunk-TVLV7C74.mjs +207 -0
- package/dist/{chunk-4JZO2D7T.mjs → chunk-UEZNZBJO.mjs} +9 -2
- package/dist/core/blobs.mjs +2 -1
- package/dist/core/clients/ShelbyBlobClient.d.ts +16 -0
- package/dist/core/clients/ShelbyBlobClient.mjs +8 -8
- package/dist/core/clients/ShelbyClient.mjs +13 -13
- package/dist/core/clients/ShelbyMetadataClient.d.ts +56 -5
- package/dist/core/clients/ShelbyMetadataClient.mjs +3 -2
- package/dist/core/clients/ShelbyMicropaymentChannelClient.d.ts +39 -34
- package/dist/core/clients/ShelbyMicropaymentChannelClient.mjs +5 -4
- package/dist/core/clients/ShelbyPlacementGroupClient.mjs +3 -3
- package/dist/core/clients/ShelbyRPCClient.mjs +6 -6
- package/dist/core/clients/index.mjs +17 -17
- package/dist/core/commitments.mjs +2 -2
- package/dist/core/constants.d.ts +2 -2
- package/dist/core/constants.mjs +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.mjs +31 -29
- package/dist/core/operations/generated/types.d.ts +908 -0
- package/dist/core/operations/generated/types.mjs +63 -0
- package/dist/core/operations/index.mjs +2 -2
- package/dist/core/types/index.mjs +2 -1
- package/dist/core/types/payments.d.ts +82 -9
- package/dist/core/types/payments.mjs +2 -1
- package/dist/core/types/placement_groups.d.ts +2 -2
- package/dist/core/types/storage_providers.d.ts +2 -2
- package/dist/core/utils.d.ts +3 -2
- package/dist/core/utils.mjs +3 -1
- package/dist/node/clients/ShelbyNodeClient.mjs +14 -14
- package/dist/node/clients/index.mjs +16 -16
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.mjs +32 -30
- package/package.json +1 -1
- package/dist/chunk-4MG4XGY4.mjs +0 -91
- package/dist/chunk-OTBLZL2S.mjs +0 -9
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import "../../../chunk-7P6ASYW6.mjs";
|
|
2
|
+
|
|
3
|
+
// src/core/operations/generated/types.ts
|
|
4
|
+
var Blob_Activities_Select_Column = /* @__PURE__ */ ((Blob_Activities_Select_Column2) => {
|
|
5
|
+
Blob_Activities_Select_Column2["BlobName"] = "blob_name";
|
|
6
|
+
Blob_Activities_Select_Column2["EventIndex"] = "event_index";
|
|
7
|
+
Blob_Activities_Select_Column2["EventType"] = "event_type";
|
|
8
|
+
Blob_Activities_Select_Column2["Timestamp"] = "timestamp";
|
|
9
|
+
Blob_Activities_Select_Column2["TransactionHash"] = "transaction_hash";
|
|
10
|
+
Blob_Activities_Select_Column2["TransactionVersion"] = "transaction_version";
|
|
11
|
+
return Blob_Activities_Select_Column2;
|
|
12
|
+
})(Blob_Activities_Select_Column || {});
|
|
13
|
+
var Blobs_Select_Column = /* @__PURE__ */ ((Blobs_Select_Column2) => {
|
|
14
|
+
Blobs_Select_Column2["BlobCommitment"] = "blob_commitment";
|
|
15
|
+
Blobs_Select_Column2["BlobName"] = "blob_name";
|
|
16
|
+
Blobs_Select_Column2["CreatedAt"] = "created_at";
|
|
17
|
+
Blobs_Select_Column2["ExpiresAt"] = "expires_at";
|
|
18
|
+
Blobs_Select_Column2["IsDeleted"] = "is_deleted";
|
|
19
|
+
Blobs_Select_Column2["IsWritten"] = "is_written";
|
|
20
|
+
Blobs_Select_Column2["NumChunksets"] = "num_chunksets";
|
|
21
|
+
Blobs_Select_Column2["Owner"] = "owner";
|
|
22
|
+
Blobs_Select_Column2["PlacementGroup"] = "placement_group";
|
|
23
|
+
Blobs_Select_Column2["Size"] = "size";
|
|
24
|
+
Blobs_Select_Column2["SliceAddress"] = "slice_address";
|
|
25
|
+
Blobs_Select_Column2["UpdatedAt"] = "updated_at";
|
|
26
|
+
return Blobs_Select_Column2;
|
|
27
|
+
})(Blobs_Select_Column || {});
|
|
28
|
+
var Cursor_Ordering = /* @__PURE__ */ ((Cursor_Ordering2) => {
|
|
29
|
+
Cursor_Ordering2["Asc"] = "ASC";
|
|
30
|
+
Cursor_Ordering2["Desc"] = "DESC";
|
|
31
|
+
return Cursor_Ordering2;
|
|
32
|
+
})(Cursor_Ordering || {});
|
|
33
|
+
var Order_By = /* @__PURE__ */ ((Order_By2) => {
|
|
34
|
+
Order_By2["Asc"] = "asc";
|
|
35
|
+
Order_By2["AscNullsFirst"] = "asc_nulls_first";
|
|
36
|
+
Order_By2["AscNullsLast"] = "asc_nulls_last";
|
|
37
|
+
Order_By2["Desc"] = "desc";
|
|
38
|
+
Order_By2["DescNullsFirst"] = "desc_nulls_first";
|
|
39
|
+
Order_By2["DescNullsLast"] = "desc_nulls_last";
|
|
40
|
+
return Order_By2;
|
|
41
|
+
})(Order_By || {});
|
|
42
|
+
var Placement_Group_Slots_Select_Column = /* @__PURE__ */ ((Placement_Group_Slots_Select_Column2) => {
|
|
43
|
+
Placement_Group_Slots_Select_Column2["PlacementGroup"] = "placement_group";
|
|
44
|
+
Placement_Group_Slots_Select_Column2["SlotIndex"] = "slot_index";
|
|
45
|
+
Placement_Group_Slots_Select_Column2["Status"] = "status";
|
|
46
|
+
Placement_Group_Slots_Select_Column2["StorageProvider"] = "storage_provider";
|
|
47
|
+
Placement_Group_Slots_Select_Column2["UpdatedAt"] = "updated_at";
|
|
48
|
+
return Placement_Group_Slots_Select_Column2;
|
|
49
|
+
})(Placement_Group_Slots_Select_Column || {});
|
|
50
|
+
var Processor_Status_Select_Column = /* @__PURE__ */ ((Processor_Status_Select_Column2) => {
|
|
51
|
+
Processor_Status_Select_Column2["LastSuccessVersion"] = "last_success_version";
|
|
52
|
+
Processor_Status_Select_Column2["LastTransactionTimestamp"] = "last_transaction_timestamp";
|
|
53
|
+
Processor_Status_Select_Column2["LastUpdated"] = "last_updated";
|
|
54
|
+
return Processor_Status_Select_Column2;
|
|
55
|
+
})(Processor_Status_Select_Column || {});
|
|
56
|
+
export {
|
|
57
|
+
Blob_Activities_Select_Column,
|
|
58
|
+
Blobs_Select_Column,
|
|
59
|
+
Cursor_Ordering,
|
|
60
|
+
Order_By,
|
|
61
|
+
Placement_Group_Slots_Select_Column,
|
|
62
|
+
Processor_Status_Select_Column
|
|
63
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createShelbyIndexerClient,
|
|
3
3
|
getShelbyIndexerClient
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-EZPZAUIV.mjs";
|
|
5
5
|
import {
|
|
6
6
|
Blob_Activities_Select_Column,
|
|
7
7
|
Blobs_Select_Column,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
getSdk
|
|
20
20
|
} from "../../chunk-KJ24NKPH.mjs";
|
|
21
21
|
import "../../chunk-AABBONAF.mjs";
|
|
22
|
-
import "../../chunk-
|
|
22
|
+
import "../../chunk-7OV5ZYW6.mjs";
|
|
23
23
|
import "../../chunk-7P6ASYW6.mjs";
|
|
24
24
|
export {
|
|
25
25
|
Blob_Activities_Select_Column,
|
|
@@ -5,7 +5,8 @@ import "../../chunk-MQUVYMNQ.mjs";
|
|
|
5
5
|
import {
|
|
6
6
|
SenderBuiltMicropayment,
|
|
7
7
|
StaleChannelStateError
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-TVLV7C74.mjs";
|
|
9
|
+
import "../../chunk-7OV5ZYW6.mjs";
|
|
9
10
|
import "../../chunk-7P6ASYW6.mjs";
|
|
10
11
|
export {
|
|
11
12
|
SenderBuiltMicropayment,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Serializable,
|
|
1
|
+
import { Serializable, AccountAddress, Serializer, Hex } from '@aptos-labs/ts-sdk';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Error thrown when a micropayment is stale (sequence number or amount is behind
|
|
@@ -24,19 +24,88 @@ declare class StaleChannelStateError extends Error {
|
|
|
24
24
|
static fromBase64(base64: string, message?: string): StaleChannelStateError;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* A
|
|
28
|
-
*
|
|
27
|
+
* A micropayment approval signed by the sender. The receiver can submit this
|
|
28
|
+
* to withdraw funds from the micropayment channel.
|
|
29
|
+
*
|
|
30
|
+
* This matches the Move struct WithdrawApproval:
|
|
31
|
+
* struct WithdrawApproval {
|
|
32
|
+
* sender: address,
|
|
33
|
+
* receiver: address,
|
|
34
|
+
* metadata: Object<Metadata>, // represented as an address
|
|
35
|
+
* amount: u64,
|
|
36
|
+
* payment_channel_id: u64,
|
|
37
|
+
* sequence_number: u64
|
|
38
|
+
* }
|
|
39
|
+
*
|
|
40
|
+
* The signature is over a SignedMessage<WithdrawApproval> which includes TypeInfo
|
|
41
|
+
* for domain separation (used with signature_verify_strict_t).
|
|
29
42
|
*/
|
|
30
43
|
declare class SenderBuiltMicropayment implements Serializable {
|
|
31
44
|
/**
|
|
32
|
-
* The
|
|
45
|
+
* The sender's address (owner of the payment channel).
|
|
46
|
+
*/
|
|
47
|
+
readonly sender: AccountAddress;
|
|
48
|
+
/**
|
|
49
|
+
* The receiver's address (beneficiary of the withdrawal).
|
|
50
|
+
*/
|
|
51
|
+
readonly receiver: AccountAddress;
|
|
52
|
+
/**
|
|
53
|
+
* The unique ID of the payment channel.
|
|
54
|
+
*/
|
|
55
|
+
readonly paymentChannelId: bigint;
|
|
56
|
+
/**
|
|
57
|
+
* The cumulative amount the receiver is authorized to withdraw.
|
|
58
|
+
*/
|
|
59
|
+
readonly amount: bigint;
|
|
60
|
+
/**
|
|
61
|
+
* The fungible asset metadata address.
|
|
62
|
+
*/
|
|
63
|
+
readonly fungibleAssetAddress: AccountAddress;
|
|
64
|
+
/**
|
|
65
|
+
* Monotonically increasing sequence number for replay protection.
|
|
66
|
+
*/
|
|
67
|
+
readonly sequenceNumber: bigint;
|
|
68
|
+
/**
|
|
69
|
+
* The sender's Ed25519 public key (32 bytes).
|
|
70
|
+
* Used by the receiver to verify the signature before submitting.
|
|
33
71
|
*/
|
|
34
|
-
readonly
|
|
72
|
+
readonly publicKey: Uint8Array;
|
|
35
73
|
/**
|
|
36
|
-
* The
|
|
74
|
+
* The Ed25519 signature of the SignedMessage<WithdrawApproval> struct.
|
|
75
|
+
* The SignedMessage includes TypeInfo for domain separation.
|
|
37
76
|
*/
|
|
38
|
-
readonly
|
|
39
|
-
|
|
77
|
+
readonly signature: Uint8Array;
|
|
78
|
+
/**
|
|
79
|
+
* The deployer address of the micropayments module.
|
|
80
|
+
* This is needed to reconstruct the TypeInfo for signature verification.
|
|
81
|
+
*/
|
|
82
|
+
readonly deployer: AccountAddress;
|
|
83
|
+
constructor(sender: AccountAddress, receiver: AccountAddress, paymentChannelId: bigint, amount: bigint, fungibleAssetAddress: AccountAddress, sequenceNumber: bigint, publicKey: Uint8Array, signature: Uint8Array, deployer: AccountAddress);
|
|
84
|
+
/**
|
|
85
|
+
* Creates the BCS-serialized message that was signed.
|
|
86
|
+
* This is a SignedMessage<WithdrawApproval> which includes:
|
|
87
|
+
* 1. TypeInfo (module_address, module_name, struct_name)
|
|
88
|
+
* 2. WithdrawApproval struct fields
|
|
89
|
+
*
|
|
90
|
+
* This format is used with signature_verify_strict_t for domain separation.
|
|
91
|
+
*/
|
|
92
|
+
getSignedMessage(): Uint8Array;
|
|
93
|
+
/**
|
|
94
|
+
* Static helper to build the SignedMessage<WithdrawApproval> bytes from raw parameters.
|
|
95
|
+
* This can be used to create the message for signing without constructing the full object.
|
|
96
|
+
*
|
|
97
|
+
* @param params - The withdrawal approval parameters.
|
|
98
|
+
* @returns The BCS-serialized SignedMessage<WithdrawApproval> bytes.
|
|
99
|
+
*/
|
|
100
|
+
static buildSignedMessage(params: {
|
|
101
|
+
deployer: AccountAddress;
|
|
102
|
+
sender: AccountAddress;
|
|
103
|
+
receiver: AccountAddress;
|
|
104
|
+
fungibleAssetAddress: AccountAddress;
|
|
105
|
+
amount: bigint | number;
|
|
106
|
+
paymentChannelId: bigint | number;
|
|
107
|
+
sequenceNumber: bigint | number;
|
|
108
|
+
}): Uint8Array;
|
|
40
109
|
serialize(serializer: Serializer): void;
|
|
41
110
|
bcsToBytes(): Uint8Array;
|
|
42
111
|
bcsToHex(): Hex;
|
|
@@ -50,7 +119,7 @@ declare class SenderBuiltMicropayment implements Serializable {
|
|
|
50
119
|
static deserialize(bytes: Uint8Array | string): SenderBuiltMicropayment;
|
|
51
120
|
}
|
|
52
121
|
/**
|
|
53
|
-
* The information
|
|
122
|
+
* The information associated with a micropayment channel.
|
|
54
123
|
*/
|
|
55
124
|
interface ChannelInfo {
|
|
56
125
|
/**
|
|
@@ -89,6 +158,10 @@ interface ChannelInfo {
|
|
|
89
158
|
* The amount already withdrawn by the receiver.
|
|
90
159
|
*/
|
|
91
160
|
receiverWithdrawnAmount: number;
|
|
161
|
+
/**
|
|
162
|
+
* The Ed25519 public key used to verify withdrawal signatures.
|
|
163
|
+
*/
|
|
164
|
+
publicKey: Uint8Array;
|
|
92
165
|
}
|
|
93
166
|
|
|
94
167
|
export { type ChannelInfo, SenderBuiltMicropayment, StaleChannelStateError };
|
|
@@ -14,7 +14,7 @@ interface PlacementGroupInfo {
|
|
|
14
14
|
/**
|
|
15
15
|
* The status of a placement group slot.
|
|
16
16
|
*/
|
|
17
|
-
type PlacementGroupSlotStatus = "joining" | "active" | "
|
|
17
|
+
type PlacementGroupSlotStatus = "joining" | "active" | "vacated";
|
|
18
18
|
/**
|
|
19
19
|
* A placement group slot representing an assignment of a storage provider to a placement group.
|
|
20
20
|
*/
|
|
@@ -32,7 +32,7 @@ interface PlacementGroupSlot {
|
|
|
32
32
|
*/
|
|
33
33
|
storageProvider: string;
|
|
34
34
|
/**
|
|
35
|
-
* The status of this slot (joining, active, or
|
|
35
|
+
* The status of this slot (joining, active, or vacated).
|
|
36
36
|
*/
|
|
37
37
|
status: PlacementGroupSlotStatus;
|
|
38
38
|
/**
|
|
@@ -49,9 +49,9 @@ interface StorageProviderInfo {
|
|
|
49
49
|
*/
|
|
50
50
|
blsPublicKey: Uint8Array;
|
|
51
51
|
/**
|
|
52
|
-
* The
|
|
52
|
+
* The availability zone of the storage provider.
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
availabilityZone: string;
|
|
55
55
|
/**
|
|
56
56
|
* The state details of the storage provider (Active, Waitlisted, or Frozen).
|
|
57
57
|
*/
|
package/dist/core/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HexInput, Hex } from '@aptos-labs/ts-sdk';
|
|
1
|
+
import { HexInput, Hex, AccountAddressInput, AccountAddress } from '@aptos-labs/ts-sdk';
|
|
2
2
|
|
|
3
3
|
type ByteStream = ReadableStream<Uint8Array>;
|
|
4
4
|
type ChunkSource = ByteStream | ArrayBufferView;
|
|
@@ -45,5 +45,6 @@ declare function buildRequestUrl(path: string, baseUrl: string): URL;
|
|
|
45
45
|
* @returns The blob name suffix.
|
|
46
46
|
*/
|
|
47
47
|
declare function getBlobNameSuffix(blobName: string): string;
|
|
48
|
+
declare function normalizeAddress(address: AccountAddressInput): AccountAddress;
|
|
48
49
|
|
|
49
|
-
export { buildRequestUrl, concatHashes, getBlobNameSuffix, readInChunks, zeroPadBytes };
|
|
50
|
+
export { buildRequestUrl, concatHashes, getBlobNameSuffix, normalizeAddress, readInChunks, zeroPadBytes };
|
package/dist/core/utils.mjs
CHANGED
|
@@ -2,14 +2,16 @@ import {
|
|
|
2
2
|
buildRequestUrl,
|
|
3
3
|
concatHashes,
|
|
4
4
|
getBlobNameSuffix,
|
|
5
|
+
normalizeAddress,
|
|
5
6
|
readInChunks,
|
|
6
7
|
zeroPadBytes
|
|
7
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-UEZNZBJO.mjs";
|
|
8
9
|
import "../chunk-7P6ASYW6.mjs";
|
|
9
10
|
export {
|
|
10
11
|
buildRequestUrl,
|
|
11
12
|
concatHashes,
|
|
12
13
|
getBlobNameSuffix,
|
|
14
|
+
normalizeAddress,
|
|
13
15
|
readInChunks,
|
|
14
16
|
zeroPadBytes
|
|
15
17
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ShelbyNodeClient
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-FMPOGFDW.mjs";
|
|
4
|
+
import "../../chunk-ONOOCOQ5.mjs";
|
|
5
|
+
import "../../chunk-PESSW3FK.mjs";
|
|
6
|
+
import "../../chunk-H53O23I7.mjs";
|
|
7
|
+
import "../../chunk-E5PP7BZJ.mjs";
|
|
8
|
+
import "../../chunk-TVLV7C74.mjs";
|
|
9
|
+
import "../../chunk-EZPZAUIV.mjs";
|
|
10
|
+
import "../../chunk-KJ24NKPH.mjs";
|
|
11
|
+
import "../../chunk-AABBONAF.mjs";
|
|
6
12
|
import "../../chunk-XNEIWM4O.mjs";
|
|
7
13
|
import "../../chunk-HPPMI7DC.mjs";
|
|
8
14
|
import "../../chunk-OGKZ575S.mjs";
|
|
9
15
|
import "../../chunk-NHWWORCH.mjs";
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-PJVWGMVI.mjs";
|
|
12
|
-
import "../../chunk-4MG4XGY4.mjs";
|
|
13
|
-
import "../../chunk-CGYJLKBU.mjs";
|
|
14
|
-
import "../../chunk-KJ24NKPH.mjs";
|
|
15
|
-
import "../../chunk-AABBONAF.mjs";
|
|
16
|
+
import "../../chunk-Z4FZ7W6L.mjs";
|
|
16
17
|
import "../../chunk-I6NG5GNL.mjs";
|
|
17
18
|
import "../../chunk-IE6LYVIA.mjs";
|
|
18
|
-
import "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
20
|
-
import "../../chunk-
|
|
19
|
+
import "../../chunk-3NRBHSMQ.mjs";
|
|
20
|
+
import "../../chunk-BXEVML7N.mjs";
|
|
21
|
+
import "../../chunk-UEZNZBJO.mjs";
|
|
21
22
|
import "../../chunk-JTXYKO3U.mjs";
|
|
22
23
|
import "../../chunk-AUQDI5BS.mjs";
|
|
23
|
-
import "../../chunk-
|
|
24
|
-
import "../../chunk-Z4FZ7W6L.mjs";
|
|
24
|
+
import "../../chunk-7OV5ZYW6.mjs";
|
|
25
25
|
import "../../chunk-7P6ASYW6.mjs";
|
|
26
26
|
export {
|
|
27
27
|
ShelbyNodeClient
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import "../../chunk-MB7C7VQF.mjs";
|
|
2
2
|
import {
|
|
3
3
|
ShelbyNodeClient
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-XNEIWM4O.mjs";
|
|
8
|
-
import "../../chunk-HPPMI7DC.mjs";
|
|
9
|
-
import "../../chunk-OGKZ575S.mjs";
|
|
10
|
-
import "../../chunk-NHWWORCH.mjs";
|
|
4
|
+
} from "../../chunk-FMPOGFDW.mjs";
|
|
5
|
+
import "../../chunk-ONOOCOQ5.mjs";
|
|
6
|
+
import "../../chunk-PESSW3FK.mjs";
|
|
11
7
|
import {
|
|
12
8
|
ShelbyMetadataClient
|
|
13
|
-
} from "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-H53O23I7.mjs";
|
|
10
|
+
import "../../chunk-E5PP7BZJ.mjs";
|
|
11
|
+
import "../../chunk-TVLV7C74.mjs";
|
|
12
|
+
import "../../chunk-EZPZAUIV.mjs";
|
|
17
13
|
import "../../chunk-KJ24NKPH.mjs";
|
|
18
14
|
import "../../chunk-AABBONAF.mjs";
|
|
15
|
+
import "../../chunk-XNEIWM4O.mjs";
|
|
16
|
+
import "../../chunk-HPPMI7DC.mjs";
|
|
17
|
+
import "../../chunk-OGKZ575S.mjs";
|
|
18
|
+
import "../../chunk-NHWWORCH.mjs";
|
|
19
|
+
import "../../chunk-Z4FZ7W6L.mjs";
|
|
19
20
|
import "../../chunk-I6NG5GNL.mjs";
|
|
20
21
|
import "../../chunk-IE6LYVIA.mjs";
|
|
21
|
-
import "../../chunk-
|
|
22
|
-
import "../../chunk-
|
|
23
|
-
import "../../chunk-
|
|
22
|
+
import "../../chunk-3NRBHSMQ.mjs";
|
|
23
|
+
import "../../chunk-BXEVML7N.mjs";
|
|
24
|
+
import "../../chunk-UEZNZBJO.mjs";
|
|
24
25
|
import "../../chunk-JTXYKO3U.mjs";
|
|
25
26
|
import "../../chunk-AUQDI5BS.mjs";
|
|
26
|
-
import "../../chunk-
|
|
27
|
-
import "../../chunk-Z4FZ7W6L.mjs";
|
|
27
|
+
import "../../chunk-7OV5ZYW6.mjs";
|
|
28
28
|
import "../../chunk-7P6ASYW6.mjs";
|
|
29
29
|
export {
|
|
30
30
|
ShelbyMetadataClient,
|
package/dist/node/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export { BlobActivity, BlobActivityType, BlobEncoding, BlobMetadata, ClayEncodin
|
|
|
23
23
|
export { ChannelInfo, SenderBuiltMicropayment, StaleChannelStateError } from '../core/types/payments.js';
|
|
24
24
|
export { PlacementGroupInfo, PlacementGroupSlot, PlacementGroupSlotStatus } from '../core/types/placement_groups.js';
|
|
25
25
|
export { ActiveStateDetails, FrozenStateDetails, StorageProviderInfo, StorageProviderStateDetails, WaitlistedStateDetails } from '../core/types/storage_providers.js';
|
|
26
|
-
export { buildRequestUrl, concatHashes, getBlobNameSuffix, readInChunks, zeroPadBytes } from '../core/utils.js';
|
|
26
|
+
export { buildRequestUrl, concatHashes, getBlobNameSuffix, normalizeAddress, readInChunks, zeroPadBytes } from '../core/utils.js';
|
|
27
27
|
export { ShelbyNodeClient } from './clients/ShelbyNodeClient.js';
|
|
28
28
|
export { t as testUtil } from '../testUtil-BnxAchIN.js';
|
|
29
29
|
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';
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-MB7C7VQF.mjs";
|
|
2
2
|
import {
|
|
3
3
|
ShelbyNodeClient
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-FMPOGFDW.mjs";
|
|
5
5
|
import {
|
|
6
6
|
testUtil_exports
|
|
7
7
|
} from "../chunk-A4IG6GSE.mjs";
|
|
@@ -9,49 +9,36 @@ import "../chunk-EM67QTMR.mjs";
|
|
|
9
9
|
import "../chunk-WTICJPDB.mjs";
|
|
10
10
|
import {
|
|
11
11
|
ShelbyClient
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-ONOOCOQ5.mjs";
|
|
13
13
|
import {
|
|
14
14
|
MissingTransactionSubmitterError,
|
|
15
15
|
ShelbyBlobClient
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-XNEIWM4O.mjs";
|
|
18
|
-
import {
|
|
19
|
-
createDefaultErasureCodingProvider,
|
|
20
|
-
defaultErasureCodingConfig,
|
|
21
|
-
erasureCodingConfig16Total10Data13Helper,
|
|
22
|
-
erasureCodingConfig4Total2Data3Helper
|
|
23
|
-
} from "../chunk-HPPMI7DC.mjs";
|
|
24
|
-
import {
|
|
25
|
-
ClayErasureCodingProvider
|
|
26
|
-
} from "../chunk-OGKZ575S.mjs";
|
|
27
|
-
import {
|
|
28
|
-
ReedSolomonErasureCodingProvider
|
|
29
|
-
} from "../chunk-NHWWORCH.mjs";
|
|
16
|
+
} from "../chunk-PESSW3FK.mjs";
|
|
30
17
|
import "../chunk-Z7RFCADT.mjs";
|
|
31
18
|
import {
|
|
32
19
|
ShelbyMetadataClient
|
|
33
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-H53O23I7.mjs";
|
|
34
21
|
import {
|
|
35
22
|
ShelbyMicropaymentChannelClient
|
|
36
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-H5YZHUSJ.mjs";
|
|
37
24
|
import "../chunk-QQ57OGQ2.mjs";
|
|
38
25
|
import "../chunk-ZHXCVRZX.mjs";
|
|
39
26
|
import "../chunk-AD2G3QYD.mjs";
|
|
40
27
|
import "../chunk-MQUVYMNQ.mjs";
|
|
41
28
|
import {
|
|
42
29
|
ShelbyPlacementGroupClient
|
|
43
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-57RQAVKL.mjs";
|
|
44
31
|
import {
|
|
45
32
|
ShelbyRPCClient
|
|
46
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-E5PP7BZJ.mjs";
|
|
47
34
|
import {
|
|
48
35
|
SenderBuiltMicropayment,
|
|
49
36
|
StaleChannelStateError
|
|
50
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-TVLV7C74.mjs";
|
|
51
38
|
import {
|
|
52
39
|
createShelbyIndexerClient,
|
|
53
40
|
getShelbyIndexerClient
|
|
54
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-EZPZAUIV.mjs";
|
|
55
42
|
import {
|
|
56
43
|
Blob_Activities_Select_Column,
|
|
57
44
|
Blobs_Select_Column,
|
|
@@ -69,6 +56,23 @@ import {
|
|
|
69
56
|
getSdk
|
|
70
57
|
} from "../chunk-KJ24NKPH.mjs";
|
|
71
58
|
import "../chunk-AABBONAF.mjs";
|
|
59
|
+
import "../chunk-XNEIWM4O.mjs";
|
|
60
|
+
import {
|
|
61
|
+
createDefaultErasureCodingProvider,
|
|
62
|
+
defaultErasureCodingConfig,
|
|
63
|
+
erasureCodingConfig16Total10Data13Helper,
|
|
64
|
+
erasureCodingConfig4Total2Data3Helper
|
|
65
|
+
} from "../chunk-HPPMI7DC.mjs";
|
|
66
|
+
import {
|
|
67
|
+
ClayErasureCodingProvider
|
|
68
|
+
} from "../chunk-OGKZ575S.mjs";
|
|
69
|
+
import {
|
|
70
|
+
ReedSolomonErasureCodingProvider
|
|
71
|
+
} from "../chunk-NHWWORCH.mjs";
|
|
72
|
+
import {
|
|
73
|
+
BlobNameSchema,
|
|
74
|
+
ChunkKey
|
|
75
|
+
} from "../chunk-Z4FZ7W6L.mjs";
|
|
72
76
|
import {
|
|
73
77
|
isShelbyNetwork,
|
|
74
78
|
shelbyNetworks
|
|
@@ -92,7 +96,7 @@ import {
|
|
|
92
96
|
} from "../chunk-C6RQ3AEU.mjs";
|
|
93
97
|
import {
|
|
94
98
|
createBlobKey
|
|
95
|
-
} from "../chunk-
|
|
99
|
+
} from "../chunk-3NRBHSMQ.mjs";
|
|
96
100
|
import {
|
|
97
101
|
BlobCommitmentsSchema,
|
|
98
102
|
COMMITMENT_SCHEMA_VERSION,
|
|
@@ -100,14 +104,15 @@ import {
|
|
|
100
104
|
expectedTotalChunksets,
|
|
101
105
|
generateCommitments,
|
|
102
106
|
generateMerkleRoot
|
|
103
|
-
} from "../chunk-
|
|
107
|
+
} from "../chunk-BXEVML7N.mjs";
|
|
104
108
|
import {
|
|
105
109
|
buildRequestUrl,
|
|
106
110
|
concatHashes,
|
|
107
111
|
getBlobNameSuffix,
|
|
112
|
+
normalizeAddress,
|
|
108
113
|
readInChunks,
|
|
109
114
|
zeroPadBytes
|
|
110
|
-
} from "../chunk-
|
|
115
|
+
} from "../chunk-UEZNZBJO.mjs";
|
|
111
116
|
import {
|
|
112
117
|
CHUNK_SIZE_PARAMS,
|
|
113
118
|
ChunkSizeScheme,
|
|
@@ -138,7 +143,7 @@ import {
|
|
|
138
143
|
SHELBY_DEPLOYER,
|
|
139
144
|
TOKEN_DEPLOYER,
|
|
140
145
|
TOKEN_OBJECT_ADDRESS
|
|
141
|
-
} from "../chunk-
|
|
146
|
+
} from "../chunk-7OV5ZYW6.mjs";
|
|
142
147
|
import {
|
|
143
148
|
ShelbyErrorCodes,
|
|
144
149
|
isAccessDeniedError,
|
|
@@ -146,10 +151,6 @@ import {
|
|
|
146
151
|
isBlobExpiredError,
|
|
147
152
|
isBlobNotFoundError
|
|
148
153
|
} from "../chunk-CQ6QPIZK.mjs";
|
|
149
|
-
import {
|
|
150
|
-
BlobNameSchema,
|
|
151
|
-
ChunkKey
|
|
152
|
-
} from "../chunk-Z4FZ7W6L.mjs";
|
|
153
154
|
import "../chunk-7P6ASYW6.mjs";
|
|
154
155
|
export {
|
|
155
156
|
BlobCommitmentsSchema,
|
|
@@ -237,6 +238,7 @@ export {
|
|
|
237
238
|
isBlobExpiredError,
|
|
238
239
|
isBlobNotFoundError,
|
|
239
240
|
isShelbyNetwork,
|
|
241
|
+
normalizeAddress,
|
|
240
242
|
readInChunks,
|
|
241
243
|
shelbyNetworks,
|
|
242
244
|
testUtil_exports as testUtil,
|
package/package.json
CHANGED
package/dist/chunk-4MG4XGY4.mjs
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
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
|
-
};
|
package/dist/chunk-OTBLZL2S.mjs
DELETED