@soroban-dev-kit/core
v0.1.1
Published
Framework-agnostic transaction lifecycle, types, and Submitter abstraction for Soroban.
Maintainers
Readme
@soroban-dev-kit/core
Framework-agnostic transaction lifecycle for Stellar/Soroban: the
Connector/Submitter abstractions, the idle → simulating → simulated →
signing → submitting → pending → success state machine, and two
Submitter implementations — DirectSubmitter (the user's own account
pays the fee) and RelayerSubmitter (a relay service sponsors it via the
fee-bump pattern).
Most apps won't use this package directly — install
@soroban-dev-kit/react
instead, which wraps this in React hooks. Use core directly for a
non-React integration (a CLI, a backend job, a different framework).
npm install @soroban-dev-kit/core @stellar/stellar-sdkExample: simulate and submit a contract call
import { DirectSubmitter, NETWORK_PRESETS, buildContractCallTransaction } from "@soroban-dev-kit/core";
import { Keypair, TransactionBuilder, nativeToScVal } from "@stellar/stellar-sdk";
const network = NETWORK_PRESETS.testnet;
const submitter = new DirectSubmitter();
const keypair = Keypair.fromSecret("S...");
const unsignedXdr = await buildContractCallTransaction({
sourceAddress: keypair.publicKey(),
contractId: "C...",
method: "transfer",
args: [nativeToScVal(keypair.publicKey(), { type: "address" }), /* ... */],
network,
});
const sim = await submitter.simulate(unsignedXdr, { network });
const signedTx = TransactionBuilder.fromXDR(sim.assembledTransactionXdr, network.networkPassphrase);
signedTx.sign(keypair);
const result = await submitter.submit(
{ kind: "signed-envelope", signedTransactionXdr: signedTx.toXDR() },
{ network },
);What's in here
DirectSubmitter,RelayerSubmitter,LaunchtubeAdapter— theSubmitterimplementations.TxLifecycle,TX_LIFECYCLE_TRANSITIONS— the write-transaction state machine.buildContractCallTransaction,simulateReadContract— transaction/simulation building blocks.signAuthEntriesForAddress,signAuthEntriesToPayload,getUnsignedAuthEntryAddresses— auth-entry signing for multi-signer and sponsor-as-source flows.NETWORK_PRESETS,fundTestnetAccount— network config and a testnet friendbot helper.
Full docs and the design rationale: see the
soroban-dev-kit repo and its
SKILL.md.
