thirdweb 5.95.0-nightly-4c1f384a635054a8cfaaa487e3ba7ada63b221ec-20250415110008 → 5.95.0-nightly-64bd603301b3067b6a69a29f66a28dee7ffa38f5-20250416000349
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/chains/utils.js +41 -0
- package/dist/cjs/chains/utils.js.map +1 -1
- package/dist/cjs/event/actions/get-events.js +65 -11
- package/dist/cjs/event/actions/get-events.js.map +1 -1
- package/dist/cjs/insight/get-events.js +54 -0
- package/dist/cjs/insight/get-events.js.map +1 -0
- package/dist/cjs/insight/get-nfts.js +4 -4
- package/dist/cjs/insight/get-nfts.js.map +1 -1
- package/dist/cjs/insight/get-tokens.js +4 -4
- package/dist/cjs/insight/get-tokens.js.map +1 -1
- package/dist/cjs/insight/get-transactions.js +3 -2
- package/dist/cjs/insight/get-transactions.js.map +1 -1
- package/dist/cjs/insight/index.js +3 -1
- package/dist/cjs/insight/index.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getHistory.js +2 -2
- package/dist/cjs/pay/buyWithCrypto/getHistory.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getStatus.js +2 -2
- package/dist/cjs/pay/buyWithCrypto/getStatus.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/getHistory.js +2 -2
- package/dist/cjs/pay/buyWithFiat/getHistory.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/getStatus.js +2 -2
- package/dist/cjs/pay/buyWithFiat/getStatus.js.map +1 -1
- package/dist/cjs/pay/getBuyHistory.js +2 -2
- package/dist/cjs/pay/getBuyHistory.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +6 -2
- 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/TransferConfirmationScreen.js +3 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SendFunds.js +3 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SendFunds.js.map +1 -1
- package/dist/cjs/rpc/fetch-rpc.js +4 -4
- package/dist/cjs/rpc/fetch-rpc.js.map +1 -1
- package/dist/cjs/transaction/actions/gasless/providers/biconomy.js +0 -1
- package/dist/cjs/transaction/actions/gasless/providers/biconomy.js.map +1 -1
- package/dist/cjs/transaction/actions/gasless/providers/openzeppelin.js +0 -1
- package/dist/cjs/transaction/actions/gasless/providers/openzeppelin.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/chains/utils.js +40 -0
- package/dist/esm/chains/utils.js.map +1 -1
- package/dist/esm/event/actions/get-events.js +62 -8
- package/dist/esm/event/actions/get-events.js.map +1 -1
- package/dist/esm/insight/get-events.js +51 -0
- package/dist/esm/insight/get-events.js.map +1 -0
- package/dist/esm/insight/get-nfts.js +4 -4
- package/dist/esm/insight/get-nfts.js.map +1 -1
- package/dist/esm/insight/get-tokens.js +4 -4
- package/dist/esm/insight/get-tokens.js.map +1 -1
- package/dist/esm/insight/get-transactions.js +3 -2
- package/dist/esm/insight/get-transactions.js.map +1 -1
- package/dist/esm/insight/index.js +1 -0
- package/dist/esm/insight/index.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getHistory.js +2 -2
- package/dist/esm/pay/buyWithCrypto/getHistory.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getStatus.js +2 -2
- package/dist/esm/pay/buyWithCrypto/getStatus.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/getHistory.js +2 -2
- package/dist/esm/pay/buyWithFiat/getHistory.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/getStatus.js +2 -2
- package/dist/esm/pay/buyWithFiat/getStatus.js.map +1 -1
- package/dist/esm/pay/getBuyHistory.js +2 -2
- package/dist/esm/pay/getBuyHistory.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +6 -2
- 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/TransferConfirmationScreen.js +3 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/SendFunds.js +3 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/SendFunds.js.map +1 -1
- package/dist/esm/rpc/fetch-rpc.js +4 -4
- package/dist/esm/rpc/fetch-rpc.js.map +1 -1
- package/dist/esm/transaction/actions/gasless/providers/biconomy.js +0 -1
- package/dist/esm/transaction/actions/gasless/providers/biconomy.js.map +1 -1
- package/dist/esm/transaction/actions/gasless/providers/openzeppelin.js +0 -1
- package/dist/esm/transaction/actions/gasless/providers/openzeppelin.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/chains/types.d.ts +7 -0
- package/dist/types/chains/types.d.ts.map +1 -1
- package/dist/types/chains/utils.d.ts +15 -1
- package/dist/types/chains/utils.d.ts.map +1 -1
- package/dist/types/event/actions/get-events.d.ts +1 -6
- package/dist/types/event/actions/get-events.d.ts.map +1 -1
- package/dist/types/insight/get-events.d.ts +31 -0
- package/dist/types/insight/get-events.d.ts.map +1 -0
- package/dist/types/insight/get-nfts.d.ts +1 -1
- package/dist/types/insight/get-nfts.d.ts.map +1 -1
- package/dist/types/insight/get-tokens.d.ts +1 -1
- package/dist/types/insight/get-tokens.d.ts.map +1 -1
- package/dist/types/insight/get-transactions.d.ts +1 -1
- package/dist/types/insight/get-transactions.d.ts.map +1 -1
- package/dist/types/insight/index.d.ts +1 -0
- package/dist/types/insight/index.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getHistory.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getStatus.d.ts.map +1 -1
- package/dist/types/pay/buyWithFiat/getHistory.d.ts.map +1 -1
- package/dist/types/pay/buyWithFiat/getStatus.d.ts.map +1 -1
- package/dist/types/pay/getBuyHistory.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/TransferConfirmationScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/SendFunds.d.ts.map +1 -1
- package/dist/types/rpc/fetch-rpc.d.ts.map +1 -1
- package/dist/types/transaction/actions/gasless/providers/biconomy.d.ts.map +1 -1
- package/dist/types/transaction/actions/gasless/providers/openzeppelin.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/chains/types.ts +8 -0
- package/src/chains/utils.ts +61 -0
- package/src/event/actions/get-events.test.ts +96 -0
- package/src/event/actions/get-events.ts +99 -12
- package/src/insight/get-events.ts +78 -0
- package/src/insight/get-nfts.ts +8 -5
- package/src/insight/get-tokens.ts +8 -5
- package/src/insight/get-transactions.ts +6 -6
- package/src/insight/index.ts +1 -0
- package/src/pay/buyWithCrypto/getHistory.ts +4 -2
- package/src/pay/buyWithCrypto/getStatus.ts +4 -2
- package/src/pay/buyWithFiat/getHistory.ts +4 -2
- package/src/pay/buyWithFiat/getStatus.ts +4 -2
- package/src/pay/getBuyHistory.ts +4 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +10 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.tsx +5 -1
- package/src/react/web/ui/ConnectWallet/screens/SendFunds.tsx +5 -1
- package/src/rpc/fetch-rpc.ts +6 -4
- package/src/transaction/actions/gasless/providers/biconomy.ts +0 -1
- package/src/transaction/actions/gasless/providers/openzeppelin.ts +0 -1
- package/src/version.ts +1 -1
@@ -3,6 +3,7 @@ import {
|
|
3
3
|
type GetV1WalletsByWalletAddressTransactionsResponse,
|
4
4
|
getV1WalletsByWalletAddressTransactions,
|
5
5
|
} from "@thirdweb-dev/insight";
|
6
|
+
import { stringify } from "viem";
|
6
7
|
import type { Chain } from "../chains/types.js";
|
7
8
|
import type { ThirdwebClient } from "../client/client.js";
|
8
9
|
import { getThirdwebDomains } from "../utils/domains.js";
|
@@ -30,10 +31,7 @@ export async function getTransactions(args: {
|
|
30
31
|
client: ThirdwebClient;
|
31
32
|
walletAddress: string;
|
32
33
|
chains: Chain[];
|
33
|
-
queryOptions?:
|
34
|
-
GetV1WalletsByWalletAddressTransactionsData["query"],
|
35
|
-
"chain"
|
36
|
-
>;
|
34
|
+
queryOptions?: GetV1WalletsByWalletAddressTransactionsData["query"];
|
37
35
|
}): Promise<Transaction[]> {
|
38
36
|
const threeMonthsAgoInSeconds = Math.floor(
|
39
37
|
(Date.now() - 3 * 30 * 24 * 60 * 60 * 1000) / 1000,
|
@@ -52,15 +50,17 @@ export async function getTransactions(args: {
|
|
52
50
|
baseUrl: `https://${getThirdwebDomains().insight}`,
|
53
51
|
fetch: getClientFetch(client),
|
54
52
|
query: {
|
55
|
-
...queryOptions,
|
56
53
|
chain: chains.map((chain) => chain.id),
|
54
|
+
...queryOptions,
|
57
55
|
},
|
58
56
|
path: {
|
59
57
|
wallet_address: walletAddress,
|
60
58
|
},
|
61
59
|
});
|
62
60
|
if (result.error) {
|
63
|
-
throw new Error(
|
61
|
+
throw new Error(
|
62
|
+
`${result.response.status} ${result.response.statusText} - ${result.error ? stringify(result.error) : "Unknown error"}`,
|
63
|
+
);
|
64
64
|
}
|
65
65
|
return result.data.data || [];
|
66
66
|
}
|
package/src/insight/index.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
1
|
export { getOwnedNFTs, type OwnedNFT } from "./get-nfts.js";
|
2
2
|
export { getOwnedTokens, type OwnedToken } from "./get-tokens.js";
|
3
3
|
export { getTransactions, type Transaction } from "./get-transactions.js";
|
4
|
+
export { getContractEvents, type ContractEvent } from "./get-events.js";
|
@@ -79,8 +79,10 @@ export async function getBuyWithCryptoHistory(
|
|
79
79
|
|
80
80
|
// Assuming the response directly matches the SwapResponse interface
|
81
81
|
if (!response.ok) {
|
82
|
-
response.
|
83
|
-
throw new Error(
|
82
|
+
const error = await response.text().catch(() => null);
|
83
|
+
throw new Error(
|
84
|
+
`HTTP error! status: ${response.status} - ${response.statusText}: ${error || "unknown error"}`,
|
85
|
+
);
|
84
86
|
}
|
85
87
|
|
86
88
|
const data: BuyWithCryptoHistoryData = (await response.json()).result;
|
@@ -142,8 +142,10 @@ export async function getBuyWithCryptoStatus(
|
|
142
142
|
|
143
143
|
// Assuming the response directly matches the BuyWithCryptoStatus interface
|
144
144
|
if (!response.ok) {
|
145
|
-
response.
|
146
|
-
throw new Error(
|
145
|
+
const error = await response.text().catch(() => null);
|
146
|
+
throw new Error(
|
147
|
+
`HTTP error! status: ${response.status} - ${response.statusText}: ${error || "unknown error"}`,
|
148
|
+
);
|
147
149
|
}
|
148
150
|
|
149
151
|
const data: BuyWithCryptoStatus = (await response.json()).result;
|
@@ -78,8 +78,10 @@ export async function getBuyWithFiatHistory(
|
|
78
78
|
|
79
79
|
// Assuming the response directly matches the BuyWithFiatStatus response interface
|
80
80
|
if (!response.ok) {
|
81
|
-
response.
|
82
|
-
throw new Error(
|
81
|
+
const error = await response.text().catch(() => null);
|
82
|
+
throw new Error(
|
83
|
+
`HTTP error! status: ${response.status} - ${response.statusText}: ${error || "unknown error"}`,
|
84
|
+
);
|
83
85
|
}
|
84
86
|
|
85
87
|
const data: BuyWithFiatHistoryData = (await response.json()).result;
|
@@ -188,8 +188,10 @@ export async function getBuyWithFiatStatus(
|
|
188
188
|
const response = await getClientFetch(params.client)(url);
|
189
189
|
|
190
190
|
if (!response.ok) {
|
191
|
-
response.
|
192
|
-
throw new Error(
|
191
|
+
const error = await response.text().catch(() => null);
|
192
|
+
throw new Error(
|
193
|
+
`HTTP error! status: ${response.status} - ${response.statusText}: ${error || "unknown error"}`,
|
194
|
+
);
|
193
195
|
}
|
194
196
|
|
195
197
|
return (await response.json()).result;
|
package/src/pay/getBuyHistory.ts
CHANGED
@@ -93,8 +93,10 @@ export async function getBuyHistory(
|
|
93
93
|
|
94
94
|
// Assuming the response directly matches the SwapResponse interface
|
95
95
|
if (!response.ok) {
|
96
|
-
response.
|
97
|
-
throw new Error(
|
96
|
+
const error = await response.text().catch(() => null);
|
97
|
+
throw new Error(
|
98
|
+
`HTTP error! status: ${response.status} - ${response.statusText}: ${error || "unknown error"}`,
|
99
|
+
);
|
98
100
|
}
|
99
101
|
|
100
102
|
const data: BuyHistoryData = (await response.json()).result;
|
@@ -68,7 +68,11 @@ export function SwapConfirmationScreen(props: {
|
|
68
68
|
|
69
69
|
const uiErrorMessage = useMemo(() => {
|
70
70
|
if (step === "approval" && status === "error" && error) {
|
71
|
-
if (
|
71
|
+
if (
|
72
|
+
error.toLowerCase().includes("user rejected") ||
|
73
|
+
error.toLowerCase().includes("user closed modal") ||
|
74
|
+
error.toLowerCase().includes("user denied")
|
75
|
+
) {
|
72
76
|
return {
|
73
77
|
title: "Failed to Approve",
|
74
78
|
message: "Your wallet rejected the approval request.",
|
@@ -82,7 +86,11 @@ export function SwapConfirmationScreen(props: {
|
|
82
86
|
}
|
83
87
|
|
84
88
|
if (step === "swap" && status === "error" && error) {
|
85
|
-
if (
|
89
|
+
if (
|
90
|
+
error.toLowerCase().includes("user rejected") ||
|
91
|
+
error.toLowerCase().includes("user closed modal") ||
|
92
|
+
error.toLowerCase().includes("user denied")
|
93
|
+
) {
|
86
94
|
return {
|
87
95
|
title: "Failed to Confirm",
|
88
96
|
message: "Your wallet rejected the confirmation request.",
|
@@ -112,7 +112,11 @@ export function TransferConfirmationScreen(
|
|
112
112
|
|
113
113
|
const uiErrorMessage = useMemo(() => {
|
114
114
|
if (step === "approve" && status.id === "error" && status.error) {
|
115
|
-
if (
|
115
|
+
if (
|
116
|
+
status.error.toLowerCase().includes("user rejected") ||
|
117
|
+
status.error.toLowerCase().includes("user closed modal") ||
|
118
|
+
status.error.toLowerCase().includes("user denied")
|
119
|
+
) {
|
116
120
|
return {
|
117
121
|
title: "Failed to Approve",
|
118
122
|
message: "Your wallet rejected the approval request.",
|
@@ -145,7 +145,11 @@ export function SendFundsForm(props: {
|
|
145
145
|
return locale.transactionFailed;
|
146
146
|
}
|
147
147
|
|
148
|
-
if (
|
148
|
+
if (
|
149
|
+
message.includes("user rejected") ||
|
150
|
+
message.includes("user closed modal") ||
|
151
|
+
message.includes("user denied")
|
152
|
+
) {
|
149
153
|
return locale.transactionRejected;
|
150
154
|
}
|
151
155
|
|
package/src/rpc/fetch-rpc.ts
CHANGED
@@ -72,9 +72,9 @@ export async function fetchRpc(
|
|
72
72
|
});
|
73
73
|
|
74
74
|
if (!response.ok) {
|
75
|
-
response.
|
75
|
+
const error = await response.text().catch(() => null);
|
76
76
|
throw new Error(
|
77
|
-
`RPC request failed with status ${response.status} - ${response.statusText}`,
|
77
|
+
`RPC request failed with status ${response.status} - ${response.statusText}: ${error || "unknown error"}`,
|
78
78
|
);
|
79
79
|
}
|
80
80
|
|
@@ -116,8 +116,10 @@ export async function fetchSingleRpc(
|
|
116
116
|
});
|
117
117
|
|
118
118
|
if (!response.ok) {
|
119
|
-
response.
|
120
|
-
throw new Error(
|
119
|
+
const error = await response.text().catch(() => null);
|
120
|
+
throw new Error(
|
121
|
+
`RPC request failed with status ${response.status} - ${response.statusText}: ${error || "unknown error"}`,
|
122
|
+
);
|
121
123
|
}
|
122
124
|
if (response.headers.get("Content-Type")?.startsWith("application/json")) {
|
123
125
|
return await response.json();
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.95.0-nightly-
|
1
|
+
export const version = "5.95.0-nightly-64bd603301b3067b6a69a29f66a28dee7ffa38f5-20250416000349";
|