diff --git a/packages/protocol-sdk/src/apis/chain-constants.ts b/packages/protocol-sdk/src/apis/chain-constants.ts new file mode 100644 index 000000000..f999f1701 --- /dev/null +++ b/packages/protocol-sdk/src/apis/chain-constants.ts @@ -0,0 +1,101 @@ +import { + base, + baseGoerli, + foundry, + goerli, + mainnet, + optimism, + optimismGoerli, + zora, + zoraTestnet, +} from "viem/chains"; +import type { components } from "./generated/premint-api-types"; +import { parseEther } from "viem"; +import { getSubgraph } from "../constants"; + +export type NetworkConfig = { + chainId: number; + zoraPathChainName: string; + zoraBackendChainName: components["schemas"]["ChainName"]; + isTestnet: boolean; + subgraphUrl: string; +}; + +export const REWARD_PER_TOKEN = parseEther("0.000777"); + +export const BackendChainNamesLookup = { + ZORA_MAINNET: "ZORA-MAINNET", + ZORA_GOERLI: "ZORA-GOERLI", + OPTIMISM_MAINNET: "OPTIMISM-MAINNET", + OPTIMISM_GOERLI: "OPTIMISM-GOERLI", + ETHEREUM_MAINNET: "ETHEREUM-MAINNET", + ETHEREUM_GOERLI: "ETHEREUM-GOERLI", + BASE_MAINNET: "BASE-MAINNET", + BASE_GOERLI: "BASE-GOERLI", +} as const; + +export const networkConfigByChain: Record = { + [mainnet.id]: { + chainId: mainnet.id, + isTestnet: false, + zoraPathChainName: "eth", + zoraBackendChainName: BackendChainNamesLookup.ETHEREUM_MAINNET, + subgraphUrl: getSubgraph("zora-create-mainnet", "stable"), + }, + [goerli.id]: { + chainId: goerli.id, + isTestnet: true, + zoraPathChainName: "gor", + zoraBackendChainName: BackendChainNamesLookup.ETHEREUM_GOERLI, + subgraphUrl: getSubgraph("zora-create-goerli", "stable"), + }, + [zora.id]: { + chainId: zora.id, + isTestnet: false, + zoraPathChainName: "zora", + zoraBackendChainName: BackendChainNamesLookup.ZORA_MAINNET, + subgraphUrl: getSubgraph("zora-create-zora-mainnet", "stable"), + }, + [zoraTestnet.id]: { + chainId: zora.id, + isTestnet: true, + zoraPathChainName: "zgor", + zoraBackendChainName: BackendChainNamesLookup.ZORA_GOERLI, + subgraphUrl: getSubgraph("zora-create-zora-testnet", "stable"), + }, + [optimism.id]: { + chainId: optimism.id, + isTestnet: false, + zoraPathChainName: "opt", + zoraBackendChainName: BackendChainNamesLookup.OPTIMISM_MAINNET, + subgraphUrl: getSubgraph("zora-create-optimism", "stable"), + }, + [optimismGoerli.id]: { + chainId: optimismGoerli.id, + isTestnet: true, + zoraPathChainName: "ogor", + zoraBackendChainName: BackendChainNamesLookup.OPTIMISM_GOERLI, + subgraphUrl: getSubgraph("zora-create-optimism-goerli", "stable"), + }, + [base.id]: { + chainId: base.id, + isTestnet: false, + zoraPathChainName: "base", + zoraBackendChainName: BackendChainNamesLookup.BASE_MAINNET, + subgraphUrl: getSubgraph("zora-create-base-mainnet", "stable"), + }, + [baseGoerli.id]: { + chainId: baseGoerli.id, + isTestnet: true, + zoraPathChainName: "bgor", + zoraBackendChainName: BackendChainNamesLookup.BASE_GOERLI, + subgraphUrl: getSubgraph("zora-create-base-goerli", "stable"), + }, + [foundry.id]: { + chainId: foundry.id, + isTestnet: true, + zoraPathChainName: "zgor", + zoraBackendChainName: BackendChainNamesLookup.ZORA_GOERLI, + subgraphUrl: getSubgraph("zora-create-zora-testnet", "stable"), + }, +}; diff --git a/packages/protocol-sdk/src/apis/client-base.ts b/packages/protocol-sdk/src/apis/client-base.ts index 9aecf2601..3ee4a1e1e 100644 --- a/packages/protocol-sdk/src/apis/client-base.ts +++ b/packages/protocol-sdk/src/apis/client-base.ts @@ -1,47 +1,5 @@ -import { foundry, zora, zoraTestnet } from "viem/chains"; -import type { BackendChainNames as BackendChainNamesType } from "../premint/premint-api-client"; -import { - Chain, - PublicClient, - createPublicClient, - http, - parseEther, -} from "viem"; - -export type NetworkConfig = { - chainId: number; - zoraPathChainName: string; - zoraBackendChainName: BackendChainNamesType; - isTestnet: boolean; -}; - -export const REWARD_PER_TOKEN = parseEther("0.000777"); - -export const BackendChainNamesLookup = { - ZORA_MAINNET: "ZORA-MAINNET", - ZORA_GOERLI: "ZORA-GOERLI", -} as const; - -export const networkConfigByChain: Record = { - [zora.id]: { - chainId: zora.id, - isTestnet: false, - zoraPathChainName: "zora", - zoraBackendChainName: BackendChainNamesLookup.ZORA_MAINNET, - }, - [zoraTestnet.id]: { - chainId: zora.id, - isTestnet: true, - zoraPathChainName: "zgor", - zoraBackendChainName: BackendChainNamesLookup.ZORA_GOERLI, - }, - [foundry.id]: { - chainId: foundry.id, - isTestnet: true, - zoraPathChainName: "zgor", - zoraBackendChainName: BackendChainNamesLookup.ZORA_GOERLI, - }, -}; +import { Chain, PublicClient, createPublicClient, http } from "viem"; +import { NetworkConfig, networkConfigByChain } from "./chain-constants"; export abstract class ClientBase { network: NetworkConfig; diff --git a/packages/protocol-sdk/src/constants.ts b/packages/protocol-sdk/src/constants.ts index 507885321..a63c86806 100644 --- a/packages/protocol-sdk/src/constants.ts +++ b/packages/protocol-sdk/src/constants.ts @@ -2,21 +2,9 @@ export const ZORA_API_BASE = "https://api.zora.co/"; export const OPEN_EDITION_MINT_SIZE = BigInt("18446744073709551615"); // Subgraph base settings -const CONFIG_BASE = +const SUBGRAPH_CONFIG_BASE = "https://api.goldsky.com/api/public/project_clhk16b61ay9t49vm6ntn4mkz/subgraphs"; -function getSubgraph(name: string, version: string): string { - return `${CONFIG_BASE}/${name}/${version}/gn`; +export function getSubgraph(name: string, version: string): string { + return `${SUBGRAPH_CONFIG_BASE}/${name}/${version}/gn`; } - -export const ZORA_SUBGRAPH_URLS: Record = { - [1]: getSubgraph("zora-create-mainnet", "stable"), - [5]: getSubgraph("zora-create-goerli", "stable"), - [10]: getSubgraph("zora-create-optimism", "stable"), - [420]: getSubgraph("zora-create-optimism-goerli", "stable"), - [424]: getSubgraph("zora-create-publicgoods", "stable"), - [999]: getSubgraph("zora-create-zora-testnet", "stable"), - [7777777]: getSubgraph("zora-create-zora-mainnet", "stable"), - [84531]: getSubgraph("zora-create-base-goerli", "stable"), - [8453]: getSubgraph("zora-create-base-mainnet", "stable"), -}; diff --git a/packages/protocol-sdk/src/create/1155-create-helper.ts b/packages/protocol-sdk/src/create/1155-create-helper.ts index e87a42a1d..66b8f3340 100644 --- a/packages/protocol-sdk/src/create/1155-create-helper.ts +++ b/packages/protocol-sdk/src/create/1155-create-helper.ts @@ -14,8 +14,11 @@ import type { import { decodeEventLog, encodeFunctionData, zeroAddress } from "viem"; import { OPEN_EDITION_MINT_SIZE } from "../constants"; -const saleEndForever = 18446744073709551615n; -const royaltyBPSDefault = 1000; +// Sales end forever amount (uint64 max) +const SALE_END_FOREVER = 18446744073709551615n; + +// Default royalty bps +const ROYALTY_BPS_DEFAULT = 1000; type SalesConfigParamsType = { // defaults to 0 @@ -24,17 +27,24 @@ type SalesConfigParamsType = { saleStart?: bigint; // defaults to forever, in seconds saleEnd?: bigint; - maxTokensPerAddress?: number; + // max tokens that can be minted per address + maxTokensPerAddress?: bigint; fundsRecipient?: Address; }; export const DEFAULT_SALE_SETTINGS = { fundsRecipient: zeroAddress, + // Free Mint pricePerToken: 0n, + // Sale start time – defaults to beginning of unix time saleStart: 0n, - saleEnd: saleEndForever, + // This is the end of uint64, plenty of time + saleEnd: SALE_END_FOREVER, + // 0 Here means no limit maxTokensPerAddress: 0n, }; + +// Hardcode the permission bit for the minter const PERMISSION_BIT_MINTER = 2n ** 2n; type ContractType = @@ -52,11 +62,16 @@ type RoyaltySettingsType = { export function create1155TokenSetupArgs({ nextTokenId, + // How many NFTs upon initialization to mint to the creator mintToCreatorCount, tokenMetadataURI, + // Fixed price minter address – required minter fixedPriceMinterAddress, + // Address to use as the create referral, optional. createReferral, + // Optional max supply of the token. Default unlimited maxSupply, + // wallet sending the transaction account, salesConfig, royaltySettings, @@ -65,6 +80,7 @@ export function create1155TokenSetupArgs({ createReferral?: Address; nextTokenId: bigint; mintToCreatorCount: bigint | number; + // wallet sending the transaction account: Address; tokenMetadataURI: string; fixedPriceMinterAddress: Address; @@ -77,12 +93,12 @@ export function create1155TokenSetupArgs({ maxSupply = BigInt(maxSupply); mintToCreatorCount = BigInt(mintToCreatorCount); - const salesConfigWithDefaults = Object.assign( + const salesConfigWithDefaults = { // Set static sales default. - DEFAULT_SALE_SETTINGS, + ...DEFAULT_SALE_SETTINGS, // Override with user settings. - salesConfig, - ); + ...salesConfig, + }; const setupActions = [ encodeFunctionData({ @@ -140,7 +156,7 @@ export function create1155TokenSetupArgs({ nextTokenId, { royaltyMintSchedule: 0, - royaltyBPS: royaltySettings?.royaltyBPS || royaltyBPSDefault, + royaltyBPS: royaltySettings?.royaltyBPS || ROYALTY_BPS_DEFAULT, royaltyRecipient: royaltySettings?.royaltyRecipient || account, }, ], @@ -171,6 +187,7 @@ export const getTokenIdFromCreateReceipt = ( async function getContractExists( publicClient: PublicClient, contract: ContractType, + // Account that is the creator of the contract account: Address, ) { let contractAddress; @@ -188,6 +205,7 @@ async function getContractExists( contract.defaultAdmin || account, ], }); + try { await publicClient.readContract({ abi: zoraCreator1155ImplABI, @@ -208,6 +226,7 @@ async function getContractExists( }; } +// Create new 1155 token export async function createNew1155Token({ publicClient, contract, @@ -233,12 +252,15 @@ export async function createNew1155Token({ contractAddress: Address; }) => Hex[]; }) { + // Check if contract exists either from metadata or the static address passed in. + // If a static address is passed in, this fails if that contract does not exist. const { contractExists, contractAddress } = await getContractExists( publicClient, contract, account, ); + // Assume the next token id is the first token available for a new contract. let nextTokenId = 1n; if (contractExists) { @@ -249,6 +271,7 @@ export async function createNew1155Token({ }); } + // Get the fixed price minter to use within the new token to set the sales configuration. const fixedPriceMinterAddress = await publicClient.readContract({ abi: zoraCreator1155FactoryImplABI, address: zoraCreator1155FactoryImplAddress[999], @@ -287,7 +310,7 @@ export async function createNew1155Token({ { // deprecated royaltyMintSchedule: 0, - royaltyBPS: royaltySettings?.royaltyBPS || royaltyBPSDefault, + royaltyBPS: royaltySettings?.royaltyBPS || ROYALTY_BPS_DEFAULT, royaltyRecipient: royaltySettings?.royaltyRecipient || account, }, contract.defaultAdmin || account, diff --git a/packages/protocol-sdk/src/mint/mint-api-client.ts b/packages/protocol-sdk/src/mint/mint-api-client.ts index 627a8e1cb..3918ab3e2 100644 --- a/packages/protocol-sdk/src/mint/mint-api-client.ts +++ b/packages/protocol-sdk/src/mint/mint-api-client.ts @@ -1,10 +1,9 @@ import { retries, get, post } from "../apis/http-api-base"; import { paths } from "../apis/generated/discover-api-types"; -import { ZORA_API_BASE } from "../premint/premint-api-client"; -import { ZORA_SUBGRAPH_URLS } from "../constants"; +import { ZORA_API_BASE } from "../constants"; export type MintableGetToken = - paths["/mintables_v2/{chain_name}/{collection_address}"]; + paths["/mintables/{chain_name}/{collection_address}"]; type MintableGetTokenPathParameters = MintableGetToken["get"]["parameters"]["path"]; type MintableGetTokenGetQueryParameters = @@ -22,24 +21,23 @@ const getMintable = async ( ): Promise => retries(() => { return get( - `${ZORA_API_BASE}discover/mintables_v2/${path.chain_name}/${path.collection_address}${ - query?.token_id ? `?${encodeQueryParameters(query)}` : "" - }`, + `${ZORA_API_BASE}discover/mintables/${path.chain_name}/${ + path.collection_address + }${query?.token_id ? `?${encodeQueryParameters(query)}` : ""}`, ); - } - ); + }); export const getSalesConfigFixedPrice = async ({ contractAddress, tokenId, - chainId, + subgraphUrl, }: { contractAddress: string; tokenId: string; - chainId: number; + subgraphUrl: string; }): Promise => retries(async () => { - const response = await post(ZORA_SUBGRAPH_URLS[chainId]!, { + const response = await post(subgraphUrl, { query: "query($id: ID!) {\n zoraCreateToken(id: $id) {\n id\n salesStrategies{\n fixedPrice {\n address\n }\n }\n }\n}", variables: { id: `${contractAddress.toLowerCase()}-${tokenId}` }, diff --git a/packages/protocol-sdk/src/mint/mint-client.test.ts b/packages/protocol-sdk/src/mint/mint-client.test.ts index a75cb16c6..58c3b2514 100644 --- a/packages/protocol-sdk/src/mint/mint-client.test.ts +++ b/packages/protocol-sdk/src/mint/mint-client.test.ts @@ -1,7 +1,4 @@ -import { - parseAbi, - parseEther, -} from "viem"; +import { parseAbi, parseEther } from "viem"; import { zora } from "viem/chains"; import { describe, expect } from "vitest"; import { MintClient } from "./mint-client"; @@ -26,16 +23,19 @@ describe("mint-helper", () => { const targetTokenId = 1n; const minter = new MintClient(zora); - const { send } = await minter.mintToken({ - address: targetContract, - tokenId: targetTokenId, - publicClient, - sender: creatorAccount, - mintArguments: { - mintToAddress: creatorAccount, - quantityToMint: 1, - }, - }); + const { simulateContractParameters: params } = + await minter.makePrepareMintTokenParams({ + publicClient, + minterAccount: creatorAccount, + mintable: await minter.getMintable({ + tokenId: targetTokenId, + tokenContract: targetContract, + }), + mintArguments: { + mintToAddress: creatorAccount, + quantityToMint: 1, + }, + }); const oldBalance = await publicClient.readContract({ abi: zoraCreator1155ImplABI, @@ -43,7 +43,10 @@ describe("mint-helper", () => { functionName: "balanceOf", args: [creatorAccount, targetTokenId], }); - const hash = await send(walletClient); + + const simulationResult = await publicClient.simulateContract(params); + + const hash = await walletClient.writeContract(simulationResult.request); const receipt = await publicClient.waitForTransactionReceipt({ hash }); const newBalance = await publicClient.readContract({ abi: zoraCreator1155ImplABI, @@ -72,23 +75,30 @@ describe("mint-helper", () => { const targetTokenId = undefined; const minter = new MintClient(zora); - const { send } = await minter.mintToken({ - address: targetContract, - tokenId: targetTokenId, - publicClient, - sender: creatorAccount, - mintArguments: { - mintToAddress: creatorAccount, - quantityToMint: 1, - }, - }); + const { simulateContractParameters: prepared } = + await minter.makePrepareMintTokenParams({ + mintable: await minter.getMintable({ + tokenContract: targetContract, + tokenId: targetTokenId, + }), + publicClient, + minterAccount: creatorAccount, + mintArguments: { + mintToAddress: creatorAccount, + quantityToMint: 1, + }, + }); const oldBalance = await publicClient.readContract({ abi: erc721ABI, address: targetContract, functionName: "balanceOf", args: [creatorAccount], }); - const hash = await send(walletClient); + + const simulated = await publicClient.simulateContract(prepared); + + const hash = await walletClient.writeContract(simulated.request); + const receipt = await publicClient.getTransactionReceipt({ hash }); expect(receipt).not.to.be.null; diff --git a/packages/protocol-sdk/src/mint/mint-client.ts b/packages/protocol-sdk/src/mint/mint-client.ts index 0aba0159e..74ddcffe9 100644 --- a/packages/protocol-sdk/src/mint/mint-client.ts +++ b/packages/protocol-sdk/src/mint/mint-client.ts @@ -2,7 +2,6 @@ import { Address, Chain, PublicClient, - WalletClient, encodeAbiParameters, parseAbi, parseAbiParameters, @@ -10,6 +9,7 @@ import { } from "viem"; import { ClientBase } from "../apis/client-base"; import { MintAPIClient, MintableGetTokenResponse } from "./mint-api-client"; +import { SimulateContractParameters } from "viem"; import { zoraCreator1155ImplABI, zoraCreatorFixedPriceSaleStrategyAddress, @@ -54,78 +54,82 @@ export class MintClient extends ClientBase { this.apiClient = apiClient; } - async mintToken({ - publicClient, - sender, - address, + async getMintable({ + tokenContract, tokenId, - mintArguments, }: { - publicClient: PublicClient; - address: Address; - sender: Address; + tokenContract: Address; tokenId?: bigint | number | string; - mintArguments: MintArguments; }) { - if (tokenId) { - tokenId = BigInt(tokenId); - } - - const mintable = await this.apiClient.getMintable( + return this.apiClient.getMintable( { chain_name: this.network.zoraBackendChainName, - collection_address: address, + collection_address: tokenContract, }, { token_id: tokenId?.toString() }, ); + } - if (!mintable.feed_item.is_active) { + async makePrepareMintTokenParams({ + publicClient, + minterAccount, + mintable, + mintArguments, + }: { + publicClient: PublicClient; + mintable: MintableGetTokenResponse; + minterAccount: Address; + mintArguments: MintArguments; + }) { + if (!mintable) { + throw new MintError("No mintable found"); + } + + if (!mintable.is_active) { throw new MintInactiveError("Minting token is inactive"); } - if (!mintable.feed_item.mint_context) { + if (!mintable.mint_context) { throw new MintError("No minting context data from zora API"); } if ( !["zora_create", "zora_create_1155"].includes( - mintable.feed_item.mint_context?.mint_context_type!, + mintable.mint_context?.mint_context_type!, ) ) { throw new MintError( - `Mintable type ${mintable.feed_item.mint_context.mint_context_type} is currently unsupported.`, + `Mintable type ${mintable.mint_context.mint_context_type} is currently unsupported.`, ); } - if ( - mintable.feed_item.mint_context.mint_context_type === "zora_create_1155" - ) { + const thisPublicClient = this.getPublicClient(publicClient); + + if (mintable.mint_context.mint_context_type === "zora_create_1155") { return { - send: await this.mintZora1155({ - publicClient: this.getPublicClient(publicClient), + simulateContractParameters: await this.prepareMintZora1155({ + publicClient: thisPublicClient, mintArguments, - sender, + sender: minterAccount, mintable, }), - mintable, }; } - if (mintable.feed_item.mint_context.mint_context_type === "zora_create") { + if (mintable.mint_context.mint_context_type === "zora_create") { return { - send: await this.mintZora721({ - publicClient: this.getPublicClient(publicClient), + simulateContractParameters: await this.prepareMintZora721({ + publicClient: thisPublicClient, mintArguments, - sender, + sender: minterAccount, mintable, }), - mintable, }; } throw new Error("Mintable type not found or recognized."); } - private async mintZora1155({ + private async prepareMintZora1155({ mintable, sender, publicClient, @@ -133,7 +137,7 @@ export class MintClient extends ClientBase { }: MintParameters) { const mintQuantity = BigInt(mintArguments.quantityToMint); - const address = mintable.feed_item.collection.address as Address; + const address = mintable.collection.address as Address; const mintFee = await publicClient.readContract({ abi: zoraCreator1155ImplABI, @@ -143,39 +147,39 @@ export class MintClient extends ClientBase { const tokenFixedPriceMinter = await this.apiClient.getSalesConfigFixedPrice( { - contractAddress: mintable.feed_item.contract_address, - tokenId: mintable.feed_item.token_id!, - chainId: this.network.chainId, + contractAddress: mintable.contract_address, + tokenId: mintable.token_id!, + subgraphUrl: this.network.subgraphUrl, }, ); - return async (walletClient: WalletClient) => { - const { request } = await publicClient.simulateContract({ - abi: zoraCreator1155ImplABI, - functionName: "mintWithRewards", - account: sender, - value: - (mintFee + BigInt(mintable.feed_item.cost.native_price.raw)) * - mintQuantity, - address, - /* args: minter, tokenId, quantity, minterArguments, mintReferral */ - args: [ - (tokenFixedPriceMinter || - zoraCreatorFixedPriceSaleStrategyAddress[999]) as Address, - BigInt(mintable.feed_item.token_id!), - mintQuantity, - encodeAbiParameters(parseAbiParameters("address, string"), [ - mintArguments.mintToAddress, - mintArguments.mintComment || "", - ]), - mintArguments.mintReferral || zeroAddress, - ], - }); - return await walletClient.writeContract(request); + const result: SimulateContractParameters< + typeof zoraCreator1155ImplABI, + "mintWithRewards" + > = { + abi: zoraCreator1155ImplABI, + functionName: "mintWithRewards", + account: sender, + value: (mintFee + BigInt(mintable.cost.native_price.raw)) * mintQuantity, + address, + /* args: minter, tokenId, quantity, minterArguments, mintReferral */ + args: [ + (tokenFixedPriceMinter || + zoraCreatorFixedPriceSaleStrategyAddress[999]) as Address, + BigInt(mintable.token_id!), + mintQuantity, + encodeAbiParameters(parseAbiParameters("address, string"), [ + mintArguments.mintToAddress, + mintArguments.mintComment || "", + ]), + mintArguments.mintReferral || zeroAddress, + ], }; + + return result; } - private async mintZora721({ + private async prepareMintZora721({ mintable, publicClient, sender, @@ -183,30 +187,32 @@ export class MintClient extends ClientBase { }: MintParameters) { const [_, mintFee] = await publicClient.readContract({ abi: zora721Abi, - address: mintable.feed_item.contract_address as Address, + address: mintable.contract_address as Address, functionName: "zoraFeeForAmount", args: [BigInt(mintArguments.quantityToMint)], }); - return async (walletClient: WalletClient) => { - const { request } = await publicClient.simulateContract({ - abi: zora721Abi, - address: mintable.feed_item.contract_address as Address, - account: sender, - functionName: "mintWithRewards", - value: - mintFee + - BigInt(mintable.feed_item.cost.native_price.raw) * - BigInt(mintArguments.quantityToMint), - /* args: mint recipient, quantity to mint, mint comment, mintReferral */ - args: [ - mintArguments.mintToAddress, + const result: SimulateContractParameters< + typeof zora721Abi, + "mintWithRewards" + > = { + abi: zora721Abi, + address: mintable.contract_address as Address, + account: sender, + functionName: "mintWithRewards", + value: + mintFee + + BigInt(mintable.cost.native_price.raw) * BigInt(mintArguments.quantityToMint), - mintArguments.mintComment || "", - mintArguments.mintReferral || zeroAddress, - ], - }); - return await walletClient.writeContract(request); + /* args: mint recipient, quantity to mint, mint comment, mintReferral */ + args: [ + mintArguments.mintToAddress, + BigInt(mintArguments.quantityToMint), + mintArguments.mintComment || "", + mintArguments.mintReferral || zeroAddress, + ], }; + + return result; } } diff --git a/packages/protocol-sdk/src/premint/premint-client.test.ts b/packages/protocol-sdk/src/premint/premint-client.test.ts index 290e08d1f..7b119b368 100644 --- a/packages/protocol-sdk/src/premint/premint-client.test.ts +++ b/packages/protocol-sdk/src/premint/premint-client.test.ts @@ -1,8 +1,8 @@ import { foundry } from "viem/chains"; import { describe, expect, vi } from "vitest"; import { PremintClient } from "./premint-client"; -import { BackendChainNamesLookup } from "../apis/client-base"; import { anvilTest } from "src/anvil"; +import { BackendChainNamesLookup } from "src/apis/chain-constants"; describe("ZoraCreator1155Premint", () => { anvilTest( diff --git a/packages/protocol-sdk/src/premint/premint-client.ts b/packages/protocol-sdk/src/premint/premint-client.ts index 460bbe7f2..c708359a4 100644 --- a/packages/protocol-sdk/src/premint/premint-client.ts +++ b/packages/protocol-sdk/src/premint/premint-client.ts @@ -20,8 +20,9 @@ import type { } from "./premint-api-client"; import { PremintAPIClient } from "./premint-api-client"; import type { DecodeEventLogReturnType } from "viem"; -import { ClientBase, REWARD_PER_TOKEN } from "../apis/client-base"; +import { ClientBase } from "../apis/client-base"; import { OPEN_EDITION_MINT_SIZE } from "../constants"; +import { REWARD_PER_TOKEN } from "src/apis/chain-constants"; type MintArgumentsSettings = { tokenURI: string; diff --git a/packages/protocol-sdk/src/premint/preminter.ts b/packages/protocol-sdk/src/premint/preminter.ts index dd9a93b0a..35e83161d 100644 --- a/packages/protocol-sdk/src/premint/preminter.ts +++ b/packages/protocol-sdk/src/premint/preminter.ts @@ -68,7 +68,5 @@ export const preminterTypedDataDefinition = ({ primaryType: "CreatorAttribution", }; - // console.log({ result, deleted }); - return result; };