Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"devDependencies": {
"@size-limit/preset-small-lib": "7.0.3",
"@typechain/ethers-v5": "^8.0.5",
"@types/lodash": "^4.14.178",
"husky": "^7.0.2",
"prettier": "^2.5.1",
"size-limit": "7.0.4",
Expand All @@ -69,9 +68,6 @@
"@ethersproject/wallet": "^5.5.0",
"date-fns": "^2.28.0",
"ethers": "^5.5.3",
"from-exponential": "^1.1.1",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"tiny-invariant": "^1.2.0",
"tiny-warning": "^1.0.3"
},
Expand Down
7 changes: 3 additions & 4 deletions src/sdk/pure.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import flatten from 'lodash/flatten';
import type { ContractTransaction } from '@ethersproject/contracts';
import { BaseProvider, Provider } from '@ethersproject/providers';
import {
Expand Down Expand Up @@ -649,14 +648,14 @@ export const convertDecodedAssetDataToUserFacingAssets = (
case AssetProxyId.MultiAsset:
const multiAssetDecodedData =
decodedAssetData as MultiAssetDataSerializedRecursivelyDecoded;
const nestedAssets = flatten(
multiAssetDecodedData.nestedAssetData.map((asset, idx) =>
console.log('here')
const nestedAssets =
multiAssetDecodedData.nestedAssetData.flatMap((asset, idx) =>
convertDecodedAssetDataToUserFacingAssets(
asset,
multiAssetDecodedData.amounts[idx]
)
)
);
const nestedAssetsWithCorrectAmounts: Array<SwappableAsset> =
nestedAssets.map((nestedAsset, idx) => {
const nestedAssetValueFromMultiAsset =
Expand Down
47 changes: 0 additions & 47 deletions src/utils/bn/toBN.ts

This file was deleted.

32 changes: 16 additions & 16 deletions test/multi-asset-swap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,26 +154,26 @@ describe('NFTSwap', () => {
);

// Uncomment to actually fill order
const tx = await nftSwapperMaker.fillSignedOrder(signedOrder, undefined, {
gasPrice,
});
// const tx = await nftSwapperMaker.fillSignedOrder(signedOrder, undefined, {
// gasPrice,
// });

const finalGasLimit = tx.gasLimit;
// const finalGasLimit = tx.gasLimit;

const expectedGasLimitWithBufferMultiple = Math.floor(
estimatedGasLimit.toNumber() *
DEFAUTLT_GAS_BUFFER_MULTIPLES[SupportedChainIds.PolygonMumbai]
);
// const expectedGasLimitWithBufferMultiple = Math.floor(
// estimatedGasLimit.toNumber() *
// DEFAUTLT_GAS_BUFFER_MULTIPLES[SupportedChainIds.PolygonMumbai]
// );

expect(finalGasLimit.toNumber()).toEqual(
expectedGasLimitWithBufferMultiple
);
// expect(finalGasLimit.toNumber()).toEqual(
// expectedGasLimitWithBufferMultiple
// );

const txReceipt = await tx.wait();
expect(txReceipt.transactionHash).toBeTruthy();
console.log(
`Swapped multiasset on Mumbai (txHAsh: ${txReceipt.transactionHash})`
);
// const txReceipt = await tx.wait();
// expect(txReceipt.transactionHash).toBeTruthy();
// console.log(
// `Swapped multiasset on Mumbai (txHAsh: ${txReceipt.transactionHash})`
// );
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/order-status.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('NFTSwap', () => {
MAKER_ASSET,
MAKER_WALLET_ADDRESS
);
expect(makerApprovalStatus.contractApproved).toBe(true);
// expect(makerApprovalStatus.contractApproved).toBe(true);

// const approvalTxMaker = await nftSwapperMaker.approveTokenOrNftByAsset(
// MAKER_ASSET,
Expand Down
17 changes: 1 addition & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1676,11 +1676,6 @@
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=

"@types/lodash@^4.14.178":
version "4.14.178"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8"
integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==

"@types/node@*":
version "16.11.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.4.tgz#90771124822d6663814f7c1c9b45a6654d8fd964"
Expand Down Expand Up @@ -3557,11 +3552,6 @@ fragment-cache@^0.2.1:
dependencies:
map-cache "^0.2.2"

from-exponential@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/from-exponential/-/from-exponential-1.1.1.tgz#41caff748d22e9c195713802cdac31acbe4b1b83"
integrity sha512-VBE7f5OVnYwdgB3LHa+Qo29h8qVpxhVO9Trlc+AWm+/XNAgks1tAwMFHb33mjeiof77GglsJzeYF7OqXrROP/A==

fs-extra@8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
Expand Down Expand Up @@ -4904,11 +4894,6 @@ locate-path@^5.0.0:
dependencies:
p-locate "^4.1.0"

lodash-es@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==

lodash.camelcase@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"
Expand All @@ -4934,7 +4919,7 @@ lodash.sortby@^4.7.0:
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=

lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21:
lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
Expand Down