Create a payment stream (TypeScript)
Query a worker’s reputation (TypeScript)
Read all attestations (Rust)
Full sample repo
Clone the reference implementation with tests and a working web demo.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
End-to-end code examples for creating streams, submitting session reports, and reading on-chain reputation using the Aven contracts on Stellar.
import { Contract, TransactionBuilder, Networks, rpc } from "@stellar/stellar-sdk";
import { signTransaction } from "@stellar/freighter-api";
const server = new rpc.Server("https://soroban-testnet.stellar.org");
const stream = new Contract("CSTREAMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
const tx = new TransactionBuilder(clientAccount, {
fee: "100",
networkPassphrase: Networks.TESTNET,
})
.addOperation(stream.call(
"create_stream",
workerAddress,
tokenAddress,
ratePerSecond,
totalAmount
))
.setTimeout(30)
.build();
const signed = await signTransaction(tx.toXDR(), { networkPassphrase: Networks.TESTNET });
await server.sendTransaction(TransactionBuilder.fromXDR(signed, Networks.TESTNET));
const reputation = new Contract("CREPUTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
const score = await server.simulateTransaction(
new TransactionBuilder(readOnlyAccount, { fee: "100", networkPassphrase: Networks.TESTNET })
.addOperation(reputation.call("compute_score", workerAddress))
.setTimeout(30)
.build()
);
console.log("Score:", score.result?.retval);
use soroban_sdk::{Address, Env, Vec};
let attestation_client = attestation::Client::new(&env, &ATTESTATION_ID);
let all: Vec<Attestation> = attestation_client.get_attestations(&worker);
for a in all.iter() {
log!(&env, "session={} amount={}", a.session_id, a.amount);
}