Skip to content

Commit

Permalink
update with arweave components
Browse files Browse the repository at this point in the history
  • Loading branch information
leeduckgo committed Jan 23, 2024
1 parent 74a7ae1 commit 049c806
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/components/arweave_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,17 @@ defmodule Components.ArweaveHandler do
def get_content(tx_id) do
ArweaveSdkEx.get_content_in_tx(Constants.get_arweave_node(), tx_id)
end

def send_tx(data, tags) do
node = Constants.get_arweave_node()
# call the priv key local.
jwt = ArweaveSdkEx.Wallet.read_jwk_json_from_file("../arweave_wallet.json")
reward_coefficient = 1
{tx_signed, id, _tx_unsigned} =
ArweaveSdkEx.Wallet.sign_tx(node, data, tags, jwt, reward_coefficient)
{:ok, "success submit tx"} =
ArweaveSdkEx.send(node, tx_signed)
id
end

end

0 comments on commit 049c806

Please sign in to comment.