@medialane/sdk 0.19.0 → 0.21.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/index.cjs +66 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +252 -8
- package/dist/index.d.ts +252 -8
- package/dist/index.js +65 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -426,6 +426,37 @@ interface EnforcementDeclaration {
|
|
|
426
426
|
timeLock?: boolean;
|
|
427
427
|
revocable?: boolean;
|
|
428
428
|
}
|
|
429
|
+
/** An on-chain event the service emits. The indexer consumes this list to
|
|
430
|
+
* decide what to poll and how to parse — the year-2 "data-driven event
|
|
431
|
+
* parser registry" foundation (02-protocol-app-split §V).
|
|
432
|
+
*
|
|
433
|
+
* The Cairo selector is derivable from `name` via
|
|
434
|
+
* `starknet.hash.getSelectorFromName(name)` — not stored to avoid
|
|
435
|
+
* duplication and keep the SDK runtime-free of pre-computed hashes.
|
|
436
|
+
*/
|
|
437
|
+
interface ServiceEventDeclaration {
|
|
438
|
+
/** Cairo event struct name (e.g. "OrderCreated", "CollectionCreated"). */
|
|
439
|
+
name: string;
|
|
440
|
+
/**
|
|
441
|
+
* Where this event is emitted:
|
|
442
|
+
* - "factory": at the service's `onchain.factoryAddress` (fixed address).
|
|
443
|
+
* Examples: marketplace OrderCreated, factory CollectionCreated.
|
|
444
|
+
* - "instance": at the address of each deployed collection contract
|
|
445
|
+
* (variable; the indexer iterates discovered instances).
|
|
446
|
+
* Examples: ERC-721 Transfer, POP AllowlistUpdated.
|
|
447
|
+
*/
|
|
448
|
+
emittedBy: "factory" | "instance";
|
|
449
|
+
/**
|
|
450
|
+
* Polling cadence the indexer should use:
|
|
451
|
+
* - "fast" (default): every indexer tick (~6s). Right for low-volume
|
|
452
|
+
* protocol events like order/factory events.
|
|
453
|
+
* - "slow": a separate slower loop (~2min). Right for
|
|
454
|
+
* high-volume per-instance events like Transfer
|
|
455
|
+
* and AllowlistUpdated — polling them every tick
|
|
456
|
+
* against every known instance is RPC-expensive.
|
|
457
|
+
*/
|
|
458
|
+
poll?: "fast" | "slow";
|
|
459
|
+
}
|
|
429
460
|
/** Declarative description of a service (05-service-model §II).
|
|
430
461
|
* SDK-resident in v1; on-chain registry in year 2. */
|
|
431
462
|
interface ServiceDefinition {
|
|
@@ -443,6 +474,12 @@ interface ServiceDefinition {
|
|
|
443
474
|
/** Drives the dapp asset/collection page variant. */
|
|
444
475
|
uiVariant: string;
|
|
445
476
|
capabilities: ServiceCapability[];
|
|
477
|
+
/** Events the indexer should poll + parse for this service.
|
|
478
|
+
* Optional during the year-1 transition — backend hand-coded pollers
|
|
479
|
+
* (medialane-backend/src/mirror/poller.ts) take precedence today.
|
|
480
|
+
* Populated here so consumers and the future data-driven indexer can
|
|
481
|
+
* read what events a service emits without code-spelunking. */
|
|
482
|
+
events?: ServiceEventDeclaration[];
|
|
446
483
|
metadataSchema?: {
|
|
447
484
|
requiredTraits?: string[];
|
|
448
485
|
/** Canonical platform default is "CC BY-SA" (04-licensing-model §III). */
|
|
@@ -5006,6 +5043,198 @@ declare const IPNftABI: readonly [{
|
|
|
5006
5043
|
}];
|
|
5007
5044
|
}];
|
|
5008
5045
|
|
|
5046
|
+
/**
|
|
5047
|
+
* The Medialane service registry (05-service-model §II, §VI).
|
|
5048
|
+
* Canonical long-form IDs (01-core-model §III). SDK-resident in v1;
|
|
5049
|
+
* on-chain registry in year 2 (08-dao-governance §IV).
|
|
5050
|
+
*
|
|
5051
|
+
* Year-2 forward-compat: cross-account identity uses the future `AccountID`
|
|
5052
|
+
* contract (07-identity-model §IV) — no field here yet, intentionally.
|
|
5053
|
+
*
|
|
5054
|
+
* Phase 2B.2 of the service-model refactor. `ip-erc721` has no dedicated
|
|
5055
|
+
* on-chain constant in src/constants.ts, so its `onchain` is omitted rather
|
|
5056
|
+
* than invented (the genesis contract address ships with that service).
|
|
5057
|
+
*/
|
|
5058
|
+
declare const SERVICES: {
|
|
5059
|
+
readonly "mip-erc721": {
|
|
5060
|
+
readonly id: "mip-erc721";
|
|
5061
|
+
readonly displayName: "IP Collection";
|
|
5062
|
+
readonly description: "Tokenize intellectual property as a per-creator ERC-721 collection.";
|
|
5063
|
+
readonly standard: "ERC721";
|
|
5064
|
+
readonly provenance: "MEDIALANE";
|
|
5065
|
+
readonly onchain: {
|
|
5066
|
+
readonly factoryAddress: "0x0322cb7119955e01ac778d40976eb3ba50540bb0899f812d612f9c7e63e49fd2";
|
|
5067
|
+
readonly startBlock: 10046166;
|
|
5068
|
+
};
|
|
5069
|
+
readonly uiVariant: "standard";
|
|
5070
|
+
readonly capabilities: ["list", "buy", "make_offer", "cancel", "transfer", "mint", "remix", "license"];
|
|
5071
|
+
readonly events: [{
|
|
5072
|
+
readonly name: "CollectionCreated";
|
|
5073
|
+
readonly emittedBy: "factory";
|
|
5074
|
+
}];
|
|
5075
|
+
readonly metadataSchema: {
|
|
5076
|
+
readonly licenseDefault: "CC BY-SA";
|
|
5077
|
+
};
|
|
5078
|
+
};
|
|
5079
|
+
readonly "ip-erc721": {
|
|
5080
|
+
readonly id: "ip-erc721";
|
|
5081
|
+
readonly displayName: "Programmable IP (genesis)";
|
|
5082
|
+
readonly description: "One shared ERC-721 contract; many wallets mint genesis pieces.";
|
|
5083
|
+
readonly standard: "ERC721";
|
|
5084
|
+
readonly provenance: "MEDIALANE";
|
|
5085
|
+
readonly uiVariant: "standard";
|
|
5086
|
+
readonly capabilities: ["list", "buy", "make_offer", "cancel", "transfer", "mint", "remix", "license"];
|
|
5087
|
+
readonly metadataSchema: {
|
|
5088
|
+
readonly licenseDefault: "CC BY-SA";
|
|
5089
|
+
};
|
|
5090
|
+
};
|
|
5091
|
+
readonly "mip-erc1155": {
|
|
5092
|
+
readonly id: "mip-erc1155";
|
|
5093
|
+
readonly displayName: "NFT Editions";
|
|
5094
|
+
readonly description: "Per-creator ERC-1155 collection; creator mints editions.";
|
|
5095
|
+
readonly standard: "ERC1155";
|
|
5096
|
+
readonly provenance: "MEDIALANE";
|
|
5097
|
+
readonly onchain: {
|
|
5098
|
+
readonly factoryAddress: "0x067064adcaaed61e17bf50ea802ea6482336126aec5b4d032b4ff8fbb5009131";
|
|
5099
|
+
readonly classHash: "0x281e13803c906f20bbe158efb44b7a0273c56fdebbeeb55b2ba59530ddb1c80";
|
|
5100
|
+
readonly startBlock: 10045611;
|
|
5101
|
+
};
|
|
5102
|
+
readonly uiVariant: "edition";
|
|
5103
|
+
readonly capabilities: ["list", "buy", "make_offer", "cancel", "transfer", "mint", "remix", "license"];
|
|
5104
|
+
readonly events: [{
|
|
5105
|
+
readonly name: "CollectionDeployed";
|
|
5106
|
+
readonly emittedBy: "factory";
|
|
5107
|
+
}];
|
|
5108
|
+
readonly metadataSchema: {
|
|
5109
|
+
readonly licenseDefault: "CC BY-SA";
|
|
5110
|
+
};
|
|
5111
|
+
};
|
|
5112
|
+
readonly "pop-protocol": {
|
|
5113
|
+
readonly id: "pop-protocol";
|
|
5114
|
+
readonly displayName: "POP Protocol";
|
|
5115
|
+
readonly description: "Soulbound proof-of-presence collectibles per event.";
|
|
5116
|
+
readonly standard: "ERC721";
|
|
5117
|
+
readonly provenance: "MEDIALANE";
|
|
5118
|
+
readonly onchain: {
|
|
5119
|
+
readonly factoryAddress: "0x00b32c34b427d8f346b5843ada6a37bd3368d879fc752cd52b68a87287f60111";
|
|
5120
|
+
readonly classHash: "0x077c421686f10851872561953ea16898d933364b7f8937a5d7e2b1ba0a36263f";
|
|
5121
|
+
};
|
|
5122
|
+
readonly uiVariant: "pop";
|
|
5123
|
+
readonly capabilities: ["claim", "transfer"];
|
|
5124
|
+
readonly events: [{
|
|
5125
|
+
readonly name: "CollectionCreated";
|
|
5126
|
+
readonly emittedBy: "factory";
|
|
5127
|
+
}, {
|
|
5128
|
+
readonly name: "AllowlistUpdated";
|
|
5129
|
+
readonly emittedBy: "instance";
|
|
5130
|
+
readonly poll: "slow";
|
|
5131
|
+
}];
|
|
5132
|
+
readonly metadataSchema: {
|
|
5133
|
+
readonly licenseDefault: "CC BY-SA";
|
|
5134
|
+
};
|
|
5135
|
+
};
|
|
5136
|
+
readonly "drop-collection": {
|
|
5137
|
+
readonly id: "drop-collection";
|
|
5138
|
+
readonly displayName: "Collection Drop";
|
|
5139
|
+
readonly description: "Sequential mint with claim windows + allowlist.";
|
|
5140
|
+
readonly standard: "ERC721";
|
|
5141
|
+
readonly provenance: "MEDIALANE";
|
|
5142
|
+
readonly onchain: {
|
|
5143
|
+
readonly factoryAddress: "0x03587f42e29daee1b193f6cf83bf8627908ed6632d0d83fcb26225c50547d800";
|
|
5144
|
+
readonly classHash: "0x00092e72cdb63067521e803aaf7d4101c3e3ce026ae6bc045ec4228027e58282";
|
|
5145
|
+
};
|
|
5146
|
+
readonly uiVariant: "drop";
|
|
5147
|
+
readonly capabilities: ["claim", "list", "buy", "make_offer", "cancel", "transfer"];
|
|
5148
|
+
readonly events: [{
|
|
5149
|
+
readonly name: "DropCreated";
|
|
5150
|
+
readonly emittedBy: "factory";
|
|
5151
|
+
}, {
|
|
5152
|
+
readonly name: "AllowlistUpdated";
|
|
5153
|
+
readonly emittedBy: "instance";
|
|
5154
|
+
readonly poll: "slow";
|
|
5155
|
+
}];
|
|
5156
|
+
readonly metadataSchema: {
|
|
5157
|
+
readonly licenseDefault: "CC BY-SA";
|
|
5158
|
+
};
|
|
5159
|
+
};
|
|
5160
|
+
readonly "medialane-marketplace-erc721": {
|
|
5161
|
+
readonly id: "medialane-marketplace-erc721";
|
|
5162
|
+
readonly displayName: "Medialane Marketplace (ERC-721)";
|
|
5163
|
+
readonly description: "ERC-721 order matching venue.";
|
|
5164
|
+
readonly standard: "ERC721";
|
|
5165
|
+
readonly provenance: "MEDIALANE";
|
|
5166
|
+
readonly onchain: {
|
|
5167
|
+
readonly factoryAddress: "0x00f8ccaae0bc811c79605974cc1dab769b9cea8877f033f8e3c17f30457caba6";
|
|
5168
|
+
readonly classHash: "0x03dff4f34b976207246207954263be9a28b51390321702443291088dcdf4b2e6";
|
|
5169
|
+
readonly startBlock: 9196722;
|
|
5170
|
+
};
|
|
5171
|
+
readonly uiVariant: "standard";
|
|
5172
|
+
readonly capabilities: ["list", "buy", "make_offer", "cancel"];
|
|
5173
|
+
readonly events: [{
|
|
5174
|
+
readonly name: "OrderCreated";
|
|
5175
|
+
readonly emittedBy: "factory";
|
|
5176
|
+
}, {
|
|
5177
|
+
readonly name: "OrderFulfilled";
|
|
5178
|
+
readonly emittedBy: "factory";
|
|
5179
|
+
}, {
|
|
5180
|
+
readonly name: "OrderCancelled";
|
|
5181
|
+
readonly emittedBy: "factory";
|
|
5182
|
+
}];
|
|
5183
|
+
};
|
|
5184
|
+
readonly "medialane-marketplace-erc1155": {
|
|
5185
|
+
readonly id: "medialane-marketplace-erc1155";
|
|
5186
|
+
readonly displayName: "Medialane Marketplace (ERC-1155)";
|
|
5187
|
+
readonly description: "ERC-1155 order matching venue.";
|
|
5188
|
+
readonly standard: "ERC1155";
|
|
5189
|
+
readonly provenance: "MEDIALANE";
|
|
5190
|
+
readonly onchain: {
|
|
5191
|
+
readonly factoryAddress: "0x02bfa521c25461a09d735889b469418608d7d92f8b26e3d37ef174a4c2e22f99";
|
|
5192
|
+
readonly classHash: "0x01b674aad934be85abc7c1970265cbf7e9bc7d586a90f0a67112c201636dbdd3";
|
|
5193
|
+
readonly startBlock: 9260304;
|
|
5194
|
+
};
|
|
5195
|
+
readonly uiVariant: "edition";
|
|
5196
|
+
readonly capabilities: ["list", "buy", "make_offer", "cancel"];
|
|
5197
|
+
readonly events: [{
|
|
5198
|
+
readonly name: "OrderCreated";
|
|
5199
|
+
readonly emittedBy: "factory";
|
|
5200
|
+
}, {
|
|
5201
|
+
readonly name: "OrderFulfilled";
|
|
5202
|
+
readonly emittedBy: "factory";
|
|
5203
|
+
}, {
|
|
5204
|
+
readonly name: "OrderCancelled";
|
|
5205
|
+
readonly emittedBy: "factory";
|
|
5206
|
+
}];
|
|
5207
|
+
};
|
|
5208
|
+
readonly "external-erc721": {
|
|
5209
|
+
readonly id: "external-erc721";
|
|
5210
|
+
readonly displayName: "External ERC-721";
|
|
5211
|
+
readonly description: "ERC-721 contract not deployed via a Medialane service.";
|
|
5212
|
+
readonly standard: "ERC721";
|
|
5213
|
+
readonly provenance: "EXTERNAL";
|
|
5214
|
+
readonly uiVariant: "standard";
|
|
5215
|
+
readonly capabilities: ["list", "buy", "make_offer", "cancel", "transfer"];
|
|
5216
|
+
};
|
|
5217
|
+
readonly "external-erc1155": {
|
|
5218
|
+
readonly id: "external-erc1155";
|
|
5219
|
+
readonly displayName: "External ERC-1155";
|
|
5220
|
+
readonly description: "ERC-1155 contract not deployed via a Medialane service.";
|
|
5221
|
+
readonly standard: "ERC1155";
|
|
5222
|
+
readonly provenance: "EXTERNAL";
|
|
5223
|
+
readonly uiVariant: "edition";
|
|
5224
|
+
readonly capabilities: ["list", "buy", "make_offer", "cancel", "transfer"];
|
|
5225
|
+
};
|
|
5226
|
+
};
|
|
5227
|
+
/**
|
|
5228
|
+
* Literal-union of every registered service ID. Use this as the type for
|
|
5229
|
+
* `Collection.service` write sites in consumers — typos like "pop_protocol"
|
|
5230
|
+
* (underscore instead of hyphen) become compile errors.
|
|
5231
|
+
*
|
|
5232
|
+
* `getService()` still accepts loose `string` for read-side lookups where the
|
|
5233
|
+
* value came from the DB and is trusted to already be valid.
|
|
5234
|
+
*/
|
|
5235
|
+
type ServiceId = keyof typeof SERVICES;
|
|
5236
|
+
/** Type guard: narrows a string to ServiceId if it's registered. */
|
|
5237
|
+
declare function isServiceId(id: string | null | undefined): id is ServiceId;
|
|
5009
5238
|
/** Lookup. Returns undefined for unregistered service IDs — callers should
|
|
5010
5239
|
* treat that as a data error, since every Collection.service value is
|
|
5011
5240
|
* expected to map to a registered ServiceDefinition. */
|
|
@@ -5016,9 +5245,24 @@ declare function listServices(): ServiceDefinition[];
|
|
|
5016
5245
|
declare function getServicesByCapability(cap: ServiceCapability): ServiceDefinition[];
|
|
5017
5246
|
|
|
5018
5247
|
/**
|
|
5019
|
-
* Normalize a Starknet address to a 0x-prefixed 64-character hex
|
|
5248
|
+
* Normalize a Starknet address to a 0x-prefixed 64-character lowercase hex
|
|
5249
|
+
* string. Validates the input by routing through `BigInt(...)` — non-numeric
|
|
5250
|
+
* input throws `Invalid Starknet address: "<input>"`.
|
|
5251
|
+
*
|
|
5252
|
+
* The single source of truth for address normalization across Medialane.
|
|
5253
|
+
* `medialane-backend` re-exports this; do not maintain a parallel copy.
|
|
5020
5254
|
*/
|
|
5021
5255
|
declare function normalizeAddress(address: string): string;
|
|
5256
|
+
/**
|
|
5257
|
+
* Normalize a Starknet felt/hash (tx hash, order hash, etc.) to a 0x-prefixed
|
|
5258
|
+
* 64-character lowercase hex string. Same shape as `normalizeAddress` — kept
|
|
5259
|
+
* as a separate name so the *intent* of each call site is explicit.
|
|
5260
|
+
*
|
|
5261
|
+
* Starknet RPCs and wallets may omit leading zeroes for the same value;
|
|
5262
|
+
* database uniqueness must not treat those textual variants as different
|
|
5263
|
+
* transactions.
|
|
5264
|
+
*/
|
|
5265
|
+
declare function normalizeHash(hash: string): string;
|
|
5022
5266
|
/**
|
|
5023
5267
|
* Shorten an address to "0x1234...abcd" format.
|
|
5024
5268
|
*/
|
|
@@ -5078,17 +5322,17 @@ declare function encodeByteArray(str: string): string[];
|
|
|
5078
5322
|
* The shape is identical across ERC-721 and ERC-1155 (nested OfferItem +
|
|
5079
5323
|
* ConsiderationItem) — only the domain version differs.
|
|
5080
5324
|
*/
|
|
5081
|
-
declare function buildOrderTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5082
|
-
declare function build1155OrderTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5325
|
+
declare function buildOrderTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
5326
|
+
declare function build1155OrderTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
5083
5327
|
/**
|
|
5084
5328
|
* Build SNIP-12 typed data for an OrderFulfillment struct.
|
|
5085
5329
|
* ERC-1155 adds a `quantity` field so the contract can verify the partial-fill
|
|
5086
5330
|
* amount; ERC-721 omits it (always single-fill).
|
|
5087
5331
|
*/
|
|
5088
|
-
declare function buildFulfillmentTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5089
|
-
declare function build1155FulfillmentTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5332
|
+
declare function buildFulfillmentTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
5333
|
+
declare function build1155FulfillmentTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
5090
5334
|
/** OrderCancellation typed data — identical shape across both standards. */
|
|
5091
|
-
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5092
|
-
declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5335
|
+
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
5336
|
+
declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
5093
5337
|
|
|
5094
|
-
export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, type ApiAppSource, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWalletType, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintItemParams, type BuildFeeCallParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET, COLLECTION_1155_START_BLOCK_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_721_START_BLOCK_MAINNET, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type ClaimConditions, CollectionRegistryABI, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateDropParams, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, ERC1155CollectionService, type EnforcementDeclaration, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPCOLLECTION_CLASS_HASH_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, IPNFT_CLASS_HASH_MAINNET, IPNftABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintItemParams, type MintParams, NFTCOMMENTS_CONTRACT_MAINNET, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type ResolvedFeeConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type ServiceCapability, type ServiceDefinition, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, build1155CancellationTypedData, build1155FulfillmentTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFeeCall, buildFulfillmentTypedData, buildOrderTypedData, encodeByteArray, formatAmount, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, listServices, normalizeAddress, parseAmount, resolveConfig, resolveFeeConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
5338
|
+
export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, type ApiAppSource, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWalletType, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintItemParams, type BuildFeeCallParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET, COLLECTION_1155_START_BLOCK_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_721_START_BLOCK_MAINNET, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type ClaimConditions, CollectionRegistryABI, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateDropParams, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, ERC1155CollectionService, type EnforcementDeclaration, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPCOLLECTION_CLASS_HASH_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, IPNFT_CLASS_HASH_MAINNET, IPNftABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintItemParams, type MintParams, NFTCOMMENTS_CONTRACT_MAINNET, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type ResolvedFeeConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type ServiceCapability, type ServiceDefinition, type ServiceEventDeclaration, type ServiceId, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, build1155CancellationTypedData, build1155FulfillmentTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFeeCall, buildFulfillmentTypedData, buildOrderTypedData, encodeByteArray, formatAmount, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, isServiceId, listServices, normalizeAddress, normalizeHash, parseAmount, resolveConfig, resolveFeeConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
package/dist/index.d.ts
CHANGED
|
@@ -426,6 +426,37 @@ interface EnforcementDeclaration {
|
|
|
426
426
|
timeLock?: boolean;
|
|
427
427
|
revocable?: boolean;
|
|
428
428
|
}
|
|
429
|
+
/** An on-chain event the service emits. The indexer consumes this list to
|
|
430
|
+
* decide what to poll and how to parse — the year-2 "data-driven event
|
|
431
|
+
* parser registry" foundation (02-protocol-app-split §V).
|
|
432
|
+
*
|
|
433
|
+
* The Cairo selector is derivable from `name` via
|
|
434
|
+
* `starknet.hash.getSelectorFromName(name)` — not stored to avoid
|
|
435
|
+
* duplication and keep the SDK runtime-free of pre-computed hashes.
|
|
436
|
+
*/
|
|
437
|
+
interface ServiceEventDeclaration {
|
|
438
|
+
/** Cairo event struct name (e.g. "OrderCreated", "CollectionCreated"). */
|
|
439
|
+
name: string;
|
|
440
|
+
/**
|
|
441
|
+
* Where this event is emitted:
|
|
442
|
+
* - "factory": at the service's `onchain.factoryAddress` (fixed address).
|
|
443
|
+
* Examples: marketplace OrderCreated, factory CollectionCreated.
|
|
444
|
+
* - "instance": at the address of each deployed collection contract
|
|
445
|
+
* (variable; the indexer iterates discovered instances).
|
|
446
|
+
* Examples: ERC-721 Transfer, POP AllowlistUpdated.
|
|
447
|
+
*/
|
|
448
|
+
emittedBy: "factory" | "instance";
|
|
449
|
+
/**
|
|
450
|
+
* Polling cadence the indexer should use:
|
|
451
|
+
* - "fast" (default): every indexer tick (~6s). Right for low-volume
|
|
452
|
+
* protocol events like order/factory events.
|
|
453
|
+
* - "slow": a separate slower loop (~2min). Right for
|
|
454
|
+
* high-volume per-instance events like Transfer
|
|
455
|
+
* and AllowlistUpdated — polling them every tick
|
|
456
|
+
* against every known instance is RPC-expensive.
|
|
457
|
+
*/
|
|
458
|
+
poll?: "fast" | "slow";
|
|
459
|
+
}
|
|
429
460
|
/** Declarative description of a service (05-service-model §II).
|
|
430
461
|
* SDK-resident in v1; on-chain registry in year 2. */
|
|
431
462
|
interface ServiceDefinition {
|
|
@@ -443,6 +474,12 @@ interface ServiceDefinition {
|
|
|
443
474
|
/** Drives the dapp asset/collection page variant. */
|
|
444
475
|
uiVariant: string;
|
|
445
476
|
capabilities: ServiceCapability[];
|
|
477
|
+
/** Events the indexer should poll + parse for this service.
|
|
478
|
+
* Optional during the year-1 transition — backend hand-coded pollers
|
|
479
|
+
* (medialane-backend/src/mirror/poller.ts) take precedence today.
|
|
480
|
+
* Populated here so consumers and the future data-driven indexer can
|
|
481
|
+
* read what events a service emits without code-spelunking. */
|
|
482
|
+
events?: ServiceEventDeclaration[];
|
|
446
483
|
metadataSchema?: {
|
|
447
484
|
requiredTraits?: string[];
|
|
448
485
|
/** Canonical platform default is "CC BY-SA" (04-licensing-model §III). */
|
|
@@ -5006,6 +5043,198 @@ declare const IPNftABI: readonly [{
|
|
|
5006
5043
|
}];
|
|
5007
5044
|
}];
|
|
5008
5045
|
|
|
5046
|
+
/**
|
|
5047
|
+
* The Medialane service registry (05-service-model §II, §VI).
|
|
5048
|
+
* Canonical long-form IDs (01-core-model §III). SDK-resident in v1;
|
|
5049
|
+
* on-chain registry in year 2 (08-dao-governance §IV).
|
|
5050
|
+
*
|
|
5051
|
+
* Year-2 forward-compat: cross-account identity uses the future `AccountID`
|
|
5052
|
+
* contract (07-identity-model §IV) — no field here yet, intentionally.
|
|
5053
|
+
*
|
|
5054
|
+
* Phase 2B.2 of the service-model refactor. `ip-erc721` has no dedicated
|
|
5055
|
+
* on-chain constant in src/constants.ts, so its `onchain` is omitted rather
|
|
5056
|
+
* than invented (the genesis contract address ships with that service).
|
|
5057
|
+
*/
|
|
5058
|
+
declare const SERVICES: {
|
|
5059
|
+
readonly "mip-erc721": {
|
|
5060
|
+
readonly id: "mip-erc721";
|
|
5061
|
+
readonly displayName: "IP Collection";
|
|
5062
|
+
readonly description: "Tokenize intellectual property as a per-creator ERC-721 collection.";
|
|
5063
|
+
readonly standard: "ERC721";
|
|
5064
|
+
readonly provenance: "MEDIALANE";
|
|
5065
|
+
readonly onchain: {
|
|
5066
|
+
readonly factoryAddress: "0x0322cb7119955e01ac778d40976eb3ba50540bb0899f812d612f9c7e63e49fd2";
|
|
5067
|
+
readonly startBlock: 10046166;
|
|
5068
|
+
};
|
|
5069
|
+
readonly uiVariant: "standard";
|
|
5070
|
+
readonly capabilities: ["list", "buy", "make_offer", "cancel", "transfer", "mint", "remix", "license"];
|
|
5071
|
+
readonly events: [{
|
|
5072
|
+
readonly name: "CollectionCreated";
|
|
5073
|
+
readonly emittedBy: "factory";
|
|
5074
|
+
}];
|
|
5075
|
+
readonly metadataSchema: {
|
|
5076
|
+
readonly licenseDefault: "CC BY-SA";
|
|
5077
|
+
};
|
|
5078
|
+
};
|
|
5079
|
+
readonly "ip-erc721": {
|
|
5080
|
+
readonly id: "ip-erc721";
|
|
5081
|
+
readonly displayName: "Programmable IP (genesis)";
|
|
5082
|
+
readonly description: "One shared ERC-721 contract; many wallets mint genesis pieces.";
|
|
5083
|
+
readonly standard: "ERC721";
|
|
5084
|
+
readonly provenance: "MEDIALANE";
|
|
5085
|
+
readonly uiVariant: "standard";
|
|
5086
|
+
readonly capabilities: ["list", "buy", "make_offer", "cancel", "transfer", "mint", "remix", "license"];
|
|
5087
|
+
readonly metadataSchema: {
|
|
5088
|
+
readonly licenseDefault: "CC BY-SA";
|
|
5089
|
+
};
|
|
5090
|
+
};
|
|
5091
|
+
readonly "mip-erc1155": {
|
|
5092
|
+
readonly id: "mip-erc1155";
|
|
5093
|
+
readonly displayName: "NFT Editions";
|
|
5094
|
+
readonly description: "Per-creator ERC-1155 collection; creator mints editions.";
|
|
5095
|
+
readonly standard: "ERC1155";
|
|
5096
|
+
readonly provenance: "MEDIALANE";
|
|
5097
|
+
readonly onchain: {
|
|
5098
|
+
readonly factoryAddress: "0x067064adcaaed61e17bf50ea802ea6482336126aec5b4d032b4ff8fbb5009131";
|
|
5099
|
+
readonly classHash: "0x281e13803c906f20bbe158efb44b7a0273c56fdebbeeb55b2ba59530ddb1c80";
|
|
5100
|
+
readonly startBlock: 10045611;
|
|
5101
|
+
};
|
|
5102
|
+
readonly uiVariant: "edition";
|
|
5103
|
+
readonly capabilities: ["list", "buy", "make_offer", "cancel", "transfer", "mint", "remix", "license"];
|
|
5104
|
+
readonly events: [{
|
|
5105
|
+
readonly name: "CollectionDeployed";
|
|
5106
|
+
readonly emittedBy: "factory";
|
|
5107
|
+
}];
|
|
5108
|
+
readonly metadataSchema: {
|
|
5109
|
+
readonly licenseDefault: "CC BY-SA";
|
|
5110
|
+
};
|
|
5111
|
+
};
|
|
5112
|
+
readonly "pop-protocol": {
|
|
5113
|
+
readonly id: "pop-protocol";
|
|
5114
|
+
readonly displayName: "POP Protocol";
|
|
5115
|
+
readonly description: "Soulbound proof-of-presence collectibles per event.";
|
|
5116
|
+
readonly standard: "ERC721";
|
|
5117
|
+
readonly provenance: "MEDIALANE";
|
|
5118
|
+
readonly onchain: {
|
|
5119
|
+
readonly factoryAddress: "0x00b32c34b427d8f346b5843ada6a37bd3368d879fc752cd52b68a87287f60111";
|
|
5120
|
+
readonly classHash: "0x077c421686f10851872561953ea16898d933364b7f8937a5d7e2b1ba0a36263f";
|
|
5121
|
+
};
|
|
5122
|
+
readonly uiVariant: "pop";
|
|
5123
|
+
readonly capabilities: ["claim", "transfer"];
|
|
5124
|
+
readonly events: [{
|
|
5125
|
+
readonly name: "CollectionCreated";
|
|
5126
|
+
readonly emittedBy: "factory";
|
|
5127
|
+
}, {
|
|
5128
|
+
readonly name: "AllowlistUpdated";
|
|
5129
|
+
readonly emittedBy: "instance";
|
|
5130
|
+
readonly poll: "slow";
|
|
5131
|
+
}];
|
|
5132
|
+
readonly metadataSchema: {
|
|
5133
|
+
readonly licenseDefault: "CC BY-SA";
|
|
5134
|
+
};
|
|
5135
|
+
};
|
|
5136
|
+
readonly "drop-collection": {
|
|
5137
|
+
readonly id: "drop-collection";
|
|
5138
|
+
readonly displayName: "Collection Drop";
|
|
5139
|
+
readonly description: "Sequential mint with claim windows + allowlist.";
|
|
5140
|
+
readonly standard: "ERC721";
|
|
5141
|
+
readonly provenance: "MEDIALANE";
|
|
5142
|
+
readonly onchain: {
|
|
5143
|
+
readonly factoryAddress: "0x03587f42e29daee1b193f6cf83bf8627908ed6632d0d83fcb26225c50547d800";
|
|
5144
|
+
readonly classHash: "0x00092e72cdb63067521e803aaf7d4101c3e3ce026ae6bc045ec4228027e58282";
|
|
5145
|
+
};
|
|
5146
|
+
readonly uiVariant: "drop";
|
|
5147
|
+
readonly capabilities: ["claim", "list", "buy", "make_offer", "cancel", "transfer"];
|
|
5148
|
+
readonly events: [{
|
|
5149
|
+
readonly name: "DropCreated";
|
|
5150
|
+
readonly emittedBy: "factory";
|
|
5151
|
+
}, {
|
|
5152
|
+
readonly name: "AllowlistUpdated";
|
|
5153
|
+
readonly emittedBy: "instance";
|
|
5154
|
+
readonly poll: "slow";
|
|
5155
|
+
}];
|
|
5156
|
+
readonly metadataSchema: {
|
|
5157
|
+
readonly licenseDefault: "CC BY-SA";
|
|
5158
|
+
};
|
|
5159
|
+
};
|
|
5160
|
+
readonly "medialane-marketplace-erc721": {
|
|
5161
|
+
readonly id: "medialane-marketplace-erc721";
|
|
5162
|
+
readonly displayName: "Medialane Marketplace (ERC-721)";
|
|
5163
|
+
readonly description: "ERC-721 order matching venue.";
|
|
5164
|
+
readonly standard: "ERC721";
|
|
5165
|
+
readonly provenance: "MEDIALANE";
|
|
5166
|
+
readonly onchain: {
|
|
5167
|
+
readonly factoryAddress: "0x00f8ccaae0bc811c79605974cc1dab769b9cea8877f033f8e3c17f30457caba6";
|
|
5168
|
+
readonly classHash: "0x03dff4f34b976207246207954263be9a28b51390321702443291088dcdf4b2e6";
|
|
5169
|
+
readonly startBlock: 9196722;
|
|
5170
|
+
};
|
|
5171
|
+
readonly uiVariant: "standard";
|
|
5172
|
+
readonly capabilities: ["list", "buy", "make_offer", "cancel"];
|
|
5173
|
+
readonly events: [{
|
|
5174
|
+
readonly name: "OrderCreated";
|
|
5175
|
+
readonly emittedBy: "factory";
|
|
5176
|
+
}, {
|
|
5177
|
+
readonly name: "OrderFulfilled";
|
|
5178
|
+
readonly emittedBy: "factory";
|
|
5179
|
+
}, {
|
|
5180
|
+
readonly name: "OrderCancelled";
|
|
5181
|
+
readonly emittedBy: "factory";
|
|
5182
|
+
}];
|
|
5183
|
+
};
|
|
5184
|
+
readonly "medialane-marketplace-erc1155": {
|
|
5185
|
+
readonly id: "medialane-marketplace-erc1155";
|
|
5186
|
+
readonly displayName: "Medialane Marketplace (ERC-1155)";
|
|
5187
|
+
readonly description: "ERC-1155 order matching venue.";
|
|
5188
|
+
readonly standard: "ERC1155";
|
|
5189
|
+
readonly provenance: "MEDIALANE";
|
|
5190
|
+
readonly onchain: {
|
|
5191
|
+
readonly factoryAddress: "0x02bfa521c25461a09d735889b469418608d7d92f8b26e3d37ef174a4c2e22f99";
|
|
5192
|
+
readonly classHash: "0x01b674aad934be85abc7c1970265cbf7e9bc7d586a90f0a67112c201636dbdd3";
|
|
5193
|
+
readonly startBlock: 9260304;
|
|
5194
|
+
};
|
|
5195
|
+
readonly uiVariant: "edition";
|
|
5196
|
+
readonly capabilities: ["list", "buy", "make_offer", "cancel"];
|
|
5197
|
+
readonly events: [{
|
|
5198
|
+
readonly name: "OrderCreated";
|
|
5199
|
+
readonly emittedBy: "factory";
|
|
5200
|
+
}, {
|
|
5201
|
+
readonly name: "OrderFulfilled";
|
|
5202
|
+
readonly emittedBy: "factory";
|
|
5203
|
+
}, {
|
|
5204
|
+
readonly name: "OrderCancelled";
|
|
5205
|
+
readonly emittedBy: "factory";
|
|
5206
|
+
}];
|
|
5207
|
+
};
|
|
5208
|
+
readonly "external-erc721": {
|
|
5209
|
+
readonly id: "external-erc721";
|
|
5210
|
+
readonly displayName: "External ERC-721";
|
|
5211
|
+
readonly description: "ERC-721 contract not deployed via a Medialane service.";
|
|
5212
|
+
readonly standard: "ERC721";
|
|
5213
|
+
readonly provenance: "EXTERNAL";
|
|
5214
|
+
readonly uiVariant: "standard";
|
|
5215
|
+
readonly capabilities: ["list", "buy", "make_offer", "cancel", "transfer"];
|
|
5216
|
+
};
|
|
5217
|
+
readonly "external-erc1155": {
|
|
5218
|
+
readonly id: "external-erc1155";
|
|
5219
|
+
readonly displayName: "External ERC-1155";
|
|
5220
|
+
readonly description: "ERC-1155 contract not deployed via a Medialane service.";
|
|
5221
|
+
readonly standard: "ERC1155";
|
|
5222
|
+
readonly provenance: "EXTERNAL";
|
|
5223
|
+
readonly uiVariant: "edition";
|
|
5224
|
+
readonly capabilities: ["list", "buy", "make_offer", "cancel", "transfer"];
|
|
5225
|
+
};
|
|
5226
|
+
};
|
|
5227
|
+
/**
|
|
5228
|
+
* Literal-union of every registered service ID. Use this as the type for
|
|
5229
|
+
* `Collection.service` write sites in consumers — typos like "pop_protocol"
|
|
5230
|
+
* (underscore instead of hyphen) become compile errors.
|
|
5231
|
+
*
|
|
5232
|
+
* `getService()` still accepts loose `string` for read-side lookups where the
|
|
5233
|
+
* value came from the DB and is trusted to already be valid.
|
|
5234
|
+
*/
|
|
5235
|
+
type ServiceId = keyof typeof SERVICES;
|
|
5236
|
+
/** Type guard: narrows a string to ServiceId if it's registered. */
|
|
5237
|
+
declare function isServiceId(id: string | null | undefined): id is ServiceId;
|
|
5009
5238
|
/** Lookup. Returns undefined for unregistered service IDs — callers should
|
|
5010
5239
|
* treat that as a data error, since every Collection.service value is
|
|
5011
5240
|
* expected to map to a registered ServiceDefinition. */
|
|
@@ -5016,9 +5245,24 @@ declare function listServices(): ServiceDefinition[];
|
|
|
5016
5245
|
declare function getServicesByCapability(cap: ServiceCapability): ServiceDefinition[];
|
|
5017
5246
|
|
|
5018
5247
|
/**
|
|
5019
|
-
* Normalize a Starknet address to a 0x-prefixed 64-character hex
|
|
5248
|
+
* Normalize a Starknet address to a 0x-prefixed 64-character lowercase hex
|
|
5249
|
+
* string. Validates the input by routing through `BigInt(...)` — non-numeric
|
|
5250
|
+
* input throws `Invalid Starknet address: "<input>"`.
|
|
5251
|
+
*
|
|
5252
|
+
* The single source of truth for address normalization across Medialane.
|
|
5253
|
+
* `medialane-backend` re-exports this; do not maintain a parallel copy.
|
|
5020
5254
|
*/
|
|
5021
5255
|
declare function normalizeAddress(address: string): string;
|
|
5256
|
+
/**
|
|
5257
|
+
* Normalize a Starknet felt/hash (tx hash, order hash, etc.) to a 0x-prefixed
|
|
5258
|
+
* 64-character lowercase hex string. Same shape as `normalizeAddress` — kept
|
|
5259
|
+
* as a separate name so the *intent* of each call site is explicit.
|
|
5260
|
+
*
|
|
5261
|
+
* Starknet RPCs and wallets may omit leading zeroes for the same value;
|
|
5262
|
+
* database uniqueness must not treat those textual variants as different
|
|
5263
|
+
* transactions.
|
|
5264
|
+
*/
|
|
5265
|
+
declare function normalizeHash(hash: string): string;
|
|
5022
5266
|
/**
|
|
5023
5267
|
* Shorten an address to "0x1234...abcd" format.
|
|
5024
5268
|
*/
|
|
@@ -5078,17 +5322,17 @@ declare function encodeByteArray(str: string): string[];
|
|
|
5078
5322
|
* The shape is identical across ERC-721 and ERC-1155 (nested OfferItem +
|
|
5079
5323
|
* ConsiderationItem) — only the domain version differs.
|
|
5080
5324
|
*/
|
|
5081
|
-
declare function buildOrderTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5082
|
-
declare function build1155OrderTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5325
|
+
declare function buildOrderTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
5326
|
+
declare function build1155OrderTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
5083
5327
|
/**
|
|
5084
5328
|
* Build SNIP-12 typed data for an OrderFulfillment struct.
|
|
5085
5329
|
* ERC-1155 adds a `quantity` field so the contract can verify the partial-fill
|
|
5086
5330
|
* amount; ERC-721 omits it (always single-fill).
|
|
5087
5331
|
*/
|
|
5088
|
-
declare function buildFulfillmentTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5089
|
-
declare function build1155FulfillmentTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5332
|
+
declare function buildFulfillmentTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
5333
|
+
declare function build1155FulfillmentTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
5090
5334
|
/** OrderCancellation typed data — identical shape across both standards. */
|
|
5091
|
-
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5092
|
-
declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5335
|
+
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
5336
|
+
declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
5093
5337
|
|
|
5094
|
-
export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, type ApiAppSource, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWalletType, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintItemParams, type BuildFeeCallParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET, COLLECTION_1155_START_BLOCK_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_721_START_BLOCK_MAINNET, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type ClaimConditions, CollectionRegistryABI, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateDropParams, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, ERC1155CollectionService, type EnforcementDeclaration, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPCOLLECTION_CLASS_HASH_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, IPNFT_CLASS_HASH_MAINNET, IPNftABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintItemParams, type MintParams, NFTCOMMENTS_CONTRACT_MAINNET, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type ResolvedFeeConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type ServiceCapability, type ServiceDefinition, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, build1155CancellationTypedData, build1155FulfillmentTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFeeCall, buildFulfillmentTypedData, buildOrderTypedData, encodeByteArray, formatAmount, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, listServices, normalizeAddress, parseAmount, resolveConfig, resolveFeeConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
5338
|
+
export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, type ApiAppSource, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWalletType, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintItemParams, type BuildFeeCallParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET, COLLECTION_1155_START_BLOCK_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_721_START_BLOCK_MAINNET, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type ClaimConditions, CollectionRegistryABI, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateDropParams, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, ERC1155CollectionService, type EnforcementDeclaration, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPCOLLECTION_CLASS_HASH_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, IPNFT_CLASS_HASH_MAINNET, IPNftABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintItemParams, type MintParams, NFTCOMMENTS_CONTRACT_MAINNET, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type ResolvedFeeConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type ServiceCapability, type ServiceDefinition, type ServiceEventDeclaration, type ServiceId, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, build1155CancellationTypedData, build1155FulfillmentTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFeeCall, buildFulfillmentTypedData, buildOrderTypedData, encodeByteArray, formatAmount, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, isServiceId, listServices, normalizeAddress, normalizeHash, parseAmount, resolveConfig, resolveFeeConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|