forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ts sdk] Add initial scaffold of SDK docs site (MystenLabs#13109)
## Description Describe the changes or additions included in this PR. ## Test Plan How did you test the new or updated feature? --- If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process. ### Type of Change (Check all that apply) - [ ] protocol change - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes
- Loading branch information
1 parent
13df03f
commit f5c49cc
Showing
34 changed files
with
530 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
packages: | ||
- 'sdk/**' | ||
- 'apps/**' | ||
- 'dapps/**' | ||
- '!**/dist/**' | ||
- '!sdk/typescript/*/**' | ||
- '!sdk/typescript/builder' | ||
- '!sdk/typescript/cryptography' | ||
- '!sdk/typescript/faucet' | ||
- '!sdk/typescript/transactions' | ||
- '!sdk/typescript/client' | ||
- '!sdk/typescript/verify' | ||
- '!sdk/typescript/multisig' | ||
- '!sdk/typescript/utils' | ||
- 'sdk/**' | ||
- 'apps/**' | ||
- 'dapps/**' | ||
- '!**/dist/**' | ||
- '!**/.next/**' | ||
- '!sdk/typescript/*/**' | ||
- '!sdk/typescript/builder' | ||
- '!sdk/typescript/cryptography' | ||
- '!sdk/typescript/faucet' | ||
- '!sdk/typescript/transactions' | ||
- '!sdk/typescript/client' | ||
- '!sdk/typescript/verify' | ||
- '!sdk/typescript/multisig' | ||
- '!sdk/typescript/utils' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CHANGELOG.md | ||
.next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
const withNextra = require('nextra')({ | ||
theme: 'nextra-theme-docs', | ||
themeConfig: './theme.config.jsx', | ||
}); | ||
|
||
module.exports = withNextra(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "@mysten/sdk-docs", | ||
"version": "1.0.0", | ||
"description": "Docs for @mysten npm packages", | ||
"main": "index.js", | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"prettier:check": "prettier -c --ignore-unknown .", | ||
"prettier:fix": "prettier -w --ignore-unknown .", | ||
"eslint:check": "eslint --max-warnings=0 .", | ||
"eslint:fix": "pnpm run eslint:check --fix", | ||
"lint": "pnpm run eslint:check && pnpm run prettier:check", | ||
"lint:fix": "pnpm run eslint:fix && pnpm run prettier:fix" | ||
}, | ||
"publishConfig": { | ||
"access": "restricted" | ||
}, | ||
"keywords": [], | ||
"author": "Mysten Labs <[email protected]>", | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@types/node": "^20.4.2", | ||
"next": "^13.4.10", | ||
"nextra": "^2.10.0", | ||
"nextra-theme-docs": "^2.10.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"index": { | ||
"title": "Home" | ||
}, | ||
"typescript-sdk": { | ||
"title": "TypeScript SDK", | ||
"type": "page" | ||
}, | ||
"wallet-kit": { | ||
"title": "Wallet Kit", | ||
"type": "page" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Cards, Card } from 'nextra/components'; | ||
|
||
# Sui Typescript Documentation | ||
|
||
<Cards> | ||
<Card icon={'⚙️ '} title="Typescript SDK" href="/typescript-sdk" /> | ||
<Card icon={'🔐 '} title="Wallet Kit" href="/wallet-kit" /> | ||
</Cards> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"index": "Typescript SDK", | ||
"faucet": "Faucet", | ||
"sui-client": "SuiClient", | ||
"transaction-building": "Transaction Building", | ||
"cryptography": "Cryptography" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"keypairs": "KeyPairs", | ||
"multisig": "Multisig", | ||
"mnemonics": "Mnemonics" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Callout } from 'nextra/components'; | ||
|
||
# KeyPairs | ||
|
||
<Callout type="warning" emoji="⚠️"> | ||
Coming soon! | ||
</Callout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Callout } from 'nextra/components'; | ||
|
||
# Mnemonics | ||
|
||
<Callout type="warning" emoji="⚠️"> | ||
Coming soon! | ||
</Callout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Callout } from 'nextra/components'; | ||
|
||
# MultiSig | ||
|
||
<Callout type="warning" emoji="⚠️"> | ||
Coming soon! | ||
</Callout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Callout } from 'nextra/components'; | ||
|
||
# Faucet | ||
|
||
To get started with the SDK it can be helpful get some Sui tokens to play with. The faucet is a | ||
simple way to get some tokens sent to your address in `testnet`, `devnet` or `localnet` if you are | ||
running your own network locally for development. | ||
|
||
You can request sui from the faucet using the `@mysten/sui.js/faucet` package. | ||
|
||
```typescript | ||
import { requestSuiFromFaucetV0, getFaucetHost } from '@mysten/sui.js/faucet'; | ||
|
||
await requestSuiFromFaucetV0({ | ||
host: getFaucetHost('testnet'), | ||
recipient: '0xcc2bd176a478baea9a0de7a24cd927661cc6e860d5bacecb9a138ef20dbab231', | ||
}); | ||
``` | ||
|
||
The sui faucet is rate limited, so after making this call you may not be able to request more sui | ||
for a while. The exact limits depend on which network you are connecting to. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Callout } from 'nextra/components'; | ||
|
||
# Getting Started | ||
|
||
The Sui Typescript SDK is a modular library of tool for interacting with the SUi blockchain. It can | ||
be used to send queries to RPC nodes, build and sign transactions, and more. | ||
|
||
## Installation | ||
|
||
```sh npm2yarn | ||
npm i -D @mysten/sui.js | ||
``` | ||
|
||
## Overview | ||
|
||
The SDK is split into a set of modular packages that can be used independently or together. So you | ||
can import just what you need. | ||
|
||
- [`@mysten/sui.js/client`](/typescript-sdk/sui-client) - A client for interacting with Sui RPC | ||
nodes. | ||
- [`@mysten/sui.js/transaction`](/typescript-sdk/transaction-building/basics) - Utilities for | ||
building and interacting with transactions. | ||
- [`@mysten/sui.js/keypairs/*`](/typescript-sdk/cryptography/keypairs) - Modular exports for | ||
specific KeyPair implementations. | ||
- `@mysten/sui.js/verify` - Methods for verifying transactions and messages. | ||
- `@mysten/sui.js/cryptography` - Shared types and classes for cryptography. | ||
- `@mysten/sui.js/multisig` - Utilities for working with multisig signatures. | ||
- `@mysten/sui.js/utils` - Utilities for formatting and parsing various Sui types. | ||
- [`@mysten/sui.js/faucet`](/typescript-sdk/faucet) - Methods for requesting sui from a faucet. |
Oops, something went wrong.