Fix icpswap pool index parser
This commit is contained in:
parent
f6047bb928
commit
b16813fa84
@ -31,7 +31,7 @@
|
||||
$#{number_with_delimiter(value_amount)} USD
|
||||
- total_value += value_amount rescue 0
|
||||
- else
|
||||
- value = icpswap_pool_data_raw.split("record {").select{|pool| !pool.scan(canister_id).empty? && !pool.scan(icp_canister_id).empty? }[0].scan(/token0Price = [+-]?([1-9]\d*|0)(\.\d+)?/).join.to_f rescue nil
|
||||
- value = icpswap_pool_data_raw.split("record {").select{|pool| !pool.scan(canister_id).empty? && !pool.scan(icp_canister_id).empty? }[-1].scan(/token0Price = [+-]?([1-9]\d*|0)(\.\d+)?/).join.to_f rescue nil
|
||||
*
|
||||
= "$#{value.round(2)}"
|
||||
= icpswap_pool_data_raw.split("record {").select{|pool| !pool.scan(canister_id).empty? && !pool.scan(icp_canister_id).empty? }[0].scan(/token0Symbol = \"(.*)\"; /)[0][0] rescue nil
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user