For the complete documentation index, see llms.txt. This page is also available as Markdown.

Stable Points (SP)

Build on Spree Protocol with the @spree-finance/spree-evm-sdk. The SDK builds unsigned transactions for offline signing and executes read-only calls against Spree smart contracts.

Install

npm install @spree-finance/spree-evm-sdk

Quick Start

import { Factory, Points } from '@spree-finance/spree-evm-sdk';

// Configure the Factory wrapper
const factory = new Factory({
  rpcUrl: 'https://sepolia.base.org',
  chainId: 84532n,
  contractAddress: '0xFactoryAddress',
  from: '0xYourWallet',
  defaultGasPriceWei: 1_000_000_000n,
  defaultGasLimit: 500_000n,
});

// Read SP balance (no transaction, uses eth_call)
const points = new Points({ ...pointsConfig });
const balance = await points.readBalanceOf('0xUserAddress');

// Build an unsigned mint transaction
const unsignedTx = await factory.mint(
  '0xUSDCAddress',  // stablecoin asset
  1_000_000n,       // amount (6 decimals for USDC)
  '0xReceiver',     // SP recipient
  false,            // expectBasketMode
);

// Sign with your wallet, then broadcast

Contract Wrappers

The SDK ships one wrapper per contract. Each wrapper accepts BaseContractConfig and exposes both write methods (return unsigned tx hex) and read methods (return decoded values).

Wrapper
Contract
Purpose

Factory

Factory

Mint SP, redeem SP, vault management

Points

Points

ERC-20 SP token, transfer whitelist

SpreeVault4626

SpreeVault4626

ERC-4626 rewards vault

BonusRewardsVault

BonusRewardsVault

Epoch-based bonus rewards

PythPriceOracle

PythPriceOracle

Price feeds

PendingSPVault

PendingSPVault

Campaign-based pSP distribution

SpreeStatusRegistry

SpreeStatusRegistry

Tier/status management

BoostEngine

BoostEngine

Boost multiplier calculations

Additional Modules

Module
Purpose

ClientOnboarding

Deploy brand infrastructure

ContractRegistry

Query deployed factories and contracts

ERC20

Generic ERC-20 approve/transfer/balance

Guides

Last updated