thirdweb 5.88.5-nightly-0574eac02c832c382972fd545df79c36e11796e1-20250217000342 → 5.88.6-nightly-b182302f590e75c9881cebd0ca1cc8b1425d50b8-20250218000338
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/dist/cjs/contract/deployment/zksync/zkDeployDeterministic.js +5 -1
- package/dist/cjs/contract/deployment/zksync/zkDeployDeterministic.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +53 -71
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +4 -14
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +2 -32
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +9 -3
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js +15 -8
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js +39 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +58 -53
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js +3 -10
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +35 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js +1 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/nativeToken.js +4 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/nativeToken.js.map +1 -1
- package/dist/cjs/react/web/ui/components/token/TokenRow.js +11 -4
- package/dist/cjs/react/web/ui/components/token/TokenRow.js.map +1 -1
- package/dist/cjs/utils/any-evm/compute-deployment-address.js +4 -1
- package/dist/cjs/utils/any-evm/compute-deployment-address.js.map +1 -1
- package/dist/cjs/utils/any-evm/compute-published-contract-deploy-info.js +1 -0
- package/dist/cjs/utils/any-evm/compute-published-contract-deploy-info.js.map +1 -1
- package/dist/cjs/utils/any-evm/get-init-bytecode-with-salt.js +3 -1
- package/dist/cjs/utils/any-evm/get-init-bytecode-with-salt.js.map +1 -1
- package/dist/cjs/utils/any-evm/zksync/computeDeploymentAddress.js +6 -1
- package/dist/cjs/utils/any-evm/zksync/computeDeploymentAddress.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/connection/autoConnect.js +3 -4
- package/dist/cjs/wallets/connection/autoConnect.js.map +1 -1
- package/dist/esm/contract/deployment/zksync/zkDeployDeterministic.js +6 -2
- package/dist/esm/contract/deployment/zksync/zkDeployDeterministic.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +55 -73
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +4 -14
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +4 -34
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +9 -3
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js +15 -8
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js +36 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +59 -53
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js +4 -11
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +32 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js +1 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/nativeToken.js +4 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/nativeToken.js.map +1 -1
- package/dist/esm/react/web/ui/components/token/TokenRow.js +11 -4
- package/dist/esm/react/web/ui/components/token/TokenRow.js.map +1 -1
- package/dist/esm/utils/any-evm/compute-deployment-address.js +4 -1
- package/dist/esm/utils/any-evm/compute-deployment-address.js.map +1 -1
- package/dist/esm/utils/any-evm/compute-published-contract-deploy-info.js +1 -0
- package/dist/esm/utils/any-evm/compute-published-contract-deploy-info.js.map +1 -1
- package/dist/esm/utils/any-evm/get-init-bytecode-with-salt.js +4 -2
- package/dist/esm/utils/any-evm/get-init-bytecode-with-salt.js.map +1 -1
- package/dist/esm/utils/any-evm/zksync/computeDeploymentAddress.js +6 -1
- package/dist/esm/utils/any-evm/zksync/computeDeploymentAddress.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/connection/autoConnect.js +2 -2
- package/dist/esm/wallets/connection/autoConnect.js.map +1 -1
- package/dist/types/contract/deployment/zksync/zkDeployDeterministic.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts +2 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts +2 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts +2 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.d.ts +15 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts +2 -16
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts +9 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/nativeToken.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/nativeToken.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/token/TokenRow.d.ts +2 -2
- package/dist/types/react/web/ui/components/token/TokenRow.d.ts.map +1 -1
- package/dist/types/utils/any-evm/compute-deployment-address.d.ts.map +1 -1
- package/dist/types/utils/any-evm/compute-published-contract-deploy-info.d.ts +3 -0
- package/dist/types/utils/any-evm/compute-published-contract-deploy-info.d.ts.map +1 -1
- package/dist/types/utils/any-evm/get-init-bytecode-with-salt.d.ts.map +1 -1
- package/dist/types/utils/any-evm/zksync/computeDeploymentAddress.d.ts +1 -1
- package/dist/types/utils/any-evm/zksync/computeDeploymentAddress.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/connection/autoConnect.d.ts +2 -2
- package/dist/types/wallets/connection/autoConnect.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/contract/deployment/deploy-deterministic.test.ts +45 -2
- package/src/contract/deployment/zksync/zkDeployDeterministic.ts +10 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +70 -157
- package/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.tsx +1 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +4 -18
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +20 -161
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.tsx +25 -14
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.tsx +58 -34
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.tsx +134 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx +134 -128
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.tsx +18 -48
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx +70 -0
- package/src/react/web/ui/ConnectWallet/screens/TokenSelector.tsx +1 -3
- package/src/react/web/ui/ConnectWallet/screens/nativeToken.ts +5 -3
- package/src/react/web/ui/components/token/TokenRow.tsx +38 -14
- package/src/utils/any-evm/compute-deployment-address.ts +4 -1
- package/src/utils/any-evm/compute-published-contract-deploy-info.ts +1 -0
- package/src/utils/any-evm/get-init-bytecode-with-salt.ts +5 -2
- package/src/utils/any-evm/zksync/computeDeploymentAddress.ts +6 -2
- package/src/version.ts +1 -1
- package/src/wallets/connection/autoConnect.ts +3 -3
@@ -10,17 +10,17 @@ import {
|
|
10
10
|
spacing,
|
11
11
|
} from "../../../../core/design-system/index.js";
|
12
12
|
import { useChainName } from "../../../../core/hooks/others/useChainQuery.js";
|
13
|
+
import { PayTokenIcon } from "../../ConnectWallet/screens/Buy/PayTokenIcon.js";
|
13
14
|
import type { ERC20OrNativeToken } from "../../ConnectWallet/screens/nativeToken.js";
|
14
15
|
import { Skeleton } from "../Skeleton.js";
|
15
|
-
import { TokenIcon } from "../TokenIcon.js";
|
16
16
|
import { Container } from "../basic.js";
|
17
17
|
import { Button } from "../buttons.js";
|
18
18
|
import { Text } from "../text.js";
|
19
19
|
import { TokenSymbol } from "./TokenSymbol.js";
|
20
20
|
|
21
21
|
export function TokenRow(props: {
|
22
|
-
token: ERC20OrNativeToken;
|
23
|
-
chain: Chain;
|
22
|
+
token: ERC20OrNativeToken | undefined;
|
23
|
+
chain: Chain | undefined;
|
24
24
|
client: ThirdwebClient;
|
25
25
|
onSelectToken: () => void;
|
26
26
|
freezeChainAndToken?: boolean;
|
@@ -29,6 +29,32 @@ export function TokenRow(props: {
|
|
29
29
|
style?: React.CSSProperties;
|
30
30
|
}) {
|
31
31
|
const { name } = useChainName(props.chain);
|
32
|
+
|
33
|
+
if (!props.token || !props.chain) {
|
34
|
+
return (
|
35
|
+
<Button
|
36
|
+
variant="secondary"
|
37
|
+
fullWidth
|
38
|
+
style={{
|
39
|
+
fontSize: fontSize.sm,
|
40
|
+
justifyContent: "space-between",
|
41
|
+
paddingTop: spacing.md,
|
42
|
+
paddingBottom: spacing.md,
|
43
|
+
...props.style,
|
44
|
+
}}
|
45
|
+
gap="xxs"
|
46
|
+
onClick={props.onSelectToken}
|
47
|
+
>
|
48
|
+
<Text size="sm" color="primaryText">
|
49
|
+
Select payment token
|
50
|
+
</Text>
|
51
|
+
<Container color="primaryText">
|
52
|
+
<ChevronDownIcon width={iconSize.sm} height={iconSize.sm} />
|
53
|
+
</Container>
|
54
|
+
</Button>
|
55
|
+
);
|
56
|
+
}
|
57
|
+
|
32
58
|
return (
|
33
59
|
<TokenButton
|
34
60
|
variant="secondary"
|
@@ -42,21 +68,16 @@ export function TokenRow(props: {
|
|
42
68
|
disabled={props.freezeChainAndToken}
|
43
69
|
>
|
44
70
|
<Container flex="row" center="y" gap="sm">
|
45
|
-
<
|
71
|
+
<PayTokenIcon
|
46
72
|
token={props.token}
|
47
73
|
chain={props.chain}
|
48
74
|
size="md"
|
49
75
|
client={props.client}
|
50
76
|
/>
|
51
77
|
|
52
|
-
<Container
|
53
|
-
flex="column"
|
54
|
-
style={{
|
55
|
-
gap: "4px",
|
56
|
-
}}
|
57
|
-
>
|
78
|
+
<Container flex="column" gap="4xs">
|
58
79
|
{/* Token Symbol */}
|
59
|
-
<Container flex="column" gap="
|
80
|
+
<Container flex="column" gap="4xs">
|
60
81
|
{props.isLoading ? (
|
61
82
|
<Skeleton
|
62
83
|
width="120px"
|
@@ -74,6 +95,7 @@ export function TokenRow(props: {
|
|
74
95
|
<TokenSymbol
|
75
96
|
token={props.token}
|
76
97
|
chain={props.chain}
|
98
|
+
color="secondaryText"
|
77
99
|
size="sm"
|
78
100
|
/>
|
79
101
|
</Container>
|
@@ -92,9 +114,11 @@ export function TokenRow(props: {
|
|
92
114
|
)}
|
93
115
|
</Container>
|
94
116
|
</Container>
|
95
|
-
|
96
|
-
<
|
97
|
-
|
117
|
+
{!props.freezeChainAndToken && (
|
118
|
+
<Container color="primaryText">
|
119
|
+
<ChevronDownIcon width={iconSize.sm} height={iconSize.sm} />
|
120
|
+
</Container>
|
121
|
+
)}
|
98
122
|
</TokenButton>
|
99
123
|
);
|
100
124
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { type Hex, encodePacked } from "viem";
|
2
2
|
import { getAddress } from "../address.js";
|
3
3
|
import { ensureBytecodePrefix } from "../bytecode/prefix.js";
|
4
|
+
import { isHex } from "../encoding/hex.js";
|
4
5
|
import { keccak256 } from "../hashing/keccak256.js";
|
5
6
|
import { getSaltHash } from "./get-salt-hash.js";
|
6
7
|
import { keccakId } from "./keccak-id.js";
|
@@ -33,7 +34,9 @@ export function computeDeploymentAddress(
|
|
33
34
|
) {
|
34
35
|
const bytecode = ensureBytecodePrefix(options.bytecode);
|
35
36
|
const saltHash = options.salt
|
36
|
-
?
|
37
|
+
? isHex(options.salt) && options.salt.length === 66
|
38
|
+
? options.salt
|
39
|
+
: keccakId(options.salt)
|
37
40
|
: getSaltHash(bytecode);
|
38
41
|
|
39
42
|
// 1. create init bytecode hash with contract's bytecode and encoded args
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { encodePacked } from "viem/utils";
|
2
2
|
import { ensureBytecodePrefix } from "../bytecode/prefix.js";
|
3
|
-
import { type Hex, uint8ArrayToHex } from "../encoding/hex.js";
|
3
|
+
import { type Hex, isHex, uint8ArrayToHex } from "../encoding/hex.js";
|
4
4
|
import { getSaltHash } from "./get-salt-hash.js";
|
5
5
|
import { keccakId } from "./keccak-id.js";
|
6
6
|
|
@@ -29,8 +29,11 @@ export function getInitBytecodeWithSalt(
|
|
29
29
|
options: GetInitiBytecodeWithSaltOptions,
|
30
30
|
): Hex {
|
31
31
|
const bytecode = ensureBytecodePrefix(options.bytecode);
|
32
|
+
|
32
33
|
const saltHash = options.salt
|
33
|
-
?
|
34
|
+
? isHex(options.salt) && options.salt.length === 66
|
35
|
+
? options.salt
|
36
|
+
: keccakId(options.salt)
|
34
37
|
: getSaltHash(bytecode);
|
35
38
|
|
36
39
|
const encodedArgs =
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { Address } from "../../address.js";
|
2
|
-
import type
|
2
|
+
import { type Hex, isHex } from "../../encoding/hex.js";
|
3
3
|
import { keccakId } from "../keccak-id.js";
|
4
4
|
import { create2Address } from "./create2Address.js";
|
5
5
|
|
@@ -13,7 +13,11 @@ type ComputeDeploymentAddressOptions = {
|
|
13
13
|
export function computeDeploymentAddress(
|
14
14
|
options: ComputeDeploymentAddressOptions,
|
15
15
|
) {
|
16
|
-
const saltHash = options.salt
|
16
|
+
const saltHash = options.salt
|
17
|
+
? isHex(options.salt) && options.salt.length === 66
|
18
|
+
? options.salt
|
19
|
+
: keccakId(options.salt)
|
20
|
+
: keccakId("thirdweb");
|
17
21
|
|
18
22
|
return create2Address({
|
19
23
|
sender: options.create2FactoryAddress,
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.88.
|
1
|
+
export const version = "5.88.6-nightly-b182302f590e75c9881cebd0ca1cc8b1425d50b8-20250218000338";
|
@@ -29,11 +29,11 @@ import type { AutoConnectProps } from "./types.js";
|
|
29
29
|
* @returns {boolean} a promise resolving to true or false depending on whether the auto connect function connected to a wallet or not
|
30
30
|
* @walletConnection
|
31
31
|
*/
|
32
|
-
export
|
32
|
+
export async function autoConnect(
|
33
33
|
props: AutoConnectProps & {
|
34
34
|
wallets?: Wallet[];
|
35
35
|
},
|
36
|
-
)
|
36
|
+
): Promise<boolean> {
|
37
37
|
const wallets = props.wallets || getDefaultWallets(props);
|
38
38
|
const manager = createConnectionManager(webLocalStorage);
|
39
39
|
const result = await autoConnectCore({
|
@@ -56,4 +56,4 @@ export const autoConnect = async (
|
|
56
56
|
manager,
|
57
57
|
});
|
58
58
|
return result;
|
59
|
-
}
|
59
|
+
}
|