@exodus/ethereum-api 2.25.3 → 2.26.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "2.25.3",
3
+ "version": "2.26.1",
4
4
  "description": "Ethereum Api",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -34,5 +34,5 @@
34
34
  "devDependencies": {
35
35
  "@exodus/models": "^8.7.2"
36
36
  },
37
- "gitHead": "5fc9011ce93fad50a48bccb4ab25930dbf7d762b"
37
+ "gitHead": "69dbf7d343fbe5ab22f233d4019fcfcb80816cc4"
38
38
  }
@@ -116,7 +116,7 @@ async function tryToDecodeApprovalTransaction(transaction) {
116
116
  const [grantedTo, balance] = decodedInput.values
117
117
 
118
118
  const symbol =
119
- (await getAssetSymbolFromContract(transaction.to)).toUpperCase() || 'Unknown Token'
119
+ (await getAssetSymbolFromContract(transaction.to))?.toUpperCase() || 'Unknown Token'
120
120
 
121
121
  return [{ grantedTo, balance, symbol, decimals: undefined }] // ToDo: Return 'decimals' in the future once we support changing the approval amount.
122
122
  } catch (e) {
@@ -126,7 +126,7 @@ async function tryToDecodeApprovalTransaction(transaction) {
126
126
  }
127
127
  }
128
128
 
129
- export async function simulateAndRetrieveSideEffects(transaction, assetName) {
129
+ export async function retrieveSideEffects({ transaction, assetName, shouldSimulate = true }) {
130
130
  const willSend = []
131
131
  const willReceive = []
132
132
 
@@ -135,6 +135,10 @@ export async function simulateAndRetrieveSideEffects(transaction, assetName) {
135
135
  return { willApprove: approveTransactionData }
136
136
  }
137
137
 
138
+ if (!shouldSimulate) {
139
+ return null
140
+ }
141
+
138
142
  if (!transaction.to) throw new Error(`'to' field is missing in the TX object`)
139
143
 
140
144
  const blocknativeTxObject = {