Playtron GameOS Rust SDK
The Playtron GameOS Rust SDK enables seamless integration with Playtron-native features including PACT attestation, Sui wallet signing, and system-level utilities like the virtual keyboard and browser. This SDK supports both Linux and Windows (via Wine/Proton).
Table of Contents
Features
- ✅ Detect if running on Playtron OS
- ✅ Remote attestation via TPM and PACT service
- ✅ Native Sui wallet integration for signing messages and transactions
- ✅ Open, close, and query status of the virtual keyboard
- ✅ Launch the browser on the device with a URL
- ✅ Cross-platform: Linux + Windows (via Wine)
Requirements
- Rust
1.70+ - Linux or Wine runtime (for testing Playtron-specific features)
tokioruntime for async execution- For Sui transactions:
sui-sdk,bcs, andbase64dependencies
Installation
Add to your Cargo.toml:
[]
= { = "https://github.com/playtrontech/playtron-sdk-rs" }
= { = "1", = ["full"] }
= { = "0.11", = ["json", "gzip"] }
= "0.21"
= "0.1"
= { = "https://github.com/mystenlabs/sui", = "sui-sdk"}
Example Usage
Detecting Playtron
let manager = new.await?;
if manager.is_playtron.await?
PACT Attestation
use AttestationClient;
let attestation_client = new;
let session_info = attestation_client.create_session.await?;
let quote = attestation_client.get_quote?;
Send the quote to the PACT server:
let client = new;
let url = "https://pact.playtron.one/api/v1/session/attest";
let res = client
.post
.header
.header
.body
.send
.await?;
Sui Wallet Integration
Get Wallet Address
use Sui;
let sui = new.await?;
let address = sui.get_address.await;
Sign a Message
let result = sui.sign_message.await?;
println!;
Sign and Execute a Transaction
let tx_base64 = simple_coin_transfer_txn;
let result = sui.sign_and_execute_transaction.await?;
Sign a Transaction (Without Executing)
let tx_base64 = simple_coin_transfer_txn;
let result = sui.sign_transaction.await?;
Virtual Keyboard and Browser
let manager = new.await?;
// Show keyboard
manager.show_keyboard.await?;
// Open a browser
manager.open_browser.await?;
// Wait and close
sleep.await;
manager.close_browser.await?;
Running
Ensure libplaytron.so and playtron.dll are installed to the appropriate Wine system paths.
This is done automatically from GameOS if SDK is being launched as a game.
License
- MIT License
See LICENSE for details.