Skip to content

Commit 35d1e3c

Browse files
Shadowfiendclaude
andcommitted
oxfmt reformats the codebase for consistent style
Ran oxfmt --write . to bring all JS/TS/CSS files into conformance with the new formatter (100% Prettier-compatible output, semi:false, printWidth:80). Also includes bun test infrastructure files (setupBun.*, bunfig preloads, run-tests-isolated.sh) that were pending from the bun migration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ee2b77c commit 35d1e3c

139 files changed

Lines changed: 12498 additions & 425 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pledge-signer-sync/pledge-sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const syncGalxe = async () => {
132132
body: JSON.stringify(payload),
133133
})
134134
} catch (error) {
135-
throw new Error("Unable to sync with galxe")
135+
throw new Error("Unable to sync with galxe", { cause: error })
136136
}
137137

138138
await wait(3000)

background/abilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NormalizedEVMAddress } from "./types"
1+
import type { NormalizedEVMAddress } from "./types"
22

33
type HoldERC20 = {
44
type: "hold"

background/accounts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { AnyAssetAmount, SmartContractFungibleAsset } from "./assets"
22
import { EVMNetwork, NetworkBaseAsset } from "./networks"
3-
import { HexString } from "./types"
3+
import type { HexString } from "./types"
44

55
/**
66
* An account balance at a particular time and block height, on a particular

background/assets.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { keyBy } from "lodash"
22
import { TokenList } from "@uniswap/token-lists"
3-
import { UNIXTime, HexString } from "./types"
3+
import type { UNIXTime, HexString } from "./types"
44
import {
55
NetworkSpecific,
66
SmartContract,
@@ -145,7 +145,6 @@ export type AnyAsset =
145145
| Asset
146146
| NetworkSpecificAsset
147147
| FiatCurrency
148-
| FungibleAsset
149148
| SmartContractFungibleAsset
150149
| NetworkBaseAsset
151150

background/index.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import browser from "webextension-polyfill"
22

33
import { Store as ProxyStore } from "webext-redux"
44
import { produce } from "immer"
5-
import { Action, AnyAction, ThunkAction, ThunkDispatch } from "@reduxjs/toolkit"
5+
import { Action, ThunkAction, ThunkDispatch } from "@reduxjs/toolkit"
66

77
import { Delta, patch as patchDeepDiff } from "./services/redux/differ"
88
import ReduxService from "./services/redux"
@@ -37,13 +37,10 @@ type BackgroundAsyncThunkDispatch<S, E, A extends Action> = {
3737
// behaves a little differently from AsyncThunk by producing its result
3838
// directly at the dispatch site, instead of producing a triplet of
3939
// fulfilled/rejected/complete functions.
40-
type BackgroundAsyncThunkDispatchify<T> = T extends ThunkDispatch<
41-
infer S,
42-
infer E,
43-
infer A
44-
>
45-
? BackgroundAsyncThunkDispatch<S, E, A>
46-
: never
40+
type BackgroundAsyncThunkDispatchify<T> =
41+
T extends ThunkDispatch<infer S, infer E, infer A>
42+
? BackgroundAsyncThunkDispatch<S, E, A>
43+
: never
4744

4845
export type BackgroundDispatch = BackgroundAsyncThunkDispatchify<
4946
ReduxService["store"]["dispatch"]
@@ -58,9 +55,7 @@ export type BackgroundDispatch = BackgroundAsyncThunkDispatchify<
5855
* The returned Promise resolves once the proxy store is ready and hydrated
5956
* with the current background store data.
6057
*/
61-
export async function newProxyStore(): Promise<
62-
ProxyStore<RootState, AnyAction>
63-
> {
58+
export async function newProxyStore(): Promise<ProxyStore<RootState>> {
6459
const proxyStore = new ProxyStore({
6560
serializer: encodeJSON,
6661
deserializer: decodeJSON,

background/lib/0x-swap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
import { EVMNetwork } from "../networks"
99
import { SwapQuoteRequest } from "../redux-slices/utils/0x-swap-utils"
1010
import { isNetworkBaseAsset } from "../redux-slices/utils/asset-utils"
11-
import { HexString } from "../types"
11+
import type { HexString } from "../types"
1212
import { GetPriceParams, GetQuoteParams } from "./0x-swap-types"
1313
import logger from "./logger"
1414
import {

background/lib/erc20.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010
} from "ethers/lib/utils"
1111
import { SmartContractAmount, SmartContractFungibleAsset } from "../assets"
1212
import { EVMLog, SmartContract } from "../networks"
13-
import { HexString } from "../types"
14-
import { AddressOnNetwork } from "../accounts"
13+
import type { HexString } from "../types"
14+
import type { AddressOnNetwork } from "../accounts"
1515
import {
1616
AggregateContractResponse,
1717
CHAIN_SPECIFIC_MULTICALL_CONTRACT_ADDRESSES,
@@ -114,7 +114,7 @@ export async function getMetadata(
114114
}
115115
} catch (error) {
116116
logger.warn("Invalid metadata for token", tokenSmartContract)
117-
throw new Error("Could not retrieve erc20 token metadata")
117+
throw new Error("Could not retrieve erc20 token metadata", { cause: error })
118118
}
119119
}
120120

@@ -231,7 +231,7 @@ export const getTokenBalances = async (
231231
)) as AggregateContractResponse
232232

233233
return response.returnData.flatMap((data, i) => {
234-
if (data.success !== true) {
234+
if (!data.success) {
235235
return []
236236
}
237237

background/lib/erc721.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BaseProvider } from "@ethersproject/providers"
33
import { fetchJson } from "@ethersproject/web"
44

55
import logger from "./logger"
6-
import { HexString, URI } from "../types"
6+
import type { HexString, URI } from "../types"
77
import { isValidMetadata } from "./validate"
88

99
const abi = [

background/lib/nfts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AddressOnNetwork } from "../accounts"
1+
import type { AddressOnNetwork } from "../accounts"
22
import {
33
getSimpleHashCollections,
44
getSimpleHashNFTs,
@@ -12,7 +12,7 @@ import {
1212
NFTCollection,
1313
TransferredNFT,
1414
} from "../nfts"
15-
import { UNIXTime } from "../types"
15+
import type { UNIXTime } from "../types"
1616
import { MEZO_TESTNET } from "../constants"
1717
import { NFT_COLLECTION_ID } from "../services/campaign/matsnet-nft"
1818

background/lib/priceOracle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export async function getUSDPriceForTokens(
270270
}
271271
// FIXME: If a lookup fails, retry?
272272
if (
273-
response.success !== true ||
273+
!response.success ||
274274
ethers.BigNumber.from(response.returnData).isZero()
275275
) {
276276
// Don't add price point if we don't have a valid response or if rate is zero

0 commit comments

Comments
 (0)