Skip to content

Commit 18232a4

Browse files
authored
Merge pull request #2192 from AmbireTech/release/v2.88.5
Release / v2.88.5
2 parents bd9cd04 + d3fa2e8 commit 18232a4

10 files changed

Lines changed: 45 additions & 14 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.88.4",
2+
"version": "2.88.5",
33
"name": "ambire-common",
44
"description": "Common ground for the Ambire apps",
55
"scripts": {

src/classes/recurringTimeout/recurringTimeout.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ export class RecurringTimeout implements IRecurringTimeout {
122122

123123
#scheduleStart(opts: RecurringTimeoutStartOptions = {}) {
124124
if (this.running) return
125-
this.#pendingStart = opts // collect latest opts for this tick
125+
this.#pendingStart = {
126+
timeout: opts.timeout ?? this.#pendingStart?.timeout,
127+
runImmediately: opts.runImmediately || this.#pendingStart?.runImmediately,
128+
allowOverlap: opts.allowOverlap || this.#pendingStart?.allowOverlap
129+
}
126130
if (this.startScheduled) return
127131
this.startScheduled = true
128132

src/consts/coingecko.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ const COINGECKO_BASE_URL = 'https://www.coingecko.com/en/coins/'
1010
export function geckoIdMapper(address: string, network: Network): string | null {
1111
if (address === ZeroAddress) return network.nativeAssetId
1212

13+
// citrea wrapepd cbtc
14+
if (network.chainId === 4114n && address === '0x3100000000000000000000000000000000000006')
15+
return network.nativeAssetId
16+
17+
// citrea wbtc
18+
if (network.chainId === 4114n && address === '0xDF240DC08B0FdaD1d93b74d5048871232f6BEA3d')
19+
return 'wrapped-bitcoin'
20+
1321
// we currently can't map aave so we're leaving this
1422
if (address === '0x4da27a545c0c5B758a6BA100e3a049001de870f5') return 'aave'
1523

src/consts/dapps/dapps.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export const featuredDapps = new Set([
7878
'snapshot.box/#/s:ambire.eth',
7979
'lido.fi',
8080
'bitrefill.com',
81-
'altitude.fi',
8281
'drops.bot',
8382
'app.barterswap.xyz'
8483
])
@@ -421,7 +420,7 @@ export const defiLlamaProtocolIdsToExclude: string[] = [
421420

422421
export const categoriesNotToFilterOut = ['DEX Aggregator']
423422
export const categoriesToExclude = ['CEX', 'Developer Tools']
424-
export const dappsNotToFilterOutByDomain = ['snapshot.box', 'bungee.exchange']
423+
export const dappsNotToFilterOutByDomain = ['snapshot.box', 'bungee.exchange', 'altitude.fi']
425424

426425
export const CATEGORY_MAP: Record<string, string> = {
427426
'AI Agents': 'AI Agents',

src/controllers/signAccountOp/signAccountOp.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ import { failedPaymasters } from '../../services/paymaster/FailedPaymasters'
128128
import { ZERO_ADDRESS } from '../../services/socket/constants'
129129
import shortenAddress from '../../utils/shortenAddress'
130130
import { generateUuid } from '../../utils/uuid'
131-
import wait from '../../utils/wait'
132131
import { EstimationController } from '../estimation/estimation'
133132
import { EstimationStatus } from '../estimation/types'
134133
import EventEmitter from '../eventEmitter/eventEmitter'
@@ -1335,8 +1334,6 @@ export class SignAccountOpController extends EventEmitter implements ISignAccoun
13351334
// Destroy sub-controllers
13361335
this.estimation.destroy()
13371336
this.gasPrice.destroy()
1338-
this.gasPrice = null as any
1339-
this.estimation = null as any
13401337
// Other cleanup
13411338
this.#hwCleanup()
13421339
this.gasPrices = undefined

src/interfaces/network.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,12 @@ export type RelayerNetwork = {
179179
symbol: string
180180
name: string
181181
coingeckoId: string
182-
icon: string
183182
decimals: number
184183
wrapped: {
185184
address: string
186185
symbol: string
187186
name: string
188187
coingeckoId: string
189-
icon: string
190188
decimals: number
191189
}
192190
oldNativeAssetSymbols?: string[]

src/libs/networks/networks.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable import/no-extraneous-dependencies */
2-
31
import { toBeHex } from 'ethers'
42

53
import { AMBIRE_ACCOUNT_FACTORY, OPTIMISTIC_ORACLE, SINGLETON } from '../../consts/deploy'

src/libs/portfolio/helpers.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import IERC20 from '../../../contracts/compiled/IERC20.json'
66
import gasTankFeeTokens from '../../consts/gasTankFeeTokens'
77
import humanizerInfoRaw from '../../consts/humanizer/humanizerInfo.json'
88
import { PINNED_TOKENS } from '../../consts/pinnedTokens'
9+
import { Price } from '../../interfaces/assets'
910
import { Network } from '../../interfaces/network'
1011
import { RPCProvider } from '../../interfaces/provider'
1112
import { AssetType } from '../defiPositions/types'
@@ -802,3 +803,19 @@ export const getHintsError = (
802803
level: isLastUpdateTooOld ? 'critical' : 'silent'
803804
}
804805
}
806+
807+
export const getHardcodedCitreaPrices = (address: string): Price | null => {
808+
const stables = [
809+
'0x8D82c4E3c936C7B5724A382a9c5a4E6Eb7aB6d5D',
810+
'0xE045e6c36cF77FAA2CfB54466D71A3aEF7bbE839',
811+
'0x9f3096Bac87e7F03DC09b0B416eB0DF837304dc4'
812+
]
813+
if (stables.indexOf(address) !== -1) {
814+
return {
815+
baseCurrency: 'usd',
816+
price: 1
817+
}
818+
}
819+
820+
return null
821+
}

src/libs/portfolio/portfolio.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable import/no-cycle */
21
/* eslint-disable no-restricted-syntax */
32
import { ZeroAddress } from 'ethers'
43
/* eslint-disable guard-for-in */
@@ -15,7 +14,12 @@ import { Deployless, fromDescriptor } from '../deployless/deployless'
1514
import batcher from './batcher'
1615
import { geckoRequestBatcher, geckoResponseIdentifier } from './gecko'
1716
import { getNFTs, getTokens } from './getOnchainBalances'
18-
import { formatExternalHintsAPIResponse, mergeERC721s, tokenFilter } from './helpers'
17+
import {
18+
formatExternalHintsAPIResponse,
19+
getHardcodedCitreaPrices,
20+
mergeERC721s,
21+
tokenFilter
22+
} from './helpers'
1923
import {
2024
CollectionResult,
2125
ExternalHintsAPIResponse,
@@ -346,6 +350,12 @@ export class Portfolio {
346350

347351
// Re-map/filter into our format
348352
const getPriceFromCache = (address: string, _priceRecency: number = priceRecency) => {
353+
// hardcode citrea prices
354+
if (this.network.chainId === 4114n) {
355+
const citreaTokenPrice = getHardcodedCitreaPrices(address)
356+
if (citreaTokenPrice) return [citreaTokenPrice]
357+
}
358+
349359
const cached = priceCache.get(address)
350360
if (!cached) return null
351361
const [timestamp, entry] = cached

src/utils/networks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const convertToAmbireNetworkFormat = async (network: ChainlistNetwork): Promise<
8989
name: network.name,
9090
chainId: BigInt(network.chainId),
9191
rpcUrls: [workingRpcUrl ?? network.rpc[0]],
92-
explorerUrl: network.explorers[0].url,
92+
explorerUrl: network.explorers[0]?.url || '',
9393
selectedRpcUrl: workingRpcUrl || '',
9494
platformId,
9595
nativeAssetId,

0 commit comments

Comments
 (0)