Skip to content

Commit

Permalink
initial commit...
Browse files Browse the repository at this point in the history
  • Loading branch information
astinz committed Nov 16, 2024
0 parents commit 83feeec
Show file tree
Hide file tree
Showing 31 changed files with 720 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build documentation

on:
push:
branches: ["main"]
workflow_dispatch:

permissions:
id-token: write
pages: write

env:
INSTANCE: 'docs/in'
ARTIFACT: 'webHelpIN2-all.zip'
DOCKER_VERSION: '243.21565'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build docs using Writerside Docker builder
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.DOCKER_VERSION }}

- name: Save artifact with build results
uses: actions/upload-artifact@v4
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
retention-days: 7
test:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: docs
path: artifacts

- name: Test documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.INSTANCE }}
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: [build, test]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: docs

- name: Unzip artifact
run: unzip -O UTF-8 -qq '${{ env.ARTIFACT }}' -d dir

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Package and upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dir

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Sui Cookbook

6 changes: 6 additions & 0 deletions docs/c.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE categories
SYSTEM "https://resources.jetbrains.com/writerside/1.0/categories.dtd">
<categories>
<category id="wrs" name="Writerside documentation" order="1"/>
</categories>
31 changes: 31 additions & 0 deletions docs/cfg/buildprofiles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<buildprofiles xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/build-profiles.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<sitemap priority="0.5" change-frequency="weekly"/>
<variables>
<primary-color>#7F52FF</primary-color>
<color-preset>contrast</color-preset>
<header-logo>sui-cookbook.svg</header-logo>
<custom-favicons>sui-cookbook.svg</custom-favicons>
<noindex-content>false</noindex-content>
<enable-contribution>true</enable-contribution>
<contribute-url>https://github.com/mcxross/sui-cookbook</contribute-url>
<analytics-head-script-file>gtm.js</analytics-head-script-file>
<analytics-body-html-file>google_analytics_noscript.html</analytics-body-html-file>
<download-title>Launch PTB Studio</download-title>
<download-page>https://ptb.studio</download-page>
<showDownloadButton>true</showDownloadButton>
</variables>
<build-profile instance="in">
<variables>
<noindex-content>false</noindex-content>
</variables>
</build-profile>
<footer>
<social type="twitter" href="https://x.com/mcxross">McXross on X</social>

<link href="mailto:[email protected]">Contact us</link>

<copyright>2024 McXross</copyright>
</footer>
</buildprofiles>
16 changes: 16 additions & 0 deletions docs/cfg/glossary.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE terms SYSTEM "https://resources.jetbrains.com/writerside/1.0/glossary.dtd">
<terms>
<term name="Mainnet">The network that processes production transaction blocks. When you trade SUI or NFTs that are
ultimately based on fiat currency, you are doing so on the Mainnet network of Sui
</term>
<term name="Testnet">Staging network to provide quality assurance that any planned changes to Sui do not adversely
impact performance. Developers can use this network to test their code before placing it in production
</term>
<term name="Devnet">A more unstable network that is used to develop new features. Developers can leverage this
network to code against the latest planned features of Sui
</term>
<term name="Localnet">You can run a Sui network on your local computer. Developing on a local network provides an
optimized workflow in an environment you control
</term>
</terms>
4 changes: 4 additions & 0 deletions docs/cfg/google_analytics_noscript.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
9 changes: 9 additions & 0 deletions docs/cfg/gtm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FBMW5GY10D"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-FBMW5GY10D');
</script>
4 changes: 4 additions & 0 deletions docs/code-snippets/account.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
val account = Account.create()

val account = Account.import("suipri...8cpv0g")
val account = Account.import("abandon salad ...")
1 change: 1 addition & 0 deletions docs/code-snippets/install.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
implementation("xyz.mcxross.ksui:ksui:<$ksui_version>")
1 change: 1 addition & 0 deletions docs/code-snippets/sui.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
val sui = Sui()
27 changes: 27 additions & 0 deletions docs/code-snippets/zkLogin-android.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
private val zkLoginSuccess = mutableStateOf(false)
private var activityResult: ActivityResult? = null
private var zkLoginResponse: ZKLoginResponse? = null

private val zkLoginResultLauncher =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
if (result.resultCode == Activity.RESULT_OK) {
activityResult = result
zkLoginResponse =
result.data?.getStringExtra("zkLoginResponse")?.let { jsonToZKLoginResponse(it) }
zkLoginSuccess.value = true
} else {
Toast.makeText(this, "Login failed", Toast.LENGTH_SHORT).show()
}
}


val googleZKIntent =
context zkLogin
ZKLoginRequest(
OpenIDServiceConfiguration(
Google(),
System.getenv("GOOGLE_CLIENT_ID")!!, // Replace with your Google Client ID
System.getenv("GOOGLE_REDIRECT_URI")!!, // Replace with your Google Redirect URI,
)
)
launcher.launch(googleZKIntent)
Binary file added docs/images/ptb-studio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions docs/images/sui-cookbook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions docs/in.tree
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE instance-profile
SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd">

<instance-profile id="in"
name="Sui Cookbook"
start-page="welcome.topic">

<toc-element topic="welcome.topic"/>
<toc-element topic="getting-started.topic"/>
<toc-element topic="accounts.md"/>
<toc-element topic="Transactions.md">
<toc-element topic="programmable-transaction-blocks.md"/>
<toc-element topic="ptb-studio.md"/>
</toc-element>
<toc-element topic="ext-technology.md">
<toc-element topic="deepbook.md"/>
<toc-element topic="zklogin.topic"/>
</toc-element>
<toc-element topic="misc.md">
<toc-element topic="bcs.topic"/>
</toc-element>
<toc-element topic="Reference.md">
<toc-element toc-title="Kotlin Sui SDK API"
href="https://mcxross.github.io/ksui"/>
<toc-element toc-title="Kotlin DeepBook SDK API"
href="https://mcxross.github.io/ksui"/>
<toc-element toc-title="Kotlin zkLogin SDK API"
href="https://github.com/mcxross/kotlinx-serialization-bcs"/>
<toc-element toc-title="Kotlin BCS SDK API"
href="https://github.com/mcxross/kotlinx-serialization-bcs"/>
</toc-element>
</instance-profile>
18 changes: 18 additions & 0 deletions docs/labels.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE labels SYSTEM "https://resources.jetbrains.com/writerside/1.0/labels-list.dtd">
<labels xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/labels.xsd">
<primary-label id="label" short-name="L" name="Label">
This is an example label
</primary-label>

<primary-label id="mcxross" short-name="MXS" name="McXross" href="https://www.mcxross.xyz" color="red">
Go to McXross
</primary-label>

<secondary-label id="wip" name="WIP" color="purple">Work in progress</secondary-label>
<secondary-label id="beta" name="β" color="tangerine">Beta</secondary-label>

<secondary-label id="experimental" name="Experimental" color="purple">This is an experimental feature</secondary-label>
<secondary-label id="2023.3" name="2023.3" color="blue">New in version 2023.3</secondary-label>
</labels>
12 changes: 12 additions & 0 deletions docs/redirection-rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rules SYSTEM "https://resources.jetbrains.com/writerside/1.0/redirection-rules.dtd">
<rules>
<rule id="6b23e458">
<description>Created after removal of "Development" from SuiCookbook
Help IDs that are no longer available in build after removal:

Development
</description>
<accepts>development.html</accepts>
</rule>
</rules>
11 changes: 11 additions & 0 deletions docs/topics/Reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Reference

API References for the various SDKs used across the topics.

[Kotlin Sui SDK API](https://mcxross.github.io/ksui)

[Kotlin DeepBook SDK API](https://mcxross.github.io/ksui)

[Kotlin zkLogin SDK](https://zeroauth.dev/)

[Kotlin BCS SDK API](https://github.com/mcxross/kotlinx-serialization-bcs)
12 changes: 12 additions & 0 deletions docs/topics/Transactions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Transactions

Transactions allow us to alter the state of a Blockchain. In Sui,
these transactions are made up of a chain of commands termed
Programmable Transaction Blocks.

The execution of these commands is an all-or-nothing operation, in that, either all
commands execute successfully or the entire transaction fails. Construction of
these PTBs is either by SDKs or Transaction Builders.

In this chapter, we'll cover how to construct PTBs with both an SDK and a Transaction
Builder.
Loading

0 comments on commit 83feeec

Please sign in to comment.