@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,27 @@
|
|
|
1
|
+
# Function: fetchAccessNftById()
|
|
2
|
+
|
|
3
|
+
> **fetchAccessNftById**(`client`, `objectId`): `Promise`\<[`OwnedAccessNft`](../interfaces/OwnedAccessNft.md)\>
|
|
4
|
+
|
|
5
|
+
Defined in: ownership.ts:68
|
|
6
|
+
|
|
7
|
+
Typed single-object read of one access NFT by id (`getObject` with `showType`+`showContent`),
|
|
8
|
+
used when a UI needs the **exact** `usesRemaining` reliably rather than the best-effort parse
|
|
9
|
+
of an owned-objects page. Returns `null` if the object is missing or not an access NFT.
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
### client
|
|
14
|
+
|
|
15
|
+
[`SuiObjectClient`](../interfaces/SuiObjectClient.md)
|
|
16
|
+
|
|
17
|
+
### objectId
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`Promise`\<[`OwnedAccessNft`](../interfaces/OwnedAccessNft.md)\>
|
|
24
|
+
|
|
25
|
+
## Throws
|
|
26
|
+
|
|
27
|
+
if the RPC call fails at the network or transport layer.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Function: fetchAccessNfts()
|
|
2
|
+
|
|
3
|
+
> **fetchAccessNfts**(`client`, `owner`, `nftType`, `gateId?`): `Promise`\<[`OwnedAccessNft`](../interfaces/OwnedAccessNft.md)[]\>
|
|
4
|
+
|
|
5
|
+
Defined in: ownership.ts:82
|
|
6
|
+
|
|
7
|
+
Fetch all access NFTs of `nftType` owned by `owner`, optionally restricted to a specific
|
|
8
|
+
`gateId`. Uses `getOwnedObjects` filtered by `StructType` (the standard owned-objects query).
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
### client
|
|
13
|
+
|
|
14
|
+
[`OwnedObjectsClient`](../interfaces/OwnedObjectsClient.md)
|
|
15
|
+
|
|
16
|
+
### owner
|
|
17
|
+
|
|
18
|
+
`string`
|
|
19
|
+
|
|
20
|
+
### nftType
|
|
21
|
+
|
|
22
|
+
`string`
|
|
23
|
+
|
|
24
|
+
### gateId?
|
|
25
|
+
|
|
26
|
+
`string`
|
|
27
|
+
|
|
28
|
+
## Returns
|
|
29
|
+
|
|
30
|
+
`Promise`\<[`OwnedAccessNft`](../interfaces/OwnedAccessNft.md)[]\>
|
|
31
|
+
|
|
32
|
+
## Throws
|
|
33
|
+
|
|
34
|
+
if the RPC call fails at the network or transport layer.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Function: fetchAdminCaps()
|
|
2
|
+
|
|
3
|
+
> **fetchAdminCaps**(`client`, `owner`, `packageId`): `Promise`\<`object`[]\>
|
|
4
|
+
|
|
5
|
+
Defined in: ownership.ts:171
|
|
6
|
+
|
|
7
|
+
List the `{ adminCapId, gateId }` pairs for every `access_gate::AdminCap` owned by `owner`
|
|
8
|
+
under `packageId`. Uses `getOwnedObjects` filtered by `StructType` (the standard query).
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
### client
|
|
13
|
+
|
|
14
|
+
[`OwnedObjectsClient`](../interfaces/OwnedObjectsClient.md)
|
|
15
|
+
|
|
16
|
+
### owner
|
|
17
|
+
|
|
18
|
+
`string`
|
|
19
|
+
|
|
20
|
+
### packageId
|
|
21
|
+
|
|
22
|
+
`string`
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
`Promise`\<`object`[]\>
|
|
27
|
+
|
|
28
|
+
## Throws
|
|
29
|
+
|
|
30
|
+
if the underlying RPC call fails.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Function: fetchChallenge()
|
|
2
|
+
|
|
3
|
+
> **fetchChallenge**(`gatewayHost`, `opts?`): `Promise`\<[`Challenge`](../interfaces/Challenge.md)\>
|
|
4
|
+
|
|
5
|
+
Defined in: challenge.ts:10
|
|
6
|
+
|
|
7
|
+
Fetch a fresh challenge from a gateway's `GET /v1/challenge` endpoint. Tolerates both
|
|
8
|
+
`expiresAt` (camelCase) and `expires_at` (snake_case) response shapes.
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
### gatewayHost
|
|
13
|
+
|
|
14
|
+
`string`
|
|
15
|
+
|
|
16
|
+
### opts?
|
|
17
|
+
|
|
18
|
+
#### signal?
|
|
19
|
+
|
|
20
|
+
`AbortSignal`
|
|
21
|
+
|
|
22
|
+
## Returns
|
|
23
|
+
|
|
24
|
+
`Promise`\<[`Challenge`](../interfaces/Challenge.md)\>
|
|
25
|
+
|
|
26
|
+
## Throws
|
|
27
|
+
|
|
28
|
+
if the network request fails or the gateway returns a non-2xx status.
|
|
29
|
+
|
|
30
|
+
## Throws
|
|
31
|
+
|
|
32
|
+
if the response body is missing the required `nonce` field.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Function: fetchGate()
|
|
2
|
+
|
|
3
|
+
> **fetchGate**(`client`, `gateId`): `Promise`\<`Omit`\<[`OwnedGate`](../interfaces/OwnedGate.md), `"adminCapId"`\>\>
|
|
4
|
+
|
|
5
|
+
Defined in: ownership.ts:192
|
|
6
|
+
|
|
7
|
+
Typed single-object read of one `Gate` by id, returning its parsed state (without `adminCapId`).
|
|
8
|
+
Returns `null` if the object is missing or not a `Gate`.
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
### client
|
|
13
|
+
|
|
14
|
+
[`SuiObjectClient`](../interfaces/SuiObjectClient.md)
|
|
15
|
+
|
|
16
|
+
### gateId
|
|
17
|
+
|
|
18
|
+
`string`
|
|
19
|
+
|
|
20
|
+
## Returns
|
|
21
|
+
|
|
22
|
+
`Promise`\<`Omit`\<[`OwnedGate`](../interfaces/OwnedGate.md), `"adminCapId"`\>\>
|
|
23
|
+
|
|
24
|
+
## Throws
|
|
25
|
+
|
|
26
|
+
if the RPC call fails at the network or transport layer.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: fetchOwnedGates()
|
|
2
|
+
|
|
3
|
+
> **fetchOwnedGates**(`client`, `owner`, `packageId`): `Promise`\<[`OwnedGate`](../interfaces/OwnedGate.md)[]\>
|
|
4
|
+
|
|
5
|
+
Defined in: ownership.ts:207
|
|
6
|
+
|
|
7
|
+
Fetch every gate `owner` administers: list their owned `AdminCap`s, then fetch each referenced
|
|
8
|
+
`Gate` shared object and merge in the owning `adminCapId`. Gates whose object can no longer be
|
|
9
|
+
read (e.g. deleted) are skipped.
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
### client
|
|
14
|
+
|
|
15
|
+
[`OwnedObjectsClient`](../interfaces/OwnedObjectsClient.md) & [`SuiObjectClient`](../interfaces/SuiObjectClient.md)
|
|
16
|
+
|
|
17
|
+
### owner
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
### packageId
|
|
22
|
+
|
|
23
|
+
`string`
|
|
24
|
+
|
|
25
|
+
## Returns
|
|
26
|
+
|
|
27
|
+
`Promise`\<[`OwnedGate`](../interfaces/OwnedGate.md)[]\>
|
|
28
|
+
|
|
29
|
+
## Throws
|
|
30
|
+
|
|
31
|
+
if an underlying RPC call fails at the network or transport layer.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Function: ownsAccessNft()
|
|
2
|
+
|
|
3
|
+
> **ownsAccessNft**(`client`, `owner`, `nftType`, `gateId?`): `Promise`\<`boolean`\>
|
|
4
|
+
|
|
5
|
+
Defined in: ownership.ts:106
|
|
6
|
+
|
|
7
|
+
True if `owner` holds at least one access NFT of `nftType` (optionally for `gateId`).
|
|
8
|
+
This is the cheap check a frontend runs to decide whether to show a gated option, and a
|
|
9
|
+
gateway runs (server-side) as part of access verification.
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
### client
|
|
14
|
+
|
|
15
|
+
[`OwnedObjectsClient`](../interfaces/OwnedObjectsClient.md)
|
|
16
|
+
|
|
17
|
+
### owner
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
### nftType
|
|
22
|
+
|
|
23
|
+
`string`
|
|
24
|
+
|
|
25
|
+
### gateId?
|
|
26
|
+
|
|
27
|
+
`string`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`Promise`\<`boolean`\>
|
|
32
|
+
|
|
33
|
+
## Throws
|
|
34
|
+
|
|
35
|
+
if the underlying RPC call fails.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Function: parseAdminCap()
|
|
2
|
+
|
|
3
|
+
> **parseAdminCap**(`entry`): `object`
|
|
4
|
+
|
|
5
|
+
Defined in: ownership.ts:129
|
|
6
|
+
|
|
7
|
+
Parse a single `getOwnedObjects`/`getObject` entry into `{ adminCapId, gateId }`, or `null` if
|
|
8
|
+
it is not an `AdminCap`. Validates the object **type** when present and reads `fields.gate_id`.
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
### entry
|
|
13
|
+
|
|
14
|
+
`any`
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
`object`
|
|
19
|
+
|
|
20
|
+
### adminCapId
|
|
21
|
+
|
|
22
|
+
> **adminCapId**: `string`
|
|
23
|
+
|
|
24
|
+
### gateId
|
|
25
|
+
|
|
26
|
+
> **gateId**: `string`
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Function: parseGate()
|
|
2
|
+
|
|
3
|
+
> **parseGate**(`entry`): `Omit`\<[`OwnedGate`](../interfaces/OwnedGate.md), `"adminCapId"`\>
|
|
4
|
+
|
|
5
|
+
Defined in: ownership.ts:145
|
|
6
|
+
|
|
7
|
+
Parse a `getObject` entry for a `Gate` shared object into an [OwnedGate](../interfaces/OwnedGate.md) (minus
|
|
8
|
+
`adminCapId`, which comes from the owning cap). Returns `null` if the object is missing its
|
|
9
|
+
expected `Gate` fields.
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
### entry
|
|
14
|
+
|
|
15
|
+
`any`
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
`Omit`\<[`OwnedGate`](../interfaces/OwnedGate.md), `"adminCapId"`\>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Function: parseOwnedAccessNft()
|
|
2
|
+
|
|
3
|
+
> **parseOwnedAccessNft**(`entry`): [`OwnedAccessNft`](../interfaces/OwnedAccessNft.md)
|
|
4
|
+
|
|
5
|
+
Defined in: ownership.ts:44
|
|
6
|
+
|
|
7
|
+
Parse a single core-API object (a `listOwnedObjects` item or a `getObject`'s `{ object }`) into
|
|
8
|
+
an [OwnedAccessNft](../interfaces/OwnedAccessNft.md), or `null` if it is not an access NFT. Validates the object **type**
|
|
9
|
+
when present (typed), and reads the nested `data` fields deterministically.
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
### entry
|
|
14
|
+
|
|
15
|
+
`any`
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
[`OwnedAccessNft`](../interfaces/OwnedAccessNft.md)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Function: personalMessageForNonce()
|
|
2
|
+
|
|
3
|
+
> **personalMessageForNonce**(`nonce`): `Uint8Array`
|
|
4
|
+
|
|
5
|
+
Defined in: proof.ts:7
|
|
6
|
+
|
|
7
|
+
The exact bytes a wallet signs (as a personal message) to answer a challenge. Both the
|
|
8
|
+
client (signing) and the gateway (verifying) MUST derive the message identically.
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
### nonce
|
|
13
|
+
|
|
14
|
+
`string`
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
`Uint8Array`
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# NFT-gate client API
|
|
2
|
+
|
|
3
|
+
## Interfaces
|
|
4
|
+
|
|
5
|
+
- [AccessGateConfig](interfaces/AccessGateConfig.md)
|
|
6
|
+
- [AccessProof](interfaces/AccessProof.md)
|
|
7
|
+
- [Challenge](interfaces/Challenge.md)
|
|
8
|
+
- [GateAdminContext](interfaces/GateAdminContext.md)
|
|
9
|
+
- [OwnedAccessNft](interfaces/OwnedAccessNft.md)
|
|
10
|
+
- [OwnedGate](interfaces/OwnedGate.md)
|
|
11
|
+
- [OwnedObjectsClient](interfaces/OwnedObjectsClient.md)
|
|
12
|
+
- [SuiObjectClient](interfaces/SuiObjectClient.md)
|
|
13
|
+
|
|
14
|
+
## Type Aliases
|
|
15
|
+
|
|
16
|
+
- [PersonalMessageSigner](type-aliases/PersonalMessageSigner.md)
|
|
17
|
+
|
|
18
|
+
## Functions
|
|
19
|
+
|
|
20
|
+
- [buildAccessProof](functions/buildAccessProof.md)
|
|
21
|
+
- [buildAirdropTx](functions/buildAirdropTx.md)
|
|
22
|
+
- [buildConsumeTx](functions/buildConsumeTx.md)
|
|
23
|
+
- [buildCreateGateTx](functions/buildCreateGateTx.md)
|
|
24
|
+
- [buildMakeGateImmutableTx](functions/buildMakeGateImmutableTx.md)
|
|
25
|
+
- [buildPurchaseTx](functions/buildPurchaseTx.md)
|
|
26
|
+
- [buildSetAutoBurnAtZeroTx](functions/buildSetAutoBurnAtZeroTx.md)
|
|
27
|
+
- [buildSetDefaultUsesTx](functions/buildSetDefaultUsesTx.md)
|
|
28
|
+
- [buildSetNftDescriptionTx](functions/buildSetNftDescriptionTx.md)
|
|
29
|
+
- [buildSetNftImageUrlTx](functions/buildSetNftImageUrlTx.md)
|
|
30
|
+
- [buildSetNftNameTx](functions/buildSetNftNameTx.md)
|
|
31
|
+
- [buildSetPausedTx](functions/buildSetPausedTx.md)
|
|
32
|
+
- [buildSetPaymentRecipientTx](functions/buildSetPaymentRecipientTx.md)
|
|
33
|
+
- [buildSetPriceTx](functions/buildSetPriceTx.md)
|
|
34
|
+
- [buildSetSoulboundTx](functions/buildSetSoulboundTx.md)
|
|
35
|
+
- [decodeAccessProof](functions/decodeAccessProof.md)
|
|
36
|
+
- [encodeAccessProof](functions/encodeAccessProof.md)
|
|
37
|
+
- [fetchAccessNftById](functions/fetchAccessNftById.md)
|
|
38
|
+
- [fetchAccessNfts](functions/fetchAccessNfts.md)
|
|
39
|
+
- [fetchAdminCaps](functions/fetchAdminCaps.md)
|
|
40
|
+
- [fetchChallenge](functions/fetchChallenge.md)
|
|
41
|
+
- [fetchGate](functions/fetchGate.md)
|
|
42
|
+
- [fetchOwnedGates](functions/fetchOwnedGates.md)
|
|
43
|
+
- [ownsAccessNft](functions/ownsAccessNft.md)
|
|
44
|
+
- [parseAdminCap](functions/parseAdminCap.md)
|
|
45
|
+
- [parseGate](functions/parseGate.md)
|
|
46
|
+
- [parseOwnedAccessNft](functions/parseOwnedAccessNft.md)
|
|
47
|
+
- [personalMessageForNonce](functions/personalMessageForNonce.md)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Interface: AccessGateConfig
|
|
2
|
+
|
|
3
|
+
Defined in: types.ts:9
|
|
4
|
+
|
|
5
|
+
Identifies a deployed gate and the NFT type that satisfies it.
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
### gateId
|
|
10
|
+
|
|
11
|
+
> **gateId**: `string`
|
|
12
|
+
|
|
13
|
+
Defined in: types.ts:13
|
|
14
|
+
|
|
15
|
+
The shared `Gate` object ID.
|
|
16
|
+
|
|
17
|
+
***
|
|
18
|
+
|
|
19
|
+
### nftType
|
|
20
|
+
|
|
21
|
+
> **nftType**: `string`
|
|
22
|
+
|
|
23
|
+
Defined in: types.ts:21
|
|
24
|
+
|
|
25
|
+
Fully-qualified NFT type string to filter ownership by, e.g.
|
|
26
|
+
`<pkg>::access_gate::AccessNFT` or `<pkg>::access_gate::SoulboundAccessNFT`.
|
|
27
|
+
Choose the variant matching the gate's `soulbound` flag.
|
|
28
|
+
|
|
29
|
+
***
|
|
30
|
+
|
|
31
|
+
### packageId
|
|
32
|
+
|
|
33
|
+
> **packageId**: `string`
|
|
34
|
+
|
|
35
|
+
Defined in: types.ts:11
|
|
36
|
+
|
|
37
|
+
Published `access_gate` package ID.
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
41
|
+
### platformConfigId
|
|
42
|
+
|
|
43
|
+
> **platformConfigId**: `string`
|
|
44
|
+
|
|
45
|
+
Defined in: types.ts:15
|
|
46
|
+
|
|
47
|
+
The shared `PlatformConfig` object ID. Required for `buildPurchaseTx`.
|
|
48
|
+
|
|
49
|
+
***
|
|
50
|
+
|
|
51
|
+
### soulbound?
|
|
52
|
+
|
|
53
|
+
> `optional` **soulbound?**: `boolean`
|
|
54
|
+
|
|
55
|
+
Defined in: types.ts:23
|
|
56
|
+
|
|
57
|
+
Whether this gate mints soulbound NFTs (selects `consume` vs `consume_soulbound`).
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Interface: AccessProof
|
|
2
|
+
|
|
3
|
+
Defined in: types.ts:77
|
|
4
|
+
|
|
5
|
+
The proof a client presents to a gateway to demonstrate gated access.
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
### address
|
|
10
|
+
|
|
11
|
+
> **address**: `string`
|
|
12
|
+
|
|
13
|
+
Defined in: types.ts:79
|
|
14
|
+
|
|
15
|
+
The Sui address claimed by the caller.
|
|
16
|
+
|
|
17
|
+
***
|
|
18
|
+
|
|
19
|
+
### consumeDigest?
|
|
20
|
+
|
|
21
|
+
> `optional` **consumeDigest?**: `string`
|
|
22
|
+
|
|
23
|
+
Defined in: types.ts:88
|
|
24
|
+
|
|
25
|
+
For single-use gates: the digest of the on-chain `consume(nft, nonce)` transaction, so
|
|
26
|
+
the gateway can confirm the matching `AccessConsumedEvent` before allowing the request.
|
|
27
|
+
|
|
28
|
+
***
|
|
29
|
+
|
|
30
|
+
### nonce
|
|
31
|
+
|
|
32
|
+
> **nonce**: `string`
|
|
33
|
+
|
|
34
|
+
Defined in: types.ts:81
|
|
35
|
+
|
|
36
|
+
The challenge nonce that was signed.
|
|
37
|
+
|
|
38
|
+
***
|
|
39
|
+
|
|
40
|
+
### signature
|
|
41
|
+
|
|
42
|
+
> **signature**: `string`
|
|
43
|
+
|
|
44
|
+
Defined in: types.ts:83
|
|
45
|
+
|
|
46
|
+
Base64 personal-message signature over [personalMessageForNonce](../functions/personalMessageForNonce.md).
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Interface: Challenge
|
|
2
|
+
|
|
3
|
+
Defined in: types.ts:69
|
|
4
|
+
|
|
5
|
+
A server-issued, time-bound challenge the wallet signs to prove control of an address.
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
### expiresAt
|
|
10
|
+
|
|
11
|
+
> **expiresAt**: `number`
|
|
12
|
+
|
|
13
|
+
Defined in: types.ts:73
|
|
14
|
+
|
|
15
|
+
Unix epoch milliseconds after which the challenge is rejected.
|
|
16
|
+
|
|
17
|
+
***
|
|
18
|
+
|
|
19
|
+
### nonce
|
|
20
|
+
|
|
21
|
+
> **nonce**: `string`
|
|
22
|
+
|
|
23
|
+
Defined in: types.ts:71
|
|
24
|
+
|
|
25
|
+
Opaque nonce (as issued by the gateway; treated as a UTF-8 string end-to-end).
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Interface: GateAdminContext
|
|
2
|
+
|
|
3
|
+
Defined in: types.ts:31
|
|
4
|
+
|
|
5
|
+
Identifies a gate an operator administers, for the AdminCap-gated management PTB builders
|
|
6
|
+
(setters, airdrop, freeze). The three ids together authorise a call: `adminCapId` must be the
|
|
7
|
+
`AdminCap` whose `gate_id` matches `gateId`, under the published `packageId`.
|
|
8
|
+
|
|
9
|
+
## Properties
|
|
10
|
+
|
|
11
|
+
### adminCapId
|
|
12
|
+
|
|
13
|
+
> **adminCapId**: `string`
|
|
14
|
+
|
|
15
|
+
Defined in: types.ts:37
|
|
16
|
+
|
|
17
|
+
The `AdminCap` object ID authorised over `gateId` (held by the operator).
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### gateId
|
|
22
|
+
|
|
23
|
+
> **gateId**: `string`
|
|
24
|
+
|
|
25
|
+
Defined in: types.ts:35
|
|
26
|
+
|
|
27
|
+
The shared `Gate` object ID being administered.
|
|
28
|
+
|
|
29
|
+
***
|
|
30
|
+
|
|
31
|
+
### packageId
|
|
32
|
+
|
|
33
|
+
> **packageId**: `string`
|
|
34
|
+
|
|
35
|
+
Defined in: types.ts:33
|
|
36
|
+
|
|
37
|
+
Published `access_gate` package ID.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Interface: OwnedAccessNft
|
|
2
|
+
|
|
3
|
+
Defined in: types.ts:92
|
|
4
|
+
|
|
5
|
+
A parsed owned access NFT.
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
### gateId
|
|
10
|
+
|
|
11
|
+
> **gateId**: `string`
|
|
12
|
+
|
|
13
|
+
Defined in: types.ts:94
|
|
14
|
+
|
|
15
|
+
***
|
|
16
|
+
|
|
17
|
+
### objectId
|
|
18
|
+
|
|
19
|
+
> **objectId**: `string`
|
|
20
|
+
|
|
21
|
+
Defined in: types.ts:93
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### usesRemaining
|
|
26
|
+
|
|
27
|
+
> **usesRemaining**: `number`
|
|
28
|
+
|
|
29
|
+
Defined in: types.ts:96
|
|
30
|
+
|
|
31
|
+
`null` for an unlimited pass; otherwise remaining single-use count.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Interface: OwnedGate
|
|
2
|
+
|
|
3
|
+
Defined in: types.ts:41
|
|
4
|
+
|
|
5
|
+
A gate an operator administers, parsed from its on-chain `Gate` object + owning `AdminCap`.
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
### adminCapId
|
|
10
|
+
|
|
11
|
+
> **adminCapId**: `string`
|
|
12
|
+
|
|
13
|
+
Defined in: types.ts:45
|
|
14
|
+
|
|
15
|
+
The `AdminCap` object ID that authorises administering this gate.
|
|
16
|
+
|
|
17
|
+
***
|
|
18
|
+
|
|
19
|
+
### autoBurnAtZero
|
|
20
|
+
|
|
21
|
+
> **autoBurnAtZero**: `boolean`
|
|
22
|
+
|
|
23
|
+
Defined in: types.ts:55
|
|
24
|
+
|
|
25
|
+
Whether a single-use NFT is deleted (vs. kept as a receipt) at zero uses.
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
29
|
+
### defaultUses
|
|
30
|
+
|
|
31
|
+
> **defaultUses**: `bigint`
|
|
32
|
+
|
|
33
|
+
Defined in: types.ts:51
|
|
34
|
+
|
|
35
|
+
0 ⇒ unlimited passes; N ⇒ single-use NFTs with N uses.
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
### frozen
|
|
40
|
+
|
|
41
|
+
> **frozen**: `boolean`
|
|
42
|
+
|
|
43
|
+
Defined in: types.ts:59
|
|
44
|
+
|
|
45
|
+
Whether the gate has been made immutable (all admin/airdrop permanently disabled).
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### gateId
|
|
50
|
+
|
|
51
|
+
> **gateId**: `string`
|
|
52
|
+
|
|
53
|
+
Defined in: types.ts:43
|
|
54
|
+
|
|
55
|
+
The shared `Gate` object ID.
|
|
56
|
+
|
|
57
|
+
***
|
|
58
|
+
|
|
59
|
+
### nftDescription
|
|
60
|
+
|
|
61
|
+
> **nftDescription**: `string`
|
|
62
|
+
|
|
63
|
+
Defined in: types.ts:65
|
|
64
|
+
|
|
65
|
+
Default NFT description minted into future NFTs.
|
|
66
|
+
|
|
67
|
+
***
|
|
68
|
+
|
|
69
|
+
### nftImageUrl
|
|
70
|
+
|
|
71
|
+
> **nftImageUrl**: `string`
|
|
72
|
+
|
|
73
|
+
Defined in: types.ts:63
|
|
74
|
+
|
|
75
|
+
Default NFT image URL minted into future NFTs.
|
|
76
|
+
|
|
77
|
+
***
|
|
78
|
+
|
|
79
|
+
### nftName
|
|
80
|
+
|
|
81
|
+
> **nftName**: `string`
|
|
82
|
+
|
|
83
|
+
Defined in: types.ts:61
|
|
84
|
+
|
|
85
|
+
Default NFT display name minted into future NFTs.
|
|
86
|
+
|
|
87
|
+
***
|
|
88
|
+
|
|
89
|
+
### paused
|
|
90
|
+
|
|
91
|
+
> **paused**: `boolean`
|
|
92
|
+
|
|
93
|
+
Defined in: types.ts:57
|
|
94
|
+
|
|
95
|
+
Whether `purchase` is currently disabled.
|
|
96
|
+
|
|
97
|
+
***
|
|
98
|
+
|
|
99
|
+
### paymentRecipient
|
|
100
|
+
|
|
101
|
+
> **paymentRecipient**: `string`
|
|
102
|
+
|
|
103
|
+
Defined in: types.ts:49
|
|
104
|
+
|
|
105
|
+
Address that receives the operator share of each paid `purchase`.
|
|
106
|
+
|
|
107
|
+
***
|
|
108
|
+
|
|
109
|
+
### priceMist
|
|
110
|
+
|
|
111
|
+
> **priceMist**: `bigint`
|
|
112
|
+
|
|
113
|
+
Defined in: types.ts:47
|
|
114
|
+
|
|
115
|
+
Price in MIST charged by `purchase` (0 = free).
|
|
116
|
+
|
|
117
|
+
***
|
|
118
|
+
|
|
119
|
+
### soulbound
|
|
120
|
+
|
|
121
|
+
> **soulbound**: `boolean`
|
|
122
|
+
|
|
123
|
+
Defined in: types.ts:53
|
|
124
|
+
|
|
125
|
+
Whether newly-minted NFTs are soulbound.
|