Commit aa1035d
committed
[TOOL-4988] Dashboard, SDK: Add gas sponsorship option for asset creation for in-app wallets (#7566)
<!--
## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"
If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):
## Notes for the reviewer
Anything important to call out? Be sure to also clarify these in your comments.
## How to test
Unit tests, playground, etc.
-->
<!-- start pr-codex -->
---
## PR-Codex overview
This PR focuses on enhancing the handling of gasless transactions across various components in the `thirdweb` dashboard, specifically for NFT and token creation processes. It introduces new parameters and logic to support gas sponsorship features.
### Detailed summary
- Added `useAuthToken` option in `bundler.ts` fetch requests.
- Enhanced `fetch.ts` to include authentication headers for bundler requests.
- Updated `CreateTokenFunctions` and `CreateNFTCollectionFunctions` to accept `gasless` parameter.
- Modified multiple functions in the NFT and token creation pages to support gasless transactions.
- Implemented UI elements for enabling gas sponsorship in the `LaunchNFT` and `LaunchTokenStatus` components.
- Adjusted error handling for unsupported gas sponsorship on certain chains.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
Here are the updated release notes based on the provided summary:
* **New Features**
* Added support for gasless transactions when launching NFT collections and tokens, available for eligible team plans and in-app wallets.
* Introduced a toggle in the launch UI to enable or disable gasless mode for NFT and token creation.
* Updated UI labels and dialogs for launching NFT collections.
* **Refactor**
* Standardized function signatures for NFT and token creation to accept a unified parameter object, including a new gasless flag.
* Centralized account and contract retrieval logic for improved maintainability and consistency.
* Improved error logging in the token creation workflow.
* **Bug Fixes**
* Enhanced error handling during token launch to detect unsupported gas sponsorship and provide user-friendly retry options.
* **Chores**
* Updated request headers logic to properly handle authorization tokens and additional headers for bundler URLs.
* Enabled authentication token usage in bundler request configurations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent bd395a3 commit aa1035d
File tree
9 files changed
+353
-157
lines changed- apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create
- nft
- _common
- launch
- token
- launch
- packages/thirdweb/src
- utils
- wallets/smart/lib
9 files changed
+353
-157
lines changedLines changed: 22 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | | - | |
51 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
52 | 62 | | |
53 | 63 | | |
54 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
55 | 68 | | |
56 | 69 | | |
57 | 70 | | |
| |||
60 | 73 | | |
61 | 74 | | |
62 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
63 | 81 | | |
64 | | - | |
65 | 82 | | |
66 | 83 | | |
67 | 84 | | |
| |||
Lines changed: 68 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
54 | 66 | | |
55 | 67 | | |
56 | 68 | | |
| |||
60 | 72 | | |
61 | 73 | | |
62 | 74 | | |
63 | | - | |
| 75 | + | |
64 | 76 | | |
65 | 77 | | |
66 | 78 | | |
67 | 79 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 80 | | |
74 | 81 | | |
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
| 85 | + | |
78 | 86 | | |
79 | 87 | | |
80 | 88 | | |
81 | 89 | | |
82 | 90 | | |
83 | 91 | | |
84 | | - | |
85 | | - | |
86 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
| |||
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
96 | | - | |
| 104 | + | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
| |||
110 | 118 | | |
111 | 119 | | |
112 | 120 | | |
113 | | - | |
| 121 | + | |
114 | 122 | | |
115 | 123 | | |
116 | 124 | | |
| |||
166 | 174 | | |
167 | 175 | | |
168 | 176 | | |
169 | | - | |
| 177 | + | |
170 | 178 | | |
| 179 | + | |
171 | 180 | | |
172 | | - | |
| 181 | + | |
173 | 182 | | |
174 | 183 | | |
175 | 184 | | |
176 | | - | |
177 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
178 | 191 | | |
179 | 192 | | |
180 | 193 | | |
181 | 194 | | |
182 | 195 | | |
183 | 196 | | |
184 | | - | |
| 197 | + | |
185 | 198 | | |
186 | 199 | | |
187 | 200 | | |
188 | 201 | | |
189 | | - | |
| 202 | + | |
190 | 203 | | |
191 | 204 | | |
192 | 205 | | |
| |||
205 | 218 | | |
206 | 219 | | |
207 | 220 | | |
208 | | - | |
| 221 | + | |
| 222 | + | |
209 | 223 | | |
210 | | - | |
211 | | - | |
212 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
213 | 227 | | |
214 | 228 | | |
215 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
216 | 234 | | |
217 | 235 | | |
218 | 236 | | |
| |||
235 | 253 | | |
236 | 254 | | |
237 | 255 | | |
238 | | - | |
| 256 | + | |
239 | 257 | | |
240 | 258 | | |
241 | 259 | | |
| |||
259 | 277 | | |
260 | 278 | | |
261 | 279 | | |
| 280 | + | |
262 | 281 | | |
263 | 282 | | |
264 | | - | |
| 283 | + | |
265 | 284 | | |
266 | 285 | | |
267 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
268 | 291 | | |
269 | 292 | | |
270 | 293 | | |
| |||
315 | 338 | | |
316 | 339 | | |
317 | 340 | | |
318 | | - | |
| 341 | + | |
319 | 342 | | |
320 | 343 | | |
321 | 344 | | |
| |||
339 | 362 | | |
340 | 363 | | |
341 | 364 | | |
| 365 | + | |
342 | 366 | | |
343 | 367 | | |
344 | | - | |
| 368 | + | |
345 | 369 | | |
346 | 370 | | |
347 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
348 | 376 | | |
349 | 377 | | |
350 | | - | |
| 378 | + | |
351 | 379 | | |
352 | 380 | | |
353 | 381 | | |
| |||
369 | 397 | | |
370 | 398 | | |
371 | 399 | | |
372 | | - | |
| 400 | + | |
373 | 401 | | |
374 | 402 | | |
375 | 403 | | |
| |||
392 | 420 | | |
393 | 421 | | |
394 | 422 | | |
395 | | - | |
| 423 | + | |
396 | 424 | | |
397 | 425 | | |
398 | | - | |
| 426 | + | |
399 | 427 | | |
400 | 428 | | |
401 | | - | |
| 429 | + | |
402 | 430 | | |
403 | 431 | | |
404 | | - | |
| 432 | + | |
405 | 433 | | |
406 | 434 | | |
407 | | - | |
| 435 | + | |
408 | 436 | | |
409 | | - | |
| 437 | + | |
410 | 438 | | |
411 | 439 | | |
412 | 440 | | |
413 | 441 | | |
414 | | - | |
| 442 | + | |
415 | 443 | | |
416 | 444 | | |
417 | | - | |
| 445 | + | |
418 | 446 | | |
419 | 447 | | |
420 | | - | |
| 448 | + | |
421 | 449 | | |
422 | 450 | | |
423 | | - | |
| 451 | + | |
424 | 452 | | |
425 | 453 | | |
426 | 454 | | |
| |||
0 commit comments