@@ -187,13 +187,14 @@ class NftSwapV4 implements INftSwapV4 {
187187 constructor (
188188 provider : BaseProvider ,
189189 signer : Signer ,
190- chainId ?: number ,
190+ chainId ?: number | string ,
191191 additionalConfig ?: Partial < AdditionalSdkConfig >
192192 ) {
193193 this . provider = provider ;
194194 this . signer = signer ;
195- this . chainId =
196- chainId ?? ( this . provider . _network . chainId as SupportedChainIdsV4 ) ;
195+ this . chainId = chainId
196+ ? parseInt ( chainId . toString ( 10 ) , 10 )
197+ : ( this . provider . _network . chainId as SupportedChainIdsV4 ) ;
197198
198199 const defaultAddressesForChain : AddressesForChainV4 | undefined =
199200 addresses [ this . chainId as SupportedChainIdsV4 ] ;
@@ -616,7 +617,7 @@ class NftSwapV4 implements INftSwapV4 {
616617 } ;
617618
618619 /**
619- * Fills a 'collection'-based order (e.g. a bid for any nft belonging to a particulat collection)
620+ * Fills a 'collection'-based order (e.g. a bid for any nft belonging to a particular collection)
620621 * @param signedOrder A 0x signed collection order
621622 * @param tokenId The token id to fill for the collection order
622623 * @param fillOrderOverrides Various fill options
@@ -645,6 +646,13 @@ class NftSwapV4 implements INftSwapV4 {
645646 return order . erc20Token . toLowerCase ( ) === ETH_ADDRESS_AS_ERC20 ;
646647 } ;
647648
649+ /**
650+ * Fills a signed order
651+ * @param signedOrder A signed 0x v4 order
652+ * @param fillOrderOverrides Optional configuration on possible ways to fill the order
653+ * @param transactionOverrides Ethers transaction overrides (e.g. gas price)
654+ * @returns
655+ */
648656 fillSignedOrder = async (
649657 signedOrder : SignedNftOrderV4 ,
650658 fillOrderOverrides ?: Partial < FillOrderOverrides > ,
@@ -764,16 +772,17 @@ class NftSwapV4 implements INftSwapV4 {
764772 */
765773 postOrder = (
766774 signedOrder : SignedNftOrderV4 ,
767- chainId : string ,
775+ chainId : string | number ,
768776 metadata ?: Record < string , string >
769777 ) : Promise < PostOrderResponsePayload > => {
778+ const parsedChainId = parseInt ( chainId . toString ( 10 ) , 10 ) ;
770779 const supportsMonitoring =
771- SupportedChainsForV4OrderbookStatusMonitoring . includes ( parseInt ( chainId ) ) ;
780+ SupportedChainsForV4OrderbookStatusMonitoring . includes ( parsedChainId ) ;
772781 warning (
773782 supportsMonitoring ,
774783 `Chain ${ chainId } does not support live orderbook status monitoring. Orders can be posted to be persisted, but status wont be monitored (e.g. updating status on a fill, cancel, or expiry.)`
775784 ) ;
776- return postOrderToOrderbook ( signedOrder , chainId , metadata , {
785+ return postOrderToOrderbook ( signedOrder , parsedChainId , metadata , {
777786 rootUrl : this . orderbookRootUrl ,
778787 } ) ;
779788 } ;
0 commit comments