Skip to content

Commit ad32c6c

Browse files
committed
Merge branch 'main' of https://github.com/thirdweb-dev/js
2 parents e92552b + a0835f7 commit ad32c6c

File tree

130 files changed

+3629
-958
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+3629
-958
lines changed

.changeset/cyan-shrimps-battle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Update implementations

.changeset/fair-planes-doubt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
SDK: Fix chain switching in smart account transactions

.changeset/metal-mails-ring.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
- Add onClose callback to Connect Details modal
6+
7+
```tsx
8+
<ConnectButton
9+
detailsModal={{
10+
onClose: (screen: string) => {
11+
// The last screen name that was being shown when user closed the modal
12+
console.log({ screen });
13+
}
14+
}}
15+
/>
16+
```
17+
18+
- Small fix for ChainIcon: Always resolve IPFS URI
19+
20+
- Improve test coverage

.github/pull_request_template.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
## Problem solved
1+
---
2+
title: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"
3+
---
24

3-
Short description of the bug fixed or feature added
5+
If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):
6+
7+
## Notes for the reviewer
8+
Anything important to call out? Be sure to also clarify these in your comments.
9+
10+
## How to test
11+
Unit tests, playground, etc.
412

.github/workflows/auto-assign.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
if: |
1414
github.event.pull_request.author_association == 'MEMBER' ||
1515
github.event.pull_request.author_association == 'OWNER' ||
16-
github.event.pull_request.author_association == 'COLLABORATOR'
16+
github.event.pull_request.author_association == 'COLLABORATOR' ||
17+
github.event.pull_request.author_association == 'CONTRIBUTOR'
1718
steps:
1819
- uses: toshimaru/[email protected]

.github/workflows/issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [opened, edited, ready_for_review]
66

77
env:
8-
VALID_ISSUE_PREFIXES: "CORE|TOOL"
8+
VALID_ISSUE_PREFIXES: "CORE|TOOL|NEB|INFRA"
99

1010
jobs:
1111
linear:

.github/workflows/stale.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
steps:
1010
- uses: actions/stale@v9
1111
with:
12-
stale-issue-message: 'This issue has been inactive for 30 days. It is now marked as stale and will be closed in 5 days if no further activity occurs.'
13-
stale-pr-message: 'This PR has been inactive for 30 days. It is now marked as stale and will be closed in 5 days if no further activity occurs.'
12+
stale-issue-message: 'This issue has been inactive for 7 days. It is now marked as stale and will be closed in 2 days if no further activity occurs.'
13+
stale-pr-message: 'This PR has been inactive for 7 days. It is now marked as stale and will be closed in 2 days if no further activity occurs.'
1414
days-before-stale: 7
1515
days-before-close: 2

apps/dashboard/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
/// <reference types="next/navigation-types/compat/navigation" />
44

55
// NOTE: This file should not be edited
6-
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
6+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/list-form.tsx

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { CurrencySelector } from "components/shared/CurrencySelector";
1818
import { SolidityInput } from "contract-ui/components/solidity-inputs";
1919
import { useTrack } from "hooks/analytics/useTrack";
2020
import { useAllChainsData } from "hooks/chains/allChains";
21+
import { useTxNotifications } from "hooks/useTxNotifications";
2122
import { isAlchemySupported } from "lib/wallet/nfts/alchemy";
2223
import { isMoralisSupported } from "lib/wallet/nfts/moralis";
2324
import { isSimpleHashSupported } from "lib/wallet/nfts/simpleHash";
@@ -125,6 +126,15 @@ export const CreateListingsForm: React.FC<CreateListingsFormProps> = ({
125126
walletAddress: account?.address,
126127
});
127128
const sendAndConfirmTx = useSendAndConfirmTransaction();
129+
const listingNotifications = useTxNotifications(
130+
"NFT listed Successfully",
131+
"Failed to list NFT",
132+
);
133+
134+
const auctionNotifications = useTxNotifications(
135+
"Auction created successfully",
136+
"Failed to create an auction",
137+
);
128138

129139
const form = useForm<ListForm>({
130140
defaultValues:
@@ -351,14 +361,11 @@ export const CreateListingsForm: React.FC<CreateListingsFormProps> = ({
351361
endTimestamp,
352362
});
353363

354-
const promise = sendAndConfirmTx.mutateAsync(transaction, {
364+
await sendAndConfirmTx.mutateAsync(transaction, {
355365
onSuccess: () => setOpen(false),
356366
});
357-
toast.promise(promise, {
358-
loading: "Listing NFT",
359-
success: "NFT listed successfully",
360-
error: "Failed to list NFT",
361-
});
367+
368+
listingNotifications.onSuccess();
362369
} else if (formData.listingType === "auction") {
363370
let minimumBidAmountWei: bigint;
364371
let buyoutBidAmountWei: bigint;
@@ -403,7 +410,7 @@ export const CreateListingsForm: React.FC<CreateListingsFormProps> = ({
403410
buyoutBidAmountWei: buyoutBidAmountWei * selectedQuantity,
404411
});
405412

406-
const promise = sendAndConfirmTx.mutateAsync(transaction, {
413+
await sendAndConfirmTx.mutateAsync(transaction, {
407414
onSuccess: () => {
408415
trackEvent({
409416
category: "marketplace",
@@ -423,15 +430,15 @@ export const CreateListingsForm: React.FC<CreateListingsFormProps> = ({
423430
});
424431
},
425432
});
426-
toast.promise(promise, {
427-
loading: "Creating auction",
428-
success: "Auction created successfully",
429-
error: "Failed to create auction",
430-
});
433+
auctionNotifications.onSuccess();
431434
}
432435
} catch (err) {
433436
console.error(err);
434-
toast.error("Failed to list NFT");
437+
if (formData.listingType === "auction") {
438+
auctionNotifications.onError(err);
439+
} else {
440+
listingNotifications.onError(err);
441+
}
435442
}
436443

437444
setIsFormLoading(false);

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/components/airdrop-tab.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { cn } from "@/lib/utils";
1212
import type { Account } from "@3rdweb-sdk/react/hooks/useApi";
1313
import { TransactionButton } from "components/buttons/TransactionButton";
1414
import { useTrack } from "hooks/analytics/useTrack";
15+
import { useTxNotifications } from "hooks/useTxNotifications";
1516
import { UploadIcon } from "lucide-react";
1617
import { useState } from "react";
1718
import { useForm } from "react-hook-form";
@@ -49,6 +50,10 @@ const AirdropTab: React.FC<AirdropTabProps> = ({
4950
const sendAndConfirmTx = useSendAndConfirmTransaction();
5051
const addresses = watch("addresses");
5152
const [open, setOpen] = useState(false);
53+
const airdropNotifications = useTxNotifications(
54+
"NFTs airdropped successfully",
55+
"Failed to airdrop NFTs",
56+
);
5257

5358
return (
5459
<div className="flex w-full flex-col gap-2">
@@ -86,7 +91,7 @@ const AirdropTab: React.FC<AirdropTabProps> = ({
8691
}),
8792
);
8893
const transaction = multicall({ contract, data });
89-
const promise = sendAndConfirmTx.mutateAsync(transaction, {
94+
await sendAndConfirmTx.mutateAsync(transaction, {
9095
onSuccess: () => {
9196
trackEvent({
9297
category: "nft",
@@ -108,14 +113,11 @@ const AirdropTab: React.FC<AirdropTabProps> = ({
108113
});
109114
},
110115
});
111-
toast.promise(promise, {
112-
loading: "Airdropping NFTs",
113-
success: "Airdropped successfully",
114-
error: "Failed to airdrop",
115-
});
116+
117+
airdropNotifications.onSuccess();
116118
} catch (err) {
117119
console.error(err);
118-
toast.error("Failed to airdrop NFTs");
120+
airdropNotifications.onError(err);
119121
}
120122
})}
121123
>

0 commit comments

Comments
 (0)