@xchainjs/xchain-evm-providers
Advanced tools
Comparing version 0.1.13 to 1.0.0
@@ -6,1 +6,2 @@ /** | ||
export * from './providers'; | ||
export * from './types'; |
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" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
80539
16
2264
1
+ Added@xchainjs/xchain-client@1.0.0(transitive)
+ Added@xchainjs/xchain-util@1.0.0(transitive)
- Removed@xchainjs/xchain-client@0.16.8(transitive)
- Removed@xchainjs/xchain-util@0.13.7(transitive)
Updated@xchainjs/xchain-util@1.0.0