Skip to content

Commit

Permalink
Update dependencies to support Ruby 3 and Rails 7 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
hklee93 authored Apr 3, 2024
1 parent 3db3a05 commit d630884
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require 'pinetwork'
api_key = "YOUR_PI_API_KEY"
wallet_private_seed = "S_YOUR_WALLET_PRIVATE_SEED" # starts with S

pi = PiNetwork.new(api_key, wallet_private_seed)
pi = PiNetwork.new(api_key: api_key, wallet_private_seed: wallet_private_seed)
```

2. Create an A2U payment
Expand Down
7 changes: 2 additions & 5 deletions lib/pinetwork.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def set_horizon_client(network)
host = (network.starts_with? "Pi Network") ? @mainnet_host : @testnet_host
horizon = "https://#{host}"

client = Stellar::Client.new(host: host, horizon: horizon)
client = Stellar::Horizon::Client.new(host: host, horizon: horizon)
Stellar::default_network = network

@client = client
Expand All @@ -185,10 +185,7 @@ def build_a2u_transaction(transaction_data)
recipient = Stellar::KeyPair.from_address(transaction_data[:recipient])
memo = Stellar::Memo.new(:memo_text, transaction_data[:identifier])

payment_operation = Stellar::Operation.payment({
destination: recipient,
amount: amount.to_payment
})
payment_operation = Stellar::Operation.payment(destination: recipient, amount: amount.to_payment)

my_public_key = self.account.address
sequence_number = self.client.account_info(my_public_key).sequence.to_i
Expand Down
6 changes: 3 additions & 3 deletions pinetwork.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "pinetwork"
s.version = "0.1.4"
s.version = "0.1.5"
s.summary = "Pi Network Ruby"
s.description = "Pi Network backend library for Ruby-based webservers."
s.authors = ["Pi Core Team"]
Expand All @@ -13,8 +13,8 @@ Gem::Specification.new do |s|
]
s.homepage = "https://github.com/pi-apps/pi-ruby"
s.license = "PiOS"
s.add_runtime_dependency "stellar-sdk", "~> 0.29.0"
s.add_runtime_dependency "faraday", "~> 0"
s.add_runtime_dependency "stellar-sdk", "~> 0.31.0"
s.add_runtime_dependency "faraday", "~> 1.6.0"
s.metadata = {
"documentation_uri" => "https://github.com/pi-apps/pi-ruby",
}
Expand Down

0 comments on commit d630884

Please sign in to comment.