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
{ | |
"name": "Hashnote", | |
"description": "Regulated Institutional-Grade Gateway & Investments", | |
"ticker": "HASH", | |
"homepage": "https://www.hashnote.com" | |
} |
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
{ | |
"annotations": { | |
"list": [ | |
{ | |
"builtIn": 1, | |
"datasource": { | |
"type": "datasource", | |
"uid": "Prometheus" | |
}, | |
"enable": true, |
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
const CPK = require('contract-proxy-kit'); | |
const EthersAdapter = CPK.EthersAdapter; | |
const ethers = require('ethers'); | |
const main = async function() { | |
const provider = ethers.getDefaultProvider('homestead'); | |
const wallet = ethers.Wallet.createRandom().connect(provider); | |
const ethLibAdapter = new EthersAdapter({ ethers, signer: wallet}); | |
const cpk = await CPK.default.create({ ethLibAdapter, isSafeApp: false}) |
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 CryptoPrices.Application do | |
# See https://hexdocs.pm/elixir/Application.html | |
# for more information on OTP Applications | |
@moduledoc false | |
use Application | |
def start(_type, _args) do | |
# List all child processes to be supervised | |
children = [ |
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 CryptoPrices.Aggregator.Bittrex do | |
@limit 10 | |
@base "http://api.bittrex.com/api/v1.1/public/getorderbook" | |
def compute(pair, _opts) do | |
pair | |
|> fetch_json() | |
|> format_results() | |
end |
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 CryptoPrices do | |
alias CryptoPrices.Aggregator | |
@clients [Aggregator.Bittrex, Aggregator.Poloniex, Aggregator.Kraken] | |
def compute(pair, opts \\ []) do | |
timeout = opts[:timeout] || 2_000 | |
opts = Keyword.put_new(opts, :limit, 10) | |
clients = opts[:clients] || @clients |
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
{ | |
"success":true, | |
"message":"", | |
"result":{ | |
"buy":[ | |
{ | |
"Quantity":17.21215708, | |
"Rate":0.03160399 | |
}, | |
{ |
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 CryptoPrices.Aggregator.Supervisor do | |
alias CryptoPrices.Aggregator | |
use Supervisor | |
def start_link(opts) do | |
Supervisor.start_link(__MODULE__, opts, name: __MODULE__) | |
end | |
def init(opts) do |
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
iex(14)> Ethereumex.HttpClient.eth_call(%{ data: "0x" <> data, to: "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07"}) | |
{:ok, "0x00000000000000000000000000000000000000000000000005698eef06670000"} |
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
{:ok, address } = | |
"0x456196dfa8eb4534669a01c5933c3bba2ba0d018" | |
|> String.slice(2..-1) | |
|> Base.decode16(case: :mixed) | |
data = ABI.encode("balanceOf(address)", [address]) | |
|> Base.encode16(case: :lower) | |
# 70a08231000000000000000000000000456196dfa8eb4534669a01c5933c3bba2ba0d018 |
NewerOlder