@arcadiasystems/morse-sdk 0.2.0 → 0.4.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.
Files changed (99) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/dist/codecs.d.ts +3 -7
  3. package/dist/codecs.d.ts.map +1 -1
  4. package/dist/codecs.js +3 -11
  5. package/dist/codecs.js.map +1 -1
  6. package/dist/config.d.ts +11 -0
  7. package/dist/config.d.ts.map +1 -1
  8. package/dist/config.js +14 -3
  9. package/dist/config.js.map +1 -1
  10. package/dist/errors.d.ts +2 -2
  11. package/dist/errors.d.ts.map +1 -1
  12. package/dist/errors.format.js +1 -2
  13. package/dist/errors.format.js.map +1 -1
  14. package/dist/errors.js +29 -27
  15. package/dist/errors.js.map +1 -1
  16. package/dist/index.d.ts +5 -5
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +4 -4
  19. package/dist/index.js.map +1 -1
  20. package/dist/ops/index.d.ts +2 -3
  21. package/dist/ops/index.d.ts.map +1 -1
  22. package/dist/ops/index.js +2 -3
  23. package/dist/ops/index.js.map +1 -1
  24. package/dist/ops/recipient-file-from-bytes.d.ts +123 -0
  25. package/dist/ops/recipient-file-from-bytes.d.ts.map +1 -0
  26. package/dist/ops/recipient-file-from-bytes.js +142 -0
  27. package/dist/ops/recipient-file-from-bytes.js.map +1 -0
  28. package/dist/ops/recipient-file.d.ts +114 -0
  29. package/dist/ops/recipient-file.d.ts.map +1 -0
  30. package/dist/ops/recipient-file.js +151 -0
  31. package/dist/ops/recipient-file.js.map +1 -0
  32. package/dist/ptb/recipient-file.d.ts +82 -0
  33. package/dist/ptb/recipient-file.d.ts.map +1 -0
  34. package/dist/ptb/recipient-file.js +148 -0
  35. package/dist/ptb/recipient-file.js.map +1 -0
  36. package/dist/read/index.d.ts +2 -1
  37. package/dist/read/index.d.ts.map +1 -1
  38. package/dist/read/index.js +2 -1
  39. package/dist/read/index.js.map +1 -1
  40. package/dist/read/recipient-file-events.d.ts +65 -0
  41. package/dist/read/recipient-file-events.d.ts.map +1 -0
  42. package/dist/read/recipient-file-events.js +172 -0
  43. package/dist/read/recipient-file-events.js.map +1 -0
  44. package/dist/read/recipient-files-reader.d.ts +27 -0
  45. package/dist/read/recipient-files-reader.d.ts.map +1 -0
  46. package/dist/read/recipient-files-reader.js +170 -0
  47. package/dist/read/recipient-files-reader.js.map +1 -0
  48. package/dist/seal/adapter.d.ts +20 -19
  49. package/dist/seal/adapter.d.ts.map +1 -1
  50. package/dist/seal/adapter.js +9 -3
  51. package/dist/seal/adapter.js.map +1 -1
  52. package/dist/seal/default-adapter.d.ts +5 -5
  53. package/dist/seal/default-adapter.d.ts.map +1 -1
  54. package/dist/seal/default-adapter.js +13 -22
  55. package/dist/seal/default-adapter.js.map +1 -1
  56. package/dist/seal/index.d.ts +2 -2
  57. package/dist/seal/index.d.ts.map +1 -1
  58. package/dist/seal/index.js +1 -1
  59. package/dist/seal/index.js.map +1 -1
  60. package/dist/seal/recipient-file-identity.d.ts +53 -0
  61. package/dist/seal/recipient-file-identity.d.ts.map +1 -0
  62. package/dist/seal/recipient-file-identity.js +87 -0
  63. package/dist/seal/recipient-file-identity.js.map +1 -0
  64. package/dist/types.d.ts +60 -31
  65. package/dist/types.d.ts.map +1 -1
  66. package/dist/types.js +1 -1
  67. package/dist/types.js.map +1 -1
  68. package/dist/wallets/keypair-adapter.d.ts.map +1 -1
  69. package/dist/wallets/keypair-adapter.js +1 -2
  70. package/dist/wallets/keypair-adapter.js.map +1 -1
  71. package/package.json +1 -1
  72. package/dist/ops/allowlist.d.ts +0 -79
  73. package/dist/ops/allowlist.d.ts.map +0 -1
  74. package/dist/ops/allowlist.js +0 -122
  75. package/dist/ops/allowlist.js.map +0 -1
  76. package/dist/ops/file-from-bytes.d.ts +0 -84
  77. package/dist/ops/file-from-bytes.d.ts.map +0 -1
  78. package/dist/ops/file-from-bytes.js +0 -133
  79. package/dist/ops/file-from-bytes.js.map +0 -1
  80. package/dist/ops/file.d.ts +0 -88
  81. package/dist/ops/file.d.ts.map +0 -1
  82. package/dist/ops/file.js +0 -142
  83. package/dist/ops/file.js.map +0 -1
  84. package/dist/ptb/allowlist.d.ts +0 -65
  85. package/dist/ptb/allowlist.d.ts.map +0 -1
  86. package/dist/ptb/allowlist.js +0 -75
  87. package/dist/ptb/allowlist.js.map +0 -1
  88. package/dist/ptb/file.d.ts +0 -58
  89. package/dist/ptb/file.d.ts.map +0 -1
  90. package/dist/ptb/file.js +0 -108
  91. package/dist/ptb/file.js.map +0 -1
  92. package/dist/read/files-reader.d.ts +0 -59
  93. package/dist/read/files-reader.d.ts.map +0 -1
  94. package/dist/read/files-reader.js +0 -247
  95. package/dist/read/files-reader.js.map +0 -1
  96. package/dist/seal/allowlist-identity.d.ts +0 -36
  97. package/dist/seal/allowlist-identity.d.ts.map +0 -1
  98. package/dist/seal/allowlist-identity.js +0 -81
  99. package/dist/seal/allowlist-identity.js.map +0 -1
@@ -1,12 +1,11 @@
1
1
  /**
2
2
  * Public barrel for the high-level ops layer.
3
3
  */
4
- export { type AddMemberArgs, type AllowlistOpResult, addMember, type CreateAllowlistArgs, type CreateAllowlistResult, createAllowlist, type DeleteAllowlistArgs, deleteAllowlist, type RemoveMemberArgs, removeMember, type TransferAllowlistCapArgs, transferAllowlistCap, } from "./allowlist.js";
5
4
  export { type DestroyPublisherCapArgs, type DestroyPublisherCapResult, destroyPublisherCap, type IssuePublisherCapArgs, type IssuePublisherCapResult, issuePublisherCap, type RevokePublisherCapArgs, type RevokePublisherCapResult, revokePublisherCap, type TransferPublisherCapArgs, type TransferPublisherCapResult, transferPublisherCap, } from "./cap.js";
6
5
  export { type CreateCollectionArgs, type CreateCollectionResult, createCollection, type DeleteCollectionArgs, type DeleteCollectionResult, deleteCollection, } from "./collection.js";
7
6
  export { type AddEncryptedEntryArgs, type AddEntryArgs, type AddEntryResult, type AppendDraftRevisionArgs, type AppendEncryptedDraftRevisionArgs, addEncryptedEntry, addEntry, appendDraftRevision, appendEncryptedDraftRevision, type DeleteEntryArgs, type DeleteEntryResult, deleteEntry, type PublishDirectArgs, type PublishFromDraftArgs, publishDirect, publishFromDraft, type RevisionAppendResult, } from "./entry.js";
8
7
  export { type AddEncryptedEntryFromBytesArgs, type AddEntryFromBytesArgs, type AddEntryFromBytesResult, addEncryptedEntryFromBytes, addEntryFromBytes, type ProgressCallback, type ProgressEvent, } from "./entry-from-bytes.js";
9
- export { type CreateEncryptedFileArgs, type CreateFileResult, type CreatePublicFileArgs, createEncryptedFile, createPublicFile, type DeleteFileArgs, deleteFile, type FileOpResult, type TransferFileOwnershipArgs, transferFileOwnership, type UpdateFileMetadataArgs, updateFileMetadata, } from "./file.js";
10
- export { type FileUploadProgressCallback, type FileUploadProgressEvent, type UploadEncryptedFileFromBytesArgs, type UploadFileResult, type UploadPublicFileFromBytesArgs, uploadEncryptedFileFromBytes, uploadPublicFileFromBytes, } from "./file-from-bytes.js";
11
8
  export { type CreatePublicationArgs, type CreatePublicationResult, createPublication, type DeletePublicationArgs, type DeletePublicationResult, deletePublication, type PublicationConfig, type TransferOwnershipArgs, type TransferOwnershipResult, transferOwnership, } from "./publication.js";
9
+ export { type AddRecipientArgs, addRecipient, type CreateEncryptedRecipientFileArgs, type CreateRecipientFileArgs, type CreateRecipientFileResult, createEncryptedRecipientFile, createRecipientFile, type DeleteRecipientFileArgs, deleteRecipientFile, type RecipientFileOpResult, type RemoveRecipientArgs, removeRecipient, type TransferRecipientFileOwnershipArgs, transferRecipientFileOwnership, type UpdateRecipientFileMetadataArgs, updateRecipientFileMetadata, } from "./recipient-file.js";
10
+ export { type FileUploadProgressCallback, type FileUploadProgressEvent, type UploadEncryptedRecipientFileArgs, type UploadEncryptedRecipientFileResult, type UploadRecipientFileArgs, type UploadRecipientFileResult, uploadEncryptedRecipientFileFromBytes, uploadRecipientFileFromBytes, } from "./recipient-file-from-bytes.js";
12
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {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rel for the high-level ops layer.
3
3
  */
4
- export { addMember, createAllowlist, deleteAllowlist, removeMember, transferAllowlistCap, } from "./allowlist.js";
5
4
  export { destroyPublisherCap, issuePublisherCap, revokePublisherCap, transferPublisherCap, } from "./cap.js";
6
5
  export { createCollection, deleteCollection, } from "./collection.js";
7
6
  export { addEncryptedEntry, addEntry, appendDraftRevision, appendEncryptedDraftRevision, deleteEntry, publishDirect, publishFromDraft, } from "./entry.js";
8
7
  export { addEncryptedEntryFromBytes, addEntryFromBytes, } from "./entry-from-bytes.js";
9
- export { createEncryptedFile, createPublicFile, deleteFile, transferFileOwnership, updateFileMetadata, } from "./file.js";
10
- export { uploadEncryptedFileFromBytes, uploadPublicFileFromBytes, } from "./file-from-bytes.js";
11
8
  export { createPublication, deletePublication, transferOwnership, } from "./publication.js";
9
+ export { addRecipient, createEncryptedRecipientFile, createRecipientFile, deleteRecipientFile, removeRecipient, transferRecipientFileOwnership, updateRecipientFileMetadata, } from "./recipient-file.js";
10
+ export { uploadEncryptedRecipientFileFromBytes, uploadRecipientFileFromBytes, } from "./recipient-file-from-bytes.js";
12
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ops/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGN,SAAS,EAGT,eAAe,EAEf,eAAe,EAEf,YAAY,EAEZ,oBAAoB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAGN,mBAAmB,EAGnB,iBAAiB,EAGjB,kBAAkB,EAGlB,oBAAoB,GACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAGN,gBAAgB,EAGhB,gBAAgB,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAMN,iBAAiB,EACjB,QAAQ,EACR,mBAAmB,EACnB,4BAA4B,EAG5B,WAAW,EAGX,aAAa,EACb,gBAAgB,GAEhB,MAAM,YAAY,CAAC;AACpB,OAAO,EAIN,0BAA0B,EAC1B,iBAAiB,GAGjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAIN,mBAAmB,EACnB,gBAAgB,EAEhB,UAAU,EAGV,qBAAqB,EAErB,kBAAkB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAMN,4BAA4B,EAC5B,yBAAyB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGN,iBAAiB,EAGjB,iBAAiB,EAIjB,iBAAiB,GACjB,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ops/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGN,mBAAmB,EAGnB,iBAAiB,EAGjB,kBAAkB,EAGlB,oBAAoB,GACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAGN,gBAAgB,EAGhB,gBAAgB,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAMN,iBAAiB,EACjB,QAAQ,EACR,mBAAmB,EACnB,4BAA4B,EAG5B,WAAW,EAGX,aAAa,EACb,gBAAgB,GAEhB,MAAM,YAAY,CAAC;AACpB,OAAO,EAIN,0BAA0B,EAC1B,iBAAiB,GAGjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGN,iBAAiB,EAGjB,iBAAiB,EAIjB,iBAAiB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEN,YAAY,EAIZ,4BAA4B,EAC5B,mBAAmB,EAEnB,mBAAmB,EAGnB,eAAe,EAEf,8BAA8B,EAE9B,2BAA2B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAON,qCAAqC,EACrC,4BAA4B,GAC5B,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,123 @@
1
+ /**
2
+ * One-shot upload helpers that combine Walrus blob upload with
3
+ * RecipientFile creation in 2 wallet popups.
4
+ *
5
+ * Background: a naive flow has three popups (Walrus `register_blob`, Walrus
6
+ * `certify_blob`, then `new_recipient_file_with_seal_prefix`). The second
7
+ * and third are both on-chain Sui transactions and can be packed into one
8
+ * PTB. The first cannot be merged because the off-chain byte upload to
9
+ * storage nodes happens between register and certify.
10
+ *
11
+ * The encrypted variant exploits the v4 contract's caller-supplied seal
12
+ * prefix: the client picks a random prefix, encrypts under it before
13
+ * uploading, and binds the same prefix on chain via
14
+ * `new_recipient_file_with_seal_prefix`. This breaks the file-id chicken-
15
+ * and-egg the v3 contract had (file id was unknown at encrypt time).
16
+ */
17
+ import type { MorsePackageConfig } from "../config.js";
18
+ import type { SealAdapter } from "../seal/adapter.js";
19
+ import type { BlobObjectId, RecipientFileId, SuiAddress, WalrusBlobId } from "../types.js";
20
+ import type { WalletAdapter } from "../wallets/adapter.js";
21
+ import { type UploadBlobOptions, type WalrusFlowCapable, type WalrusWriteAdapter } from "../walrus/adapter.js";
22
+ /**
23
+ * Coarse-grained progress phases.
24
+ *
25
+ * - `encrypting`: emitted once at the start of
26
+ * `uploadEncryptedRecipientFileFromBytes` before the Seal call. Not
27
+ * emitted for the public variant.
28
+ * - `uploading`: emitted before `register_blob` (popup 1) and again before
29
+ * the off-chain upload to storage nodes; UI can keep one spinner across
30
+ * both.
31
+ * - `submitting`: emitted before the combined `certify_blob +
32
+ * new_recipient_file{_with_seal_prefix} + share` PTB (popup 2).
33
+ * - `complete`: emitted after the file has been created on chain.
34
+ */
35
+ export type FileUploadProgressEvent = {
36
+ readonly phase: "encrypting";
37
+ } | {
38
+ readonly phase: "uploading";
39
+ } | {
40
+ readonly phase: "submitting";
41
+ } | {
42
+ readonly phase: "complete";
43
+ };
44
+ export type FileUploadProgressCallback = (event: FileUploadProgressEvent) => void;
45
+ /** Result of `uploadRecipientFileFromBytes` / `uploadEncryptedRecipientFileFromBytes`. */
46
+ export interface UploadRecipientFileResult {
47
+ readonly digest: string;
48
+ readonly gasUsedMist: bigint;
49
+ readonly fileId: RecipientFileId;
50
+ readonly blobId: WalrusBlobId;
51
+ readonly blobObjectId: BlobObjectId;
52
+ }
53
+ /** Args for `uploadRecipientFileFromBytes`. */
54
+ export interface UploadRecipientFileArgs {
55
+ readonly walrus: WalrusWriteAdapter & WalrusFlowCapable;
56
+ readonly bytes: Uint8Array;
57
+ readonly recipients: readonly SuiAddress[];
58
+ readonly name: string;
59
+ readonly contentType: string;
60
+ readonly upload: UploadBlobOptions;
61
+ readonly signal?: AbortSignal;
62
+ readonly onProgress?: FileUploadProgressCallback;
63
+ }
64
+ /**
65
+ * Upload `bytes` to Walrus and create a public (unencrypted) `RecipientFile`
66
+ * in 2 wallet popups: `register_blob`, then a combined `certify_blob +
67
+ * new_recipient_file + share` PTB.
68
+ *
69
+ * @throws {UncertifiedBlobError} If popup 2 fails after upload succeeded.
70
+ * The blob is uploaded but uncertified and storage is held until expiry.
71
+ * @throws {ContractAbortError} On Move abort during simulation.
72
+ * @throws {TransportError} On RPC, network, or upload-step failure.
73
+ */
74
+ export declare function uploadRecipientFileFromBytes(adapter: WalletAdapter, config: MorsePackageConfig, args: UploadRecipientFileArgs): Promise<UploadRecipientFileResult>;
75
+ /** Args for `uploadEncryptedRecipientFileFromBytes`. */
76
+ export interface UploadEncryptedRecipientFileArgs {
77
+ readonly walrus: WalrusWriteAdapter & WalrusFlowCapable;
78
+ readonly seal: SealAdapter;
79
+ readonly plaintext: Uint8Array;
80
+ readonly recipients: readonly SuiAddress[];
81
+ readonly name: string;
82
+ readonly contentType: string;
83
+ readonly upload: UploadBlobOptions;
84
+ readonly signal?: AbortSignal;
85
+ readonly onProgress?: FileUploadProgressCallback;
86
+ /**
87
+ * Optional caller-supplied seal prefix. Defaults to 32 random bytes from
88
+ * Web Crypto. Override for deterministic tests or when the prefix is
89
+ * derived from external state. Must be at least 1 byte.
90
+ */
91
+ readonly sealIdPrefix?: Uint8Array;
92
+ /**
93
+ * Optional caller-supplied seal nonce. Defaults to 16 random bytes from
94
+ * Web Crypto. Override for deterministic tests; must be at least 1 byte.
95
+ */
96
+ readonly sealNonce?: Uint8Array;
97
+ }
98
+ /** Result of `uploadEncryptedRecipientFileFromBytes`. */
99
+ export interface UploadEncryptedRecipientFileResult extends UploadRecipientFileResult {
100
+ /** The seal prefix bound to the on-chain file. Recipients need this to decrypt. */
101
+ readonly sealIdPrefix: Uint8Array;
102
+ /** The nonce used for this encryption. Surface to indexers/UI as needed. */
103
+ readonly sealNonce: Uint8Array;
104
+ }
105
+ /**
106
+ * Encrypt `plaintext` under Seal with a caller-supplied prefix, upload the
107
+ * ciphertext to Walrus, and create an encrypted `RecipientFile` carrying
108
+ * the prefix on chain. 2 wallet popups: `register_blob`, then a combined
109
+ * `certify_blob + new_recipient_file_with_seal_prefix + share` PTB.
110
+ *
111
+ * After this returns, recipients can decrypt by reading the file, fetching
112
+ * the blob via Walrus, and calling
113
+ * `sealAdapter.decryptUnderRecipientFile(ciphertext, { fileId, sealId, sessionKey })`
114
+ * where `sealId = sealIdPrefix || tag(=3) || sealNonce` (rebuild via
115
+ * `buildRecipientFileSealId(sealIdPrefix, sealNonce)`).
116
+ *
117
+ * @throws {SealError} If encryption fails (no popup yet).
118
+ * @throws {UncertifiedBlobError} If popup 2 fails after upload succeeded.
119
+ * @throws {ContractAbortError} On Move abort during simulation.
120
+ * @throws {TransportError} On RPC, network, or upload-step failure.
121
+ */
122
+ export declare function uploadEncryptedRecipientFileFromBytes(adapter: WalletAdapter, config: MorsePackageConfig, args: UploadEncryptedRecipientFileArgs): Promise<UploadEncryptedRecipientFileResult>;
123
+ //# sourceMappingURL=recipient-file-from-bytes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipient-file-from-bytes.d.ts","sourceRoot":"","sources":["../../src/ops/recipient-file-from-bytes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAOvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMtD,OAAO,KAAK,EACX,YAAY,EACZ,eAAe,EACf,UAAU,EACV,YAAY,EAC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
4
+ *
5
+ * Background: a naive flow has three popups (Walrus `register_blob`, Walrus
6
+ * `certify_blob`, then `new_recipient_file_with_seal_prefix`). The second
7
+ * and third are both on-chain Sui transactions and can be packed into one
8
+ * PTB. The first cannot be merged because the off-chain byte upload to
9
+ * storage nodes happens between register and certify.
10
+ *
11
+ * The encrypted variant exploits the v4 contract's caller-supplied seal
12
+ * prefix: the client picks a random prefix, encrypts under it before
13
+ * uploading, and binds the same prefix on chain via
14
+ * `new_recipient_file_with_seal_prefix`. This breaks the file-id chicken-
15
+ * and-egg the v3 contract had (file id was unknown at encrypt time).
16
+ */
17
+ import { toRecipientFileId } from "../codecs.js";
18
+ import { TransportError, UncertifiedBlobError } from "../errors.js";
19
+ import { buildNewRecipientFile, buildNewRecipientFileWithSealPrefix, buildShareRecipientFile, } from "../ptb/recipient-file.js";
20
+ import { buildRecipientFileSealId, randomSealNonce, randomSealPrefix, } from "../seal/recipient-file-identity.js";
21
+ import { isWalrusFlowCapable, } from "../walrus/adapter.js";
22
+ import { findCreatedId } from "./internal.js";
23
+ /**
24
+ * Upload `bytes` to Walrus and create a public (unencrypted) `RecipientFile`
25
+ * in 2 wallet popups: `register_blob`, then a combined `certify_blob +
26
+ * new_recipient_file + share` PTB.
27
+ *
28
+ * @throws {UncertifiedBlobError} If popup 2 fails after upload succeeded.
29
+ * The blob is uploaded but uncertified and storage is held until expiry.
30
+ * @throws {ContractAbortError} On Move abort during simulation.
31
+ * @throws {TransportError} On RPC, network, or upload-step failure.
32
+ */
33
+ export async function uploadRecipientFileFromBytes(adapter, config, args) {
34
+ assertFlowCapable(args.walrus);
35
+ args.onProgress?.({ phase: "uploading" });
36
+ const upload = await args.walrus.startBlobUpload(args.bytes, args.upload);
37
+ try {
38
+ const tx = upload.certifyTransaction;
39
+ const file = buildNewRecipientFile(tx, {
40
+ packageId: config.packageId,
41
+ blobId: upload.blobId,
42
+ blobObjectId: upload.blobObjectId,
43
+ name: args.name,
44
+ contentType: args.contentType,
45
+ size: args.bytes.length,
46
+ recipients: args.recipients,
47
+ });
48
+ buildShareRecipientFile(tx, { packageId: config.packageId, file });
49
+ args.onProgress?.({ phase: "submitting" });
50
+ const result = await submitCombinedTx(adapter, tx, config, {
51
+ blobObjectId: upload.blobObjectId,
52
+ blobId: upload.blobId,
53
+ ...(args.signal === undefined ? {} : { signal: args.signal }),
54
+ });
55
+ args.onProgress?.({ phase: "complete" });
56
+ return result;
57
+ }
58
+ catch (cause) {
59
+ if (cause instanceof UncertifiedBlobError)
60
+ throw cause;
61
+ throw new UncertifiedBlobError(upload.blobObjectId, upload.blobId, {
62
+ cause,
63
+ });
64
+ }
65
+ }
66
+ /**
67
+ * Encrypt `plaintext` under Seal with a caller-supplied prefix, upload the
68
+ * ciphertext to Walrus, and create an encrypted `RecipientFile` carrying
69
+ * the prefix on chain. 2 wallet popups: `register_blob`, then a combined
70
+ * `certify_blob + new_recipient_file_with_seal_prefix + share` PTB.
71
+ *
72
+ * After this returns, recipients can decrypt by reading the file, fetching
73
+ * the blob via Walrus, and calling
74
+ * `sealAdapter.decryptUnderRecipientFile(ciphertext, { fileId, sealId, sessionKey })`
75
+ * where `sealId = sealIdPrefix || tag(=3) || sealNonce` (rebuild via
76
+ * `buildRecipientFileSealId(sealIdPrefix, sealNonce)`).
77
+ *
78
+ * @throws {SealError} If encryption fails (no popup yet).
79
+ * @throws {UncertifiedBlobError} If popup 2 fails after upload succeeded.
80
+ * @throws {ContractAbortError} On Move abort during simulation.
81
+ * @throws {TransportError} On RPC, network, or upload-step failure.
82
+ */
83
+ export async function uploadEncryptedRecipientFileFromBytes(adapter, config, args) {
84
+ assertFlowCapable(args.walrus);
85
+ const sealIdPrefix = args.sealIdPrefix ?? randomSealPrefix();
86
+ const sealNonce = args.sealNonce ?? randomSealNonce();
87
+ const sealId = buildRecipientFileSealId(sealIdPrefix, sealNonce);
88
+ args.onProgress?.({ phase: "encrypting" });
89
+ const { ciphertext } = await args.seal.encrypt(args.plaintext, { sealId });
90
+ args.onProgress?.({ phase: "uploading" });
91
+ const upload = await args.walrus.startBlobUpload(ciphertext, args.upload);
92
+ try {
93
+ const tx = upload.certifyTransaction;
94
+ const file = buildNewRecipientFileWithSealPrefix(tx, {
95
+ packageId: config.packageId,
96
+ sealIdPrefix,
97
+ blobId: upload.blobId,
98
+ blobObjectId: upload.blobObjectId,
99
+ name: args.name,
100
+ contentType: args.contentType,
101
+ // Plaintext byte length, per Move contract semantics. The Walrus
102
+ // blob stores the larger ciphertext.
103
+ size: args.plaintext.length,
104
+ recipients: args.recipients,
105
+ });
106
+ buildShareRecipientFile(tx, { packageId: config.packageId, file });
107
+ args.onProgress?.({ phase: "submitting" });
108
+ const result = await submitCombinedTx(adapter, tx, config, {
109
+ blobObjectId: upload.blobObjectId,
110
+ blobId: upload.blobId,
111
+ ...(args.signal === undefined ? {} : { signal: args.signal }),
112
+ });
113
+ args.onProgress?.({ phase: "complete" });
114
+ return { ...result, sealIdPrefix, sealNonce };
115
+ }
116
+ catch (cause) {
117
+ if (cause instanceof UncertifiedBlobError)
118
+ throw cause;
119
+ throw new UncertifiedBlobError(upload.blobObjectId, upload.blobId, {
120
+ cause,
121
+ });
122
+ }
123
+ }
124
+ function assertFlowCapable(walrus) {
125
+ if (!isWalrusFlowCapable(walrus)) {
126
+ throw new TransportError("uploadRecipientFileFromBytes / uploadEncryptedRecipientFileFromBytes require a WalrusWriteAdapter that implements WalrusFlowCapable (i.e. exposes startBlobUpload). DefaultWalrusWriteAdapter does. Custom adapters without the capability should compose walrus.uploadBlob + createRecipientFile (3 popups) instead.", { operation: "sdk.uploadRecipientFileFromBytes" });
127
+ }
128
+ }
129
+ async function submitCombinedTx(adapter, tx, config, args) {
130
+ const receipt = await adapter.signAndExecuteTransaction(tx, args.signal);
131
+ // RecipientFile was added in the v3 upgrade; the type identity uses the
132
+ // current published-at, not originalPackageId.
133
+ const fileType = `${config.packageId}::recipient_file::RecipientFile`;
134
+ return {
135
+ digest: receipt.digest,
136
+ gasUsedMist: receipt.gasUsedMist,
137
+ fileId: toRecipientFileId(findCreatedId(receipt, fileType)),
138
+ blobObjectId: args.blobObjectId,
139
+ blobId: args.blobId,
140
+ };
141
+ }
142
+ //# sourceMappingURL=recipient-file-from-bytes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipient-file-from-bytes.js","sourceRoot":"","sources":["../../src/ops/recipient-file-from-bytes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EACN,qBAAqB,EACrB,mCAAmC,EACnC,uBAAuB,GACvB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACN,wBAAwB,EACxB,eAAe,EACf,gBAAgB,GAChB,MAAM,oCAAoC,CAAC;AAQ5C,OAAO,EACN,mBAAmB,GAInB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AA8C9C;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CACjD,OAAsB,EACtB,MAA0B,EAC1B,IAA6B;IAE7B,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAE/B,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAE1E,IAAI,CAAC;QACJ,MAAM,EAAE,GAAG,MAAM,CAAC,kBAAkB,CAAC;QACrC,MAAM,IAAI,GAAG,qBAAqB,CAAC,EAAE,EAAE;YACtC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,YAAY,EAAE,MAAM,CAA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AAE,QAAQ,CAAC,CAAC;QAC3D,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,MAAM,EAAE,IAAI,CAAC,MAAM;KACnB,CAAC;AACH,CAAC"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * High-level ops for the `recipient_file` module. Single-Move-call wrappers
3
+ * that build a PTB, sign-and-execute it, and parse the receipt. Composed
4
+ * upload flows live in `recipient-file-from-bytes.ts`.
5
+ */
6
+ import type { MorsePackageConfig } from "../config.js";
7
+ import type { BlobObjectId, RecipientFileId, SuiAddress, WalrusBlobId } from "../types.js";
8
+ import type { WalletAdapter } from "../wallets/adapter.js";
9
+ /** Result returned by recipient-file ops that mutate but do not create. */
10
+ export interface RecipientFileOpResult {
11
+ readonly digest: string;
12
+ readonly gasUsedMist: bigint;
13
+ }
14
+ /** Result returned by `createRecipientFile` / `createEncryptedRecipientFile`. */
15
+ export interface CreateRecipientFileResult extends RecipientFileOpResult {
16
+ readonly fileId: RecipientFileId;
17
+ }
18
+ export interface CreateRecipientFileArgs {
19
+ readonly blobId: WalrusBlobId;
20
+ readonly blobObjectId?: BlobObjectId;
21
+ readonly name: string;
22
+ readonly contentType: string;
23
+ readonly size: number;
24
+ readonly recipients: readonly SuiAddress[];
25
+ readonly signal?: AbortSignal;
26
+ }
27
+ /**
28
+ * Create a `RecipientFile` referencing an already-uploaded Walrus blob. The
29
+ * sender is auto-added to the recipient set; duplicates in `recipients` are
30
+ * silently deduplicated by the Move layer.
31
+ *
32
+ * Builds a single PTB that calls `new_recipient_file` and
33
+ * `share_recipient_file` in sequence so the file is immediately usable.
34
+ *
35
+ * For Seal-encrypted uploads where the seal identity must be bound to the
36
+ * file before signing, use `createEncryptedRecipientFile` (or the one-shot
37
+ * `uploadEncryptedRecipientFileFromBytes`) instead.
38
+ *
39
+ * @throws {ContractAbortError} On Move abort (empty `blobId`, `name`, or
40
+ * `contentType`; oversized fields).
41
+ * @throws {TransportError} On RPC, network, or response-parsing failure.
42
+ */
43
+ export declare function createRecipientFile(adapter: WalletAdapter, config: MorsePackageConfig, args: CreateRecipientFileArgs): Promise<CreateRecipientFileResult>;
44
+ export interface CreateEncryptedRecipientFileArgs extends CreateRecipientFileArgs {
45
+ /**
46
+ * Caller-chosen prefix bytes bound to the file on chain via a dynamic
47
+ * field. The same prefix must have been used as the leading bytes of the
48
+ * Seal identity when encrypting the blob this file references; the on-chain
49
+ * `seal_approve_with_prefix` will validate decryption requests against
50
+ * exactly these bytes. Use `randomSealPrefix()` for a fresh 32-byte value.
51
+ */
52
+ readonly sealIdPrefix: Uint8Array;
53
+ }
54
+ /**
55
+ * Create a `RecipientFile` with an attached Seal identity prefix. The blob
56
+ * referenced by `blobId` is assumed to already be encrypted under a Seal
57
+ * identity of the form `sealIdPrefix || tag(=3) || nonce`. After this PTB
58
+ * lands, recipients can decrypt via `sealAdapter.decryptUnderRecipientFile`.
59
+ *
60
+ * @throws {ContractAbortError} On Move abort (empty `sealIdPrefix` /
61
+ * `blobId` / `name` / `contentType`, oversized fields).
62
+ * @throws {TransportError} On RPC, network, or response-parsing failure.
63
+ */
64
+ export declare function createEncryptedRecipientFile(adapter: WalletAdapter, config: MorsePackageConfig, args: CreateEncryptedRecipientFileArgs): Promise<CreateRecipientFileResult>;
65
+ export interface AddRecipientArgs {
66
+ readonly fileId: RecipientFileId;
67
+ readonly recipient: SuiAddress;
68
+ readonly signal?: AbortSignal;
69
+ }
70
+ /**
71
+ * Add an address to a recipient file's member set. Owner only. Aborts at the
72
+ * Move layer if the address is already a member (`ERecipientAlreadyPresent`).
73
+ */
74
+ export declare function addRecipient(adapter: WalletAdapter, config: MorsePackageConfig, args: AddRecipientArgs): Promise<RecipientFileOpResult>;
75
+ export interface RemoveRecipientArgs {
76
+ readonly fileId: RecipientFileId;
77
+ readonly recipient: SuiAddress;
78
+ readonly signal?: AbortSignal;
79
+ }
80
+ /**
81
+ * Remove an address from a recipient file's member set. Owner only. The owner
82
+ * may remove themselves; doing so revokes decrypt access but does not revoke
83
+ * mutation rights (those still come from the `owner` field).
84
+ */
85
+ export declare function removeRecipient(adapter: WalletAdapter, config: MorsePackageConfig, args: RemoveRecipientArgs): Promise<RecipientFileOpResult>;
86
+ export interface TransferRecipientFileOwnershipArgs {
87
+ readonly fileId: RecipientFileId;
88
+ readonly newOwner: SuiAddress;
89
+ readonly signal?: AbortSignal;
90
+ }
91
+ /**
92
+ * Transfer mutation rights to a new owner. Does NOT touch `members`; for a
93
+ * full handover (new owner gains decrypt, old owner loses it), compose with
94
+ * `addRecipient` + `removeRecipient` or call them in a custom PTB.
95
+ */
96
+ export declare function transferRecipientFileOwnership(adapter: WalletAdapter, config: MorsePackageConfig, args: TransferRecipientFileOwnershipArgs): Promise<RecipientFileOpResult>;
97
+ export interface UpdateRecipientFileMetadataArgs {
98
+ readonly fileId: RecipientFileId;
99
+ readonly name: string;
100
+ readonly contentType: string;
101
+ readonly signal?: AbortSignal;
102
+ }
103
+ /** Update the `name` and `contentType` of a recipient file. Owner only. */
104
+ export declare function updateRecipientFileMetadata(adapter: WalletAdapter, config: MorsePackageConfig, args: UpdateRecipientFileMetadataArgs): Promise<RecipientFileOpResult>;
105
+ export interface DeleteRecipientFileArgs {
106
+ readonly fileId: RecipientFileId;
107
+ readonly signal?: AbortSignal;
108
+ }
109
+ /**
110
+ * Delete a recipient file metadata record. Owner only. Does NOT delete the
111
+ * Walrus blob; that follows the Walrus lease lifecycle independently.
112
+ */
113
+ export declare function deleteRecipientFile(adapter: WalletAdapter, config: MorsePackageConfig, args: DeleteRecipientFileArgs): Promise<RecipientFileOpResult>;
114
+ //# sourceMappingURL=recipient-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipient-file.d.ts","sourceRoot":"","sources":["../../src/ops/recipient-file.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAWvD,OAAO,KAAK,EACX,YAAY,EACZ,eAAe,EACf,UAAU,EACV,YA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AAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC9B;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAE,uBAAuB,GAC3B,OAAO,CAAC,qBAAqB,CAAC,CAQhC"}
@@ -0,0 +1,151 @@
1
+ /**
2
+ * High-level ops for the `recipient_file` module. Single-Move-call wrappers
3
+ * that build a PTB, sign-and-execute it, and parse the receipt. Composed
4
+ * upload flows live in `recipient-file-from-bytes.ts`.
5
+ */
6
+ import { Transaction } from "@mysten/sui/transactions";
7
+ import { toRecipientFileId } from "../codecs.js";
8
+ import { buildAddRecipient, buildDeleteRecipientFile, buildNewRecipientFile, buildNewRecipientFileWithSealPrefix, buildRemoveRecipient, buildShareRecipientFile, buildTransferRecipientFileOwnership, buildUpdateRecipientFileMetadata, } from "../ptb/recipient-file.js";
9
+ import { findCreatedId } from "./internal.js";
10
+ /**
11
+ * Create a `RecipientFile` referencing an already-uploaded Walrus blob. The
12
+ * sender is auto-added to the recipient set; duplicates in `recipients` are
13
+ * silently deduplicated by the Move layer.
14
+ *
15
+ * Builds a single PTB that calls `new_recipient_file` and
16
+ * `share_recipient_file` in sequence so the file is immediately usable.
17
+ *
18
+ * For Seal-encrypted uploads where the seal identity must be bound to the
19
+ * file before signing, use `createEncryptedRecipientFile` (or the one-shot
20
+ * `uploadEncryptedRecipientFileFromBytes`) instead.
21
+ *
22
+ * @throws {ContractAbortError} On Move abort (empty `blobId`, `name`, or
23
+ * `contentType`; oversized fields).
24
+ * @throws {TransportError} On RPC, network, or response-parsing failure.
25
+ */
26
+ export async function createRecipientFile(adapter, config, args) {
27
+ const tx = new Transaction();
28
+ const file = buildNewRecipientFile(tx, {
29
+ packageId: config.packageId,
30
+ blobId: args.blobId,
31
+ ...(args.blobObjectId === undefined
32
+ ? {}
33
+ : { blobObjectId: args.blobObjectId }),
34
+ name: args.name,
35
+ contentType: args.contentType,
36
+ size: args.size,
37
+ recipients: args.recipients,
38
+ });
39
+ buildShareRecipientFile(tx, { packageId: config.packageId, file });
40
+ const receipt = await adapter.signAndExecuteTransaction(tx, args.signal);
41
+ return parseCreateReceipt(receipt, config);
42
+ }
43
+ /**
44
+ * Create a `RecipientFile` with an attached Seal identity prefix. The blob
45
+ * referenced by `blobId` is assumed to already be encrypted under a Seal
46
+ * identity of the form `sealIdPrefix || tag(=3) || nonce`. After this PTB
47
+ * lands, recipients can decrypt via `sealAdapter.decryptUnderRecipientFile`.
48
+ *
49
+ * @throws {ContractAbortError} On Move abort (empty `sealIdPrefix` /
50
+ * `blobId` / `name` / `contentType`, oversized fields).
51
+ * @throws {TransportError} On RPC, network, or response-parsing failure.
52
+ */
53
+ export async function createEncryptedRecipientFile(adapter, config, args) {
54
+ const tx = new Transaction();
55
+ const file = buildNewRecipientFileWithSealPrefix(tx, {
56
+ packageId: config.packageId,
57
+ sealIdPrefix: args.sealIdPrefix,
58
+ blobId: args.blobId,
59
+ ...(args.blobObjectId === undefined
60
+ ? {}
61
+ : { blobObjectId: args.blobObjectId }),
62
+ name: args.name,
63
+ contentType: args.contentType,
64
+ size: args.size,
65
+ recipients: args.recipients,
66
+ });
67
+ buildShareRecipientFile(tx, { packageId: config.packageId, file });
68
+ const receipt = await adapter.signAndExecuteTransaction(tx, args.signal);
69
+ return parseCreateReceipt(receipt, config);
70
+ }
71
+ /**
72
+ * Add an address to a recipient file's member set. Owner only. Aborts at the
73
+ * Move layer if the address is already a member (`ERecipientAlreadyPresent`).
74
+ */
75
+ export async function addRecipient(adapter, config, args) {
76
+ const tx = new Transaction();
77
+ buildAddRecipient(tx, {
78
+ packageId: config.packageId,
79
+ file: args.fileId,
80
+ recipient: args.recipient,
81
+ });
82
+ const receipt = await adapter.signAndExecuteTransaction(tx, args.signal);
83
+ return { digest: receipt.digest, gasUsedMist: receipt.gasUsedMist };
84
+ }
85
+ /**
86
+ * Remove an address from a recipient file's member set. Owner only. The owner
87
+ * may remove themselves; doing so revokes decrypt access but does not revoke
88
+ * mutation rights (those still come from the `owner` field).
89
+ */
90
+ export async function removeRecipient(adapter, config, args) {
91
+ const tx = new Transaction();
92
+ buildRemoveRecipient(tx, {
93
+ packageId: config.packageId,
94
+ file: args.fileId,
95
+ recipient: args.recipient,
96
+ });
97
+ const receipt = await adapter.signAndExecuteTransaction(tx, args.signal);
98
+ return { digest: receipt.digest, gasUsedMist: receipt.gasUsedMist };
99
+ }
100
+ /**
101
+ * Transfer mutation rights to a new owner. Does NOT touch `members`; for a
102
+ * full handover (new owner gains decrypt, old owner loses it), compose with
103
+ * `addRecipient` + `removeRecipient` or call them in a custom PTB.
104
+ */
105
+ export async function transferRecipientFileOwnership(adapter, config, args) {
106
+ const tx = new Transaction();
107
+ buildTransferRecipientFileOwnership(tx, {
108
+ packageId: config.packageId,
109
+ file: args.fileId,
110
+ newOwner: args.newOwner,
111
+ });
112
+ const receipt = await adapter.signAndExecuteTransaction(tx, args.signal);
113
+ return { digest: receipt.digest, gasUsedMist: receipt.gasUsedMist };
114
+ }
115
+ /** Update the `name` and `contentType` of a recipient file. Owner only. */
116
+ export async function updateRecipientFileMetadata(adapter, config, args) {
117
+ const tx = new Transaction();
118
+ buildUpdateRecipientFileMetadata(tx, {
119
+ packageId: config.packageId,
120
+ file: args.fileId,
121
+ name: args.name,
122
+ contentType: args.contentType,
123
+ });
124
+ const receipt = await adapter.signAndExecuteTransaction(tx, args.signal);
125
+ return { digest: receipt.digest, gasUsedMist: receipt.gasUsedMist };
126
+ }
127
+ /**
128
+ * Delete a recipient file metadata record. Owner only. Does NOT delete the
129
+ * Walrus blob; that follows the Walrus lease lifecycle independently.
130
+ */
131
+ export async function deleteRecipientFile(adapter, config, args) {
132
+ const tx = new Transaction();
133
+ buildDeleteRecipientFile(tx, {
134
+ packageId: config.packageId,
135
+ file: args.fileId,
136
+ });
137
+ const receipt = await adapter.signAndExecuteTransaction(tx, args.signal);
138
+ return { digest: receipt.digest, gasUsedMist: receipt.gasUsedMist };
139
+ }
140
+ function parseCreateReceipt(receipt, config) {
141
+ // RecipientFile was first defined in the v3 upgrade and lives at the
142
+ // current published-at, not at originalPackageId. Type filters against
143
+ // originalPackageId would miss the created object.
144
+ const fileType = `${config.packageId}::recipient_file::RecipientFile`;
145
+ return {
146
+ digest: receipt.digest,
147
+ gasUsedMist: receipt.gasUsedMist,
148
+ fileId: toRecipientFileId(findCreatedId(receipt, fileType)),
149
+ };
150
+ }
151
+ //# sourceMappingURL=recipient-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipient-file.js","sourceRoot":"","sources":["../../src/ops/recipient-file.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EACN,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,mCAAmC,EACnC,oBAAoB,EACpB,uBAAuB,EACvB,mCAAmC,EACnC,gCAAgC,GAChC,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAuB9C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,OAAsB,EACtB,MAA0B,EAC1B,IAA6B;IAE7B,MAAM,EAAE,GAAG,IAAI,WAAW,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,qBAAqB,CAAC,EAAE,EAAE;QACtC,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,GAAG,CAAC,IAAI,CAAC,YAAY,KAAK,SAAS;YAClC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC;QACvC,IA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