@exodus/web3-ethereum 2.4.1 → 2.5.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/CHANGELOG.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to
|
|
7
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
|
+
|
|
9
|
+
## [Unreleased]
|
|
10
|
+
|
|
11
|
+
## [2.5.0] - 2023-06-07
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Use a simplified `getNonce` dependency (doesn't require arguments)
|
|
16
|
+
|
|
17
|
+
## [2.4.1] - 2023-06-05
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- chore(ethereum): build ethereum dependencies based on hydra modules (#502)
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- fix(ethereum): harden typed data validation (#508)
|
|
26
|
+
- fix(ethereum): untangle balance weirdness (#506)
|
|
27
|
+
|
|
28
|
+
## [2.4.0] - 2023-05-29
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- fix(ethereum): TS compilation errors (#498)
|
|
33
|
+
- fix: rename ethereum:provider to eip1193:provider (#499)
|
|
34
|
+
|
|
35
|
+
## [2.3.0] - 2023-05-18
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- fix(web3): resolve error on approving token for swap (#485)
|
|
40
|
+
- fix: rename ethereum:provider to eip1193:provider (#499)
|
|
41
|
+
|
|
42
|
+
## [2.1.1] - 2023-05-11
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- Validation for signing typed data.
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
|
|
50
|
+
- Ensure mainnet (`0x1`) is always a first supported chain ID
|
|
51
|
+
|
|
52
|
+
## [2.0.0] - 2023-05-11
|
|
53
|
+
|
|
54
|
+
### Changed
|
|
55
|
+
|
|
56
|
+
- Breaking: accept `getAsset` dependency instead of `asset`.
|
|
57
|
+
- Breaking: make RPC validate parsed requests.
|
|
58
|
+
|
|
59
|
+
## [1.5.1] - 2023-04-06
|
|
60
|
+
|
|
61
|
+
### Fixed
|
|
62
|
+
|
|
63
|
+
- Convert methods in the provider to properties with arrow functions.
|
|
64
|
+
- Convert chain ID from `getDefaultChainId` to lower case
|
|
65
|
+
|
|
66
|
+
## [1.5.0] - 2023-04-05
|
|
67
|
+
|
|
68
|
+
### Changed
|
|
69
|
+
|
|
70
|
+
- Supply simulated changes to the approval function
|
|
71
|
+
|
|
72
|
+
## [1.4.6] - 2023-03-27
|
|
73
|
+
|
|
74
|
+
### Fixed
|
|
75
|
+
|
|
76
|
+
- `eth_getLogs` method validation (allow null in an array)
|
|
77
|
+
|
|
78
|
+
## [1.4.4] - 2023-03-26
|
|
79
|
+
|
|
80
|
+
### Fixed
|
|
81
|
+
|
|
82
|
+
- Don't change the Approve Transaction title if no token symbol found
|
|
83
|
+
- `eth_getLogs` method validation
|
|
84
|
+
|
|
85
|
+
## [1.4.2] - 2023-03-22
|
|
86
|
+
|
|
87
|
+
### Fixed
|
|
88
|
+
|
|
89
|
+
- Returning a possibly mutated object in `validateRequestWithPrefix`
|
|
90
|
+
|
|
91
|
+
## [1.4.1] - 2023-03-15
|
|
92
|
+
|
|
93
|
+
### Changed
|
|
94
|
+
|
|
95
|
+
- Properly check if `getDefaultChainId` is undefined in provider constructor
|
|
96
|
+
|
|
97
|
+
## [1.4.0] - 2023-03-01
|
|
98
|
+
|
|
99
|
+
### Changed
|
|
100
|
+
|
|
101
|
+
- Unpin `ethereum-api` package version
|
|
102
|
+
|
|
103
|
+
## [1.3.0] - 2023-02-28
|
|
104
|
+
|
|
105
|
+
### Changed
|
|
106
|
+
|
|
107
|
+
- Use arrow functions for compatibility with React bundler
|
|
108
|
+
|
|
109
|
+
## [1.2.0] - 2023-02-27
|
|
110
|
+
|
|
111
|
+
### Added
|
|
112
|
+
|
|
113
|
+
- Implement RPC functions
|
|
114
|
+
|
|
115
|
+
## [1.1.0] - 2023-02-22
|
|
116
|
+
|
|
117
|
+
### Changed
|
|
118
|
+
|
|
119
|
+
- Rework simulate transaction api
|
|
120
|
+
- Package structure
|
|
121
|
+
|
|
122
|
+
## [1.0.0] - 2023-02-20
|
|
123
|
+
|
|
124
|
+
Initial release.
|
|
125
|
+
|
|
126
|
+
[unreleased]:
|
|
127
|
+
https://github.com/ExodusMovement/exodus-web3/compare/db3e8cfd7d2f3cb908bb675cff1ca7981bbd1b09...master
|
|
128
|
+
[1.0.0]:
|
|
129
|
+
(https://github.com/ExodusMovement/exodus-web3/commit/c220026347ce27cfc25bacc083d61b1aae5c876b)
|
|
130
|
+
[1.1.0]:
|
|
131
|
+
(https://github.com/ExodusMovement/exodus-web3/commit/75254d697e3ffd2d95759e30425c30c7fb7fa654)
|
|
132
|
+
[1.2.0]:
|
|
133
|
+
(https://github.com/ExodusMovement/exodus-web3/commit/39137384d78bfa3e008b92e47e106a7be1df071e)
|
|
134
|
+
[1.3.0]:
|
|
135
|
+
(https://github.com/ExodusMovement/exodus-web3/commit/91de31ee30652f2f8acc66f6e1d909fd27174a36)
|
|
136
|
+
[1.4.0]:
|
|
137
|
+
(https://github.com/ExodusMovement/exodus-web3/commit/bbba5c8aa7d663deec5f649250421777c855341a)
|
|
138
|
+
[1.4.1]:
|
|
139
|
+
(https://github.com/ExodusMovement/exodus-web3/commit/cd3382acdb92fd0dafbb2f2f49b0cc9a648d6e2c)
|
|
140
|
+
[1.4.2]:
|
|
141
|
+
(https://github.com/ExodusMovement/exodus-web3/commit/c414d2c359ecbd25fe1b4d244f6fb51f633a4284)
|
|
142
|
+
[1.4.4]:
|
|
143
|
+
(https://github.com/ExodusMovement/exodus-web3/commit/e48f74f32e040de9e86ef77ea48058d5c0b36c86)
|
|
144
|
+
[1.4.6]:
|
|
145
|
+
(https://github.com/ExodusMovement/exodus-web3/commit/4d9d6eed59fbe201c1e6f2abb4b50f1f336bc690)
|
|
146
|
+
[1.5.0]:
|
|
147
|
+
(https://github.com/ExodusMovement/exodus-web3/commit/4a0c077d0175fe3c6a35e2f9a459f8cad214e8f6)
|
|
148
|
+
[1.5.1]:
|
|
149
|
+
(https://github.com/ExodusMovement/exodus-web3/commit/0576160a36d260f5f63789ddd28c18c9d8885e7b)
|
|
150
|
+
[2.0.0]:
|
|
151
|
+
(https://github.com/ExodusMovement/exodus-web3/commit/54f84cf089d1dffd5dafd443fc2aacb8dd0fc962)
|
|
152
|
+
[2.1.1]:
|
|
153
|
+
(https://github.com/ExodusMovement/exodus-web3/commit/db3e8cfd7d2f3cb908bb675cff1ca7981bbd1b09)
|
|
@@ -41,16 +41,13 @@ const createEvmDepsFactory = ({ analytics, activeWalletAccountAtom, assetsModule
|
|
|
41
41
|
});
|
|
42
42
|
return privateKey;
|
|
43
43
|
};
|
|
44
|
-
const getNonce = async (
|
|
45
|
-
// Shouldn't we retrieve the nonce for a given account?
|
|
46
|
-
// We are relying on the assumption here that "account"
|
|
47
|
-
// is always equal to the activeWalletAccount.
|
|
44
|
+
const getNonce = async () => {
|
|
48
45
|
const [baseAssetTxLog, blockchainNonce] = await Promise.all([
|
|
49
46
|
blockchainMetadata.getTxLog({
|
|
50
47
|
assetName,
|
|
51
48
|
walletAccount: await activeWalletAccountAtom.get(),
|
|
52
49
|
}),
|
|
53
|
-
apiGetNonce({ asset, address:
|
|
50
|
+
apiGetNonce({ asset, address: await getAddress() }),
|
|
54
51
|
]);
|
|
55
52
|
const walletNonce = Array.from(baseAssetTxLog)
|
|
56
53
|
.filter((tx) => tx.sent && !tx.dropped && tx.data.nonce != null)
|
|
@@ -59,7 +59,7 @@ export function exposeHandlers(rpc, deps) {
|
|
|
59
59
|
async function prepareTransaction(transaction) {
|
|
60
60
|
const { gasPrice, maxFeePerGas, maxPriorityFeePerGas } = await getFeeData();
|
|
61
61
|
const preparedTransaction = { ...transaction };
|
|
62
|
-
preparedTransaction.nonce = await getNonce(
|
|
62
|
+
preparedTransaction.nonce = await getNonce();
|
|
63
63
|
if (!transaction.value) {
|
|
64
64
|
preparedTransaction.value = '0x0';
|
|
65
65
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare type EVMDeps = {
|
|
|
31
31
|
sendRawTransaction: (rawTransaction: string) => Promise<EthTransactionHash>;
|
|
32
32
|
getEstimatedGas: (transaction: EthTransaction) => Promise<string>;
|
|
33
33
|
getFeeData: () => Promise<FeeData>;
|
|
34
|
-
getNonce: (
|
|
34
|
+
getNonce: () => Promise<string>;
|
|
35
35
|
forwardRequest: (args: EthRequestArguments) => Promise<unknown>;
|
|
36
36
|
onEthWalletWatchAssetRequest?: (assetDetails: EthWalletWatchAsset) => Promise<boolean>;
|
|
37
37
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/web3-ethereum",
|
|
3
3
|
"description": "Apps connectivity library for EVM-compatible chains.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"module": "lib/index.js",
|
|
@@ -50,6 +50,5 @@
|
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@exodus/assets": "^8.0.72"
|
|
53
|
-
}
|
|
54
|
-
"gitHead": "6516ee0735272140b1c48527bf98ed3b7bc54499"
|
|
53
|
+
}
|
|
55
54
|
}
|