Skip to content

Commit 4b99d42

Browse files
committed
move utils to canonical packages, update imports / exports
1 parent 4ce2f49 commit 4b99d42

File tree

36 files changed

+83
-107
lines changed

36 files changed

+83
-107
lines changed

apps/iframe/src/components/interface/AddressInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Clipboard as ArkClipboard, useClipboard } from "@ark-ui/react/clipboard"
2-
import { shortenAddress } from "@happy.tech/wallet-common"
2+
import { shortenAddress } from "@happy.tech/common"
33
import { CheckIcon, CopyIcon } from "@phosphor-icons/react"
44
import type { Address } from "viem"
55

apps/iframe/src/components/interface/home/tabs/views/activity/BoopEntry.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Onchain } from "@happy.tech/boop-sdk"
2-
import { shortenAddress } from "@happy.tech/wallet-common"
2+
import { shortenAddress } from "@happy.tech/common"
33
import {
44
ArrowUpIcon,
55
LightningIcon,

apps/iframe/src/components/interface/home/tabs/views/activity/BoopEntrySkeleton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { shortenAddress } from "@happy.tech/wallet-common"
1+
import { shortenAddress } from "@happy.tech/common"
22
import { CircleNotchIcon } from "@phosphor-icons/react"
33
import type { Hash } from "viem"
44

apps/iframe/src/components/requests/HappyLoadAbi.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { HappyMethodNames } from "@happy.tech/common"
1+
import type { HappyMethodNames } from "@happy.tech/wallet-common"
22
import { formatAbiItem } from "abitype"
33
import { useSmartContract } from "#src/hooks/useBlockExplorer"
44
import { useClassifyAbi } from "#src/hooks/useClassifyAbiSections"

apps/iframe/src/components/requests/HappyRequestSessionKey.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { HappyMethodNames } from "@happy.tech/common"
1+
import type { HappyMethodNames } from "@happy.tech/wallet-common"
22
import type { Address } from "viem"
33
import { getAppURL } from "#src/utils/appURL"
44
import {

apps/iframe/src/components/requests/common/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { shortenAddress } from "@happy.tech/wallet-common"
1+
import { shortenAddress } from "@happy.tech/common"
22
import { cva } from "class-variance-authority"
33
import { useAtomValue } from "jotai"
44
import type { PropsWithChildren } from "react"

apps/iframe/src/components/requests/utils/transactionTypes.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1-
import { TransactionType } from "@happy.tech/common"
21
import type { RpcTransactionRequest } from "viem"
32

3+
export enum TransactionType {
4+
/**
5+
* Legacy tx include both pre- and post-EIP155 (replay protection) transactions. These are indistinguishable, they
6+
* only vary in how they generated their signatures (post-EIP-155 signs a hash that also encompasses the chain ID).
7+
*
8+
* This is the only transaction type that doesn't really have a type encoded in the tx itself (so the number
9+
* 0x0 here is arbitrary), that concepts comes from "types transaction envelopes introduced in EIP-2718.
10+
*/
11+
Legacy = "0x0",
12+
/**
13+
* Defined in EIP2930, but few people know that number, hence "access list".
14+
*/
15+
AccessList = "0x1",
16+
EIP1559 = "0x2",
17+
EIP4844 = "0x3",
18+
EIP7702 = "0x4",
19+
}
20+
421
/**
522
* Classify a transaction into its type.
623
*

apps/iframe/src/components/requests/utils/useTxFees.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { TransactionType, parseBigInt } from "@happy.tech/common"
1+
import { parseBigInt } from "@happy.tech/common"
22
import type { RpcTransactionRequest } from "viem"
33
import { type UseEstimateFeesPerGasReturnType, useEstimateFeesPerGas } from "wagmi"
4+
import { TransactionType } from "./transactionTypes"
45

56
export type UseTxFeesArgs = {
67
tx: RpcTransactionRequest

apps/iframe/src/connections/firebase/workers/web3auth.sw.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import "./web3auth/polyfill"
33

44
import type { Address } from "@happy.tech/common"
5-
import { waitForCondition } from "@happy.tech/wallet-common"
5+
import { waitForCondition } from "@happy.tech/common"
66
import { COREKIT_STATUS, type JWTLoginParams } from "@web3auth/mpc-core-kit"
77
import { web3Auth } from "./web3auth/mpc-core-kit"
88
import { ethereumSigningProvider } from "./web3auth/signingProvider"

apps/iframe/src/constants/contracts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { shortenAddress } from "@happy.tech/common"
12
import {
23
abis as boopStagingAbis,
34
deployment as boopStagingDeployment,
45
} from "@happy.tech/contracts/boop-staging/sepolia"
56
import { abis as boopAnvilAbis, deployment as boopAnvilDeployment } from "@happy.tech/contracts/boop/anvil"
67
import { abis as boopSepoliaAbis, deployment as boopSepoliaDeployment } from "@happy.tech/contracts/boop/sepolia"
7-
import { anvil, happyChainSepolia, shortenAddress } from "@happy.tech/wallet-common"
8+
import { anvil, happyChainSepolia } from "@happy.tech/wallet-common"
89
import { type Address, isAddressEqual } from "viem"
910

1011
// Default chain ID, used for deployment addresses and ABIs. The iframe might (or might not — unsupported)

0 commit comments

Comments
 (0)