@misonetwork/sdk 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -7
- package/dist/client.d.ts +3 -17
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +13 -0
- package/dist/client.js.map +1 -1
- package/dist/contracts/miso/composition.d.ts +0 -14
- package/dist/contracts/miso/composition.d.ts.map +1 -1
- package/dist/contracts/miso/composition.js +0 -15
- package/dist/contracts/miso/composition.js.map +1 -1
- package/dist/contracts/miso/recording.d.ts +0 -15
- package/dist/contracts/miso/recording.d.ts.map +1 -1
- package/dist/contracts/miso/recording.js +0 -15
- package/dist/contracts/miso/recording.js.map +1 -1
- package/dist/contracts/miso/release.d.ts +0 -11
- package/dist/contracts/miso/release.d.ts.map +1 -1
- package/dist/contracts/miso/release.js +0 -14
- package/dist/contracts/miso/release.js.map +1 -1
- package/dist/contracts/miso_party/deps/sui/vec_set.d.ts +21 -0
- package/dist/contracts/miso_party/deps/sui/vec_set.d.ts.map +1 -0
- package/dist/contracts/miso_party/deps/sui/vec_set.js +20 -0
- package/dist/contracts/miso_party/deps/sui/vec_set.js.map +1 -0
- package/dist/contracts/miso_party/party.d.ts +481 -0
- package/dist/contracts/miso_party/party.d.ts.map +1 -0
- package/dist/contracts/miso_party/party.js +527 -0
- package/dist/contracts/miso_party/party.js.map +1 -0
- package/dist/contracts/party_cta/party_cta.d.ts +120 -0
- package/dist/contracts/party_cta/party_cta.d.ts.map +1 -0
- package/dist/contracts/party_cta/party_cta.js +139 -0
- package/dist/contracts/party_cta/party_cta.js.map +1 -0
- package/dist/contracts/party_genre/party_genre.d.ts +117 -0
- package/dist/contracts/party_genre/party_genre.d.ts.map +1 -0
- package/dist/contracts/party_genre/party_genre.js +131 -0
- package/dist/contracts/party_genre/party_genre.js.map +1 -0
- package/dist/contracts/party_media/party_media.d.ts +86 -0
- package/dist/contracts/party_media/party_media.d.ts.map +1 -0
- package/dist/contracts/party_media/party_media.js +97 -0
- package/dist/contracts/party_media/party_media.js.map +1 -0
- package/dist/contracts/party_music/party_music.d.ts +209 -0
- package/dist/contracts/party_music/party_music.d.ts.map +1 -0
- package/dist/contracts/party_music/party_music.js +259 -0
- package/dist/contracts/party_music/party_music.js.map +1 -0
- package/dist/contracts/party_platform_link/party_platform_link.d.ts +89 -0
- package/dist/contracts/party_platform_link/party_platform_link.d.ts.map +1 -0
- package/dist/contracts/party_platform_link/party_platform_link.js +92 -0
- package/dist/contracts/party_platform_link/party_platform_link.js.map +1 -0
- package/dist/contracts/party_pro_link/party_pro_link.d.ts +233 -0
- package/dist/contracts/party_pro_link/party_pro_link.d.ts.map +1 -0
- package/dist/contracts/party_pro_link/party_pro_link.js +289 -0
- package/dist/contracts/party_pro_link/party_pro_link.js.map +1 -0
- package/dist/contracts/party_profile/deps/country_code/country_code.d.ts +15 -0
- package/dist/contracts/party_profile/deps/country_code/country_code.d.ts.map +1 -0
- package/dist/contracts/party_profile/deps/country_code/country_code.js +17 -0
- package/dist/contracts/party_profile/deps/country_code/country_code.js.map +1 -0
- package/dist/contracts/party_profile/deps/language_code/language_code.d.ts +6 -0
- package/dist/contracts/party_profile/deps/language_code/language_code.d.ts.map +1 -0
- package/dist/contracts/party_profile/deps/language_code/language_code.js +8 -0
- package/dist/contracts/party_profile/deps/language_code/language_code.js.map +1 -0
- package/dist/contracts/party_profile/party_profile.d.ts +133 -0
- package/dist/contracts/party_profile/party_profile.d.ts.map +1 -0
- package/dist/contracts/party_profile/party_profile.js +153 -0
- package/dist/contracts/party_profile/party_profile.js.map +1 -0
- package/dist/contracts/party_roles/party_roles.d.ts +201 -0
- package/dist/contracts/party_roles/party_roles.d.ts.map +1 -0
- package/dist/contracts/party_roles/party_roles.js +237 -0
- package/dist/contracts/party_roles/party_roles.js.map +1 -0
- package/dist/contracts/party_social/party_social.d.ts +258 -0
- package/dist/contracts/party_social/party_social.d.ts.map +1 -0
- package/dist/contracts/party_social/party_social.js +320 -0
- package/dist/contracts/party_social/party_social.js.map +1 -0
- package/dist/contracts/party_tags/party_tags.d.ts +116 -0
- package/dist/contracts/party_tags/party_tags.d.ts.map +1 -0
- package/dist/contracts/party_tags/party_tags.js +130 -0
- package/dist/contracts/party_tags/party_tags.js.map +1 -0
- package/dist/contracts/routed_stake/routed_stake.d.ts +0 -14
- package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -1
- package/dist/contracts/routed_stake/routed_stake.js +0 -14
- package/dist/contracts/routed_stake/routed_stake.js.map +1 -1
- package/dist/contracts/royalty_pool/pool.d.ts +0 -14
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/pool.js +0 -14
- package/dist/contracts/royalty_pool/pool.js.map +1 -1
- package/dist/contracts/royalty_pool/stake.d.ts +0 -13
- package/dist/contracts/royalty_pool/stake.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/stake.js +0 -14
- package/dist/contracts/royalty_pool/stake.js.map +1 -1
- package/dist/contracts.d.ts +13 -2
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +14 -2
- package/dist/contracts.js.map +1 -1
- package/dist/deployments.d.ts +2 -2
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +16 -3
- package/dist/deployments.js.map +1 -1
- package/dist/events.d.ts +0 -14
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +0 -4
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/packages.d.ts +39 -4
- package/dist/packages.d.ts.map +1 -1
- package/dist/packages.js +39 -4
- package/dist/packages.js.map +1 -1
- package/dist/party/client.d.ts +233 -0
- package/dist/party/client.d.ts.map +1 -0
- package/dist/party/client.js +222 -0
- package/dist/party/client.js.map +1 -0
- package/dist/party/extensions/ctas.d.ts +19 -0
- package/dist/party/extensions/ctas.d.ts.map +1 -0
- package/dist/party/extensions/ctas.js +25 -0
- package/dist/party/extensions/ctas.js.map +1 -0
- package/dist/party/extensions/genres.d.ts +27 -0
- package/dist/party/extensions/genres.d.ts.map +1 -0
- package/dist/party/extensions/genres.js +31 -0
- package/dist/party/extensions/genres.js.map +1 -0
- package/dist/party/extensions/links.d.ts +65 -0
- package/dist/party/extensions/links.d.ts.map +1 -0
- package/dist/party/extensions/links.js +117 -0
- package/dist/party/extensions/links.js.map +1 -0
- package/dist/party/extensions/media.d.ts +36 -0
- package/dist/party/extensions/media.d.ts.map +1 -0
- package/dist/party/extensions/media.js +45 -0
- package/dist/party/extensions/media.js.map +1 -0
- package/dist/party/extensions/profile.d.ts +24 -0
- package/dist/party/extensions/profile.d.ts.map +1 -0
- package/dist/party/extensions/profile.js +48 -0
- package/dist/party/extensions/profile.js.map +1 -0
- package/dist/party/extensions/roles.d.ts +37 -0
- package/dist/party/extensions/roles.d.ts.map +1 -0
- package/dist/party/extensions/roles.js +46 -0
- package/dist/party/extensions/roles.js.map +1 -0
- package/dist/party/extensions/tags.d.ts +25 -0
- package/dist/party/extensions/tags.d.ts.map +1 -0
- package/dist/party/extensions/tags.js +25 -0
- package/dist/party/extensions/tags.js.map +1 -0
- package/dist/party/index.d.ts +12 -0
- package/dist/party/index.d.ts.map +1 -0
- package/dist/party/index.js +14 -0
- package/dist/party/index.js.map +1 -0
- package/dist/party/internal.d.ts +15 -0
- package/dist/party/internal.d.ts.map +1 -0
- package/dist/party/internal.js +103 -0
- package/dist/party/internal.js.map +1 -0
- package/dist/party/queries.d.ts +38 -0
- package/dist/party/queries.d.ts.map +1 -0
- package/dist/party/queries.js +232 -0
- package/dist/party/queries.js.map +1 -0
- package/dist/party/transactions.d.ts +74 -0
- package/dist/party/transactions.d.ts.map +1 -0
- package/dist/party/transactions.js +85 -0
- package/dist/party/transactions.js.map +1 -0
- package/dist/party/types.d.ts +54 -0
- package/dist/party/types.d.ts.map +1 -0
- package/dist/party/types.js +4 -0
- package/dist/party/types.js.map +1 -0
- package/package.json +6 -2
- package/src/client.ts +16 -0
- package/src/contracts/miso/composition.ts +0 -27
- package/src/contracts/miso/recording.ts +0 -28
- package/src/contracts/miso/release.ts +0 -23
- package/src/contracts/miso_party/deps/sui/vec_set.ts +21 -0
- package/src/contracts/miso_party/party.ts +797 -0
- package/src/contracts/party_cta/party_cta.ts +212 -0
- package/src/contracts/party_genre/party_genre.ts +199 -0
- package/src/contracts/party_media/party_media.ts +141 -0
- package/src/contracts/party_music/party_music.ts +405 -0
- package/src/contracts/party_platform_link/party_platform_link.ts +148 -0
- package/src/contracts/party_pro_link/party_pro_link.ts +453 -0
- package/src/contracts/party_profile/deps/country_code/country_code.ts +19 -0
- package/src/contracts/party_profile/deps/language_code/language_code.ts +7 -0
- package/src/contracts/party_profile/party_profile.ts +239 -0
- package/src/contracts/party_roles/party_roles.ts +363 -0
- package/src/contracts/party_social/party_social.ts +502 -0
- package/src/contracts/party_tags/party_tags.ts +198 -0
- package/src/contracts/routed_stake/routed_stake.ts +0 -27
- package/src/contracts/royalty_pool/pool.ts +0 -27
- package/src/contracts/royalty_pool/stake.ts +0 -26
- package/src/contracts.ts +15 -2
- package/src/deployments.ts +18 -3
- package/src/events.ts +0 -4
- package/src/index.ts +2 -0
- package/src/packages.ts +40 -8
- package/src/party/client.ts +283 -0
- package/src/party/extensions/ctas.ts +46 -0
- package/src/party/extensions/genres.ts +62 -0
- package/src/party/extensions/links.ts +185 -0
- package/src/party/extensions/media.ts +72 -0
- package/src/party/extensions/profile.ts +81 -0
- package/src/party/extensions/roles.ts +94 -0
- package/src/party/extensions/tags.ts +54 -0
- package/src/party/index.ts +14 -0
- package/src/party/internal.ts +119 -0
- package/src/party/queries.ts +303 -0
- package/src/party/transactions.ts +167 -0
- package/src/party/types.ts +95 -0
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts +0 -52
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts.map +0 -1
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js +0 -37
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js.map +0 -1
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts +0 -91
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts.map +0 -1
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js +0 -91
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js.map +0 -1
- package/src/contracts/release_snapshot_bundle/deps/ori/walrus_data.ts +0 -36
- package/src/contracts/release_snapshot_bundle/release_snapshot_bundle.ts +0 -124
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
import { MoveEnum, MoveStruct, MoveTuple } from '../../../utils/index.ts';
|
|
5
|
-
/**
|
|
6
|
-
* Confidentiality of a stored blob: cleartext, or encrypted with an access policy.
|
|
7
|
-
* Only applies to standalone blobs — a quilt patch is a slice of a shared quilt
|
|
8
|
-
* blob and can never be the direct product of an encryption.
|
|
9
|
-
*/
|
|
10
|
-
export declare const Confidentiality: MoveEnum<{
|
|
11
|
-
/** The blob is stored in the clear. */
|
|
12
|
-
Unencrypted: null;
|
|
13
|
-
/**
|
|
14
|
-
* The blob is AES-encrypted. `dek` is the AES data-encryption key sealed via Seal
|
|
15
|
-
* — a small ciphertext stored on-chain, not the blob bytes. The sealed DEK is
|
|
16
|
-
* itself a Seal `EncryptedObject`, which already carries the decryption-policy
|
|
17
|
-
* package id, so no separate policy field is stored here. Decryption is gated by
|
|
18
|
-
* that policy package's `seal_approve`, not by this library.
|
|
19
|
-
*/
|
|
20
|
-
Encrypted: MoveStruct<{
|
|
21
|
-
dek: import("@mysten/sui/bcs").BcsType<number[], Iterable<number> & {
|
|
22
|
-
length: number;
|
|
23
|
-
}, string>;
|
|
24
|
-
}, "Confidentiality.Encrypted">;
|
|
25
|
-
}, "ori::walrus_data::Confidentiality">;
|
|
26
|
-
/** Represents either a standalone Walrus blob or a patch within a quilt. */
|
|
27
|
-
export declare const WalrusData: MoveEnum<{
|
|
28
|
-
/** A standalone Walrus blob. Fields: blob_id, confidentiality. */
|
|
29
|
-
Blob: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u256">, MoveEnum<{
|
|
30
|
-
/** The blob is stored in the clear. */
|
|
31
|
-
Unencrypted: null;
|
|
32
|
-
/**
|
|
33
|
-
* The blob is AES-encrypted. `dek` is the AES data-encryption key sealed via Seal
|
|
34
|
-
* — a small ciphertext stored on-chain, not the blob bytes. The sealed DEK is
|
|
35
|
-
* itself a Seal `EncryptedObject`, which already carries the decryption-policy
|
|
36
|
-
* package id, so no separate policy field is stored here. Decryption is gated by
|
|
37
|
-
* that policy package's `seal_approve`, not by this library.
|
|
38
|
-
*/
|
|
39
|
-
Encrypted: MoveStruct<{
|
|
40
|
-
dek: import("@mysten/sui/bcs").BcsType<number[], Iterable<number> & {
|
|
41
|
-
length: number;
|
|
42
|
-
}, string>;
|
|
43
|
-
}, "Confidentiality.Encrypted">;
|
|
44
|
-
}, "ori::walrus_data::Confidentiality">], "WalrusData.Blob">;
|
|
45
|
-
/**
|
|
46
|
-
* A patch within a Walrus quilt. Fields: quilt_id, version, start_index,
|
|
47
|
-
* end_index. Always a plaintext reference into a (possibly separately encrypted)
|
|
48
|
-
* quilt blob.
|
|
49
|
-
*/
|
|
50
|
-
QuiltPatch: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u256">, import("@mysten/sui/bcs").BcsType<number, number, "u8">, import("@mysten/sui/bcs").BcsType<number, number, "u16">, import("@mysten/sui/bcs").BcsType<number, number, "u16">], "WalrusData.QuiltPatch">;
|
|
51
|
-
}, "ori::walrus_data::WalrusData">;
|
|
52
|
-
//# sourceMappingURL=walrus_data.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"walrus_data.d.ts","sourceRoot":"","sources":["../../../../../src/contracts/release_snapshot_bundle/deps/ori/walrus_data.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAChE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAG1E;;;;GAIG;AACH,eAAO,MAAM,eAAe;IACpB,uCAAuC;;IAEvC;;;;;;OAMG;;;;;;uCAIH,CAAC;AACT,4EAA4E;AAC5E,eAAO,MAAM,UAAU;IACf,kEAAkE;;QAflE,uCAAuC;;QAEvC;;;;;;WAMG;;;;;;;IASH;;;;OAIG;;kCAEH,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
import { MoveEnum, MoveStruct, MoveTuple } from "../../../utils/index.js";
|
|
5
|
-
import { bcs } from '@mysten/sui/bcs';
|
|
6
|
-
const $moduleName = 'ori::walrus_data';
|
|
7
|
-
/**
|
|
8
|
-
* Confidentiality of a stored blob: cleartext, or encrypted with an access policy.
|
|
9
|
-
* Only applies to standalone blobs — a quilt patch is a slice of a shared quilt
|
|
10
|
-
* blob and can never be the direct product of an encryption.
|
|
11
|
-
*/
|
|
12
|
-
export const Confidentiality = new MoveEnum({ name: `${$moduleName}::Confidentiality`, fields: {
|
|
13
|
-
/** The blob is stored in the clear. */
|
|
14
|
-
Unencrypted: null,
|
|
15
|
-
/**
|
|
16
|
-
* The blob is AES-encrypted. `dek` is the AES data-encryption key sealed via Seal
|
|
17
|
-
* — a small ciphertext stored on-chain, not the blob bytes. The sealed DEK is
|
|
18
|
-
* itself a Seal `EncryptedObject`, which already carries the decryption-policy
|
|
19
|
-
* package id, so no separate policy field is stored here. Decryption is gated by
|
|
20
|
-
* that policy package's `seal_approve`, not by this library.
|
|
21
|
-
*/
|
|
22
|
-
Encrypted: new MoveStruct({ name: `Confidentiality.Encrypted`, fields: {
|
|
23
|
-
dek: bcs.vector(bcs.u8())
|
|
24
|
-
} })
|
|
25
|
-
} });
|
|
26
|
-
/** Represents either a standalone Walrus blob or a patch within a quilt. */
|
|
27
|
-
export const WalrusData = new MoveEnum({ name: `${$moduleName}::WalrusData`, fields: {
|
|
28
|
-
/** A standalone Walrus blob. Fields: blob_id, confidentiality. */
|
|
29
|
-
Blob: new MoveTuple({ name: `WalrusData.Blob`, fields: [bcs.u256(), Confidentiality] }),
|
|
30
|
-
/**
|
|
31
|
-
* A patch within a Walrus quilt. Fields: quilt_id, version, start_index,
|
|
32
|
-
* end_index. Always a plaintext reference into a (possibly separately encrypted)
|
|
33
|
-
* quilt blob.
|
|
34
|
-
*/
|
|
35
|
-
QuiltPatch: new MoveTuple({ name: `WalrusData.QuiltPatch`, fields: [bcs.u256(), bcs.u8(), bcs.u16(), bcs.u16()] })
|
|
36
|
-
} });
|
|
37
|
-
//# sourceMappingURL=walrus_data.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"walrus_data.js","sourceRoot":"","sources":["../../../../../src/contracts/release_snapshot_bundle/deps/ori/walrus_data.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAChE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,MAAM,WAAW,GAAG,kBAAkB,CAAC;AACvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,QAAQ,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,mBAAmB,EAAE,MAAM,EAAE;QACvF,uCAAuC;QACvC,WAAW,EAAE,IAAI;QACjB;;;;;;WAMG;QACH,SAAS,EAAE,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,2BAA2B,EAAE,MAAM,EAAE;gBAC/D,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;aAC5B,EAAE,CAAC;KACX,EAAE,CAAC,CAAC;AACT,4EAA4E;AAC5E,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,cAAc,EAAE,MAAM,EAAE;QAC7E,kEAAkE;QAClE,IAAI,EAAE,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,eAAe,CAAC,EAAE,CAAC;QACvF;;;;WAIG;QACH,UAAU,EAAE,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC;KACrH,EAAE,CAAC,CAAC"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/**
|
|
5
|
-
* The on-chain pointer to a release's snapshot bundle: which Walrus quilt is this
|
|
6
|
-
* release's bundle.
|
|
7
|
-
*
|
|
8
|
-
* A snapshot bundle is curated bonus material a buyer gets access to — one Walrus
|
|
9
|
-
* quilt, assembled after the fact. The quilt is self-describing: its plaintext
|
|
10
|
-
* `manifest.json` patch carries all the metadata, its media patches are
|
|
11
|
-
* chunk-encrypted under one AES envelope key, and that key travels Seal-wrapped
|
|
12
|
-
* inside the quilt as its `key.seal` patch. This package therefore stores none of
|
|
13
|
-
* that — no ciphertext, no metadata, no access policy (unlocking by holding a
|
|
14
|
-
* Record is `miso_record_acl`'s concern, in miso-record-extensions). The stored
|
|
15
|
-
* value is the quilt's `WalrusData` blob reference, and nothing else.
|
|
16
|
-
*
|
|
17
|
-
* The slot is write-once: `set_snapshot_bundle` aborts with `EBundleAlreadySet` if
|
|
18
|
-
* a bundle is already set, and there is NO unset, NO remove, and NO replace
|
|
19
|
-
* function. That absence is a product guarantee: the bundle a buyer's Record
|
|
20
|
-
* points at can never be swapped out from under them. More content later means a
|
|
21
|
-
* new Release.
|
|
22
|
-
*/
|
|
23
|
-
import { MoveTuple, MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
24
|
-
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
25
|
-
export declare const ExtensionKey: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">], "@local-pkg/release_snapshot_bundle::release_snapshot_bundle::ExtensionKey">;
|
|
26
|
-
export declare const SnapshotBundleSetEvent: MoveStruct<{
|
|
27
|
-
release_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
28
|
-
bundle: import("../utils/index.ts").MoveEnum<{
|
|
29
|
-
Blob: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u256">, import("../utils/index.ts").MoveEnum<{
|
|
30
|
-
Unencrypted: null;
|
|
31
|
-
Encrypted: MoveStruct<{
|
|
32
|
-
dek: import("@mysten/sui/bcs").BcsType<number[], Iterable<number> & {
|
|
33
|
-
length: number;
|
|
34
|
-
}, string>;
|
|
35
|
-
}, "Confidentiality.Encrypted">;
|
|
36
|
-
}, "ori::walrus_data::Confidentiality">], "WalrusData.Blob">;
|
|
37
|
-
QuiltPatch: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u256">, import("@mysten/sui/bcs").BcsType<number, number, "u8">, import("@mysten/sui/bcs").BcsType<number, number, "u16">, import("@mysten/sui/bcs").BcsType<number, number, "u16">], "WalrusData.QuiltPatch">;
|
|
38
|
-
}, "ori::walrus_data::WalrusData">;
|
|
39
|
-
}, "@local-pkg/release_snapshot_bundle::release_snapshot_bundle::SnapshotBundleSetEvent">;
|
|
40
|
-
export interface SetSnapshotBundleArguments {
|
|
41
|
-
self: RawTransactionArgument<string>;
|
|
42
|
-
cap: RawTransactionArgument<string>;
|
|
43
|
-
bundle: TransactionArgument;
|
|
44
|
-
}
|
|
45
|
-
export interface SetSnapshotBundleOptions {
|
|
46
|
-
package?: string;
|
|
47
|
-
arguments: SetSnapshotBundleArguments | [
|
|
48
|
-
self: RawTransactionArgument<string>,
|
|
49
|
-
cap: RawTransactionArgument<string>,
|
|
50
|
-
bundle: TransactionArgument
|
|
51
|
-
];
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Sets the release's snapshot bundle — once. Aborts with `EBundleAlreadySet` if a
|
|
55
|
-
* bundle is already set; there is no way to unset or replace it.
|
|
56
|
-
*
|
|
57
|
-
* The reference must be a plaintext standalone blob. A quilt patch is a slice of
|
|
58
|
-
* some other quilt, not the bundle's own quilt blob. And the outer quilt blob is
|
|
59
|
-
* plaintext by design: its `manifest.json` patch must be readable, encryption is
|
|
60
|
-
* per-patch inside the quilt, and the Seal-wrapped envelope key travels as the
|
|
61
|
-
* quilt's `key.seal` patch — so an encrypted outer reference is structurally
|
|
62
|
-
* wrong. With no replace function either mistake would be permanent, which is why
|
|
63
|
-
* both checks live on-chain rather than in the client.
|
|
64
|
-
*/
|
|
65
|
-
export declare function setSnapshotBundle(options: SetSnapshotBundleOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
66
|
-
export interface HasSnapshotBundleArguments {
|
|
67
|
-
self: RawTransactionArgument<string>;
|
|
68
|
-
}
|
|
69
|
-
export interface HasSnapshotBundleOptions {
|
|
70
|
-
package?: string;
|
|
71
|
-
arguments: HasSnapshotBundleArguments | [
|
|
72
|
-
self: RawTransactionArgument<string>
|
|
73
|
-
];
|
|
74
|
-
}
|
|
75
|
-
/** Returns whether a snapshot bundle is set on this release. */
|
|
76
|
-
export declare function hasSnapshotBundle(options: HasSnapshotBundleOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
77
|
-
export interface SnapshotBundleArguments {
|
|
78
|
-
self: RawTransactionArgument<string>;
|
|
79
|
-
}
|
|
80
|
-
export interface SnapshotBundleOptions {
|
|
81
|
-
package?: string;
|
|
82
|
-
arguments: SnapshotBundleArguments | [
|
|
83
|
-
self: RawTransactionArgument<string>
|
|
84
|
-
];
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* The release's snapshot bundle reference. Aborts with `ENoSnapshotBundle` if none
|
|
88
|
-
* is set.
|
|
89
|
-
*/
|
|
90
|
-
export declare function snapshotBundle(options: SnapshotBundleOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
91
|
-
//# sourceMappingURL=release_snapshot_bundle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"release_snapshot_bundle.d.ts","sourceRoot":"","sources":["../../../src/contracts/release_snapshot_bundle/release_snapshot_bundle.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAA0B,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE/G,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGtF,eAAO,MAAM,YAAY,gKAAgF,CAAC;AAC1G,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;yFAG3B,CAAC;AACT,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACrC,GAAG,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,EAAE,mBAAmB,CAAC;CAC/B;AACD,MAAM,WAAW,wBAAwB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,0BAA0B,GAAG;QACpC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;QACpC,GAAG,EAAE,sBAAsB,CAAC,MAAM,CAAC;QACnC,MAAM,EAAE,mBAAmB;KAC9B,CAAC;CACL;AACD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,IAQvD,IAAI,WAAW,0DAM1B;AACD,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;CACxC;AACD,MAAM,WAAW,wBAAwB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,0BAA0B,GAAG;QACpC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACvC,CAAC;CACL;AACD,gEAAgE;AAChE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,IAMvD,IAAI,WAAW,0DAM1B;AACD,MAAM,WAAW,uBAAuB;IACpC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;CACxC;AACD,MAAM,WAAW,qBAAqB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,uBAAuB,GAAG;QACjC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACvC,CAAC;CACL;AACD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,IAMjD,IAAI,WAAW,0DAM1B"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/**
|
|
5
|
-
* The on-chain pointer to a release's snapshot bundle: which Walrus quilt is this
|
|
6
|
-
* release's bundle.
|
|
7
|
-
*
|
|
8
|
-
* A snapshot bundle is curated bonus material a buyer gets access to — one Walrus
|
|
9
|
-
* quilt, assembled after the fact. The quilt is self-describing: its plaintext
|
|
10
|
-
* `manifest.json` patch carries all the metadata, its media patches are
|
|
11
|
-
* chunk-encrypted under one AES envelope key, and that key travels Seal-wrapped
|
|
12
|
-
* inside the quilt as its `key.seal` patch. This package therefore stores none of
|
|
13
|
-
* that — no ciphertext, no metadata, no access policy (unlocking by holding a
|
|
14
|
-
* Record is `miso_record_acl`'s concern, in miso-record-extensions). The stored
|
|
15
|
-
* value is the quilt's `WalrusData` blob reference, and nothing else.
|
|
16
|
-
*
|
|
17
|
-
* The slot is write-once: `set_snapshot_bundle` aborts with `EBundleAlreadySet` if
|
|
18
|
-
* a bundle is already set, and there is NO unset, NO remove, and NO replace
|
|
19
|
-
* function. That absence is a product guarantee: the bundle a buyer's Record
|
|
20
|
-
* points at can never be swapped out from under them. More content later means a
|
|
21
|
-
* new Release.
|
|
22
|
-
*/
|
|
23
|
-
import { MoveTuple, MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
24
|
-
import { bcs } from '@mysten/sui/bcs';
|
|
25
|
-
import {} from '@mysten/sui/transactions';
|
|
26
|
-
import * as walrus_data from "./deps/ori/walrus_data.js";
|
|
27
|
-
const $moduleName = '@local-pkg/release_snapshot_bundle::release_snapshot_bundle';
|
|
28
|
-
export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
|
|
29
|
-
export const SnapshotBundleSetEvent = new MoveStruct({ name: `${$moduleName}::SnapshotBundleSetEvent`, fields: {
|
|
30
|
-
release_id: bcs.Address,
|
|
31
|
-
bundle: walrus_data.WalrusData
|
|
32
|
-
} });
|
|
33
|
-
/**
|
|
34
|
-
* Sets the release's snapshot bundle — once. Aborts with `EBundleAlreadySet` if a
|
|
35
|
-
* bundle is already set; there is no way to unset or replace it.
|
|
36
|
-
*
|
|
37
|
-
* The reference must be a plaintext standalone blob. A quilt patch is a slice of
|
|
38
|
-
* some other quilt, not the bundle's own quilt blob. And the outer quilt blob is
|
|
39
|
-
* plaintext by design: its `manifest.json` patch must be readable, encryption is
|
|
40
|
-
* per-patch inside the quilt, and the Seal-wrapped envelope key travels as the
|
|
41
|
-
* quilt's `key.seal` patch — so an encrypted outer reference is structurally
|
|
42
|
-
* wrong. With no replace function either mistake would be permanent, which is why
|
|
43
|
-
* both checks live on-chain rather than in the client.
|
|
44
|
-
*/
|
|
45
|
-
export function setSnapshotBundle(options) {
|
|
46
|
-
const packageAddress = options.package ?? '@local-pkg/release_snapshot_bundle';
|
|
47
|
-
const argumentsTypes = [
|
|
48
|
-
null,
|
|
49
|
-
null,
|
|
50
|
-
null
|
|
51
|
-
];
|
|
52
|
-
const parameterNames = ["self", "cap", "bundle"];
|
|
53
|
-
return (tx) => tx.moveCall({
|
|
54
|
-
package: packageAddress,
|
|
55
|
-
module: 'release_snapshot_bundle',
|
|
56
|
-
function: 'set_snapshot_bundle',
|
|
57
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
/** Returns whether a snapshot bundle is set on this release. */
|
|
61
|
-
export function hasSnapshotBundle(options) {
|
|
62
|
-
const packageAddress = options.package ?? '@local-pkg/release_snapshot_bundle';
|
|
63
|
-
const argumentsTypes = [
|
|
64
|
-
null
|
|
65
|
-
];
|
|
66
|
-
const parameterNames = ["self"];
|
|
67
|
-
return (tx) => tx.moveCall({
|
|
68
|
-
package: packageAddress,
|
|
69
|
-
module: 'release_snapshot_bundle',
|
|
70
|
-
function: 'has_snapshot_bundle',
|
|
71
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* The release's snapshot bundle reference. Aborts with `ENoSnapshotBundle` if none
|
|
76
|
-
* is set.
|
|
77
|
-
*/
|
|
78
|
-
export function snapshotBundle(options) {
|
|
79
|
-
const packageAddress = options.package ?? '@local-pkg/release_snapshot_bundle';
|
|
80
|
-
const argumentsTypes = [
|
|
81
|
-
null
|
|
82
|
-
];
|
|
83
|
-
const parameterNames = ["self"];
|
|
84
|
-
return (tx) => tx.moveCall({
|
|
85
|
-
package: packageAddress,
|
|
86
|
-
module: 'release_snapshot_bundle',
|
|
87
|
-
function: 'snapshot_bundle',
|
|
88
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=release_snapshot_bundle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"release_snapshot_bundle.js","sourceRoot":"","sources":["../../../src/contracts/release_snapshot_bundle/release_snapshot_bundle.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AAC/G,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAA8C,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,WAAW,MAAM,2BAA2B,CAAC;AACzD,MAAM,WAAW,GAAG,6DAA6D,CAAC;AAClF,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,gBAAgB,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AAC1G,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,0BAA0B,EAAE,MAAM,EAAE;QACvG,UAAU,EAAE,GAAG,CAAC,OAAO;QACvB,MAAM,EAAE,WAAW,CAAC,UAAU;KACjC,EAAE,CAAC,CAAC;AAcT;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAiC;IAC/D,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,oCAAoC,CAAC;IAC/E,MAAM,cAAc,GAAG;QACnB,IAAI;QACJ,IAAI;QACJ,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACjD,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,yBAAyB;QACjC,QAAQ,EAAE,qBAAqB;QAC/B,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC;AAUD,gEAAgE;AAChE,MAAM,UAAU,iBAAiB,CAAC,OAAiC;IAC/D,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,oCAAoC,CAAC;IAC/E,MAAM,cAAc,GAAG;QACnB,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,yBAAyB;QACjC,QAAQ,EAAE,qBAAqB;QAC/B,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC;AAUD;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,OAA8B;IACzD,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,oCAAoC,CAAC;IAC/E,MAAM,cAAc,GAAG;QACnB,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,yBAAyB;QACjC,QAAQ,EAAE,iBAAiB;QAC3B,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
import { MoveEnum, MoveStruct, MoveTuple } from '../../../utils/index.ts';
|
|
5
|
-
import { bcs } from '@mysten/sui/bcs';
|
|
6
|
-
const $moduleName = 'ori::walrus_data';
|
|
7
|
-
/**
|
|
8
|
-
* Confidentiality of a stored blob: cleartext, or encrypted with an access policy.
|
|
9
|
-
* Only applies to standalone blobs — a quilt patch is a slice of a shared quilt
|
|
10
|
-
* blob and can never be the direct product of an encryption.
|
|
11
|
-
*/
|
|
12
|
-
export const Confidentiality = new MoveEnum({ name: `${$moduleName}::Confidentiality`, fields: {
|
|
13
|
-
/** The blob is stored in the clear. */
|
|
14
|
-
Unencrypted: null,
|
|
15
|
-
/**
|
|
16
|
-
* The blob is AES-encrypted. `dek` is the AES data-encryption key sealed via Seal
|
|
17
|
-
* — a small ciphertext stored on-chain, not the blob bytes. The sealed DEK is
|
|
18
|
-
* itself a Seal `EncryptedObject`, which already carries the decryption-policy
|
|
19
|
-
* package id, so no separate policy field is stored here. Decryption is gated by
|
|
20
|
-
* that policy package's `seal_approve`, not by this library.
|
|
21
|
-
*/
|
|
22
|
-
Encrypted: new MoveStruct({ name: `Confidentiality.Encrypted`, fields: {
|
|
23
|
-
dek: bcs.vector(bcs.u8())
|
|
24
|
-
} })
|
|
25
|
-
} });
|
|
26
|
-
/** Represents either a standalone Walrus blob or a patch within a quilt. */
|
|
27
|
-
export const WalrusData = new MoveEnum({ name: `${$moduleName}::WalrusData`, fields: {
|
|
28
|
-
/** A standalone Walrus blob. Fields: blob_id, confidentiality. */
|
|
29
|
-
Blob: new MoveTuple({ name: `WalrusData.Blob`, fields: [bcs.u256(), Confidentiality] }),
|
|
30
|
-
/**
|
|
31
|
-
* A patch within a Walrus quilt. Fields: quilt_id, version, start_index,
|
|
32
|
-
* end_index. Always a plaintext reference into a (possibly separately encrypted)
|
|
33
|
-
* quilt blob.
|
|
34
|
-
*/
|
|
35
|
-
QuiltPatch: new MoveTuple({ name: `WalrusData.QuiltPatch`, fields: [bcs.u256(), bcs.u8(), bcs.u16(), bcs.u16()] })
|
|
36
|
-
} });
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* The on-chain pointer to a release's snapshot bundle: which Walrus quilt is this
|
|
8
|
-
* release's bundle.
|
|
9
|
-
*
|
|
10
|
-
* A snapshot bundle is curated bonus material a buyer gets access to — one Walrus
|
|
11
|
-
* quilt, assembled after the fact. The quilt is self-describing: its plaintext
|
|
12
|
-
* `manifest.json` patch carries all the metadata, its media patches are
|
|
13
|
-
* chunk-encrypted under one AES envelope key, and that key travels Seal-wrapped
|
|
14
|
-
* inside the quilt as its `key.seal` patch. This package therefore stores none of
|
|
15
|
-
* that — no ciphertext, no metadata, no access policy (unlocking by holding a
|
|
16
|
-
* Record is `miso_record_acl`'s concern, in miso-record-extensions). The stored
|
|
17
|
-
* value is the quilt's `WalrusData` blob reference, and nothing else.
|
|
18
|
-
*
|
|
19
|
-
* The slot is write-once: `set_snapshot_bundle` aborts with `EBundleAlreadySet` if
|
|
20
|
-
* a bundle is already set, and there is NO unset, NO remove, and NO replace
|
|
21
|
-
* function. That absence is a product guarantee: the bundle a buyer's Record
|
|
22
|
-
* points at can never be swapped out from under them. More content later means a
|
|
23
|
-
* new Release.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
|
|
27
|
-
import { bcs } from '@mysten/sui/bcs';
|
|
28
|
-
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
29
|
-
import * as walrus_data from './deps/ori/walrus_data.ts';
|
|
30
|
-
const $moduleName = '@local-pkg/release_snapshot_bundle::release_snapshot_bundle';
|
|
31
|
-
export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
|
|
32
|
-
export const SnapshotBundleSetEvent = new MoveStruct({ name: `${$moduleName}::SnapshotBundleSetEvent`, fields: {
|
|
33
|
-
release_id: bcs.Address,
|
|
34
|
-
bundle: walrus_data.WalrusData
|
|
35
|
-
} });
|
|
36
|
-
export interface SetSnapshotBundleArguments {
|
|
37
|
-
self: RawTransactionArgument<string>;
|
|
38
|
-
cap: RawTransactionArgument<string>;
|
|
39
|
-
bundle: TransactionArgument;
|
|
40
|
-
}
|
|
41
|
-
export interface SetSnapshotBundleOptions {
|
|
42
|
-
package?: string;
|
|
43
|
-
arguments: SetSnapshotBundleArguments | [
|
|
44
|
-
self: RawTransactionArgument<string>,
|
|
45
|
-
cap: RawTransactionArgument<string>,
|
|
46
|
-
bundle: TransactionArgument
|
|
47
|
-
];
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Sets the release's snapshot bundle — once. Aborts with `EBundleAlreadySet` if a
|
|
51
|
-
* bundle is already set; there is no way to unset or replace it.
|
|
52
|
-
*
|
|
53
|
-
* The reference must be a plaintext standalone blob. A quilt patch is a slice of
|
|
54
|
-
* some other quilt, not the bundle's own quilt blob. And the outer quilt blob is
|
|
55
|
-
* plaintext by design: its `manifest.json` patch must be readable, encryption is
|
|
56
|
-
* per-patch inside the quilt, and the Seal-wrapped envelope key travels as the
|
|
57
|
-
* quilt's `key.seal` patch — so an encrypted outer reference is structurally
|
|
58
|
-
* wrong. With no replace function either mistake would be permanent, which is why
|
|
59
|
-
* both checks live on-chain rather than in the client.
|
|
60
|
-
*/
|
|
61
|
-
export function setSnapshotBundle(options: SetSnapshotBundleOptions) {
|
|
62
|
-
const packageAddress = options.package ?? '@local-pkg/release_snapshot_bundle';
|
|
63
|
-
const argumentsTypes = [
|
|
64
|
-
null,
|
|
65
|
-
null,
|
|
66
|
-
null
|
|
67
|
-
] satisfies (string | null)[];
|
|
68
|
-
const parameterNames = ["self", "cap", "bundle"];
|
|
69
|
-
return (tx: Transaction) => tx.moveCall({
|
|
70
|
-
package: packageAddress,
|
|
71
|
-
module: 'release_snapshot_bundle',
|
|
72
|
-
function: 'set_snapshot_bundle',
|
|
73
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
export interface HasSnapshotBundleArguments {
|
|
77
|
-
self: RawTransactionArgument<string>;
|
|
78
|
-
}
|
|
79
|
-
export interface HasSnapshotBundleOptions {
|
|
80
|
-
package?: string;
|
|
81
|
-
arguments: HasSnapshotBundleArguments | [
|
|
82
|
-
self: RawTransactionArgument<string>
|
|
83
|
-
];
|
|
84
|
-
}
|
|
85
|
-
/** Returns whether a snapshot bundle is set on this release. */
|
|
86
|
-
export function hasSnapshotBundle(options: HasSnapshotBundleOptions) {
|
|
87
|
-
const packageAddress = options.package ?? '@local-pkg/release_snapshot_bundle';
|
|
88
|
-
const argumentsTypes = [
|
|
89
|
-
null
|
|
90
|
-
] satisfies (string | null)[];
|
|
91
|
-
const parameterNames = ["self"];
|
|
92
|
-
return (tx: Transaction) => tx.moveCall({
|
|
93
|
-
package: packageAddress,
|
|
94
|
-
module: 'release_snapshot_bundle',
|
|
95
|
-
function: 'has_snapshot_bundle',
|
|
96
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
export interface SnapshotBundleArguments {
|
|
100
|
-
self: RawTransactionArgument<string>;
|
|
101
|
-
}
|
|
102
|
-
export interface SnapshotBundleOptions {
|
|
103
|
-
package?: string;
|
|
104
|
-
arguments: SnapshotBundleArguments | [
|
|
105
|
-
self: RawTransactionArgument<string>
|
|
106
|
-
];
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* The release's snapshot bundle reference. Aborts with `ENoSnapshotBundle` if none
|
|
110
|
-
* is set.
|
|
111
|
-
*/
|
|
112
|
-
export function snapshotBundle(options: SnapshotBundleOptions) {
|
|
113
|
-
const packageAddress = options.package ?? '@local-pkg/release_snapshot_bundle';
|
|
114
|
-
const argumentsTypes = [
|
|
115
|
-
null
|
|
116
|
-
] satisfies (string | null)[];
|
|
117
|
-
const parameterNames = ["self"];
|
|
118
|
-
return (tx: Transaction) => tx.moveCall({
|
|
119
|
-
package: packageAddress,
|
|
120
|
-
module: 'release_snapshot_bundle',
|
|
121
|
-
function: 'snapshot_bundle',
|
|
122
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
123
|
-
});
|
|
124
|
-
}
|