@exodus/ethereum-api 8.76.5 → 8.76.6
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/CHANGELOG.md +10 -0
- package/package.json +3 -3
- package/src/address-has-history.js +6 -2
- package/src/create-asset.js +5 -2
- package/src/eth-like-util.js +53 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [8.76.6](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.76.5...@exodus/ethereum-api@8.76.6) (2026-06-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: Ledger clear-signing for EVM token approvals (#8207)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
## [8.76.5](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.76.4...@exodus/ethereum-api@8.76.5) (2026-06-03)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @exodus/ethereum-api
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "8.76.
|
|
3
|
+
"version": "8.76.6",
|
|
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",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@exodus/bip44-constants": "^195.0.0",
|
|
30
30
|
"@exodus/crypto": "^1.0.0-rc.26",
|
|
31
31
|
"@exodus/currency": "^6.0.1",
|
|
32
|
-
"@exodus/ethereum-lib": "^5.24.
|
|
32
|
+
"@exodus/ethereum-lib": "^5.24.3",
|
|
33
33
|
"@exodus/ethereum-meta": "^2.9.1",
|
|
34
34
|
"@exodus/ethereumholesky-meta": "^2.0.5",
|
|
35
35
|
"@exodus/ethereumjs": "^1.11.0",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"type": "git",
|
|
71
71
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "f9bb7fcf58132b8daa6db82edc0bc53f380029cd"
|
|
74
74
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export const addressHasHistoryFactory =
|
|
2
2
|
({ server }) =>
|
|
3
3
|
async (address) => {
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const [nonceHex, balanceHex] = await Promise.all([
|
|
5
|
+
server.getTransactionCount(address, 'pending'),
|
|
6
|
+
server.getBalanceProxied(address, 'latest'),
|
|
7
|
+
])
|
|
8
|
+
|
|
9
|
+
return Number.parseInt(nonceHex, 16) > 0 || Number.parseInt(balanceHex, 16) > 0
|
|
6
10
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from './create-asset-utils.js'
|
|
35
35
|
import { createTokenFactory } from './create-token-factory.js'
|
|
36
36
|
import { createCustomFeesApi } from './custom-fees.js'
|
|
37
|
-
import { getEIP7702Delegation } from './eth-like-util.js'
|
|
37
|
+
import { getEIP7702Delegation, getIsNftContract } from './eth-like-util.js'
|
|
38
38
|
import { createEvmServer } from './exodus-eth-server/index.js'
|
|
39
39
|
import { createFeeData } from './fee-data/index.js'
|
|
40
40
|
import { createGetBalanceForAddress } from './get-balance-for-address.js'
|
|
@@ -353,7 +353,10 @@ export const createAssetFactory = ({
|
|
|
353
353
|
signer
|
|
354
354
|
? signUnsignedTxWithSigner(unsignedTx, signer)
|
|
355
355
|
: signUnsignedTx(unsignedTx, privateKey),
|
|
356
|
-
signHardware: signHardwareFactory({
|
|
356
|
+
signHardware: signHardwareFactory({
|
|
357
|
+
baseAssetName: asset.name,
|
|
358
|
+
getIsNft: ({ address }) => getIsNftContract({ server, address }),
|
|
359
|
+
}),
|
|
357
360
|
signMessage: ({ message, privateKey, signer }) =>
|
|
358
361
|
signer ? signMessageWithSigner({ message, signer }) : signMessage({ privateKey, message }),
|
|
359
362
|
...(checkTx && { checkTx }),
|
package/src/eth-like-util.js
CHANGED
|
@@ -159,6 +159,7 @@ export const getIsForwarderContract = memoizeLruCache(
|
|
|
159
159
|
|
|
160
160
|
const ERC20 = new SolidityContract(ABI.erc20)
|
|
161
161
|
const ERC20BytesParams = new SolidityContract(ABI.erc20BytesParams)
|
|
162
|
+
const ERC721 = new SolidityContract(ABI.erc721)
|
|
162
163
|
const DEFAULT_PARAM_NAMES = ['decimals', 'name', 'symbol']
|
|
163
164
|
const erc20ParamsCache = Object.create(null)
|
|
164
165
|
|
|
@@ -213,6 +214,58 @@ export const getERC20Params = async ({ asset, address, paramNames = DEFAULT_PARA
|
|
|
213
214
|
return response
|
|
214
215
|
}
|
|
215
216
|
|
|
217
|
+
// ERC-165 introspection used to drive Ledger's clear-signing for contract calls:
|
|
218
|
+
// it tells the device whether the target is an NFT (ERC-721/1155) or a fungible
|
|
219
|
+
// token. See `signHardwareFactory` in ethereum-lib for how this feeds the device's
|
|
220
|
+
// `isNft` hint. Display-only: never affects the signed transaction.
|
|
221
|
+
const buildSupportsInterfaceData = (interfaceId) => {
|
|
222
|
+
const erc165InterfaceId = `0x${interfaceId}`
|
|
223
|
+
return `0x${ERC721.supportsInterface.build(erc165InterfaceId).toString('hex')}`
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const decodeBool = (result) => {
|
|
227
|
+
return ERC721.decodeOutput({ method: 'supportsInterface', data: result })[0]
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// true = supported, false = not supported / reverted, undefined = transport failure
|
|
231
|
+
const probeSupportsInterface = async ({ server, address, interfaceId }) => {
|
|
232
|
+
try {
|
|
233
|
+
const result = await server.ethCall({
|
|
234
|
+
to: address,
|
|
235
|
+
data: buildSupportsInterfaceData(interfaceId),
|
|
236
|
+
})
|
|
237
|
+
return decodeBool(result)
|
|
238
|
+
} catch (err) {
|
|
239
|
+
// Empirically, a contract without supportsInterface comes through Clarity as
|
|
240
|
+
// "Bad rpc response: execution reverted". Unknown errors stay undefined so
|
|
241
|
+
// we don't force a wrong hint.
|
|
242
|
+
const EXECUTION_REVERT_MESSAGE = 'execution reverted'
|
|
243
|
+
const errorMessage = err?.message || String(err || '')
|
|
244
|
+
return errorMessage.toLowerCase().includes(EXECUTION_REVERT_MESSAGE) ? false : undefined
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Resolves whether `address` is an NFT contract (ERC-721 or ERC-1155) via ERC-165.
|
|
249
|
+
// Returns true (NFT), false (not an NFT), or undefined (couldn't determine).
|
|
250
|
+
export async function getIsNftContract({ server, address }) {
|
|
251
|
+
assert(server, 'getIsNftContract(): server required')
|
|
252
|
+
assert(address, 'getIsNftContract(): address required')
|
|
253
|
+
|
|
254
|
+
const ERC721_INTERFACE_ID = '80ac58cd'
|
|
255
|
+
const ERC1155_INTERFACE_ID = 'd9b67a26'
|
|
256
|
+
|
|
257
|
+
const [isErc721, isErc1155] = await Promise.all([
|
|
258
|
+
probeSupportsInterface({ server, address, interfaceId: ERC721_INTERFACE_ID }),
|
|
259
|
+
probeSupportsInterface({ server, address, interfaceId: ERC1155_INTERFACE_ID }),
|
|
260
|
+
])
|
|
261
|
+
|
|
262
|
+
if (isErc721 === true || isErc1155 === true) {
|
|
263
|
+
return true
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (isErc721 === false && isErc1155 === false) return false
|
|
267
|
+
}
|
|
268
|
+
|
|
216
269
|
export async function getEIP7702Delegation({ address, server }) {
|
|
217
270
|
const code = await withErrorReason({
|
|
218
271
|
promise: server.getCode(address),
|