New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@edgeandnode/common

Package Overview
Dependencies
Maintainers
19
Versions
468
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@edgeandnode/common - npm Package Compare versions

Comparing version 4.11.0 to 4.11.1

51

build/index.esm.js

@@ -1041,3 +1041,52 @@ import { gql } from 'graphql-tag';

export { AllocationStatus, DisputeStatus, DisputeType, ETHEREUM_BLOCK_TIME, EventType, GRTBufferedMaxUint256, GrtUsdcUniswapPair, MAX_WEIGHT, NETWORKS, NetworkEnum, PPM, Revocability, SECONDS_IN_DAY, SIGNAL_PER_MINIMUM_DEPOSIT, SubgraphIndexHealth, TenTrillion, TransactionType, ZERO, addrShortener, appendEth, appendQueryParam, bigNumberify, blocksToDays, buildEnsDataLoader, buildEventInterfaceList, buildSubgraphId, checkAllowance, connectProvider, convertSubgraphId, convertSubgraphIdtoBase58, dateFromNow, dateStringFromNow, dateUntilNow, decToBigNumber, delegatorCooldownToDays, ensLookup, ensLookups, ensNameBuilder, formatDayHourMin, formatDays, formatDuration, formatHourMin, formatNameHash, formatUnits, formatUnitsToNumber, formatWithNumeral, generateExampleQuery, generateExampleQueryForField, generateExampleQueryForFieldWithNamedType, generateExampleQueryForFieldWithType, generateExampleQueryForType, getContract, getDate, getERC20Balance, getEventInterface, getEventTypeFromTypename, getGnosisTxLink, getNetworkId, getNetworkName, getTxLink, increaseGas, isV1SubgraphId, nSignalToTokens, nSignalToVSignal, overrides, pickExampleFields, pickExampleTypes, purchaseTargetAmount, saleTargetAmount, signalToTokens, toCamelCase, toGRT, toPlural, toWei, tokensToNSignal, tokensToSignal, unixDateFromNow, vSignalToNSignal };
var UniV2PairAbi = [
{
constant: true,
inputs: [],
name: 'getReserves',
outputs: [
{ internalType: 'uint112', name: '_reserve0', type: 'uint112' },
{ internalType: 'uint112', name: '_reserve1', type: 'uint112' },
{ internalType: 'uint32', name: '_blockTimestampLast', type: 'uint32' }
],
payable: false,
stateMutability: 'view',
type: 'function'
},
{
constant: true,
inputs: [],
name: 'token0',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
payable: false,
stateMutability: 'view',
type: 'function'
},
{
constant: true,
inputs: [],
name: 'token1',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
payable: false,
stateMutability: 'view',
type: 'function'
}
];
/**
* Get current GRT price in USD
* @param provider Ethers provider
* @returns Current GRT price in USD
*/
const getGrtPriceUsd = async (provider) => {
const pairContract = new Contract(GrtUsdcUniswapPair, UniV2PairAbi, provider);
const reserves = await pairContract.getReserves();
const usdc = reserves._reserve0;
const usdcFormatted = Number(utils.formatUnits(usdc, 6));
const grt = reserves._reserve1;
const grtFormatted = Number(utils.formatEther(grt));
return usdcFormatted / grtFormatted;
};
export { AllocationStatus, DisputeStatus, DisputeType, ETHEREUM_BLOCK_TIME, EventType, GRTBufferedMaxUint256, GrtUsdcUniswapPair, MAX_WEIGHT, NETWORKS, NetworkEnum, PPM, Revocability, SECONDS_IN_DAY, SIGNAL_PER_MINIMUM_DEPOSIT, SubgraphIndexHealth, TenTrillion, TransactionType, ZERO, addrShortener, appendEth, appendQueryParam, bigNumberify, blocksToDays, buildEnsDataLoader, buildEventInterfaceList, buildSubgraphId, checkAllowance, connectProvider, convertSubgraphId, convertSubgraphIdtoBase58, dateFromNow, dateStringFromNow, dateUntilNow, decToBigNumber, delegatorCooldownToDays, ensLookup, ensLookups, ensNameBuilder, formatDayHourMin, formatDays, formatDuration, formatHourMin, formatNameHash, formatUnits, formatUnitsToNumber, formatWithNumeral, generateExampleQuery, generateExampleQueryForField, generateExampleQueryForFieldWithNamedType, generateExampleQueryForFieldWithType, generateExampleQueryForType, getContract, getDate, getERC20Balance, getEventInterface, getEventTypeFromTypename, getGnosisTxLink, getGrtPriceUsd, getNetworkId, getNetworkName, getTxLink, increaseGas, isV1SubgraphId, nSignalToTokens, nSignalToVSignal, overrides, pickExampleFields, pickExampleTypes, purchaseTargetAmount, saleTargetAmount, signalToTokens, toCamelCase, toGRT, toPlural, toWei, tokensToNSignal, tokensToSignal, unixDateFromNow, vSignalToNSignal };
//# sourceMappingURL=index.esm.js.map

@@ -1054,2 +1054,51 @@ 'use strict';

var UniV2PairAbi = [
{
constant: true,
inputs: [],
name: 'getReserves',
outputs: [
{ internalType: 'uint112', name: '_reserve0', type: 'uint112' },
{ internalType: 'uint112', name: '_reserve1', type: 'uint112' },
{ internalType: 'uint32', name: '_blockTimestampLast', type: 'uint32' }
],
payable: false,
stateMutability: 'view',
type: 'function'
},
{
constant: true,
inputs: [],
name: 'token0',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
payable: false,
stateMutability: 'view',
type: 'function'
},
{
constant: true,
inputs: [],
name: 'token1',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
payable: false,
stateMutability: 'view',
type: 'function'
}
];
/**
* Get current GRT price in USD
* @param provider Ethers provider
* @returns Current GRT price in USD
*/
const getGrtPriceUsd = async (provider) => {
const pairContract = new ethers.Contract(GrtUsdcUniswapPair, UniV2PairAbi, provider);
const reserves = await pairContract.getReserves();
const usdc = reserves._reserve0;
const usdcFormatted = Number(ethers.utils.formatUnits(usdc, 6));
const grt = reserves._reserve1;
const grtFormatted = Number(ethers.utils.formatEther(grt));
return usdcFormatted / grtFormatted;
};
exports.ETHEREUM_BLOCK_TIME = ETHEREUM_BLOCK_TIME;

@@ -1104,2 +1153,3 @@ exports.GRTBufferedMaxUint256 = GRTBufferedMaxUint256;

exports.getGnosisTxLink = getGnosisTxLink;
exports.getGrtPriceUsd = getGrtPriceUsd;
exports.getNetworkId = getNetworkId;

@@ -1106,0 +1156,0 @@ exports.getNetworkName = getNetworkName;

@@ -12,1 +12,2 @@ export * from './graphql.utils';

export * from './string.utils';
export * from './grt.utils';

2

package.json
{
"name": "@edgeandnode/common",
"version": "4.11.0",
"version": "4.11.1",
"description": "Common Edge & Node utils and types",

@@ -5,0 +5,0 @@ "main": "build/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc