@xchainjs/xchain-evm
Advanced tools
Comparing version 0.1.5 to 0.2.0
@@ -9,3 +9,3 @@ import { Provider, TransactionResponse } from '@ethersproject/abstract-provider'; | ||
*/ | ||
declare type EvmDefaults = { | ||
type EvmDefaults = { | ||
transferGasAssetGasLimit: BigNumber; | ||
@@ -16,3 +16,3 @@ transferTokenGasLimit: BigNumber; | ||
}; | ||
export declare type EVMClientParams = XChainClientParams & { | ||
export type EVMClientParams = XChainClientParams & { | ||
chain: Chain; | ||
@@ -19,0 +19,0 @@ gasAsset: Asset; |
@@ -0,0 +0,0 @@ export * from './types'; |
import { BaseXChainClient, Network, FeeOption, checkFeeBounds, standardFeeRates, FeeType, TxType } from '@xchainjs/xchain-client'; | ||
import { baseAmount, assetToString, eqAsset, bnOrZero, assetFromString } from '@xchainjs/xchain-util'; | ||
import { baseAmount, eqAsset, assetToString, bnOrZero, assetFromString } from '@xchainjs/xchain-util'; | ||
import { ethers, Wallet, BigNumber } from 'ethers'; | ||
@@ -7,3 +7,3 @@ import { HDNode, toUtf8Bytes } from 'ethers/lib/utils'; | ||
/*! ***************************************************************************** | ||
/****************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
@@ -33,3 +33,3 @@ | ||
var erc20ABI = [ | ||
var erc20ABI$1 = [ | ||
{ | ||
@@ -276,3 +276,3 @@ inputs: [ | ||
*/ | ||
const validateAddress = (address) => { | ||
const validateAddress$1 = (address) => { | ||
try { | ||
@@ -390,3 +390,3 @@ ethers.utils.getAddress(address); | ||
const txAmount = ethers.BigNumber.from((_a = amount === null || amount === void 0 ? void 0 : amount.amount().toFixed()) !== null && _a !== void 0 ? _a : 1); | ||
const contract = new ethers.Contract(contractAddress, erc20ABI, provider); | ||
const contract = new ethers.Contract(contractAddress, erc20ABI$1, provider); | ||
const allowance = yield contract.allowance(fromAddress, spenderAddress); | ||
@@ -541,3 +541,3 @@ return txAmount.lte(allowance); | ||
validateAddress(address) { | ||
return validateAddress(address); | ||
return validateAddress$1(address); | ||
} | ||
@@ -694,3 +694,3 @@ /** | ||
const valueToApprove = getApprovalAmount(amount); | ||
const contract = new ethers.Contract(contractAddress, erc20ABI, this.getProvider()); | ||
const contract = new ethers.Contract(contractAddress, erc20ABI$1, this.getProvider()); | ||
/* as same as ethers.TransactionResponse expected by `sendTransaction` */ | ||
@@ -720,3 +720,3 @@ const unsignedTx = yield contract.populateTransaction.approve(spenderAddress, valueToApprove); | ||
fromAddress, | ||
abi: erc20ABI, | ||
abi: erc20ABI$1, | ||
amount, | ||
@@ -787,3 +787,3 @@ }); | ||
contractAddress: assetAddress, | ||
abi: erc20ABI, | ||
abi: erc20ABI$1, | ||
funcName: 'transfer', | ||
@@ -864,3 +864,3 @@ funcParams: [recipient, txAmount, Object.assign({}, overrides)], | ||
throw Error(`Can't get address from asset ${assetToString(theAsset)}`); | ||
const contract = new ethers.Contract(assetAddress, erc20ABI, this.getProvider()); | ||
const contract = new ethers.Contract(assetAddress, erc20ABI$1, this.getProvider()); | ||
gasEstimate = yield contract.estimateGas.transfer(recipient, txAmount, { | ||
@@ -927,3 +927,3 @@ from: this.getAddress(), | ||
var erc20ABI$1 = [ | ||
var erc20ABI = [ | ||
{ | ||
@@ -1163,3 +1163,3 @@ inputs: [ | ||
const MAX_APPROVAL$1 = ethers.BigNumber.from(2).pow(256).sub(1); | ||
ethers.BigNumber.from(2).pow(256).sub(1); | ||
/** | ||
@@ -1171,3 +1171,3 @@ * Validate the given address. | ||
*/ | ||
const validateAddress$1 = (address) => { | ||
const validateAddress = (address) => { | ||
try { | ||
@@ -1242,3 +1242,3 @@ ethers.utils.getAddress(address); | ||
const address = tx.contractAddress; | ||
if (validateSymbol(symbol) && validateAddress$1(address)) { | ||
if (validateSymbol(symbol) && validateAddress(address)) { | ||
const tokenAsset = assetFromString(`${chain}.${symbol}-${address}`); | ||
@@ -1399,3 +1399,3 @@ if (tokenAsset) { | ||
}; | ||
const contract = new ethers.Contract(contractAddress, erc20ABI$1, this.provider); | ||
const contract = new ethers.Contract(contractAddress, erc20ABI, this.provider); | ||
const balance = (yield contract.balanceOf(address)).toString(); | ||
@@ -1945,6 +1945,6 @@ const decimals = (yield contract.decimals()).toString(); | ||
router: routerABI, | ||
erc20: erc20ABI, | ||
erc20: erc20ABI$1, | ||
}; | ||
export { Client, EtherscanProvider, MAX_APPROVAL, abi, call, estimateApprove, estimateCall, getApprovalAmount, getPrefix, getTokenAddress, isApproved, strip0x, validateAddress }; | ||
export { Client, EtherscanProvider, MAX_APPROVAL, abi, call, estimateApprove, estimateCall, getApprovalAmount, getPrefix, getTokenAddress, isApproved, strip0x, validateAddress$1 as validateAddress }; | ||
//# sourceMappingURL=index.esm.js.map |
@@ -15,3 +15,3 @@ 'use strict'; | ||
/*! ***************************************************************************** | ||
/****************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
@@ -41,3 +41,3 @@ | ||
var erc20ABI = [ | ||
var erc20ABI$1 = [ | ||
{ | ||
@@ -284,3 +284,3 @@ inputs: [ | ||
*/ | ||
const validateAddress = (address) => { | ||
const validateAddress$1 = (address) => { | ||
try { | ||
@@ -398,3 +398,3 @@ ethers.ethers.utils.getAddress(address); | ||
const txAmount = ethers.ethers.BigNumber.from((_a = amount === null || amount === void 0 ? void 0 : amount.amount().toFixed()) !== null && _a !== void 0 ? _a : 1); | ||
const contract = new ethers.ethers.Contract(contractAddress, erc20ABI, provider); | ||
const contract = new ethers.ethers.Contract(contractAddress, erc20ABI$1, provider); | ||
const allowance = yield contract.allowance(fromAddress, spenderAddress); | ||
@@ -549,3 +549,3 @@ return txAmount.lte(allowance); | ||
validateAddress(address) { | ||
return validateAddress(address); | ||
return validateAddress$1(address); | ||
} | ||
@@ -702,3 +702,3 @@ /** | ||
const valueToApprove = getApprovalAmount(amount); | ||
const contract = new ethers.ethers.Contract(contractAddress, erc20ABI, this.getProvider()); | ||
const contract = new ethers.ethers.Contract(contractAddress, erc20ABI$1, this.getProvider()); | ||
/* as same as ethers.TransactionResponse expected by `sendTransaction` */ | ||
@@ -728,3 +728,3 @@ const unsignedTx = yield contract.populateTransaction.approve(spenderAddress, valueToApprove); | ||
fromAddress, | ||
abi: erc20ABI, | ||
abi: erc20ABI$1, | ||
amount, | ||
@@ -795,3 +795,3 @@ }); | ||
contractAddress: assetAddress, | ||
abi: erc20ABI, | ||
abi: erc20ABI$1, | ||
funcName: 'transfer', | ||
@@ -872,3 +872,3 @@ funcParams: [recipient, txAmount, Object.assign({}, overrides)], | ||
throw Error(`Can't get address from asset ${xchainUtil.assetToString(theAsset)}`); | ||
const contract = new ethers.ethers.Contract(assetAddress, erc20ABI, this.getProvider()); | ||
const contract = new ethers.ethers.Contract(assetAddress, erc20ABI$1, this.getProvider()); | ||
gasEstimate = yield contract.estimateGas.transfer(recipient, txAmount, { | ||
@@ -935,3 +935,3 @@ from: this.getAddress(), | ||
var erc20ABI$1 = [ | ||
var erc20ABI = [ | ||
{ | ||
@@ -1171,3 +1171,3 @@ inputs: [ | ||
const MAX_APPROVAL$1 = ethers.ethers.BigNumber.from(2).pow(256).sub(1); | ||
ethers.ethers.BigNumber.from(2).pow(256).sub(1); | ||
/** | ||
@@ -1179,3 +1179,3 @@ * Validate the given address. | ||
*/ | ||
const validateAddress$1 = (address) => { | ||
const validateAddress = (address) => { | ||
try { | ||
@@ -1250,3 +1250,3 @@ ethers.ethers.utils.getAddress(address); | ||
const address = tx.contractAddress; | ||
if (validateSymbol(symbol) && validateAddress$1(address)) { | ||
if (validateSymbol(symbol) && validateAddress(address)) { | ||
const tokenAsset = xchainUtil.assetFromString(`${chain}.${symbol}-${address}`); | ||
@@ -1299,3 +1299,3 @@ if (tokenAsset) { | ||
url += `&endblock=${endblock}`; | ||
const result = (yield axios__default['default'].get(url)).data.result; | ||
const result = (yield axios__default["default"].get(url)).data.result; | ||
if (JSON.stringify(result).includes('Invalid API Key')) | ||
@@ -1334,3 +1334,3 @@ throw new Error('Invalid API Key'); | ||
url += `&endblock=${endblock}`; | ||
const result = (yield axios__default['default'].get(url)).data.result; | ||
const result = (yield axios__default["default"].get(url)).data.result; | ||
if (JSON.stringify(result).includes('Invalid API Key')) | ||
@@ -1382,3 +1382,3 @@ throw new Error('Invalid API Key'); | ||
// Get All Erc-20 txs | ||
const response = (yield axios__default['default'].get(`${this.baseUrl}/api?module=account&action=tokentx&address=${address}&startblock=0&sort=asc&apikey=${this.apiKey}`)).data; | ||
const response = (yield axios__default["default"].get(`${this.baseUrl}/api?module=account&action=tokentx&address=${address}&startblock=0&sort=asc&apikey=${this.apiKey}`)).data; | ||
const erc20TokenTxs = this.getUniqueContractAddresses(response.result); | ||
@@ -1410,3 +1410,3 @@ for (const erc20Token of erc20TokenTxs) { | ||
}; | ||
const contract = new ethers.ethers.Contract(contractAddress, erc20ABI$1, this.provider); | ||
const contract = new ethers.ethers.Contract(contractAddress, erc20ABI, this.provider); | ||
const balance = (yield contract.balanceOf(address)).toString(); | ||
@@ -1956,3 +1956,3 @@ const decimals = (yield contract.decimals()).toString(); | ||
router: routerABI, | ||
erc20: erc20ABI, | ||
erc20: erc20ABI$1, | ||
}; | ||
@@ -1972,3 +1972,3 @@ | ||
exports.strip0x = strip0x; | ||
exports.validateAddress = validateAddress; | ||
exports.validateAddress = validateAddress$1; | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ import { Balance, Fees, OnlineDataProvider, Tx, TxHistoryParams, TxsPage } from '@xchainjs/xchain-client'; |
import { Address } from '@xchainjs/xchain-util'; | ||
export declare type GetBalanceResponse = { | ||
export type GetBalanceResponse = { | ||
data: { | ||
@@ -15,3 +15,3 @@ items: [ | ||
}; | ||
export declare type LogEventParam = { | ||
export type LogEventParam = { | ||
name: string; | ||
@@ -21,3 +21,3 @@ type: string; | ||
}; | ||
export declare type LogEvent = { | ||
export type LogEvent = { | ||
sender_contract_decimals: number; | ||
@@ -28,7 +28,7 @@ sender_contract_ticker_symbol: string | null | undefined; | ||
}; | ||
export declare type DecodedEvent = { | ||
export type DecodedEvent = { | ||
name: string; | ||
params: LogEventParam[] | null | undefined; | ||
}; | ||
export declare type GetTransactionsItem = { | ||
export type GetTransactionsItem = { | ||
tx_hash: string; | ||
@@ -41,3 +41,3 @@ block_signed_at: string; | ||
}; | ||
export declare type GetTransactionsResponse = { | ||
export type GetTransactionsResponse = { | ||
data: { | ||
@@ -54,3 +54,3 @@ address: string; | ||
}; | ||
export declare type GetTransactionResponse = { | ||
export type GetTransactionResponse = { | ||
data: { | ||
@@ -60,3 +60,3 @@ items: GetTransactionsItem[]; | ||
}; | ||
export declare type getTxsParams = { | ||
export type getTxsParams = { | ||
address: Address; | ||
@@ -63,0 +63,0 @@ offset: number; |
@@ -1,2 +0,2 @@ | ||
export declare type GasOracleResponse = { | ||
export type GasOracleResponse = { | ||
LastBlock: string; | ||
@@ -7,7 +7,7 @@ SafeGasPrice: string; | ||
}; | ||
export declare type TokenBalanceParam = { | ||
export type TokenBalanceParam = { | ||
address: string; | ||
assetAddress: string; | ||
}; | ||
export declare type TransactionHistoryParam = { | ||
export type TransactionHistoryParam = { | ||
address?: string; | ||
@@ -20,3 +20,3 @@ assetAddress?: string; | ||
}; | ||
export declare type TokenTransactionInfo = { | ||
export type TokenTransactionInfo = { | ||
blockNumber: string; | ||
@@ -42,3 +42,3 @@ timeStamp: string; | ||
}; | ||
export declare type ETHTransactionInfo = { | ||
export type ETHTransactionInfo = { | ||
blockNumber: string; | ||
@@ -45,0 +45,0 @@ timeStamp: string; |
@@ -22,3 +22,3 @@ import { Tx } from '@xchainjs/xchain-client'; | ||
*/ | ||
export declare const validateSymbol: (symbol?: string | null | undefined) => boolean; | ||
export declare const validateSymbol: (symbol?: string | null) => boolean; | ||
/** | ||
@@ -47,3 +47,3 @@ * Get transactions from ETH transaction | ||
*/ | ||
export declare const getGasOracle: (baseUrl: string, apiKey?: string | undefined) => Promise<GasOracleResponse>; | ||
export declare const getGasOracle: (baseUrl: string, apiKey?: string) => Promise<GasOracleResponse>; | ||
/** | ||
@@ -50,0 +50,0 @@ * Get token balance |
@@ -0,0 +0,0 @@ import { Provider } from '@ethersproject/abstract-provider'; |
import { Address } from '@xchainjs/xchain-util'; | ||
export declare type ERC20Tx = { | ||
export type ERC20Tx = { | ||
timeStamp: string; | ||
@@ -13,3 +13,3 @@ hash: string; | ||
}; | ||
export declare type GasAssetTx = { | ||
export type GasAssetTx = { | ||
timeStamp: string; | ||
@@ -22,3 +22,3 @@ hash: string; | ||
}; | ||
export declare type GetERC20TxsResponse = { | ||
export type GetERC20TxsResponse = { | ||
status: string; | ||
@@ -28,3 +28,3 @@ message: string; | ||
}; | ||
export declare type GetGasAssetTxsResponse = { | ||
export type GetGasAssetTxsResponse = { | ||
status: string; | ||
@@ -34,3 +34,3 @@ message: string; | ||
}; | ||
export declare type LogEventParam = { | ||
export type LogEventParam = { | ||
name: string; | ||
@@ -40,3 +40,3 @@ type: string; | ||
}; | ||
export declare type LogEvent = { | ||
export type LogEvent = { | ||
sender_contract_decimals: number; | ||
@@ -47,7 +47,7 @@ sender_contract_ticker_symbol: string | null | undefined; | ||
}; | ||
export declare type DecodedEvent = { | ||
export type DecodedEvent = { | ||
name: string; | ||
params: LogEventParam[] | null | undefined; | ||
}; | ||
export declare type GetTransactionsItem = { | ||
export type GetTransactionsItem = { | ||
tx_hash: string; | ||
@@ -60,3 +60,3 @@ block_signed_at: string; | ||
}; | ||
export declare type GetTransactionsResponse = { | ||
export type GetTransactionsResponse = { | ||
data: { | ||
@@ -73,3 +73,3 @@ address: string; | ||
}; | ||
export declare type GetTransactionResponse = { | ||
export type GetTransactionResponse = { | ||
data: { | ||
@@ -79,3 +79,3 @@ items: GetTransactionsItem[]; | ||
}; | ||
export declare type getTxsParams = { | ||
export type getTxsParams = { | ||
address: Address; | ||
@@ -82,0 +82,0 @@ offset: number; |
@@ -24,3 +24,3 @@ import { Address, Asset, BaseAmount } from '@xchainjs/xchain-util'; | ||
*/ | ||
export declare const validateSymbol: (symbol?: string | null | undefined) => boolean; | ||
export declare const validateSymbol: (symbol?: string | null) => boolean; | ||
/** | ||
@@ -37,12 +37,12 @@ * Calculate fees by multiplying . | ||
type: import("@xchainjs/xchain-util").Denomination.Base; | ||
amount: () => import("bignumber.js").default; | ||
plus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
minus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
times: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
div: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
gt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
gte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
eq: (value: any | import("bignumber.js").default.Value) => boolean; | ||
amount: () => import("bignumber.js").BigNumber; | ||
plus: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
minus: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
times: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
div: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
gt: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
gte: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
lt: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
lte: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
eq: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
decimal: number; | ||
@@ -73,16 +73,3 @@ }; | ||
*/ | ||
export declare const getApprovalAmount: (amount?: { | ||
type: import("@xchainjs/xchain-util").Denomination.Base; | ||
amount: () => import("bignumber.js").default; | ||
plus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
minus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
times: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
div: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
gt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
gte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
eq: (value: any | import("bignumber.js").default.Value) => boolean; | ||
decimal: number; | ||
} | undefined) => ethers.BigNumber; | ||
export declare const getApprovalAmount: (amount?: BaseAmount) => ethers.BigNumber; | ||
/** | ||
@@ -145,12 +132,12 @@ * Call a contract function. | ||
type: import("@xchainjs/xchain-util").Denomination.Base; | ||
amount: () => import("bignumber.js").default; | ||
plus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
minus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
times: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
div: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
gt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
gte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
eq: (value: any | import("bignumber.js").default.Value) => boolean; | ||
amount: () => import("bignumber.js").BigNumber; | ||
plus: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
minus: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
times: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
div: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
gt: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
gte: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
lt: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
lte: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
eq: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
decimal: number; | ||
@@ -177,12 +164,12 @@ } | undefined; | ||
type: import("@xchainjs/xchain-util").Denomination.Base; | ||
amount: () => import("bignumber.js").default; | ||
plus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
minus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
times: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
div: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
gt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
gte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
eq: (value: any | import("bignumber.js").default.Value) => boolean; | ||
amount: () => import("bignumber.js").BigNumber; | ||
plus: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
minus: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
times: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
div: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
gt: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
gte: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
lt: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
lte: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
eq: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
decimal: number; | ||
@@ -189,0 +176,0 @@ } | undefined; |
export * from './etherscan/types'; | ||
export * from './etherscan/etherscan-data-provider'; |
import { FeeOption, Fees, Network } from '@xchainjs/xchain-client'; | ||
import { Address, BaseAmount } from '@xchainjs/xchain-util'; | ||
import { BigNumber, Signer, ethers } from 'ethers'; | ||
export declare type ClientUrl = Record<Network, string>; | ||
export declare type ExplorerUrl = Record<Network, string>; | ||
export declare type TxOverrides = { | ||
export type ClientUrl = Record<Network, string>; | ||
export type ExplorerUrl = Record<Network, string>; | ||
export type TxOverrides = { | ||
nonce?: ethers.BigNumberish; | ||
@@ -13,4 +13,4 @@ gasLimit: ethers.BigNumberish; | ||
}; | ||
export declare type GasPrices = Record<FeeOption, BaseAmount>; | ||
export declare type FeesWithGasPricesAndLimits = { | ||
export type GasPrices = Record<FeeOption, BaseAmount>; | ||
export type FeesWithGasPricesAndLimits = { | ||
fees: Fees; | ||
@@ -20,3 +20,3 @@ gasPrices: GasPrices; | ||
}; | ||
export declare type ApproveParams = { | ||
export type ApproveParams = { | ||
walletIndex?: number; | ||
@@ -29,3 +29,3 @@ signer?: Signer; | ||
}; | ||
export declare type EstimateApproveParams = { | ||
export type EstimateApproveParams = { | ||
contractAddress: Address; | ||
@@ -36,3 +36,3 @@ spenderAddress: Address; | ||
}; | ||
export declare type IsApprovedParams = { | ||
export type IsApprovedParams = { | ||
walletIndex?: number; | ||
@@ -43,3 +43,3 @@ contractAddress: Address; | ||
}; | ||
export declare type CallParams = { | ||
export type CallParams = { | ||
signer?: Signer; | ||
@@ -52,2 +52,2 @@ walletIndex?: number; | ||
}; | ||
export declare type EstimateCallParams = Pick<CallParams, 'contractAddress' | 'abi' | 'funcName' | 'funcParams'>; | ||
export type EstimateCallParams = Pick<CallParams, 'contractAddress' | 'abi' | 'funcName' | 'funcParams'>; |
export * from './client-types'; |
@@ -24,3 +24,3 @@ import { Address, Asset, BaseAmount } from '@xchainjs/xchain-util'; | ||
*/ | ||
export declare const validateSymbol: (symbol?: string | null | undefined) => boolean; | ||
export declare const validateSymbol: (symbol?: string | null) => boolean; | ||
/** | ||
@@ -37,12 +37,12 @@ * Calculate fees by multiplying . | ||
type: import("@xchainjs/xchain-util").Denomination.Base; | ||
amount: () => import("bignumber.js").default; | ||
plus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
minus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
times: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
div: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
gt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
gte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
eq: (value: any | import("bignumber.js").default.Value) => boolean; | ||
amount: () => import("bignumber.js").BigNumber; | ||
plus: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
minus: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
times: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
div: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
gt: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
gte: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
lt: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
lte: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
eq: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
decimal: number; | ||
@@ -73,16 +73,3 @@ }; | ||
*/ | ||
export declare const getApprovalAmount: (amount?: { | ||
type: import("@xchainjs/xchain-util").Denomination.Base; | ||
amount: () => import("bignumber.js").default; | ||
plus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
minus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
times: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
div: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
gt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
gte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
eq: (value: any | import("bignumber.js").default.Value) => boolean; | ||
decimal: number; | ||
} | undefined) => ethers.BigNumber; | ||
export declare const getApprovalAmount: (amount?: BaseAmount) => ethers.BigNumber; | ||
/** | ||
@@ -158,12 +145,12 @@ * Call a contract function. | ||
type: import("@xchainjs/xchain-util").Denomination.Base; | ||
amount: () => import("bignumber.js").default; | ||
plus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
minus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
times: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
div: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
gt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
gte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
eq: (value: any | import("bignumber.js").default.Value) => boolean; | ||
amount: () => import("bignumber.js").BigNumber; | ||
plus: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
minus: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
times: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
div: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
gt: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
gte: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
lt: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
lte: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
eq: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
decimal: number; | ||
@@ -190,12 +177,12 @@ } | undefined; | ||
type: import("@xchainjs/xchain-util").Denomination.Base; | ||
amount: () => import("bignumber.js").default; | ||
plus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
minus: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
times: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
div: (value: any | import("bignumber.js").default.Value, decimal?: number | undefined) => any; | ||
gt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
gte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lt: (value: any | import("bignumber.js").default.Value) => boolean; | ||
lte: (value: any | import("bignumber.js").default.Value) => boolean; | ||
eq: (value: any | import("bignumber.js").default.Value) => boolean; | ||
amount: () => import("bignumber.js").BigNumber; | ||
plus: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
minus: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
times: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
div: (value: any | import("bignumber.js").BigNumber.Value, decimal?: number | undefined) => any; | ||
gt: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
gte: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
lt: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
lte: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
eq: (value: any | import("bignumber.js").BigNumber.Value) => boolean; | ||
decimal: number; | ||
@@ -202,0 +189,0 @@ } | undefined; |
{ | ||
"name": "@xchainjs/xchain-evm", | ||
"version": "0.1.5", | ||
"version": "0.2.0", | ||
"description": "Genereic EVM client for XChainJS", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"clean": "rimraf lib/**", | ||
"build": "yarn clean && rollup -c rollup.config.ts", | ||
"build": "yarn clean && rollup -c", | ||
"test": "jest", | ||
@@ -38,15 +38,15 @@ "lint": "eslint \"{src,__tests__, __mocks__}/**/*.ts\" --fix --max-warnings 0", | ||
"devDependencies": { | ||
"@xchainjs/xchain-client": "^0.13.7", | ||
"@xchainjs/xchain-crypto": "^0.2.6", | ||
"@xchainjs/xchain-util": "^0.12.0", | ||
"axios": "^0.25.0", | ||
"@xchainjs/xchain-client": "^0.14.0", | ||
"@xchainjs/xchain-crypto": "^0.3.0", | ||
"@xchainjs/xchain-util": "^0.13.0", | ||
"axios": "^1.3.6", | ||
"ethers": "^5.6.6" | ||
}, | ||
"peerDependencies": { | ||
"@xchainjs/xchain-client": "^0.13.7", | ||
"@xchainjs/xchain-crypto": "^0.2.6", | ||
"@xchainjs/xchain-util": "^0.12.0", | ||
"axios": "^0.25.0", | ||
"@xchainjs/xchain-client": "^0.14.0", | ||
"@xchainjs/xchain-crypto": "^0.3.0", | ||
"@xchainjs/xchain-util": "^0.13.0", | ||
"axios": "^1.3.6", | ||
"ethers": "^5.6.6" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
310391
4967