|
1 | 1 | # thirdweb
|
2 | 2 |
|
| 3 | +## 5.95.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- [#6706](https://github.com/thirdweb-dev/js/pull/6706) [`185d2f3`](https://github.com/thirdweb-dev/js/commit/185d2f309c349e37ac84bd3a2ce5a1c9c7011083) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Expose getOwnedTokens, getOwnedNFTs and getTransaction functions |
| 8 | + |
| 9 | + You can now use Insight, our in-house indexer directly from the SDK with a simple API: |
| 10 | + |
| 11 | + ## Get Owned ERC20 tokens |
| 12 | + |
| 13 | + ```ts |
| 14 | + import { Insight } from "thirdweb"; |
| 15 | + |
| 16 | + const tokens = await Insight.getOwnedTokens({ |
| 17 | + client, |
| 18 | + ownerAddress, |
| 19 | + chains: [base, polygon, arbitrum], |
| 20 | + }); |
| 21 | + ``` |
| 22 | + |
| 23 | + ## Get Owned NFTs (ERC721 and ERC1155) |
| 24 | + |
| 25 | + ```ts |
| 26 | + import { Insight } from "thirdweb"; |
| 27 | + |
| 28 | + const nfts = await Insight.getOwnedNFTs({ |
| 29 | + client, |
| 30 | + ownerAddress, |
| 31 | + chains: [sepolia], |
| 32 | + }); |
| 33 | + ``` |
| 34 | + |
| 35 | + ## Get Transactions for a given wallet address |
| 36 | + |
| 37 | + ```ts |
| 38 | + import { Insight } from "thirdweb"; |
| 39 | + |
| 40 | + const transactions = await Insight.getTransactions({ |
| 41 | + client, |
| 42 | + walletAddress, |
| 43 | + chains: [sepolia], |
| 44 | + }); |
| 45 | + ``` |
| 46 | + |
| 47 | + All functions come with extra query filters for more granular queries, refer to the documentation for more details. |
| 48 | + |
| 49 | +### Patch Changes |
| 50 | + |
| 51 | +- [#6760](https://github.com/thirdweb-dev/js/pull/6760) [`7ecfcb9`](https://github.com/thirdweb-dev/js/commit/7ecfcb95afaeca56fd8dbf8b157ac6a1eb2339b2) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Add thirdweb branding to PayEmbed |
| 52 | + |
| 53 | +- [#6753](https://github.com/thirdweb-dev/js/pull/6753) [`4cf15a2`](https://github.com/thirdweb-dev/js/commit/4cf15a2475fce1c5b55d19f7cf51ab080e80e33f) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Use insight for 1155 getNFTs, getOwnedNFTs and getNFT |
| 54 | + |
| 55 | +- [#6752](https://github.com/thirdweb-dev/js/pull/6752) [`23d3757`](https://github.com/thirdweb-dev/js/commit/23d375778b900468409bb2435f60f1aff33823c9) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Simplify RPC request handling |
| 56 | + |
| 57 | +- [#6741](https://github.com/thirdweb-dev/js/pull/6741) [`8d4d991`](https://github.com/thirdweb-dev/js/commit/8d4d991e5710cbed668a52522686cc2dce4e4790) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Use insight for erc821/getNFT, erc721/getNFTs and erc721/getOwnedNFTs |
| 58 | + |
| 59 | + Standard ERC721 getNFT, getNFTs and getOwnedNFTs now use insight, our in house indexer by default. If indexer is not availbale, will fallback to RPC. |
| 60 | + |
| 61 | + You can also use the indexer directly using the Insight API: |
| 62 | + |
| 63 | + for an entire collection |
| 64 | + |
| 65 | + ```ts |
| 66 | + import { Insight } from "thirdweb"; |
| 67 | + |
| 68 | + const events = await Insight.getContractNFTs({ |
| 69 | + client, |
| 70 | + chains: [sepolia], |
| 71 | + contractAddress: "0x1234567890123456789012345678901234567890", |
| 72 | + }); |
| 73 | + ``` |
| 74 | + |
| 75 | + or for a single NFT |
| 76 | + |
| 77 | + ```ts |
| 78 | + import { Insight } from "thirdweb"; |
| 79 | + |
| 80 | + const events = await Insight.getNFT({ |
| 81 | + client, |
| 82 | + chains: [sepolia], |
| 83 | + contractAddress: "0x1234567890123456789012345678901234567890", |
| 84 | + tokenId: 1n, |
| 85 | + }); |
| 86 | + ``` |
| 87 | + |
| 88 | +- [#6683](https://github.com/thirdweb-dev/js/pull/6683) [`a3e7300`](https://github.com/thirdweb-dev/js/commit/a3e73007230120f2e2d79b894cf1a3c81e062a21) Thanks [@kumaryash90](https://github.com/kumaryash90)! - Get indexed events from `getContractEvents` |
| 89 | + |
| 90 | + You can now automatically query indexed events on supported chains when calling getContractEvents |
| 91 | + |
| 92 | + ```ts |
| 93 | + import { getContractEvents } from "thirdweb"; |
| 94 | + |
| 95 | + const events = await getContractEvents({ |
| 96 | + contract: DOODLES_CONTRACT, |
| 97 | + events: [transferEvent()], |
| 98 | + }); |
| 99 | + ``` |
| 100 | + |
| 101 | + This method falls back to RPC eth_getLogs if the indexer is not available. |
| 102 | + |
| 103 | + You can also use the dedicated indexer function via the Insight export |
| 104 | + |
| 105 | + ```ts |
| 106 | + import { Insight } from "thirdweb"; |
| 107 | + |
| 108 | + const events = await Insight.getContractEvents({ |
| 109 | + client, |
| 110 | + chains: [sepolia], |
| 111 | + contractAddress: "0x1234567890123456789012345678901234567890", |
| 112 | + event: transferEvent(), |
| 113 | + decodeLogs: true, |
| 114 | + }); |
| 115 | + ``` |
| 116 | + |
| 117 | +- [#6732](https://github.com/thirdweb-dev/js/pull/6732) [`a45c558`](https://github.com/thirdweb-dev/js/commit/a45c558e06a7104c0e54df9647343e9681f73e1d) Thanks [@gregfromstl](https://github.com/gregfromstl)! - Improve pay error messages |
| 118 | + |
| 119 | +- [#6758](https://github.com/thirdweb-dev/js/pull/6758) [`62ce05e`](https://github.com/thirdweb-dev/js/commit/62ce05ec35aa362df25eaf46824651c7f0792f99) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Better error message for getUser |
| 120 | + |
| 121 | +- [#6734](https://github.com/thirdweb-dev/js/pull/6734) [`2a7df33`](https://github.com/thirdweb-dev/js/commit/2a7df337f790051d7eaf9258428349e162b4ed01) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Better error messages for failed requests |
| 122 | + |
| 123 | +- Updated dependencies [[`185d2f3`](https://github.com/thirdweb-dev/js/commit/185d2f309c349e37ac84bd3a2ce5a1c9c7011083)]: |
| 124 | + - @thirdweb-dev/insight@1.0.0 |
| 125 | + |
3 | 126 | ## 5.94.2
|
4 | 127 |
|
5 | 128 | ### Patch Changes
|
|
0 commit comments