Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xchainjs/xchain-evm-providers

Package Overview
Dependencies
Maintainers
0
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xchainjs/xchain-evm-providers - npm Package Compare versions

Comparing version 0.1.13 to 1.0.0

lib/types/index.d.ts

1

lib/index.d.ts

@@ -6,1 +6,2 @@ /**

export * from './providers';
export * from './types';

36

lib/index.esm.js
import { TxType, FeeOption } from '@xchainjs/xchain-client';
import { bnOrZero, baseAmount, assetFromString, assetToString } from '@xchainjs/xchain-util';
import { bnOrZero, baseAmount, assetFromString, assetToString, AssetType } from '@xchainjs/xchain-util';
import axios from 'axios';

@@ -513,3 +513,3 @@ import { ethers } from 'ethers';

ticker: tokenTicker,
synth: false,
type: AssetType.TOKEN,
};

@@ -676,4 +676,5 @@ const contract = new ethers.Contract(contractAddress, erc20ABI, this.provider);

// TODO: Study why this is needed
const AVAXChain = 'AVAX';
const AssetAVAX = { chain: AVAXChain, symbol: 'AVAX', ticker: 'AVAX', synth: false };
const AssetAVAX = { chain: AVAXChain, symbol: 'AVAX', ticker: 'AVAX', type: AssetType.NATIVE };
class CovalentProvider {

@@ -699,2 +700,11 @@ constructor(apiKey, chain, chainId, nativeAsset, nativeAssetDecimals) {

symbol = balance.contract_ticker_symbol;
balances.push({
asset: {
chain: this.chain,
symbol,
ticker: balance.contract_ticker_symbol,
type: AssetType.NATIVE,
},
amount: baseAmount(balance.balance, balance.contract_decimals),
});
}

@@ -704,12 +714,12 @@ else {

symbol = `${balance.contract_ticker_symbol}-${balance.contract_address}`;
balances.push({
asset: {
chain: this.chain,
symbol,
ticker: balance.contract_ticker_symbol,
type: AssetType.TOKEN,
},
amount: baseAmount(balance.balance, balance.contract_decimals),
});
}
balances.push({
asset: {
chain: this.chain,
symbol,
ticker: balance.contract_ticker_symbol,
synth: false,
},
amount: baseAmount(balance.balance, balance.contract_decimals),
});
}

@@ -761,3 +771,3 @@ let finalBalances = balances;

ticker: transferEvent.sender_contract_ticker_symbol,
synth: false,
type: AssetType.TOKEN,
},

@@ -764,0 +774,0 @@ from,

@@ -521,3 +521,3 @@ 'use strict';

ticker: tokenTicker,
synth: false,
type: xchainUtil.AssetType.TOKEN,
};

@@ -684,4 +684,5 @@ const contract = new ethers.ethers.Contract(contractAddress, erc20ABI, this.provider);

// TODO: Study why this is needed
const AVAXChain = 'AVAX';
const AssetAVAX = { chain: AVAXChain, symbol: 'AVAX', ticker: 'AVAX', synth: false };
const AssetAVAX = { chain: AVAXChain, symbol: 'AVAX', ticker: 'AVAX', type: xchainUtil.AssetType.NATIVE };
class CovalentProvider {

@@ -707,2 +708,11 @@ constructor(apiKey, chain, chainId, nativeAsset, nativeAssetDecimals) {

symbol = balance.contract_ticker_symbol;
balances.push({
asset: {
chain: this.chain,
symbol,
ticker: balance.contract_ticker_symbol,
type: xchainUtil.AssetType.NATIVE,
},
amount: xchainUtil.baseAmount(balance.balance, balance.contract_decimals),
});
}

@@ -712,12 +722,12 @@ else {

symbol = `${balance.contract_ticker_symbol}-${balance.contract_address}`;
balances.push({
asset: {
chain: this.chain,
symbol,
ticker: balance.contract_ticker_symbol,
type: xchainUtil.AssetType.TOKEN,
},
amount: xchainUtil.baseAmount(balance.balance, balance.contract_decimals),
});
}
balances.push({
asset: {
chain: this.chain,
symbol,
ticker: balance.contract_ticker_symbol,
synth: false,
},
amount: xchainUtil.baseAmount(balance.balance, balance.contract_decimals),
});
}

@@ -769,3 +779,3 @@ let finalBalances = balances;

ticker: transferEvent.sender_contract_ticker_symbol,
synth: false,
type: xchainUtil.AssetType.TOKEN,
},

@@ -772,0 +782,0 @@ from,

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

import { Balance, EvmOnlineDataProvider, FeeRates, Tx, TxHistoryParams, TxsPage } from '@xchainjs/xchain-client';
import { FeeRates, TxHistoryParams } from '@xchainjs/xchain-client';
import { Address, Asset, Chain } from '@xchainjs/xchain-util';
import { Balance, CompatibleAsset, EvmOnlineDataProvider, Tx, TxsPage } from '../../types';
export declare class CovalentProvider implements EvmOnlineDataProvider {

@@ -11,3 +12,3 @@ private baseUrl;

constructor(apiKey: string, chain: Chain, chainId: number, nativeAsset: Asset, nativeAssetDecimals: number);
getBalance(address: Address, assets?: Asset[]): Promise<Balance[]>;
getBalance(address: Address, assets?: CompatibleAsset[]): Promise<Balance[]>;
private buildNativeTx;

@@ -14,0 +15,0 @@ private buildNonNativeTx;

@@ -1,4 +0,4 @@

import { Tx } from '@xchainjs/xchain-client';
import { Asset, Chain } from '@xchainjs/xchain-util';
import { BigNumberish } from 'ethers';
import { Tx } from '../../types';
import { ETHTransactionInfo, GasOracleResponse, TokenBalanceParam, TokenTransactionInfo, TransactionHistoryParam } from './etherscan-api-types';

@@ -5,0 +5,0 @@ /**

import { Provider } from '@ethersproject/abstract-provider';
import { Balance, EvmOnlineDataProvider, FeeRates, Tx, TxHistoryParams, TxsPage } from '@xchainjs/xchain-client';
import { FeeRates, TxHistoryParams } from '@xchainjs/xchain-client';
import { Address, Asset, Chain } from '@xchainjs/xchain-util';
import { Balance, CompatibleAsset, EvmOnlineDataProvider, Tx, TxsPage } from '../../types';
export declare class EtherscanProvider implements EvmOnlineDataProvider {

@@ -12,3 +13,3 @@ private provider;

constructor(provider: Provider, baseUrl: string, apiKey: string, chain: Chain, nativeAsset: Asset, nativeAssetDecimals: number);
getBalance(address: Address, assets?: Asset[]): Promise<Balance[]>;
getBalance(address: Address, assets?: CompatibleAsset[]): Promise<Balance[]>;
private getNativeAssetBalance;

@@ -15,0 +16,0 @@ private getTokenBalance;

import { Provider } from '@ethersproject/abstract-provider';
import { TxHistoryParams, TxsPage } from '@xchainjs/xchain-client';
import { TxHistoryParams } from '@xchainjs/xchain-client';
import { Asset } from '@xchainjs/xchain-util';
import { TxsPage } from '../../types';
import { EtherscanProvider } from '../etherscan/etherscan-data-provider';

@@ -5,0 +6,0 @@ export declare class RoutescanProvider extends EtherscanProvider {

{
"name": "@xchainjs/xchain-evm-providers",
"version": "0.1.13",
"version": "1.0.0",
"license": "MIT",

@@ -32,4 +32,4 @@ "main": "lib/index.js",

"@supercharge/promise-pool": "2.4.0",
"@xchainjs/xchain-client": "0.16.8",
"@xchainjs/xchain-util": "0.13.7",
"@xchainjs/xchain-client": "1.0.0",
"@xchainjs/xchain-util": "1.0.0",
"axios": "1.3.6",

@@ -36,0 +36,0 @@ "ethers": "5.7.2"

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