@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.
- package/CHANGELOG.md +14 -0
- package/LICENSE +14 -0
- package/README.md +54 -0
- package/docs/.vitepress/config.ts +101 -0
- package/docs/.vitepress/theme/custom.css +51 -0
- package/docs/.vitepress/theme/index.ts +8 -0
- package/docs/access-gate/api/functions/buildAccessProof.md +38 -0
- package/docs/access-gate/api/functions/buildAirdropTx.md +21 -0
- package/docs/access-gate/api/functions/buildConsumeTx.md +27 -0
- package/docs/access-gate/api/functions/buildCreateGateTx.md +52 -0
- package/docs/access-gate/api/functions/buildMakeGateImmutableTx.md +19 -0
- package/docs/access-gate/api/functions/buildPurchaseTx.md +23 -0
- package/docs/access-gate/api/functions/buildSetAutoBurnAtZeroTx.md +21 -0
- package/docs/access-gate/api/functions/buildSetDefaultUsesTx.md +21 -0
- package/docs/access-gate/api/functions/buildSetNftDescriptionTx.md +21 -0
- package/docs/access-gate/api/functions/buildSetNftImageUrlTx.md +21 -0
- package/docs/access-gate/api/functions/buildSetNftNameTx.md +21 -0
- package/docs/access-gate/api/functions/buildSetPausedTx.md +21 -0
- package/docs/access-gate/api/functions/buildSetPaymentRecipientTx.md +21 -0
- package/docs/access-gate/api/functions/buildSetPriceTx.md +21 -0
- package/docs/access-gate/api/functions/buildSetSoulboundTx.md +21 -0
- package/docs/access-gate/api/functions/decodeAccessProof.md +17 -0
- package/docs/access-gate/api/functions/encodeAccessProof.md +17 -0
- package/docs/access-gate/api/functions/fetchAccessNftById.md +27 -0
- package/docs/access-gate/api/functions/fetchAccessNfts.md +34 -0
- package/docs/access-gate/api/functions/fetchAdminCaps.md +30 -0
- package/docs/access-gate/api/functions/fetchChallenge.md +32 -0
- package/docs/access-gate/api/functions/fetchGate.md +26 -0
- package/docs/access-gate/api/functions/fetchOwnedGates.md +31 -0
- package/docs/access-gate/api/functions/ownsAccessNft.md +35 -0
- package/docs/access-gate/api/functions/parseAdminCap.md +26 -0
- package/docs/access-gate/api/functions/parseGate.md +19 -0
- package/docs/access-gate/api/functions/parseOwnedAccessNft.md +19 -0
- package/docs/access-gate/api/functions/personalMessageForNonce.md +18 -0
- package/docs/access-gate/api/index.md +47 -0
- package/docs/access-gate/api/interfaces/AccessGateConfig.md +57 -0
- package/docs/access-gate/api/interfaces/AccessProof.md +46 -0
- package/docs/access-gate/api/interfaces/Challenge.md +25 -0
- package/docs/access-gate/api/interfaces/GateAdminContext.md +37 -0
- package/docs/access-gate/api/interfaces/OwnedAccessNft.md +31 -0
- package/docs/access-gate/api/interfaces/OwnedGate.md +125 -0
- package/docs/access-gate/api/interfaces/OwnedObjectsClient.md +49 -0
- package/docs/access-gate/api/interfaces/SuiObjectClient.md +37 -0
- package/docs/access-gate/api/type-aliases/PersonalMessageSigner.md +17 -0
- package/docs/access-gate/api/typedoc-sidebar.json +1 -0
- package/docs/access-gate/index.md +61 -0
- package/docs/access-gate/reference.md +111 -0
- package/docs/access-gate/using.md +68 -0
- package/docs/architecture.md +61 -0
- package/docs/dao/index.md +71 -0
- package/docs/dao/reference.md +94 -0
- package/docs/getting-started.md +59 -0
- package/docs/index.md +58 -0
- package/docs/sealed-storage/api/classes/PolicyRegistry.md +103 -0
- package/docs/sealed-storage/api/classes/SealController.md +113 -0
- package/docs/sealed-storage/api/functions/buildPublishSealedContentTx.md +27 -0
- package/docs/sealed-storage/api/functions/bytesToHex.md +17 -0
- package/docs/sealed-storage/api/functions/concatBytes.md +17 -0
- package/docs/sealed-storage/api/functions/createDefaultRegistry.md +22 -0
- package/docs/sealed-storage/api/functions/createNftGateProvider.md +21 -0
- package/docs/sealed-storage/api/functions/hexToBytes.md +17 -0
- package/docs/sealed-storage/api/functions/objectIdBytes.md +17 -0
- package/docs/sealed-storage/api/functions/randomBytes.md +17 -0
- package/docs/sealed-storage/api/functions/sealedContentEventType.md +17 -0
- package/docs/sealed-storage/api/functions/u64beBytes.md +17 -0
- package/docs/sealed-storage/api/index.md +45 -0
- package/docs/sealed-storage/api/interfaces/EncryptResult.md +23 -0
- package/docs/sealed-storage/api/interfaces/FieldSpec.md +51 -0
- package/docs/sealed-storage/api/interfaces/FieldSuggestion.md +21 -0
- package/docs/sealed-storage/api/interfaces/KeyServerConfig.md +35 -0
- package/docs/sealed-storage/api/interfaces/NftGateParams.md +33 -0
- package/docs/sealed-storage/api/interfaces/PolicyDescriptor.md +49 -0
- package/docs/sealed-storage/api/interfaces/SealControllerConfig.md +63 -0
- package/docs/sealed-storage/api/interfaces/SealPolicyProvider.md +115 -0
- package/docs/sealed-storage/api/interfaces/SealSuggestClient.md +74 -0
- package/docs/sealed-storage/api/interfaces/SealedContentInput.md +45 -0
- package/docs/sealed-storage/api/interfaces/SealedContentPointer.md +53 -0
- package/docs/sealed-storage/api/interfaces/SealedManifest.md +65 -0
- package/docs/sealed-storage/api/interfaces/SuggestContext.md +25 -0
- package/docs/sealed-storage/api/interfaces/TimeLockParams.md +13 -0
- package/docs/sealed-storage/api/type-aliases/SignPersonalMessage.md +17 -0
- package/docs/sealed-storage/api/typedoc-sidebar.json +1 -0
- package/docs/sealed-storage/api/variables/nftGateProvider.md +9 -0
- package/docs/sealed-storage/api/variables/timeLockProvider.md +9 -0
- package/docs/sealed-storage/index.md +68 -0
- package/docs/sealed-storage/policies.md +52 -0
- package/docs/sealed-storage/reference.md +79 -0
- package/docs/sealed-storage/using.md +55 -0
- package/docs/walrus-storage/api/classes/RetryableWalrusClientError.md +101 -0
- package/docs/walrus-storage/api/classes/WalrusFile.md +111 -0
- package/docs/walrus-storage/api/functions/buildAccessProofToken.md +21 -0
- package/docs/walrus-storage/api/functions/certifyBlobTransaction.md +30 -0
- package/docs/walrus-storage/api/functions/createBlobUploadFlow.md +30 -0
- package/docs/walrus-storage/api/functions/createRelayAccessToken.md +45 -0
- package/docs/walrus-storage/api/functions/createUploadFlow.md +30 -0
- package/docs/walrus-storage/api/functions/createWalrusClient.md +23 -0
- package/docs/walrus-storage/api/functions/estimateStorageCost.md +35 -0
- package/docs/walrus-storage/api/functions/extendBlobLifetime.md +40 -0
- package/docs/walrus-storage/api/functions/extendBlobLifetimeTransaction.md +34 -0
- package/docs/walrus-storage/api/functions/fetchOwnedWalrusBlobs.md +34 -0
- package/docs/walrus-storage/api/functions/fetchRelayChallenge.md +32 -0
- package/docs/walrus-storage/api/functions/getWalrusPackageConfig.md +25 -0
- package/docs/walrus-storage/api/functions/personalMessageForNonce.md +18 -0
- package/docs/walrus-storage/api/functions/readBlobAttributes.md +27 -0
- package/docs/walrus-storage/api/functions/setBlobAttributes.md +40 -0
- package/docs/walrus-storage/api/functions/setBlobAttributesTransaction.md +34 -0
- package/docs/walrus-storage/api/functions/uploadBytes.md +38 -0
- package/docs/walrus-storage/api/functions/uploadImageBytes.md +34 -0
- package/docs/walrus-storage/api/functions/uploadLocalFile.md +37 -0
- package/docs/walrus-storage/api/functions/walrusBlobUrl.md +26 -0
- package/docs/walrus-storage/api/index.md +56 -0
- package/docs/walrus-storage/api/interfaces/CertifyOptions.md +46 -0
- package/docs/walrus-storage/api/interfaces/StorageCost.md +35 -0
- package/docs/walrus-storage/api/type-aliases/AccessProofInput.md +7 -0
- package/docs/walrus-storage/api/type-aliases/CreateWalrusClientOptions.md +113 -0
- package/docs/walrus-storage/api/type-aliases/ExtendOptions.md +8 -0
- package/docs/walrus-storage/api/type-aliases/OwnedBlob.md +57 -0
- package/docs/walrus-storage/api/type-aliases/PersonalMessageSigner.md +17 -0
- package/docs/walrus-storage/api/type-aliases/RelayChallenge.md +7 -0
- package/docs/walrus-storage/api/type-aliases/UploadOptions.md +37 -0
- package/docs/walrus-storage/api/type-aliases/UploadResult.md +27 -0
- package/docs/walrus-storage/api/type-aliases/WalrusClient.md +7 -0
- package/docs/walrus-storage/api/type-aliases/WalrusNetwork.md +7 -0
- package/docs/walrus-storage/api/typedoc-sidebar.json +1 -0
- package/docs/walrus-storage/api/variables/DEFAULT_RPC_URLS.md +7 -0
- package/docs/walrus-storage/api/variables/LONG_TERM_EPOCHS.md +12 -0
- package/docs/walrus-storage/api/variables/MAINNET_WALRUS_PACKAGE_CONFIG.md +15 -0
- package/docs/walrus-storage/api/variables/PUBLIC_UPLOAD_RELAY_HOSTS.md +10 -0
- package/docs/walrus-storage/api/variables/TESTNET_WALRUS_PACKAGE_CONFIG.md +19 -0
- package/docs/walrus-storage/api/variables/WALRUS_AGGREGATOR_HOSTS.md +7 -0
- package/docs/walrus-storage/index.md +54 -0
- package/docs/walrus-storage/reference.md +69 -0
- package/docs/walrus-storage/using.md +53 -0
- package/package.json +50 -0
- package/scripts/gen-api.mjs +107 -0
- package/tsconfig.json +13 -0
- package/tsconfig.typedoc.json +20 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Sealed Storage — reference
|
|
2
|
+
|
|
3
|
+
Shapes and identifiers behind Sealed Storage. The **exhaustive, always-current API** is auto-generated
|
|
4
|
+
from the `@meddleware/seal-client` SDK — see [SDK API](#sdk-api).
|
|
5
|
+
|
|
6
|
+
## Deployed identifiers (testnet)
|
|
7
|
+
|
|
8
|
+
| Thing | ID |
|
|
9
|
+
| --- | --- |
|
|
10
|
+
| `seal_policies` package | `0x9f0563bfe42fbd29932cd280cc47efe17f5339b4dc569eb110114665eecc231e` |
|
|
11
|
+
|
|
12
|
+
Mainnet is pending; the app is enabled by configuration once the package and key-server committee are
|
|
13
|
+
available.
|
|
14
|
+
|
|
15
|
+
## The manifest
|
|
16
|
+
|
|
17
|
+
The portable pointer produced when you seal a file. It contains **no secrets**:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"policyType": "nft-gate", // which policy sealed this content
|
|
22
|
+
"id": "…", // Seal identity (hex) — required to decrypt; cannot be recomputed
|
|
23
|
+
"blobId": "…", // Walrus blob id of the ciphertext
|
|
24
|
+
"network": "testnet",
|
|
25
|
+
"params": { "gateId": "0x…" }, // non-secret policy params (e.g. which gate)
|
|
26
|
+
"label": "optional human label"
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Keep the manifest safe — its `id` (the encryption identity) is needed to locate and decrypt the
|
|
31
|
+
ciphertext.
|
|
32
|
+
|
|
33
|
+
## Policy identities
|
|
34
|
+
|
|
35
|
+
Each policy encodes its access condition into the encryption **identity**. Conceptually:
|
|
36
|
+
|
|
37
|
+
| Policy | Identity layout | On-chain check |
|
|
38
|
+
| --- | --- | --- |
|
|
39
|
+
| `nft-gate` | `[32-byte gate id][random nonce]` | Holder of a valid pass for that gate |
|
|
40
|
+
| `time-lock` | `[8-byte unlock time][random nonce]` | On-chain clock ≥ unlock time |
|
|
41
|
+
|
|
42
|
+
The gate id in the identity namespaces the content: a pass for gate A cannot decrypt gate B.
|
|
43
|
+
|
|
44
|
+
## Threshold committee
|
|
45
|
+
|
|
46
|
+
Decryption uses a **t-of-n** committee of key servers (e.g. 2 of 3). Encryption targets all
|
|
47
|
+
configured servers; decryption needs a threshold of them to release shares. A short-lived **session
|
|
48
|
+
key** (signed once per session) authorises the release.
|
|
49
|
+
|
|
50
|
+
## Discoverable content pointer (optional)
|
|
51
|
+
|
|
52
|
+
Publishing a pointer for gate-unlockable content emits an on-chain event so pass-holders can discover
|
|
53
|
+
it:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"contentId": "0x…",
|
|
58
|
+
"gateId": "0x…",
|
|
59
|
+
"blobId": "…",
|
|
60
|
+
"sealId": "…",
|
|
61
|
+
"label": "…",
|
|
62
|
+
"publisher": "0x…"
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The pointer is public and grants nothing on its own — confidentiality stays enforced by Seal + the
|
|
67
|
+
gate.
|
|
68
|
+
|
|
69
|
+
## SDK API
|
|
70
|
+
|
|
71
|
+
The full `@meddleware/seal-client` API — the `SealController`, the policy registry, both built-in
|
|
72
|
+
providers, and the manifest/byte helpers — is generated here:
|
|
73
|
+
|
|
74
|
+
- [Seal client API](./api/)
|
|
75
|
+
|
|
76
|
+
::: tip Writing your own policy?
|
|
77
|
+
That's `dev.meddleware.co.uk` material (a `seal_policies` Move module + a matching client provider),
|
|
78
|
+
planned in the package docs.
|
|
79
|
+
:::
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Sealed Storage — using it
|
|
2
|
+
|
|
3
|
+
A walkthrough of the [Sealed Storage app](https://sui-seal.meddleware.co.uk). You'll need a
|
|
4
|
+
[Sui wallet](/getting-started); browsing policies needs nothing, but decrypting requires a signature.
|
|
5
|
+
|
|
6
|
+
## Encrypt and store
|
|
7
|
+
|
|
8
|
+
1. Open the **Encrypt** tab.
|
|
9
|
+
2. **Choose a file.**
|
|
10
|
+
3. **Pick a policy** (see [Policies](/sealed-storage/policies)). The form adapts to the policy — for
|
|
11
|
+
an Access Gate policy you select the gate; for a time-lock you pick an unlock time.
|
|
12
|
+
4. Encrypt. The file is sealed **in your browser** and the ciphertext is uploaded to Walrus.
|
|
13
|
+
5. You receive a **manifest** — save or share it. It's the pointer needed to decrypt later, and it
|
|
14
|
+
holds no secrets.
|
|
15
|
+
|
|
16
|
+
::: tip Choose the policy deliberately
|
|
17
|
+
The policy is baked into the encryption — you can't change who's allowed after the fact without
|
|
18
|
+
re-encrypting. Pick the right gate or unlock time up front.
|
|
19
|
+
:::
|
|
20
|
+
|
|
21
|
+
## Share
|
|
22
|
+
|
|
23
|
+
Send the **manifest** to whoever should be able to decrypt. Because access is enforced on-chain, you
|
|
24
|
+
can share it openly: only those who satisfy the policy (e.g. hold a valid pass, or wait until the
|
|
25
|
+
unlock time) can actually decrypt.
|
|
26
|
+
|
|
27
|
+
## Decrypt / unlock
|
|
28
|
+
|
|
29
|
+
1. Open the **Decrypt** (or **Unlock**) tab and provide the **manifest**.
|
|
30
|
+
2. For a gate policy, provide the **pass NFT** you hold; for a time-lock, just proceed once the time
|
|
31
|
+
has passed.
|
|
32
|
+
3. **Sign one wallet message.** This mints a short-lived **session key** — you won't be prompted again
|
|
33
|
+
until it expires.
|
|
34
|
+
4. If the on-chain check passes, a threshold of key servers releases their shares and the file is
|
|
35
|
+
decrypted locally. If not (no valid pass, too early), decryption is refused.
|
|
36
|
+
|
|
37
|
+
## Publishing discoverable content (optional)
|
|
38
|
+
|
|
39
|
+
For Access Gate content, you can optionally **publish a pointer on-chain** so a gate's pass-holders
|
|
40
|
+
can *discover* your sealed content without you sending each of them a manifest. The pointer is public
|
|
41
|
+
and grants nothing on its own — confidentiality is still enforced by the encryption and the gate.
|
|
42
|
+
|
|
43
|
+
## Common questions
|
|
44
|
+
|
|
45
|
+
**Can Meddleware read my file?** No. Encryption happens in your browser and the keys are split across
|
|
46
|
+
independent key servers. Meddleware never holds key material.
|
|
47
|
+
|
|
48
|
+
**What if a key server is down?** The committee is threshold-based (e.g. 2 of 3), so it tolerates some
|
|
49
|
+
servers being unavailable.
|
|
50
|
+
|
|
51
|
+
**I lost the manifest — can I recover the file?** The manifest holds no secret, but you need it (its
|
|
52
|
+
**identity** value in particular) to locate and decrypt the ciphertext. Keep it safe.
|
|
53
|
+
|
|
54
|
+
**Why did decryption fail?** The on-chain policy said no — commonly: you don't hold a valid pass for
|
|
55
|
+
the gate, or a time-lock hasn't elapsed yet.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Class: RetryableWalrusClientError
|
|
2
|
+
|
|
3
|
+
Defined in: @meddleware/walrus-client/node\_modules/@mysten/walrus/dist/error.d.mts:3
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `WalrusClientError`
|
|
8
|
+
|
|
9
|
+
## Constructors
|
|
10
|
+
|
|
11
|
+
### Constructor
|
|
12
|
+
|
|
13
|
+
> **new RetryableWalrusClientError**(`message?`): `RetryableWalrusClientError`
|
|
14
|
+
|
|
15
|
+
Defined in: typescript/lib/lib.es5.d.ts:1080
|
|
16
|
+
|
|
17
|
+
#### Parameters
|
|
18
|
+
|
|
19
|
+
##### message?
|
|
20
|
+
|
|
21
|
+
`string`
|
|
22
|
+
|
|
23
|
+
#### Returns
|
|
24
|
+
|
|
25
|
+
`RetryableWalrusClientError`
|
|
26
|
+
|
|
27
|
+
#### Inherited from
|
|
28
|
+
|
|
29
|
+
`WalrusClientError.constructor`
|
|
30
|
+
|
|
31
|
+
### Constructor
|
|
32
|
+
|
|
33
|
+
> **new RetryableWalrusClientError**(`message?`, `options?`): `RetryableWalrusClientError`
|
|
34
|
+
|
|
35
|
+
Defined in: typescript/lib/lib.es5.d.ts:1080
|
|
36
|
+
|
|
37
|
+
#### Parameters
|
|
38
|
+
|
|
39
|
+
##### message?
|
|
40
|
+
|
|
41
|
+
`string`
|
|
42
|
+
|
|
43
|
+
##### options?
|
|
44
|
+
|
|
45
|
+
`ErrorOptions`
|
|
46
|
+
|
|
47
|
+
#### Returns
|
|
48
|
+
|
|
49
|
+
`RetryableWalrusClientError`
|
|
50
|
+
|
|
51
|
+
#### Inherited from
|
|
52
|
+
|
|
53
|
+
`WalrusClientError.constructor`
|
|
54
|
+
|
|
55
|
+
## Properties
|
|
56
|
+
|
|
57
|
+
### cause?
|
|
58
|
+
|
|
59
|
+
> `optional` **cause?**: `unknown`
|
|
60
|
+
|
|
61
|
+
Defined in: typescript/lib/lib.es2022.error.d.ts:24
|
|
62
|
+
|
|
63
|
+
#### Inherited from
|
|
64
|
+
|
|
65
|
+
`WalrusClientError.cause`
|
|
66
|
+
|
|
67
|
+
***
|
|
68
|
+
|
|
69
|
+
### message
|
|
70
|
+
|
|
71
|
+
> **message**: `string`
|
|
72
|
+
|
|
73
|
+
Defined in: typescript/lib/lib.es5.d.ts:1075
|
|
74
|
+
|
|
75
|
+
#### Inherited from
|
|
76
|
+
|
|
77
|
+
`WalrusClientError.message`
|
|
78
|
+
|
|
79
|
+
***
|
|
80
|
+
|
|
81
|
+
### name
|
|
82
|
+
|
|
83
|
+
> **name**: `string`
|
|
84
|
+
|
|
85
|
+
Defined in: typescript/lib/lib.es5.d.ts:1074
|
|
86
|
+
|
|
87
|
+
#### Inherited from
|
|
88
|
+
|
|
89
|
+
`WalrusClientError.name`
|
|
90
|
+
|
|
91
|
+
***
|
|
92
|
+
|
|
93
|
+
### stack?
|
|
94
|
+
|
|
95
|
+
> `optional` **stack?**: `string`
|
|
96
|
+
|
|
97
|
+
Defined in: typescript/lib/lib.es5.d.ts:1076
|
|
98
|
+
|
|
99
|
+
#### Inherited from
|
|
100
|
+
|
|
101
|
+
`WalrusClientError.stack`
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Class: WalrusFile
|
|
2
|
+
|
|
3
|
+
Defined in: @meddleware/walrus-client/node\_modules/@mysten/walrus/dist/files/file.d.mts:7
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### Constructor
|
|
8
|
+
|
|
9
|
+
> **new WalrusFile**(`__namedParameters`): `WalrusFile`
|
|
10
|
+
|
|
11
|
+
Defined in: @meddleware/walrus-client/node\_modules/@mysten/walrus/dist/files/file.d.mts:14
|
|
12
|
+
|
|
13
|
+
#### Parameters
|
|
14
|
+
|
|
15
|
+
##### \_\_namedParameters
|
|
16
|
+
|
|
17
|
+
###### reader
|
|
18
|
+
|
|
19
|
+
`FileReader`
|
|
20
|
+
|
|
21
|
+
#### Returns
|
|
22
|
+
|
|
23
|
+
`WalrusFile`
|
|
24
|
+
|
|
25
|
+
## Methods
|
|
26
|
+
|
|
27
|
+
### bytes()
|
|
28
|
+
|
|
29
|
+
> **bytes**(): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
30
|
+
|
|
31
|
+
Defined in: @meddleware/walrus-client/node\_modules/@mysten/walrus/dist/files/file.d.mts:21
|
|
32
|
+
|
|
33
|
+
#### Returns
|
|
34
|
+
|
|
35
|
+
`Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
### getIdentifier()
|
|
40
|
+
|
|
41
|
+
> **getIdentifier**(): `Promise`\<`string`\>
|
|
42
|
+
|
|
43
|
+
Defined in: @meddleware/walrus-client/node\_modules/@mysten/walrus/dist/files/file.d.mts:19
|
|
44
|
+
|
|
45
|
+
#### Returns
|
|
46
|
+
|
|
47
|
+
`Promise`\<`string`\>
|
|
48
|
+
|
|
49
|
+
***
|
|
50
|
+
|
|
51
|
+
### getTags()
|
|
52
|
+
|
|
53
|
+
> **getTags**(): `Promise`\<`Record`\<`string`, `string`\>\>
|
|
54
|
+
|
|
55
|
+
Defined in: @meddleware/walrus-client/node\_modules/@mysten/walrus/dist/files/file.d.mts:20
|
|
56
|
+
|
|
57
|
+
#### Returns
|
|
58
|
+
|
|
59
|
+
`Promise`\<`Record`\<`string`, `string`\>\>
|
|
60
|
+
|
|
61
|
+
***
|
|
62
|
+
|
|
63
|
+
### json()
|
|
64
|
+
|
|
65
|
+
> **json**(): `Promise`\<`any`\>
|
|
66
|
+
|
|
67
|
+
Defined in: @meddleware/walrus-client/node\_modules/@mysten/walrus/dist/files/file.d.mts:23
|
|
68
|
+
|
|
69
|
+
#### Returns
|
|
70
|
+
|
|
71
|
+
`Promise`\<`any`\>
|
|
72
|
+
|
|
73
|
+
***
|
|
74
|
+
|
|
75
|
+
### text()
|
|
76
|
+
|
|
77
|
+
> **text**(): `Promise`\<`string`\>
|
|
78
|
+
|
|
79
|
+
Defined in: @meddleware/walrus-client/node\_modules/@mysten/walrus/dist/files/file.d.mts:22
|
|
80
|
+
|
|
81
|
+
#### Returns
|
|
82
|
+
|
|
83
|
+
`Promise`\<`string`\>
|
|
84
|
+
|
|
85
|
+
***
|
|
86
|
+
|
|
87
|
+
### from()
|
|
88
|
+
|
|
89
|
+
> `static` **from**(`options`): `WalrusFile`
|
|
90
|
+
|
|
91
|
+
Defined in: @meddleware/walrus-client/node\_modules/@mysten/walrus/dist/files/file.d.mts:9
|
|
92
|
+
|
|
93
|
+
#### Parameters
|
|
94
|
+
|
|
95
|
+
##### options
|
|
96
|
+
|
|
97
|
+
###### contents
|
|
98
|
+
|
|
99
|
+
`Uint8Array`\<`ArrayBufferLike`\> \| `Blob`
|
|
100
|
+
|
|
101
|
+
###### identifier
|
|
102
|
+
|
|
103
|
+
`string`
|
|
104
|
+
|
|
105
|
+
###### tags?
|
|
106
|
+
|
|
107
|
+
`Record`\<`string`, `string`\>
|
|
108
|
+
|
|
109
|
+
#### Returns
|
|
110
|
+
|
|
111
|
+
`WalrusFile`
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Function: buildAccessProofToken()
|
|
2
|
+
|
|
3
|
+
> **buildAccessProofToken**(`proof`): `string`
|
|
4
|
+
|
|
5
|
+
Defined in: @meddleware/walrus-client/src/access.ts:43
|
|
6
|
+
|
|
7
|
+
Encode a proof as the base64(JSON) Bearer token the relay auth header carries.
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
### proof
|
|
12
|
+
|
|
13
|
+
`AccessProof`
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
## Throws
|
|
20
|
+
|
|
21
|
+
if `JSON.stringify` or `btoa` is unavailable in the environment.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Function: certifyBlobTransaction()
|
|
2
|
+
|
|
3
|
+
> **certifyBlobTransaction**(`client`, `options`): `Transaction`
|
|
4
|
+
|
|
5
|
+
Defined in: @meddleware/walrus-client/src/manage.ts:95
|
|
6
|
+
|
|
7
|
+
Build (but do not sign) a transaction that certifies an already-uploaded blob, for a browser
|
|
8
|
+
wallet to sign. Lets an upload that was registered + uploaded (and paid for) but not certified —
|
|
9
|
+
e.g. the user dismissed the certify prompt — be completed later without re-uploading: certify is a
|
|
10
|
+
plain owner transaction that submits the stored availability certificate, validated on-chain.
|
|
11
|
+
|
|
12
|
+
## Parameters
|
|
13
|
+
|
|
14
|
+
### client
|
|
15
|
+
|
|
16
|
+
`ClientWithExtensions`
|
|
17
|
+
|
|
18
|
+
A Walrus-extended client.
|
|
19
|
+
|
|
20
|
+
### options
|
|
21
|
+
|
|
22
|
+
[`CertifyOptions`](../interfaces/CertifyOptions.md)
|
|
23
|
+
|
|
24
|
+
The blob ids + the base64 certificate captured at upload time.
|
|
25
|
+
|
|
26
|
+
## Returns
|
|
27
|
+
|
|
28
|
+
`Transaction`
|
|
29
|
+
|
|
30
|
+
An unsigned `Transaction`.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Function: createBlobUploadFlow()
|
|
2
|
+
|
|
3
|
+
> **createBlobUploadFlow**(`client`, `contents`): `WriteBlobFlow`
|
|
4
|
+
|
|
5
|
+
Defined in: @meddleware/walrus-client/src/upload.ts:141
|
|
6
|
+
|
|
7
|
+
Begin a multi-step raw-blob upload flow suitable for browser wallet signing.
|
|
8
|
+
|
|
9
|
+
Drive the returned flow:
|
|
10
|
+
```ts
|
|
11
|
+
await flow.encode()
|
|
12
|
+
const regTx = flow.register({ owner, epochs, deletable }) // wallet signs + executes
|
|
13
|
+
await flow.upload({ digest }) // digest of regTx
|
|
14
|
+
const certTx = flow.certify() // wallet signs + executes
|
|
15
|
+
const { blobId } = await flow.getBlob() // use walrusBlobUrl(network, blobId)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Parameters
|
|
19
|
+
|
|
20
|
+
### client
|
|
21
|
+
|
|
22
|
+
`ClientWithExtensions`
|
|
23
|
+
|
|
24
|
+
### contents
|
|
25
|
+
|
|
26
|
+
`Uint8Array`
|
|
27
|
+
|
|
28
|
+
## Returns
|
|
29
|
+
|
|
30
|
+
`WriteBlobFlow`
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Function: createRelayAccessToken()
|
|
2
|
+
|
|
3
|
+
> **createRelayAccessToken**(`opts`): `Promise`\<`string`\>
|
|
4
|
+
|
|
5
|
+
Defined in: @meddleware/walrus-client/src/access.ts:69
|
|
6
|
+
|
|
7
|
+
One-shot: fetch a challenge, sign it with the wallet, and return the encoded proof token
|
|
8
|
+
to pass as `createWalrusClient({ uploadRelayAuthToken })`. For single-use gates, supply
|
|
9
|
+
the `consumeDigest` of the on-chain consume transaction.
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
### opts
|
|
14
|
+
|
|
15
|
+
#### address
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
#### consumeDigest?
|
|
20
|
+
|
|
21
|
+
`string`
|
|
22
|
+
|
|
23
|
+
#### relayHost
|
|
24
|
+
|
|
25
|
+
`string`
|
|
26
|
+
|
|
27
|
+
#### sign
|
|
28
|
+
|
|
29
|
+
[`PersonalMessageSigner`](../type-aliases/PersonalMessageSigner.md)
|
|
30
|
+
|
|
31
|
+
#### signal?
|
|
32
|
+
|
|
33
|
+
`AbortSignal`
|
|
34
|
+
|
|
35
|
+
## Returns
|
|
36
|
+
|
|
37
|
+
`Promise`\<`string`\>
|
|
38
|
+
|
|
39
|
+
## Throws
|
|
40
|
+
|
|
41
|
+
if the challenge fetch fails.
|
|
42
|
+
|
|
43
|
+
## Throws
|
|
44
|
+
|
|
45
|
+
if the wallet signer rejects the message.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Function: createUploadFlow()
|
|
2
|
+
|
|
3
|
+
> **createUploadFlow**(`client`, `contents`, `identifier`, `options?`): `WriteFilesFlow`
|
|
4
|
+
|
|
5
|
+
Defined in: @meddleware/walrus-client/src/upload.ts:90
|
|
6
|
+
|
|
7
|
+
Begin a multi-step quilt upload flow suitable for browser wallet signing.
|
|
8
|
+
The caller drives the flow: encode → register (wallet signs) → upload → certify (wallet signs).
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
### client
|
|
13
|
+
|
|
14
|
+
`ClientWithExtensions`
|
|
15
|
+
|
|
16
|
+
### contents
|
|
17
|
+
|
|
18
|
+
`Uint8Array`
|
|
19
|
+
|
|
20
|
+
### identifier
|
|
21
|
+
|
|
22
|
+
`string`
|
|
23
|
+
|
|
24
|
+
### options?
|
|
25
|
+
|
|
26
|
+
[`UploadOptions`](../type-aliases/UploadOptions.md) = `{}`
|
|
27
|
+
|
|
28
|
+
## Returns
|
|
29
|
+
|
|
30
|
+
`WriteFilesFlow`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Function: createWalrusClient()
|
|
2
|
+
|
|
3
|
+
> **createWalrusClient**(`__namedParameters?`): `ClientWithExtensions`\<\{ `walrus`: `WalrusClient`; \}, `SuiGrpcClient`\>
|
|
4
|
+
|
|
5
|
+
Defined in: @meddleware/walrus-client/src/client.ts:116
|
|
6
|
+
|
|
7
|
+
Create a Walrus client pre-configured for the given network and relay options.
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
### \_\_namedParameters?
|
|
12
|
+
|
|
13
|
+
[`CreateWalrusClientOptions`](../type-aliases/CreateWalrusClientOptions.md) = `{}`
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`ClientWithExtensions`\<\{ `walrus`: `WalrusClient`; \}, `SuiGrpcClient`\>
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
const client = createWalrusClient({ network: 'testnet' })
|
|
23
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Function: estimateStorageCost()
|
|
2
|
+
|
|
3
|
+
> **estimateStorageCost**(`client`, `size`, `epochs`): `Promise`\<[`StorageCost`](../interfaces/StorageCost.md)\>
|
|
4
|
+
|
|
5
|
+
Defined in: @meddleware/walrus-client/src/manage.ts:124
|
|
6
|
+
|
|
7
|
+
Estimate the on-chain storage cost of a blob, so the UI can price a chosen reservation or extension
|
|
8
|
+
duration. Thin wrapper over the SDK's `walrus.storageCost(size, epochs)` — kept here so Vue layers
|
|
9
|
+
(which must not import `@mysten/walrus`) can price durations through the injected client.
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
### client
|
|
14
|
+
|
|
15
|
+
`ClientWithExtensions`
|
|
16
|
+
|
|
17
|
+
A Walrus-extended client.
|
|
18
|
+
|
|
19
|
+
### size
|
|
20
|
+
|
|
21
|
+
`number`
|
|
22
|
+
|
|
23
|
+
Unencoded blob size in bytes.
|
|
24
|
+
|
|
25
|
+
### epochs
|
|
26
|
+
|
|
27
|
+
`number`
|
|
28
|
+
|
|
29
|
+
Number of epochs to price (reservation length, or epochs added on extend).
|
|
30
|
+
|
|
31
|
+
## Returns
|
|
32
|
+
|
|
33
|
+
`Promise`\<[`StorageCost`](../interfaces/StorageCost.md)\>
|
|
34
|
+
|
|
35
|
+
Storage/write/total cost in MIST.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Function: extendBlobLifetime()
|
|
2
|
+
|
|
3
|
+
> **extendBlobLifetime**(`client`, `blobObjectId`, `signer`, `options`): `Promise`\<\{ `digest`: `string`; \}\>
|
|
4
|
+
|
|
5
|
+
Defined in: @meddleware/walrus-client/src/manage.ts:39
|
|
6
|
+
|
|
7
|
+
Extend a blob's storage lifetime on-chain (Node.js — signs and executes).
|
|
8
|
+
Since Walrus blobs expire, call this before expiry to prevent data loss.
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
### client
|
|
13
|
+
|
|
14
|
+
`ClientWithExtensions`
|
|
15
|
+
|
|
16
|
+
A Walrus-extended client.
|
|
17
|
+
|
|
18
|
+
### blobObjectId
|
|
19
|
+
|
|
20
|
+
`string`
|
|
21
|
+
|
|
22
|
+
The on-chain Blob object id (not the blob id).
|
|
23
|
+
|
|
24
|
+
### signer
|
|
25
|
+
|
|
26
|
+
`Signer`
|
|
27
|
+
|
|
28
|
+
The keypair paying for and authorising the extension.
|
|
29
|
+
|
|
30
|
+
### options
|
|
31
|
+
|
|
32
|
+
[`ExtendOptions`](../type-aliases/ExtendOptions.md)
|
|
33
|
+
|
|
34
|
+
Add `epochs` more, or extend to an absolute `endEpoch`.
|
|
35
|
+
|
|
36
|
+
## Returns
|
|
37
|
+
|
|
38
|
+
`Promise`\<\{ `digest`: `string`; \}\>
|
|
39
|
+
|
|
40
|
+
The executed transaction digest.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Function: extendBlobLifetimeTransaction()
|
|
2
|
+
|
|
3
|
+
> **extendBlobLifetimeTransaction**(`client`, `blobObjectId`, `options`): `Promise`\<`Transaction`\>
|
|
4
|
+
|
|
5
|
+
Defined in: @meddleware/walrus-client/src/manage.ts:62
|
|
6
|
+
|
|
7
|
+
Build (but do not sign) a blob-lifetime-extension transaction for a browser
|
|
8
|
+
wallet to sign. Browser counterpart of [extendBlobLifetime](extendBlobLifetime.md).
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
### client
|
|
13
|
+
|
|
14
|
+
`ClientWithExtensions`
|
|
15
|
+
|
|
16
|
+
A Walrus-extended client.
|
|
17
|
+
|
|
18
|
+
### blobObjectId
|
|
19
|
+
|
|
20
|
+
`string`
|
|
21
|
+
|
|
22
|
+
The on-chain Blob object id.
|
|
23
|
+
|
|
24
|
+
### options
|
|
25
|
+
|
|
26
|
+
[`ExtendOptions`](../type-aliases/ExtendOptions.md)
|
|
27
|
+
|
|
28
|
+
Add `epochs` more, or extend to an absolute `endEpoch`.
|
|
29
|
+
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
`Promise`\<`Transaction`\>
|
|
33
|
+
|
|
34
|
+
An unsigned `Transaction`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Function: fetchOwnedWalrusBlobs()
|
|
2
|
+
|
|
3
|
+
> **fetchOwnedWalrusBlobs**(`suiClient`, `walrusClient`, `owner`): `Promise`\<[`OwnedBlob`](../type-aliases/OwnedBlob.md)[]\>
|
|
4
|
+
|
|
5
|
+
Defined in: @meddleware/walrus-client/src/query.ts:41
|
|
6
|
+
|
|
7
|
+
Return all Walrus blobs owned by `owner`. Resolves the on-chain Blob struct
|
|
8
|
+
type dynamically via `getBlobType()`, so no package addresses are hardcoded.
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
### suiClient
|
|
13
|
+
|
|
14
|
+
`ClientWithCoreApi`
|
|
15
|
+
|
|
16
|
+
A Sui client exposing the unified core API (`SuiGrpcClient`).
|
|
17
|
+
|
|
18
|
+
### walrusClient
|
|
19
|
+
|
|
20
|
+
`ClientWithExtensions`
|
|
21
|
+
|
|
22
|
+
A Walrus-extended client (see [createWalrusClient](createWalrusClient.md)).
|
|
23
|
+
|
|
24
|
+
### owner
|
|
25
|
+
|
|
26
|
+
`string`
|
|
27
|
+
|
|
28
|
+
The address whose owned blobs to enumerate.
|
|
29
|
+
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
`Promise`\<[`OwnedBlob`](../type-aliases/OwnedBlob.md)[]\>
|
|
33
|
+
|
|
34
|
+
The owner's blobs; entries whose fields cannot be parsed are skipped.
|