12 lines
333 B
Ruby
12 lines
333 B
Ruby
class Metapurse < ActiveRecord::Base
|
|
belongs_to :user
|
|
def icpswap_pool_data_raw
|
|
icpswap_pool_data_raw = `dfx --identity anonymous canister --network=ic call ggzvv-5qaaa-aaaag-qck7a-cai getAllPools`
|
|
end
|
|
|
|
def icp_usd
|
|
JSON.parse(`curl -s https://www.binance.com/api/v3/avgPrice?symbol=ICPUSDT`)["price"].to_f
|
|
end
|
|
|
|
end
|