Skip to content
Prev Previous commit
Next Next commit
Remove barrel files from @r/packages/sdk/src/evm/types
  • Loading branch information
kien-ngo committed Oct 23, 2023
commit e6b48730bb4c81ca6e607d9b3ea8fbd2e0dcf44e
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BigNumber, type PopulatedTransaction, type Signer } from "ethers";
import invariant from "tiny-invariant";
import { PrecomputedDeploymentTransaction } from "../../types/any-evm/deploy-data";
import type { DeployOptions } from "../../types/deploy";
import type { DeployOptions } from "../../types/deploy/deploy-options";
import { isContractDeployed } from "./isContractDeployed";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
type Signer,
} from "ethers";
import invariant from "tiny-invariant";
import type { DeployOptions } from "../../types/deploy";
import type { DeployOptions } from "../../types/deploy/deploy-options";
import { isContractDeployed } from "./isContractDeployed";
import { getInitBytecodeWithSalt } from "./getInitBytecodeWithSalt";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BigNumber, Signer } from "ethers";
import invariant from "tiny-invariant";
import { toWei } from "../currency/toWei";
import type { DeployOptions } from "../../types/deploy";
import type { DeployOptions } from "../../types/deploy/deploy-options";
import { CUSTOM_GAS_FOR_CHAIN } from "../any-evm-constants";
import { COMMON_FACTORY } from "./constants";
import { isContractDeployed } from "./isContractDeployed";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ContractFactory, type Signer } from "ethers";
import { PrecomputedDeploymentTransaction } from "../../types/any-evm/deploy-data";
import type { DeployOptions } from "../../types/deploy";
import type { DeployOptions } from "../../types/deploy/deploy-options";
import { DEPLOYER_ABI, DEPLOYER_BYTECODE } from "./constants";
import { createTransactionBatches } from "./createTransactionBatches";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ThirdwebStorage } from "@thirdweb-dev/storage";
import { fetchExtendedReleaseMetadata } from "../feature-detection/fetchExtendedReleaseMetadata";
import { fetchPreDeployMetadata } from "../feature-detection/fetchPreDeployMetadata";
import type { DeployMetadata } from "../../types/deploy";
import type { DeployMetadata } from "../../types/deploy/deploy-options";

const deployMetadataCache: Record<string, any> = {};

Expand Down
10 changes: 4 additions & 6 deletions packages/sdk/src/evm/common/marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ import {
InterfaceId_IERC721,
} from "../constants/contract";
import { ContractWrapper } from "../core/classes/contract-wrapper";
import {
NewAuctionListing,
NewDirectListing,
Offer,
UnmappedOffer,
} from "../types/marketplace";
import { fetchCurrencyValue } from "./currency/fetchCurrencyValue";
import { NewDirectListing } from "../types/marketplace/NewDirectListing";
import { NewAuctionListing } from "../types/marketplace/NewAuctionListing";
import { UnmappedOffer } from "../types/marketplace/UnmappedOffer";
import { Offer } from "../types/marketplace/Offer";

/**
* This method checks if the given token is approved for the transferrerContractAddress contract.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ import { MarketplaceContractSchema } from "../../schema/contracts/marketplace";
import { SDKOptions } from "../../schema/sdk-options";
import { AddressOrEns } from "../../schema/shared/AddressOrEnsSchema";
import { Price } from "../../types/currency";
import { AuctionListing, DirectListing, Offer } from "../../types/marketplace";
import { MarketplaceFilter } from "../../types/marketplace/MarketPlaceFilter";
import { UnmappedOffer } from "../../types/marketplace/UnmappedOffer";
import { MARKETPLACE_CONTRACT_ROLES } from "../contractRoles";
import { ListingType } from "../../enums/marketplace/ListingType";
import { AuctionListing } from "../../types/marketplace/AuctionListing";
import { DirectListing } from "../../types/marketplace/DirectListing";
import { Offer } from "../../types/marketplace/Offer";

/**
* Create your own whitelabel marketplace that enables users to buy and sell any digital assets.
Expand Down
6 changes: 3 additions & 3 deletions packages/sdk/src/evm/core/classes/account-permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import type {
IAccountPermissions_V1,
} from "@thirdweb-dev/contracts-js";
import invariant from "tiny-invariant";
import { detectContractFeature } from "../../common/feature-detection/detectContractFeature";
import { resolveAddress } from "../../common/ens/resolveAddress";
import { resolveOrGenerateId } from "../../common/signature-minting";
import { buildTransactionFunction } from "../../common/transactions";
import { AddressOrEns } from "../../schema";
Expand All @@ -28,10 +30,8 @@ import {
SignerPermissionsOutput,
SignerPermissionsSchema,
SignerWithPermissions,
} from "../../types";
} from "../../types/account";
import { AddressZero } from "../../constants/addresses/AddressZero";
import { detectContractFeature } from "../../common/feature-detection/detectContractFeature";
import { resolveAddress } from "../../common/ens/resolveAddress";

export class AccountPermissions implements DetectableFeature {
featureName = FEATURE_ACCOUNT_PERMISSIONS.name;
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/core/classes/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
PermissionSnapshotInput,
SignerPermissionsInput,
SignerWithPermissions,
} from "../../types";
} from "../../types/account";
import { buildTransactionFunction } from "../../common/transactions";
import { AccountPermissions } from "./account-permissions";
import { detectContractFeature } from "../../common/feature-detection/detectContractFeature";
Expand Down
5 changes: 4 additions & 1 deletion packages/sdk/src/evm/core/classes/airdrop-erc1155.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { AirdropFailedEvent } from "@thirdweb-dev/contracts-js/dist/declarations
import { buildTransactionFunction } from "../../common/transactions";
import { FEATURE_AIRDROP_ERC1155 } from "../../constants/thirdweb-features";
import { Address } from "../../schema";
import { Airdrop1155Content, Airdrop1155Output } from "../../types";
import {
Airdrop1155Content,
Airdrop1155Output,
} from "../../types/airdrop/airdrop";
import { DetectableFeature } from "../interfaces/DetectableFeature";
import { ContractWrapper } from "./contract-wrapper";
import { Transaction } from "./transactions";
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/core/classes/airdrop-erc20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { AirdropFailedEvent } from "@thirdweb-dev/contracts-js/dist/declarations
import { buildTransactionFunction } from "../../common/transactions";
import { FEATURE_AIRDROP_ERC20 } from "../../constants/thirdweb-features";
import { Address } from "../../schema";
import { Airdrop20Content, Airdrop20Output } from "../../types";
import { DetectableFeature } from "../interfaces/DetectableFeature";
import { ContractWrapper } from "./contract-wrapper";
import { Transaction } from "./transactions";
import { Airdrop20Content, Airdrop20Output } from "../../types/airdrop/airdrop";

/**
* @public
Expand Down
5 changes: 4 additions & 1 deletion packages/sdk/src/evm/core/classes/airdrop-erc721.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { AirdropFailedEvent } from "@thirdweb-dev/contracts-js/dist/declarations
import { buildTransactionFunction } from "../../common/transactions";
import { FEATURE_AIRDROP_ERC721 } from "../../constants/thirdweb-features";
import { Address } from "../../schema";
import { Airdrop721Content, Airdrop721Output } from "../../types";
import {
Airdrop721Content,
Airdrop721Output,
} from "../../types/airdrop/airdrop";
import { DetectableFeature } from "../interfaces/DetectableFeature";
import { ContractWrapper } from "./contract-wrapper";
import { Transaction } from "./transactions";
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/core/classes/erc-721-claim-zora.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { toWei } from "../../common/currency/toWei";
import { buildTransactionFunction } from "../../common/transactions";
import { FEATURE_NFT_CLAIM_ZORA } from "../../constants/erc721-features";
import { AddressOrEns } from "../../schema";
import type { ClaimOptions } from "../../types";
import type { ClaimOptions } from "../../types/claim-conditions/claim-conditions";
import { DetectableFeature } from "../interfaces/DetectableFeature";
import { TransactionResultWithId } from "../types";
import { ContractWrapper } from "./contract-wrapper";
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/core/classes/extension-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { utils } from "ethers";
import invariant from "tiny-invariant";
import { joinABIs } from "../../common/plugin/joinABIs";
import { TransactionReceipt } from "@ethersproject/abstract-provider";
import { DynamicContractExtensionMetadataOrUri } from "../../types";
import { DynamicContractExtensionMetadataOrUri } from "../../types/deploy/deploy-metadata";
import {
ExtensionAddedEvent,
ExtensionRemovedEvent,
Expand Down
3 changes: 2 additions & 1 deletion packages/sdk/src/evm/core/classes/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ import {
} from "../../contracts";
import { SDKOptions } from "../../schema/sdk-options";
import { Address } from "../../schema/shared/Address";
import type { DeployEvents, DeployOptions } from "../../types/deploy";
import type { DeployOptions } from "../../types/deploy/deploy-options";
import type { DeployEvents } from "../../types/deploy/deploy-events";
import { NetworkInput } from "../types";
import { ContractWrapper } from "./contract-wrapper";
import { Transaction } from "./transactions";
Expand Down
8 changes: 3 additions & 5 deletions packages/sdk/src/evm/core/classes/marketplace-auction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,15 @@ import {
import { fetchTokenMetadataForContract } from "../../common/nft";
import { buildTransactionFunction } from "../../common/transactions";
import { CurrencyValue, Price } from "../../types/currency";
import {
AuctionListing,
NewAuctionListing,
Offer,
} from "../../types/marketplace";
import { TransactionResultWithId } from "../types";
import { ContractEncoder } from "./contract-encoder";
import { ContractEvents } from "./contract-events";
import { ContractWrapper } from "./contract-wrapper";
import { Transaction } from "./transactions";
import { ListingType } from "../../enums/marketplace/ListingType";
import { AuctionListing } from "../../types/marketplace/AuctionListing";
import { Offer } from "../../types/marketplace/Offer";
import { NewAuctionListing } from "../../types/marketplace/NewAuctionListing";

/**
* Handles auction listings
Expand Down
8 changes: 3 additions & 5 deletions packages/sdk/src/evm/core/classes/marketplace-direct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@ import {
import { ListingType } from "../../enums/marketplace/ListingType";
import { AddressOrEns } from "../../schema/shared/AddressOrEnsSchema";
import { Price } from "../../types/currency";
import {
DirectListing,
NewDirectListing,
Offer,
} from "../../types/marketplace";
import { TransactionResultWithId } from "../types";
import { ContractWrapper } from "./contract-wrapper";
import { Transaction } from "./transactions";
import { DirectListing } from "../../types/marketplace/DirectListing";
import { Offer } from "../../types/marketplace/Offer";
import { NewDirectListing } from "../../types/marketplace/NewDirectListing";

/**
* Handles direct listings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ import {
DirectListingInputParamsSchema,
} from "../../schema/marketplacev3/direct-listings";
import { AddressOrEns } from "../../schema/shared/AddressOrEnsSchema";
import type { MarketplaceFilterWithoutOfferor } from "../../types/marketplace";
import type { DirectListingV3 } from "../../types/marketplacev3";
import type { MarketplaceFilterWithoutOfferor } from "../../types/marketplace/MarketPlaceFilter";
import type { DirectListingV3 } from "../../types/marketplacev3/DirectListingV3";
import { DetectableFeature } from "../interfaces/DetectableFeature";
import { TransactionResultWithId } from "../types";
import { ContractEncoder } from "./contract-encoder";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ import {
import { Address } from "../../schema/shared/Address";
import { AddressOrEns } from "../../schema/shared/AddressOrEnsSchema";
import { CurrencyValue, Price } from "../../types/currency";
import type { MarketplaceFilterWithoutOfferor } from "../../types/marketplace";
import { Bid, EnglishAuction } from "../../types/marketplacev3";
import type { MarketplaceFilterWithoutOfferor } from "../../types/marketplace/MarketPlaceFilter";
import { EnglishAuction } from "../../types/marketplacev3/EnglishAuction";
import { Bid } from "../../types/marketplacev3/Bid";
import { DetectableFeature } from "../interfaces/DetectableFeature";
import { TransactionResultWithId } from "../types";
import { ContractEncoder } from "./contract-encoder";
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/src/evm/core/classes/marketplacev3-offers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import {
OfferInputParams,
OfferInputParamsSchema,
} from "../../schema/marketplacev3/offer";
import type { MarketplaceFilterWithoutSeller } from "../../types/marketplace";
import { OfferV3 } from "../../types/marketplacev3";
import type { MarketplaceFilterWithoutSeller } from "../../types/marketplace/MarketPlaceFilter";
import { OfferV3 } from "../../types/marketplacev3/OfferV3";
import { DetectableFeature } from "../interfaces/DetectableFeature";
import { TransactionResultWithId } from "../types";
import { ContractEncoder } from "./contract-encoder";
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/core/classes/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
import { BigNumber } from "ethers";
import invariant from "tiny-invariant";
import EventEmitter from "eventemitter3";
import type { DeployEvents } from "../../types/deploy";
import type { DeployEvents } from "../../types/deploy/deploy-events";
import { ForwardRequestMessage, PermitRequestMessage } from "../types";
import { computeEOAForwarderAddress } from "../../common/any-evm-utils/computeEOAForwarderAddress";
import { computeForwarderAddress } from "../../common/any-evm-utils/computeForwarderAddress";
Expand Down
28 changes: 13 additions & 15 deletions packages/sdk/src/evm/core/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,6 @@ import {
} from "../contracts";
import { Address } from "../schema/shared/Address";
import type { CurrencyValue } from "../types/currency";
import type {
DeployEvents,
NFTContractDeployMetadata,
MultiwrapContractDeployMetadata,
TokenContractDeployMetadata,
MarketplaceContractDeployMetadata,
MarketplaceV3ContractDeployMetadata,
SplitContractDeployMetadata,
VoteContractDeployMetadata,
DeployOptions,
DeployMetadata,
DeployEvent,
OpenEditionContractDeployMetadata,
AirdropContractDeployMetadata,
} from "../types/deploy";
import type { ContractWithMetadata } from "../types/registry";
import { DeploySchemaForPrebuiltContractType } from "../contracts";
import { ContractFactory } from "./classes/factory";
Expand Down Expand Up @@ -121,6 +106,19 @@ import {
predictAddressDeterministicPublished,
} from "../common/any-evm-utils/deployDirectDeterministic";
import { getDefaultTrustedForwarders } from "../constants/addresses/getDefaultTrustedForwarders";
import { DeployEvent, DeployEvents } from "../types/deploy/deploy-events";
import {
AirdropContractDeployMetadata,
MarketplaceContractDeployMetadata,
MarketplaceV3ContractDeployMetadata,
MultiwrapContractDeployMetadata,
NFTContractDeployMetadata,
OpenEditionContractDeployMetadata,
SplitContractDeployMetadata,
TokenContractDeployMetadata,
VoteContractDeployMetadata,
} from "../types/deploy/deploy-metadata";
import { DeployMetadata, DeployOptions } from "../types/deploy/deploy-options";

/**
* The main entry point for the thirdweb SDK
Expand Down
30 changes: 29 additions & 1 deletion packages/sdk/src/evm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export type {
SDKOptionsOutput,
} from "./schema/sdk-options";

export * from "./types";
export * from "./contracts";

export { StaticJsonRpcBatchProvider } from "./lib/static-batch-rpc";
Expand Down Expand Up @@ -230,3 +229,32 @@ export * from "./enums/vote/ProposalState";
export * from "./enums/vote/Vote";
export * from "./enums/ClaimEligibility";
//#endregion @r/packages/sdk/src/evm/enums

//#region @r/packages/sdk/src/evm/types
export * from "./types/claim-conditions/claim-conditions";
export * from "./types/airdrop/airdrop";
export * from "./types/marketplace/NewDirectListing";
export * from "./types/marketplace/DirectListing";
export * from "./types/marketplace/MarketPlaceFilter";
export * from "./types/marketplace/NewAuctionListing";
export * from "./types/marketplace/AuctionListing";
export * from "./types/marketplace/Offer";
export * from "./types/marketplace/UnmappedOffer";
export * from "./types/marketplacev3/DirectListingV3";
export * from "./types/marketplacev3/EnglishAuction";
export * from "./types/marketplacev3/Bid";
export * from "./types/marketplacev3/OfferV3";
export * from "./types/currency";
export * from "./types/delayed-reveal";
export * from "./types/vote";
export * from "./types/SplitRecipient";
export * from "./types/deploy/deploy-metadata";
export * from "./types/deploy/deploy-events";
export * from "./types/deploy/deploy-options";
export * from "./types/events";
export * from "./types/multiwrap";
export * from "./types/registry";
export * from "./types/transactions";
export * from "./types/contract";
export * from "./types/account";
//#endregion
3 changes: 0 additions & 3 deletions packages/sdk/src/evm/types/deploy/index.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/sdk/src/evm/types/index.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/sdk/src/evm/types/marketplace/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/sdk/src/evm/types/marketplacev3/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/sdk/src/evm/types/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
ContractFactory,
} from "ethers";
import EventEmitter from "eventemitter3";
import { DeployEvents } from "./deploy";
import { DeployEvents } from "./deploy/deploy-events";

export type ParseTransactionReceipt<TResult = TransactionResult> =
| ((receipt: providers.TransactionReceipt) => TResult)
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/zksync/zksync-deploy-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { extractConstructorParamsFromAbi } from "../common/feature-detection/ext
import { extractFunctionParamsFromAbi } from "../common/feature-detection/extractFunctionParamsFromAbi";
import { type BytesLike, Contract, type Signer, utils, Wallet } from "ethers";
import { ThirdwebStorage } from "@thirdweb-dev/storage";
import type { DeployOptions } from "../types/deploy";
import type { DeployOptions } from "../types/deploy/deploy-options";
import { ThirdwebSDK } from "../core/sdk";
import { getImplementation } from "./constants/addresses";
import { DeploymentTransaction } from "../types/any-evm/deploy-data";
Expand Down