@meddleware/docs 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE +14 -0
  3. package/README.md +54 -0
  4. package/docs/.vitepress/config.ts +101 -0
  5. package/docs/.vitepress/theme/custom.css +51 -0
  6. package/docs/.vitepress/theme/index.ts +8 -0
  7. package/docs/access-gate/api/functions/buildAccessProof.md +38 -0
  8. package/docs/access-gate/api/functions/buildAirdropTx.md +21 -0
  9. package/docs/access-gate/api/functions/buildConsumeTx.md +27 -0
  10. package/docs/access-gate/api/functions/buildCreateGateTx.md +52 -0
  11. package/docs/access-gate/api/functions/buildMakeGateImmutableTx.md +19 -0
  12. package/docs/access-gate/api/functions/buildPurchaseTx.md +23 -0
  13. package/docs/access-gate/api/functions/buildSetAutoBurnAtZeroTx.md +21 -0
  14. package/docs/access-gate/api/functions/buildSetDefaultUsesTx.md +21 -0
  15. package/docs/access-gate/api/functions/buildSetNftDescriptionTx.md +21 -0
  16. package/docs/access-gate/api/functions/buildSetNftImageUrlTx.md +21 -0
  17. package/docs/access-gate/api/functions/buildSetNftNameTx.md +21 -0
  18. package/docs/access-gate/api/functions/buildSetPausedTx.md +21 -0
  19. package/docs/access-gate/api/functions/buildSetPaymentRecipientTx.md +21 -0
  20. package/docs/access-gate/api/functions/buildSetPriceTx.md +21 -0
  21. package/docs/access-gate/api/functions/buildSetSoulboundTx.md +21 -0
  22. package/docs/access-gate/api/functions/decodeAccessProof.md +17 -0
  23. package/docs/access-gate/api/functions/encodeAccessProof.md +17 -0
  24. package/docs/access-gate/api/functions/fetchAccessNftById.md +27 -0
  25. package/docs/access-gate/api/functions/fetchAccessNfts.md +34 -0
  26. package/docs/access-gate/api/functions/fetchAdminCaps.md +30 -0
  27. package/docs/access-gate/api/functions/fetchChallenge.md +32 -0
  28. package/docs/access-gate/api/functions/fetchGate.md +26 -0
  29. package/docs/access-gate/api/functions/fetchOwnedGates.md +31 -0
  30. package/docs/access-gate/api/functions/ownsAccessNft.md +35 -0
  31. package/docs/access-gate/api/functions/parseAdminCap.md +26 -0
  32. package/docs/access-gate/api/functions/parseGate.md +19 -0
  33. package/docs/access-gate/api/functions/parseOwnedAccessNft.md +19 -0
  34. package/docs/access-gate/api/functions/personalMessageForNonce.md +18 -0
  35. package/docs/access-gate/api/index.md +47 -0
  36. package/docs/access-gate/api/interfaces/AccessGateConfig.md +57 -0
  37. package/docs/access-gate/api/interfaces/AccessProof.md +46 -0
  38. package/docs/access-gate/api/interfaces/Challenge.md +25 -0
  39. package/docs/access-gate/api/interfaces/GateAdminContext.md +37 -0
  40. package/docs/access-gate/api/interfaces/OwnedAccessNft.md +31 -0
  41. package/docs/access-gate/api/interfaces/OwnedGate.md +125 -0
  42. package/docs/access-gate/api/interfaces/OwnedObjectsClient.md +49 -0
  43. package/docs/access-gate/api/interfaces/SuiObjectClient.md +37 -0
  44. package/docs/access-gate/api/type-aliases/PersonalMessageSigner.md +17 -0
  45. package/docs/access-gate/api/typedoc-sidebar.json +1 -0
  46. package/docs/access-gate/index.md +61 -0
  47. package/docs/access-gate/reference.md +111 -0
  48. package/docs/access-gate/using.md +68 -0
  49. package/docs/architecture.md +61 -0
  50. package/docs/dao/index.md +71 -0
  51. package/docs/dao/reference.md +94 -0
  52. package/docs/getting-started.md +59 -0
  53. package/docs/index.md +58 -0
  54. package/docs/sealed-storage/api/classes/PolicyRegistry.md +103 -0
  55. package/docs/sealed-storage/api/classes/SealController.md +113 -0
  56. package/docs/sealed-storage/api/functions/buildPublishSealedContentTx.md +27 -0
  57. package/docs/sealed-storage/api/functions/bytesToHex.md +17 -0
  58. package/docs/sealed-storage/api/functions/concatBytes.md +17 -0
  59. package/docs/sealed-storage/api/functions/createDefaultRegistry.md +22 -0
  60. package/docs/sealed-storage/api/functions/createNftGateProvider.md +21 -0
  61. package/docs/sealed-storage/api/functions/hexToBytes.md +17 -0
  62. package/docs/sealed-storage/api/functions/objectIdBytes.md +17 -0
  63. package/docs/sealed-storage/api/functions/randomBytes.md +17 -0
  64. package/docs/sealed-storage/api/functions/sealedContentEventType.md +17 -0
  65. package/docs/sealed-storage/api/functions/u64beBytes.md +17 -0
  66. package/docs/sealed-storage/api/index.md +45 -0
  67. package/docs/sealed-storage/api/interfaces/EncryptResult.md +23 -0
  68. package/docs/sealed-storage/api/interfaces/FieldSpec.md +51 -0
  69. package/docs/sealed-storage/api/interfaces/FieldSuggestion.md +21 -0
  70. package/docs/sealed-storage/api/interfaces/KeyServerConfig.md +35 -0
  71. package/docs/sealed-storage/api/interfaces/NftGateParams.md +33 -0
  72. package/docs/sealed-storage/api/interfaces/PolicyDescriptor.md +49 -0
  73. package/docs/sealed-storage/api/interfaces/SealControllerConfig.md +63 -0
  74. package/docs/sealed-storage/api/interfaces/SealPolicyProvider.md +115 -0
  75. package/docs/sealed-storage/api/interfaces/SealSuggestClient.md +74 -0
  76. package/docs/sealed-storage/api/interfaces/SealedContentInput.md +45 -0
  77. package/docs/sealed-storage/api/interfaces/SealedContentPointer.md +53 -0
  78. package/docs/sealed-storage/api/interfaces/SealedManifest.md +65 -0
  79. package/docs/sealed-storage/api/interfaces/SuggestContext.md +25 -0
  80. package/docs/sealed-storage/api/interfaces/TimeLockParams.md +13 -0
  81. package/docs/sealed-storage/api/type-aliases/SignPersonalMessage.md +17 -0
  82. package/docs/sealed-storage/api/typedoc-sidebar.json +1 -0
  83. package/docs/sealed-storage/api/variables/nftGateProvider.md +9 -0
  84. package/docs/sealed-storage/api/variables/timeLockProvider.md +9 -0
  85. package/docs/sealed-storage/index.md +68 -0
  86. package/docs/sealed-storage/policies.md +52 -0
  87. package/docs/sealed-storage/reference.md +79 -0
  88. package/docs/sealed-storage/using.md +55 -0
  89. package/docs/walrus-storage/api/classes/RetryableWalrusClientError.md +101 -0
  90. package/docs/walrus-storage/api/classes/WalrusFile.md +111 -0
  91. package/docs/walrus-storage/api/functions/buildAccessProofToken.md +21 -0
  92. package/docs/walrus-storage/api/functions/certifyBlobTransaction.md +30 -0
  93. package/docs/walrus-storage/api/functions/createBlobUploadFlow.md +30 -0
  94. package/docs/walrus-storage/api/functions/createRelayAccessToken.md +45 -0
  95. package/docs/walrus-storage/api/functions/createUploadFlow.md +30 -0
  96. package/docs/walrus-storage/api/functions/createWalrusClient.md +23 -0
  97. package/docs/walrus-storage/api/functions/estimateStorageCost.md +35 -0
  98. package/docs/walrus-storage/api/functions/extendBlobLifetime.md +40 -0
  99. package/docs/walrus-storage/api/functions/extendBlobLifetimeTransaction.md +34 -0
  100. package/docs/walrus-storage/api/functions/fetchOwnedWalrusBlobs.md +34 -0
  101. package/docs/walrus-storage/api/functions/fetchRelayChallenge.md +32 -0
  102. package/docs/walrus-storage/api/functions/getWalrusPackageConfig.md +25 -0
  103. package/docs/walrus-storage/api/functions/personalMessageForNonce.md +18 -0
  104. package/docs/walrus-storage/api/functions/readBlobAttributes.md +27 -0
  105. package/docs/walrus-storage/api/functions/setBlobAttributes.md +40 -0
  106. package/docs/walrus-storage/api/functions/setBlobAttributesTransaction.md +34 -0
  107. package/docs/walrus-storage/api/functions/uploadBytes.md +38 -0
  108. package/docs/walrus-storage/api/functions/uploadImageBytes.md +34 -0
  109. package/docs/walrus-storage/api/functions/uploadLocalFile.md +37 -0
  110. package/docs/walrus-storage/api/functions/walrusBlobUrl.md +26 -0
  111. package/docs/walrus-storage/api/index.md +56 -0
  112. package/docs/walrus-storage/api/interfaces/CertifyOptions.md +46 -0
  113. package/docs/walrus-storage/api/interfaces/StorageCost.md +35 -0
  114. package/docs/walrus-storage/api/type-aliases/AccessProofInput.md +7 -0
  115. package/docs/walrus-storage/api/type-aliases/CreateWalrusClientOptions.md +113 -0
  116. package/docs/walrus-storage/api/type-aliases/ExtendOptions.md +8 -0
  117. package/docs/walrus-storage/api/type-aliases/OwnedBlob.md +57 -0
  118. package/docs/walrus-storage/api/type-aliases/PersonalMessageSigner.md +17 -0
  119. package/docs/walrus-storage/api/type-aliases/RelayChallenge.md +7 -0
  120. package/docs/walrus-storage/api/type-aliases/UploadOptions.md +37 -0
  121. package/docs/walrus-storage/api/type-aliases/UploadResult.md +27 -0
  122. package/docs/walrus-storage/api/type-aliases/WalrusClient.md +7 -0
  123. package/docs/walrus-storage/api/type-aliases/WalrusNetwork.md +7 -0
  124. package/docs/walrus-storage/api/typedoc-sidebar.json +1 -0
  125. package/docs/walrus-storage/api/variables/DEFAULT_RPC_URLS.md +7 -0
  126. package/docs/walrus-storage/api/variables/LONG_TERM_EPOCHS.md +12 -0
  127. package/docs/walrus-storage/api/variables/MAINNET_WALRUS_PACKAGE_CONFIG.md +15 -0
  128. package/docs/walrus-storage/api/variables/PUBLIC_UPLOAD_RELAY_HOSTS.md +10 -0
  129. package/docs/walrus-storage/api/variables/TESTNET_WALRUS_PACKAGE_CONFIG.md +19 -0
  130. package/docs/walrus-storage/api/variables/WALRUS_AGGREGATOR_HOSTS.md +7 -0
  131. package/docs/walrus-storage/index.md +54 -0
  132. package/docs/walrus-storage/reference.md +69 -0
  133. package/docs/walrus-storage/using.md +53 -0
  134. package/package.json +50 -0
  135. package/scripts/gen-api.mjs +107 -0
  136. package/tsconfig.json +13 -0
  137. package/tsconfig.typedoc.json +20 -0
@@ -0,0 +1,49 @@
1
+ # Interface: OwnedObjectsClient
2
+
3
+ Defined in: types.ts:111
4
+
5
+ Minimal structural subset of a core Sui client used for owned-object listing (`SuiGrpcClient`).
6
+
7
+ ## Properties
8
+
9
+ ### core
10
+
11
+ > **core**: `object`
12
+
13
+ Defined in: types.ts:112
14
+
15
+ #### listOwnedObjects()
16
+
17
+ > **listOwnedObjects**(`options`): `Promise`\<\{ `cursor`: `string`; `hasNextPage`: `boolean`; `objects`: `CoreObject`[]; \}\>
18
+
19
+ ##### Parameters
20
+
21
+ ###### options
22
+
23
+ ###### cursor?
24
+
25
+ `string`
26
+
27
+ ###### include?
28
+
29
+ \{ `json?`: `boolean`; \}
30
+
31
+ ###### include.json?
32
+
33
+ `boolean`
34
+
35
+ ###### limit?
36
+
37
+ `number`
38
+
39
+ ###### owner
40
+
41
+ `string`
42
+
43
+ ###### type?
44
+
45
+ `string`
46
+
47
+ ##### Returns
48
+
49
+ `Promise`\<\{ `cursor`: `string`; `hasNextPage`: `boolean`; `objects`: `CoreObject`[]; \}\>
@@ -0,0 +1,37 @@
1
+ # Interface: SuiObjectClient
2
+
3
+ Defined in: types.ts:124
4
+
5
+ Minimal structural subset of a core Sui client used for a typed single-object read.
6
+
7
+ ## Properties
8
+
9
+ ### core
10
+
11
+ > **core**: `object`
12
+
13
+ Defined in: types.ts:125
14
+
15
+ #### getObject()
16
+
17
+ > **getObject**(`options`): `Promise`\<\{ `object`: `CoreObject`; \}\>
18
+
19
+ ##### Parameters
20
+
21
+ ###### options
22
+
23
+ ###### include?
24
+
25
+ \{ `json?`: `boolean`; \}
26
+
27
+ ###### include.json?
28
+
29
+ `boolean`
30
+
31
+ ###### objectId
32
+
33
+ `string`
34
+
35
+ ##### Returns
36
+
37
+ `Promise`\<\{ `object`: `CoreObject`; \}\>
@@ -0,0 +1,17 @@
1
+ # Type Alias: PersonalMessageSigner
2
+
3
+ > **PersonalMessageSigner** = (`message`) => `Promise`\<\{ `signature`: `string`; \}\>
4
+
5
+ Defined in: proof.ts:36
6
+
7
+ A wallet-provided personal-message signer (e.g. wallet-standard `sui:signPersonalMessage`).
8
+
9
+ ## Parameters
10
+
11
+ ### message
12
+
13
+ `Uint8Array`
14
+
15
+ ## Returns
16
+
17
+ `Promise`\<\{ `signature`: `string`; \}\>
@@ -0,0 +1 @@
1
+ [{"text":"Interfaces","collapsed":true,"items":[{"text":"AccessGateConfig","link":"/docs/access-gate/api/interfaces/AccessGateConfig.md"},{"text":"AccessProof","link":"/docs/access-gate/api/interfaces/AccessProof.md"},{"text":"Challenge","link":"/docs/access-gate/api/interfaces/Challenge.md"},{"text":"GateAdminContext","link":"/docs/access-gate/api/interfaces/GateAdminContext.md"},{"text":"OwnedAccessNft","link":"/docs/access-gate/api/interfaces/OwnedAccessNft.md"},{"text":"OwnedGate","link":"/docs/access-gate/api/interfaces/OwnedGate.md"},{"text":"OwnedObjectsClient","link":"/docs/access-gate/api/interfaces/OwnedObjectsClient.md"},{"text":"SuiObjectClient","link":"/docs/access-gate/api/interfaces/SuiObjectClient.md"}]},{"text":"Type Aliases","collapsed":true,"items":[{"text":"PersonalMessageSigner","link":"/docs/access-gate/api/type-aliases/PersonalMessageSigner.md"}]},{"text":"Functions","collapsed":true,"items":[{"text":"buildAccessProof","link":"/docs/access-gate/api/functions/buildAccessProof.md"},{"text":"buildAirdropTx","link":"/docs/access-gate/api/functions/buildAirdropTx.md"},{"text":"buildConsumeTx","link":"/docs/access-gate/api/functions/buildConsumeTx.md"},{"text":"buildCreateGateTx","link":"/docs/access-gate/api/functions/buildCreateGateTx.md"},{"text":"buildMakeGateImmutableTx","link":"/docs/access-gate/api/functions/buildMakeGateImmutableTx.md"},{"text":"buildPurchaseTx","link":"/docs/access-gate/api/functions/buildPurchaseTx.md"},{"text":"buildSetAutoBurnAtZeroTx","link":"/docs/access-gate/api/functions/buildSetAutoBurnAtZeroTx.md"},{"text":"buildSetDefaultUsesTx","link":"/docs/access-gate/api/functions/buildSetDefaultUsesTx.md"},{"text":"buildSetNftDescriptionTx","link":"/docs/access-gate/api/functions/buildSetNftDescriptionTx.md"},{"text":"buildSetNftImageUrlTx","link":"/docs/access-gate/api/functions/buildSetNftImageUrlTx.md"},{"text":"buildSetNftNameTx","link":"/docs/access-gate/api/functions/buildSetNftNameTx.md"},{"text":"buildSetPausedTx","link":"/docs/access-gate/api/functions/buildSetPausedTx.md"},{"text":"buildSetPaymentRecipientTx","link":"/docs/access-gate/api/functions/buildSetPaymentRecipientTx.md"},{"text":"buildSetPriceTx","link":"/docs/access-gate/api/functions/buildSetPriceTx.md"},{"text":"buildSetSoulboundTx","link":"/docs/access-gate/api/functions/buildSetSoulboundTx.md"},{"text":"decodeAccessProof","link":"/docs/access-gate/api/functions/decodeAccessProof.md"},{"text":"encodeAccessProof","link":"/docs/access-gate/api/functions/encodeAccessProof.md"},{"text":"fetchAccessNftById","link":"/docs/access-gate/api/functions/fetchAccessNftById.md"},{"text":"fetchAccessNfts","link":"/docs/access-gate/api/functions/fetchAccessNfts.md"},{"text":"fetchAdminCaps","link":"/docs/access-gate/api/functions/fetchAdminCaps.md"},{"text":"fetchChallenge","link":"/docs/access-gate/api/functions/fetchChallenge.md"},{"text":"fetchGate","link":"/docs/access-gate/api/functions/fetchGate.md"},{"text":"fetchOwnedGates","link":"/docs/access-gate/api/functions/fetchOwnedGates.md"},{"text":"ownsAccessNft","link":"/docs/access-gate/api/functions/ownsAccessNft.md"},{"text":"parseAdminCap","link":"/docs/access-gate/api/functions/parseAdminCap.md"},{"text":"parseGate","link":"/docs/access-gate/api/functions/parseGate.md"},{"text":"parseOwnedAccessNft","link":"/docs/access-gate/api/functions/parseOwnedAccessNft.md"},{"text":"personalMessageForNonce","link":"/docs/access-gate/api/functions/personalMessageForNonce.md"}]}]
@@ -0,0 +1,61 @@
1
+ # Access Gate
2
+
3
+ Create NFT **passes** that gate access to something — content, an API, an app, a download — with
4
+ ownership verified on-chain. Operators manage gates at
5
+ [sui-access-gate.meddleware.co.uk](https://sui-access-gate.meddleware.co.uk).
6
+
7
+ ## What it is
8
+
9
+ An **access gate** is an on-chain object with a price and rules. Anyone can **purchase** a pass
10
+ (an NFT) from it; holding a valid pass is the proof of access. Passes can be **unlimited** (a
11
+ membership) or **single-use** (spent once), and optionally **soulbound** (non-transferable).
12
+
13
+ There are two perspectives:
14
+
15
+ - **Operators** create and manage gates (set the price, airdrop passes, pause, freeze).
16
+ - **Buyers/holders** purchase a pass and use it to access whatever the gate protects.
17
+
18
+ ## When to use it
19
+
20
+ - You want to **sell access** — a paid community, premium content, a members' area.
21
+ - You want to **gate an API or app** behind on-chain ownership (pair it with the
22
+ [nft-gate gateway](/access-gate/reference), which puts any HTTP service behind a gate).
23
+ - You want to gate **encrypted content** — combine it with [Sealed Storage](/sealed-storage/), where
24
+ a pass becomes the key.
25
+ - You want **single-use tickets** or **memberships** represented as NFTs.
26
+
27
+ ## How a purchase works
28
+
29
+ 1. A buyer calls **purchase** on the gate and pays the price.
30
+ 2. The payment is split on-chain: a **commission** goes to the platform treasury, the rest to the
31
+ gate's **operator** — atomically, in one transaction. Overpayment is refunded.
32
+ 3. The buyer receives the pass NFT.
33
+
34
+ No operator co-signature is needed — purchase is permissionless and atomic.
35
+
36
+ ## Single-use vs unlimited
37
+
38
+ - **Unlimited pass** — acts as ongoing membership; using it doesn't consume it.
39
+ - **Single-use** — carries a number of uses; **consuming** one is done on-chain by the owner and
40
+ emits a verifiable event (with a **nonce**) that a verifier binds to. Off-chain systems can't spend
41
+ a pass on your behalf.
42
+
43
+ When a single-use pass hits zero, the gate's policy decides: auto-burn it, or return it as a spent
44
+ receipt.
45
+
46
+ ## Soulbound passes
47
+
48
+ A gate can mint **soulbound** (non-transferable) passes — useful when access should be tied to one
49
+ identity and not resold. The non-transferability is enforced at the contract level.
50
+
51
+ ## Commission
52
+
53
+ Every purchase routes a commission (in basis points, capped on-chain at 10%) to the platform
54
+ treasury; the rest goes to the operator. The rate is set in shared on-chain config and shown in the
55
+ [DAO console](/dao/). Operators don't set the commission — only the price.
56
+
57
+ ## Next
58
+
59
+ - **[Using it](/access-gate/using)** — create and manage a gate; buy and use a pass.
60
+ - **[Reference](/access-gate/reference)** — objects, entry functions, events, the gateway, and the
61
+ SDK API.
@@ -0,0 +1,111 @@
1
+ # Access Gate — reference
2
+
3
+ The on-chain `access_gate` contract, its gateway, and the client SDK. Move tables are curated from
4
+ source; the TypeScript SDK reference is [auto-generated](#sdk-api).
5
+
6
+ ## Deployed identifiers (testnet)
7
+
8
+ | Thing | ID |
9
+ | --- | --- |
10
+ | `access_gate` package | `0x0bedd0b27d993d3292ca6a5315f7562de8bc0ff3752b445b4c53252c76f2d20d` |
11
+ | `PlatformConfig` object | `0x7c5aed0ce7f29a4dfb60657858df31c12410a67098b4bcdd1d8cb1e531be4884` |
12
+
13
+ Mainnet identifiers are pending.
14
+
15
+ ## Objects
16
+
17
+ ### `Gate` (shared)
18
+
19
+ ```
20
+ Gate {
21
+ price_mist // pass price in MIST
22
+ payment_recipient // operator address that receives the post-commission amount
23
+ default_uses // 0 ⇒ unlimited pass; N ⇒ single-use with N uses
24
+ soulbound // whether minted passes are non-transferable
25
+ auto_burn_at_zero // spent single-use pass: delete (true) or return as receipt (false)
26
+ paused // purchases blocked while true
27
+ admin_cap_id // the AdminCap authorised to manage this gate
28
+ }
29
+ ```
30
+
31
+ ### Passes
32
+
33
+ - **`AccessNFT`** (has `store`) — a transferable pass.
34
+ - **`SoulboundAccessNFT`** (no `store`) — non-transferable; only the contract's `consume`/`burn` can
35
+ destroy it.
36
+
37
+ Both wrap **`AccessData`** `{ gate_id, variant, minted_epoch }`, where **`AccessVariant`** is
38
+ `UnlimitedPass` or `SingleUse { uses_remaining }`.
39
+
40
+ ### `AdminCap`
41
+
42
+ Owned capability authorising management of one gate (`{ gate_id }`). Authorisation is by
43
+ `cap.gate_id == object::id(gate)`.
44
+
45
+ ## Entry functions
46
+
47
+ | Function | Who | Effect |
48
+ | --- | --- | --- |
49
+ | `create_gate` | anyone | Create a gate; mints an `AdminCap` to the creator. |
50
+ | `purchase` | anyone | Pay `price_mist`; commission → treasury, remainder → `payment_recipient`; mint pass; refund overpayment. |
51
+ | `consume` | pass owner | Spend one use of a single-use pass; emits `AccessConsumedEvent { nonce }`. |
52
+ | `airdrop` | AdminCap | Grant a pass to an address without payment. |
53
+ | `burn` | pass owner | Voluntarily destroy a pass; emits `AccessBurnedEvent`. |
54
+ | admin setters | AdminCap | Update price / recipient / paused / etc. |
55
+ | `make_gate_immutable` | AdminCap | **Irreversible** — consumes the AdminCap; ends settings + airdrops. |
56
+ | `set_platform_treasury`, `set_commission_bps` | platform admin | Platform-only; not exposed in the operator console. |
57
+
58
+ ## Events
59
+
60
+ | Event | Emitted when | Key fields |
61
+ | --- | --- | --- |
62
+ | `GateCreatedEvent` | a gate is created | gate config |
63
+ | `AccessMintedEvent` | a pass is purchased/airdropped | recipient, gate |
64
+ | `AccessConsumedEvent` | a single-use pass is spent | **`nonce`**, address |
65
+ | `AccessBurnedEvent` | a pass is burned | id |
66
+
67
+ ::: warning Event pruning
68
+ Sui testnet prunes old events after ~3 months. Systems that need a reliable gate list should read
69
+ **`AdminCap` ownership → `Gate`** rather than replaying `GateCreatedEvent` (this is what the
70
+ [DAO console](/dao/) does).
71
+ :::
72
+
73
+ ## Error codes
74
+
75
+ | Code | Constant | Meaning |
76
+ | --- | --- | --- |
77
+ | 1 | `E_PAUSED` | Gate is paused |
78
+ | 2 | `E_INSUFFICIENT_PAYMENT` | Payment below price |
79
+ | 3 | `E_NOT_SINGLE_USE` | Consume called on an unlimited pass |
80
+ | 4 | `E_NO_USES_REMAINING` | Single-use pass already exhausted |
81
+ | 5 | `E_WRONG_GATE` | NFT/cap doesn't belong to the supplied gate |
82
+
83
+ ## Gateway (nft-gate)
84
+
85
+ Any HTTP service can be placed **behind** a gate using the nft-gate reverse proxy. It verifies a
86
+ signed proof and on-chain pass ownership, failing **closed** on any ambiguity.
87
+
88
+ - **Personal message signed by the wallet:** `nft-gate:access:<nonce>`
89
+ - **Proof token** (`Authorization: Bearer …` or `X-Access-Proof`): base64 of
90
+
91
+ ```json
92
+ { "address": "0x…", "nonce": "…", "signature": "…", "consumeDigest": "…" }
93
+ ```
94
+
95
+ The gateway consumes the nonce immediately (single-use replay protection) and, for single-use passes,
96
+ verifies the on-chain consumption by digest. Two wire-identical implementations exist (Cloudflare
97
+ Workers and Rust); running one is a [self-host / `dev.`](#developer-note) topic.
98
+
99
+ ## SDK API
100
+
101
+ The full `@meddleware/nft-gate-client` API — PTB builders (`create_gate`, `purchase`, `consume`,
102
+ airdrop, admin setters), ownership reads, and the challenge/proof helpers — is generated here:
103
+
104
+ - [NFT-gate client API](./api/)
105
+
106
+ ## Developer note
107
+
108
+ Deploying the gateway, integrating the SDK into your own app, and white-label operation are
109
+ `dev.meddleware.co.uk` topics, planned in the `access-gate-sui`, `nft-gate`, and `nft-gate-client`
110
+ package docs. This page is the on-chain contract and wire-protocol reference users and bots can rely
111
+ on.
@@ -0,0 +1,68 @@
1
+ # Access Gate — using it
2
+
3
+ Two audiences: **operators** who run gates, and **buyers** who hold passes.
4
+
5
+ ## For operators
6
+
7
+ Manage gates in the [operator console](https://sui-access-gate.meddleware.co.uk). You'll need a
8
+ [Sui wallet](/getting-started).
9
+
10
+ ### Create a gate
11
+
12
+ 1. **Connect** your wallet and open **Create gate**.
13
+ 2. Set the pass details:
14
+ - **Name** — shown to buyers and in the DAO console.
15
+ - **Price** (in SUI) — what a buyer pays.
16
+ - **Uses** — `0` for an unlimited membership pass, or `N` for single-use with N uses.
17
+ - **Soulbound** — whether passes are non-transferable.
18
+ - **Auto-burn at zero** — for single-use, whether a spent pass is deleted or kept as a receipt.
19
+ 3. Confirm. Creating the gate gives your wallet an **admin capability** (`AdminCap`) for it.
20
+
21
+ ### Manage a gate
22
+
23
+ Under **My gates**, each gate you administer offers:
24
+
25
+ - **Settings** — update price and metadata (via the AdminCap).
26
+ - **Pause** — temporarily stop purchases.
27
+ - **Airdrop** — grant passes directly to addresses (no payment).
28
+ - **Freeze** — see below.
29
+
30
+ ### Freeze (irreversible)
31
+
32
+ ::: warning Freezing is permanent
33
+ **Freeze** makes a gate immutable: it consumes the AdminCap and permanently ends all settings and
34
+ airdrops. Purchases and consumption keep working. The console guards this behind a typed **FREEZE**
35
+ confirmation. There is no undo.
36
+ :::
37
+
38
+ ## For buyers / holders
39
+
40
+ ### Buy a pass
41
+
42
+ Purchase from the gate (through whatever surface the operator exposes — the console, a link, or an
43
+ app integrating the gate). You pay the price; the commission and operator split happen on-chain; you
44
+ receive the pass NFT. Overpayment is refunded automatically.
45
+
46
+ ### Use a pass
47
+
48
+ - For **access checks** (e.g. a gated relay or API), your wallet signs a short challenge and the
49
+ service verifies you hold a valid pass on-chain.
50
+ - For **single-use** passes, **consuming** a use is an on-chain action you take as the owner; it emits
51
+ a verifiable event that the service binds to. This is why an off-chain service can't silently spend
52
+ your pass.
53
+
54
+ ### Use a pass to unlock encrypted content
55
+
56
+ If content was sealed to a gate with [Sealed Storage](/sealed-storage/), holding a valid pass lets you
57
+ **decrypt** it — provide your pass when unlocking.
58
+
59
+ ## Common questions
60
+
61
+ **Who receives my payment?** Split on-chain: a capped commission to the platform treasury, the rest
62
+ to the operator.
63
+
64
+ **Can the operator take my pass back?** No — it's your NFT. (A soulbound pass can't be transferred by
65
+ anyone, including you.)
66
+
67
+ **What's a nonce for?** When you consume a single-use pass, the emitted **nonce** lets a verifier
68
+ confirm *that specific* consumption, rather than trusting a bare address.
@@ -0,0 +1,61 @@
1
+ # How the tools fit together
2
+
3
+ The four tools are useful on their own, but they're designed to compose. This page shows how.
4
+
5
+ ## The building blocks
6
+
7
+ | Tool | Provides | Depends on |
8
+ | --- | --- | --- |
9
+ | **Access Gate** | NFT passes that prove someone is allowed access | Sui only |
10
+ | **Walrus Storage** | Decentralised file (blob) storage | Sui + Walrus |
11
+ | **Sealed Storage** | Client-side encryption with on-chain access rules | Walrus + Seal + (optionally) Access Gate |
12
+ | **DAO** | A read-only view of the platform: treasury, commission, gates | Access Gate on-chain state |
13
+
14
+ ## Sealed Storage = Walrus + Seal + Access Gate
15
+
16
+ The clearest example of composition is **[Sealed Storage](/sealed-storage/)**. When you seal a file:
17
+
18
+ 1. **Seal** encrypts it in your browser, under a **policy** you choose.
19
+ 2. **Walrus** stores the resulting ciphertext — publicly, because it's useless without the key.
20
+ 3. The **policy** decides who can decrypt. One built-in policy is **Access Gate NFT ownership**: only
21
+ holders of a valid pass for a chosen gate can unlock the content.
22
+
23
+ So an Access Gate pass can act as the key to encrypted Walrus content — three tools, one flow.
24
+
25
+ ```
26
+ ┌─────────────┐ encrypt in browser ┌──────────────┐
27
+ file │ Seal │ ───────────────────────▶│ ciphertext │
28
+ └─────────────┘ └──────┬───────┘
29
+ ▲ │ store
30
+ policy │ (who may decrypt) ▼
31
+ ┌──────┴───────┐ ┌──────────────┐
32
+ │ Access Gate │ ← pass holders only │ Walrus │
33
+ │ (NFT pass) │ │ storage │
34
+ └──────────────┘ └──────────────┘
35
+ ```
36
+
37
+ ## How gated Walrus uploads work
38
+
39
+ **[Walrus Storage](/walrus-storage/)** can route uploads through a **relay**. Meddleware's relay can
40
+ be **gated** by an Access Gate NFT: you prove you hold a valid pass, and the relay accepts your
41
+ upload. A commission on gate purchases funds the service. If you don't need the gated relay, uploads
42
+ fall back to the public relay.
43
+
44
+ ## Where the DAO fits
45
+
46
+ The **[DAO console](/dao/)** doesn't create anything — it *observes*. It reads the platform's
47
+ on-chain configuration: the treasury address, the **commission rate** charged on Access Gate
48
+ purchases, the community gates the treasury controls, and a live feed of gate activity (passes sold,
49
+ used, burned). It's the transparency window over the Access Gate economics.
50
+
51
+ ## The commission thread
52
+
53
+ One number ties the economics together: the **commission** (in basis points) charged on-chain when an
54
+ Access Gate pass is purchased. It's set in a shared `PlatformConfig` object, capped on-chain, routed
55
+ to the treasury, and shown in the DAO console. The web apps can't change it — only an on-chain admin
56
+ capability can. This is the pattern throughout: **economics live in the smart contracts.**
57
+
58
+ ## Next
59
+
60
+ - [DAO](/dao/) · [Walrus Storage](/walrus-storage/) · [Sealed Storage](/sealed-storage/) ·
61
+ [Access Gate](/access-gate/)
@@ -0,0 +1,71 @@
1
+ # DAO
2
+
3
+ The **DAO console** is a read-only window onto the Meddleware platform's on-chain state. Open it at
4
+ [sui-dao.meddleware.co.uk](https://sui-dao.meddleware.co.uk) (it's also the default view in the
5
+ [tools hub](https://sui.meddleware.co.uk)).
6
+
7
+ ## What it is
8
+
9
+ A dashboard that reads directly from Sui and shows:
10
+
11
+ - the platform **treasury** balance and address,
12
+ - the **commission rate** charged on Access Gate purchases,
13
+ - the **community gates** the treasury controls,
14
+ - a live feed of **gate activity** (passes sold, used, burned).
15
+
16
+ You do **not** need to connect a wallet to browse it — everything shown is public on-chain data.
17
+
18
+ ## When to use it
19
+
20
+ - You want to **verify** the platform's commission rate or treasury address.
21
+ - You want to see **how many gates** exist and their prices.
22
+ - You're tracking **activity** — how many passes have been sold or used.
23
+ - You hold a platform admin capability and want to confirm the tool **detects** it (see
24
+ [Governance](#governance)).
25
+
26
+ If you want to *create* a gate, that's the [Access Gate](/access-gate/) tool, not this one.
27
+
28
+ ## The tabs
29
+
30
+ ### Overview
31
+
32
+ At-a-glance: treasury balance, commission rate, counters for active gates and accesses
33
+ minted/consumed, and a recent-activity feed.
34
+
35
+ ### Treasury
36
+
37
+ The commission rate (shown both as a percentage and in **basis points**), the treasury's live SUI
38
+ balance, and its address, plus a table of **Community Gates** the treasury controls — each with its
39
+ name, price, and object ID (linked to a Sui explorer).
40
+
41
+ ### Proposals
42
+
43
+ Reserved for on-chain governance proposals. This is a **placeholder** today — the governance module
44
+ isn't deployed yet, so the tab shows an empty state. It will list fundraising/governance proposals
45
+ when that module ships.
46
+
47
+ ### Governance
48
+
49
+ Shows the platform parameters (commission rate, the **10% / 1000 bps hard cap** enforced on-chain,
50
+ treasury address) and an **Admin Actions** panel. If you connect a wallet that holds a
51
+ `PlatformAdminCap`, the console detects it; admin controls will appear here as they're implemented.
52
+ Wallets without the capability simply see that privileged actions aren't available.
53
+
54
+ ### History
55
+
56
+ A paginated log of on-chain gate events — **Access Sold**, **Access Used**, **Access Burned** — each
57
+ with the associated address and transaction, linked to a Sui explorer.
58
+
59
+ ## How "active gates" is counted
60
+
61
+ The console finds gates by looking up the **admin capabilities** the treasury owns, then resolving the
62
+ gate each one controls — rather than replaying historical events. This matters because Sui testnet
63
+ **prunes** old events after a few months, which would otherwise make a naive event-based count read
64
+ as zero. The capability-based approach always reflects live reality. (The technical details are in
65
+ [Reference](/dao/reference).)
66
+
67
+ ## Commission, in one line
68
+
69
+ When someone buys an Access Gate pass, a share of the price — `commission_bps / 10000` — goes to the
70
+ treasury and the rest to the gate's operator. The rate is read live from on-chain config and is
71
+ capped at 10%.
@@ -0,0 +1,94 @@
1
+ # DAO — reference
2
+
3
+ Shapes and identifiers the DAO console reads. These are **on-chain** objects and events from the
4
+ `access_gate` package; the console only displays them.
5
+
6
+ ## Deployed identifiers (testnet)
7
+
8
+ | Thing | ID |
9
+ | --- | --- |
10
+ | `access_gate` package | `0x0bedd0b27d993d3292ca6a5315f7562de8bc0ff3752b445b4c53252c76f2d20d` |
11
+ | `PlatformConfig` object | `0x7c5aed0ce7f29a4dfb60657858df31c12410a67098b4bcdd1d8cb1e531be4884` |
12
+
13
+ Mainnet identifiers are pending. The console reads these from its build-time configuration; on a
14
+ Sui explorer you can inspect them directly.
15
+
16
+ ## `PlatformConfig`
17
+
18
+ The shared object holding platform-wide settings.
19
+
20
+ ```json
21
+ {
22
+ "treasury": "0x…", // address that receives commission
23
+ "commission_bps": 20 // commission in basis points (20 = 0.20%)
24
+ }
25
+ ```
26
+
27
+ The console derives the commission percentage as `commission_bps / 100` and enforces awareness of the
28
+ on-chain hard cap of **1000 bps (10%)**.
29
+
30
+ ## `Gate`
31
+
32
+ A shared object representing one access class. The console surfaces a subset of its fields:
33
+
34
+ ```json
35
+ {
36
+ "nft_name": "My Community Pass",
37
+ "price_mist": "1000000000", // price in MIST (1 SUI = 1e9 MIST)
38
+ "paused": false,
39
+ "frozen": false,
40
+ "admin_cap_id": "0x…" // the AdminCap authorised to manage this gate
41
+ }
42
+ ```
43
+
44
+ ## `AdminCap`
45
+
46
+ The owned capability that authorises managing a gate. Gate discovery walks the treasury's `AdminCap`
47
+ objects and resolves each gate:
48
+
49
+ ```json
50
+ {
51
+ "gate_id": "0x…" // the Gate this cap administers
52
+ }
53
+ ```
54
+
55
+ **Why capability-based discovery?** Sui testnet fullnodes prune old events (including the one-time
56
+ `GateCreatedEvent`) after ~3 months, so counting gates from events under-reports. Reading
57
+ `treasury → AdminCap objects → Gate` always reflects live on-chain reality.
58
+
59
+ ## Events
60
+
61
+ The History tab and activity counters read these event types (emitted by `access_gate`):
62
+
63
+ | Event | Meaning | Key fields |
64
+ | --- | --- | --- |
65
+ | `AccessMintedEvent` | A pass was purchased/minted | recipient, gate |
66
+ | `AccessConsumedEvent` | A single-use pass was spent | `nonce`, address |
67
+ | `AccessBurnedEvent` | A pass was burned | id |
68
+
69
+ Example (as decoded JSON):
70
+
71
+ ```json
72
+ {
73
+ "type": "AccessConsumedEvent",
74
+ "recipient": "0x…",
75
+ "nonce": "…",
76
+ "txDigest": "…",
77
+ "checkpoint": "12345678"
78
+ }
79
+ ```
80
+
81
+ The console queries each event type independently and merges them, sorted by checkpoint
82
+ (newest first), tolerating any single type being pruned or unavailable.
83
+
84
+ ## Roadmap: `vault_dao`
85
+
86
+ The **Proposals** and **Governance actions** are placeholders pending an on-chain `vault_dao` module.
87
+ When it ships, proposals will be read from its registry; the console's display shapes are already
88
+ stable so wiring it in won't change the UI.
89
+
90
+ ::: tip Developer note
91
+ Full SDK/contract API reference (entry functions, exhaustive event schemas) is being consolidated for
92
+ `dev.meddleware.co.uk`. The [Access Gate reference](/access-gate/reference) already lists the gate
93
+ contract's entry points and events, which is the on-chain source these DAO views read.
94
+ :::
@@ -0,0 +1,59 @@
1
+ # Getting started
2
+
3
+ Everything here runs on [Sui](https://sui.io). You interact with each tool through its hosted web app
4
+ using a **Sui wallet**. This page covers the basics that apply to all of them.
5
+
6
+ ## 1. Get a Sui wallet
7
+
8
+ Install a Sui wallet browser extension (for example [Slush](https://slush.app/), the official Sui
9
+ wallet, or any wallet that supports the Sui wallet standard). Create or import an account and keep
10
+ your recovery phrase safe — no one at Meddleware can recover it for you.
11
+
12
+ ## 2. Choose a network: testnet vs mainnet
13
+
14
+ Sui has separate networks:
15
+
16
+ - **Testnet** — a free sandbox using **test** SUI with no real value. Best for trying things out. The
17
+ Meddleware tools currently run against **testnet**.
18
+ - **Mainnet** — the real network, where SUI has value. Some tools are mainnet-pending; each app shows
19
+ its current network in the header.
20
+
21
+ Make sure your wallet is set to the **same network** as the app you're using. On testnet you can get
22
+ free test SUI from the [Sui faucet](https://faucet.sui.io/).
23
+
24
+ ::: tip You need a little SUI for gas
25
+ Every on-chain action (a purchase, an upload registration, extending a blob) costs a small **gas**
26
+ fee in SUI. On testnet this is free from the faucet; on mainnet it's real but typically tiny.
27
+ :::
28
+
29
+ ## 3. Open a tool and connect
30
+
31
+ Each tool has its own subdomain, and they're all linked from the **tools hub**:
32
+
33
+ | Tool | App |
34
+ | --- | --- |
35
+ | Tools hub | [sui.meddleware.co.uk](https://sui.meddleware.co.uk) |
36
+ | DAO console | [sui-dao.meddleware.co.uk](https://sui-dao.meddleware.co.uk) |
37
+ | Walrus Storage | [sui-walrus.meddleware.co.uk](https://sui-walrus.meddleware.co.uk) |
38
+ | Sealed Storage | [sui-seal.meddleware.co.uk](https://sui-seal.meddleware.co.uk) |
39
+ | Access Gate | [sui-access-gate.meddleware.co.uk](https://sui-access-gate.meddleware.co.uk) |
40
+
41
+ Click **Connect** and approve the connection in your wallet. The tools hub shares one wallet
42
+ connection across every tool embedded in it.
43
+
44
+ - **Browsing** the [DAO console](/dao/) needs **no wallet** — it's read-only.
45
+ - **Uploading, encrypting, buying, or managing** needs a connected wallet to sign transactions.
46
+
47
+ ## 4. Understand what's on-chain
48
+
49
+ A recurring theme across these tools: **the blockchain is the source of truth.** Prices, ownership,
50
+ commission, and access rules are enforced by Sui smart contracts, not by the web app. The apps are
51
+ thin front-ends — they show you state and help you build transactions, but they can't override what
52
+ the chain says. Anything an app displays can be independently verified on a
53
+ [Sui explorer](https://suiscan.xyz).
54
+
55
+ ## Next steps
56
+
57
+ - **[How the tools fit together](/architecture)** — the big picture.
58
+ - Jump into a tool: [DAO](/dao/) · [Walrus Storage](/walrus-storage/) ·
59
+ [Sealed Storage](/sealed-storage/) · [Access Gate](/access-gate/).