thirdweb 5.93.9 → 5.93.10
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/utils/create-2-factory.js +0 -4
- package/dist/cjs/contract/deployment/utils/create-2-factory.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getQuote.js +0 -2
- package/dist/cjs/pay/buyWithCrypto/getQuote.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getTransfer.js +0 -1
- package/dist/cjs/pay/buyWithCrypto/getTransfer.js.map +1 -1
- package/dist/cjs/react/core/hooks/contract/useWaitForReceipt.js +1 -1
- package/dist/cjs/react/core/hooks/contract/useWaitForReceipt.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +4 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js +36 -15
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js.map +1 -1
- package/dist/cjs/transaction/transaction-store.js +25 -0
- package/dist/cjs/transaction/transaction-store.js.map +1 -1
- package/dist/cjs/utils/domains.js +3 -0
- package/dist/cjs/utils/domains.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/contract/deployment/utils/create-2-factory.js +0 -4
- package/dist/esm/contract/deployment/utils/create-2-factory.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getQuote.js +0 -2
- package/dist/esm/pay/buyWithCrypto/getQuote.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getTransfer.js +0 -1
- package/dist/esm/pay/buyWithCrypto/getTransfer.js.map +1 -1
- package/dist/esm/react/core/hooks/contract/useWaitForReceipt.js +1 -1
- package/dist/esm/react/core/hooks/contract/useWaitForReceipt.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +4 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js +37 -16
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js.map +1 -1
- package/dist/esm/transaction/transaction-store.js +24 -0
- package/dist/esm/transaction/transaction-store.js.map +1 -1
- package/dist/esm/utils/domains.js +3 -0
- package/dist/esm/utils/domains.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/pay/buyWithCrypto/getQuote.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getTransfer.d.ts.map +1 -1
- package/dist/types/react/core/hooks/contract/useWaitForReceipt.d.ts +5 -1
- package/dist/types/react/core/hooks/contract/useWaitForReceipt.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.d.ts.map +1 -1
- package/dist/types/transaction/transaction-store.d.ts +14 -0
- package/dist/types/transaction/transaction-store.d.ts.map +1 -1
- package/dist/types/utils/domains.d.ts +6 -0
- package/dist/types/utils/domains.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/bridge/Buy.test.ts +1 -1
- package/src/bridge/Sell.test.ts +1 -1
- package/src/contract/deployment/utils/create-2-factory.ts +0 -4
- package/src/pay/buyWithCrypto/getQuote.ts +0 -2
- package/src/pay/buyWithCrypto/getTransfer.ts +0 -1
- package/src/react/core/hooks/contract/useWaitForReceipt.ts +5 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx +4 -1
- package/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx +51 -17
- package/src/transaction/transaction-store.ts +50 -0
- package/src/utils/domain.test.ts +1 -0
- package/src/utils/domains.ts +8 -1
- package/src/version.ts +1 -1
@@ -2,9 +2,11 @@
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
3
3
|
import styled from "@emotion/styled";
|
4
4
|
import { CheckIcon, CrossCircledIcon } from "@radix-ui/react-icons";
|
5
|
+
import { useQuery } from "@tanstack/react-query";
|
5
6
|
import { useSyncExternalStore } from "react";
|
7
|
+
import { ethereum } from "../../../../../chains/chain-definitions/ethereum.js";
|
6
8
|
import { getCachedChain } from "../../../../../chains/utils.js";
|
7
|
-
import { getTransactionStore } from "../../../../../transaction/transaction-store.js";
|
9
|
+
import { getPastTransactions, getTransactionStore, } from "../../../../../transaction/transaction-store.js";
|
8
10
|
import { shortenHex } from "../../../../../utils/address.js";
|
9
11
|
import { formatExplorerTxUrl } from "../../../../../utils/url.js";
|
10
12
|
import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js";
|
@@ -24,25 +26,44 @@ export function WalletTransactionHistory(props) {
|
|
24
26
|
const chainExplorers = useChainExplorers(activeChain);
|
25
27
|
const transactionStore = getTransactionStore(props.address);
|
26
28
|
const reverseChronologicalTransactions = useSyncExternalStore(transactionStore.subscribe, transactionStore.getValue);
|
27
|
-
const
|
29
|
+
const historicalTxQuery = useQuery({
|
30
|
+
queryKey: ["transactions", props.address, activeChain],
|
31
|
+
queryFn: () => getPastTransactions({
|
32
|
+
walletAddress: props.address,
|
33
|
+
chain: activeChain || ethereum,
|
34
|
+
client: props.client,
|
35
|
+
}),
|
36
|
+
enabled: !!activeChain,
|
37
|
+
});
|
38
|
+
const transactions = [
|
39
|
+
...[...reverseChronologicalTransactions].reverse(),
|
40
|
+
...(historicalTxQuery.data || []),
|
41
|
+
];
|
28
42
|
return (_jsx(Container, { scrollY: true, flex: "column", fullHeight: true, style: {
|
29
43
|
minHeight: "250px",
|
30
44
|
maxHeight: "370px",
|
31
45
|
paddingBottom: spacing.lg,
|
32
|
-
}, children:
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
46
|
+
}, children: _jsxs(Container, { flex: "column", gap: "xs", expand: true, children: [historicalTxQuery.isLoading && (_jsxs(Container, { flex: "column", gap: "md", center: "both", color: "secondaryText", style: {
|
47
|
+
flex: "1",
|
48
|
+
minHeight: "250px",
|
49
|
+
}, children: [_jsx(Spinner, { color: "secondaryText", size: "md" }), _jsx(Text, { children: "Loading recent transactions..." })] })), !historicalTxQuery.isLoading && transactions.length === 0 ? (_jsxs(Container, { flex: "column", gap: "md", center: "both", color: "secondaryText", style: {
|
50
|
+
flex: "1",
|
51
|
+
minHeight: "250px",
|
52
|
+
}, children: [_jsx(CrossCircledIcon, { width: iconSize.xl, height: iconSize.xl }), _jsx(Text, { children: "No Transactions" })] })) : (_jsx(Container, { animate: "fadein", flex: "column", gap: "xs", style: { minHeight: "250px" }, children: transactions.map((tx) => {
|
53
|
+
return (_jsx(TransactionButton, { explorerUrl: chainExplorers.explorers[0]?.url, client: props.client, tx: tx }, tx.transactionHash));
|
54
|
+
}) }))] }) }));
|
38
55
|
}
|
39
56
|
function TransactionButton(props) {
|
40
|
-
const { data:
|
41
|
-
transactionHash: props.
|
42
|
-
chain: getCachedChain(props.chainId),
|
57
|
+
const { data: fetchedReceipt, isLoading, error, } = useWaitForReceipt({
|
58
|
+
transactionHash: props.tx.transactionHash,
|
59
|
+
chain: getCachedChain(props.tx.chainId),
|
43
60
|
client: props.client,
|
61
|
+
queryOptions: {
|
62
|
+
enabled: props.tx.receipt === undefined,
|
63
|
+
},
|
44
64
|
});
|
45
|
-
const chainIconQuery = useChainIconUrl(getCachedChain(props.chainId));
|
65
|
+
const chainIconQuery = useChainIconUrl(getCachedChain(props.tx.chainId));
|
66
|
+
const receipt = props.tx.receipt ?? fetchedReceipt;
|
46
67
|
const content = (_jsxs(TxButton, { variant: "secondary", fullWidth: true, style: {
|
47
68
|
paddingBlock: spacing.sm,
|
48
69
|
}, children: [_jsxs(Container, { flex: "row", center: "y", gap: "md", style: {
|
@@ -55,12 +76,12 @@ function TransactionButton(props) {
|
|
55
76
|
}, children: [_jsx(Container, { flex: "row", gap: "xs", center: "y", style: {
|
56
77
|
justifyContent: "space-between",
|
57
78
|
}, children: _jsx(Text, { size: "sm", color: "primaryText", children: receipt?.to
|
58
|
-
? `Interacted with ${shortenHex(receipt
|
59
|
-
: `Hash: ${shortenHex(props.
|
79
|
+
? `Interacted with ${shortenHex(receipt?.to, 4)}`
|
80
|
+
: `Hash: ${shortenHex(props.tx.transactionHash, 4)}` }) }), _jsx(Spacer, { y: "xxs" }), _jsx(Container, { flex: "row", center: "y", gap: "xxs", style: {
|
60
81
|
justifyContent: "space-between",
|
61
|
-
}, children: _jsx(ChainName, { chain: getCachedChain(props.chainId), size: "xs", client: props.client }) })] })] }), _jsxs(Container, { flex: "row", gap: "xxs", center: "y", children: [isLoading && _jsx(Spinner, { size: "sm", color: "primaryText" }), !isLoading && receipt && receipt.status === "success" && (_jsx(Text, { size: "md", color: "success", children: _jsx(CheckIcon, { width: iconSize.md, height: iconSize.md }) })), (error || (!isLoading && receipt && receipt.status !== "success")) && (_jsx(Text, { size: "md", color: "danger", children: _jsx(CrossCircledIcon, { width: iconSize.md, height: iconSize.md }) }))] })] }));
|
82
|
+
}, children: _jsx(ChainName, { chain: getCachedChain(props.tx.chainId), size: "xs", client: props.client }) })] })] }), _jsxs(Container, { flex: "row", gap: "xxs", center: "y", children: [isLoading && _jsx(Spinner, { size: "sm", color: "primaryText" }), !isLoading && receipt && receipt.status === "success" && (_jsx(Text, { size: "md", color: "success", children: _jsx(CheckIcon, { width: iconSize.md, height: iconSize.md }) })), (error || (!isLoading && receipt && receipt.status !== "success")) && (_jsx(Text, { size: "md", color: "danger", children: _jsx(CrossCircledIcon, { width: iconSize.md, height: iconSize.md }) }))] })] }));
|
62
83
|
if (props.explorerUrl) {
|
63
|
-
return (_jsx("a", { href: formatExplorerTxUrl(props.explorerUrl, props.
|
84
|
+
return (_jsx("a", { href: formatExplorerTxUrl(props.explorerUrl, props.tx.transactionHash), target: "_blank", rel: "noreferrer", children: content }));
|
64
85
|
}
|
65
86
|
return content;
|
66
87
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WalletTransactionHistory.js","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,OAAO,
|
1
|
+
{"version":3,"file":"WalletTransactionHistory.js","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,qDAAqD,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAEL,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MA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../utils/domains.js";
|
3
|
+
import { getClientFetch } from "../utils/fetch.js";
|
2
4
|
const transactionsByAddress = new Map();
|
3
5
|
/**
|
4
6
|
* Retrieve the transaction store for a given address.
|
@@ -36,4 +38,26 @@ export function addTransactionToStore(options) {
|
|
36
38
|
]);
|
37
39
|
transactionsByAddress.set(address, tranasctionStore);
|
38
40
|
}
|
41
|
+
/**
|
42
|
+
* @internal for now
|
43
|
+
*/
|
44
|
+
export async function getPastTransactions(options) {
|
45
|
+
const { walletAddress, chain, client } = options;
|
46
|
+
const oneMonthsAgoInSeconds = Math.floor((Date.now() - 1 * 30 * 24 * 60 * 60 * 1000) / 1000);
|
47
|
+
const url = new URL(`https://${getThirdwebDomains().insight}/v1/wallets/${walletAddress}/transactions`);
|
48
|
+
url.searchParams.set("limit", "10");
|
49
|
+
url.searchParams.set("chain", chain.id.toString());
|
50
|
+
url.searchParams.set("filter_block_timestamp_gte", oneMonthsAgoInSeconds.toString());
|
51
|
+
const clientFetch = getClientFetch(client);
|
52
|
+
const result = await clientFetch(url.toString());
|
53
|
+
const json = (await result.json());
|
54
|
+
return json.data.map((tx) => ({
|
55
|
+
transactionHash: tx.hash,
|
56
|
+
chainId: tx.chain_id,
|
57
|
+
receipt: {
|
58
|
+
status: tx.status === 1 ? "success" : "failed",
|
59
|
+
to: tx.to_address,
|
60
|
+
},
|
61
|
+
}));
|
62
|
+
}
|
39
63
|
//# sourceMappingURL=transaction-store.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction-store.js","sourceRoot":"","sources":["../../../src/transaction/transaction-store.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"transaction-store.js","sourceRoot":"","sources":["../../../src/transaction/transaction-store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,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AAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACpC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnD,GAAG,CAAC,YAAY,CAAC,GAAG,CAClB,4BAA4B,EAC5B,qBAAqB,CAAC,QAAQ,EAAE,CACjC,CAAC;IACF,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,CAAC,MAAM,MAAM,CAAC,IAAI,EAAE,CAOhC,CAAC;IACF,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5B,eAAe,EAAE,EAAE,CAAC,IAAW;QAC/B,OAAO,EAAE,EAAE,CAAC,QAAQ;QACpB,OAAO,EAAE;YACP,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;YAC9C,EAAE,EAAE,EAAE,CAAC,UAAU;SAClB;KACF,CAAC,CAAC,CAAC;AACN,CAAC"}
|
@@ -5,6 +5,7 @@ const DEFAULT_PAY_URL = "pay.thirdweb.com";
|
|
5
5
|
const DEFAULT_STORAGE_URL = "storage.thirdweb.com";
|
6
6
|
const DEFAULT_BUNDLER_URL = "bundler.thirdweb.com";
|
7
7
|
const DEFAULT_ANALYTICS_URL = "c.thirdweb.com";
|
8
|
+
const DEFAULT_INSIGHT_URL = "insight.thirdweb.com";
|
8
9
|
let domains = {
|
9
10
|
rpc: DEFAULT_RPC_URL,
|
10
11
|
inAppWallet: DEFAULT_IN_APP_WALLET_URL,
|
@@ -13,6 +14,7 @@ let domains = {
|
|
13
14
|
storage: DEFAULT_STORAGE_URL,
|
14
15
|
bundler: DEFAULT_BUNDLER_URL,
|
15
16
|
analytics: DEFAULT_ANALYTICS_URL,
|
17
|
+
insight: DEFAULT_INSIGHT_URL,
|
16
18
|
};
|
17
19
|
/**
|
18
20
|
* @internal
|
@@ -26,6 +28,7 @@ export const setThirdwebDomains = (DomainOverrides) => {
|
|
26
28
|
storage: DomainOverrides.storage ?? DEFAULT_STORAGE_URL,
|
27
29
|
bundler: DomainOverrides.bundler ?? DEFAULT_BUNDLER_URL,
|
28
30
|
analytics: DomainOverrides.analytics ?? DEFAULT_ANALYTICS_URL,
|
31
|
+
insight: DomainOverrides.insight ?? DEFAULT_INSIGHT_URL,
|
29
32
|
};
|
30
33
|
};
|
31
34
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"domains.js","sourceRoot":"","sources":["../../../src/utils/domains.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"domains.js","sourceRoot":"","sources":["../../../src/utils/domains.ts"],"names":[],"mappings":"AA2CA,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAClD,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AACjD,MAAM,yBAAyB,GAAG,8BAA8B,CAAC;AACjE,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAC3C,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AACnD,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AACnD,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAC/C,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AACnD,IAAI,OAAO,GAA+C;IACxD,GAAG,EAAE,eAAe;IACpB,WAAW,EAAE,yBAAyB;IACtC,MAAM,EAAE,kBAAkB;IAC1B,GAAG,EAAE,eAAe;IACpB,OAAO,EAAE,mBAAmB;IAC5B,OAAO,EAAE,mBAAmB;IAC5B,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,mBAAmB;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,eAAgC,EAAE,EAAE;IACrE,OAAO,GAAG;QACR,GAAG,EAAE,eAAe,CAAC,GAAG,IAAI,eAAe;QAC3C,WAAW,EAAE,eAAe,CAAC,WAAW,IAAI,yBAAyB;QACrE,MAAM,EAAE,eAAe,CAAC,MAAM,IAAI,kBAAkB;QACpD,GAAG,EAAE,eAAe,CAAC,GAAG,IAAI,eAAe;QAC3C,OAAO,EAAE,eAAe,CAAC,OAAO,IAAI,mBAAmB;QACvD,OAAO,EAAE,eAAe,CAAC,OAAO,IAAI,mBAAmB;QACvD,SAAS,EAAE,eAAe,CAAC,SAAS,IAAI,qBAAqB;QAC7D,OAAO,EAAE,eAAe,CAAC,OAAO,IAAI,mBAAmB;KACxD,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAA8B,EAAE,EAAE;IACnE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,IAAI,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QACnC,OAAO,UAAU,MAAM,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO,WAAW,MAAM,EAAE,CAAC;AAC7B,CAAC,CAAC"}
|
package/dist/esm/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export const version = "5.93.
|
1
|
+
export const version = "5.93.10";
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/dist/esm/version.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"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AAM,CAAC;IACjC,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,qBAAqB,CAAC,CAoDhC"}
|
@@ -12,5 +12,9 @@ import { type WaitForReceiptOptions } from "../../../../transaction/actions/wait
|
|
12
12
|
* ```
|
13
13
|
* @transaction
|
14
14
|
*/
|
15
|
-
export declare function useWaitForReceipt(options: WaitForReceiptOptions
|
15
|
+
export declare function useWaitForReceipt(options: (WaitForReceiptOptions & {
|
16
|
+
queryOptions?: {
|
17
|
+
enabled?: boolean;
|
18
|
+
};
|
19
|
+
}) | undefined): UseQueryResult<TransactionReceipt>;
|
16
20
|
//# sourceMappingURL=useWaitForReceipt.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useWaitForReceipt.d.ts","sourceRoot":"","sources":["../../../../../../src/react/core/hooks/contract/useWaitForReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAY,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,wDAAwD,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,
|
1
|
+
{"version":3,"file":"useWaitForReceipt.d.ts","sourceRoot":"","sources":["../../../../../../src/react/core/hooks/contract/useWaitForReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAY,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,wDAAwD,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EACH,CAAC,qBAAqB,GAAG;IAAE,YAAY,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,CAAC,GAClE,SAAS,GACZ,cAAc,CAAC,kBAAkB,CAAC,CAkBpC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TransactionModeScreen.d.ts","sourceRoot":"","sources":["../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAIzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gDAAgD,CAAC;AAO9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4DAA4D,CAAC;AAQ/F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAanE,OAAO,EACL,KAAK,kBAAkB,EAGxB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAEhF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,MAAM,EAAE,cAAc,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE;QAAE,IAAI,EAAE,aAAa,CAAA;KAAE,CAAC,CAAC;IAC7D,qBAAqB,EAAE,uBAAuB,CAAC;IAC/C,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,cAAc,EAAE,sBAAsB,GAAG,SAAS,CAAC;IACnD,UAAU,EAAE,CACV,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,KAAK,EACd,OAAO,EAAE,kBAAkB,KACxB,IAAI,CAAC;CACX,
|
1
|
+
{"version":3,"file":"TransactionModeScreen.d.ts","sourceRoot":"","sources":["../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAIzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gDAAgD,CAAC;AAO9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4DAA4D,CAAC;AAQ/F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAanE,OAAO,EACL,KAAK,kBAAkB,EAGxB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAEhF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,MAAM,EAAE,cAAc,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE;QAAE,IAAI,EAAE,aAAa,CAAA;KAAE,CAAC,CAAC;IAC7D,qBAAqB,EAAE,uBAAuB,CAAC;IAC/C,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,cAAc,EAAE,sBAAsB,GAAG,SAAS,CAAC;IACnD,UAAU,EAAE,CACV,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,KAAK,EACd,OAAO,EAAE,kBAAkB,KACxB,IAAI,CAAC;CACX,8CAmUA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WalletTransactionHistory.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WalletTransactionHistory.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAuBtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB,8CAqFA"}
|
@@ -1,8 +1,14 @@
|
|
1
|
+
import type { Chain } from "../chains/types.js";
|
2
|
+
import type { ThirdwebClient } from "../client/client.js";
|
1
3
|
import { type Store } from "../reactive/store.js";
|
2
4
|
import type { Hex } from "../utils/encoding/hex.js";
|
3
5
|
export type StoredTransaction = {
|
4
6
|
transactionHash: Hex;
|
5
7
|
chainId: number;
|
8
|
+
receipt?: {
|
9
|
+
status: "success" | "failed";
|
10
|
+
to: string;
|
11
|
+
};
|
6
12
|
};
|
7
13
|
/**
|
8
14
|
* Retrieve the transaction store for a given address.
|
@@ -28,4 +34,12 @@ export declare function addTransactionToStore(options: {
|
|
28
34
|
transactionHash: Hex;
|
29
35
|
chainId: number;
|
30
36
|
}): void;
|
37
|
+
/**
|
38
|
+
* @internal for now
|
39
|
+
*/
|
40
|
+
export declare function getPastTransactions(options: {
|
41
|
+
walletAddress: string;
|
42
|
+
chain: Chain;
|
43
|
+
client: ThirdwebClient;
|
44
|
+
}): Promise<StoredTransaction[]>;
|
31
45
|
//# sourceMappingURL=transaction-store.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction-store.d.ts","sourceRoot":"","sources":["../../../src/transaction/transaction-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAe,MAAM,sBAAsB,CAAC;
|
1
|
+
{"version":3,"file":"transaction-store.d.ts","sourceRoot":"","sources":["../../../src/transaction/transaction-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,KAAK,KAAK,EAAe,MAAM,sBAAsB,CAAC;AAE/D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAGpD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,eAAe,EAAE,GAAG,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE;QACR,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;QAC7B,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;CACH,CAAC;AAIF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,GACd,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAU5B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,GAAG,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,QAUA;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE;IACjD,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAgC/B"}
|
@@ -34,6 +34,11 @@ type DomainOverrides = {
|
|
34
34
|
* @default "c.thirdweb.com"
|
35
35
|
*/
|
36
36
|
analytics?: string;
|
37
|
+
/**
|
38
|
+
* The base URL for the insight server.
|
39
|
+
* @default "insight.thirdweb.com"
|
40
|
+
*/
|
41
|
+
insight?: string;
|
37
42
|
};
|
38
43
|
export declare const DEFAULT_RPC_URL = "rpc.thirdweb.com";
|
39
44
|
/**
|
@@ -51,6 +56,7 @@ export declare const getThirdwebDomains: () => {
|
|
51
56
|
storage: string;
|
52
57
|
bundler: string;
|
53
58
|
analytics: string;
|
59
|
+
insight: string;
|
54
60
|
};
|
55
61
|
/**
|
56
62
|
* @internal
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"domains.d.ts","sourceRoot":"","sources":["../../../src/utils/domains.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG;IACrB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"domains.d.ts","sourceRoot":"","sources":["../../../src/utils/domains.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG;IACrB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAmBlD;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,iBAAiB,eAAe,SAWlE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB;SA5EvB,MAAM;YAKH,MAAM;iBAKD,MAAM;SAKd,MAAM;aAKF,MAAM;aAKN,MAAM;eAKJ,MAAM;aAKR,MAAM;CA2CjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,eAAe,WAMhE,CAAC"}
|
package/dist/types/version.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const version = "5.93.
|
1
|
+
export declare const version = "5.93.10";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,YAAY,CAAC"}
|
package/package.json
CHANGED
package/src/bridge/Buy.test.ts
CHANGED
@@ -35,7 +35,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("Bridge.Buy.quote", () => {
|
|
35
35
|
});
|
36
36
|
});
|
37
37
|
|
38
|
-
describe("Bridge.Buy.prepare", () => {
|
38
|
+
describe.runIf(process.env.TW_SECRET_KEY)("Bridge.Buy.prepare", () => {
|
39
39
|
it("should get a valid prepared quote", async () => {
|
40
40
|
const quote = await Buy.prepare({
|
41
41
|
originChainId: 1,
|
package/src/bridge/Sell.test.ts
CHANGED
@@ -35,7 +35,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("Bridge.Sell.quote", () => {
|
|
35
35
|
});
|
36
36
|
});
|
37
37
|
|
38
|
-
describe("Bridge.Sell.prepare", () => {
|
38
|
+
describe.runIf(process.env.TW_SECRET_KEY)("Bridge.Sell.prepare", () => {
|
39
39
|
it("should get a valid prepared quote", async () => {
|
40
40
|
const quote = await Sell.prepare({
|
41
41
|
originChainId: 1,
|
@@ -259,8 +259,6 @@ export async function getBuyWithCryptoQuote(
|
|
259
259
|
data: data.transactionRequest.data as Hash,
|
260
260
|
to: data.transactionRequest.to,
|
261
261
|
value: BigInt(data.transactionRequest.value),
|
262
|
-
gas: BigInt(data.transactionRequest.gasLimit),
|
263
|
-
gasPrice: undefined, // ignore gas price returned by the quote, we handle it ourselves
|
264
262
|
},
|
265
263
|
approvalData,
|
266
264
|
swapDetails: {
|
@@ -155,7 +155,6 @@ export async function getBuyWithCryptoTransfer(
|
|
155
155
|
data: data.transactionRequest.data as Hash,
|
156
156
|
to: data.transactionRequest.to as Address,
|
157
157
|
value: BigInt(data.transactionRequest.value),
|
158
|
-
gas: BigInt(data.transactionRequest.gasLimit),
|
159
158
|
},
|
160
159
|
approvalData: data.approval,
|
161
160
|
fromAddress: data.fromAddress,
|
@@ -17,7 +17,9 @@ import {
|
|
17
17
|
* @transaction
|
18
18
|
*/
|
19
19
|
export function useWaitForReceipt(
|
20
|
-
options:
|
20
|
+
options:
|
21
|
+
| (WaitForReceiptOptions & { queryOptions?: { enabled?: boolean } })
|
22
|
+
| undefined,
|
21
23
|
): UseQueryResult<TransactionReceipt> {
|
22
24
|
return useQuery({
|
23
25
|
queryKey: [
|
@@ -32,7 +34,8 @@ export function useWaitForReceipt(
|
|
32
34
|
}
|
33
35
|
return waitForReceipt(options);
|
34
36
|
},
|
35
|
-
enabled:
|
37
|
+
enabled:
|
38
|
+
!!options?.transactionHash && (options?.queryOptions?.enabled ?? true),
|
36
39
|
retry: false,
|
37
40
|
});
|
38
41
|
}
|
@@ -625,7 +625,7 @@ function SelectedTokenInfo(props: {
|
|
625
625
|
disabled?: boolean;
|
626
626
|
}) {
|
627
627
|
const getWidth = () => {
|
628
|
-
const amount = formatNumber(Number(props.tokenAmount),
|
628
|
+
const amount = formatNumber(Number(props.tokenAmount), 6).toString();
|
629
629
|
let chars = amount.replace(".", "").length;
|
630
630
|
const hasDot = amount.includes(".");
|
631
631
|
if (hasDot) {
|
@@ -334,7 +334,10 @@ export function TransactionModeScreen(props: {
|
|
334
334
|
variant="accent"
|
335
335
|
fullWidth
|
336
336
|
onClick={() => {
|
337
|
-
let totalCostWei =
|
337
|
+
let totalCostWei = insufficientFunds
|
338
|
+
? transactionCostAndData.transactionValueWei -
|
339
|
+
(balanceQuery.data?.value || 0n)
|
340
|
+
: transactionCostAndData.transactionValueWei;
|
338
341
|
if (
|
339
342
|
transactionCostAndData.token.address === NATIVE_TOKEN_ADDRESS &&
|
340
343
|
!sponsoredTransactionsEnabled
|
@@ -1,12 +1,17 @@
|
|
1
1
|
"use client";
|
2
2
|
import styled from "@emotion/styled";
|
3
3
|
import { CheckIcon, CrossCircledIcon } from "@radix-ui/react-icons";
|
4
|
+
import { useQuery } from "@tanstack/react-query";
|
4
5
|
import { useSyncExternalStore } from "react";
|
6
|
+
import { ethereum } from "../../../../../chains/chain-definitions/ethereum.js";
|
5
7
|
import { getCachedChain } from "../../../../../chains/utils.js";
|
6
8
|
import type { ThirdwebClient } from "../../../../../client/client.js";
|
7
|
-
import {
|
9
|
+
import {
|
10
|
+
type StoredTransaction,
|
11
|
+
getPastTransactions,
|
12
|
+
getTransactionStore,
|
13
|
+
} from "../../../../../transaction/transaction-store.js";
|
8
14
|
import { shortenHex } from "../../../../../utils/address.js";
|
9
|
-
import type { Hex } from "../../../../../utils/encoding/hex.js";
|
10
15
|
import { formatExplorerTxUrl } from "../../../../../utils/url.js";
|
11
16
|
import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js";
|
12
17
|
import { iconSize, spacing } from "../../../../core/design-system/index.js";
|
@@ -38,8 +43,20 @@ export function WalletTransactionHistory(props: {
|
|
38
43
|
transactionStore.subscribe,
|
39
44
|
transactionStore.getValue,
|
40
45
|
);
|
41
|
-
const
|
42
|
-
|
46
|
+
const historicalTxQuery = useQuery({
|
47
|
+
queryKey: ["transactions", props.address, activeChain],
|
48
|
+
queryFn: () =>
|
49
|
+
getPastTransactions({
|
50
|
+
walletAddress: props.address,
|
51
|
+
chain: activeChain || ethereum,
|
52
|
+
client: props.client,
|
53
|
+
}),
|
54
|
+
enabled: !!activeChain,
|
55
|
+
});
|
56
|
+
const transactions = [
|
57
|
+
...[...reverseChronologicalTransactions].reverse(),
|
58
|
+
...(historicalTxQuery.data || []),
|
59
|
+
];
|
43
60
|
return (
|
44
61
|
<Container
|
45
62
|
scrollY
|
@@ -52,7 +69,22 @@ export function WalletTransactionHistory(props: {
|
|
52
69
|
}}
|
53
70
|
>
|
54
71
|
<Container flex="column" gap="xs" expand>
|
55
|
-
{
|
72
|
+
{historicalTxQuery.isLoading && (
|
73
|
+
<Container
|
74
|
+
flex="column"
|
75
|
+
gap="md"
|
76
|
+
center="both"
|
77
|
+
color="secondaryText"
|
78
|
+
style={{
|
79
|
+
flex: "1",
|
80
|
+
minHeight: "250px",
|
81
|
+
}}
|
82
|
+
>
|
83
|
+
<Spinner color={"secondaryText"} size={"md"} />
|
84
|
+
<Text>Loading recent transactions...</Text>
|
85
|
+
</Container>
|
86
|
+
)}
|
87
|
+
{!historicalTxQuery.isLoading && transactions.length === 0 ? (
|
56
88
|
<Container
|
57
89
|
flex="column"
|
58
90
|
gap="md"
|
@@ -79,8 +111,7 @@ export function WalletTransactionHistory(props: {
|
|
79
111
|
key={tx.transactionHash}
|
80
112
|
explorerUrl={chainExplorers.explorers[0]?.url}
|
81
113
|
client={props.client}
|
82
|
-
|
83
|
-
chainId={tx.chainId}
|
114
|
+
tx={tx}
|
84
115
|
/>
|
85
116
|
);
|
86
117
|
})}
|
@@ -92,21 +123,24 @@ export function WalletTransactionHistory(props: {
|
|
92
123
|
}
|
93
124
|
|
94
125
|
function TransactionButton(props: {
|
95
|
-
|
126
|
+
tx: StoredTransaction;
|
96
127
|
client: ThirdwebClient;
|
97
|
-
chainId: number;
|
98
128
|
explorerUrl?: string;
|
99
129
|
}) {
|
100
130
|
const {
|
101
|
-
data:
|
131
|
+
data: fetchedReceipt,
|
102
132
|
isLoading,
|
103
133
|
error,
|
104
134
|
} = useWaitForReceipt({
|
105
|
-
transactionHash: props.
|
106
|
-
chain: getCachedChain(props.chainId),
|
135
|
+
transactionHash: props.tx.transactionHash,
|
136
|
+
chain: getCachedChain(props.tx.chainId),
|
107
137
|
client: props.client,
|
138
|
+
queryOptions: {
|
139
|
+
enabled: props.tx.receipt === undefined,
|
140
|
+
},
|
108
141
|
});
|
109
|
-
const chainIconQuery = useChainIconUrl(getCachedChain(props.chainId));
|
142
|
+
const chainIconQuery = useChainIconUrl(getCachedChain(props.tx.chainId));
|
143
|
+
const receipt = props.tx.receipt ?? fetchedReceipt;
|
110
144
|
|
111
145
|
const content = (
|
112
146
|
<TxButton
|
@@ -148,8 +182,8 @@ function TransactionButton(props: {
|
|
148
182
|
>
|
149
183
|
<Text size="sm" color="primaryText">
|
150
184
|
{receipt?.to
|
151
|
-
? `Interacted with ${shortenHex(receipt
|
152
|
-
: `Hash: ${shortenHex(props.
|
185
|
+
? `Interacted with ${shortenHex(receipt?.to, 4)}`
|
186
|
+
: `Hash: ${shortenHex(props.tx.transactionHash, 4)}`}
|
153
187
|
</Text>
|
154
188
|
</Container>
|
155
189
|
|
@@ -165,7 +199,7 @@ function TransactionButton(props: {
|
|
165
199
|
}}
|
166
200
|
>
|
167
201
|
<ChainName
|
168
|
-
chain={getCachedChain(props.chainId)}
|
202
|
+
chain={getCachedChain(props.tx.chainId)}
|
169
203
|
size="xs"
|
170
204
|
client={props.client}
|
171
205
|
/>
|
@@ -193,7 +227,7 @@ function TransactionButton(props: {
|
|
193
227
|
if (props.explorerUrl) {
|
194
228
|
return (
|
195
229
|
<a
|
196
|
-
href={formatExplorerTxUrl(props.explorerUrl, props.
|
230
|
+
href={formatExplorerTxUrl(props.explorerUrl, props.tx.transactionHash)}
|
197
231
|
target="_blank"
|
198
232
|
rel="noreferrer"
|
199
233
|
>
|