Last active
January 24, 2024 05:06
-
-
Save leeduckgo/7c60697e01d516c7bc4aab7ac1dc8544 to your computer and use it in GitHub Desktop.
CodesOnChain.ArweaveUploader.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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