A Ruby client for the Privy API, providing wallet management functionality.
Add this line to your application's Gemfile:
gem 'privy', path: '.'Or install manually:
gem install privyrequire 'privy'
Privy.configure do |config|
config.app_id = 'your-app-id'
config.app_secret = 'your-app-secret'
end
client = Privy::Client.new
response = client.wallets.list- Wallet management (list, create, retrieve)
- Balance checking
- Transaction history
- Object-oriented response handling
All API responses wrap data in PrivyObject instances that support both hash-like and method-based access:
client = Privy::Client.new(app_id: 'your_app', app_secret: 'secret')
response = client.wallets.retrieve(wallet_id)
# Both access patterns work:
response.data['address'] # Hash-like access
response.data.address # Method access (more Ruby-like)
# Full Enumerable support:
response.data.each { |k, v| puts "#{k}: #{v}" }
response.data.select { |k, v| v.present? }PrivyObject provides convenient methods: keys, values, key?, to_hash, to_json, and full iteration support.
See docs/PRIVY_OBJECT.md for complete documentation.
bundle install
bundle exec rake test