@exodus/ethereum-lib 0.2.10 → 1.0.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-lib",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Ethereum Library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "Exodus Movement, Inc.",
|
|
@@ -10,14 +10,15 @@
|
|
|
10
10
|
"access": "restricted"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@exodus/asset-lib": "^3.
|
|
13
|
+
"@exodus/asset-lib": "^3.4.0",
|
|
14
14
|
"@exodus/models": "^8.2.0",
|
|
15
|
+
"@exodus/solidity-contract": "^0.1.3",
|
|
15
16
|
"base-x": "^3.0.2",
|
|
16
|
-
"ethereumjs-tx": "1.3.7",
|
|
17
|
-
"ethereumjs-util": "5.2.0"
|
|
17
|
+
"ethereumjs-tx": "^1.3.7",
|
|
18
|
+
"ethereumjs-util": "^5.2.0"
|
|
18
19
|
},
|
|
19
20
|
"peerDependencies": {
|
|
20
21
|
"@exodus/assets": "8.0.x"
|
|
21
22
|
},
|
|
22
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "79db4e0d915c4d2632299343e51c066c7f2cdc9d"
|
|
23
24
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ethUtil from 'ethereumjs-util'
|
|
2
2
|
|
|
3
|
+
// TODO: obsolete, remove this
|
|
3
4
|
// TODO: migrate to using solidity-contract
|
|
4
5
|
export default function createContract(addresses, currency) {
|
|
5
6
|
// First 4 bytes of Keccak256('transfer(address,uint256)')
|
|
@@ -42,7 +43,7 @@ export default function createContract(addresses, currency) {
|
|
|
42
43
|
const APPROVE_METHOD_ID = '0x095ea7b3'
|
|
43
44
|
|
|
44
45
|
// TODO: not verified:
|
|
45
|
-
// ethUtil.bufferToHex(ethUtil.sha3('
|
|
46
|
+
// ethUtil.bufferToHex(ethUtil.sha3('Approval(address,address,uint256)'))
|
|
46
47
|
const APPROVE_EVENT_ID = '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925'
|
|
47
48
|
|
|
48
49
|
const approve = {
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import SolidityContract from '@exodus/solidity-contract'
|
|
2
|
+
// import createContractErc20 from './erc20'
|
|
3
|
+
// import ABI from '../abi'
|
|
2
4
|
|
|
3
|
-
export default function createContract(
|
|
5
|
+
export default function createContract(address, assetName) {
|
|
4
6
|
switch (assetName) {
|
|
7
|
+
// case 'dai':
|
|
8
|
+
// return new SolidityContract(ABI.dai, address)
|
|
5
9
|
default:
|
|
6
|
-
return
|
|
10
|
+
return SolidityContract.erc20(address)
|
|
7
11
|
}
|
|
8
12
|
}
|
|
@@ -26,7 +26,7 @@ export default function createUnsignedTx({
|
|
|
26
26
|
if (!chainId) chainId = CHAIN_IDS[baseAsset.name] // mainnet
|
|
27
27
|
|
|
28
28
|
const isToken = isEthereumToken(asset)
|
|
29
|
-
const to = isToken ? asset.contract.
|
|
29
|
+
const to = isToken ? asset.contract.address : address
|
|
30
30
|
let value = currency2buffer(isToken ? baseAsset.currency.ZERO : amount)
|
|
31
31
|
|
|
32
32
|
// TODO: check: present on desktop missing on mobile. This insures we never have a buffer specifying 0.
|