dart-tempo

March 20, 2026 · View on GitHub



tempo combomark



dart-tempo

Dart SDK for building on Tempo — the blockchain for payments at scale.

Contents

Packages

PackageDescriptionStatus
tempo_coreTransaction model, RLP encoding, secp256k1 signing, JSON-RPC client✅ 151 tests
tempo_contractsABI encoding, TIP-20, DEX, Fee Manager, Nonce, Keychain helpers✅ 123 tests
tempo_flutterSecure key storage, passkey signing, payment UI widgets✅ 61 tests
tempo_serverFee payer handler, key management for backend services✅ 59 tests

Examples

ExampleDescription
parallel_nonces2D nonce parallelism: 3 concurrent TIP-20 transfers
flutter_walletFlutter app: onboarding, send, receive with PathUSD
payment_terminalHTTP payment terminal: create & poll payment requests
fee_payer_serviceFee sponsorship server wrapping tempo_server

Quick Start

import 'package:tempo_core/tempo_core.dart';
import 'package:tempo_contracts/tempo_contracts.dart';

// Create a signer and client
final signer = TempoSigner('0xac0974...');
final client = TempoClient('http://localhost:8545');

// Check PathUSD balance
final balCall = Tip20.balanceOf(
  token: TempoAddresses.pathUsd,
  account: signer.address,
);
final result = await client.call(
  to: bytesToHexPrefixed(balCall.to!),
  data: bytesToHexPrefixed(balCall.data),
);
final balance = Tip20.decodeBalanceOf(hexToBytes(result));

// Send PathUSD
final nonce = await client.getNonce(signer.addressHex);
final tx = TempoTransaction(
  chainId: BigInt.from(1337),
  nonce: nonce,
  maxFeePerGas: BigInt.from(25000000000),
  maxPriorityFeePerGas: BigInt.from(1000000),
  gasLimit: 500000,
  feeToken: TempoAddresses.pathUsd,
  calls: [
    Tip20.transfer(
      token: TempoAddresses.pathUsd,
      to: hexToBytes('0x70997970C51812dc3A010C7d01b50e0d17dc79C8'),
      amount: BigInt.from(1000000),
    ),
  ],
);
final signed = signer.signTransaction(tx);
final receipt = await client.sendRawTransactionSync(serialize(signed));
print('TX: ${receipt['transactionHash']}');

Local Dev Node

Start a Tempo dev node for development and testing:

docker compose up -d

This starts a node at http://localhost:8545 with:

  • Chain ID 1337 (dev chain)
  • 1-second block time
  • Faucet enabled (tempo_fundAddress RPC method)
  • PathUSD at 0x20c0000000000000000000000000000000000000

Fund a test address:

curl -X POST http://localhost:8545 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","method":"tempo_fundAddress","params":["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"],"id":1}'

Pre-funded dev keys (Hardhat standard):

KeyAddress
0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff800xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d0x70997970C51812dc3A010C7d01b50e0d17dc79C8

Testing

# Unit tests (all packages)
cd packages/tempo_core && dart test
cd packages/tempo_contracts && dart test
cd packages/tempo_flutter && flutter test
cd packages/tempo_server && dart test

# Integration tests (requires running dev node)
cd packages/tempo_core && dart test test/integration/ --run-skipped
cd packages/tempo_contracts && dart test test/integration/ --run-skipped

# Flutter wallet test
cd examples/flutter_wallet && flutter test

Contributing

Our contributor guidelines can be found in CONTRIBUTING.md.

Security

See SECURITY.md. Note: Tempo is still undergoing audit and does not have an active bug bounty. Submissions will not be eligible for a bounty until audits have concluded.

License

Licensed under either of Apache License, Version 2.0 or MIT License at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in these packages by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.