Skip to main content

What the SDK is

The SDK exists so developers can use Parly without rebuilding deterministic authentication, recovery identity derivation, note-envelope handling, note reconstruction, execution request construction, exact approval logic, and outcome handling from scratch.

Install

npm install @parly/sdk
pnpm add @parly/sdk

Initialize the SDK

import { ParlySDK, ParlyMppAdapter } from "@parly/sdk"

const sdk = new ParlySDK({
  privateKeyHex: process.env.AGENT_PRIVATE_KEY as `0x${string}`,
  tempoChainId: Number(process.env.TEMPO_CHAIN_ID),
  tempoRpcUrl: process.env.TEMPO_RPC_URL!
})

const mpp = new ParlyMppAdapter(sdk, {
  serviceName: process.env.MPP_SERVICE_NAME,
  serviceVersion: process.env.MPP_SERVICE_VERSION
})

What the SDK includes

The SDK includes support for:
  • deterministic recovery key derivation from the fixed auth message
  • note-envelope decryption
  • reconstruction of private state from indexed history
  • private execution flow construction
  • exact-amount approval handling
  • clear handling of uncertain or pending execution outcomes
  • optional MPP-compatible wrappers above the same execution engine

What the SDK handles

The SDK handles deterministic auth-message usage, recovery key derivation, note-envelope handling, note reconstruction, direct execution path construction, exact approval flow, and outcome handling.

MPP-compatible integration

Parly supports MPP compatibility through an adapter that wraps the existing execution engine. Create a session:
const session = await mpp.createSession({
  sessionId: "invoice-2026-03-27",
  counterparty: "0x1111111111111111111111111111111111111111",
  assetId: 1,
  spendLimit: "25.0",
  destinationEid: Number(process.env.TEMPO_LZ_EID),
  poolAddress: process.env.NEXT_PUBLIC_USDC_POOL as `0x${string}`
})
Settle from a session:
const outcome = await mpp.settleFromSession(
  {
    sessionId: session.sessionId,
    destination: "0x1111111111111111111111111111111111111111",
    amount: "25.0"
  },
  session
)

Who the SDK is for

The SDK is intended for:
  • backend services
  • developer integrations
  • operator tooling
  • automation systems
  • machine-payment environments
  • agent stacks that integrate through the SDK boundary