Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

price-feed-bot-stenlycordoba #176

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions pricebot.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-- PID = iopLk76IvPwYG_HqQzVS6yK1T7So_xOnnvYHE4MXDSI

_ORBIT = "WSXUI2JjYUldJ7CKq9wE1MGwXs-ldzlUlHOQszwQe0s"

function handleError(msg, errorMessage)
ao.send({
Tareget = msg.From,
Tags = {
Action = "Error" ,
["Message-Id"] = msg.Id,
Error = Message
}
})
end

Handlers.add("nyar",
Handlers.utils.hasMatchingTag("Action", "nyar"),
function(msg)
local token = msg.Tags.Token
local url = "https://api.coingecko.com/api/v3/simple/price" .. "?ids=" .. token .. "&vs_currencies=usd"
ao.send({
Target = _ORBIT,
Action = "Get-Real-Data",
Url = url
})
Handlers.utils.reply("PriceFetch")
(msg)
end
)
Binary file added selesai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.