@medialane/sdk 0.62.0 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/evm/index.cjs +3 -3
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.d.cts +1 -1
- package/dist/evm/index.d.ts +1 -1
- package/dist/evm/index.js +3 -3
- package/dist/evm/index.js.map +1 -1
- package/dist/{index-CsiUiS0q.d.ts → index-7_t9LEnt.d.ts} +25 -14
- package/dist/{index-CyZH_h8o.d.cts → index-C94WNlgk.d.cts} +25 -14
- package/dist/index.cjs +417 -327
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +418 -328
- package/dist/index.js.map +1 -1
- package/dist/solana/index.cjs +3 -3
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +1 -1
- package/dist/solana/index.d.ts +1 -1
- package/dist/solana/index.js +3 -3
- package/dist/solana/index.js.map +1 -1
- package/dist/starknet/index.cjs +436 -354
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +3 -3
- package/dist/starknet/index.d.ts +3 -3
- package/dist/starknet/index.js +437 -355
- package/dist/starknet/index.js.map +1 -1
- package/dist/stellar/index.cjs +3 -3
- package/dist/stellar/index.cjs.map +1 -1
- package/dist/stellar/index.d.cts +1 -1
- package/dist/stellar/index.d.ts +1 -1
- package/dist/stellar/index.js +3 -3
- package/dist/stellar/index.js.map +1 -1
- package/dist/{types-V6imkXvR.d.cts → types-Bx3ax9lW.d.cts} +20 -3
- package/dist/{types-V6imkXvR.d.ts → types-Bx3ax9lW.d.ts} +20 -3
- package/package.json +3 -3
package/dist/evm/index.cjs
CHANGED
|
@@ -69,9 +69,9 @@ var COORDINATES = {
|
|
|
69
69
|
creatorCoinFactoryClassHash: "0x51765926b1344c9a20b8cd4b5abe7b7d47375ae97cf6804db3ea5d4b05a9b55",
|
|
70
70
|
creatorCoinStartBlock: 10474544,
|
|
71
71
|
ekuboCore: "0x00000005dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b",
|
|
72
|
-
ipTicketsFactory: "
|
|
73
|
-
ipTicketCollectionClassHash: "
|
|
74
|
-
ipTicketsStartBlock:
|
|
72
|
+
ipTicketsFactory: "0x03ffef4162fe2c44e17d6be2aad3553cab0ac2274cd0b1bb3fafb12fd66695c1",
|
|
73
|
+
ipTicketCollectionClassHash: "0x036393fb4241ed55bd12d8b328ed877d08100fadf9150a650e2b84cbab95e1d4",
|
|
74
|
+
ipTicketsStartBlock: 11689800,
|
|
75
75
|
ipClubRegistry: "0x00e189c619b6bb07d78973a149641c59c37eb0716f8584d7520bce12d303eede",
|
|
76
76
|
ipClubNftClassHash: "0x02bc9b20cca21b04245e9215bf7121f4d7295b195890e449b472b573017fb889",
|
|
77
77
|
ipClubStartBlock: 11404776,
|
package/dist/evm/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/evm/typedData.ts","../../src/chains.ts","../../src/evm/abis.ts","../../src/evm/venue.ts","../../src/evm/issuance.ts"],"names":["hashTypedData","parseAbi","maybeCoords","parseEventLogs"],"mappings":";;;;;AASO,IAAM,eAAA,GAAkB;AAAA,EAC7B,SAAA,EAAW;AAAA,IACT,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,OAAA,EAAQ;AAAA,IAClC,EAAE,IAAA,EAAM,OAAA,EAAS,IAAA,EAAM,SAAA,EAAU;AAAA,IACjC,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,SAAA,EAAU;AAAA,IACtC,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,SAAA;AAAU,GACpC;AAAA,EACA,iBAAA,EAAmB;AAAA,IACjB,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,OAAA,EAAQ;AAAA,IAClC,EAAE,IAAA,EAAM,OAAA,EAAS,IAAA,EA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A,CAAQ;AAAA,KACf,CAAA;AACD,IAAA,OAAO,EAAE,QAAQ,OAAA,EAAA,CAAU,MAAA,EAAQ,KAAK,OAAA,IAAW,EAAA,EAAI,UAAS,EAAE;AAAA,EACpE;AAAA,EAEA,MAAM,SAAA,CACJ,MAAA,EACA,MAAA,EAC0B;AAC1B,IAAA,MAAM,UAAU,MAAA,CAAO,OAAA;AACvB,IAAA,IAAI,CAAC,OAAA,EAAS,MAAM,IAAI,MAAM,6BAA6B,CAAA;AAC3D,IAAA,MAAM,MAAA,GAAS,MAAM,MAAA,CAAO,aAAA,CAAc;AAAA,MACxC,OAAA;AAAA,MACA,OAAO,MAAA,CAAO,KAAA;AAAA,MACd,SAAS,MAAA,CAAO,UAAA;AAAA,MAChB,GAAA,EAAK,mBAAA;AAAA,MACL,YAAA,EAAc,WAAA;AAAA,MACd,IAAA,EAAM,CAAC,MAAA,CAAO,UAAA,EAA+B,OAAO,SAAS;AAAA,KAC9D,CAAA;AACD,IAAA,OAAO,EAAE,MAAA,EAAO;AAAA,EAClB;AACF;AAEA,SAASD,aAAY,KAAA,EAA6C;AAChE,EAAA,IAAI;AACF,IAAA,OAAO,eAAe,KAAK,CAAA;AAAA,EAC7B,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,MAAA;AAAA,EACT;AACF","file":"index.cjs","sourcesContent":["import { hashTypedData, type TypedDataDomain } from \"viem\";\n\n/**\n * EIP-712 order typing for the Medialane EVM venues — byte-identical to the\n * audited Solidity (contracts/EVM-Marketplace-ERC721/src/Medialane721.sol and\n * the 1155 venue, which shares the type strings; the domain's\n * verifyingContract separates deployments and venues).\n */\n\nexport const EVM_ORDER_TYPES = {\n OfferItem: [\n { name: \"itemType\", type: \"uint8\" },\n { name: \"token\", type: \"address\" },\n { name: \"identifier\", type: \"uint256\" },\n { name: \"amount\", type: \"uint256\" },\n ],\n ConsiderationItem: [\n { name: \"itemType\", type: \"uint8\" },\n { name: \"token\", type: \"address\" },\n { name: \"identifier\", type: \"uint256\" },\n { name: \"amount\", type: \"uint256\" },\n { name: \"recipient\", type: \"address\" },\n ],\n OrderParameters: [\n { name: \"offerer\", type: \"address\" },\n { name: \"offer\", type: \"OfferItem\" },\n { name: \"consideration\", type: \"ConsiderationItem\" },\n { name: \"royaltyMaxBps\", type: \"uint256\" },\n { name: \"startTime\", type: \"uint256\" },\n { name: \"endTime\", type: \"uint256\" },\n { name: \"salt\", type: \"uint256\" },\n { name: \"counter\", type: \"uint256\" },\n ],\n} as const;\n\n/** NATIVE=0, ERC20=1, ERC721=2 on the 721 venue; NATIVE=0, ERC20=1, ERC1155=2 on the 1155 venue. */\nexport type EvmItemType = 0 | 1 | 2;\n\nexport interface EvmOfferItem {\n itemType: EvmItemType;\n token: `0x${string}`;\n identifier: bigint;\n amount: bigint;\n}\n\nexport interface EvmConsiderationItem extends EvmOfferItem {\n recipient: `0x${string}`;\n}\n\nexport interface EvmOrderParameters {\n offerer: `0x${string}`;\n offer: EvmOfferItem;\n consideration: EvmConsiderationItem;\n royaltyMaxBps: bigint;\n startTime: bigint;\n endTime: bigint;\n salt: bigint;\n counter: bigint;\n}\n\nexport function evmOrderDomain(chainId: number, verifyingContract: `0x${string}`): TypedDataDomain {\n return { name: \"Medialane\", version: \"1\", chainId, verifyingContract };\n}\n\n/** The order's EIP-712 digest — the venue's order hash and the platform's\n * canonical order id on EVM chains. */\nexport function evmOrderDigest(\n chainId: number,\n verifyingContract: `0x${string}`,\n parameters: EvmOrderParameters,\n): `0x${string}` {\n return hashTypedData({\n domain: evmOrderDomain(chainId, verifyingContract),\n types: EVM_ORDER_TYPES,\n primaryType: \"OrderParameters\",\n message: parameters,\n });\n}\n","// Single source of per-chain coordinates for Medialane's own services\n// (spec 2026-06-13 §3.1, Decision A). Keyed by CHAIN ALONE — Medialane is\n// mainnet-only, so there is no network axis (refines decisions.md D-9).\n\n/** Mirrors the backend Prisma `Chain` enum. */\nexport const CHAINS = [\"STARKNET\", \"ETHEREUM\", \"SOLANA\", \"BASE\", \"STELLAR\", \"BITCOIN\"] as const;\nexport type Chain = (typeof CHAINS)[number];\n\n/** Starknet coordinates of Medialane services + venues. All fields optional\n * because not every service exists on every chain. */\nexport interface StarknetCoordinates {\n rpcUrl: string;\n marketplace721?: `0x${string}`;\n marketplace721ClassHash?: `0x${string}`;\n marketplace721StartBlock?: number;\n marketplace1155?: `0x${string}`;\n marketplace1155ClassHash?: `0x${string}`;\n marketplace1155StartBlock?: number;\n collection721?: `0x${string}`;\n collection721StartBlock?: number;\n ipNftClassHash?: `0x${string}`;\n ipCollectionClassHash?: `0x${string}`;\n collection1155?: `0x${string}`;\n collection1155FactoryClassHash?: `0x${string}`;\n collection1155ClassHash?: `0x${string}`;\n collection1155StartBlock?: number;\n popFactory?: `0x${string}`;\n popCollectionClassHash?: `0x${string}`;\n dropFactory?: `0x${string}`;\n dropCollectionClassHash?: `0x${string}`;\n nftComments?: `0x${string}`;\n creatorCoinFactory?: `0x${string}`;\n creatorCoinEkuboLauncher?: `0x${string}`;\n creatorCoinClassHash?: `0x${string}`;\n creatorCoinFactoryClassHash?: `0x${string}`;\n creatorCoinStartBlock?: number;\n ekuboCore?: `0x${string}`;\n ipTicketsFactory?: `0x${string}`;\n ipTicketCollectionClassHash?: `0x${string}`;\n ipTicketsStartBlock?: number;\n ipClubRegistry?: `0x${string}`;\n ipClubNftClassHash?: `0x${string}`;\n ipClubStartBlock?: number;\n ipClubFactory?: `0x${string}`;\n ipClubFactoryClassHash?: `0x${string}`;\n ipClubCollectionClassHash?: `0x${string}`;\n ipClubFactoryStartBlock?: number;\n ipSponsorship?: `0x${string}`;\n ipSponsorshipStartBlock?: number;\n ipSponsorshipLicense?: `0x${string}`;\n}\n\n/** Coordinates per chain. Only STARKNET is populated today; adding a chain\n * means adding an entry here (litmus test, spec §7). */\n/** EVM coordinates — one shape for Ethereum and Base (same bytecode, two\n * chains). Populated at deploy time (federation Phase 4). */\nexport interface EvmCoordinates {\n rpcUrl: string;\n marketplace721?: `0x${string}`;\n marketplace721StartBlock?: number;\n marketplace1155?: `0x${string}`;\n marketplace1155StartBlock?: number;\n mipRegistry?: `0x${string}`;\n mipRegistryStartBlock?: number;\n mipEditionsRegistry?: `0x${string}`;\n mipEditionsRegistryStartBlock?: number;\n}\n\n/** Solana coordinates — base58 program ids. Populated at deploy time. */\nexport interface SolanaCoordinates {\n rpcUrl: string;\n mipCollectionsProgram?: string;\n marketplaceProgram?: string;\n startSlot?: number;\n}\n\n/** Stellar (Soroban) coordinates — strkey contract ids. Populated at deploy\n * time; the registry takes the collection WASM hash as a constructor arg. */\nexport interface StellarCoordinates {\n rpcUrl: string;\n mipRegistry?: string;\n marketplace?: string;\n collectionWasmHash?: string;\n startLedger?: number;\n}\n\n/** Per-chain coordinate shapes. Every chain is an equal entry — no chain is\n * privileged in core (chain-sovereignty I2/I4). */\nexport interface CoordinatesByChain {\n STARKNET?: StarknetCoordinates;\n ETHEREUM?: EvmCoordinates;\n BASE?: EvmCoordinates;\n SOLANA?: SolanaCoordinates;\n STELLAR?: StellarCoordinates;\n BITCOIN?: never;\n}\n\n/** @deprecated Renamed — use `StarknetCoordinates` (coordinates are per-chain-shaped). */\nexport type ChainCoordinates = StarknetCoordinates;\n\nconst COORDINATES: CoordinatesByChain = {\n STARKNET: {\n rpcUrl: \"https://rpc.starknet.lava.build\",\n marketplace721: \"0x03eda9a2b6ad90845a43591bac8083ebaf677d51fdf20f503b2c01889e3131fc\",\n marketplace721ClassHash: \"0x0700d9230d07e5203e27778c0dc70f9134d2b25bf319f7cf8348dc66a6923e90\",\n marketplace721StartBlock: 11198146,\n marketplace1155: \"0x07c4ce1c19ea48cc11135ed22b19ff745f5aec508c3828593002e4f76fdb1b38\",\n marketplace1155ClassHash: \"0x0242f5c388da7cee2d99e2a69453c8159bf927fbec4e797a3cfdcbbcb5b68328\",\n marketplace1155StartBlock: 11198267,\n collection721: \"0x0225c3ae09506b8d97adc39649ca740dad5aac195b7f5f0441cc1852947acaea\",\n collection721StartBlock: 11198496,\n ipNftClassHash: \"0x012d3ae40ba35c7e2be0946532dac60e48932447912fdf96b674da67c029b9cc\",\n ipCollectionClassHash: \"0x022155a1a130a40e57aac4b89c07fab3f616bc351b1270fc40f756b963afe8b4\",\n collection1155: \"0x015368976d46fae5bfa1c58600f641d5aa5dbbf53ebc6b78aa3922194aad3551\",\n collection1155FactoryClassHash: \"0x04eb6b419770f13bd191f120b9fc9ee624c0613ad4490062d293ca2016b3b1d2\",\n collection1155ClassHash: \"0x06cf3f5a2322dac35e07a6064a5b8802f19fda8aa3f4726f0cb7bc05dea1bd78\",\n collection1155StartBlock: 11199527,\n popFactory: \"0x00b32c34b427d8f346b5843ada6a37bd3368d879fc752cd52b68a87287f60111\",\n popCollectionClassHash: \"0x077c421686f10851872561953ea16898d933364b7f8937a5d7e2b1ba0a36263f\",\n dropFactory: \"0x03587f42e29daee1b193f6cf83bf8627908ed6632d0d83fcb26225c50547d800\",\n dropCollectionClassHash: \"0x00092e72cdb63067521e803aaf7d4101c3e3ce026ae6bc045ec4228027e58282\",\n nftComments: \"0x02cdac70c94447189af0389dfea63f4d5e4154ea8a563de288a5ab1c39e37843\",\n creatorCoinFactory: \"0x50fa807b5274079fb19374673d7bab6d2dc3af7e1032ea43eb6e44bcbde4c3c\",\n creatorCoinEkuboLauncher: \"0x4f7fceb5ac10f12f9544a09580592e5bdf1b7f04f48765eecf12286d8ccb7b4\",\n creatorCoinClassHash: \"0x743e4c8a5b96bb83bbf4af04edbbb482d5ece89eed9b729a79fb7df0cd0b6b6\",\n creatorCoinFactoryClassHash: \"0x51765926b1344c9a20b8cd4b5abe7b7d47375ae97cf6804db3ea5d4b05a9b55\",\n creatorCoinStartBlock: 10474544,\n ekuboCore: \"0x00000005dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b\",\n ipTicketsFactory: \"0x0664c2d6a4da9ee3ff053ceeba7579c01f2fedfd9d2b57b4c07af3734bd4acab\",\n ipTicketCollectionClassHash: \"0x086f59c416e365e2bee4ceff9f1dcb96198f2342d50ba4621f60b831863adb6\",\n ipTicketsStartBlock: 11404656,\n ipClubRegistry: \"0x00e189c619b6bb07d78973a149641c59c37eb0716f8584d7520bce12d303eede\",\n ipClubNftClassHash: \"0x02bc9b20cca21b04245e9215bf7121f4d7295b195890e449b472b573017fb889\",\n ipClubStartBlock: 11404776,\n ipClubFactory: \"0x010726346c264d1832a7303afaf5692dbd2b05446fecc6da30d958d0227c36d0\",\n ipClubFactoryClassHash: \"0x07197062578375d962b2d42d3e91560770b11b1c97a9defb74c706a2c5299473\",\n ipClubCollectionClassHash: \"0x049dc5e5ff00e67d5d457c6991ee70822f36a979b76cefd1b617aeccd7051d4b\",\n ipClubFactoryStartBlock: 11652766,\n ipSponsorship: \"0x044d9b9c3bb29b94685b0a3fe27a5e2dfa30a3637ab55979c718ebcd3268bc2f\",\n ipSponsorshipStartBlock: 11405085,\n // Dedicated ip-erc721/MIP instance for sponsorship receipts (class hash\n // 0x01bd7e39c5135b32b664e34cbbb4eafbd707a0fbc3ec2ef28657f52577d277d7) —\n // never the genesis-mint instance.\n ipSponsorshipLicense: \"0x06bcfc4e97758a2abf95af4bd49596efdbfd88ccd740caddc56ad0a4bd095839\",\n },\n};\n\nexport function getCoordinates(chain: \"STARKNET\"): StarknetCoordinates;\nexport function getCoordinates(chain: \"ETHEREUM\" | \"BASE\"): EvmCoordinates;\nexport function getCoordinates(chain: \"SOLANA\"): SolanaCoordinates;\nexport function getCoordinates(chain: \"STELLAR\"): StellarCoordinates;\nexport function getCoordinates(\n chain: Chain,\n): StarknetCoordinates | EvmCoordinates | SolanaCoordinates | StellarCoordinates;\nexport function getCoordinates(\n chain: Chain,\n): StarknetCoordinates | EvmCoordinates | SolanaCoordinates | StellarCoordinates {\n const c = COORDINATES[chain];\n if (!c) throw new Error(`No coordinates configured for chain \"${chain}\"`);\n return c;\n}\n\nexport const DEFAULT_CHAIN: Chain = \"STARKNET\";\n\n/** Typed Starknet coordinates for Starknet-only modules; throws when the\n * client is scoped to another chain. */\nexport function getStarknetCoordinates(chain: Chain): StarknetCoordinates {\n if (chain !== \"STARKNET\") {\n throw new Error(`This module is Starknet-only (client chain: \"${chain}\")`);\n }\n return getCoordinates(\"STARKNET\");\n}\n","import { parseAbi } from \"viem\";\n\n/** Minimal venue ABI — verified against Medialane721.sol / Medialane1155.sol.\n * The 1155 venue's fulfillOrder additionally takes a quantity. */\nexport const EvmVenueABI = parseAbi([\n \"struct OfferItem { uint8 itemType; address token; uint256 identifier; uint256 amount; }\",\n \"struct ConsiderationItem { uint8 itemType; address token; uint256 identifier; uint256 amount; address recipient; }\",\n \"struct OrderParameters { address offerer; OfferItem offer; ConsiderationItem consideration; uint256 royaltyMaxBps; uint256 startTime; uint256 endTime; uint256 salt; uint256 counter; }\",\n \"function registerOrder(OrderParameters parameters, bytes signature)\",\n \"function fulfillOrder(bytes32 orderHash) payable\",\n \"function cancelOrder(bytes32 orderHash)\",\n \"function incrementCounter()\",\n \"function getOrderHash(OrderParameters parameters) view returns (bytes32)\",\n \"function getCounter(address offerer) view returns (uint256)\",\n \"function version() pure returns (string)\",\n \"event OrderCreated(bytes32 indexed orderHash, address indexed offerer)\",\n \"event OrderFulfilled(bytes32 indexed orderHash, address indexed offerer, address indexed fulfiller, uint256 saleAmount, address royaltyReceiver, uint256 royaltyAmount)\",\n \"event OrderCancelled(bytes32 indexed orderHash, address indexed offerer)\",\n \"event CounterIncremented(address indexed offerer, uint256 newCounter)\",\n]);\n\nexport const EvmVenue1155ABI = parseAbi([\n \"function fulfillOrder(bytes32 orderHash, uint256 quantity) payable\",\n \"event OrderFulfilled(bytes32 indexed orderHash, address indexed offerer, address indexed fulfiller, uint256 quantity, uint256 remainingAmount, uint256 saleAmount, address royaltyReceiver, uint256 royaltyAmount)\",\n]);\n\n/** MIP issuance — verified against MIPRegistry.sol / MIPCollection.sol (and\n * the editions pair, which shares the registry surface). */\nexport const EvmMipRegistryABI = parseAbi([\n \"function createCollection(string name, string symbol, string baseUri, uint96 royaltyBps) returns (uint256 collectionId, address collection)\",\n \"function getCollection(uint256 collectionId) view returns (address collection, address creator)\",\n \"function collectionCount() view returns (uint256)\",\n \"event CollectionCreated(uint256 indexed collectionId, address indexed collection, address indexed creator, string name, string symbol, string baseUri)\",\n]);\n\nexport const EvmMipCollectionABI = parseAbi([\n \"function mint(address to, string metadataUri) returns (uint256 tokenId)\",\n \"function batchMint(address[] to, string[] metadataUris) returns (uint256[] tokenIds)\",\n \"function tokenURI(uint256 tokenId) view returns (string)\",\n \"function ownerOf(uint256 tokenId) view returns (address)\",\n \"function balanceOf(address owner) view returns (uint256)\",\n \"function owner() view returns (address)\",\n \"event TokenMinted(uint256 indexed tokenId, address indexed owner, string metadataUri)\",\n \"event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)\",\n]);\n","import type { PublicClient, WalletClient } from \"viem\";\nimport type { Chain } from \"../chains.js\";\nimport { getCoordinates, type EvmCoordinates } from \"../chains.js\";\nimport type {\n AdapterTxResult,\n OrderRef,\n RegisterOrderParams,\n VenueAdapter,\n} from \"../adapters/types.js\";\nimport { EvmVenueABI, EvmVenue1155ABI } from \"./abis.js\";\nimport {\n EVM_ORDER_TYPES,\n evmOrderDigest,\n evmOrderDomain,\n type EvmOrderParameters,\n} from \"./typedData.js\";\n\nexport type EvmChain = \"ETHEREUM\" | \"BASE\";\n\nexport interface EvmVenueOptions {\n chain: EvmChain;\n chainId: number;\n publicClient: PublicClient;\n /** \"721\" (unique assets) or \"1155\" (partial fills). */\n variant: \"721\" | \"1155\";\n /** Defaults to the chain registry's venue address (populated at deploy). */\n contract?: `0x${string}`;\n}\n\n/** The Medialane venue adapter for EVM chains — one implementation serves\n * Ethereum and Base (same bytecode; the EIP-712 domain separates them). */\nexport class EvmVenue implements VenueAdapter<WalletClient> {\n readonly chain: Chain;\n private readonly chainId: number;\n private readonly contract: `0x${string}`;\n private readonly publicClient: PublicClient;\n private readonly variant: \"721\" | \"1155\";\n\n constructor(opts: EvmVenueOptions) {\n this.chain = opts.chain;\n this.chainId = opts.chainId;\n this.publicClient = opts.publicClient;\n this.variant = opts.variant;\n const coords = maybeCoords(opts.chain);\n const contract =\n opts.contract ?? (opts.variant === \"721\" ? coords?.marketplace721 : coords?.marketplace1155);\n if (!contract) throw new Error(`No ${opts.variant} venue configured for ${opts.chain}`);\n this.contract = contract;\n }\n\n /** Builds the order struct, signs the EIP-712 digest, and registers it.\n * The digest is the canonical order id on EVM chains. */\n async registerOrder(\n signer: WalletClient,\n params: RegisterOrderParams,\n ): Promise<AdapterTxResult & { orderRef: OrderRef }> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const counter = await this.getCounter(account.address);\n const nft = {\n itemType: 2 as const,\n token: params.asset.contract as `0x${string}`,\n identifier: BigInt(params.asset.tokenId),\n amount: 1n,\n };\n const payment = {\n itemType: (params.paymentToken === NATIVE_SENTINEL ? 0 : 1) as 0 | 1,\n token: (params.paymentToken === NATIVE_SENTINEL\n ? \"0x0000000000000000000000000000000000000000\"\n : params.paymentToken) as `0x${string}`,\n identifier: 0n,\n amount: BigInt(params.amount),\n };\n const order: EvmOrderParameters =\n params.side === \"listing\"\n ? {\n offerer: account.address,\n offer: nft,\n consideration: { ...payment, recipient: account.address },\n ...commonFields(params),\n }\n : {\n offerer: account.address,\n offer: payment,\n consideration: { ...nft, recipient: account.address },\n ...commonFields(params),\n };\n order.counter = counter;\n\n const signature = await signer.signTypedData({\n account,\n domain: evmOrderDomain(this.chainId, this.contract),\n types: EVM_ORDER_TYPES,\n primaryType: \"OrderParameters\",\n message: order,\n });\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"registerOrder\",\n args: [order, signature],\n });\n return { txHash, orderRef: evmOrderDigest(this.chainId, this.contract, order) };\n }\n\n async fulfillOrder(\n signer: WalletClient,\n orderRef: OrderRef,\n opts?: { quantity?: string; value?: string },\n ): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const value = opts?.value ? BigInt(opts.value) : undefined;\n const txHash =\n this.variant === \"1155\"\n ? await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenue1155ABI,\n functionName: \"fulfillOrder\",\n args: [orderRef as `0x${string}`, BigInt(opts?.quantity ?? \"1\")],\n value,\n })\n : await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"fulfillOrder\",\n args: [orderRef as `0x${string}`],\n value,\n });\n return { txHash };\n }\n\n async cancelOrder(signer: WalletClient, orderRef: OrderRef): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"cancelOrder\",\n args: [orderRef as `0x${string}`],\n });\n return { txHash };\n }\n\n async incrementCounter(signer: WalletClient): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"incrementCounter\",\n args: [],\n });\n return { txHash };\n }\n\n async getOrderDetails(orderRef: OrderRef): Promise<unknown> {\n return this.publicClient.readContract({\n address: this.contract,\n abi: [\n {\n type: \"function\",\n name: \"getOrderDetails\",\n stateMutability: \"view\",\n inputs: [{ name: \"orderHash\", type: \"bytes32\" }],\n outputs: [{ name: \"\", type: \"bytes\" }],\n },\n ] as const,\n functionName: \"getOrderDetails\",\n args: [orderRef as `0x${string}`],\n });\n }\n\n async getCounter(address: string): Promise<bigint> {\n return this.publicClient.readContract({\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"getCounter\",\n args: [address as `0x${string}`],\n });\n }\n}\n\n/** Payment-token sentinel for native ETH (spec §3.2b currency encoding). */\nexport const NATIVE_SENTINEL = \"native\";\n\nfunction commonFields(params: RegisterOrderParams) {\n return {\n royaltyMaxBps: BigInt(params.royaltyMaxBps),\n startTime: BigInt(params.startTime),\n endTime: BigInt(params.endTime),\n salt: BigInt(params.salt),\n counter: 0n,\n };\n}\n\nfunction maybeCoords(chain: EvmChain): EvmCoordinates | undefined {\n try {\n return getCoordinates(chain);\n } catch {\n return undefined;\n }\n}\n","import type { PublicClient, WalletClient } from \"viem\";\nimport { parseEventLogs } from \"viem\";\nimport type { Chain } from \"../chains.js\";\nimport { getCoordinates, type EvmCoordinates } from \"../chains.js\";\nimport type { AdapterTxResult, CreateCollectionInput, IssuanceAdapter, MintInput } from \"../adapters/types.js\";\nimport { EvmMipCollectionABI, EvmMipRegistryABI } from \"./abis.js\";\nimport type { EvmChain } from \"./venue.js\";\n\nexport interface EvmIssuanceOptions {\n chain: EvmChain;\n publicClient: PublicClient;\n /** Defaults to the chain registry's MIP registry (populated at deploy). */\n registry?: `0x${string}`;\n}\n\n/** The Mediolano issuance adapter for EVM chains. */\nexport class EvmIssuance implements IssuanceAdapter<WalletClient> {\n readonly chain: Chain;\n private readonly registry: `0x${string}`;\n private readonly publicClient: PublicClient;\n\n constructor(opts: EvmIssuanceOptions) {\n this.chain = opts.chain;\n this.publicClient = opts.publicClient;\n const registry = opts.registry ?? maybeCoords(opts.chain)?.mipRegistry;\n if (!registry) throw new Error(`No MIP registry configured for ${opts.chain}`);\n this.registry = registry;\n }\n\n async createCollection(\n signer: WalletClient,\n params: CreateCollectionInput,\n ): Promise<AdapterTxResult & { collection: string }> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.registry,\n abi: EvmMipRegistryABI,\n functionName: \"createCollection\",\n args: [params.name, params.symbol, params.baseUri, BigInt(params.royaltyBps)],\n });\n const receipt = await this.publicClient.waitForTransactionReceipt({ hash: txHash });\n const [created] = parseEventLogs({\n abi: EvmMipRegistryABI,\n eventName: \"CollectionCreated\",\n logs: receipt.logs,\n });\n return { txHash, collection: created?.args.collection ?? \"\" };\n }\n\n async mint(signer: WalletClient, params: MintInput): Promise<AdapterTxResult & { tokenId: string }> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: params.collection as `0x${string}`,\n abi: EvmMipCollectionABI,\n functionName: \"mint\",\n args: [params.recipient as `0x${string}`, params.tokenUri],\n });\n const receipt = await this.publicClient.waitForTransactionReceipt({ hash: txHash });\n const [minted] = parseEventLogs({\n abi: EvmMipCollectionABI,\n eventName: \"TokenMinted\",\n logs: receipt.logs,\n });\n return { txHash, tokenId: (minted?.args.tokenId ?? 0n).toString() };\n }\n\n async batchMint(\n signer: WalletClient,\n params: { collection: string; recipients: string[]; tokenUris: string[] },\n ): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: params.collection as `0x${string}`,\n abi: EvmMipCollectionABI,\n functionName: \"batchMint\",\n args: [params.recipients as `0x${string}`[], params.tokenUris],\n });\n return { txHash };\n }\n}\n\nfunction maybeCoords(chain: EvmChain): EvmCoordinates | undefined {\n try {\n return getCoordinates(chain);\n } catch {\n return undefined;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/evm/typedData.ts","../../src/chains.ts","../../src/evm/abis.ts","../../src/evm/venue.ts","../../src/evm/issuance.ts"],"names":["hashTypedData","parseAbi","maybeCoords","parseEventLogs"],"mappings":";;;;;AASO,IAAM,eAAA,GAAkB;AAAA,EAC7B,SAAA,EAAW;AAAA,IACT,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,OAAA,EAAQ;AAAA,IAClC,EAAE,IAAA,EAAM,OAAA,EAAS,IAAA,EAAM,SAAA,EAAU;AAAA,IACjC,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,SAAA,EAAU;AAAA,IACtC,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,SAAA;A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M,QAAQ,CAAA;AAClF,IAAA,MAAM,CAAC,MAAM,CAAA,GAAIA,mBAAA,CAAe;AAAA,MAC9B,GAAA,EAAK,mBAAA;AAAA,MACL,SAAA,EAAW,aAAA;AAAA,MACX,MAAM,OAAA,CAAQ;AAAA,KACf,CAAA;AACD,IAAA,OAAO,EAAE,QAAQ,OAAA,EAAA,CAAU,MAAA,EAAQ,KAAK,OAAA,IAAW,EAAA,EAAI,UAAS,EAAE;AAAA,EACpE;AAAA,EAEA,MAAM,SAAA,CACJ,MAAA,EACA,MAAA,EAC0B;AAC1B,IAAA,MAAM,UAAU,MAAA,CAAO,OAAA;AACvB,IAAA,IAAI,CAAC,OAAA,EAAS,MAAM,IAAI,MAAM,6BAA6B,CAAA;AAC3D,IAAA,MAAM,MAAA,GAAS,MAAM,MAAA,CAAO,aAAA,CAAc;AAAA,MACxC,OAAA;AAAA,MACA,OAAO,MAAA,CAAO,KAAA;AAAA,MACd,SAAS,MAAA,CAAO,UAAA;AAAA,MAChB,GAAA,EAAK,mBAAA;AAAA,MACL,YAAA,EAAc,WAAA;AAAA,MACd,IAAA,EAAM,CAAC,MAAA,CAAO,UAAA,EAA+B,OAAO,SAAS;AAAA,KAC9D,CAAA;AACD,IAAA,OAAO,EAAE,MAAA,EAAO;AAAA,EAClB;AACF;AAEA,SAASD,aAAY,KAAA,EAA6C;AAChE,EAAA,IAAI;AACF,IAAA,OAAO,eAAe,KAAK,CAAA;AAAA,EAC7B,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,MAAA;AAAA,EACT;AACF","file":"index.cjs","sourcesContent":["import { hashTypedData, type TypedDataDomain } from \"viem\";\n\n/**\n * EIP-712 order typing for the Medialane EVM venues — byte-identical to the\n * audited Solidity (contracts/EVM-Marketplace-ERC721/src/Medialane721.sol and\n * the 1155 venue, which shares the type strings; the domain's\n * verifyingContract separates deployments and venues).\n */\n\nexport const EVM_ORDER_TYPES = {\n OfferItem: [\n { name: \"itemType\", type: \"uint8\" },\n { name: \"token\", type: \"address\" },\n { name: \"identifier\", type: \"uint256\" },\n { name: \"amount\", type: \"uint256\" },\n ],\n ConsiderationItem: [\n { name: \"itemType\", type: \"uint8\" },\n { name: \"token\", type: \"address\" },\n { name: \"identifier\", type: \"uint256\" },\n { name: \"amount\", type: \"uint256\" },\n { name: \"recipient\", type: \"address\" },\n ],\n OrderParameters: [\n { name: \"offerer\", type: \"address\" },\n { name: \"offer\", type: \"OfferItem\" },\n { name: \"consideration\", type: \"ConsiderationItem\" },\n { name: \"royaltyMaxBps\", type: \"uint256\" },\n { name: \"startTime\", type: \"uint256\" },\n { name: \"endTime\", type: \"uint256\" },\n { name: \"salt\", type: \"uint256\" },\n { name: \"counter\", type: \"uint256\" },\n ],\n} as const;\n\n/** NATIVE=0, ERC20=1, ERC721=2 on the 721 venue; NATIVE=0, ERC20=1, ERC1155=2 on the 1155 venue. */\nexport type EvmItemType = 0 | 1 | 2;\n\nexport interface EvmOfferItem {\n itemType: EvmItemType;\n token: `0x${string}`;\n identifier: bigint;\n amount: bigint;\n}\n\nexport interface EvmConsiderationItem extends EvmOfferItem {\n recipient: `0x${string}`;\n}\n\nexport interface EvmOrderParameters {\n offerer: `0x${string}`;\n offer: EvmOfferItem;\n consideration: EvmConsiderationItem;\n royaltyMaxBps: bigint;\n startTime: bigint;\n endTime: bigint;\n salt: bigint;\n counter: bigint;\n}\n\nexport function evmOrderDomain(chainId: number, verifyingContract: `0x${string}`): TypedDataDomain {\n return { name: \"Medialane\", version: \"1\", chainId, verifyingContract };\n}\n\n/** The order's EIP-712 digest — the venue's order hash and the platform's\n * canonical order id on EVM chains. */\nexport function evmOrderDigest(\n chainId: number,\n verifyingContract: `0x${string}`,\n parameters: EvmOrderParameters,\n): `0x${string}` {\n return hashTypedData({\n domain: evmOrderDomain(chainId, verifyingContract),\n types: EVM_ORDER_TYPES,\n primaryType: \"OrderParameters\",\n message: parameters,\n });\n}\n","// Single source of per-chain coordinates for Medialane's own services\n// (spec 2026-06-13 §3.1, Decision A). Keyed by CHAIN ALONE — Medialane is\n// mainnet-only, so there is no network axis (refines decisions.md D-9).\n\n/** Mirrors the backend Prisma `Chain` enum. */\nexport const CHAINS = [\"STARKNET\", \"ETHEREUM\", \"SOLANA\", \"BASE\", \"STELLAR\", \"BITCOIN\"] as const;\nexport type Chain = (typeof CHAINS)[number];\n\n/** Starknet coordinates of Medialane services + venues. All fields optional\n * because not every service exists on every chain. */\nexport interface StarknetCoordinates {\n rpcUrl: string;\n marketplace721?: `0x${string}`;\n marketplace721ClassHash?: `0x${string}`;\n marketplace721StartBlock?: number;\n marketplace1155?: `0x${string}`;\n marketplace1155ClassHash?: `0x${string}`;\n marketplace1155StartBlock?: number;\n collection721?: `0x${string}`;\n collection721StartBlock?: number;\n ipNftClassHash?: `0x${string}`;\n ipCollectionClassHash?: `0x${string}`;\n collection1155?: `0x${string}`;\n collection1155FactoryClassHash?: `0x${string}`;\n collection1155ClassHash?: `0x${string}`;\n collection1155StartBlock?: number;\n popFactory?: `0x${string}`;\n popCollectionClassHash?: `0x${string}`;\n dropFactory?: `0x${string}`;\n dropCollectionClassHash?: `0x${string}`;\n nftComments?: `0x${string}`;\n creatorCoinFactory?: `0x${string}`;\n creatorCoinEkuboLauncher?: `0x${string}`;\n creatorCoinClassHash?: `0x${string}`;\n creatorCoinFactoryClassHash?: `0x${string}`;\n creatorCoinStartBlock?: number;\n ekuboCore?: `0x${string}`;\n ipTicketsFactory?: `0x${string}`;\n ipTicketCollectionClassHash?: `0x${string}`;\n ipTicketsStartBlock?: number;\n ipClubRegistry?: `0x${string}`;\n ipClubNftClassHash?: `0x${string}`;\n ipClubStartBlock?: number;\n ipClubFactory?: `0x${string}`;\n ipClubFactoryClassHash?: `0x${string}`;\n ipClubCollectionClassHash?: `0x${string}`;\n ipClubFactoryStartBlock?: number;\n ipSponsorship?: `0x${string}`;\n ipSponsorshipStartBlock?: number;\n ipSponsorshipLicense?: `0x${string}`;\n}\n\n/** Coordinates per chain. Only STARKNET is populated today; adding a chain\n * means adding an entry here (litmus test, spec §7). */\n/** EVM coordinates — one shape for Ethereum and Base (same bytecode, two\n * chains). Populated at deploy time (federation Phase 4). */\nexport interface EvmCoordinates {\n rpcUrl: string;\n marketplace721?: `0x${string}`;\n marketplace721StartBlock?: number;\n marketplace1155?: `0x${string}`;\n marketplace1155StartBlock?: number;\n mipRegistry?: `0x${string}`;\n mipRegistryStartBlock?: number;\n mipEditionsRegistry?: `0x${string}`;\n mipEditionsRegistryStartBlock?: number;\n}\n\n/** Solana coordinates — base58 program ids. Populated at deploy time. */\nexport interface SolanaCoordinates {\n rpcUrl: string;\n mipCollectionsProgram?: string;\n marketplaceProgram?: string;\n startSlot?: number;\n}\n\n/** Stellar (Soroban) coordinates — strkey contract ids. Populated at deploy\n * time; the registry takes the collection WASM hash as a constructor arg. */\nexport interface StellarCoordinates {\n rpcUrl: string;\n mipRegistry?: string;\n marketplace?: string;\n collectionWasmHash?: string;\n startLedger?: number;\n}\n\n/** Per-chain coordinate shapes. Every chain is an equal entry — no chain is\n * privileged in core (chain-sovereignty I2/I4). */\nexport interface CoordinatesByChain {\n STARKNET?: StarknetCoordinates;\n ETHEREUM?: EvmCoordinates;\n BASE?: EvmCoordinates;\n SOLANA?: SolanaCoordinates;\n STELLAR?: StellarCoordinates;\n BITCOIN?: never;\n}\n\n/** @deprecated Renamed — use `StarknetCoordinates` (coordinates are per-chain-shaped). */\nexport type ChainCoordinates = StarknetCoordinates;\n\nconst COORDINATES: CoordinatesByChain = {\n STARKNET: {\n rpcUrl: \"https://rpc.starknet.lava.build\",\n marketplace721: \"0x03eda9a2b6ad90845a43591bac8083ebaf677d51fdf20f503b2c01889e3131fc\",\n marketplace721ClassHash: \"0x0700d9230d07e5203e27778c0dc70f9134d2b25bf319f7cf8348dc66a6923e90\",\n marketplace721StartBlock: 11198146,\n marketplace1155: \"0x07c4ce1c19ea48cc11135ed22b19ff745f5aec508c3828593002e4f76fdb1b38\",\n marketplace1155ClassHash: \"0x0242f5c388da7cee2d99e2a69453c8159bf927fbec4e797a3cfdcbbcb5b68328\",\n marketplace1155StartBlock: 11198267,\n collection721: \"0x0225c3ae09506b8d97adc39649ca740dad5aac195b7f5f0441cc1852947acaea\",\n collection721StartBlock: 11198496,\n ipNftClassHash: \"0x012d3ae40ba35c7e2be0946532dac60e48932447912fdf96b674da67c029b9cc\",\n ipCollectionClassHash: \"0x022155a1a130a40e57aac4b89c07fab3f616bc351b1270fc40f756b963afe8b4\",\n collection1155: \"0x015368976d46fae5bfa1c58600f641d5aa5dbbf53ebc6b78aa3922194aad3551\",\n collection1155FactoryClassHash: \"0x04eb6b419770f13bd191f120b9fc9ee624c0613ad4490062d293ca2016b3b1d2\",\n collection1155ClassHash: \"0x06cf3f5a2322dac35e07a6064a5b8802f19fda8aa3f4726f0cb7bc05dea1bd78\",\n collection1155StartBlock: 11199527,\n popFactory: \"0x00b32c34b427d8f346b5843ada6a37bd3368d879fc752cd52b68a87287f60111\",\n popCollectionClassHash: \"0x077c421686f10851872561953ea16898d933364b7f8937a5d7e2b1ba0a36263f\",\n dropFactory: \"0x03587f42e29daee1b193f6cf83bf8627908ed6632d0d83fcb26225c50547d800\",\n dropCollectionClassHash: \"0x00092e72cdb63067521e803aaf7d4101c3e3ce026ae6bc045ec4228027e58282\",\n nftComments: \"0x02cdac70c94447189af0389dfea63f4d5e4154ea8a563de288a5ab1c39e37843\",\n creatorCoinFactory: \"0x50fa807b5274079fb19374673d7bab6d2dc3af7e1032ea43eb6e44bcbde4c3c\",\n creatorCoinEkuboLauncher: \"0x4f7fceb5ac10f12f9544a09580592e5bdf1b7f04f48765eecf12286d8ccb7b4\",\n creatorCoinClassHash: \"0x743e4c8a5b96bb83bbf4af04edbbb482d5ece89eed9b729a79fb7df0cd0b6b6\",\n creatorCoinFactoryClassHash: \"0x51765926b1344c9a20b8cd4b5abe7b7d47375ae97cf6804db3ea5d4b05a9b55\",\n creatorCoinStartBlock: 10474544,\n ekuboCore: \"0x00000005dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b\",\n ipTicketsFactory: \"0x03ffef4162fe2c44e17d6be2aad3553cab0ac2274cd0b1bb3fafb12fd66695c1\",\n ipTicketCollectionClassHash: \"0x036393fb4241ed55bd12d8b328ed877d08100fadf9150a650e2b84cbab95e1d4\",\n ipTicketsStartBlock: 11689800,\n ipClubRegistry: \"0x00e189c619b6bb07d78973a149641c59c37eb0716f8584d7520bce12d303eede\",\n ipClubNftClassHash: \"0x02bc9b20cca21b04245e9215bf7121f4d7295b195890e449b472b573017fb889\",\n ipClubStartBlock: 11404776,\n ipClubFactory: \"0x010726346c264d1832a7303afaf5692dbd2b05446fecc6da30d958d0227c36d0\",\n ipClubFactoryClassHash: \"0x07197062578375d962b2d42d3e91560770b11b1c97a9defb74c706a2c5299473\",\n ipClubCollectionClassHash: \"0x049dc5e5ff00e67d5d457c6991ee70822f36a979b76cefd1b617aeccd7051d4b\",\n ipClubFactoryStartBlock: 11652766,\n ipSponsorship: \"0x044d9b9c3bb29b94685b0a3fe27a5e2dfa30a3637ab55979c718ebcd3268bc2f\",\n ipSponsorshipStartBlock: 11405085,\n // Dedicated ip-erc721/MIP instance for sponsorship receipts (class hash\n // 0x01bd7e39c5135b32b664e34cbbb4eafbd707a0fbc3ec2ef28657f52577d277d7) —\n // never the genesis-mint instance.\n ipSponsorshipLicense: \"0x06bcfc4e97758a2abf95af4bd49596efdbfd88ccd740caddc56ad0a4bd095839\",\n },\n};\n\nexport function getCoordinates(chain: \"STARKNET\"): StarknetCoordinates;\nexport function getCoordinates(chain: \"ETHEREUM\" | \"BASE\"): EvmCoordinates;\nexport function getCoordinates(chain: \"SOLANA\"): SolanaCoordinates;\nexport function getCoordinates(chain: \"STELLAR\"): StellarCoordinates;\nexport function getCoordinates(\n chain: Chain,\n): StarknetCoordinates | EvmCoordinates | SolanaCoordinates | StellarCoordinates;\nexport function getCoordinates(\n chain: Chain,\n): StarknetCoordinates | EvmCoordinates | SolanaCoordinates | StellarCoordinates {\n const c = COORDINATES[chain];\n if (!c) throw new Error(`No coordinates configured for chain \"${chain}\"`);\n return c;\n}\n\nexport const DEFAULT_CHAIN: Chain = \"STARKNET\";\n\n/** Typed Starknet coordinates for Starknet-only modules; throws when the\n * client is scoped to another chain. */\nexport function getStarknetCoordinates(chain: Chain): StarknetCoordinates {\n if (chain !== \"STARKNET\") {\n throw new Error(`This module is Starknet-only (client chain: \"${chain}\")`);\n }\n return getCoordinates(\"STARKNET\");\n}\n","import { parseAbi } from \"viem\";\n\n/** Minimal venue ABI — verified against Medialane721.sol / Medialane1155.sol.\n * The 1155 venue's fulfillOrder additionally takes a quantity. */\nexport const EvmVenueABI = parseAbi([\n \"struct OfferItem { uint8 itemType; address token; uint256 identifier; uint256 amount; }\",\n \"struct ConsiderationItem { uint8 itemType; address token; uint256 identifier; uint256 amount; address recipient; }\",\n \"struct OrderParameters { address offerer; OfferItem offer; ConsiderationItem consideration; uint256 royaltyMaxBps; uint256 startTime; uint256 endTime; uint256 salt; uint256 counter; }\",\n \"function registerOrder(OrderParameters parameters, bytes signature)\",\n \"function fulfillOrder(bytes32 orderHash) payable\",\n \"function cancelOrder(bytes32 orderHash)\",\n \"function incrementCounter()\",\n \"function getOrderHash(OrderParameters parameters) view returns (bytes32)\",\n \"function getCounter(address offerer) view returns (uint256)\",\n \"function version() pure returns (string)\",\n \"event OrderCreated(bytes32 indexed orderHash, address indexed offerer)\",\n \"event OrderFulfilled(bytes32 indexed orderHash, address indexed offerer, address indexed fulfiller, uint256 saleAmount, address royaltyReceiver, uint256 royaltyAmount)\",\n \"event OrderCancelled(bytes32 indexed orderHash, address indexed offerer)\",\n \"event CounterIncremented(address indexed offerer, uint256 newCounter)\",\n]);\n\nexport const EvmVenue1155ABI = parseAbi([\n \"function fulfillOrder(bytes32 orderHash, uint256 quantity) payable\",\n \"event OrderFulfilled(bytes32 indexed orderHash, address indexed offerer, address indexed fulfiller, uint256 quantity, uint256 remainingAmount, uint256 saleAmount, address royaltyReceiver, uint256 royaltyAmount)\",\n]);\n\n/** MIP issuance — verified against MIPRegistry.sol / MIPCollection.sol (and\n * the editions pair, which shares the registry surface). */\nexport const EvmMipRegistryABI = parseAbi([\n \"function createCollection(string name, string symbol, string baseUri, uint96 royaltyBps) returns (uint256 collectionId, address collection)\",\n \"function getCollection(uint256 collectionId) view returns (address collection, address creator)\",\n \"function collectionCount() view returns (uint256)\",\n \"event CollectionCreated(uint256 indexed collectionId, address indexed collection, address indexed creator, string name, string symbol, string baseUri)\",\n]);\n\nexport const EvmMipCollectionABI = parseAbi([\n \"function mint(address to, string metadataUri) returns (uint256 tokenId)\",\n \"function batchMint(address[] to, string[] metadataUris) returns (uint256[] tokenIds)\",\n \"function tokenURI(uint256 tokenId) view returns (string)\",\n \"function ownerOf(uint256 tokenId) view returns (address)\",\n \"function balanceOf(address owner) view returns (uint256)\",\n \"function owner() view returns (address)\",\n \"event TokenMinted(uint256 indexed tokenId, address indexed owner, string metadataUri)\",\n \"event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)\",\n]);\n","import type { PublicClient, WalletClient } from \"viem\";\nimport type { Chain } from \"../chains.js\";\nimport { getCoordinates, type EvmCoordinates } from \"../chains.js\";\nimport type {\n AdapterTxResult,\n OrderRef,\n RegisterOrderParams,\n VenueAdapter,\n} from \"../adapters/types.js\";\nimport { EvmVenueABI, EvmVenue1155ABI } from \"./abis.js\";\nimport {\n EVM_ORDER_TYPES,\n evmOrderDigest,\n evmOrderDomain,\n type EvmOrderParameters,\n} from \"./typedData.js\";\n\nexport type EvmChain = \"ETHEREUM\" | \"BASE\";\n\nexport interface EvmVenueOptions {\n chain: EvmChain;\n chainId: number;\n publicClient: PublicClient;\n /** \"721\" (unique assets) or \"1155\" (partial fills). */\n variant: \"721\" | \"1155\";\n /** Defaults to the chain registry's venue address (populated at deploy). */\n contract?: `0x${string}`;\n}\n\n/** The Medialane venue adapter for EVM chains — one implementation serves\n * Ethereum and Base (same bytecode; the EIP-712 domain separates them). */\nexport class EvmVenue implements VenueAdapter<WalletClient> {\n readonly chain: Chain;\n private readonly chainId: number;\n private readonly contract: `0x${string}`;\n private readonly publicClient: PublicClient;\n private readonly variant: \"721\" | \"1155\";\n\n constructor(opts: EvmVenueOptions) {\n this.chain = opts.chain;\n this.chainId = opts.chainId;\n this.publicClient = opts.publicClient;\n this.variant = opts.variant;\n const coords = maybeCoords(opts.chain);\n const contract =\n opts.contract ?? (opts.variant === \"721\" ? coords?.marketplace721 : coords?.marketplace1155);\n if (!contract) throw new Error(`No ${opts.variant} venue configured for ${opts.chain}`);\n this.contract = contract;\n }\n\n /** Builds the order struct, signs the EIP-712 digest, and registers it.\n * The digest is the canonical order id on EVM chains. */\n async registerOrder(\n signer: WalletClient,\n params: RegisterOrderParams,\n ): Promise<AdapterTxResult & { orderRef: OrderRef }> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const counter = await this.getCounter(account.address);\n const nft = {\n itemType: 2 as const,\n token: params.asset.contract as `0x${string}`,\n identifier: BigInt(params.asset.tokenId),\n amount: 1n,\n };\n const payment = {\n itemType: (params.paymentToken === NATIVE_SENTINEL ? 0 : 1) as 0 | 1,\n token: (params.paymentToken === NATIVE_SENTINEL\n ? \"0x0000000000000000000000000000000000000000\"\n : params.paymentToken) as `0x${string}`,\n identifier: 0n,\n amount: BigInt(params.amount),\n };\n const order: EvmOrderParameters =\n params.side === \"listing\"\n ? {\n offerer: account.address,\n offer: nft,\n consideration: { ...payment, recipient: account.address },\n ...commonFields(params),\n }\n : {\n offerer: account.address,\n offer: payment,\n consideration: { ...nft, recipient: account.address },\n ...commonFields(params),\n };\n order.counter = counter;\n\n const signature = await signer.signTypedData({\n account,\n domain: evmOrderDomain(this.chainId, this.contract),\n types: EVM_ORDER_TYPES,\n primaryType: \"OrderParameters\",\n message: order,\n });\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"registerOrder\",\n args: [order, signature],\n });\n return { txHash, orderRef: evmOrderDigest(this.chainId, this.contract, order) };\n }\n\n async fulfillOrder(\n signer: WalletClient,\n orderRef: OrderRef,\n opts?: { quantity?: string; value?: string },\n ): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const value = opts?.value ? BigInt(opts.value) : undefined;\n const txHash =\n this.variant === \"1155\"\n ? await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenue1155ABI,\n functionName: \"fulfillOrder\",\n args: [orderRef as `0x${string}`, BigInt(opts?.quantity ?? \"1\")],\n value,\n })\n : await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"fulfillOrder\",\n args: [orderRef as `0x${string}`],\n value,\n });\n return { txHash };\n }\n\n async cancelOrder(signer: WalletClient, orderRef: OrderRef): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"cancelOrder\",\n args: [orderRef as `0x${string}`],\n });\n return { txHash };\n }\n\n async incrementCounter(signer: WalletClient): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"incrementCounter\",\n args: [],\n });\n return { txHash };\n }\n\n async getOrderDetails(orderRef: OrderRef): Promise<unknown> {\n return this.publicClient.readContract({\n address: this.contract,\n abi: [\n {\n type: \"function\",\n name: \"getOrderDetails\",\n stateMutability: \"view\",\n inputs: [{ name: \"orderHash\", type: \"bytes32\" }],\n outputs: [{ name: \"\", type: \"bytes\" }],\n },\n ] as const,\n functionName: \"getOrderDetails\",\n args: [orderRef as `0x${string}`],\n });\n }\n\n async getCounter(address: string): Promise<bigint> {\n return this.publicClient.readContract({\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"getCounter\",\n args: [address as `0x${string}`],\n });\n }\n}\n\n/** Payment-token sentinel for native ETH (spec §3.2b currency encoding). */\nexport const NATIVE_SENTINEL = \"native\";\n\nfunction commonFields(params: RegisterOrderParams) {\n return {\n royaltyMaxBps: BigInt(params.royaltyMaxBps),\n startTime: BigInt(params.startTime),\n endTime: BigInt(params.endTime),\n salt: BigInt(params.salt),\n counter: 0n,\n };\n}\n\nfunction maybeCoords(chain: EvmChain): EvmCoordinates | undefined {\n try {\n return getCoordinates(chain);\n } catch {\n return undefined;\n }\n}\n","import type { PublicClient, WalletClient } from \"viem\";\nimport { parseEventLogs } from \"viem\";\nimport type { Chain } from \"../chains.js\";\nimport { getCoordinates, type EvmCoordinates } from \"../chains.js\";\nimport type { AdapterTxResult, CreateCollectionInput, IssuanceAdapter, MintInput } from \"../adapters/types.js\";\nimport { EvmMipCollectionABI, EvmMipRegistryABI } from \"./abis.js\";\nimport type { EvmChain } from \"./venue.js\";\n\nexport interface EvmIssuanceOptions {\n chain: EvmChain;\n publicClient: PublicClient;\n /** Defaults to the chain registry's MIP registry (populated at deploy). */\n registry?: `0x${string}`;\n}\n\n/** The Mediolano issuance adapter for EVM chains. */\nexport class EvmIssuance implements IssuanceAdapter<WalletClient> {\n readonly chain: Chain;\n private readonly registry: `0x${string}`;\n private readonly publicClient: PublicClient;\n\n constructor(opts: EvmIssuanceOptions) {\n this.chain = opts.chain;\n this.publicClient = opts.publicClient;\n const registry = opts.registry ?? maybeCoords(opts.chain)?.mipRegistry;\n if (!registry) throw new Error(`No MIP registry configured for ${opts.chain}`);\n this.registry = registry;\n }\n\n async createCollection(\n signer: WalletClient,\n params: CreateCollectionInput,\n ): Promise<AdapterTxResult & { collection: string }> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.registry,\n abi: EvmMipRegistryABI,\n functionName: \"createCollection\",\n args: [params.name, params.symbol, params.baseUri, BigInt(params.royaltyBps)],\n });\n const receipt = await this.publicClient.waitForTransactionReceipt({ hash: txHash });\n const [created] = parseEventLogs({\n abi: EvmMipRegistryABI,\n eventName: \"CollectionCreated\",\n logs: receipt.logs,\n });\n return { txHash, collection: created?.args.collection ?? \"\" };\n }\n\n async mint(signer: WalletClient, params: MintInput): Promise<AdapterTxResult & { tokenId: string }> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: params.collection as `0x${string}`,\n abi: EvmMipCollectionABI,\n functionName: \"mint\",\n args: [params.recipient as `0x${string}`, params.tokenUri],\n });\n const receipt = await this.publicClient.waitForTransactionReceipt({ hash: txHash });\n const [minted] = parseEventLogs({\n abi: EvmMipCollectionABI,\n eventName: \"TokenMinted\",\n logs: receipt.logs,\n });\n return { txHash, tokenId: (minted?.args.tokenId ?? 0n).toString() };\n }\n\n async batchMint(\n signer: WalletClient,\n params: { collection: string; recipients: string[]; tokenUris: string[] },\n ): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: params.collection as `0x${string}`,\n abi: EvmMipCollectionABI,\n functionName: \"batchMint\",\n args: [params.recipients as `0x${string}`[], params.tokenUris],\n });\n return { txHash };\n }\n}\n\nfunction maybeCoords(chain: EvmChain): EvmCoordinates | undefined {\n try {\n return getCoordinates(chain);\n } catch {\n return undefined;\n }\n}\n"]}
|
package/dist/evm/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypedDataDomain, WalletClient, PublicClient } from 'viem';
|
|
2
|
-
import { V as VenueAdapter, C as Chain, R as RegisterOrderParams, A as AdapterTxResult, O as OrderRef, I as IssuanceAdapter,
|
|
2
|
+
import { V as VenueAdapter, C as Chain, R as RegisterOrderParams, A as AdapterTxResult, O as OrderRef, I as IssuanceAdapter, e as CreateCollectionInput, M as MintInput } from '../types-Bx3ax9lW.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* EIP-712 order typing for the Medialane EVM venues — byte-identical to the
|
package/dist/evm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypedDataDomain, WalletClient, PublicClient } from 'viem';
|
|
2
|
-
import { V as VenueAdapter, C as Chain, R as RegisterOrderParams, A as AdapterTxResult, O as OrderRef, I as IssuanceAdapter,
|
|
2
|
+
import { V as VenueAdapter, C as Chain, R as RegisterOrderParams, A as AdapterTxResult, O as OrderRef, I as IssuanceAdapter, e as CreateCollectionInput, M as MintInput } from '../types-Bx3ax9lW.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* EIP-712 order typing for the Medialane EVM venues — byte-identical to the
|
package/dist/evm/index.js
CHANGED
|
@@ -67,9 +67,9 @@ var COORDINATES = {
|
|
|
67
67
|
creatorCoinFactoryClassHash: "0x51765926b1344c9a20b8cd4b5abe7b7d47375ae97cf6804db3ea5d4b05a9b55",
|
|
68
68
|
creatorCoinStartBlock: 10474544,
|
|
69
69
|
ekuboCore: "0x00000005dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b",
|
|
70
|
-
ipTicketsFactory: "
|
|
71
|
-
ipTicketCollectionClassHash: "
|
|
72
|
-
ipTicketsStartBlock:
|
|
70
|
+
ipTicketsFactory: "0x03ffef4162fe2c44e17d6be2aad3553cab0ac2274cd0b1bb3fafb12fd66695c1",
|
|
71
|
+
ipTicketCollectionClassHash: "0x036393fb4241ed55bd12d8b328ed877d08100fadf9150a650e2b84cbab95e1d4",
|
|
72
|
+
ipTicketsStartBlock: 11689800,
|
|
73
73
|
ipClubRegistry: "0x00e189c619b6bb07d78973a149641c59c37eb0716f8584d7520bce12d303eede",
|
|
74
74
|
ipClubNftClassHash: "0x02bc9b20cca21b04245e9215bf7121f4d7295b195890e449b472b573017fb889",
|
|
75
75
|
ipClubStartBlock: 11404776,
|
package/dist/evm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/evm/typedData.ts","../../src/chains.ts","../../src/evm/abis.ts","../../src/evm/venue.ts","../../src/evm/issuance.ts"],"names":["maybeCoords"],"mappings":";;;AASO,IAAM,eAAA,GAAkB;AAAA,EAC7B,SAAA,EAAW;AAAA,IACT,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,OAAA,EAAQ;AAAA,IAClC,EAAE,IAAA,EAAM,OAAA,EAAS,IAAA,EAAM,SAAA,EAAU;AAAA,IACjC,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,SAAA,EAAU;AAAA,IACtC,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,SAAA;AAAU,GACpC;AAAA,EACA,iBAAA,EAAmB;AAAA,IACjB,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,OAAA,EAAQ;AAAA,IAClC,EAAE,IAAA,EAAM,OAAA,EAAS,IAAA,EAAM,SAAA,EAAU;AAAA,IACjC,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,SAAA,EAAU;AAAA,IACtC,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,SAAA,EAAU;AAAA,IAClC,EAAE,IAAA,EAAM,WAAA,EAAa,IAAA,EAAM,SAAA;AAAU,GACvC;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,EAAE,IAAA,EAAM,SAAA,EAAW,IAAA,EAAM,SAAA,EAAU;AAAA,IACnC,EAAE,IAAA,EAAM,OAAA,EAAS,IAAA,EAAM,WAAA,EAAY;AAAA,IACnC,EAAE,IAAA,EAAM,eAAA,EAAiB,IAAA,EAAM,mBAAA,EAAoB;AAAA,IACnD,EAAE,IAAA,EAAM,eAAA,EAAiB,IAAA,EAAM,SAAA,EAAU;AAAA,IACzC,EAAE,IAAA,EAAM,WAAA,EAAa,IAAA,EAAM,SAAA,EAAU;AAAA,IACrC,EAAE,IAAA,EAAM,SAAA,EAAW,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AAO;AAAA,EAClB;AACF;AAEA,SAASA,aAAY,KAAA,EAA6C;AAChE,EAAA,IAAI;AACF,IAAA,OAAO,eAAe,KAAK,CAAA;AAAA,EAC7B,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,MAAA;AAAA,EACT;AACF","file":"index.js","sourcesContent":["import { hashTypedData, type TypedDataDomain } from \"viem\";\n\n/**\n * EIP-712 order typing for the Medialane EVM venues — byte-identical to the\n * audited Solidity (contracts/EVM-Marketplace-ERC721/src/Medialane721.sol and\n * the 1155 venue, which shares the type strings; the domain's\n * verifyingContract separates deployments and venues).\n */\n\nexport const EVM_ORDER_TYPES = {\n OfferItem: [\n { name: \"itemType\", type: \"uint8\" },\n { name: \"token\", type: \"address\" },\n { name: \"identifier\", type: \"uint256\" },\n { name: \"amount\", type: \"uint256\" },\n ],\n ConsiderationItem: [\n { name: \"itemType\", type: \"uint8\" },\n { name: \"token\", type: \"address\" },\n { name: \"identifier\", type: \"uint256\" },\n { name: \"amount\", type: \"uint256\" },\n { name: \"recipient\", type: \"address\" },\n ],\n OrderParameters: [\n { name: \"offerer\", type: \"address\" },\n { name: \"offer\", type: \"OfferItem\" },\n { name: \"consideration\", type: \"ConsiderationItem\" },\n { name: \"royaltyMaxBps\", type: \"uint256\" },\n { name: \"startTime\", type: \"uint256\" },\n { name: \"endTime\", type: \"uint256\" },\n { name: \"salt\", type: \"uint256\" },\n { name: \"counter\", type: \"uint256\" },\n ],\n} as const;\n\n/** NATIVE=0, ERC20=1, ERC721=2 on the 721 venue; NATIVE=0, ERC20=1, ERC1155=2 on the 1155 venue. */\nexport type EvmItemType = 0 | 1 | 2;\n\nexport interface EvmOfferItem {\n itemType: EvmItemType;\n token: `0x${string}`;\n identifier: bigint;\n amount: bigint;\n}\n\nexport interface EvmConsiderationItem extends EvmOfferItem {\n recipient: `0x${string}`;\n}\n\nexport interface EvmOrderParameters {\n offerer: `0x${string}`;\n offer: EvmOfferItem;\n consideration: EvmConsiderationItem;\n royaltyMaxBps: bigint;\n startTime: bigint;\n endTime: bigint;\n salt: bigint;\n counter: bigint;\n}\n\nexport function evmOrderDomain(chainId: number, verifyingContract: `0x${string}`): TypedDataDomain {\n return { name: \"Medialane\", version: \"1\", chainId, verifyingContract };\n}\n\n/** The order's EIP-712 digest — the venue's order hash and the platform's\n * canonical order id on EVM chains. */\nexport function evmOrderDigest(\n chainId: number,\n verifyingContract: `0x${string}`,\n parameters: EvmOrderParameters,\n): `0x${string}` {\n return hashTypedData({\n domain: evmOrderDomain(chainId, verifyingContract),\n types: EVM_ORDER_TYPES,\n primaryType: \"OrderParameters\",\n message: parameters,\n });\n}\n","// Single source of per-chain coordinates for Medialane's own services\n// (spec 2026-06-13 §3.1, Decision A). Keyed by CHAIN ALONE — Medialane is\n// mainnet-only, so there is no network axis (refines decisions.md D-9).\n\n/** Mirrors the backend Prisma `Chain` enum. */\nexport const CHAINS = [\"STARKNET\", \"ETHEREUM\", \"SOLANA\", \"BASE\", \"STELLAR\", \"BITCOIN\"] as const;\nexport type Chain = (typeof CHAINS)[number];\n\n/** Starknet coordinates of Medialane services + venues. All fields optional\n * because not every service exists on every chain. */\nexport interface StarknetCoordinates {\n rpcUrl: string;\n marketplace721?: `0x${string}`;\n marketplace721ClassHash?: `0x${string}`;\n marketplace721StartBlock?: number;\n marketplace1155?: `0x${string}`;\n marketplace1155ClassHash?: `0x${string}`;\n marketplace1155StartBlock?: number;\n collection721?: `0x${string}`;\n collection721StartBlock?: number;\n ipNftClassHash?: `0x${string}`;\n ipCollectionClassHash?: `0x${string}`;\n collection1155?: `0x${string}`;\n collection1155FactoryClassHash?: `0x${string}`;\n collection1155ClassHash?: `0x${string}`;\n collection1155StartBlock?: number;\n popFactory?: `0x${string}`;\n popCollectionClassHash?: `0x${string}`;\n dropFactory?: `0x${string}`;\n dropCollectionClassHash?: `0x${string}`;\n nftComments?: `0x${string}`;\n creatorCoinFactory?: `0x${string}`;\n creatorCoinEkuboLauncher?: `0x${string}`;\n creatorCoinClassHash?: `0x${string}`;\n creatorCoinFactoryClassHash?: `0x${string}`;\n creatorCoinStartBlock?: number;\n ekuboCore?: `0x${string}`;\n ipTicketsFactory?: `0x${string}`;\n ipTicketCollectionClassHash?: `0x${string}`;\n ipTicketsStartBlock?: number;\n ipClubRegistry?: `0x${string}`;\n ipClubNftClassHash?: `0x${string}`;\n ipClubStartBlock?: number;\n ipClubFactory?: `0x${string}`;\n ipClubFactoryClassHash?: `0x${string}`;\n ipClubCollectionClassHash?: `0x${string}`;\n ipClubFactoryStartBlock?: number;\n ipSponsorship?: `0x${string}`;\n ipSponsorshipStartBlock?: number;\n ipSponsorshipLicense?: `0x${string}`;\n}\n\n/** Coordinates per chain. Only STARKNET is populated today; adding a chain\n * means adding an entry here (litmus test, spec §7). */\n/** EVM coordinates — one shape for Ethereum and Base (same bytecode, two\n * chains). Populated at deploy time (federation Phase 4). */\nexport interface EvmCoordinates {\n rpcUrl: string;\n marketplace721?: `0x${string}`;\n marketplace721StartBlock?: number;\n marketplace1155?: `0x${string}`;\n marketplace1155StartBlock?: number;\n mipRegistry?: `0x${string}`;\n mipRegistryStartBlock?: number;\n mipEditionsRegistry?: `0x${string}`;\n mipEditionsRegistryStartBlock?: number;\n}\n\n/** Solana coordinates — base58 program ids. Populated at deploy time. */\nexport interface SolanaCoordinates {\n rpcUrl: string;\n mipCollectionsProgram?: string;\n marketplaceProgram?: string;\n startSlot?: number;\n}\n\n/** Stellar (Soroban) coordinates — strkey contract ids. Populated at deploy\n * time; the registry takes the collection WASM hash as a constructor arg. */\nexport interface StellarCoordinates {\n rpcUrl: string;\n mipRegistry?: string;\n marketplace?: string;\n collectionWasmHash?: string;\n startLedger?: number;\n}\n\n/** Per-chain coordinate shapes. Every chain is an equal entry — no chain is\n * privileged in core (chain-sovereignty I2/I4). */\nexport interface CoordinatesByChain {\n STARKNET?: StarknetCoordinates;\n ETHEREUM?: EvmCoordinates;\n BASE?: EvmCoordinates;\n SOLANA?: SolanaCoordinates;\n STELLAR?: StellarCoordinates;\n BITCOIN?: never;\n}\n\n/** @deprecated Renamed — use `StarknetCoordinates` (coordinates are per-chain-shaped). */\nexport type ChainCoordinates = StarknetCoordinates;\n\nconst COORDINATES: CoordinatesByChain = {\n STARKNET: {\n rpcUrl: \"https://rpc.starknet.lava.build\",\n marketplace721: \"0x03eda9a2b6ad90845a43591bac8083ebaf677d51fdf20f503b2c01889e3131fc\",\n marketplace721ClassHash: \"0x0700d9230d07e5203e27778c0dc70f9134d2b25bf319f7cf8348dc66a6923e90\",\n marketplace721StartBlock: 11198146,\n marketplace1155: \"0x07c4ce1c19ea48cc11135ed22b19ff745f5aec508c3828593002e4f76fdb1b38\",\n marketplace1155ClassHash: \"0x0242f5c388da7cee2d99e2a69453c8159bf927fbec4e797a3cfdcbbcb5b68328\",\n marketplace1155StartBlock: 11198267,\n collection721: \"0x0225c3ae09506b8d97adc39649ca740dad5aac195b7f5f0441cc1852947acaea\",\n collection721StartBlock: 11198496,\n ipNftClassHash: \"0x012d3ae40ba35c7e2be0946532dac60e48932447912fdf96b674da67c029b9cc\",\n ipCollectionClassHash: \"0x022155a1a130a40e57aac4b89c07fab3f616bc351b1270fc40f756b963afe8b4\",\n collection1155: \"0x015368976d46fae5bfa1c58600f641d5aa5dbbf53ebc6b78aa3922194aad3551\",\n collection1155FactoryClassHash: \"0x04eb6b419770f13bd191f120b9fc9ee624c0613ad4490062d293ca2016b3b1d2\",\n collection1155ClassHash: \"0x06cf3f5a2322dac35e07a6064a5b8802f19fda8aa3f4726f0cb7bc05dea1bd78\",\n collection1155StartBlock: 11199527,\n popFactory: \"0x00b32c34b427d8f346b5843ada6a37bd3368d879fc752cd52b68a87287f60111\",\n popCollectionClassHash: \"0x077c421686f10851872561953ea16898d933364b7f8937a5d7e2b1ba0a36263f\",\n dropFactory: \"0x03587f42e29daee1b193f6cf83bf8627908ed6632d0d83fcb26225c50547d800\",\n dropCollectionClassHash: \"0x00092e72cdb63067521e803aaf7d4101c3e3ce026ae6bc045ec4228027e58282\",\n nftComments: \"0x02cdac70c94447189af0389dfea63f4d5e4154ea8a563de288a5ab1c39e37843\",\n creatorCoinFactory: \"0x50fa807b5274079fb19374673d7bab6d2dc3af7e1032ea43eb6e44bcbde4c3c\",\n creatorCoinEkuboLauncher: \"0x4f7fceb5ac10f12f9544a09580592e5bdf1b7f04f48765eecf12286d8ccb7b4\",\n creatorCoinClassHash: \"0x743e4c8a5b96bb83bbf4af04edbbb482d5ece89eed9b729a79fb7df0cd0b6b6\",\n creatorCoinFactoryClassHash: \"0x51765926b1344c9a20b8cd4b5abe7b7d47375ae97cf6804db3ea5d4b05a9b55\",\n creatorCoinStartBlock: 10474544,\n ekuboCore: \"0x00000005dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b\",\n ipTicketsFactory: \"0x0664c2d6a4da9ee3ff053ceeba7579c01f2fedfd9d2b57b4c07af3734bd4acab\",\n ipTicketCollectionClassHash: \"0x086f59c416e365e2bee4ceff9f1dcb96198f2342d50ba4621f60b831863adb6\",\n ipTicketsStartBlock: 11404656,\n ipClubRegistry: \"0x00e189c619b6bb07d78973a149641c59c37eb0716f8584d7520bce12d303eede\",\n ipClubNftClassHash: \"0x02bc9b20cca21b04245e9215bf7121f4d7295b195890e449b472b573017fb889\",\n ipClubStartBlock: 11404776,\n ipClubFactory: \"0x010726346c264d1832a7303afaf5692dbd2b05446fecc6da30d958d0227c36d0\",\n ipClubFactoryClassHash: \"0x07197062578375d962b2d42d3e91560770b11b1c97a9defb74c706a2c5299473\",\n ipClubCollectionClassHash: \"0x049dc5e5ff00e67d5d457c6991ee70822f36a979b76cefd1b617aeccd7051d4b\",\n ipClubFactoryStartBlock: 11652766,\n ipSponsorship: \"0x044d9b9c3bb29b94685b0a3fe27a5e2dfa30a3637ab55979c718ebcd3268bc2f\",\n ipSponsorshipStartBlock: 11405085,\n // Dedicated ip-erc721/MIP instance for sponsorship receipts (class hash\n // 0x01bd7e39c5135b32b664e34cbbb4eafbd707a0fbc3ec2ef28657f52577d277d7) —\n // never the genesis-mint instance.\n ipSponsorshipLicense: \"0x06bcfc4e97758a2abf95af4bd49596efdbfd88ccd740caddc56ad0a4bd095839\",\n },\n};\n\nexport function getCoordinates(chain: \"STARKNET\"): StarknetCoordinates;\nexport function getCoordinates(chain: \"ETHEREUM\" | \"BASE\"): EvmCoordinates;\nexport function getCoordinates(chain: \"SOLANA\"): SolanaCoordinates;\nexport function getCoordinates(chain: \"STELLAR\"): StellarCoordinates;\nexport function getCoordinates(\n chain: Chain,\n): StarknetCoordinates | EvmCoordinates | SolanaCoordinates | StellarCoordinates;\nexport function getCoordinates(\n chain: Chain,\n): StarknetCoordinates | EvmCoordinates | SolanaCoordinates | StellarCoordinates {\n const c = COORDINATES[chain];\n if (!c) throw new Error(`No coordinates configured for chain \"${chain}\"`);\n return c;\n}\n\nexport const DEFAULT_CHAIN: Chain = \"STARKNET\";\n\n/** Typed Starknet coordinates for Starknet-only modules; throws when the\n * client is scoped to another chain. */\nexport function getStarknetCoordinates(chain: Chain): StarknetCoordinates {\n if (chain !== \"STARKNET\") {\n throw new Error(`This module is Starknet-only (client chain: \"${chain}\")`);\n }\n return getCoordinates(\"STARKNET\");\n}\n","import { parseAbi } from \"viem\";\n\n/** Minimal venue ABI — verified against Medialane721.sol / Medialane1155.sol.\n * The 1155 venue's fulfillOrder additionally takes a quantity. */\nexport const EvmVenueABI = parseAbi([\n \"struct OfferItem { uint8 itemType; address token; uint256 identifier; uint256 amount; }\",\n \"struct ConsiderationItem { uint8 itemType; address token; uint256 identifier; uint256 amount; address recipient; }\",\n \"struct OrderParameters { address offerer; OfferItem offer; ConsiderationItem consideration; uint256 royaltyMaxBps; uint256 startTime; uint256 endTime; uint256 salt; uint256 counter; }\",\n \"function registerOrder(OrderParameters parameters, bytes signature)\",\n \"function fulfillOrder(bytes32 orderHash) payable\",\n \"function cancelOrder(bytes32 orderHash)\",\n \"function incrementCounter()\",\n \"function getOrderHash(OrderParameters parameters) view returns (bytes32)\",\n \"function getCounter(address offerer) view returns (uint256)\",\n \"function version() pure returns (string)\",\n \"event OrderCreated(bytes32 indexed orderHash, address indexed offerer)\",\n \"event OrderFulfilled(bytes32 indexed orderHash, address indexed offerer, address indexed fulfiller, uint256 saleAmount, address royaltyReceiver, uint256 royaltyAmount)\",\n \"event OrderCancelled(bytes32 indexed orderHash, address indexed offerer)\",\n \"event CounterIncremented(address indexed offerer, uint256 newCounter)\",\n]);\n\nexport const EvmVenue1155ABI = parseAbi([\n \"function fulfillOrder(bytes32 orderHash, uint256 quantity) payable\",\n \"event OrderFulfilled(bytes32 indexed orderHash, address indexed offerer, address indexed fulfiller, uint256 quantity, uint256 remainingAmount, uint256 saleAmount, address royaltyReceiver, uint256 royaltyAmount)\",\n]);\n\n/** MIP issuance — verified against MIPRegistry.sol / MIPCollection.sol (and\n * the editions pair, which shares the registry surface). */\nexport const EvmMipRegistryABI = parseAbi([\n \"function createCollection(string name, string symbol, string baseUri, uint96 royaltyBps) returns (uint256 collectionId, address collection)\",\n \"function getCollection(uint256 collectionId) view returns (address collection, address creator)\",\n \"function collectionCount() view returns (uint256)\",\n \"event CollectionCreated(uint256 indexed collectionId, address indexed collection, address indexed creator, string name, string symbol, string baseUri)\",\n]);\n\nexport const EvmMipCollectionABI = parseAbi([\n \"function mint(address to, string metadataUri) returns (uint256 tokenId)\",\n \"function batchMint(address[] to, string[] metadataUris) returns (uint256[] tokenIds)\",\n \"function tokenURI(uint256 tokenId) view returns (string)\",\n \"function ownerOf(uint256 tokenId) view returns (address)\",\n \"function balanceOf(address owner) view returns (uint256)\",\n \"function owner() view returns (address)\",\n \"event TokenMinted(uint256 indexed tokenId, address indexed owner, string metadataUri)\",\n \"event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)\",\n]);\n","import type { PublicClient, WalletClient } from \"viem\";\nimport type { Chain } from \"../chains.js\";\nimport { getCoordinates, type EvmCoordinates } from \"../chains.js\";\nimport type {\n AdapterTxResult,\n OrderRef,\n RegisterOrderParams,\n VenueAdapter,\n} from \"../adapters/types.js\";\nimport { EvmVenueABI, EvmVenue1155ABI } from \"./abis.js\";\nimport {\n EVM_ORDER_TYPES,\n evmOrderDigest,\n evmOrderDomain,\n type EvmOrderParameters,\n} from \"./typedData.js\";\n\nexport type EvmChain = \"ETHEREUM\" | \"BASE\";\n\nexport interface EvmVenueOptions {\n chain: EvmChain;\n chainId: number;\n publicClient: PublicClient;\n /** \"721\" (unique assets) or \"1155\" (partial fills). */\n variant: \"721\" | \"1155\";\n /** Defaults to the chain registry's venue address (populated at deploy). */\n contract?: `0x${string}`;\n}\n\n/** The Medialane venue adapter for EVM chains — one implementation serves\n * Ethereum and Base (same bytecode; the EIP-712 domain separates them). */\nexport class EvmVenue implements VenueAdapter<WalletClient> {\n readonly chain: Chain;\n private readonly chainId: number;\n private readonly contract: `0x${string}`;\n private readonly publicClient: PublicClient;\n private readonly variant: \"721\" | \"1155\";\n\n constructor(opts: EvmVenueOptions) {\n this.chain = opts.chain;\n this.chainId = opts.chainId;\n this.publicClient = opts.publicClient;\n this.variant = opts.variant;\n const coords = maybeCoords(opts.chain);\n const contract =\n opts.contract ?? (opts.variant === \"721\" ? coords?.marketplace721 : coords?.marketplace1155);\n if (!contract) throw new Error(`No ${opts.variant} venue configured for ${opts.chain}`);\n this.contract = contract;\n }\n\n /** Builds the order struct, signs the EIP-712 digest, and registers it.\n * The digest is the canonical order id on EVM chains. */\n async registerOrder(\n signer: WalletClient,\n params: RegisterOrderParams,\n ): Promise<AdapterTxResult & { orderRef: OrderRef }> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const counter = await this.getCounter(account.address);\n const nft = {\n itemType: 2 as const,\n token: params.asset.contract as `0x${string}`,\n identifier: BigInt(params.asset.tokenId),\n amount: 1n,\n };\n const payment = {\n itemType: (params.paymentToken === NATIVE_SENTINEL ? 0 : 1) as 0 | 1,\n token: (params.paymentToken === NATIVE_SENTINEL\n ? \"0x0000000000000000000000000000000000000000\"\n : params.paymentToken) as `0x${string}`,\n identifier: 0n,\n amount: BigInt(params.amount),\n };\n const order: EvmOrderParameters =\n params.side === \"listing\"\n ? {\n offerer: account.address,\n offer: nft,\n consideration: { ...payment, recipient: account.address },\n ...commonFields(params),\n }\n : {\n offerer: account.address,\n offer: payment,\n consideration: { ...nft, recipient: account.address },\n ...commonFields(params),\n };\n order.counter = counter;\n\n const signature = await signer.signTypedData({\n account,\n domain: evmOrderDomain(this.chainId, this.contract),\n types: EVM_ORDER_TYPES,\n primaryType: \"OrderParameters\",\n message: order,\n });\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"registerOrder\",\n args: [order, signature],\n });\n return { txHash, orderRef: evmOrderDigest(this.chainId, this.contract, order) };\n }\n\n async fulfillOrder(\n signer: WalletClient,\n orderRef: OrderRef,\n opts?: { quantity?: string; value?: string },\n ): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const value = opts?.value ? BigInt(opts.value) : undefined;\n const txHash =\n this.variant === \"1155\"\n ? await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenue1155ABI,\n functionName: \"fulfillOrder\",\n args: [orderRef as `0x${string}`, BigInt(opts?.quantity ?? \"1\")],\n value,\n })\n : await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"fulfillOrder\",\n args: [orderRef as `0x${string}`],\n value,\n });\n return { txHash };\n }\n\n async cancelOrder(signer: WalletClient, orderRef: OrderRef): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"cancelOrder\",\n args: [orderRef as `0x${string}`],\n });\n return { txHash };\n }\n\n async incrementCounter(signer: WalletClient): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"incrementCounter\",\n args: [],\n });\n return { txHash };\n }\n\n async getOrderDetails(orderRef: OrderRef): Promise<unknown> {\n return this.publicClient.readContract({\n address: this.contract,\n abi: [\n {\n type: \"function\",\n name: \"getOrderDetails\",\n stateMutability: \"view\",\n inputs: [{ name: \"orderHash\", type: \"bytes32\" }],\n outputs: [{ name: \"\", type: \"bytes\" }],\n },\n ] as const,\n functionName: \"getOrderDetails\",\n args: [orderRef as `0x${string}`],\n });\n }\n\n async getCounter(address: string): Promise<bigint> {\n return this.publicClient.readContract({\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"getCounter\",\n args: [address as `0x${string}`],\n });\n }\n}\n\n/** Payment-token sentinel for native ETH (spec §3.2b currency encoding). */\nexport const NATIVE_SENTINEL = \"native\";\n\nfunction commonFields(params: RegisterOrderParams) {\n return {\n royaltyMaxBps: BigInt(params.royaltyMaxBps),\n startTime: BigInt(params.startTime),\n endTime: BigInt(params.endTime),\n salt: BigInt(params.salt),\n counter: 0n,\n };\n}\n\nfunction maybeCoords(chain: EvmChain): EvmCoordinates | undefined {\n try {\n return getCoordinates(chain);\n } catch {\n return undefined;\n }\n}\n","import type { PublicClient, WalletClient } from \"viem\";\nimport { parseEventLogs } from \"viem\";\nimport type { Chain } from \"../chains.js\";\nimport { getCoordinates, type EvmCoordinates } from \"../chains.js\";\nimport type { AdapterTxResult, CreateCollectionInput, IssuanceAdapter, MintInput } from \"../adapters/types.js\";\nimport { EvmMipCollectionABI, EvmMipRegistryABI } from \"./abis.js\";\nimport type { EvmChain } from \"./venue.js\";\n\nexport interface EvmIssuanceOptions {\n chain: EvmChain;\n publicClient: PublicClient;\n /** Defaults to the chain registry's MIP registry (populated at deploy). */\n registry?: `0x${string}`;\n}\n\n/** The Mediolano issuance adapter for EVM chains. */\nexport class EvmIssuance implements IssuanceAdapter<WalletClient> {\n readonly chain: Chain;\n private readonly registry: `0x${string}`;\n private readonly publicClient: PublicClient;\n\n constructor(opts: EvmIssuanceOptions) {\n this.chain = opts.chain;\n this.publicClient = opts.publicClient;\n const registry = opts.registry ?? maybeCoords(opts.chain)?.mipRegistry;\n if (!registry) throw new Error(`No MIP registry configured for ${opts.chain}`);\n this.registry = registry;\n }\n\n async createCollection(\n signer: WalletClient,\n params: CreateCollectionInput,\n ): Promise<AdapterTxResult & { collection: string }> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.registry,\n abi: EvmMipRegistryABI,\n functionName: \"createCollection\",\n args: [params.name, params.symbol, params.baseUri, BigInt(params.royaltyBps)],\n });\n const receipt = await this.publicClient.waitForTransactionReceipt({ hash: txHash });\n const [created] = parseEventLogs({\n abi: EvmMipRegistryABI,\n eventName: \"CollectionCreated\",\n logs: receipt.logs,\n });\n return { txHash, collection: created?.args.collection ?? \"\" };\n }\n\n async mint(signer: WalletClient, params: MintInput): Promise<AdapterTxResult & { tokenId: string }> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: params.collection as `0x${string}`,\n abi: EvmMipCollectionABI,\n functionName: \"mint\",\n args: [params.recipient as `0x${string}`, params.tokenUri],\n });\n const receipt = await this.publicClient.waitForTransactionReceipt({ hash: txHash });\n const [minted] = parseEventLogs({\n abi: EvmMipCollectionABI,\n eventName: \"TokenMinted\",\n logs: receipt.logs,\n });\n return { txHash, tokenId: (minted?.args.tokenId ?? 0n).toString() };\n }\n\n async batchMint(\n signer: WalletClient,\n params: { collection: string; recipients: string[]; tokenUris: string[] },\n ): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: params.collection as `0x${string}`,\n abi: EvmMipCollectionABI,\n functionName: \"batchMint\",\n args: [params.recipients as `0x${string}`[], params.tokenUris],\n });\n return { txHash };\n }\n}\n\nfunction maybeCoords(chain: EvmChain): EvmCoordinates | undefined {\n try {\n return getCoordinates(chain);\n } catch {\n return undefined;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/evm/typedData.ts","../../src/chains.ts","../../src/evm/abis.ts","../../src/evm/venue.ts","../../src/evm/issuance.ts"],"names":["maybeCoords"],"mappings":";;;AASO,IAAM,eAAA,GAAkB;AAAA,EAC7B,SAAA,EAAW;AAAA,IACT,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,OAAA,EAAQ;AAAA,IAClC,EAAE,IAAA,EAAM,OAAA,EAAS,IAAA,EAAM,SAAA,EAAU;AAAA,IACjC,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,SAAA,EAAU;AAAA,IACtC,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,SAAA;AAAU,GACpC;AAAA,EACA,iBAAA,EAAmB;AAAA,IACjB,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,OAAA,EAAQ;AAAA,IAClC,EAAE,IAAA,EAAM,OAAA,EAAS,IAAA,EAAM,SAAA,EAAU;AAAA,IACjC,EAAE,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,SAAA,EAAU;AAAA,IACtC,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,SAAA,EAAU;AAAA,IAClC,EAAE,IAAA,EAAM,WAAA,EAAa,IAAA,EAAM,SAAA;AAAU,GACvC;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,EAAE,IAAA,EAAM,SAAA,EAAW,IAAA,EAAM,SAAA,EAAU;AAAA,IACnC,EAAE,IAAA,EAAM,OAAA,EAAS,IAAA,EAAM,WAAA,EAAY;AAAA,IACnC,EAAE,IAAA,EAAM,eAAA,EAAiB,IAAA,EAAM,mBAAA,EAAoB;AAAA,IACnD,EAAE,IAAA,EAAM,eAAA,EAAiB,IAAA,EAAM,SAAA,EA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A,MACd,IAAA,EAAM,CAAC,MAAA,CAAO,UAAA,EAA+B,OAAO,SAAS;AAAA,KAC9D,CAAA;AACD,IAAA,OAAO,EAAE,MAAA,EAAO;AAAA,EAClB;AACF;AAEA,SAASA,aAAY,KAAA,EAA6C;AAChE,EAAA,IAAI;AACF,IAAA,OAAO,eAAe,KAAK,CAAA;AAAA,EAC7B,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,MAAA;AAAA,EACT;AACF","file":"index.js","sourcesContent":["import { hashTypedData, type TypedDataDomain } from \"viem\";\n\n/**\n * EIP-712 order typing for the Medialane EVM venues — byte-identical to the\n * audited Solidity (contracts/EVM-Marketplace-ERC721/src/Medialane721.sol and\n * the 1155 venue, which shares the type strings; the domain's\n * verifyingContract separates deployments and venues).\n */\n\nexport const EVM_ORDER_TYPES = {\n OfferItem: [\n { name: \"itemType\", type: \"uint8\" },\n { name: \"token\", type: \"address\" },\n { name: \"identifier\", type: \"uint256\" },\n { name: \"amount\", type: \"uint256\" },\n ],\n ConsiderationItem: [\n { name: \"itemType\", type: \"uint8\" },\n { name: \"token\", type: \"address\" },\n { name: \"identifier\", type: \"uint256\" },\n { name: \"amount\", type: \"uint256\" },\n { name: \"recipient\", type: \"address\" },\n ],\n OrderParameters: [\n { name: \"offerer\", type: \"address\" },\n { name: \"offer\", type: \"OfferItem\" },\n { name: \"consideration\", type: \"ConsiderationItem\" },\n { name: \"royaltyMaxBps\", type: \"uint256\" },\n { name: \"startTime\", type: \"uint256\" },\n { name: \"endTime\", type: \"uint256\" },\n { name: \"salt\", type: \"uint256\" },\n { name: \"counter\", type: \"uint256\" },\n ],\n} as const;\n\n/** NATIVE=0, ERC20=1, ERC721=2 on the 721 venue; NATIVE=0, ERC20=1, ERC1155=2 on the 1155 venue. */\nexport type EvmItemType = 0 | 1 | 2;\n\nexport interface EvmOfferItem {\n itemType: EvmItemType;\n token: `0x${string}`;\n identifier: bigint;\n amount: bigint;\n}\n\nexport interface EvmConsiderationItem extends EvmOfferItem {\n recipient: `0x${string}`;\n}\n\nexport interface EvmOrderParameters {\n offerer: `0x${string}`;\n offer: EvmOfferItem;\n consideration: EvmConsiderationItem;\n royaltyMaxBps: bigint;\n startTime: bigint;\n endTime: bigint;\n salt: bigint;\n counter: bigint;\n}\n\nexport function evmOrderDomain(chainId: number, verifyingContract: `0x${string}`): TypedDataDomain {\n return { name: \"Medialane\", version: \"1\", chainId, verifyingContract };\n}\n\n/** The order's EIP-712 digest — the venue's order hash and the platform's\n * canonical order id on EVM chains. */\nexport function evmOrderDigest(\n chainId: number,\n verifyingContract: `0x${string}`,\n parameters: EvmOrderParameters,\n): `0x${string}` {\n return hashTypedData({\n domain: evmOrderDomain(chainId, verifyingContract),\n types: EVM_ORDER_TYPES,\n primaryType: \"OrderParameters\",\n message: parameters,\n });\n}\n","// Single source of per-chain coordinates for Medialane's own services\n// (spec 2026-06-13 §3.1, Decision A). Keyed by CHAIN ALONE — Medialane is\n// mainnet-only, so there is no network axis (refines decisions.md D-9).\n\n/** Mirrors the backend Prisma `Chain` enum. */\nexport const CHAINS = [\"STARKNET\", \"ETHEREUM\", \"SOLANA\", \"BASE\", \"STELLAR\", \"BITCOIN\"] as const;\nexport type Chain = (typeof CHAINS)[number];\n\n/** Starknet coordinates of Medialane services + venues. All fields optional\n * because not every service exists on every chain. */\nexport interface StarknetCoordinates {\n rpcUrl: string;\n marketplace721?: `0x${string}`;\n marketplace721ClassHash?: `0x${string}`;\n marketplace721StartBlock?: number;\n marketplace1155?: `0x${string}`;\n marketplace1155ClassHash?: `0x${string}`;\n marketplace1155StartBlock?: number;\n collection721?: `0x${string}`;\n collection721StartBlock?: number;\n ipNftClassHash?: `0x${string}`;\n ipCollectionClassHash?: `0x${string}`;\n collection1155?: `0x${string}`;\n collection1155FactoryClassHash?: `0x${string}`;\n collection1155ClassHash?: `0x${string}`;\n collection1155StartBlock?: number;\n popFactory?: `0x${string}`;\n popCollectionClassHash?: `0x${string}`;\n dropFactory?: `0x${string}`;\n dropCollectionClassHash?: `0x${string}`;\n nftComments?: `0x${string}`;\n creatorCoinFactory?: `0x${string}`;\n creatorCoinEkuboLauncher?: `0x${string}`;\n creatorCoinClassHash?: `0x${string}`;\n creatorCoinFactoryClassHash?: `0x${string}`;\n creatorCoinStartBlock?: number;\n ekuboCore?: `0x${string}`;\n ipTicketsFactory?: `0x${string}`;\n ipTicketCollectionClassHash?: `0x${string}`;\n ipTicketsStartBlock?: number;\n ipClubRegistry?: `0x${string}`;\n ipClubNftClassHash?: `0x${string}`;\n ipClubStartBlock?: number;\n ipClubFactory?: `0x${string}`;\n ipClubFactoryClassHash?: `0x${string}`;\n ipClubCollectionClassHash?: `0x${string}`;\n ipClubFactoryStartBlock?: number;\n ipSponsorship?: `0x${string}`;\n ipSponsorshipStartBlock?: number;\n ipSponsorshipLicense?: `0x${string}`;\n}\n\n/** Coordinates per chain. Only STARKNET is populated today; adding a chain\n * means adding an entry here (litmus test, spec §7). */\n/** EVM coordinates — one shape for Ethereum and Base (same bytecode, two\n * chains). Populated at deploy time (federation Phase 4). */\nexport interface EvmCoordinates {\n rpcUrl: string;\n marketplace721?: `0x${string}`;\n marketplace721StartBlock?: number;\n marketplace1155?: `0x${string}`;\n marketplace1155StartBlock?: number;\n mipRegistry?: `0x${string}`;\n mipRegistryStartBlock?: number;\n mipEditionsRegistry?: `0x${string}`;\n mipEditionsRegistryStartBlock?: number;\n}\n\n/** Solana coordinates — base58 program ids. Populated at deploy time. */\nexport interface SolanaCoordinates {\n rpcUrl: string;\n mipCollectionsProgram?: string;\n marketplaceProgram?: string;\n startSlot?: number;\n}\n\n/** Stellar (Soroban) coordinates — strkey contract ids. Populated at deploy\n * time; the registry takes the collection WASM hash as a constructor arg. */\nexport interface StellarCoordinates {\n rpcUrl: string;\n mipRegistry?: string;\n marketplace?: string;\n collectionWasmHash?: string;\n startLedger?: number;\n}\n\n/** Per-chain coordinate shapes. Every chain is an equal entry — no chain is\n * privileged in core (chain-sovereignty I2/I4). */\nexport interface CoordinatesByChain {\n STARKNET?: StarknetCoordinates;\n ETHEREUM?: EvmCoordinates;\n BASE?: EvmCoordinates;\n SOLANA?: SolanaCoordinates;\n STELLAR?: StellarCoordinates;\n BITCOIN?: never;\n}\n\n/** @deprecated Renamed — use `StarknetCoordinates` (coordinates are per-chain-shaped). */\nexport type ChainCoordinates = StarknetCoordinates;\n\nconst COORDINATES: CoordinatesByChain = {\n STARKNET: {\n rpcUrl: \"https://rpc.starknet.lava.build\",\n marketplace721: \"0x03eda9a2b6ad90845a43591bac8083ebaf677d51fdf20f503b2c01889e3131fc\",\n marketplace721ClassHash: \"0x0700d9230d07e5203e27778c0dc70f9134d2b25bf319f7cf8348dc66a6923e90\",\n marketplace721StartBlock: 11198146,\n marketplace1155: \"0x07c4ce1c19ea48cc11135ed22b19ff745f5aec508c3828593002e4f76fdb1b38\",\n marketplace1155ClassHash: \"0x0242f5c388da7cee2d99e2a69453c8159bf927fbec4e797a3cfdcbbcb5b68328\",\n marketplace1155StartBlock: 11198267,\n collection721: \"0x0225c3ae09506b8d97adc39649ca740dad5aac195b7f5f0441cc1852947acaea\",\n collection721StartBlock: 11198496,\n ipNftClassHash: \"0x012d3ae40ba35c7e2be0946532dac60e48932447912fdf96b674da67c029b9cc\",\n ipCollectionClassHash: \"0x022155a1a130a40e57aac4b89c07fab3f616bc351b1270fc40f756b963afe8b4\",\n collection1155: \"0x015368976d46fae5bfa1c58600f641d5aa5dbbf53ebc6b78aa3922194aad3551\",\n collection1155FactoryClassHash: \"0x04eb6b419770f13bd191f120b9fc9ee624c0613ad4490062d293ca2016b3b1d2\",\n collection1155ClassHash: \"0x06cf3f5a2322dac35e07a6064a5b8802f19fda8aa3f4726f0cb7bc05dea1bd78\",\n collection1155StartBlock: 11199527,\n popFactory: \"0x00b32c34b427d8f346b5843ada6a37bd3368d879fc752cd52b68a87287f60111\",\n popCollectionClassHash: \"0x077c421686f10851872561953ea16898d933364b7f8937a5d7e2b1ba0a36263f\",\n dropFactory: \"0x03587f42e29daee1b193f6cf83bf8627908ed6632d0d83fcb26225c50547d800\",\n dropCollectionClassHash: \"0x00092e72cdb63067521e803aaf7d4101c3e3ce026ae6bc045ec4228027e58282\",\n nftComments: \"0x02cdac70c94447189af0389dfea63f4d5e4154ea8a563de288a5ab1c39e37843\",\n creatorCoinFactory: \"0x50fa807b5274079fb19374673d7bab6d2dc3af7e1032ea43eb6e44bcbde4c3c\",\n creatorCoinEkuboLauncher: \"0x4f7fceb5ac10f12f9544a09580592e5bdf1b7f04f48765eecf12286d8ccb7b4\",\n creatorCoinClassHash: \"0x743e4c8a5b96bb83bbf4af04edbbb482d5ece89eed9b729a79fb7df0cd0b6b6\",\n creatorCoinFactoryClassHash: \"0x51765926b1344c9a20b8cd4b5abe7b7d47375ae97cf6804db3ea5d4b05a9b55\",\n creatorCoinStartBlock: 10474544,\n ekuboCore: \"0x00000005dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b\",\n ipTicketsFactory: \"0x03ffef4162fe2c44e17d6be2aad3553cab0ac2274cd0b1bb3fafb12fd66695c1\",\n ipTicketCollectionClassHash: \"0x036393fb4241ed55bd12d8b328ed877d08100fadf9150a650e2b84cbab95e1d4\",\n ipTicketsStartBlock: 11689800,\n ipClubRegistry: \"0x00e189c619b6bb07d78973a149641c59c37eb0716f8584d7520bce12d303eede\",\n ipClubNftClassHash: \"0x02bc9b20cca21b04245e9215bf7121f4d7295b195890e449b472b573017fb889\",\n ipClubStartBlock: 11404776,\n ipClubFactory: \"0x010726346c264d1832a7303afaf5692dbd2b05446fecc6da30d958d0227c36d0\",\n ipClubFactoryClassHash: \"0x07197062578375d962b2d42d3e91560770b11b1c97a9defb74c706a2c5299473\",\n ipClubCollectionClassHash: \"0x049dc5e5ff00e67d5d457c6991ee70822f36a979b76cefd1b617aeccd7051d4b\",\n ipClubFactoryStartBlock: 11652766,\n ipSponsorship: \"0x044d9b9c3bb29b94685b0a3fe27a5e2dfa30a3637ab55979c718ebcd3268bc2f\",\n ipSponsorshipStartBlock: 11405085,\n // Dedicated ip-erc721/MIP instance for sponsorship receipts (class hash\n // 0x01bd7e39c5135b32b664e34cbbb4eafbd707a0fbc3ec2ef28657f52577d277d7) —\n // never the genesis-mint instance.\n ipSponsorshipLicense: \"0x06bcfc4e97758a2abf95af4bd49596efdbfd88ccd740caddc56ad0a4bd095839\",\n },\n};\n\nexport function getCoordinates(chain: \"STARKNET\"): StarknetCoordinates;\nexport function getCoordinates(chain: \"ETHEREUM\" | \"BASE\"): EvmCoordinates;\nexport function getCoordinates(chain: \"SOLANA\"): SolanaCoordinates;\nexport function getCoordinates(chain: \"STELLAR\"): StellarCoordinates;\nexport function getCoordinates(\n chain: Chain,\n): StarknetCoordinates | EvmCoordinates | SolanaCoordinates | StellarCoordinates;\nexport function getCoordinates(\n chain: Chain,\n): StarknetCoordinates | EvmCoordinates | SolanaCoordinates | StellarCoordinates {\n const c = COORDINATES[chain];\n if (!c) throw new Error(`No coordinates configured for chain \"${chain}\"`);\n return c;\n}\n\nexport const DEFAULT_CHAIN: Chain = \"STARKNET\";\n\n/** Typed Starknet coordinates for Starknet-only modules; throws when the\n * client is scoped to another chain. */\nexport function getStarknetCoordinates(chain: Chain): StarknetCoordinates {\n if (chain !== \"STARKNET\") {\n throw new Error(`This module is Starknet-only (client chain: \"${chain}\")`);\n }\n return getCoordinates(\"STARKNET\");\n}\n","import { parseAbi } from \"viem\";\n\n/** Minimal venue ABI — verified against Medialane721.sol / Medialane1155.sol.\n * The 1155 venue's fulfillOrder additionally takes a quantity. */\nexport const EvmVenueABI = parseAbi([\n \"struct OfferItem { uint8 itemType; address token; uint256 identifier; uint256 amount; }\",\n \"struct ConsiderationItem { uint8 itemType; address token; uint256 identifier; uint256 amount; address recipient; }\",\n \"struct OrderParameters { address offerer; OfferItem offer; ConsiderationItem consideration; uint256 royaltyMaxBps; uint256 startTime; uint256 endTime; uint256 salt; uint256 counter; }\",\n \"function registerOrder(OrderParameters parameters, bytes signature)\",\n \"function fulfillOrder(bytes32 orderHash) payable\",\n \"function cancelOrder(bytes32 orderHash)\",\n \"function incrementCounter()\",\n \"function getOrderHash(OrderParameters parameters) view returns (bytes32)\",\n \"function getCounter(address offerer) view returns (uint256)\",\n \"function version() pure returns (string)\",\n \"event OrderCreated(bytes32 indexed orderHash, address indexed offerer)\",\n \"event OrderFulfilled(bytes32 indexed orderHash, address indexed offerer, address indexed fulfiller, uint256 saleAmount, address royaltyReceiver, uint256 royaltyAmount)\",\n \"event OrderCancelled(bytes32 indexed orderHash, address indexed offerer)\",\n \"event CounterIncremented(address indexed offerer, uint256 newCounter)\",\n]);\n\nexport const EvmVenue1155ABI = parseAbi([\n \"function fulfillOrder(bytes32 orderHash, uint256 quantity) payable\",\n \"event OrderFulfilled(bytes32 indexed orderHash, address indexed offerer, address indexed fulfiller, uint256 quantity, uint256 remainingAmount, uint256 saleAmount, address royaltyReceiver, uint256 royaltyAmount)\",\n]);\n\n/** MIP issuance — verified against MIPRegistry.sol / MIPCollection.sol (and\n * the editions pair, which shares the registry surface). */\nexport const EvmMipRegistryABI = parseAbi([\n \"function createCollection(string name, string symbol, string baseUri, uint96 royaltyBps) returns (uint256 collectionId, address collection)\",\n \"function getCollection(uint256 collectionId) view returns (address collection, address creator)\",\n \"function collectionCount() view returns (uint256)\",\n \"event CollectionCreated(uint256 indexed collectionId, address indexed collection, address indexed creator, string name, string symbol, string baseUri)\",\n]);\n\nexport const EvmMipCollectionABI = parseAbi([\n \"function mint(address to, string metadataUri) returns (uint256 tokenId)\",\n \"function batchMint(address[] to, string[] metadataUris) returns (uint256[] tokenIds)\",\n \"function tokenURI(uint256 tokenId) view returns (string)\",\n \"function ownerOf(uint256 tokenId) view returns (address)\",\n \"function balanceOf(address owner) view returns (uint256)\",\n \"function owner() view returns (address)\",\n \"event TokenMinted(uint256 indexed tokenId, address indexed owner, string metadataUri)\",\n \"event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)\",\n]);\n","import type { PublicClient, WalletClient } from \"viem\";\nimport type { Chain } from \"../chains.js\";\nimport { getCoordinates, type EvmCoordinates } from \"../chains.js\";\nimport type {\n AdapterTxResult,\n OrderRef,\n RegisterOrderParams,\n VenueAdapter,\n} from \"../adapters/types.js\";\nimport { EvmVenueABI, EvmVenue1155ABI } from \"./abis.js\";\nimport {\n EVM_ORDER_TYPES,\n evmOrderDigest,\n evmOrderDomain,\n type EvmOrderParameters,\n} from \"./typedData.js\";\n\nexport type EvmChain = \"ETHEREUM\" | \"BASE\";\n\nexport interface EvmVenueOptions {\n chain: EvmChain;\n chainId: number;\n publicClient: PublicClient;\n /** \"721\" (unique assets) or \"1155\" (partial fills). */\n variant: \"721\" | \"1155\";\n /** Defaults to the chain registry's venue address (populated at deploy). */\n contract?: `0x${string}`;\n}\n\n/** The Medialane venue adapter for EVM chains — one implementation serves\n * Ethereum and Base (same bytecode; the EIP-712 domain separates them). */\nexport class EvmVenue implements VenueAdapter<WalletClient> {\n readonly chain: Chain;\n private readonly chainId: number;\n private readonly contract: `0x${string}`;\n private readonly publicClient: PublicClient;\n private readonly variant: \"721\" | \"1155\";\n\n constructor(opts: EvmVenueOptions) {\n this.chain = opts.chain;\n this.chainId = opts.chainId;\n this.publicClient = opts.publicClient;\n this.variant = opts.variant;\n const coords = maybeCoords(opts.chain);\n const contract =\n opts.contract ?? (opts.variant === \"721\" ? coords?.marketplace721 : coords?.marketplace1155);\n if (!contract) throw new Error(`No ${opts.variant} venue configured for ${opts.chain}`);\n this.contract = contract;\n }\n\n /** Builds the order struct, signs the EIP-712 digest, and registers it.\n * The digest is the canonical order id on EVM chains. */\n async registerOrder(\n signer: WalletClient,\n params: RegisterOrderParams,\n ): Promise<AdapterTxResult & { orderRef: OrderRef }> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const counter = await this.getCounter(account.address);\n const nft = {\n itemType: 2 as const,\n token: params.asset.contract as `0x${string}`,\n identifier: BigInt(params.asset.tokenId),\n amount: 1n,\n };\n const payment = {\n itemType: (params.paymentToken === NATIVE_SENTINEL ? 0 : 1) as 0 | 1,\n token: (params.paymentToken === NATIVE_SENTINEL\n ? \"0x0000000000000000000000000000000000000000\"\n : params.paymentToken) as `0x${string}`,\n identifier: 0n,\n amount: BigInt(params.amount),\n };\n const order: EvmOrderParameters =\n params.side === \"listing\"\n ? {\n offerer: account.address,\n offer: nft,\n consideration: { ...payment, recipient: account.address },\n ...commonFields(params),\n }\n : {\n offerer: account.address,\n offer: payment,\n consideration: { ...nft, recipient: account.address },\n ...commonFields(params),\n };\n order.counter = counter;\n\n const signature = await signer.signTypedData({\n account,\n domain: evmOrderDomain(this.chainId, this.contract),\n types: EVM_ORDER_TYPES,\n primaryType: \"OrderParameters\",\n message: order,\n });\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"registerOrder\",\n args: [order, signature],\n });\n return { txHash, orderRef: evmOrderDigest(this.chainId, this.contract, order) };\n }\n\n async fulfillOrder(\n signer: WalletClient,\n orderRef: OrderRef,\n opts?: { quantity?: string; value?: string },\n ): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const value = opts?.value ? BigInt(opts.value) : undefined;\n const txHash =\n this.variant === \"1155\"\n ? await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenue1155ABI,\n functionName: \"fulfillOrder\",\n args: [orderRef as `0x${string}`, BigInt(opts?.quantity ?? \"1\")],\n value,\n })\n : await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"fulfillOrder\",\n args: [orderRef as `0x${string}`],\n value,\n });\n return { txHash };\n }\n\n async cancelOrder(signer: WalletClient, orderRef: OrderRef): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"cancelOrder\",\n args: [orderRef as `0x${string}`],\n });\n return { txHash };\n }\n\n async incrementCounter(signer: WalletClient): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"incrementCounter\",\n args: [],\n });\n return { txHash };\n }\n\n async getOrderDetails(orderRef: OrderRef): Promise<unknown> {\n return this.publicClient.readContract({\n address: this.contract,\n abi: [\n {\n type: \"function\",\n name: \"getOrderDetails\",\n stateMutability: \"view\",\n inputs: [{ name: \"orderHash\", type: \"bytes32\" }],\n outputs: [{ name: \"\", type: \"bytes\" }],\n },\n ] as const,\n functionName: \"getOrderDetails\",\n args: [orderRef as `0x${string}`],\n });\n }\n\n async getCounter(address: string): Promise<bigint> {\n return this.publicClient.readContract({\n address: this.contract,\n abi: EvmVenueABI,\n functionName: \"getCounter\",\n args: [address as `0x${string}`],\n });\n }\n}\n\n/** Payment-token sentinel for native ETH (spec §3.2b currency encoding). */\nexport const NATIVE_SENTINEL = \"native\";\n\nfunction commonFields(params: RegisterOrderParams) {\n return {\n royaltyMaxBps: BigInt(params.royaltyMaxBps),\n startTime: BigInt(params.startTime),\n endTime: BigInt(params.endTime),\n salt: BigInt(params.salt),\n counter: 0n,\n };\n}\n\nfunction maybeCoords(chain: EvmChain): EvmCoordinates | undefined {\n try {\n return getCoordinates(chain);\n } catch {\n return undefined;\n }\n}\n","import type { PublicClient, WalletClient } from \"viem\";\nimport { parseEventLogs } from \"viem\";\nimport type { Chain } from \"../chains.js\";\nimport { getCoordinates, type EvmCoordinates } from \"../chains.js\";\nimport type { AdapterTxResult, CreateCollectionInput, IssuanceAdapter, MintInput } from \"../adapters/types.js\";\nimport { EvmMipCollectionABI, EvmMipRegistryABI } from \"./abis.js\";\nimport type { EvmChain } from \"./venue.js\";\n\nexport interface EvmIssuanceOptions {\n chain: EvmChain;\n publicClient: PublicClient;\n /** Defaults to the chain registry's MIP registry (populated at deploy). */\n registry?: `0x${string}`;\n}\n\n/** The Mediolano issuance adapter for EVM chains. */\nexport class EvmIssuance implements IssuanceAdapter<WalletClient> {\n readonly chain: Chain;\n private readonly registry: `0x${string}`;\n private readonly publicClient: PublicClient;\n\n constructor(opts: EvmIssuanceOptions) {\n this.chain = opts.chain;\n this.publicClient = opts.publicClient;\n const registry = opts.registry ?? maybeCoords(opts.chain)?.mipRegistry;\n if (!registry) throw new Error(`No MIP registry configured for ${opts.chain}`);\n this.registry = registry;\n }\n\n async createCollection(\n signer: WalletClient,\n params: CreateCollectionInput,\n ): Promise<AdapterTxResult & { collection: string }> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: this.registry,\n abi: EvmMipRegistryABI,\n functionName: \"createCollection\",\n args: [params.name, params.symbol, params.baseUri, BigInt(params.royaltyBps)],\n });\n const receipt = await this.publicClient.waitForTransactionReceipt({ hash: txHash });\n const [created] = parseEventLogs({\n abi: EvmMipRegistryABI,\n eventName: \"CollectionCreated\",\n logs: receipt.logs,\n });\n return { txHash, collection: created?.args.collection ?? \"\" };\n }\n\n async mint(signer: WalletClient, params: MintInput): Promise<AdapterTxResult & { tokenId: string }> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: params.collection as `0x${string}`,\n abi: EvmMipCollectionABI,\n functionName: \"mint\",\n args: [params.recipient as `0x${string}`, params.tokenUri],\n });\n const receipt = await this.publicClient.waitForTransactionReceipt({ hash: txHash });\n const [minted] = parseEventLogs({\n abi: EvmMipCollectionABI,\n eventName: \"TokenMinted\",\n logs: receipt.logs,\n });\n return { txHash, tokenId: (minted?.args.tokenId ?? 0n).toString() };\n }\n\n async batchMint(\n signer: WalletClient,\n params: { collection: string; recipients: string[]; tokenUris: string[] },\n ): Promise<AdapterTxResult> {\n const account = signer.account;\n if (!account) throw new Error(\"WalletClient has no account\");\n const txHash = await signer.writeContract({\n account,\n chain: signer.chain,\n address: params.collection as `0x${string}`,\n abi: EvmMipCollectionABI,\n functionName: \"batchMint\",\n args: [params.recipients as `0x${string}`[], params.tokenUris],\n });\n return { txHash };\n }\n}\n\nfunction maybeCoords(chain: EvmChain): EvmCoordinates | undefined {\n try {\n return getCoordinates(chain);\n } catch {\n return undefined;\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { C as Chain, V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams } from './types-
|
|
2
|
+
import { C as Chain, V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, h as VenueSigner } from './types-Bx3ax9lW.js';
|
|
3
3
|
import { AccountInterface, constants, TypedData, Call, ProviderInterface } from 'starknet';
|
|
4
4
|
|
|
5
5
|
interface RetryOptions {
|
|
@@ -1991,34 +1991,43 @@ interface ResolvedOrder {
|
|
|
1991
1991
|
*/
|
|
1992
1992
|
interface StarknetVenueDeps {
|
|
1993
1993
|
config: ResolvedConfig;
|
|
1994
|
+
/** Read provider for building (counter/approval reads) and the post-tx receipt. */
|
|
1994
1995
|
provider: ProviderInterface;
|
|
1995
|
-
/** Resolve a registered order (payment token,
|
|
1996
|
+
/** Resolve a registered order (payment token, per-unit price, venue) from its digest. */
|
|
1996
1997
|
resolveOrder: (orderRef: OrderRef) => Promise<ResolvedOrder>;
|
|
1997
1998
|
/** Resolve a collection's token standard (from the indexer). */
|
|
1998
1999
|
resolveStandard: (contract: string) => Promise<"ERC721" | "ERC1155">;
|
|
1999
2000
|
}
|
|
2000
2001
|
/**
|
|
2001
|
-
* First-class Starknet venue adapter.
|
|
2002
|
-
*
|
|
2003
|
-
*
|
|
2002
|
+
* First-class Starknet venue adapter. It orchestrates the marketplace protocol
|
|
2003
|
+
* over the chain-neutral {@link StarknetVenueSigner} capability port: it *builds*
|
|
2004
|
+
* typed data + calldata via the pure marketplace builders and *reads* chain state
|
|
2005
|
+
* (counter, approvals, receipt) on `deps.provider`, but it never signs or executes
|
|
2006
|
+
* itself — the app's signer does that (sign + submit + confirm). This is what lets
|
|
2007
|
+
* a single adapter drive every wallet (injected/Cartridge/Privy) and the AVNU
|
|
2008
|
+
* paymaster without knowing they differ.
|
|
2004
2009
|
*/
|
|
2005
|
-
declare class StarknetVenue implements VenueAdapter<
|
|
2010
|
+
declare class StarknetVenue implements VenueAdapter<StarknetVenueSigner> {
|
|
2006
2011
|
private readonly deps;
|
|
2007
2012
|
readonly chain: "STARKNET";
|
|
2008
|
-
private readonly m721;
|
|
2009
|
-
private readonly m1155;
|
|
2010
2013
|
constructor(deps: StarknetVenueDeps);
|
|
2011
|
-
incrementCounter(signer:
|
|
2014
|
+
incrementCounter(signer: StarknetVenueSigner): Promise<AdapterTxResult>;
|
|
2012
2015
|
getOrderDetails(orderRef: OrderRef): Promise<unknown>;
|
|
2013
2016
|
getCounter(address: string): Promise<bigint>;
|
|
2014
|
-
fulfillOrder(signer:
|
|
2017
|
+
fulfillOrder(signer: StarknetVenueSigner, orderRef: OrderRef, opts?: {
|
|
2015
2018
|
quantity?: string;
|
|
2016
2019
|
} & Record<string, string | undefined>): Promise<AdapterTxResult>;
|
|
2017
|
-
cancelOrder(signer:
|
|
2018
|
-
registerOrder(signer:
|
|
2020
|
+
cancelOrder(signer: StarknetVenueSigner, orderRef: OrderRef): Promise<AdapterTxResult>;
|
|
2021
|
+
registerOrder(signer: StarknetVenueSigner, p: RegisterOrderParams): Promise<AdapterTxResult & {
|
|
2019
2022
|
orderRef: OrderRef;
|
|
2020
2023
|
}>;
|
|
2021
|
-
private
|
|
2024
|
+
private readCounter;
|
|
2025
|
+
/** 721 listing approval: `get_approved(tokenId) == marketplace` ⇒ no approve. */
|
|
2026
|
+
private approval721ForListing;
|
|
2027
|
+
/** 1155 listing approval: `is_approved_for_all(owner, marketplace)`. */
|
|
2028
|
+
private approval1155ForListing;
|
|
2029
|
+
/** Offers always approve the ERC-20 spend (no read). */
|
|
2030
|
+
private approvalForErc20;
|
|
2022
2031
|
/** The canonical Starknet order id = the contract-emitted `OrderCreated`
|
|
2023
2032
|
* hash (`keys[1]`), which is exactly what the indexer stores. */
|
|
2024
2033
|
private orderRefFromReceipt;
|
|
@@ -10288,4 +10297,6 @@ declare function build1155OrderTypedData(message: Record<string, unknown>, chain
|
|
|
10288
10297
|
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
10289
10298
|
declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
10290
10299
|
|
|
10291
|
-
|
|
10300
|
+
type StarknetVenueSigner = VenueSigner<TypedData, Call>;
|
|
10301
|
+
|
|
10302
|
+
export { type ApiRewardsConfig as $, ADMIN_HEADERS as A, type ApiCreatorProfile as B, type ApiIntent as C, type ApiIntentCreated as D, type ApiKeyStatus as E, type ApiMeta as F, type ApiMetadataSignedUrl as G, type ApiMetadataUpload as H, type ApiOrder as I, type ApiOrderConsideration as J, type ApiOrderOffer as K, type ApiOrderPrice as L, type ApiOrderTokenMeta as M, type ApiOrderTxHash as N, type ApiOrdersQuery as O, type ApiPointEvent as P, type ApiPortalKey as Q, type ApiPortalKeyCreated as R, type ServiceDefinition as S, type ApiPortalMe as T, type ApiPublicRemix as U, type ApiRemixOffer as V, type ApiRemixOfferPrice as W, type ApiRemixOffersQuery as X, type ApiResponse as Y, type ApiRewardsBadge as Z, type ApiRewardsBatchEntry as _, type ServiceCapability as a, FeeConfigSchema as a$, type ApiRewardsLeaderboardEntry as a0, type ApiRewardsLevel as a1, type ApiSearchCollectionResult as a2, type ApiSearchCreatorResult as a3, type ApiSearchResult as a4, type ApiSearchTokenResult as a5, type ApiToken as a6, type ApiTokenBalance as a7, type ApiTokenMetadata as a8, type ApiUsageDay as a9, type CreateCreatorCoinParams as aA, type CreateDropParams as aB, type CreateEventParams as aC, type CreateGrantOpts as aD, type CreateListing1155Params as aE, type CreateListingIntentParams as aF, type CreateListingParams as aG, type CreateMintIntentParams as aH, type CreatePopCollectionParams as aI, type CreateRemixOfferParams as aJ, type CreateSponsorshipOfferParams as aK, type CreateWebhookParams as aL, CreatorCoinFactoryABI as aM, type CreatorCoinPrice as aN, type CreatorCoinReceiptLike as aO, CreatorCoinService as aP, type DeployClubParams as aQ, type DeployCollectionParams as aR, DropCollectionABI as aS, DropFactoryABI as aT, type DropMintStatus as aU, DropService as aV, ERC1155CollectionService as aW, type EkuboLaunchParams as aX, type EkuboPoolParams as aY, type EnforcementDeclaration as aZ, type FeeConfig as a_, type ApiUserRewards as aa, type ApiUserWallet as ab, type ApiWebhookCreated as ac, type ApiWebhookEndpoint as ad, type AutoRemixOfferParams as ae, type BatchMintEditionParams as af, type BuildFeeCallParams as ag, MAX_SUPPLY as ah, MIN_SUPPLY as ai, type CancelOrder1155Params as aj, type CancelOrderIntentParams as ak, type CancelOrderParams as al, type Cancelation as am, type CartItem as an, type ChainFilter as ao, type ClaimConditions as ap, ClubService as aq, type CollectionSort as ar, type CollectionTokensSort as as, type ConfirmRemixOfferParams as at, type ConfirmSelfRemixParams as au, type ConsiderationItem as av, type CreateClubParams as aw, type CreateCollectionIntentParams as ax, type CreateCollectionParams as ay, type CreateCounterOfferIntentParams as az, ADMIN_SCOPE as b, StarknetVenue as b$, type FeeSurface as b0, type FulfillOrder1155Params as b1, type FulfillOrderIntentParams as b2, type FulfillOrderParams as b3, IPClubABI as b4, IPClubCollectionABI as b5, IPClubFactoryABI as b6, IPClubNFTABI as b7, IPCollection1155ABI as b8, IPCollection1155FactoryABI as b9, type MintEditionParams as bA, type MintParams as bB, type MintTicketsParams as bC, OPEN_LICENSES as bD, type OfferItem as bE, type OpenLicense as bF, type Order as bG, type OrderDetails as bH, type OrderParameters as bI, type OrderStatus as bJ, POPCollectionABI as bK, POPFactoryABI as bL, type ParsedAdminHeaders as bM, type PopBatchEligibilityItem as bN, type PopClaimStatus as bO, type PopEventType as bP, PopService as bQ, type RemixOfferStatus as bR, type RequestSiwsTokenArgs as bS, type ResolvedConfig as bT, type ResolvedFeeConfig as bU, type ResolvedOrder as bV, type RetryOptions as bW, type ServiceEventDeclaration as bX, type SiwsSigner as bY, type SortOrder as bZ, SponsorshipService as b_, IPCollectionABI as ba, IPGenesisABI as bb, IPMarketplaceABI as bc, IPNftABI as bd, IPSponsorshipABI as be, IPSponsorshipLicenseABI as bf, IPTicketCollectionABI as bg, IPTicketCollectionFactoryABI as bh, type IPType as bi, type IntentCall as bj, type IntentStatus as bk, type IntentType as bl, type IpAttribute as bm, type IpNftMetadata as bn, LAUNCH_PRICE_QUOTE_PER_COIN as bo, type MakeOffer1155Params as bp, type MakeOfferIntentParams as bq, type MakeOfferParams as br, MarketplaceModule as bs, Medialane1155ABI as bt, Medialane1155Module as bu, MedialaneApiError as bv, MedialaneClient as bw, type MedialaneConfig as bx, MedialaneError as by, type MedialaneErrorCode as bz, type ActivityType as c, type StarknetVenueDeps as c0, type StarknetVenueSigner as c1, type TenantPlan as c2, TicketService as c3, type TxResult as c4, VALIDATED_EKUBO_PARAMS as c5, type WebhookEventType as c6, type WebhookStatus as c7, adminRequestDigest as c8, build1155CancellationTypedData as c9, storeSiwsToken as cA, teamCoinsRaw as cB, validateName as cC, validateSupply as cD, validateSymbol as cE, verifyAdminRequestSig as cF, build1155OrderTypedData as ca, buildAdminSessionTypedData as cb, buildCancellationTypedData as cc, buildCreateCreatorCoinCall as cd, buildFeeCall as ce, buildLaunchOnEkuboCalls as cf, buildOrderTypedData as cg, buybackQuoteRaw as ch, toRaw as ci, createAdminSessionGrant as cj, encodeAdminHeaders as ck, encodeByteArray as cl, fdvHuman as cm, getCreatorCoinPrice as cn, getSiwsStorageKey as co, getStoredSiwsToken as cp, isSiwsTokenValid as cq, normalizeSiwsSignature as cr, parseAdminHeaders as cs, parseCreatorCoinCreated as ct, randomNonce as cu, requestSiwsToken as cv, resolveConfig as cw, resolveFeeConfig as cx, sessionKeyHashOf as cy, signAdminRequest as cz, type AddSupplyParams as d, type AdminGrant as e, type AdminRequest as f, type AdminRequestSig as g, type AdminSession as h, type AdminSessionTypedDataInput as i, type ApiActivitiesQuery as j, type ApiActivity as k, type ApiActivityPrice as l, type ApiAdminCollectionClaim as m, type ApiAppSource as n, type ApiChain as o, ApiClient as p, type ApiCoin as q, type ApiCoinsQuery as r, type ApiCollection as s, type ApiCollectionClaim as t, type ApiCollectionProfile as u, type ApiCollectionSlugClaim as v, type ApiCollectionsQuery as w, type ApiComment as x, type ApiCounterOffersQuery as y, type ApiCreatorListResult as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { C as Chain, V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams } from './types-
|
|
2
|
+
import { C as Chain, V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, h as VenueSigner } from './types-Bx3ax9lW.cjs';
|
|
3
3
|
import { AccountInterface, constants, TypedData, Call, ProviderInterface } from 'starknet';
|
|
4
4
|
|
|
5
5
|
interface RetryOptions {
|
|
@@ -1991,34 +1991,43 @@ interface ResolvedOrder {
|
|
|
1991
1991
|
*/
|
|
1992
1992
|
interface StarknetVenueDeps {
|
|
1993
1993
|
config: ResolvedConfig;
|
|
1994
|
+
/** Read provider for building (counter/approval reads) and the post-tx receipt. */
|
|
1994
1995
|
provider: ProviderInterface;
|
|
1995
|
-
/** Resolve a registered order (payment token,
|
|
1996
|
+
/** Resolve a registered order (payment token, per-unit price, venue) from its digest. */
|
|
1996
1997
|
resolveOrder: (orderRef: OrderRef) => Promise<ResolvedOrder>;
|
|
1997
1998
|
/** Resolve a collection's token standard (from the indexer). */
|
|
1998
1999
|
resolveStandard: (contract: string) => Promise<"ERC721" | "ERC1155">;
|
|
1999
2000
|
}
|
|
2000
2001
|
/**
|
|
2001
|
-
* First-class Starknet venue adapter.
|
|
2002
|
-
*
|
|
2003
|
-
*
|
|
2002
|
+
* First-class Starknet venue adapter. It orchestrates the marketplace protocol
|
|
2003
|
+
* over the chain-neutral {@link StarknetVenueSigner} capability port: it *builds*
|
|
2004
|
+
* typed data + calldata via the pure marketplace builders and *reads* chain state
|
|
2005
|
+
* (counter, approvals, receipt) on `deps.provider`, but it never signs or executes
|
|
2006
|
+
* itself — the app's signer does that (sign + submit + confirm). This is what lets
|
|
2007
|
+
* a single adapter drive every wallet (injected/Cartridge/Privy) and the AVNU
|
|
2008
|
+
* paymaster without knowing they differ.
|
|
2004
2009
|
*/
|
|
2005
|
-
declare class StarknetVenue implements VenueAdapter<
|
|
2010
|
+
declare class StarknetVenue implements VenueAdapter<StarknetVenueSigner> {
|
|
2006
2011
|
private readonly deps;
|
|
2007
2012
|
readonly chain: "STARKNET";
|
|
2008
|
-
private readonly m721;
|
|
2009
|
-
private readonly m1155;
|
|
2010
2013
|
constructor(deps: StarknetVenueDeps);
|
|
2011
|
-
incrementCounter(signer:
|
|
2014
|
+
incrementCounter(signer: StarknetVenueSigner): Promise<AdapterTxResult>;
|
|
2012
2015
|
getOrderDetails(orderRef: OrderRef): Promise<unknown>;
|
|
2013
2016
|
getCounter(address: string): Promise<bigint>;
|
|
2014
|
-
fulfillOrder(signer:
|
|
2017
|
+
fulfillOrder(signer: StarknetVenueSigner, orderRef: OrderRef, opts?: {
|
|
2015
2018
|
quantity?: string;
|
|
2016
2019
|
} & Record<string, string | undefined>): Promise<AdapterTxResult>;
|
|
2017
|
-
cancelOrder(signer:
|
|
2018
|
-
registerOrder(signer:
|
|
2020
|
+
cancelOrder(signer: StarknetVenueSigner, orderRef: OrderRef): Promise<AdapterTxResult>;
|
|
2021
|
+
registerOrder(signer: StarknetVenueSigner, p: RegisterOrderParams): Promise<AdapterTxResult & {
|
|
2019
2022
|
orderRef: OrderRef;
|
|
2020
2023
|
}>;
|
|
2021
|
-
private
|
|
2024
|
+
private readCounter;
|
|
2025
|
+
/** 721 listing approval: `get_approved(tokenId) == marketplace` ⇒ no approve. */
|
|
2026
|
+
private approval721ForListing;
|
|
2027
|
+
/** 1155 listing approval: `is_approved_for_all(owner, marketplace)`. */
|
|
2028
|
+
private approval1155ForListing;
|
|
2029
|
+
/** Offers always approve the ERC-20 spend (no read). */
|
|
2030
|
+
private approvalForErc20;
|
|
2022
2031
|
/** The canonical Starknet order id = the contract-emitted `OrderCreated`
|
|
2023
2032
|
* hash (`keys[1]`), which is exactly what the indexer stores. */
|
|
2024
2033
|
private orderRefFromReceipt;
|
|
@@ -10288,4 +10297,6 @@ declare function build1155OrderTypedData(message: Record<string, unknown>, chain
|
|
|
10288
10297
|
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
10289
10298
|
declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
10290
10299
|
|
|
10291
|
-
|
|
10300
|
+
type StarknetVenueSigner = VenueSigner<TypedData, Call>;
|
|
10301
|
+
|
|
10302
|
+
export { type ApiRewardsConfig as $, ADMIN_HEADERS as A, type ApiCreatorProfile as B, type ApiIntent as C, type ApiIntentCreated as D, type ApiKeyStatus as E, type ApiMeta as F, type ApiMetadataSignedUrl as G, type ApiMetadataUpload as H, type ApiOrder as I, type ApiOrderConsideration as J, type ApiOrderOffer as K, type ApiOrderPrice as L, type ApiOrderTokenMeta as M, type ApiOrderTxHash as N, type ApiOrdersQuery as O, type ApiPointEvent as P, type ApiPortalKey as Q, type ApiPortalKeyCreated as R, type ServiceDefinition as S, type ApiPortalMe as T, type ApiPublicRemix as U, type ApiRemixOffer as V, type ApiRemixOfferPrice as W, type ApiRemixOffersQuery as X, type ApiResponse as Y, type ApiRewardsBadge as Z, type ApiRewardsBatchEntry as _, type ServiceCapability as a, FeeConfigSchema as a$, type ApiRewardsLeaderboardEntry as a0, type ApiRewardsLevel as a1, type ApiSearchCollectionResult as a2, type ApiSearchCreatorResult as a3, type ApiSearchResult as a4, type ApiSearchTokenResult as a5, type ApiToken as a6, type ApiTokenBalance as a7, type ApiTokenMetadata as a8, type ApiUsageDay as a9, type CreateCreatorCoinParams as aA, type CreateDropParams as aB, type CreateEventParams as aC, type CreateGrantOpts as aD, type CreateListing1155Params as aE, type CreateListingIntentParams as aF, type CreateListingParams as aG, type CreateMintIntentParams as aH, type CreatePopCollectionParams as aI, type CreateRemixOfferParams as aJ, type CreateSponsorshipOfferParams as aK, type CreateWebhookParams as aL, CreatorCoinFactoryABI as aM, type CreatorCoinPrice as aN, type CreatorCoinReceiptLike as aO, CreatorCoinService as aP, type DeployClubParams as aQ, type DeployCollectionParams as aR, DropCollectionABI as aS, DropFactoryABI as aT, type DropMintStatus as aU, DropService as aV, ERC1155CollectionService as aW, type EkuboLaunchParams as aX, type EkuboPoolParams as aY, type EnforcementDeclaration as aZ, type FeeConfig as a_, type ApiUserRewards as aa, type ApiUserWallet as ab, type ApiWebhookCreated as ac, type ApiWebhookEndpoint as ad, type AutoRemixOfferParams as ae, type BatchMintEditionParams as af, type BuildFeeCallParams as ag, MAX_SUPPLY as ah, MIN_SUPPLY as ai, type CancelOrder1155Params as aj, type CancelOrderIntentParams as ak, type CancelOrderParams as al, type Cancelation as am, type CartItem as an, type ChainFilter as ao, type ClaimConditions as ap, ClubService as aq, type CollectionSort as ar, type CollectionTokensSort as as, type ConfirmRemixOfferParams as at, type ConfirmSelfRemixParams as au, type ConsiderationItem as av, type CreateClubParams as aw, type CreateCollectionIntentParams as ax, type CreateCollectionParams as ay, type CreateCounterOfferIntentParams as az, ADMIN_SCOPE as b, StarknetVenue as b$, type FeeSurface as b0, type FulfillOrder1155Params as b1, type FulfillOrderIntentParams as b2, type FulfillOrderParams as b3, IPClubABI as b4, IPClubCollectionABI as b5, IPClubFactoryABI as b6, IPClubNFTABI as b7, IPCollection1155ABI as b8, IPCollection1155FactoryABI as b9, type MintEditionParams as bA, type MintParams as bB, type MintTicketsParams as bC, OPEN_LICENSES as bD, type OfferItem as bE, type OpenLicense as bF, type Order as bG, type OrderDetails as bH, type OrderParameters as bI, type OrderStatus as bJ, POPCollectionABI as bK, POPFactoryABI as bL, type ParsedAdminHeaders as bM, type PopBatchEligibilityItem as bN, type PopClaimStatus as bO, type PopEventType as bP, PopService as bQ, type RemixOfferStatus as bR, type RequestSiwsTokenArgs as bS, type ResolvedConfig as bT, type ResolvedFeeConfig as bU, type ResolvedOrder as bV, type RetryOptions as bW, type ServiceEventDeclaration as bX, type SiwsSigner as bY, type SortOrder as bZ, SponsorshipService as b_, IPCollectionABI as ba, IPGenesisABI as bb, IPMarketplaceABI as bc, IPNftABI as bd, IPSponsorshipABI as be, IPSponsorshipLicenseABI as bf, IPTicketCollectionABI as bg, IPTicketCollectionFactoryABI as bh, type IPType as bi, type IntentCall as bj, type IntentStatus as bk, type IntentType as bl, type IpAttribute as bm, type IpNftMetadata as bn, LAUNCH_PRICE_QUOTE_PER_COIN as bo, type MakeOffer1155Params as bp, type MakeOfferIntentParams as bq, type MakeOfferParams as br, MarketplaceModule as bs, Medialane1155ABI as bt, Medialane1155Module as bu, MedialaneApiError as bv, MedialaneClient as bw, type MedialaneConfig as bx, MedialaneError as by, type MedialaneErrorCode as bz, type ActivityType as c, type StarknetVenueDeps as c0, type StarknetVenueSigner as c1, type TenantPlan as c2, TicketService as c3, type TxResult as c4, VALIDATED_EKUBO_PARAMS as c5, type WebhookEventType as c6, type WebhookStatus as c7, adminRequestDigest as c8, build1155CancellationTypedData as c9, storeSiwsToken as cA, teamCoinsRaw as cB, validateName as cC, validateSupply as cD, validateSymbol as cE, verifyAdminRequestSig as cF, build1155OrderTypedData as ca, buildAdminSessionTypedData as cb, buildCancellationTypedData as cc, buildCreateCreatorCoinCall as cd, buildFeeCall as ce, buildLaunchOnEkuboCalls as cf, buildOrderTypedData as cg, buybackQuoteRaw as ch, toRaw as ci, createAdminSessionGrant as cj, encodeAdminHeaders as ck, encodeByteArray as cl, fdvHuman as cm, getCreatorCoinPrice as cn, getSiwsStorageKey as co, getStoredSiwsToken as cp, isSiwsTokenValid as cq, normalizeSiwsSignature as cr, parseAdminHeaders as cs, parseCreatorCoinCreated as ct, randomNonce as cu, requestSiwsToken as cv, resolveConfig as cw, resolveFeeConfig as cx, sessionKeyHashOf as cy, signAdminRequest as cz, type AddSupplyParams as d, type AdminGrant as e, type AdminRequest as f, type AdminRequestSig as g, type AdminSession as h, type AdminSessionTypedDataInput as i, type ApiActivitiesQuery as j, type ApiActivity as k, type ApiActivityPrice as l, type ApiAdminCollectionClaim as m, type ApiAppSource as n, type ApiChain as o, ApiClient as p, type ApiCoin as q, type ApiCoinsQuery as r, type ApiCollection as s, type ApiCollectionClaim as t, type ApiCollectionProfile as u, type ApiCollectionSlugClaim as v, type ApiCollectionsQuery as w, type ApiComment as x, type ApiCounterOffersQuery as y, type ApiCreatorListResult as z };
|