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.
Files changed (141) hide show
  1. package/dist/cjs/contract/deployment/zksync/zkDeployDeterministic.js +5 -1
  2. package/dist/cjs/contract/deployment/zksync/zkDeployDeterministic.js.map +1 -1
  3. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +53 -71
  4. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  5. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +2 -2
  6. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -1
  7. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +1 -1
  8. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +1 -1
  9. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +1 -1
  10. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
  11. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +4 -14
  12. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
  13. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +2 -32
  14. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
  15. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +9 -3
  16. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
  17. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js +15 -8
  18. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js.map +1 -1
  19. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js +39 -0
  20. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js.map +1 -0
  21. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +58 -53
  22. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +1 -1
  23. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js +3 -10
  24. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +1 -1
  25. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +35 -0
  26. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -0
  27. package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js +1 -2
  28. package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
  29. package/dist/cjs/react/web/ui/ConnectWallet/screens/nativeToken.js +4 -2
  30. package/dist/cjs/react/web/ui/ConnectWallet/screens/nativeToken.js.map +1 -1
  31. package/dist/cjs/react/web/ui/components/token/TokenRow.js +11 -4
  32. package/dist/cjs/react/web/ui/components/token/TokenRow.js.map +1 -1
  33. package/dist/cjs/utils/any-evm/compute-deployment-address.js +4 -1
  34. package/dist/cjs/utils/any-evm/compute-deployment-address.js.map +1 -1
  35. package/dist/cjs/utils/any-evm/compute-published-contract-deploy-info.js +1 -0
  36. package/dist/cjs/utils/any-evm/compute-published-contract-deploy-info.js.map +1 -1
  37. package/dist/cjs/utils/any-evm/get-init-bytecode-with-salt.js +3 -1
  38. package/dist/cjs/utils/any-evm/get-init-bytecode-with-salt.js.map +1 -1
  39. package/dist/cjs/utils/any-evm/zksync/computeDeploymentAddress.js +6 -1
  40. package/dist/cjs/utils/any-evm/zksync/computeDeploymentAddress.js.map +1 -1
  41. package/dist/cjs/version.js +1 -1
  42. package/dist/cjs/wallets/connection/autoConnect.js +3 -4
  43. package/dist/cjs/wallets/connection/autoConnect.js.map +1 -1
  44. package/dist/esm/contract/deployment/zksync/zkDeployDeterministic.js +6 -2
  45. package/dist/esm/contract/deployment/zksync/zkDeployDeterministic.js.map +1 -1
  46. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +55 -73
  47. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  48. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +1 -1
  49. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -1
  50. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +1 -1
  51. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +1 -1
  52. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +1 -1
  53. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
  54. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +4 -14
  55. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
  56. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +4 -34
  57. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
  58. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +9 -3
  59. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
  60. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js +15 -8
  61. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js.map +1 -1
  62. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js +36 -0
  63. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js.map +1 -0
  64. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +59 -53
  65. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +1 -1
  66. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js +4 -11
  67. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +1 -1
  68. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +32 -0
  69. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -0
  70. package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js +1 -2
  71. package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
  72. package/dist/esm/react/web/ui/ConnectWallet/screens/nativeToken.js +4 -2
  73. package/dist/esm/react/web/ui/ConnectWallet/screens/nativeToken.js.map +1 -1
  74. package/dist/esm/react/web/ui/components/token/TokenRow.js +11 -4
  75. package/dist/esm/react/web/ui/components/token/TokenRow.js.map +1 -1
  76. package/dist/esm/utils/any-evm/compute-deployment-address.js +4 -1
  77. package/dist/esm/utils/any-evm/compute-deployment-address.js.map +1 -1
  78. package/dist/esm/utils/any-evm/compute-published-contract-deploy-info.js +1 -0
  79. package/dist/esm/utils/any-evm/compute-published-contract-deploy-info.js.map +1 -1
  80. package/dist/esm/utils/any-evm/get-init-bytecode-with-salt.js +4 -2
  81. package/dist/esm/utils/any-evm/get-init-bytecode-with-salt.js.map +1 -1
  82. package/dist/esm/utils/any-evm/zksync/computeDeploymentAddress.js +6 -1
  83. package/dist/esm/utils/any-evm/zksync/computeDeploymentAddress.js.map +1 -1
  84. package/dist/esm/version.js +1 -1
  85. package/dist/esm/wallets/connection/autoConnect.js +2 -2
  86. package/dist/esm/wallets/connection/autoConnect.js.map +1 -1
  87. package/dist/types/contract/deployment/zksync/zkDeployDeterministic.d.ts.map +1 -1
  88. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
  89. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.d.ts.map +1 -1
  90. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts +2 -2
  91. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts.map +1 -1
  92. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts.map +1 -1
  93. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts +2 -2
  94. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts.map +1 -1
  95. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts +2 -2
  96. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts.map +1 -1
  97. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.d.ts +15 -0
  98. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.d.ts.map +1 -0
  99. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts +2 -16
  100. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts.map +1 -1
  101. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.d.ts.map +1 -1
  102. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts +9 -0
  103. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts.map +1 -0
  104. package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts.map +1 -1
  105. package/dist/types/react/web/ui/ConnectWallet/screens/nativeToken.d.ts +1 -1
  106. package/dist/types/react/web/ui/ConnectWallet/screens/nativeToken.d.ts.map +1 -1
  107. package/dist/types/react/web/ui/components/token/TokenRow.d.ts +2 -2
  108. package/dist/types/react/web/ui/components/token/TokenRow.d.ts.map +1 -1
  109. package/dist/types/utils/any-evm/compute-deployment-address.d.ts.map +1 -1
  110. package/dist/types/utils/any-evm/compute-published-contract-deploy-info.d.ts +3 -0
  111. package/dist/types/utils/any-evm/compute-published-contract-deploy-info.d.ts.map +1 -1
  112. package/dist/types/utils/any-evm/get-init-bytecode-with-salt.d.ts.map +1 -1
  113. package/dist/types/utils/any-evm/zksync/computeDeploymentAddress.d.ts +1 -1
  114. package/dist/types/utils/any-evm/zksync/computeDeploymentAddress.d.ts.map +1 -1
  115. package/dist/types/version.d.ts +1 -1
  116. package/dist/types/wallets/connection/autoConnect.d.ts +2 -2
  117. package/dist/types/wallets/connection/autoConnect.d.ts.map +1 -1
  118. package/package.json +1 -1
  119. package/src/contract/deployment/deploy-deterministic.test.ts +45 -2
  120. package/src/contract/deployment/zksync/zkDeployDeterministic.ts +10 -2
  121. package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +70 -157
  122. package/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx +1 -1
  123. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.tsx +1 -0
  124. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +1 -1
  125. package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +4 -18
  126. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +20 -161
  127. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.tsx +25 -14
  128. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.tsx +58 -34
  129. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.tsx +134 -0
  130. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx +134 -128
  131. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.tsx +18 -48
  132. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx +70 -0
  133. package/src/react/web/ui/ConnectWallet/screens/TokenSelector.tsx +1 -3
  134. package/src/react/web/ui/ConnectWallet/screens/nativeToken.ts +5 -3
  135. package/src/react/web/ui/components/token/TokenRow.tsx +38 -14
  136. package/src/utils/any-evm/compute-deployment-address.ts +4 -1
  137. package/src/utils/any-evm/compute-published-contract-deploy-info.ts +1 -0
  138. package/src/utils/any-evm/get-init-bytecode-with-salt.ts +5 -2
  139. package/src/utils/any-evm/zksync/computeDeploymentAddress.ts +6 -2
  140. package/src/version.ts +1 -1
  141. 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
- <TokenIcon
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="3xs">
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
- <Container color="primaryText">
96
- <ChevronDownIcon width={iconSize.sm} height={iconSize.sm} />
97
- </Container>
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
- ? keccakId(options.salt)
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
@@ -96,5 +96,6 @@ export async function computeDeploymentInfoFromBytecode(args: {
96
96
  initBytecodeWithsalt,
97
97
  encodedArgs,
98
98
  create2FactoryAddress,
99
+ salt,
99
100
  };
100
101
  }
@@ -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
- ? keccakId(options.salt)
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 { Hex } from "../../encoding/hex.js";
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 ? keccakId(options.salt) : keccakId("thirdweb");
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.5-nightly-0574eac02c832c382972fd545df79c36e11796e1-20250217000342";
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 const autoConnect = async (
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
+ }