thirdweb 5.105.17-nightly-84eaded1520ba3f346486bb62e5d998abacc2e93-20250721000428 → 5.105.18

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 (124) hide show
  1. package/dist/cjs/engine/list-server-wallets.js +4 -0
  2. package/dist/cjs/engine/list-server-wallets.js.map +1 -1
  3. package/dist/cjs/engine/server-wallet.js +22 -1
  4. package/dist/cjs/engine/server-wallet.js.map +1 -1
  5. package/dist/cjs/react/core/hooks/transaction/useSendAndConfirmTransaction.js.map +1 -1
  6. package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
  7. package/dist/cjs/react/core/hooks/usePaymentMethods.js +17 -0
  8. package/dist/cjs/react/core/hooks/usePaymentMethods.js.map +1 -1
  9. package/dist/cjs/react/native/ui/connect/ConnectButton.js +7 -6
  10. package/dist/cjs/react/native/ui/connect/ConnectButton.js.map +1 -1
  11. package/dist/cjs/react/native/ui/connect/ConnectModal.js +12 -1
  12. package/dist/cjs/react/native/ui/connect/ConnectModal.js.map +1 -1
  13. package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js +10 -2
  14. package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js.map +1 -1
  15. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +1 -1
  16. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  17. package/dist/cjs/react/web/ui/ConnectWallet/MenuButton.js +1 -1
  18. package/dist/cjs/react/web/ui/ConnectWallet/MenuButton.js.map +1 -1
  19. package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js +2 -2
  20. package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
  21. package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js +1 -1
  22. package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
  23. package/dist/cjs/react/web/ui/ConnectWallet/screens/ReceiveFunds.js +1 -1
  24. package/dist/cjs/react/web/ui/ConnectWallet/screens/ReceiveFunds.js.map +1 -1
  25. package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js +1 -1
  26. package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
  27. package/dist/cjs/react/web/ui/components/buttons.js +2 -2
  28. package/dist/cjs/react/web/ui/components/buttons.js.map +1 -1
  29. package/dist/cjs/react/web/ui/components/text.js +1 -1
  30. package/dist/cjs/react/web/ui/components/text.js.map +1 -1
  31. package/dist/cjs/react/web/wallets/shared/GetStartedScreen.js +1 -1
  32. package/dist/cjs/react/web/wallets/shared/GetStartedScreen.js.map +1 -1
  33. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js +1 -1
  34. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  35. package/dist/cjs/transaction/actions/send-batch-transaction.js.map +1 -1
  36. package/dist/cjs/version.js +1 -1
  37. package/dist/cjs/version.js.map +1 -1
  38. package/dist/esm/engine/list-server-wallets.js +4 -0
  39. package/dist/esm/engine/list-server-wallets.js.map +1 -1
  40. package/dist/esm/engine/server-wallet.js +22 -1
  41. package/dist/esm/engine/server-wallet.js.map +1 -1
  42. package/dist/esm/react/core/hooks/transaction/useSendAndConfirmTransaction.js.map +1 -1
  43. package/dist/esm/react/core/hooks/transaction/useSendTransaction.js +1 -1
  44. package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
  45. package/dist/esm/react/core/hooks/usePaymentMethods.js +17 -0
  46. package/dist/esm/react/core/hooks/usePaymentMethods.js.map +1 -1
  47. package/dist/esm/react/native/ui/connect/ConnectButton.js +7 -6
  48. package/dist/esm/react/native/ui/connect/ConnectButton.js.map +1 -1
  49. package/dist/esm/react/native/ui/connect/ConnectModal.js +12 -1
  50. package/dist/esm/react/native/ui/connect/ConnectModal.js.map +1 -1
  51. package/dist/esm/react/web/ui/Bridge/TransactionPayment.js +10 -2
  52. package/dist/esm/react/web/ui/Bridge/TransactionPayment.js.map +1 -1
  53. package/dist/esm/react/web/ui/ConnectWallet/Details.js +1 -1
  54. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  55. package/dist/esm/react/web/ui/ConnectWallet/MenuButton.js +1 -1
  56. package/dist/esm/react/web/ui/ConnectWallet/MenuButton.js.map +1 -1
  57. package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js +2 -2
  58. package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
  59. package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js +1 -1
  60. package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
  61. package/dist/esm/react/web/ui/ConnectWallet/screens/ReceiveFunds.js +1 -1
  62. package/dist/esm/react/web/ui/ConnectWallet/screens/ReceiveFunds.js.map +1 -1
  63. package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js +1 -1
  64. package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
  65. package/dist/esm/react/web/ui/components/buttons.js +2 -2
  66. package/dist/esm/react/web/ui/components/buttons.js.map +1 -1
  67. package/dist/esm/react/web/ui/components/text.js +1 -1
  68. package/dist/esm/react/web/ui/components/text.js.map +1 -1
  69. package/dist/esm/react/web/wallets/shared/GetStartedScreen.js +1 -1
  70. package/dist/esm/react/web/wallets/shared/GetStartedScreen.js.map +1 -1
  71. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js +1 -1
  72. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  73. package/dist/esm/transaction/actions/send-batch-transaction.js.map +1 -1
  74. package/dist/esm/version.js +1 -1
  75. package/dist/esm/version.js.map +1 -1
  76. package/dist/types/engine/create-server-wallet.d.ts +1 -0
  77. package/dist/types/engine/create-server-wallet.d.ts.map +1 -1
  78. package/dist/types/engine/list-server-wallets.d.ts +14 -4
  79. package/dist/types/engine/list-server-wallets.d.ts.map +1 -1
  80. package/dist/types/engine/server-wallet.d.ts.map +1 -1
  81. package/dist/types/react/core/hooks/transaction/useSendAndConfirmTransaction.d.ts +2 -2
  82. package/dist/types/react/core/hooks/transaction/useSendAndConfirmTransaction.d.ts.map +1 -1
  83. package/dist/types/react/core/hooks/transaction/useSendBatchTransaction.d.ts +2 -2
  84. package/dist/types/react/core/hooks/transaction/useSendBatchTransaction.d.ts.map +1 -1
  85. package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +2 -1
  86. package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
  87. package/dist/types/react/core/hooks/usePaymentMethods.d.ts.map +1 -1
  88. package/dist/types/react/native/hooks/transaction/useSendTransaction.d.ts +1 -1
  89. package/dist/types/react/native/hooks/transaction/useSendTransaction.d.ts.map +1 -1
  90. package/dist/types/react/native/ui/connect/ConnectButton.d.ts.map +1 -1
  91. package/dist/types/react/native/ui/connect/ConnectModal.d.ts +1 -1
  92. package/dist/types/react/native/ui/connect/ConnectModal.d.ts.map +1 -1
  93. package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts +1 -1
  94. package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
  95. package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts.map +1 -1
  96. package/dist/types/react/web/ui/ConnectWallet/MenuButton.d.ts.map +1 -1
  97. package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts.map +1 -1
  98. package/dist/types/transaction/actions/send-batch-transaction.d.ts +2 -2
  99. package/dist/types/transaction/actions/send-batch-transaction.d.ts.map +1 -1
  100. package/dist/types/version.d.ts +1 -1
  101. package/dist/types/version.d.ts.map +1 -1
  102. package/package.json +3 -3
  103. package/src/engine/list-server-wallets.ts +6 -0
  104. package/src/engine/server-wallet.test.ts +11 -12
  105. package/src/engine/server-wallet.ts +22 -2
  106. package/src/react/core/hooks/transaction/useSendAndConfirmTransaction.ts +6 -2
  107. package/src/react/core/hooks/transaction/useSendBatchTransaction.ts +2 -2
  108. package/src/react/core/hooks/transaction/useSendTransaction.ts +9 -2
  109. package/src/react/core/hooks/usePaymentMethods.ts +19 -0
  110. package/src/react/native/ui/connect/ConnectButton.tsx +22 -6
  111. package/src/react/native/ui/connect/ConnectModal.tsx +37 -5
  112. package/src/react/web/ui/Bridge/TransactionPayment.tsx +19 -5
  113. package/src/react/web/ui/ConnectWallet/Details.tsx +1 -1
  114. package/src/react/web/ui/ConnectWallet/MenuButton.tsx +2 -1
  115. package/src/react/web/ui/ConnectWallet/NetworkSelector.tsx +2 -2
  116. package/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx +2 -1
  117. package/src/react/web/ui/ConnectWallet/screens/ReceiveFunds.tsx +1 -1
  118. package/src/react/web/ui/TransactionButton/DepositScreen.tsx +1 -1
  119. package/src/react/web/ui/components/buttons.tsx +2 -2
  120. package/src/react/web/ui/components/text.tsx +1 -1
  121. package/src/react/web/wallets/shared/GetStartedScreen.tsx +1 -1
  122. package/src/react/web/wallets/shared/OTPLoginUI.tsx +1 -1
  123. package/src/transaction/actions/send-batch-transaction.ts +2 -2
  124. package/src/version.ts +1 -1
@@ -361,12 +361,26 @@ export function TransactionPayment({
361
361
  fullWidth
362
362
  onClick={() => {
363
363
  if (transactionDataQuery.data?.tokenInfo) {
364
+ if (
365
+ userBalance &&
366
+ Number(userBalance) <
367
+ Number(transactionDataQuery.data.totalCost)
368
+ ) {
369
+ // if user has funds, but not enough, we need to fund the wallet with the difference
370
+ onContinue(
371
+ (
372
+ Number(transactionDataQuery.data.totalCost) -
373
+ Number(userBalance)
374
+ ).toString(),
375
+ transactionDataQuery.data.tokenInfo,
376
+ getAddress(activeAccount.address),
377
+ );
378
+ return;
379
+ }
380
+
381
+ // otherwise, use the full transaction cost
364
382
  onContinue(
365
- Math.max(
366
- 0,
367
- Number(transactionDataQuery.data.totalCost) -
368
- Number(userBalance ?? "0"),
369
- ).toString(),
383
+ transactionDataQuery.data.totalCost,
370
384
  transactionDataQuery.data.tokenInfo,
371
385
  getAddress(activeAccount.address),
372
386
  );
@@ -1153,12 +1153,12 @@ export function NetworkSwitcherButton(props: {
1153
1153
  const WalletInfoButton = /* @__PURE__ */ StyledButton((_) => {
1154
1154
  const theme = useCustomTheme();
1155
1155
  return {
1156
+ all: "unset",
1156
1157
  "&:hover": {
1157
1158
  background: theme.colors.connectedButtonBgHover,
1158
1159
  transition: "background 250ms ease",
1159
1160
  },
1160
1161
  alignItems: "center",
1161
- all: "unset",
1162
1162
  animation: `${fadeInAnimation} 300ms ease`,
1163
1163
  background: theme.colors.connectedButtonBg,
1164
1164
  border: `1px solid ${theme.colors.borderColor}`,
@@ -9,6 +9,7 @@ import { StyledButton } from "../design-system/elements.js";
9
9
  export const MenuButton = /* @__PURE__ */ StyledButton((_) => {
10
10
  const theme = useCustomTheme();
11
11
  return {
12
+ all: "unset",
12
13
  "&:hover": {
13
14
  backgroundColor: theme.colors.tertiaryBg,
14
15
  svg: {
@@ -24,8 +25,8 @@ export const MenuButton = /* @__PURE__ */ StyledButton((_) => {
24
25
  "&[disabled]": {
25
26
  cursor: "not-allowed",
26
27
  },
28
+
27
29
  alignItems: "center",
28
- all: "unset",
29
30
  backgroundColor: "transparent",
30
31
  borderRadius: radius.md,
31
32
  // border: `1px solid ${theme.colors.borderColor}`,
@@ -735,11 +735,11 @@ export const TabButton = /* @__PURE__ */ (() =>
735
735
  styled.button((_) => {
736
736
  const theme = useCustomTheme();
737
737
  return {
738
+ all: "unset",
738
739
  "&[data-active='true']": {
739
740
  background: theme.colors.secondaryButtonBg,
740
741
  color: theme.colors.primaryText,
741
742
  },
742
- all: "unset",
743
743
  borderRadius: radius.lg,
744
744
  color: theme.colors.secondaryText,
745
745
  cursor: "pointer",
@@ -784,8 +784,8 @@ export const NetworkButton = /* @__PURE__ */ StyledButton((_) => {
784
784
  "&:hover": {
785
785
  background: theme.colors.secondaryButtonBg,
786
786
  },
787
- alignItems: "center",
788
787
  all: "unset",
788
+ alignItems: "center",
789
789
  borderRadius: radius.md,
790
790
  boxSizing: "border-box",
791
791
  color: theme.colors.primaryText,
@@ -95,6 +95,7 @@ export function WalletEntryButton(props: {
95
95
  export const WalletButtonEl = /* @__PURE__ */ StyledButton((_) => {
96
96
  const theme = useCustomTheme();
97
97
  return {
98
+ all: "unset",
98
99
  "&:hover": {
99
100
  backgroundColor: theme.colors.tertiaryBg,
100
101
  transform: "scale(1.01)",
@@ -102,7 +103,7 @@ export const WalletButtonEl = /* @__PURE__ */ StyledButton((_) => {
102
103
  '&[data-active="true"]': {
103
104
  backgroundColor: theme.colors.tertiaryBg,
104
105
  },
105
- all: "unset",
106
+
106
107
  alignItems: "center",
107
108
  borderRadius: radius.md,
108
109
  boxSizing: "border-box",
@@ -85,10 +85,10 @@ export function ReceiveFunds(props: {
85
85
  const WalletAddressContainer = /* @__PURE__ */ StyledButton((_) => {
86
86
  const theme = useCustomTheme();
87
87
  return {
88
+ all: "unset",
88
89
  "&:hover": {
89
90
  borderColor: theme.colors.accentText,
90
91
  },
91
- all: "unset",
92
92
  border: `1px solid ${theme.colors.borderColor}`,
93
93
  borderRadius: radius.md,
94
94
  boxSizing: "border-box",
@@ -283,10 +283,10 @@ export function DepositScreen(props: {
283
283
  const WalletAddressContainer = /* @__PURE__ */ StyledButton((_) => {
284
284
  const theme = useCustomTheme();
285
285
  return {
286
+ all: "unset",
286
287
  "&:hover": {
287
288
  borderColor: theme.colors.accentText,
288
289
  },
289
- all: "unset",
290
290
  border: `1px solid ${theme.colors.borderColor}`,
291
291
  borderRadius: `0 0 ${radius.md} ${radius.md}`,
292
292
  boxSizing: "border-box",
@@ -22,6 +22,7 @@ export const Button = /* @__PURE__ */ StyledButton((props: ButtonProps) => {
22
22
  return {};
23
23
  }
24
24
  return {
25
+ all: "unset",
25
26
  "&:active": {
26
27
  transform: "translateY(1px)",
27
28
  },
@@ -38,7 +39,6 @@ export const Button = /* @__PURE__ */ StyledButton((props: ButtonProps) => {
38
39
  cursor: "not-allowed",
39
40
  },
40
41
  alignItems: "center",
41
- all: "unset",
42
42
  background: (() => {
43
43
  if (props.bg) {
44
44
  return theme.colors[props.bg];
@@ -144,6 +144,7 @@ export const ButtonLink = /* @__PURE__ */ (() => Button.withComponent("a"))();
144
144
  export const IconButton = /* @__PURE__ */ StyledButton((_) => {
145
145
  const theme = useCustomTheme();
146
146
  return {
147
+ all: "unset",
147
148
  "&:hover": {
148
149
  background: theme.colors.secondaryIconHoverBg,
149
150
  color: theme.colors.secondaryIconHoverColor,
@@ -152,7 +153,6 @@ export const IconButton = /* @__PURE__ */ StyledButton((_) => {
152
153
  cursor: "not-allowed",
153
154
  },
154
155
  alignItems: "center",
155
- all: "unset",
156
156
  borderRadius: radius.sm,
157
157
  color: theme.colors.secondaryIconColor,
158
158
  cursor: "pointer",
@@ -44,11 +44,11 @@ type LinkProps = {
44
44
  export const Link = /* @__PURE__ */ StyledAnchor<LinkProps>((p) => {
45
45
  const theme = useCustomTheme();
46
46
  return {
47
+ all: "unset",
47
48
  "&:hover": {
48
49
  color: theme.colors[p.hoverColor || "primaryText"],
49
50
  textDecoration: "none",
50
51
  },
51
- all: "unset",
52
52
  color: theme.colors[p.color || "accentText"],
53
53
  cursor: "pointer",
54
54
  display: p.inline ? "inline" : "block",
@@ -212,13 +212,13 @@ const InstallScanScreen: React.FC<{
212
212
  const ButtonLink = /* @__PURE__ */ StyledButton((_) => {
213
213
  const theme = useCustomTheme();
214
214
  return {
215
+ all: "unset",
215
216
  "&:hover": {
216
217
  background: theme.colors.secondaryButtonHoverBg,
217
218
  color: theme.colors.primaryText,
218
219
  textDecoration: "none",
219
220
  },
220
221
  alignItems: "center",
221
- all: "unset",
222
222
  background: theme.colors.secondaryButtonBg,
223
223
  borderRadius: radius.sm,
224
224
  boxSizing: "border-box",
@@ -342,10 +342,10 @@ export function OTPLoginUI(props: {
342
342
  const LinkButton = /* @__PURE__ */ StyledButton((_) => {
343
343
  const theme = useCustomTheme();
344
344
  return {
345
+ all: "unset",
345
346
  "&:hover": {
346
347
  color: theme.colors.primaryText,
347
348
  },
348
- all: "unset",
349
349
  color: theme.colors.accentText,
350
350
  cursor: "pointer",
351
351
  fontSize: fontSize.sm,
@@ -3,12 +3,12 @@ import type {
3
3
  Account,
4
4
  SendTransactionOption,
5
5
  } from "../../wallets/interfaces/wallet.js";
6
- import type { PreparedTransaction } from "../prepare-transaction.js";
7
6
  import { encode } from "./encode.js";
7
+ import type { SendTransactionOptions } from "./send-transaction.js";
8
8
  import type { WaitForReceiptOptions } from "./wait-for-tx-receipt.js";
9
9
 
10
10
  export type SendBatchTransactionOptions = {
11
- transactions: PreparedTransaction[];
11
+ transactions: SendTransactionOptions["transaction"][];
12
12
  account: Account;
13
13
  };
14
14
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "5.105.17-nightly-84eaded1520ba3f346486bb62e5d998abacc2e93-20250721000428";
1
+ export const version = "5.105.18";