Skip to content

Instantly share code, notes, and snippets.

@leeduckgo
Last active January 24, 2024 05:06
Show Gist options
  • Save leeduckgo/7c60697e01d516c7bc4aab7ac1dc8544 to your computer and use it in GitHub Desktop.
Save leeduckgo/7c60697e01d516c7bc4aab7ac1dc8544 to your computer and use it in GitHub Desktop.
CodesOnChain.ArweaveUploader.ex
defmodule CodesOnChain.ArweaveUploader do
alias Components.ArweaveHandler
@moduledoc """
generate map by a given hash.
"""
def get_module_doc, do: @moduledoc
def send_tx(api_key, data, tags) do
tags_handled = Enum.map(tags, fn {key, value} -> {key, value} end)
the_api_key = Constants.get_admin_key()
with true <-(api_key == the_api_key) do
ArweaveHandler.send_tx(data, tags_handled)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment