Step 0: make sure that your IDE is ready to use this project :
- jetbrains://idea/settings?name=Build%2C+Execution%2C+Deployment--Build+Tools--Gradle : Gradle JVM 18
- Project Settings - Project - SDK - 18
How to connect ton-kotlin in your project:
repositories {
mavenCentral()
maven("https://s01.oss.sonatype.org/service/local/repositories/snapshots/content/")
}
dependencies {
implementation("org.ton:ton-kotlin-jvm:0.3.0-20230412.120307-1")
implementation("org.ton:ton-kotlin-contract-jvm:0.3.0-20230412.120307-1")
}
Blockchain config file setup over application.yml
ton:
net-config: classpath:global-config.json
config.TonChainConfigReader
: config class that serves for reading json config and setup liteClient
config.TonBeansConfig
: config class that creating main beans, eg. LiteClient that will often be used later
LiteClient org.ton.tonkotlinusecase.LiteClientTests
Accounts:
- get account info raw
- get account info DTO (with suggested object mapping)
Blocks:
- get last masterchain block
- decode coin transfer with comment
- decode notification about NFT receiving
Contract get methods examples org.ton.tonkotlinusecase.GetMethodsTest
- get nft data
- get collectable nft address by index
- get collection data
Wallet org.ton.tonkotlinusecase.WalletTests
Before start you need to set wallet seed phrase in env variable WALLET_MNEMONIC
or directly inside application.yml
- get wallet seqno
- send TONs
- deploy nft
- transfer nft
- Workaround for building LiteClient on nearest and live liteserver only
- @TonAddress constraint validation annotation (no ton-kotlin lib required)