Beautiful error messages & solidity stack traces
No more confusing and hard-to-parse SDK error messages! We've given some to love to error messages in version 3.8.0
of the @thirweb-dev/sdk
package.
Error messages in the TypeScript SDK on reverts and other transaction errors will now display a message with all relevant transaction data, the revert reason, and a solidity stack trace of where the revert came from in the smart contract code!
Below is a before and after of the changes (from the same error thrown by the code below):
// Trying to create a listing with an NFT that I have no balance of
await marketplace.direct.createListing({
currencyToAccept: "0x0000000000000000000000000000000000000000",
assetContract: "0xBF1829B780C24a47aBC4C5C0b53AB93001ed1402",
secondsUntilEndTime: 10000000000,
startTime: 10000000000,
reservePricePerToken: 0,
buyoutPricePerToken: 0,
quantityToList: 1,
listingType: 0,
tokenId: 0,
});
And here is the before and after error messages: