|
1 | 1 | # thirdweb |
2 | 2 |
|
| 3 | +## 5.102.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- [#7190](https://github.com/thirdweb-dev/js/pull/7190) [`861e623`](https://github.com/thirdweb-dev/js/commit/861e623a1b7519bcac09c0c6d975cad2c0c5be4f) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Enhanced Engine functionality with server wallet management, search transactions and batch transaction support: |
| 8 | + |
| 9 | + - Added `Engine.createServerWallet()` to create a new server wallet with a custom label |
| 10 | + |
| 11 | + ```ts |
| 12 | + import { Engine } from "thirdweb"; |
| 13 | + |
| 14 | + const serverWallet = await Engine.createServerWallet({ |
| 15 | + client, |
| 16 | + label: "My Server Wallet", |
| 17 | + }); |
| 18 | + console.log(serverWallet.address); |
| 19 | + console.log(serverWallet.smartAccountAddress); |
| 20 | + ``` |
| 21 | + |
| 22 | + - Added `Engine.getServerWallets()` to list all existing server wallets |
| 23 | + |
| 24 | + ```ts |
| 25 | + import { Engine } from "thirdweb"; |
| 26 | + |
| 27 | + const serverWallets = await Engine.getServerWallets({ |
| 28 | + client, |
| 29 | + }); |
| 30 | + console.log(serverWallets); |
| 31 | + ``` |
| 32 | + |
| 33 | + - Added `Engine.searchTransactions()` to search for transactions by various filters (id, chainId, from address, etc.) |
| 34 | + |
| 35 | + ```ts |
| 36 | + // Search by transaction IDs |
| 37 | + const transactions = await Engine.searchTransactions({ |
| 38 | + client, |
| 39 | + filters: [ |
| 40 | + { |
| 41 | + field: "id", |
| 42 | + values: ["1", "2", "3"], |
| 43 | + }, |
| 44 | + ], |
| 45 | + }); |
| 46 | + |
| 47 | + // Search by chain ID and sender address |
| 48 | + const transactions = await Engine.searchTransactions({ |
| 49 | + client, |
| 50 | + filters: [ |
| 51 | + { |
| 52 | + filters: [ |
| 53 | + { |
| 54 | + field: "from", |
| 55 | + values: ["0x1234567890123456789012345678901234567890"], |
| 56 | + }, |
| 57 | + { |
| 58 | + field: "chainId", |
| 59 | + values: ["8453"], |
| 60 | + }, |
| 61 | + ], |
| 62 | + operation: "AND", |
| 63 | + }, |
| 64 | + ], |
| 65 | + pageSize: 100, |
| 66 | + page: 0, |
| 67 | + }); |
| 68 | + ``` |
| 69 | + |
| 70 | + - Added `serverWallet.enqueueBatchTransaction()` to enqueue multiple transactions in a single batch |
| 71 | + |
| 72 | + ```ts |
| 73 | + // Prepare multiple transactions |
| 74 | + const transaction1 = claimTo({ |
| 75 | + contract, |
| 76 | + to: firstRecipient, |
| 77 | + quantity: 1n, |
| 78 | + }); |
| 79 | + const transaction2 = claimTo({ |
| 80 | + contract, |
| 81 | + to: secondRecipient, |
| 82 | + quantity: 1n, |
| 83 | + }); |
| 84 | + |
| 85 | + // Enqueue as a batch |
| 86 | + const { transactionId } = await serverWallet.enqueueBatchTransaction({ |
| 87 | + transactions: [transaction1, transaction2], |
| 88 | + }); |
| 89 | + |
| 90 | + // Wait for batch completion |
| 91 | + const { transactionHash } = await Engine.waitForTransactionHash({ |
| 92 | + client, |
| 93 | + transactionId, |
| 94 | + }); |
| 95 | + ``` |
| 96 | + |
| 97 | + - Improved server wallet transaction handling with better error reporting |
| 98 | + |
| 99 | +### Patch Changes |
| 100 | + |
| 101 | +- Updated dependencies [[`861e623`](https://github.com/thirdweb-dev/js/commit/861e623a1b7519bcac09c0c6d975cad2c0c5be4f)]: |
| 102 | + |
| 103 | + |
3 | 104 | ## 5.101.2 |
4 | 105 |
|
5 | 106 | ### Patch Changes |
|
0 commit comments