diff --git a/lib/xogmios_watcher/application.ex b/lib/xogmios_watcher/application.ex index 4082e8b..34b7261 100644 --- a/lib/xogmios_watcher/application.ex +++ b/lib/xogmios_watcher/application.ex @@ -6,7 +6,8 @@ defmodule XogmiosWatcher.Application do @impl true def start(_type, _args) do children = [ - {XogmiosWatcher.ChainSyncClient, url: get_ogmios_url()} + {XogmiosWatcher.ChainSyncClient, url: get_ogmios_url()}, + {XomgiosWatcher.TxSubmissionClient, url: get_ogmios_url()} ] opts = [strategy: :one_for_one, name: XogmiosWatcher.Supervisor] diff --git a/lib/xogmios_watcher/tx_submission_client.ex b/lib/xogmios_watcher/tx_submission_client.ex new file mode 100644 index 0000000..42c1a8c --- /dev/null +++ b/lib/xogmios_watcher/tx_submission_client.ex @@ -0,0 +1,16 @@ +defmodule XomgiosWatcher.TxSubmissionClient do + use Xogmios, :tx_submission + alias Xogmios.TxSubmission + + def start_link(opts) do + Xogmios.start_tx_submission_link(__MODULE__, opts) + end + + def submit_tx(pid \\ __MODULE__, cbor) do + TxSubmission.submit_tx(pid, cbor) + end + + def evaluate_tx(pid \\ __MODULE__, cbor) do + TxSubmission.evaluate_tx(pid, cbor) + end +end diff --git a/mix.exs b/mix.exs index 45c8e13..27af170 100644 --- a/mix.exs +++ b/mix.exs @@ -22,7 +22,7 @@ defmodule XogmiosWatcher.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do [ - {:xogmios, github: "wowica/xogmios", ref: "1b9a106"}, + {:xogmios, "~> 0.2.0"}, {:bech32, "~> 1.0"}, {:blake2, "~> 1.0"} ] diff --git a/mix.lock b/mix.lock index 9f13e68..7604d2e 100644 --- a/mix.lock +++ b/mix.lock @@ -3,5 +3,5 @@ "blake2": {:hex, :blake2, "1.0.4", "8263c69a191142922bc2510f1ffc0de0ae96e8c3bd5e2ad3fac7e87aed94c8b1", [:mix], [], "hexpm", "e9f4120d163ba14d86304195e50745fa18483e6ad2be94c864ae449bbdd6a189"}, "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, "websocket_client": {:hex, :websocket_client, "1.5.0", "e825f23c51a867681a222148ed5200cc4a12e4fb5ff0b0b35963e916e2b5766b", [:rebar3], [], "hexpm", "2b9b201cc5c82b9d4e6966ad8e605832eab8f4ddb39f57ac62f34cb208b68de9"}, - "xogmios": {:git, "https://github.com/wowica/xogmios.git", "1b9a10679b1aeec05402d993926ffc69ef785a93", [ref: "1b9a106"]}, + "xogmios": {:hex, :xogmios, "0.2.0", "40c25dfb0e4bfa1643e3132ee2de91f13f767744b7e67a12503ec438ce74d30e", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:websocket_client, "~> 1.5", [hex: :websocket_client, repo: "hexpm", optional: false]}], "hexpm", "cd780888ec6104a253e10b48ff00d472bf742248240ce04f9d51ca826c3edc9f"}, }