Skip to content

Commit a6bcf43

Browse files
committed
cleanup, remove unused imports
1 parent a497f22 commit a6bcf43

File tree

2 files changed

+16
-31
lines changed

2 files changed

+16
-31
lines changed

src/sdk/v4/NftSwapV4.ts

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
import { Signer, TypedDataSigner } from '@ethersproject/abstract-signer';
2-
import { BaseProvider, TransactionReceipt } from '@ethersproject/providers';
3-
import { BigNumber, BigNumberish, ContractTransaction } from 'ethers';
1+
import type { Signer, TypedDataSigner } from '@ethersproject/abstract-signer';
2+
import type {
3+
BaseProvider,
4+
TransactionReceipt,
5+
} from '@ethersproject/providers';
6+
import type { BigNumberish, ContractTransaction } from 'ethers';
7+
import { Interface } from '@ethersproject/abi';
8+
import invariant from 'tiny-invariant';
49
import {
510
ERC1155__factory,
611
ERC721__factory,
@@ -35,22 +40,17 @@ import {
3540
import type {
3641
AddressesForChain,
3742
ApprovalOverrides,
38-
FeeStruct,
3943
FillOrderOverrides,
4044
NftOrderV4,
4145
OrderStructOptionsCommonStrict,
42-
PropertyStruct,
4346
SignedNftOrderV4,
4447
SigningOptions,
4548
} from './types';
46-
import addresses from './addresses.json';
47-
import invariant from 'tiny-invariant';
48-
import { NULL_ADDRESS } from '../../utils/eth';
49-
import { defaultAbiCoder, Interface } from '@ethersproject/abi';
5049
import {
51-
ERC1155_ENCODED_ORDER_DATA,
52-
ERC721_ENCODED_ORDER_DATA,
50+
ERC1155_TRANSFER_FROM_DATA,
51+
ERC721_TRANSFER_FROM_DATA,
5352
} from './nft-safe-transfer-from-data';
53+
import addresses from './addresses.json';
5454

5555
export enum SupportedChainIdsV4 {
5656
Ropsten = 3,
@@ -118,21 +118,6 @@ export interface INftSwapV4 extends BaseNftSwap {
118118
// };
119119
}
120120

121-
export type ERC1155OrderStruct = {
122-
direction: BigNumberish;
123-
maker: string;
124-
taker: string;
125-
expiry: BigNumberish;
126-
nonce: BigNumberish;
127-
erc20Token: string;
128-
erc20TokenAmount: BigNumberish;
129-
fees: FeeStruct[];
130-
erc1155Token: string;
131-
erc1155TokenId: BigNumberish;
132-
erc1155TokenProperties: PropertyStruct[];
133-
erc1155TokenAmount: BigNumberish;
134-
};
135-
136121
export interface AdditionalSdkConfig {
137122
zeroExExchangeProxyContractAddress: string;
138123
}
@@ -398,7 +383,7 @@ class NftSwapV4 implements INftSwapV4 {
398383
* @param tokenId NFT token id that taker of trade will sell
399384
* @param fillOrderOverrides Trade specific (SDK-level) overrides
400385
* @param transactionOverrides General transaction overrides from ethers (gasPrice, gasLimit, etc)
401-
* @returns
386+
* @returns
402387
*/
403388
fillBuyNftOrderWithoutApproval = async (
404389
signedOrder: SignedNftOrderV4,
@@ -429,7 +414,7 @@ class NftSwapV4 implements INftSwapV4 {
429414
this.signer
430415
);
431416

432-
const encodingIface = new Interface(ERC721_ENCODED_ORDER_DATA);
417+
const encodingIface = new Interface(ERC721_TRANSFER_FROM_DATA);
433418

434419
const fragment = encodingIface.getFunction('safeTransferFromErc721Data');
435420
const data = encodingIface._encodeParams(fragment.inputs, [
@@ -456,7 +441,7 @@ class NftSwapV4 implements INftSwapV4 {
456441
signedOrder.erc1155Token,
457442
this.signer
458443
);
459-
const encodingIface = new Interface(ERC1155_ENCODED_ORDER_DATA);
444+
const encodingIface = new Interface(ERC1155_TRANSFER_FROM_DATA);
460445

461446
const fragment = encodingIface.getFunction('safeTransferFromErc1155Data');
462447
const data = encodingIface._encodeParams(fragment.inputs, [

src/sdk/v4/nft-safe-transfer-from-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const ERC721_ENCODED_ORDER_DATA = [
1+
export const ERC721_TRANSFER_FROM_DATA = [
22
{
33
inputs: [
44
{
@@ -131,7 +131,7 @@ export const ERC721_ENCODED_ORDER_DATA = [
131131
},
132132
];
133133

134-
export const ERC1155_ENCODED_ORDER_DATA = [
134+
export const ERC1155_TRANSFER_FROM_DATA = [
135135
{
136136
inputs: [
137137
{

0 commit comments

Comments
 (0)