Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions FULL_HELP_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ Generate code client bindings for a contract
- `flutter` — Generate Flutter bindings
- `swift` — Generate Swift bindings
- `php` — Generate PHP bindings
- `kmp` — Generate Kotlin Multiplatform bindings

## `stellar contract bindings rust`

Expand Down Expand Up @@ -344,6 +345,12 @@ Generate PHP bindings

**Usage:** `stellar contract bindings php`

## `stellar contract bindings kmp`

Generate Kotlin Multiplatform bindings

**Usage:** `stellar contract bindings kmp`

## `stellar contract build`

Build a contract from source
Expand Down
8 changes: 8 additions & 0 deletions cmd/soroban-cli/src/commands/contract/bindings.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pub mod flutter;
pub mod java;
pub mod kmp;
pub mod php;
pub mod python;
pub mod rust;
Expand Down Expand Up @@ -28,6 +29,9 @@ pub enum Cmd {

/// Generate PHP bindings
Php(php::Cmd),

/// Generate Kotlin Multiplatform bindings
Kmp(kmp::Cmd),
Comment thread
christian-rogobete marked this conversation as resolved.
}

#[derive(thiserror::Error, Debug)]
Expand All @@ -52,6 +56,9 @@ pub enum Error {

#[error(transparent)]
Php(#[from] php::Error),

#[error(transparent)]
Kmp(#[from] kmp::Error),
}

impl Cmd {
Expand All @@ -64,6 +71,7 @@ impl Cmd {
Cmd::Flutter(flutter) => flutter.run()?,
Cmd::Swift(swift) => swift.run()?,
Cmd::Php(php) => php.run()?,
Cmd::Kmp(kmp) => kmp.run()?,
}
Ok(())
}
Expand Down
19 changes: 19 additions & 0 deletions cmd/soroban-cli/src/commands/contract/bindings/kmp.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use std::fmt::Debug;

use clap::Parser;

#[derive(Parser, Debug, Clone)]
#[group(skip)]
pub struct Cmd {}

#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("kmp binding generation is not implemented in the stellar-cli, but is available via the tool located here: https://github.com/lightsail-network/stellar-contract-bindings")]
NotImplemented,
}

impl Cmd {
pub fn run(&self) -> Result<(), Error> {
Err(Error::NotImplemented)
}
}
Loading