Skip to content

Commit

Permalink
[docs] Updated docs (#142)
Browse files Browse the repository at this point in the history
* Updated docs
* updated logo, color defs
  • Loading branch information
ronny-mysten authored Jun 26, 2024
1 parent 22fbce8 commit d9c6d1b
Show file tree
Hide file tree
Showing 50 changed files with 303 additions and 11,574 deletions.
39 changes: 39 additions & 0 deletions documentation/components/player.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React, { useState, useEffect } from 'react'
import ReactPlayer from 'react-player/lazy'

const Player = ({ videoFilename }) => {
const [hasWindow, setHasWindow] = useState(false);
const [duration, setDuration] = useState();
const videoUrl = `/videos/${videoFilename.replace('.mp4', '')}.mp4`;
const thumbnailUrl = `/videos/thumbnails/${videoFilename.replace('.mp4', '')}.png`;

const handleDuration = (time) => {
setDuration(time);
}

useEffect(() => {
if (typeof window !== "undefined") {
setHasWindow(true);
}
}, []);

return (
<div>
<p className="py-4">Watch this quick {duration && <span>{Math.floor(duration)} second</span>} clip to see how.</p>
<div className='relative pt-[56.25%]'>
{hasWindow && <ReactPlayer
className='absolute top-0 left-0'
url={videoUrl}
controls={true}
light={thumbnailUrl}
playing={true}
width='100%'
height='100%'
onDuration={handleDuration}
/>}
</div>
</div>
)
}

export default Player;
1 change: 1 addition & 0 deletions documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"postcss": "^8.4.38",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-player": "^2.16.0",
"tailwindcss": "^3.4.3"
}
}
9 changes: 3 additions & 6 deletions documentation/pages/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"index": "SuiNS Documentation",
"integration": "Integration",
"subnames": "Subnames",
"indexing": "Indexing",
"sdk": "SuiNS SDK",
"examples": "Examples",
"dashbaord": {
"developer": "Developer",
"user": "User",
"dashboard": {
"title": "SuiNS Dashboard ↗",
"type": "page",
"href": "https://suins.io/",
Expand Down
62 changes: 62 additions & 0 deletions documentation/pages/developer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { Tabs } from 'nextra/components'
import { Callout } from 'nextra/components'

# Sui Name Service Developer Documentation

Integrate Sui Name Service (SuiNS) with your projects using either on-chain or off-chain resolutions, depending on your particular use case.

## Active constants

This is a list of the current active objects to interact with SuiNS.

<Callout type="info" emoji="ℹ️">
Look here for the latest state, as some active constants might change.
These changes come from secondary packages responsible for registering a name, renewing a name, and associated utilities.
The core package cannot change, nor can the core SuiNS object.
</Callout>

<Tabs items={['Mainnet', 'Testnet']}>
<Tabs.Tab>
SuiNS deploys, authorizes, and maintains the following packages on Mainnet.
<Tabs items={['Packages', 'Objects']}>
<Tabs.Tab>
| Kind | Package Id |
|-------------- |---------------------------------------------------------------------- |
| SuiNS Core V3 | `0x00c2f85e07181b90c140b15c5ce27d863f93c4d9159d2a4e7bdaeb40e286d6f5` |
| SuiNS Core V2 | `0xb7004c7914308557f7afbaf0dca8dd258e18e306cb7a45b28019f3d0a693f162` |
| SuiNS Core V1 | `0xd22b24490e0bae52676651b4f56660a5ff8022a2576e0089f79b3c88d44e08f0` |
| Subnames | `0xe177697e191327901637f8d2c5ffbbde8b1aaac27ec1024c4b62d1ebd1cd7430` |
| Registration | `0x9d451fa0139fef8f7c1f0bd5d7e45b7fa9dbb84c2e63c2819c7abd0a7f7d749d` |
| Renewal | `0xd5e5f74126e7934e35991643b0111c3361827fc0564c83fa810668837c6f0b0f` |
| Utilities (setup) | `0xdac22652eb400beb1f5e2126459cae8eedc116b73b8ad60b71e3e8d7fdb317e2` |
| Discounts Package | `0x6a6ea140e095ddd82f7c745905054b3203129dd04a09d0375416c31161932d2d` |
</Tabs.Tab>
<Tabs.Tab>
| Kind | Object Id |
|-------------- |---------------------------------------------------------------------- |
| SuiNS Core Object | `0x6e0ddefc0ad98889c04bab9639e512c21766c5e6366f89e696956d9be6952871` |
| SuiNS Discounts | `0x7fdd883c0b7427f18cdb498c4c87a4a79d6bec4783cb3f21aa3816bbc64ce8ef` |
</Tabs.Tab>
</Tabs>
</Tabs.Tab>
<Tabs.Tab>
SuiNS deploys, authorizes, and maintains the following packages on Testnet.
<Tabs items={['Packages', 'Objects']}>
<Tabs.Tab>
| Kind | Package Id |
|-------------- |---------------------------------------------------------------------- |
| SuiNS Core | `0x22fa05f21b1ad71442491220bb9338f7b7095fe35000ef88d5400d28523bdd93` |
| Registration | `0x4255184a0143c0ce4394a3f16a6f5aa5d64507269e54e51ea396d569fe8f1ba5` |
| Renewal | `0x54800ebb4606fd0c03b4554976264373b3374eeb3fd63e7ff69f31cac786ba8c` |
| Utilities (setup) | `0x6ed81fd808a23eae2da488052334d50478b36527474fc99707c1aed0e43104b1` |
| Subnames | `0x3c272bc45f9157b7818ece4f7411bdfa8af46303b071aca4e18c03119c9ff636` |
| Subnames Proxy | `0x3489ab5dcd346afee8b681267bcab2583a5eba9855680ec9931355e50e21c148` |
</Tabs.Tab>
<Tabs.Tab>
| Kind | Object Id |
|-------------- |---------------------------------------------------------------------- |
| SuiNS Core Object | `0x300369e8909b9a6464da265b9a5a9ab6fe2158a040e84e808628cde7a07ee5a3` |
</Tabs.Tab>
</Tabs>
</Tabs.Tab>
</Tabs>
7 changes: 7 additions & 0 deletions documentation/pages/developer/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"integration": "Integration",
"subnames": "Subnames",
"indexing": "Indexing",
"sdk": "SuiNS SDK",
"examples": "Examples"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
60 changes: 2 additions & 58 deletions documentation/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,6 @@ import { Callout } from 'nextra/components'

# Sui Name Service Documentation

Sui Name Service documentation details how to integrate Sui Name Service (SuiNS) with you projects. This includes ways to integrate using both the on-chain resolution, as well as off-chain resolution, depending on the use case.
Sui Name Service (SuiNS) documentation is divided into two main sections: [**User**](./user.mdx) and [**Developer**](./developer.mdx). The **Developer** section provides integration details for adding Sui Name Service (SuiNS) to your projects. The **User** section provides instructions on how to use the SuiNS portal to register names and integrate them with your web3 identity.

The documentation is early in its development. As the site matures, the content will include instructions on how to use the SuiNS portal, as well.

## Active constants

This is a list of the current active objects to interact with SuiNS.

<Callout type="info" emoji="ℹ️">
It's recommended to look here for the latest state, as some of the active constants might be changed.
That mostly applies to secondary packages responsible for registering a name, renewing a name & utilities.
The core package cannot change, nor can the core SuiNS object.
</Callout>

<Tabs items={['Mainnet', 'Testnet']}>
<Tabs.Tab>
SuiNS deploys, authorizes, and maintains the following packages on Mainnet.
<Tabs items={['Packages', 'Objects']}>
<Tabs.Tab>
| Kind | Package Id |
|-------------- |---------------------------------------------------------------------- |
| SuiNS Core V3 | `0x00c2f85e07181b90c140b15c5ce27d863f93c4d9159d2a4e7bdaeb40e286d6f5` |
| SuiNS Core V2 | `0xb7004c7914308557f7afbaf0dca8dd258e18e306cb7a45b28019f3d0a693f162` |
| SuiNS Core V1 | `0xd22b24490e0bae52676651b4f56660a5ff8022a2576e0089f79b3c88d44e08f0` |
| Subnames | `0xe177697e191327901637f8d2c5ffbbde8b1aaac27ec1024c4b62d1ebd1cd7430` |
| Registration | `0x9d451fa0139fef8f7c1f0bd5d7e45b7fa9dbb84c2e63c2819c7abd0a7f7d749d` |
| Renewal | `0xd5e5f74126e7934e35991643b0111c3361827fc0564c83fa810668837c6f0b0f` |
| Utilities (setup) | `0xdac22652eb400beb1f5e2126459cae8eedc116b73b8ad60b71e3e8d7fdb317e2` |
| Discounts Package | `0x6a6ea140e095ddd82f7c745905054b3203129dd04a09d0375416c31161932d2d` |
</Tabs.Tab>
<Tabs.Tab>
| Kind | Object Id |
|-------------- |---------------------------------------------------------------------- |
| SuiNS Core Object | `0x6e0ddefc0ad98889c04bab9639e512c21766c5e6366f89e696956d9be6952871` |
| SuiNS Discounts | `0x7fdd883c0b7427f18cdb498c4c87a4a79d6bec4783cb3f21aa3816bbc64ce8ef` |
</Tabs.Tab>
</Tabs>
</Tabs.Tab>
<Tabs.Tab>
SuiNS deploys, authorizes, and maintains the following packages on Testnet.
<Tabs items={['Packages', 'Objects']}>
<Tabs.Tab>
| Kind | Package Id |
|-------------- |---------------------------------------------------------------------- |
| SuiNS Core | `0x22fa05f21b1ad71442491220bb9338f7b7095fe35000ef88d5400d28523bdd93` |
| Registration | `0x4255184a0143c0ce4394a3f16a6f5aa5d64507269e54e51ea396d569fe8f1ba5` |
| Renewal | `0x54800ebb4606fd0c03b4554976264373b3374eeb3fd63e7ff69f31cac786ba8c` |
| Utilities (setup) | `0x6ed81fd808a23eae2da488052334d50478b36527474fc99707c1aed0e43104b1` |
| Subnames | `0x3c272bc45f9157b7818ece4f7411bdfa8af46303b071aca4e18c03119c9ff636` |
| Subnames Proxy | `0x3489ab5dcd346afee8b681267bcab2583a5eba9855680ec9931355e50e21c148` |
</Tabs.Tab>
<Tabs.Tab>
| Kind | Object Id |
|-------------- |---------------------------------------------------------------------- |
| SuiNS Core Object | `0x300369e8909b9a6464da265b9a5a9ab6fe2158a040e84e808628cde7a07ee5a3` |
</Tabs.Tab>
</Tabs>
</Tabs.Tab>
</Tabs>
You can use the **SuiNS Dashboard** link in the top nav bar to jump over to SuiNS and register some names, or configure the ones you already own.
5 changes: 5 additions & 0 deletions documentation/pages/user.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Sui Name Service User Documentation

Build your on-chain identity in web3 with Sui Name Service (SuiNS). Using SuiNS, you can register a name (any name that isn't already registered) and use it for on-chain transactions.

You can use the **SuiNS Dashboard** link in the top nav bar to jump over to SuiNS and register some names, or configure the ones you already own.
7 changes: 7 additions & 0 deletions documentation/pages/user/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"registration": "Register Names",
"renew": "Renew Names",
"avatar": "Update Avatars",
"linked-address": "Link Addresses",
"sui-id": "sui.id"
}
29 changes: 29 additions & 0 deletions documentation/pages/user/avatar.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Update Avatars

import Player from '../../components/player';

Have a special NFT that you want to represent your identity on chain? After you [register a name](./registration.mdx), you can set the avatar to associate with that name.

## Show me how

<Player videoFilename="suins-howto-avatar"/>

## Tell me how

To assign an owned NFT to your SuiNS name:

1. Tap or click the **Connect Wallet** button in the upper right.

![Connect button](/images/ui/connect-btn.png)
If your wallet is already connected, your address or SuiNS name appears here instead.
1. Follow the prompts to connect your Sui or Stashed Wallet, if not already connected.
1. After connecting, the **Connect Wallet** button displays your address (or connected SuiNS default name). Tap or click the button to open the account dialog.
![Dialog](/images/ui/view-names.png)
1. Tap or click the **View names you own** button in the dialog. The **Names** view opens with a list of names associated with the connected account.
1. Hover your cursor over or tap the icon for the name you want to change and click the ellipses (...) that appears in the upper-right corner to open the context menu for the name.
1. Select **Personalize Avatar** from the menu to open the avatar dialog.
![Personalize avatar](/images/ui/personalize.png)
1. The dialog lists the NFTs for your address. Select the one you want to use and click **Update Avatar**.
![Update avatar](/images/ui/avatar.png)
1. Approve the transaction using your connected wallet. After the transaction completes, your avatar becomes associated with your address and appears with your SuiNS name wherever avatars are supported.
![Update avatar](/images/ui/avatar-login.png)
29 changes: 29 additions & 0 deletions documentation/pages/user/linked-address.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Linked Address

You can change the address that your SuiNS name resolves to. The original address that registered the SuiNS name retains control over its configuration, but the name points to the address you provide.

import Player from '../../components/player';

## Show me how

<Player videoFilename="suins-howto-linkedaddress"/>

## Tell me how

To link an address to your SuiNS name:

1. Tap or click the **Connect Wallet** button in the upper right.

![Connect button](/images/ui/connect-btn.png)
If your wallet is already connected, your address or SuiNS name appears here instead.
1. Follow the prompts to connect your Sui or Stashed Wallet, if not already connected.
1. After connecting, the **Connect Wallet** button displays your address (or connected SuiNS default name). Tap or click the button to open the account dialog.
![Dialog](/images/ui/view-names.png)
1. Tap or click the **View names you own** button in the dialog. The **Names** view opens with a list of names associated with the connected account.
1. Hover your cursor over or tap the icon for the name you want to change and click the ellipses (...) that appears in the upper-right corner to open the context menu for the name.
1. Select **Link To Wallet Address** from the menu to open the **Set Linked Address** dialog.
1. Type in the new address the name should resolve to in the **Enter Target Address** field. By default, the linked address is the address that registered the name. SuiNS warns you if you enter an address that has no on-chain transactions.
- If you previously changed the linked address, the dialog notifies you and displays a **Set your address** link to quickly set the address back to the one that registered the name.
1. Tap or click **Apply**. Alternatively, click **Cancel** to close the dialog without making any changes.
![Set linked name](/images/ui/set-linked.png)
1. Approve the transaction using your connected wallet. The address the name points to is updated, but the address that registered the name retains control of the SuiNS name and the SuiNS NFT remains in the wallet of the registered address, as well.
21 changes: 21 additions & 0 deletions documentation/pages/user/registration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Register Names

To enjoy the benefits of SuiNS, you must first register names. When you register available names, you purchase the rights to those names for one year. After registration, you can [renew your names](./renew.mdx) for multiple years.

import Player from '../../components/player';

## Show me how

<Player videoFilename="suins-howto-registration"/>

## Tell me how

To register a name:

1. Go to the [SuiNS site](https://suins.io/) and tap or click the name search bar to open the SuiNS search dialog. This search bar is available at the top of the site when navigating the dashboard.
![Name search](/images/ui/name-search.png)
1. Type a name of interest in the search field between 3 and 63 characters, inclusive. Press <kbd>Enter</kbd> or tap/click the magnifying glass icon to initiate the search. Search results show whether the name is available and the price in SUI for one year of registration.
1. Tap or click a name to open the **Register Name** dialog.
![Register name](/images/ui/register-name.png)
1. Tap or click the **Set as Default** toggle to identify whether the name should be default for the address, apply a coupon code if you have one, then tap or click **Register name**.
1. Approve the transaction using your connected wallet. If registration is successful, SuiNS opens the **Names** page of the dashboard. The new name appears in the list. If there's an error, fix the issue SuiNS raises and try again.
35 changes: 35 additions & 0 deletions documentation/pages/user/renew.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Renew Names

You can renew, or extend the expiration date, for any of your registered names for up to five years.

import Player from '../../components/player';

## Show me how

<Player videoFilename="suins-howto-renew"/>

## Tell me how

To renew registered names:

1. Tap or click the **Connect Wallet** button in the upper right.

![Connect button](/images/ui/connect-btn.png)
If your wallet is already connected, your address or SuiNS name appears here instead.
1. Follow the prompts to connect your Sui or Stashed Wallet, if not already connected.
1. After connecting, the **Connect Wallet** button displays your address (or connected SuiNS default name). Tap or click the button to open the account dialog.
![Dialog](/images/ui/view-names.png)
1. Tap or click the **View names you own** button in the dialog. The **Names** view opens with a list of names associated with the connected account.
1. Hover your cursor over or tap the icon for the name you want to change and click the ellipses (...) that appears in the upper-right corner to open the context menu for the name.
1. Select **Renew name** from the menu to open the dialog.
1. Use the **Registration Period** field to set the number of years to retain the rights to the name. The maximum value is five years minus the current registration period. So, if you just registered the name, the maximum number of years you can renew is four. As you increase or decrease the value, SuiNS updates the amount in SUI and the registration expiration date based on the value.
![Extend](/images/ui/renew.png)
1. Tap or click **Extend Name Expiry** button.
1. Approve the transaction using your connected wallet.

### Renewal grace period

When the current date surpasses the last day of your registration period, the SuiNS name expires. You have a thirty-day grace period within which you can renew the registration. After that, you must [register](./registration.mdx) the name again, if it's available.

![Grace](/images/ui/expired.png)

31 changes: 31 additions & 0 deletions documentation/pages/user/sui-id.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# sui.id

Using [IPFS](https://ipfs.tech/), you can create a `sui.id` address connected to your SuiNS name to claim a spot on the decentralized web. The IPFS protocol enables hosting peer-to-peer static sites or media that you can associate with your SuiNS name.

import Player from '../../components/player';

## Show me how

<Player videoFilename="suins-howto-suid"/>

## Tell me how

You need a content identifier (CID) to map your SuiNS name to your IPFS asset. To get the CID, download and use the [IPFS desktop app](https://docs.ipfs.tech/install/ipfs-desktop/) for your operating system.

1. Open the IPFS desktop app.
1. Select the **FILES** option from the main menu and import relevant files into IPFS.
1. Tap or click the ellipses (...) for the uploaded file or folder that you want to have your sui.id name point to and select **Copy CID**.
1. Navigate a browser to [suins.io](https://suins.io/).
1. Tap or click the **Connect Wallet** button in the upper right.

![Connect button](/images/ui/connect-btn.png)
If your wallet is already connected, your address or SuiNS name appears here instead.
1. Follow the prompts to connect your Sui or Stashed Wallet, if not already connected.
1. After connecting, the **Connect Wallet** button displays your address (or connected SuiNS default name). Tap or click the button to open the account dialog.
![Dialog](/images/ui/view-names.png)
1. Tap or click the **View names you own** button in the dialog. The **Names** view opens with a list of names associated with the connected account.
1. Hover your cursor over or tap the icon for the name you want to change and click the ellipses (...) that appears in the upper-right corner to open the context menu for the name.
1. From the context menu, select **Link to IPFS Website** to open the **Set IPFS CID** dialog.
![IPFS link site](/images/ui/ipfs-link.png)
1. Paste the CID copied from the earlier step into the field and tap or click **Apply**. Alterantively, tap or click **Cancel** to close the dialog without making any changes.
1. Navigate your browser to `https://<YOUR-NAME>.sui.id` to see your asset, being sure to change `<YOUR-NAME>` to your actual SuiNS name.
Loading

0 comments on commit d9c6d1b

Please sign in to comment.