Skip to content

Commit

Permalink
feat: refine doc
Browse files Browse the repository at this point in the history
Signed-off-by: grapebaba <281165273@qq.com>
  • Loading branch information
GrapeBaBa committed Feb 6, 2023
1 parent 7a4b3a6 commit 2036d02
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 16 deletions.
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $ ./gradlew build
## Javadoc

For the latest javadocs for the `main` branch, run `./gradlew javadoc` and open
the [javadoc](build/docs/javadoc/index.html) in your browser.
the document under the `build/docs/javadoc/index.html` in your browser.

## Testing

Expand Down Expand Up @@ -82,15 +82,28 @@ cd sui/target/release
./gradlew integrationTest
```

## Supported APIs
## Supported APIs (sui SDK 0.25.0)

- [x] sui_batchTransaction
- [ ] sui_devInspectTransaction
- [x] sui_dryRunTransaction
- [x] sui_executeTransaction
- [x] sui_executeTransactionSerializedSig(same with sui_executeTransaction)
- [ ] sui_getAllBalances
- [ ] sui_getAllCoins
- [ ] sui_getBalance
- [ ] sui_getCheckpointContents
- [ ] sui_getCheckpointContentsByDigest
- [ ] sui_getCheckpointSummary
- [ ] sui_getCheckpointSummaryByDigest
- [x] sui_getCoinMetadata
- [ ] sui_executeTransactionSerializedSig
- [ ] sui_getCoins
- [x] sui_getCommitteeInfo
- [ ] sui_getDelegatedStakes
- [ ] sui_getDynamicFieldObject
- [ ] sui_getDynamicFields
- [x] sui_getEvents
- [ ] sui_getLatestCheckpointSequenceNumber
- [x] sui_getMoveFunctionArgTypes
- [x] sui_getNormalizedMoveFunction
- [x] sui_getNormalizedMoveModule
Expand All @@ -100,24 +113,32 @@ cd sui/target/release
- [x] sui_getObjectsOwnedByAddress
- [x] sui_getObjectsOwnedByObject
- [x] sui_getRawObject
- [x] sui_getReferenceGasPrice
- [ ] sui_getSuiSystemState
- [ ] sui_getTotalSupply
- [x] sui_getTotalTransactionNumber
- [x] sui_getTransaction
- [ ] sui_getTransactionAuthSigners
- [x] sui_getTransactions
- [x] sui_getTransactionsInRange
- [ ] sui_getValidators
- [x] sui_mergeCoins
- [x] sui_moveCall
- [x] sui_pay
- [x] sui_payAllSui
- [x] sui_paySui
- [x] sui_publish
- [ ] sui_requestAddDelegation
- [ ] sui_requestSwitchDelegation
- [ ] sui_requestWithdrawDelegation
- [x] sui_splitCoin
- [x] sui_splitCoinEqual
- [ ] sui_subscribeEvent
- [x] sui_subscribeEvent
- [ ] sui_tblsSignRandomnessObject
- [x] sui_transferObject
- [x] sui_transferSui
- [x] sui_tryGetPastObject
- [ ] sui_getTransactionAuthSigners
- [ ] sui_getSuiSystemState


## Examples

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {


group 'me.grapebaba'
version '0.3.2'
version '0.4.0'

repositories {
mavenCentral()
Expand Down
8 changes: 8 additions & 0 deletions docs/build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Build

To get started you need to install JDK8+, then run the following command:
```shell
./gradlew build
```

For detail, please check the [README](https://github.com/GrapeBaBa/sui4j/blob/main/README.md).
18 changes: 18 additions & 0 deletions docs/event.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Subscribe Events

### SubscribeEvent

```java
EventTypeEventFilter eventFilter = new EventTypeEventFilter();
eventFilter.setEventType(EventType.CoinBalanceChange);
Disposable disposable =
sui.subscribeEvent(
eventFilter,
<event_callback>,
<error_callback>);
moveCall(); // transaction invocation

disposable.dispose(); // undo subscribe
```

For more examples, you can see [SuiIntTests](https://github.com/GrapeBaBa/sui4j/blob/main/src/integrationTest/java/io/sui/SuiIntTests.java)
6 changes: 3 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ site_dir: "_site"

repo_name: "GrapeBaBa/sui4j"
repo_url: https://github.com/GrapeBaBa/sui4j
edit_uri: blob/main/docs/
edit_uri: edit/main/docs/

copyright: "Copyright &copy; 2022-2023 281165273grape@gmail.com"

Expand Down Expand Up @@ -61,8 +61,8 @@ nav:
- Init sui client: initsui.md
- Coin transaction: coin.md
- Object and Smart Contract: call.md
# - Deploy and Interact with Smart Contracts: getting_started/deploy_interact_smart_contracts.md
# - Filters and Flowables: getting_started/pub_sub.md
- Subscribe Events: event.md
- Build: build.md
# - Manual Configuration: getting_started/manual_configuration.md

markdown_extensions:
Expand Down
7 changes: 1 addition & 6 deletions src/integrationTest/java/io/sui/SuiIntTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -671,12 +671,7 @@ void subscribeEvent() throws ExecutionException, InterruptedException {
Disposable disposable =
sui.subscribeEvent(
eventFilter,
new Consumer<EventEnvelope>() {
@Override
public void accept(EventEnvelope eventEnvelope) throws Throwable {
System.out.println(eventEnvelope);
}
},
System.out::println,
System.out::println);
moveCall();

Expand Down

0 comments on commit 2036d02

Please sign in to comment.