diff --git a/README.md b/README.md index 9f2dafc..5f30746 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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 diff --git a/build.gradle b/build.gradle index a188103..c2e94e3 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ plugins { group 'me.grapebaba' -version '0.3.2' +version '0.4.0' repositories { mavenCentral() diff --git a/docs/build.md b/docs/build.md new file mode 100644 index 0000000..55906c5 --- /dev/null +++ b/docs/build.md @@ -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). \ No newline at end of file diff --git a/docs/event.md b/docs/event.md index e69de29..abaa5e4 100644 --- a/docs/event.md +++ b/docs/event.md @@ -0,0 +1,18 @@ +## Subscribe Events + +### SubscribeEvent + +```java + EventTypeEventFilter eventFilter = new EventTypeEventFilter(); + eventFilter.setEventType(EventType.CoinBalanceChange); + Disposable disposable = + sui.subscribeEvent( + eventFilter, + , + ); + 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) diff --git a/mkdocs.yml b/mkdocs.yml index 6394663..b16cbc1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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 © 2022-2023 281165273grape@gmail.com" @@ -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: diff --git a/src/integrationTest/java/io/sui/SuiIntTests.java b/src/integrationTest/java/io/sui/SuiIntTests.java index f7ebc06..cbb96ca 100644 --- a/src/integrationTest/java/io/sui/SuiIntTests.java +++ b/src/integrationTest/java/io/sui/SuiIntTests.java @@ -671,12 +671,7 @@ void subscribeEvent() throws ExecutionException, InterruptedException { Disposable disposable = sui.subscribeEvent( eventFilter, - new Consumer() { - @Override - public void accept(EventEnvelope eventEnvelope) throws Throwable { - System.out.println(eventEnvelope); - } - }, + System.out::println, System.out::println); moveCall();