# frozen_string_literal: true

require_relative "synor_wallet/version"
require_relative "synor_wallet/types"
require_relative "synor_wallet/client"

# Synor Wallet SDK for Ruby
#
# Key management, transaction signing, and balance queries for the Synor blockchain.
#
# @example Quick Start
#   require 'synor_wallet'
#
#   # Create client
#   client = SynorWallet::Client.new(api_key: 'your-api-key')
#
#   # Create a new wallet
#   result = client.create_wallet
#   puts "Wallet ID: #{result.wallet.id}"
#   puts "Mnemonic: #{result.mnemonic}"
#
#   # Get balance
#   balance = client.get_balance(result.wallet.addresses.first.address)
#   puts "Balance: #{balance.total}"
#
#   # Sign a message
#   signature = client.sign_message(result.wallet.id, "Hello, Synor!")
#   puts "Signature: #{signature.signature}"
#
module SynorWallet
  class Error < StandardError; end
  class ApiError < Error
    attr_reader :status_code

    def initialize(message, status_code: nil)
      super(message)
      @status_code = status_code
    end
  end
  class ClientClosedError < Error; end
end
