> For the complete documentation index, see [llms.txt](https://docs.rome.builders/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rome.builders/de/produkte/rome-sdk.md).

# Rome SDK

Das Rome SDK stellt typisierte Solidity-Interfaces bereit, um von EVM-Smart-Contracts aus mit Solana-Programmen zu interagieren. Es ist das Entwickler-Toolkit für den Aufbau von Anwendungen über Laufzeitumgebungen hinweg auf Rome.

## SDKs

Rome hat SDKs für drei Zielgruppen — App-Builder (TypeScript), Contract-Entwickler (Solidity) und Infrastruktur-Betreiber (Rust).

### TypeScript-SDK (`@rome-protocol/sdk`)

**Für Dapp- und Frontend-Entwickler** — das SDK, mit dem die meisten App-Builder beginnen. [`@rome-protocol/sdk`](https://github.com/rome-protocol/rome-sdk-ts) umhüllt den Rome-Schreibpfad, sodass eine Web-App Rome-Transaktionen korrekt übermittelt: `submitRomeTx` (der korrekte Schreibpfad plus Gas-/Gebührenbehandlung), PDA-/ATA-Ableitung, CPI `invoke` / `invoke_signed` Encoder, Precompile-Bindungen und einen `/bridge` Subpfad. Installation per Repo zuerst (npm-Veröffentlichung ausstehend):

```bash
npm install github:rome-protocol/rome-sdk-ts#v0.2.1
```

```typescript
import { submitRomeTx } from '@rome-protocol/sdk';
// Sende jede Rome-EVM-Schreiboperation über den korrekten Schreibpfad ab (behandelt Gas-/Gebührenkodierung).
```

Die öffentlichen Referenz-Apps — [rome-dex](https://github.com/rome-protocol/rome-dex) und [cardo](https://github.com/rome-protocol/cardo) — verwenden dieses SDK.

**Beide Pfade, ein SDK.** `submitRomeTx` ist der EVM-Pfad (MetaMask). Für den **Solana-Pfad** — eine Phantom-/Solana-Wallet, die Ihre EVM-App steuert — `submitRomeTxSolanaLane` bildet das Gegenstück dazu: Der Nutzer signiert eine Solana-Transaktion, und Rome führt sie als EVM-Transaktion aus seiner abgeleiteten Identität aus, ganz ohne EVM-Schlüssel. Werte fließen hinein und hinaus über `buildFundLeg` / `buildSweepLeg` als ERC-20-Wrapper (z. B. `wUSDC`), nicht nativ `msg.value` — der synthetische Absender hält im Ruhezustand nichts — und ein erstmals verwendetes synthetisches Konto wird beim ersten Gebrauch automatisch bereitgestellt. Siehe [Erstelle eine App mit zwei Pfaden](/de/entwicklerleitfaden/dual-lane-app.md) und [EVM von Solana aus aufrufen](/de/entwicklerleitfaden/call-evm-from-solana.md).

### Solidity-SDK (`@rome-protocol/rome-solidity`)

**Für Solidity-Entwickler.** Stellt die Precompile-Interfaces, ERC-20/SPL-Wrapper, PDA-Ableitung und CPI-Utilities bereit. Die npm-Veröffentlichung steht noch aus; heute beziehst du diese aus dem öffentlichen [`rome-solidity`](https://github.com/rome-protocol/rome-solidity) Repo (Git-Abhängigkeit oder kopierte Dateien).

```solidity
import {ISystemProgram, ICrossProgramInvocation, IHelperProgram, IWithdraw}
    from "@rome-protocol/rome-solidity/contracts/interface.sol";
import {SPL_ERC20} from "@rome-protocol/rome-solidity/contracts/erc20spl/erc20spl.sol";
import {RomeEVMAccount} from "@rome-protocol/rome-solidity/contracts/rome_evm_account.sol";
```

### Rust-SDK (`rome-sdk`)

**Für Infrastruktur-Betreiber.** Ein Rust-Workspace, der Transaktionszusammenstellung, Solana-Interaktion, Gaspreisgestaltung und Blockindizierung übernimmt. Verwendet von Proxy und Hercules.

## Solidity-SDK: Enthaltenes

### Precompile-Interfaces

Binde ein Interface an seine Precompile-Adresse:

```solidity
ISystemProgram          constant System   = ISystemProgram(0xFF00000000000000000000000000000000000007);
ICrossProgramInvocation constant Cpi      = ICrossProgramInvocation(0xFF00000000000000000000000000000000000008);
IHelperProgram          constant Helper   = IHelperProgram(0xFF00000000000000000000000000000000000009);
IWithdraw               constant Withdraw = IWithdraw(0x4200000000000000000000000000000000000016);
// Cache-Pfad: ISplCached 0xff…05, IAssociatedSplCached 0xff…06, ISystemCached 0xff…04, IWithdrawCached 0xff…0b
```

### SPL-Token-Operationen

Verwende `IHelperProgram` (`0xff…09`) für mit User-PDA signierte SPL-Primitiven:

```solidity
// Erstelle das ATA des Aufrufers für einen Mint
Helper.create_ata(user, mint);

// Übertrage SPL vom PDA des Aufrufers
Helper.transfer_spl(to, tokens, mint);
```

Auf dem Cache-Pfad liegen die entsprechenden Operationen auf `ISplCached` (`0xff…05`) und `IAssociatedSplCached` (`0xff…06`). Siehe `interface.sol` für alle Überladungen; ein Vertrag verwendet durchgehend einen Pfad.

### PDA-Ableitung

```solidity
// Leite das Solana-PDA eines Benutzers ab
bytes32 userPda = RomeEVMAccount.pda(msg.sender);

// Leite PDA mit Salt ab (um mehrere PDAs pro Benutzer zu erstellen)
bytes32 pda = RomeEVMAccount.pda_with_salt(msg.sender, salt);

// Beliebiges PDA finden
(bytes32 pda, uint8 bump) = SystemProgram.find_program_address(programId, seeds);
```

### Cross-Program-Aufruf

```solidity
// Rufe ein beliebiges Solana-Programm auf
ICrossProgramInvocation.AccountMeta[] memory accounts = new ICrossProgramInvocation.AccountMeta[](2);
accounts[0] = ICrossProgramInvocation.AccountMeta(signerPda, true, true);
accounts[1] = ICrossProgramInvocation.AccountMeta(targetAccount, false, true);

CpiProgram.invoke(programId, accounts, instructionData);

// Aufruf mit PDA-Signierung
CpiProgram.invoke_signed(programId, accounts, data, seeds);

// Kontodaten lesen
(uint64 lamports, bytes32 owner, bool isSigner, bool isWritable, bool executable, bytes memory data)
    = CpiProgram.account_info(pubkey);
```

### ERC-20 über SPL-Token

```solidity
// Stelle einen Wrapper für jeden SPL-Mint bereit
ERC20SPLFactory factory = ERC20SPLFactory(FACTORY_ADDRESS);
address wrapper = factory.add_spl_token_with_metadata(splMint);

// Verwende den Wrapper als Standard-ERC-20
SPL_ERC20 token = SPL_ERC20(wrapper);
token.transfer(recipient, amount);
uint256 balance = token.balanceOf(user);
```

### Borsh-Deserialisierung

```solidity
import {Convert} from "@rome-protocol/rome-solidity/contracts/convert.sol";

// Solana-Kontodaten parsen (Borsh-Format im Little-Endian)
(uint64 value, uint256 newOffset) = Convert.read_u64le(data, offset);
(bytes32 pubkey, uint256 newOffset2) = Convert.read_bytes32(data, offset);
```

### Metaplex-Metadaten

```solidity
import {MplTokenMetadataLib} from "@rome-protocol/rome-solidity/contracts/mpl_token_metadata/lib.sol";

// Token-Metadaten von Metaplex laden
MplTokenMetadataLib.Metadata memory meta = MplTokenMetadataLib.load_metadata(
    mintPubkey, mplProgramId, cpiAddress
);
string memory name = meta.name;
string memory symbol = meta.symbol;
```

## Rust SDK: Architektur

Das Rust SDK ist ein Cargo-Workspace. Seine Kern-Crates:

| Crate               | Zweck                                                                                    |
| ------------------- | ---------------------------------------------------------------------------------------- |
| `rome-sdk`          | Kern-API: `Rome` Struktur, Konfiguration, Transaktionstypen (RheaTx, RemusTx, RomulusTx) |
| `rome-evm-client`   | EVM-Rollup-Client, TxBuilder, ResourceFactory, Emulator-Integration                      |
| `rome-solana`       | Solana-Tower, RPC-Client, Transaktions-Batching und -Tracking                            |
| `rome-utils`        | RLP-, Hex-, JSON-RPC- und Authentifizierungs-Utilities                                   |
| `rome-obs`          | OpenTelemetry-Beobachtbarkeit (Traces, Metriken, Logs)                                   |
| `rome-meteora`      | Meteora-DEX-AMM-Pool-Adapter für die Gaspreisgestaltung                                  |
| `rome-jito-bundler` | Jito-Bundle-Builder für atomare Mehrfach-Transaktionsübermittlung                        |

### Transaktionstypen

```rust
// Einzelne Rollup-Transaktion
let rhea = RheaTx::new(signed_eth_tx);
let mut tx = rome.compose_rollup_tx(rhea).await?;
let sig = rome.send_and_confirm(&mut *tx).await?;

// Atomare Cross-Rollup-Transaktion
let remus = RemusTx::new(vec![tx1, tx2]);
let mut tx = rome.compose_cross_rollup_tx(remus).await?;

// Atomare Cross-Chain-Transaktion (EVM + Solana)
let romulus = RomulusTx::new(eth_txs, sol_ixs);
let mut tx = rome.compose_cross_chain_tx(romulus, signers).await?;
```

### Ressourcen-Pooling

Das SDK pooled Solana-Keypairs (Payer) und Holder-Kontoinstanzen für die parallele Transaktionsübermittlung:

```rust
let resource = resource_factory.get().await?;
let payer = resource.payer();       // Solana-Keypair
let holder = resource.holder();     // Holder-Kontoinstanz
// Ressource wird beim Drop automatisch an den Pool zurückgegeben
```

## SDK-Roadmap

### Fertig und funktionsfähig

* SPL-Token-Wrapper und Precompile-Interfaces
* Meteora DAMM v1 Swaps über CPI
* Oracle-Gateway V1 + V2 (Pyth Pull, Switchboard V3)
* System-Program-Helper, Borsh-Deserialisierung
* ERC20SPL-Factory + Bridge-Verträge

## Was kommt als Nächstes

* [Solidity deployen](/de/entwicklerleitfaden/deploy-solidity.md) — deploye deinen ersten Vertrag mit dem SDK
* [Solana aus EVM aufrufen](/de/entwicklerleitfaden/call-solana-from-evm.md) — verwende CPI, um mit Solana-Programmen zu interagieren
* [Contract-Adressen](/de/referenz/contract-addresses.md) — bereitgestellte SDK-Contract-Adressen


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.rome.builders/de/produkte/rome-sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
