-
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.
- Loading branch information
0 parents
commit 83feeec
Showing
31 changed files
with
720 additions
and
0 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
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 |
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 @@ | ||
.idea |
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 @@ | ||
# Sui Cookbook | ||
|
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,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> |
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 @@ | ||
<?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> |
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,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> |
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,4 @@ | ||
<noscript> | ||
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXX" | ||
height="0" width="0" style="display:none;visibility:hidden"></iframe> | ||
</noscript> |
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 @@ | ||
<!-- 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> |
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,4 @@ | ||
val account = Account.create() | ||
|
||
val account = Account.import("suipri...8cpv0g") | ||
val account = Account.import("abandon salad ...") |
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 @@ | ||
implementation("xyz.mcxross.ksui:ksui:<$ksui_version>") |
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 @@ | ||
val sui = Sui() |
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,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) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,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> |
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,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> |
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,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> |
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,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) |
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,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. |
Oops, something went wrong.