|
1 | 1 | # thirdweb |
2 | 2 |
|
| 3 | +## 5.96.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- [#6830](https://github.com/thirdweb-dev/js/pull/6830) [`e526f75`](https://github.com/thirdweb-dev/js/commit/e526f75f228401027c3acb3871eb2621cf89f41a) Thanks [@gregfromstl](https://github.com/gregfromstl)! - Enhanced SDK Bridge functionality with the following key updates: |
| 8 | + |
| 9 | + 1. **Breaking Change:** Standardized parameter naming in bridge functions: |
| 10 | + |
| 11 | + - Changed `buyAmountWei` to `amount` in Buy functions |
| 12 | + - Changed `sellAmountWei` to `amount` in Sell functions |
| 13 | + |
| 14 | + Example: |
| 15 | + |
| 16 | + ```ts |
| 17 | + // Before |
| 18 | + const buyQuote = await buy.quote({ |
| 19 | + originChainId: 1, |
| 20 | + originTokenAddress: NATIVE_TOKEN_ADDRESS, |
| 21 | + destinationChainId: 10, |
| 22 | + destinationTokenAddress: NATIVE_TOKEN_ADDRESS, |
| 23 | + buyAmountWei: toWei("0.01"), |
| 24 | + client: thirdwebClient, |
| 25 | + }); |
| 26 | + |
| 27 | + // After |
| 28 | + const buyQuote = await buy.quote({ |
| 29 | + originChainId: 1, |
| 30 | + originTokenAddress: NATIVE_TOKEN_ADDRESS, |
| 31 | + destinationChainId: 10, |
| 32 | + destinationTokenAddress: NATIVE_TOKEN_ADDRESS, |
| 33 | + amount: toWei("0.01"), |
| 34 | + client: thirdwebClient, |
| 35 | + }); |
| 36 | + ``` |
| 37 | + |
| 38 | + 2. **Enhanced Quote Structure:** Added `steps` array to buy/sell quote responses with detailed token information: |
| 39 | + ```ts |
| 40 | + // Steps contains detailed information about each step in a cross-chain transaction |
| 41 | + steps: [ |
| 42 | + { |
| 43 | + originToken: { |
| 44 | + chainId: 1, |
| 45 | + address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", |
| 46 | + symbol: "ETH", |
| 47 | + name: "Ethereum", |
| 48 | + decimals: 18, |
| 49 | + priceUsd: 2000, |
| 50 | + iconUri: "https://...", |
| 51 | + }, |
| 52 | + destinationToken: { |
| 53 | + chainId: 10, |
| 54 | + address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", |
| 55 | + symbol: "ETH", |
| 56 | + name: "Ethereum", |
| 57 | + decimals: 18, |
| 58 | + priceUsd: 2000, |
| 59 | + iconUri: "https://...", |
| 60 | + }, |
| 61 | + originAmount: 1000000000000000000n, |
| 62 | + destinationAmount: 9980000000000000000n, |
| 63 | + estimatedExecutionTimeMs: 1000, |
| 64 | + transactions: [ |
| 65 | + /* transactions for this step */ |
| 66 | + ], |
| 67 | + }, |
| 68 | + ]; |
| 69 | + ``` |
| 70 | + 3. **Added Purchase Data Support:** Added optional `purchaseData` parameter to Buy and Sell functions: |
| 71 | + ```ts |
| 72 | + // Example with purchaseData |
| 73 | + const quote = await buy.prepare({ |
| 74 | + originChainId: 1, |
| 75 | + originTokenAddress: NATIVE_TOKEN_ADDRESS, |
| 76 | + destinationChainId: 10, |
| 77 | + destinationTokenAddress: NATIVE_TOKEN_ADDRESS, |
| 78 | + amount: toWei("0.01"), |
| 79 | + sender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709", |
| 80 | + receiver: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709", |
| 81 | + purchaseData: { |
| 82 | + foo: "bar", |
| 83 | + }, |
| 84 | + client: thirdwebClient, |
| 85 | + }); |
| 86 | + ``` |
| 87 | + 4. **Enhanced Status Responses:** Status responses now include the `purchaseData` field that was provided during the initial transaction: |
| 88 | + ```ts |
| 89 | + // Status response includes purchaseData |
| 90 | + { |
| 91 | + status: "COMPLETED", |
| 92 | + // ...other status fields |
| 93 | + purchaseData: { |
| 94 | + foo: "bar" |
| 95 | + } |
| 96 | + } |
| 97 | + ``` |
| 98 | + 5. **Updated API Interactions:** Changed from query parameters to JSON body for prepare functions to accommodate complex data. |
| 99 | + |
| 100 | +### Patch Changes |
| 101 | + |
| 102 | +- [#6823](https://github.com/thirdweb-dev/js/pull/6823) [`dc2e514`](https://github.com/thirdweb-dev/js/commit/dc2e514e564c8fc9dba41ae3be459fabf267be8f) Thanks [@kumaryash90](https://github.com/kumaryash90)! - Deprecate Pack |
| 103 | + |
| 104 | +- [#6822](https://github.com/thirdweb-dev/js/pull/6822) [`33666aa`](https://github.com/thirdweb-dev/js/commit/33666aa8c5adbe4f9f376c52dfebcd4091ce91db) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - More efficient multi event querying when using indexer |
| 105 | + |
| 106 | +- [#6819](https://github.com/thirdweb-dev/js/pull/6819) [`8b4b873`](https://github.com/thirdweb-dev/js/commit/8b4b8733172591853215072f1510396ef0e2ec96) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - expose setServiceKey |
| 107 | + |
| 108 | +- [#6824](https://github.com/thirdweb-dev/js/pull/6824) [`b2e56f8`](https://github.com/thirdweb-dev/js/commit/b2e56f89fe03e4d1c4c3cf80c784de9c35b1d4e5) Thanks [@kumaryash90](https://github.com/kumaryash90)! - Custom factory addr for Chiliz mainnet |
| 109 | + |
3 | 110 | ## 5.95.3 |
4 | 111 |
|
5 | 112 | ### Patch Changes |
|
0 commit comments