@xchainjs/xchain-wallet 2.0.6 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.esm.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Network, FeeOption } from '@xchainjs/xchain-client';
2
2
  import { isApproved } from '@xchainjs/xchain-evm';
3
3
  import { baseAmount, getContractAddressFromAsset } from '@xchainjs/xchain-util';
4
+ import { getAddress } from 'ethers';
4
5
 
5
6
  /******************************************************************************
6
7
  Copyright (c) Microsoft Corporation.
@@ -476,7 +477,7 @@ class Wallet {
476
477
  throw Error('Can not make approve over non EVM client');
477
478
  if (asset.chain === asset.ticker)
478
479
  throw Error('Can not make approve over native asset');
479
- const contractAddress = getContractAddressFromAsset(asset);
480
+ const contractAddress = getAddress(getContractAddressFromAsset(asset));
480
481
  return yield client.approve({ contractAddress, amount, spenderAddress });
481
482
  });
482
483
  }
@@ -496,7 +497,7 @@ class Wallet {
496
497
  throw Error('Can not validate approve over non EVM client');
497
498
  if (asset.chain === asset.ticker)
498
499
  throw Error('Can not validate approve over native asset');
499
- const contractAddress = getContractAddressFromAsset(asset);
500
+ const contractAddress = getAddress(getContractAddressFromAsset(asset));
500
501
  return isApproved({
501
502
  provider: client.getProvider(),
502
503
  amount,
package/lib/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var xchainClient = require('@xchainjs/xchain-client');
4
4
  var xchainEvm = require('@xchainjs/xchain-evm');
5
5
  var xchainUtil = require('@xchainjs/xchain-util');
6
+ var ethers = require('ethers');
6
7
 
7
8
  /******************************************************************************
8
9
  Copyright (c) Microsoft Corporation.
@@ -478,7 +479,7 @@ class Wallet {
478
479
  throw Error('Can not make approve over non EVM client');
479
480
  if (asset.chain === asset.ticker)
480
481
  throw Error('Can not make approve over native asset');
481
- const contractAddress = xchainUtil.getContractAddressFromAsset(asset);
482
+ const contractAddress = ethers.getAddress(xchainUtil.getContractAddressFromAsset(asset));
482
483
  return yield client.approve({ contractAddress, amount, spenderAddress });
483
484
  });
484
485
  }
@@ -498,7 +499,7 @@ class Wallet {
498
499
  throw Error('Can not validate approve over non EVM client');
499
500
  if (asset.chain === asset.ticker)
500
501
  throw Error('Can not validate approve over native asset');
501
- const contractAddress = xchainUtil.getContractAddressFromAsset(asset);
502
+ const contractAddress = ethers.getAddress(xchainUtil.getContractAddressFromAsset(asset));
502
503
  return xchainEvm.isApproved({
503
504
  provider: client.getProvider(),
504
505
  amount,
package/lib/wallet.d.ts CHANGED
@@ -5,7 +5,7 @@ import { AssetInfo, Balance, FeeOption, Fees, Network, Protocol, Tx, TxHash, Txs
5
5
  import { GasPrices } from '@xchainjs/xchain-evm';
6
6
  import { DepositParam } from '@xchainjs/xchain-mayachain';
7
7
  import { Address, AnyAsset, BaseAmount, Chain, TokenAsset } from '@xchainjs/xchain-util';
8
- import { BigNumber } from 'ethers';
8
+ import BigNumber from 'bignumber.js';
9
9
  import { ChainBalances, CosmosTxParams, EvmTxParams, RadixTxParams, UtxoTxParams } from './types';
10
10
  export type NodeUrls = Record<Network, string>;
11
11
  export declare class Wallet {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-wallet",
3
3
  "description": "XChainjs clients wrapper to work with several chains at the same time",
4
- "version": "2.0.6",
4
+ "version": "2.0.8",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
7
7
  "module": "lib/index.esm.js",
@@ -29,18 +29,19 @@
29
29
  "directory": "release/package"
30
30
  },
31
31
  "dependencies": {
32
- "@xchainjs/xchain-client": "2.0.1",
33
- "@xchainjs/xchain-evm": "2.0.2",
34
- "@xchainjs/xchain-mayachain": "3.0.1",
35
- "@xchainjs/xchain-radix": "2.0.1",
36
- "@xchainjs/xchain-thorchain": "3.0.5",
37
- "@xchainjs/xchain-util": "2.0.0",
38
- "@xchainjs/xchain-utxo": "2.0.1",
39
- "ethers": "5.7.2"
32
+ "@xchainjs/xchain-client": "2.0.2",
33
+ "@xchainjs/xchain-evm": "2.0.4",
34
+ "@xchainjs/xchain-mayachain": "3.0.2",
35
+ "@xchainjs/xchain-radix": "2.0.2",
36
+ "@xchainjs/xchain-thorchain": "3.0.6",
37
+ "@xchainjs/xchain-util": "2.0.1",
38
+ "@xchainjs/xchain-utxo": "2.0.2",
39
+ "bignumber.js": "^9.0.0",
40
+ "ethers": "^6.14.3"
40
41
  },
41
42
  "devDependencies": {
42
- "@xchainjs/xchain-bitcoin": "2.0.1",
43
- "@xchainjs/xchain-bitcoincash": "2.0.1",
44
- "@xchainjs/xchain-ethereum": "2.0.3"
43
+ "@xchainjs/xchain-bitcoin": "2.0.2",
44
+ "@xchainjs/xchain-bitcoincash": "2.0.3",
45
+ "@xchainjs/xchain-ethereum": "2.0.5"
45
46
  }
46
47
  }