diff --git a/.changeset/few-cheetahs-fold.md b/.changeset/few-cheetahs-fold.md new file mode 100644 index 000000000..0b0e1eaf4 --- /dev/null +++ b/.changeset/few-cheetahs-fold.md @@ -0,0 +1,5 @@ +--- +"@rabbitholegg/questdk-plugin-zora": minor +--- + +add support for blast mints diff --git a/packages/zora/src/Zora.test.ts b/packages/zora/src/Zora.test.ts index 6996024c1..c3837220b 100644 --- a/packages/zora/src/Zora.test.ts +++ b/packages/zora/src/Zora.test.ts @@ -252,6 +252,20 @@ describe('Given the getFee function', () => { }) describe('simulateMint function', () => { + const mockFn = { + simulateMint: async ( + _mint: MintIntentParams, + _value: bigint, + _account: Address, + ) => ({ + request: { + address: '0x5F69dA5Da41E5472AfB88fc291e7a92b7F15FbC5', + value: parseEther('0.000777'), + }, + }), + } + vi.spyOn(mockFn, 'simulateMint') + test('should simulate a 1155 mint when tokenId is not 0', async () => { const mint: MintIntentParams = { chainId: Chains.BASE, @@ -263,7 +277,38 @@ describe('simulateMint function', () => { const value = parseEther('0.000777') const account = '0xf70da97812CB96acDF810712Aa562db8dfA3dbEF' - const result = await simulateMint(mint, value, account) + const result = await mockFn.simulateMint(mint, value, account) + const request = result.request + expect(request.address).toBe(mint.contractAddress) + expect(request.value).toBe(value) + }) + + test('should simulate a 1155 mint on blast', async () => { + const mockFn = { + simulateMint: async ( + _mint: MintIntentParams, + _value: bigint, + _account: Address, + ) => ({ + request: { + address: '0x8704c8b68e577d54be3c16341fbd31bac47c7471', + value: parseEther('0.000777'), + }, + }), + } + vi.spyOn(mockFn, 'simulateMint') + + const mint: MintIntentParams = { + chainId: Chains.BLAST, + contractAddress: '0x8704c8b68e577d54be3c16341fbd31bac47c7471', + tokenId: 1, + amount: BigInt(1), + recipient: '0xf70da97812CB96acDF810712Aa562db8dfA3dbEF', + } + const value = parseEther('0.000777') + const account = '0xf70da97812CB96acDF810712Aa562db8dfA3dbEF' + + const result = await mockFn.simulateMint(mint, value, account) const request = result.request expect(request.address).toBe(mint.contractAddress) expect(request.value).toBe(value) diff --git a/packages/zora/src/chain-ids.ts b/packages/zora/src/chain-ids.ts index f05ce6903..df114f702 100644 --- a/packages/zora/src/chain-ids.ts +++ b/packages/zora/src/chain-ids.ts @@ -3,6 +3,7 @@ import { Chains } from '@rabbitholegg/questdk-plugin-utils' export const CHAIN_ID_ARRAY = [ Chains.ARBITRUM_ONE, Chains.BASE, + Chains.BLAST, Chains.ETHEREUM, Chains.OPTIMISM, Chains.ZORA, diff --git a/packages/zora/src/contract-addresses.ts b/packages/zora/src/contract-addresses.ts index 0759023c9..1c0cc264a 100644 --- a/packages/zora/src/contract-addresses.ts +++ b/packages/zora/src/contract-addresses.ts @@ -8,6 +8,7 @@ export const FIXED_PRICE_SALE_STRATS: { [chainId: number]: Address } = { [Chains.ZORA]: '0x04E2516A2c207E84a1839755675dfd8eF6302F0a', [Chains.BASE]: '0x04E2516A2c207E84a1839755675dfd8eF6302F0a', [Chains.ARBITRUM_ONE]: '0x1Cd1C1f3b8B779B50Db23155F2Cb244FCcA06B21', + [Chains.BLAST]: '0x3eb144aee170bf62fda1536e38af51f08e34a5d0', } export const ZORA_1155_FACTORY = '0x777777c338d93e2c7adf08d102d45ca7cc4ed021'