Skip to content
Prev Previous commit
Next Next commit
Remove barrel file in @r/packages/sdk/src/evm/constants/*
  • Loading branch information
kien-ngo committed Oct 23, 2023
commit 6b904b480ae19d42a9e951f56a8ed1e08dab9b63
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import { getInitBytecodeWithSalt } from "./getInitBytecodeWithSalt";
import { fetchAndCacheDeployMetadata } from "./fetchAndCacheDeployMetadata";
import { deployCreate2Factory } from "./deployCreate2Factory";
import { convertParamValues } from "./convertParamValues";
import { AbiInput } from "../../schema";
import { getCreate2FactoryAddress } from "./getCreate2FactoryAddress";
import { fetchPublishedContractFromPolygon } from "./fetchPublishedContractFromPolygon";
import { AbiInput } from "../../schema/contracts/custom";

/**
* Direct deploy a contract at a deterministic address, using Create2 method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import ContractPublisherAbi from "@thirdweb-dev/contracts-js/dist/abis/ContractP
import type { ContractPublisher } from "@thirdweb-dev/contracts-js";
import { getContractPublisherAddress } from "../../constants/addresses/getContractPublisherAddress";
import { getChainProvider } from "../../constants/urls";
import { AddressOrEns, PublishedContractSchema } from "../../schema";
import { resolveAddress } from "../ens/resolveAddress";
import invariant from "tiny-invariant";
import { ThirdwebStorage } from "@thirdweb-dev/storage";
import { fetchAndCacheDeployMetadata } from "./fetchAndCacheDeployMetadata";
import { Polygon } from "@thirdweb-dev/chains";
import { getSupportedChains } from "../../constants/chains/supportedChains";
import { AddressOrEns } from "../../schema/shared/AddressOrEnsSchema";
import { PublishedContractSchema } from "../../schema/contracts/custom";

export const THIRDWEB_DEPLOYER = "0xdd99b75f095d0c4d5112aCe938e4e6ed962fb024";

Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/common/metadata-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getMultichainRegistryAddress } from "../constants/addresses/getMulticha
import { getChainProvider } from "../constants/urls";
import type { TWMultichainRegistryLogic } from "@thirdweb-dev/contracts-js";
import { constructAbiFromBytecode } from "./feature-detection/getAllDetectedFeatures";
import { SDKOptions } from "../schema";
import { SDKOptions } from "../schema/sdk-options";
import { Polygon } from "@thirdweb-dev/chains";

// Internal static cache
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/core/classes/account-permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { detectContractFeature } from "../../common/feature-detection/detectCont
import { resolveAddress } from "../../common/ens/resolveAddress";
import { resolveOrGenerateId } from "../../common/signature-minting";
import { buildTransactionFunction } from "../../common/transactions";
import { AddressOrEns } from "../../schema";
import { AddressOrEns } from "../../schema/shared/AddressOrEnsSchema";
import {
AdminFlag,
DEFAULT_PERMISSIONS,
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 @@ -6,7 +6,7 @@ import { DetectableFeature } from "../interfaces/DetectableFeature";
import { ContractWrapper } from "./contract-wrapper";

import type { IAccountCore } from "@thirdweb-dev/contracts-js";
import { AddressOrEns } from "../../schema";
import { AddressOrEns } from "../../schema/shared/AddressOrEnsSchema";
import {
PermissionSnapshotInput,
SignerPermissionsInput,
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/core/classes/airdrop-erc1155.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
import { AirdropFailedEvent } from "@thirdweb-dev/contracts-js/dist/declarations/src/AirdropERC1155";
import { buildTransactionFunction } from "../../common/transactions";
import { FEATURE_AIRDROP_ERC1155 } from "../../constants/thirdweb-features";
import { Address } from "../../schema";
import { Address } from "../../schema/shared/Address";
import {
Airdrop1155Content,
Airdrop1155Output,
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 @@ -2,7 +2,7 @@ import type { AirdropERC20, IAirdropERC20 } from "@thirdweb-dev/contracts-js";
import { AirdropFailedEvent } from "@thirdweb-dev/contracts-js/dist/declarations/src/AirdropERC1155";
import { buildTransactionFunction } from "../../common/transactions";
import { FEATURE_AIRDROP_ERC20 } from "../../constants/thirdweb-features";
import { Address } from "../../schema";
import { Address } from "../../schema/shared/Address";
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-erc721.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { AirdropERC721, IAirdropERC721 } from "@thirdweb-dev/contracts-js";
import { AirdropFailedEvent } from "@thirdweb-dev/contracts-js/dist/declarations/src/AirdropERC1155";
import { buildTransactionFunction } from "../../common/transactions";
import { FEATURE_AIRDROP_ERC721 } from "../../constants/thirdweb-features";
import { Address } from "../../schema";
import { Address } from "../../schema/shared/Address";
import {
Airdrop721Content,
Airdrop721Output,
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 @@ -8,7 +8,7 @@ import { NFT } from "../../../core/schema/nft";
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 { AddressOrEns } from "../../schema/shared/AddressOrEnsSchema";
import type { ClaimOptions } from "../../types/claim-conditions/claim-conditions";
import { DetectableFeature } from "../interfaces/DetectableFeature";
import { TransactionResultWithId } from "../types";
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/core/classes/erc-721-tiered-drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { setErc20Allowance } from "../../common/currency/setErc20Allowance";
import { getBaseUriFromBatch, uploadOrExtractURIs } from "../../common/nft";
import { buildTransactionFunction } from "../../common/transactions";
import { FEATURE_NFT_TIERED_DROP } from "../../constants/erc721-features";
import { GenericRequest } from "../../schema/contracts/common";
import {
GenericRequest,
TieredDropPayloadInput,
TieredDropPayloadOutput,
TieredDropPayloadSchema,
Expand Down
3 changes: 2 additions & 1 deletion packages/sdk/src/evm/core/classes/extension-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
import { FEATURE_DYNAMIC_CONTRACT } from "../../constants/thirdweb-features";
import { ContractInterface } from "ethers";
import { generateExtensionFunctions } from "../../common/plugin/generatePluginFunctions";
import { Abi, AbiSchema, CommonContractSchema } from "../../schema";
import { utils } from "ethers";
import invariant from "tiny-invariant";
import { joinABIs } from "../../common/plugin/joinABIs";
Expand All @@ -31,6 +30,8 @@ import {
import { getDeploymentInfo } from "../../common/any-evm-utils/getDeploymentInfo";
import { deployWithThrowawayDeployer } from "../../common/any-evm-utils/deployWithThrowawayDeployer";
import { deployContractDeterministic } from "../../common/any-evm-utils/deployContractDeterministic";
import { Abi, AbiSchema } from "../../schema/contracts/custom";
import { CommonContractSchema } from "../../schema/contracts/common";

export class ExtensionManager implements DetectableFeature {
featureName = FEATURE_DYNAMIC_CONTRACT.name;
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/core/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ import { fetchContractMetadataFromAddress } from "../common/metadata-resolver";
import { LoyaltyCardContractDeploy } from "../schema/contracts/loyalty-card";
import { checkClientIdOrSecretKey } from "../../core/utils/apiKey";
import { getProcessEnv } from "../../core/utils/process";
import { DropErc721ContractSchema } from "../schema";
import { DropErc721ContractSchema } from "../schema/contracts/drop-erc721";
import { AirdropContractDeploy } from "../schema/contracts/airdrop";
import {
directDeployDeterministicPublished,
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
Signer,
providers,
} from "ethers";
import { ChainInfo } from "../schema";
import { ChainInfo } from "../schema/shared/ChainInfo";

// --- utility types extracted from from ts-toolbelt --- //

Expand Down
61 changes: 34 additions & 27 deletions packages/sdk/src/evm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,6 @@ export type { ContractType } from "./contracts";

export type { Role } from "./common/role";

export * from "./schema/contracts/custom";
export * from "./schema/contracts/common/claim-conditions";
export * from "./schema/tokens/common/properties";
export * from "./schema/tokens/token";
export * from "./schema/tokens/edition";
export * from "./schema/contracts/common";

// shared
export * from "./schema/shared/BigNumberSchema";
export * from "./schema/shared/AddressSchema";
export * from "./schema/shared/AddressOrEnsSchema";
export * from "./schema/shared/RawDateSchema";
export * from "./schema/shared/CallOverrideSchema";
export * from "./schema/shared/ChainInfo";
export * from "./schema/shared/Ens";
export * from "./schema/shared/Address";

export type {
SDKOptions,
SDKOptionsSchema,
SDKOptionsOutput,
} from "./schema/sdk-options";

export * from "./contracts";

export { StaticJsonRpcBatchProvider } from "./lib/static-batch-rpc";
Expand All @@ -55,10 +32,6 @@ export type { SmartContract } from "./contracts/smart-contract";
// re-export from functions entry point
export * from "./functions";

// marketplace v3 types
export type { DirectListingInputParams } from "./schema/marketplacev3/direct-listings";
export type { EnglishAuctionInputParams } from "./schema/marketplacev3/english-auctions";

//#region @r/packages/sdk/src/evm/core
export * from "./core/types";
export * from "./core/classes/contract-encoder";
Expand Down Expand Up @@ -258,3 +231,37 @@ export * from "./types/transactions";
export * from "./types/contract";
export * from "./types/account";
//#endregion

//#region @r/packages/sdk/src/evm/schema
export * from "./schema/shared/BigNumberSchema";
export * from "./schema/shared/AddressSchema";
export * from "./schema/shared/AddressOrEnsSchema";
export * from "./schema/shared/RawDateSchema";
export * from "./schema/shared/CallOverrideSchema";
export * from "./schema/shared/ChainInfo";
export * from "./schema/shared/Ens";
export * from "./schema/shared/Address";
export * from "./schema/sdk-options";
export * from "./schema/contracts/custom";
export * from "./schema/contracts/common/index";
export * from "./schema/contracts/common/claim-conditions";
export * from "./schema/contracts/common/currency";
export * from "./schema/contracts/common/signature";
export * from "./schema/contracts/common/snapshots";
export * from "./schema/contracts/drop-erc721";
export * from "./schema/contracts/drop-erc1155";
export * from "./schema/contracts/marketplace";
export * from "./schema/contracts/packs";
export * from "./schema/contracts/splits";
export * from "./schema/contracts/token-erc20";
export * from "./schema/contracts/token-erc721";
export * from "./schema/contracts/token-erc1155";
export * from "./schema/contracts/vote";
export * from "./schema/tokens/common/properties";
export * from "./schema/tokens/common/wrap";
export * from "./schema/tokens/edition";
export * from "./schema/tokens/token";
export * from "./schema/tokens/pack";
export type { DirectListingInputParams } from "./schema/marketplacev3/direct-listings";
export type { EnglishAuctionInputParams } from "./schema/marketplacev3/english-auctions";
//#endregion @r/packages/sdk/src/evm/schema
5 changes: 0 additions & 5 deletions packages/sdk/src/evm/schema/contracts/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,3 @@ export const CommonSymbolSchema = /* @__PURE__ */ (() =>
z.object({
symbol: z.string().default(""),
}))();

export * from "./claim-conditions";
export * from "./currency";
export * from "./signature";
export * from "./snapshots";
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/schema/contracts/custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import {
CommonRoyaltySchema,
CommonSymbolSchema,
CommonTrustedForwarderSchema,
MerkleSchema,
} from "./common";
import { BigNumberish } from "ethers";
import { z } from "zod";
import { MerkleSchema } from "./common/snapshots";

/**
* @internal
Expand Down
11 changes: 0 additions & 11 deletions packages/sdk/src/evm/schema/contracts/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/sdk/src/evm/schema/contracts/tiered-drop.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { BasisPointsSchema } from "../../../core/schema/shared";
import { BigNumberSchema } from "../shared/BigNumberSchema";
import { AddressOrEnsSchema } from "../shared/AddressOrEnsSchema";
import { BaseSignaturePayloadInput } from "./common";
import { constants } from "ethers";
import { z } from "zod";
import { BaseSignaturePayloadInput } from "./common/signature";

/**
* @internal
Expand Down
14 changes: 0 additions & 14 deletions packages/sdk/src/evm/schema/index.ts

This file was deleted.

5 changes: 0 additions & 5 deletions packages/sdk/src/evm/schema/tokens/index.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/sdk/src/evm/types/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import type {
import { BigNumber, BytesLike } from "ethers";
import { z } from "zod";
import { AmountSchema } from "../../core/schema/shared";
import { EndDateSchema, StartDateSchema } from "../schema";
import { AddressOrEnsSchema } from "../schema";
import { AddressOrEnsSchema } from "../schema/shared/AddressOrEnsSchema";
import { EndDateSchema, StartDateSchema } from "../schema/shared/RawDateSchema";

export type SignerPermissions = {
startDate: Date;
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/types/any-evm/deploy-data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BytesLike } from "ethers";
import { PreDeployMetadataFetched } from "../../schema/contracts/custom";
import { AddressOrEns } from "../../schema";
import { AddressOrEns } from "../../schema/shared/AddressOrEnsSchema";

export type PrecomputedDeploymentTransaction = {
predictedAddress: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/evm/types/deploy/deploy-metadata.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AddressOrEns } from "../../schema/shared/AddressOrEnsSchema";
import { FileOrBufferOrString } from "@thirdweb-dev/storage";
import type { BigNumberish, Bytes } from "ethers";
import { CommonContractSchemaInput } from "../../schema";
import { CommonContractSchemaInput } from "../../schema/contracts/common";

/**
* Options for deploying an NFT contract
Expand Down