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
15
Versions
453
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 3.1.0 to 3.2.0

build/constants/erc20.abi.d.ts

2

build/index.d.ts

@@ -1,3 +0,3 @@

export { generateExampleQuery, connectProvider, getContract, getTxLink, formatWithNumeral, buildEnsDataLoader, ensLookup, ensLookups, unixDateFromNow, dateFromNow, dateStringFromNow, dateUntilNow, formatDuration, formatHourMin, getDate, blocksToDays, delegatorCooldownToDays, formatDayHourMin, formatDays, formatUnits, formatUnitsToNumber, toGRT, formatNameHash, bigNumberify, decToBigNumber, overrides, FormatNumeralOptions, FormatUnitsOptions, ToGRTOptions, toWei, addrShortener, checkAllowance, purchaseTargetAmount, saleTargetAmount, tokensToSignal, TokensToSignalPair, vSignalToNSignal, signalToTokens, TokensToNSignalTriple, tokensToNSignal, NSignalToTokensPair, nSignalToTokens, nSignalToVSignal, getEventTypeFromTypename, getEventInterface, buildEventInterfaceList } from './utils';
export { generateExampleQuery, connectProvider, getContract, getTxLink, formatWithNumeral, buildEnsDataLoader, ensLookup, ensLookups, unixDateFromNow, dateFromNow, dateStringFromNow, dateUntilNow, formatDuration, formatHourMin, getDate, blocksToDays, delegatorCooldownToDays, formatDayHourMin, formatDays, formatUnits, formatUnitsToNumber, toGRT, formatNameHash, bigNumberify, decToBigNumber, overrides, FormatNumeralOptions, FormatUnitsOptions, ToGRTOptions, toWei, addrShortener, checkAllowance, purchaseTargetAmount, saleTargetAmount, tokensToSignal, TokensToSignalPair, vSignalToNSignal, signalToTokens, TokensToNSignalTriple, tokensToNSignal, NSignalToTokensPair, nSignalToTokens, nSignalToVSignal, getEventTypeFromTypename, getEventInterface, buildEventInterfaceList, getERC20Balance } from './utils';
export * from './models';
export { SECONDS_IN_DAY, ETHEREUM_BLOCK_TIME, NETWORKS } from './constants';

@@ -63,2 +63,10 @@ import gql from 'graphql-tag';

var erc20Abi = [
'function balanceOf(address owner) view returns (uint256)',
'function decimals() view returns (uint8)',
'function symbol() view returns (string)',
'function transfer(address to, uint amount) returns (bool)',
'event Transfer(address indexed from, address indexed to, uint amount)'
];
/**

@@ -206,2 +214,13 @@ * Get provider

};
/**
* Get ERC20 balance of a wallet
* @param walletAddress Address of interest
* @param tokenAddress Address of ERC20
* @param provider Web3 provider
* @returns Balance of ERC20 in provided wallet
*/
const getERC20Balance = async (walletAddress, tokenAddress, provider) => {
const contract = new Contract(tokenAddress, erc20Abi, provider);
return contract.balanceOf(walletAddress);
};

@@ -816,3 +835,3 @@ Object.assign(numeral.localeData('en'), {

export { AllocationStatus, DisputeStatus, DisputeType, ETHEREUM_BLOCK_TIME, EventType, NETWORKS, Revocability, SECONDS_IN_DAY, SubgraphIndexHealth, TransactionType, addrShortener, bigNumberify, blocksToDays, buildEnsDataLoader, buildEventInterfaceList, checkAllowance, connectProvider, dateFromNow, dateStringFromNow, dateUntilNow, decToBigNumber, delegatorCooldownToDays, ensLookup, ensLookups, formatDayHourMin, formatDays, formatDuration, formatHourMin, formatNameHash, formatUnits, formatUnitsToNumber, formatWithNumeral, generateExampleQuery, getContract, getDate, getEventInterface, getEventTypeFromTypename, getTxLink, nSignalToTokens, nSignalToVSignal, overrides, purchaseTargetAmount, saleTargetAmount, signalToTokens, toGRT, toWei, tokensToNSignal, tokensToSignal, unixDateFromNow, vSignalToNSignal };
export { AllocationStatus, DisputeStatus, DisputeType, ETHEREUM_BLOCK_TIME, EventType, NETWORKS, Revocability, SECONDS_IN_DAY, SubgraphIndexHealth, TransactionType, addrShortener, bigNumberify, blocksToDays, buildEnsDataLoader, buildEventInterfaceList, checkAllowance, connectProvider, dateFromNow, dateStringFromNow, dateUntilNow, decToBigNumber, delegatorCooldownToDays, ensLookup, ensLookups, formatDayHourMin, formatDays, formatDuration, formatHourMin, formatNameHash, formatUnits, formatUnitsToNumber, formatWithNumeral, generateExampleQuery, getContract, getDate, getERC20Balance, getEventInterface, getEventTypeFromTypename, getTxLink, nSignalToTokens, nSignalToVSignal, overrides, purchaseTargetAmount, saleTargetAmount, signalToTokens, toGRT, toWei, tokensToNSignal, tokensToSignal, unixDateFromNow, vSignalToNSignal };
//# sourceMappingURL=index.esm.js.map

@@ -77,2 +77,10 @@ 'use strict';

var erc20Abi = [
'function balanceOf(address owner) view returns (uint256)',
'function decimals() view returns (uint8)',
'function symbol() view returns (string)',
'function transfer(address to, uint amount) returns (bool)',
'event Transfer(address indexed from, address indexed to, uint amount)'
];
/**

@@ -220,2 +228,13 @@ * Get provider

};
/**
* Get ERC20 balance of a wallet
* @param walletAddress Address of interest
* @param tokenAddress Address of ERC20
* @param provider Web3 provider
* @returns Balance of ERC20 in provided wallet
*/
const getERC20Balance = async (walletAddress, tokenAddress, provider) => {
const contract = new ethers.Contract(tokenAddress, erc20Abi, provider);
return contract.balanceOf(walletAddress);
};

@@ -858,2 +877,3 @@ Object.assign(numeral__default['default'].localeData('en'), {

exports.getDate = getDate;
exports.getERC20Balance = getERC20Balance;
exports.getEventInterface = getEventInterface;

@@ -860,0 +880,0 @@ exports.getEventTypeFromTypename = getEventTypeFromTypename;

@@ -68,1 +68,9 @@ import DataLoader from 'dataloader';

}>;
/**
* Get ERC20 balance of a wallet
* @param walletAddress Address of interest
* @param tokenAddress Address of ERC20
* @param provider Web3 provider
* @returns Balance of ERC20 in provided wallet
*/
export declare const getERC20Balance: (walletAddress: string, tokenAddress: string, provider: providers.BaseProvider | Signer) => Promise<BigNumber>;
{
"name": "@edgeandnode/common",
"version": "3.1.0",
"version": "3.2.0",
"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