File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ import {
5656} from './orderbook' ;
5757import { DIRECTION_MAPPING , OrderStatusV4 , TradeDirection } from './enums' ;
5858import { CONTRACT_ORDER_VALIDATOR } from './properties' ;
59+ import { getWrappedNativeToken } from '../../utils/addresses' ;
5960
6061export enum SupportedChainIdsV4 {
6162 Mainnet = 1 ,
@@ -347,6 +348,10 @@ class NftSwapV4 implements INftSwapV4 {
347348 ) ;
348349 }
349350
351+ getWrappedTokenAddress = ( chainId : number | string ) => {
352+ return getWrappedNativeToken ( chainId ) ;
353+ }
354+
350355 buildCollectionBasedOrder = (
351356 erc20ToSell : UserFacingERC20AssetDataSerializedV4 ,
352357 nftCollectionToBid : {
Original file line number Diff line number Diff line change 1+ import { SupportedChainIdsV4 } from '../sdk' ;
2+ import defaultAddresses from '../sdk/v4/addresses.json' ;
3+
4+ export const getWrappedNativeToken = (
5+ chainId : number | string
6+ ) : string | null => {
7+ const chainIdString = chainId . toString ( 10 ) ;
8+ const zeroExAddresses :
9+ | { exchange : string ; wrappedNativeToken : string }
10+ | undefined =
11+ defaultAddresses [ chainIdString as unknown as SupportedChainIdsV4 ] ;
12+ return zeroExAddresses ?. wrappedNativeToken ?? null ;
13+ } ;
You can’t perform that action at this time.
0 commit comments