Skip to content

Commit acd6b33

Browse files
authored
fix: change Transaction.value type from number to string to prevent overflow (#1836)
JavaScript's Number type can only safely represent integers up to 2^53-1. When the API returns large wei values (like NFT prices in wei), they can overflow and become negative values like -1617240366657743600. This fix changes Transaction.value type from number to string, which: - Prevents integer overflow for large wei values - Works with ethers.js which accepts strings as BigNumberish - Matches how the API should serialize large integer values
1 parent 125b065 commit acd6b33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/orders/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ type Transaction = {
7979
function: string;
8080
chain: number;
8181
to: string;
82-
value: number;
82+
value: string;
8383
input_data:
8484
| {
8585
// For fulfillAdvancedOrder

0 commit comments

Comments
 (0)