Integration Guide

Table of Content

Table of Content

Table of Content

Backend SDKs

Learn how to use Stakefy’s SDKs and APIs for backend automation, yield tracking, and webhook-based access management.

Python

from stakefy import StakefyClient

client = StakefyClient(secret_key='your-secret-key')

# Verify stake
status = client.verify_stake(
    wallet_address='8fH7pj...',
    service_id='your-service-id'
)

if status['has_active_stake']:
    print(f"User has {status['access_tier']} access")
    print(f"Yield generated: {status['yield_generated']}")

# Get service stats
stats = client.get_service_stats('your-service-id')
print(f"Total TVL: ${stats['total_value_locked']}")
print(f"Active users: {stats['active_stakers']}")
print(f"Revenue (yield): ${stats['total_yield_distributed']}")

Ruby

require 'stakefy'

client = Stakefy::Client.new(secret_key: ENV['STAKEFY_SECRET_KEY'])

status = client.verify_stake(
  wallet_address: '8fH7pj...',
  service_id: 'your-service-id'
)

if status.has_active_stake
  puts "Access granted: #{status.access_tier}"
end