@exodus/ethereum-api 8.52.0 → 8.52.1
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 +3 -4
- package/src/tx-create.js +11 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "8.52.
|
|
3
|
+
"version": "8.52.1",
|
|
4
4
|
"description": "Transaction monitors, fee monitors, RPC with the blockchain node, and other networking code for Ethereum and EVM-based blockchains",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"ws": "^6.1.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@exodus/assets-testing": "
|
|
54
|
+
"@exodus/assets-testing": "workspace:^",
|
|
55
55
|
"@exodus/bsc-meta": "^2.5.1",
|
|
56
56
|
"@exodus/errors": "^3.3.0",
|
|
57
57
|
"@exodus/ethereumarbone-meta": "^2.1.2",
|
|
@@ -65,6 +65,5 @@
|
|
|
65
65
|
"repository": {
|
|
66
66
|
"type": "git",
|
|
67
67
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
68
|
-
}
|
|
69
|
-
"gitHead": "cf881908a1cff88e98d2f9a7a3f29357474e3d0c"
|
|
68
|
+
}
|
|
70
69
|
}
|
package/src/tx-create.js
CHANGED
|
@@ -271,7 +271,17 @@ export const createTxFactory = ({ chainId, assetClientInterface, useAbsoluteNonc
|
|
|
271
271
|
|
|
272
272
|
const resolvedGasPrice = providedGasPrice ?? maybeGasPrice
|
|
273
273
|
|
|
274
|
-
|
|
274
|
+
// When sending a main asset, the transaction (tx) 'to' address is the receiver's address. No tx input is provided.
|
|
275
|
+
// When sending a token, the tx 'to' address is the asset.contract?.address. No tx input is provided; it's resolved locally.
|
|
276
|
+
// When DEX swapping a main asset, the exchange provides a txInput and a DEX address. Use the DEX address as the tx 'to' address.
|
|
277
|
+
// When DEX swapping a token, the exchange provides a txInput and a DEX address. Use the DEX address as the tx 'to' address.
|
|
278
|
+
// When CEX swapping a main asset, the exchange may provide a txInput and an address. Use this address as the tx 'to' address.
|
|
279
|
+
// When CEX swapping a token, the exchange may provide a txInput but not an address. In this case, the tx 'to' address is the token address.
|
|
280
|
+
|
|
281
|
+
const txToAddress =
|
|
282
|
+
isToken && !providedTxInput
|
|
283
|
+
? asset.contract.address
|
|
284
|
+
: providedToAddress || asset.contract?.address || ARBITRARY_ADDRESS
|
|
275
285
|
|
|
276
286
|
const isContractToAddress = await isContractAddressCached({ asset, address: txToAddress })
|
|
277
287
|
|