@medialane/sdk 0.118.2 → 0.119.1

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.
@@ -495,6 +495,11 @@ type ApiIntentCreated = {
495
495
  requiresSignature: false;
496
496
  calls: IntentCall[];
497
497
  };
498
+ interface ApiTxSyncResult {
499
+ applied: number;
500
+ contracts?: string[];
501
+ pending: boolean;
502
+ }
498
503
  interface CreateListingIntentParams {
499
504
  offerer: string;
500
505
  nftContract: string;
@@ -1098,6 +1103,7 @@ declare class ApiClient {
1098
1103
  getIntent(id: string): Promise<ApiResponse<ApiIntent>>;
1099
1104
  submitIntentSignature(id: string, signature: string[]): Promise<ApiResponse<ApiIntent>>;
1100
1105
  confirmIntent(id: string, txHash: string): Promise<ApiResponse<ApiIntent>>;
1106
+ syncTransaction(txHash: string): Promise<ApiResponse<ApiTxSyncResult>>;
1101
1107
  createMintIntent(params: CreateMintIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
1102
1108
  createCollectionIntent(params: CreateCollectionIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
1103
1109
  createTierIntent(params: CreateTierIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
@@ -1377,4 +1383,4 @@ interface ProposeSponsorshipParams {
1377
1383
  royaltyBps: bigint | string;
1378
1384
  }
1379
1385
 
1380
- export { type ApiRemixOffersQuery as $, type AcceptSponsorshipBidIntentParams as A, type ApiCreditPayment as B, type ApiEmissionCall as C, type ApiEmissionResult as D, type ApiIntent as E, type ApiIntentCreated as F, type ApiKeyStatus as G, type ApiMeta as H, type ApiMetadataSignedUrl as I, type ApiMetadataUpload as J, type ApiOrder as K, type ApiOrderConsideration as L, type ApiOrderOffer as M, type ApiOrderPrice as N, type ApiOrderTokenMeta as O, type ApiOrderTxHash as P, type ApiOrdersQuery as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiPointEvent as T, type ApiPortalKey as U, type ApiPortalKeyCreated as V, type ApiPortalMe as W, type ApiPortalSpend as X, type ApiPublicRemix as Y, type ApiRemixOffer as Z, type ApiRemixOfferPrice as _, type ServiceCapability as a, type MedialaneErrorCode as a$, type ApiResponse as a0, type ApiRewardsBadge as a1, type ApiRewardsBatchEntry as a2, type ApiRewardsConfig as a3, type ApiRewardsLeaderboardEntry as a4, type ApiRewardsLevel as a5, type ApiSearchCollectionResult as a6, type ApiSearchCreatorResult as a7, type ApiSearchResult as a8, type ApiSearchTokenResult as a9, type CreateMembershipParams as aA, type CreateMintIntentParams as aB, type CreatePopCollectionParams as aC, type CreateRemixOfferParams as aD, type CreateSponsorshipOfferIntentParams as aE, type CreateSponsorshipOfferParams as aF, type CreateSponsorshipProposalIntentParams as aG, type CreateTicketParams as aH, type CreateTierIntentParams as aI, type CreateWebhookParams as aJ, type DropMintStatus as aK, type EmissionParams as aL, type EnforcementDeclaration as aM, type FactoryFamilyServiceId as aN, type FeeConfig as aO, FeeConfigSchema as aP, type FulfillOrderIntentParams as aQ, type IPType as aR, type IntentCall as aS, type IntentStatus as aT, type IntentType as aU, type IpAttribute as aV, type IpNftMetadata as aW, type LaunchCoinIntentParams as aX, type MakeOfferIntentParams as aY, MedialaneApiError as aZ, type MedialaneConfig as a_, type ApiSpendByAction as aa, type ApiToken as ab, type ApiTokenBalance as ac, type ApiTokenMetadata as ad, type ApiUserRewards as ae, type ApiUserWallet as af, type ApiWalletActivity as ag, type ApiWebhookCreated as ah, type ApiWebhookEndpoint as ai, type AutoRemixOfferParams as aj, type CancelOrderIntentParams as ak, type ChainFilter as al, type CheckoutIntentItem as am, type ClaimConditions as an, type CollectionServiceId as ao, type CollectionSort as ap, type CollectionTokensSort as aq, type ConfirmRemixOfferParams as ar, type ConfirmSelfRemixParams as as, type ConsiderationItem as at, type CreateCheckoutIntentParams as au, type CreateCoinIntentParams as av, type CreateCollectionIntentParams as aw, type CreateCounterOfferIntentParams as ax, type CreateDropParams as ay, type CreateListingIntentParams as az, type AcceptSponsorshipProposalIntentParams as b, type MintMembershipsParams as b0, type MintTicketsParams as b1, OPEN_LICENSES as b2, type OfferItem as b3, type OpenLicense as b4, type Order as b5, type OrderDetails as b6, type OrderParameters as b7, type OrderStatus as b8, type PlaceSponsorshipBidIntentParams as b9, type PopBatchEligibilityItem as ba, type PopClaimStatus as bb, type PopEventType as bc, type ProposeSponsorshipParams as bd, type RejectSponsorshipProposalIntentParams as be, type RemixOfferStatus as bf, type ResolvedConfig as bg, type RetractSponsorshipBidIntentParams as bh, type RetryOptions as bi, type ServiceEventDeclaration as bj, type SetSponsorshipOfferOpenIntentParams as bk, type SortOrder as bl, type TenantPlan as bm, type TierServiceId as bn, type TxResult as bo, type UpdateCollectionProfileInput as bp, type WebhookEventType as bq, type WebhookStatus as br, type WithdrawSponsorshipProposalIntentParams as bs, resolveConfig as bt, resolveFeeConfig as bu, type ActivityType as c, type ApiActivitiesQuery as d, type ApiActivity as e, type ApiActivityPrice as f, type ApiAdminCollectionClaim as g, type ApiAppSource as h, type ApiBusinessProvisioning as i, type ApiChain as j, type ApiCheckoutIntentResult as k, ApiClient as l, type ApiCoin as m, type ApiCoinClaimResult as n, type ApiCoinPrice as o, type ApiCoinPrices as p, type ApiCoinsQuery as q, type ApiCollection as r, type ApiCollectionClaim as s, type ApiCollectionProfile as t, type ApiCollectionSlugClaim as u, type ApiCollectionsQuery as v, type ApiComment as w, type ApiCounterOffersQuery as x, type ApiCreatorListResult as y, type ApiCreatorProfile as z };
1386
+ export { type ApiRemixOffersQuery as $, type AcceptSponsorshipBidIntentParams as A, type ApiCreditPayment as B, type ApiEmissionCall as C, type ApiEmissionResult as D, type ApiIntent as E, type ApiIntentCreated as F, type ApiKeyStatus as G, type ApiMeta as H, type ApiMetadataSignedUrl as I, type ApiMetadataUpload as J, type ApiOrder as K, type ApiOrderConsideration as L, type ApiOrderOffer as M, type ApiOrderPrice as N, type ApiOrderTokenMeta as O, type ApiOrderTxHash as P, type ApiOrdersQuery as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiPointEvent as T, type ApiPortalKey as U, type ApiPortalKeyCreated as V, type ApiPortalMe as W, type ApiPortalSpend as X, type ApiPublicRemix as Y, type ApiRemixOffer as Z, type ApiRemixOfferPrice as _, type ServiceCapability as a, type MedialaneConfig as a$, type ApiResponse as a0, type ApiRewardsBadge as a1, type ApiRewardsBatchEntry as a2, type ApiRewardsConfig as a3, type ApiRewardsLeaderboardEntry as a4, type ApiRewardsLevel as a5, type ApiSearchCollectionResult as a6, type ApiSearchCreatorResult as a7, type ApiSearchResult as a8, type ApiSearchTokenResult as a9, type CreateListingIntentParams as aA, type CreateMembershipParams as aB, type CreateMintIntentParams as aC, type CreatePopCollectionParams as aD, type CreateRemixOfferParams as aE, type CreateSponsorshipOfferIntentParams as aF, type CreateSponsorshipOfferParams as aG, type CreateSponsorshipProposalIntentParams as aH, type CreateTicketParams as aI, type CreateTierIntentParams as aJ, type CreateWebhookParams as aK, type DropMintStatus as aL, type EmissionParams as aM, type EnforcementDeclaration as aN, type FactoryFamilyServiceId as aO, type FeeConfig as aP, FeeConfigSchema as aQ, type FulfillOrderIntentParams as aR, type IPType as aS, type IntentCall as aT, type IntentStatus as aU, type IntentType as aV, type IpAttribute as aW, type IpNftMetadata as aX, type LaunchCoinIntentParams as aY, type MakeOfferIntentParams as aZ, MedialaneApiError as a_, type ApiSpendByAction as aa, type ApiToken as ab, type ApiTokenBalance as ac, type ApiTokenMetadata as ad, type ApiTxSyncResult as ae, type ApiUserRewards as af, type ApiUserWallet as ag, type ApiWalletActivity as ah, type ApiWebhookCreated as ai, type ApiWebhookEndpoint as aj, type AutoRemixOfferParams as ak, type CancelOrderIntentParams as al, type ChainFilter as am, type CheckoutIntentItem as an, type ClaimConditions as ao, type CollectionServiceId as ap, type CollectionSort as aq, type CollectionTokensSort as ar, type ConfirmRemixOfferParams as as, type ConfirmSelfRemixParams as at, type ConsiderationItem as au, type CreateCheckoutIntentParams as av, type CreateCoinIntentParams as aw, type CreateCollectionIntentParams as ax, type CreateCounterOfferIntentParams as ay, type CreateDropParams as az, type AcceptSponsorshipProposalIntentParams as b, type MedialaneErrorCode as b0, type MintMembershipsParams as b1, type MintTicketsParams as b2, OPEN_LICENSES as b3, type OfferItem as b4, type OpenLicense as b5, type Order as b6, type OrderDetails as b7, type OrderParameters as b8, type OrderStatus as b9, type PlaceSponsorshipBidIntentParams as ba, type PopBatchEligibilityItem as bb, type PopClaimStatus as bc, type PopEventType as bd, type ProposeSponsorshipParams as be, type RejectSponsorshipProposalIntentParams as bf, type RemixOfferStatus as bg, type ResolvedConfig as bh, type RetractSponsorshipBidIntentParams as bi, type RetryOptions as bj, type ServiceEventDeclaration as bk, type SetSponsorshipOfferOpenIntentParams as bl, type SortOrder as bm, type TenantPlan as bn, type TierServiceId as bo, type TxResult as bp, type UpdateCollectionProfileInput as bq, type WebhookEventType as br, type WebhookStatus as bs, type WithdrawSponsorshipProposalIntentParams as bt, resolveConfig as bu, resolveFeeConfig as bv, type ActivityType as c, type ApiActivitiesQuery as d, type ApiActivity as e, type ApiActivityPrice as f, type ApiAdminCollectionClaim as g, type ApiAppSource as h, type ApiBusinessProvisioning as i, type ApiChain as j, type ApiCheckoutIntentResult as k, ApiClient as l, type ApiCoin as m, type ApiCoinClaimResult as n, type ApiCoinPrice as o, type ApiCoinPrices as p, type ApiCoinsQuery as q, type ApiCollection as r, type ApiCollectionClaim as s, type ApiCollectionProfile as t, type ApiCollectionSlugClaim as u, type ApiCollectionsQuery as v, type ApiComment as w, type ApiCounterOffersQuery as x, type ApiCreatorListResult as y, type ApiCreatorProfile as z };
@@ -495,6 +495,11 @@ type ApiIntentCreated = {
495
495
  requiresSignature: false;
496
496
  calls: IntentCall[];
497
497
  };
498
+ interface ApiTxSyncResult {
499
+ applied: number;
500
+ contracts?: string[];
501
+ pending: boolean;
502
+ }
498
503
  interface CreateListingIntentParams {
499
504
  offerer: string;
500
505
  nftContract: string;
@@ -1098,6 +1103,7 @@ declare class ApiClient {
1098
1103
  getIntent(id: string): Promise<ApiResponse<ApiIntent>>;
1099
1104
  submitIntentSignature(id: string, signature: string[]): Promise<ApiResponse<ApiIntent>>;
1100
1105
  confirmIntent(id: string, txHash: string): Promise<ApiResponse<ApiIntent>>;
1106
+ syncTransaction(txHash: string): Promise<ApiResponse<ApiTxSyncResult>>;
1101
1107
  createMintIntent(params: CreateMintIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
1102
1108
  createCollectionIntent(params: CreateCollectionIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
1103
1109
  createTierIntent(params: CreateTierIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
@@ -1377,4 +1383,4 @@ interface ProposeSponsorshipParams {
1377
1383
  royaltyBps: bigint | string;
1378
1384
  }
1379
1385
 
1380
- export { type ApiRemixOffersQuery as $, type AcceptSponsorshipBidIntentParams as A, type ApiCreditPayment as B, type ApiEmissionCall as C, type ApiEmissionResult as D, type ApiIntent as E, type ApiIntentCreated as F, type ApiKeyStatus as G, type ApiMeta as H, type ApiMetadataSignedUrl as I, type ApiMetadataUpload as J, type ApiOrder as K, type ApiOrderConsideration as L, type ApiOrderOffer as M, type ApiOrderPrice as N, type ApiOrderTokenMeta as O, type ApiOrderTxHash as P, type ApiOrdersQuery as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiPointEvent as T, type ApiPortalKey as U, type ApiPortalKeyCreated as V, type ApiPortalMe as W, type ApiPortalSpend as X, type ApiPublicRemix as Y, type ApiRemixOffer as Z, type ApiRemixOfferPrice as _, type ServiceCapability as a, type MedialaneErrorCode as a$, type ApiResponse as a0, type ApiRewardsBadge as a1, type ApiRewardsBatchEntry as a2, type ApiRewardsConfig as a3, type ApiRewardsLeaderboardEntry as a4, type ApiRewardsLevel as a5, type ApiSearchCollectionResult as a6, type ApiSearchCreatorResult as a7, type ApiSearchResult as a8, type ApiSearchTokenResult as a9, type CreateMembershipParams as aA, type CreateMintIntentParams as aB, type CreatePopCollectionParams as aC, type CreateRemixOfferParams as aD, type CreateSponsorshipOfferIntentParams as aE, type CreateSponsorshipOfferParams as aF, type CreateSponsorshipProposalIntentParams as aG, type CreateTicketParams as aH, type CreateTierIntentParams as aI, type CreateWebhookParams as aJ, type DropMintStatus as aK, type EmissionParams as aL, type EnforcementDeclaration as aM, type FactoryFamilyServiceId as aN, type FeeConfig as aO, FeeConfigSchema as aP, type FulfillOrderIntentParams as aQ, type IPType as aR, type IntentCall as aS, type IntentStatus as aT, type IntentType as aU, type IpAttribute as aV, type IpNftMetadata as aW, type LaunchCoinIntentParams as aX, type MakeOfferIntentParams as aY, MedialaneApiError as aZ, type MedialaneConfig as a_, type ApiSpendByAction as aa, type ApiToken as ab, type ApiTokenBalance as ac, type ApiTokenMetadata as ad, type ApiUserRewards as ae, type ApiUserWallet as af, type ApiWalletActivity as ag, type ApiWebhookCreated as ah, type ApiWebhookEndpoint as ai, type AutoRemixOfferParams as aj, type CancelOrderIntentParams as ak, type ChainFilter as al, type CheckoutIntentItem as am, type ClaimConditions as an, type CollectionServiceId as ao, type CollectionSort as ap, type CollectionTokensSort as aq, type ConfirmRemixOfferParams as ar, type ConfirmSelfRemixParams as as, type ConsiderationItem as at, type CreateCheckoutIntentParams as au, type CreateCoinIntentParams as av, type CreateCollectionIntentParams as aw, type CreateCounterOfferIntentParams as ax, type CreateDropParams as ay, type CreateListingIntentParams as az, type AcceptSponsorshipProposalIntentParams as b, type MintMembershipsParams as b0, type MintTicketsParams as b1, OPEN_LICENSES as b2, type OfferItem as b3, type OpenLicense as b4, type Order as b5, type OrderDetails as b6, type OrderParameters as b7, type OrderStatus as b8, type PlaceSponsorshipBidIntentParams as b9, type PopBatchEligibilityItem as ba, type PopClaimStatus as bb, type PopEventType as bc, type ProposeSponsorshipParams as bd, type RejectSponsorshipProposalIntentParams as be, type RemixOfferStatus as bf, type ResolvedConfig as bg, type RetractSponsorshipBidIntentParams as bh, type RetryOptions as bi, type ServiceEventDeclaration as bj, type SetSponsorshipOfferOpenIntentParams as bk, type SortOrder as bl, type TenantPlan as bm, type TierServiceId as bn, type TxResult as bo, type UpdateCollectionProfileInput as bp, type WebhookEventType as bq, type WebhookStatus as br, type WithdrawSponsorshipProposalIntentParams as bs, resolveConfig as bt, resolveFeeConfig as bu, type ActivityType as c, type ApiActivitiesQuery as d, type ApiActivity as e, type ApiActivityPrice as f, type ApiAdminCollectionClaim as g, type ApiAppSource as h, type ApiBusinessProvisioning as i, type ApiChain as j, type ApiCheckoutIntentResult as k, ApiClient as l, type ApiCoin as m, type ApiCoinClaimResult as n, type ApiCoinPrice as o, type ApiCoinPrices as p, type ApiCoinsQuery as q, type ApiCollection as r, type ApiCollectionClaim as s, type ApiCollectionProfile as t, type ApiCollectionSlugClaim as u, type ApiCollectionsQuery as v, type ApiComment as w, type ApiCounterOffersQuery as x, type ApiCreatorListResult as y, type ApiCreatorProfile as z };
1386
+ export { type ApiRemixOffersQuery as $, type AcceptSponsorshipBidIntentParams as A, type ApiCreditPayment as B, type ApiEmissionCall as C, type ApiEmissionResult as D, type ApiIntent as E, type ApiIntentCreated as F, type ApiKeyStatus as G, type ApiMeta as H, type ApiMetadataSignedUrl as I, type ApiMetadataUpload as J, type ApiOrder as K, type ApiOrderConsideration as L, type ApiOrderOffer as M, type ApiOrderPrice as N, type ApiOrderTokenMeta as O, type ApiOrderTxHash as P, type ApiOrdersQuery as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiPointEvent as T, type ApiPortalKey as U, type ApiPortalKeyCreated as V, type ApiPortalMe as W, type ApiPortalSpend as X, type ApiPublicRemix as Y, type ApiRemixOffer as Z, type ApiRemixOfferPrice as _, type ServiceCapability as a, type MedialaneConfig as a$, type ApiResponse as a0, type ApiRewardsBadge as a1, type ApiRewardsBatchEntry as a2, type ApiRewardsConfig as a3, type ApiRewardsLeaderboardEntry as a4, type ApiRewardsLevel as a5, type ApiSearchCollectionResult as a6, type ApiSearchCreatorResult as a7, type ApiSearchResult as a8, type ApiSearchTokenResult as a9, type CreateListingIntentParams as aA, type CreateMembershipParams as aB, type CreateMintIntentParams as aC, type CreatePopCollectionParams as aD, type CreateRemixOfferParams as aE, type CreateSponsorshipOfferIntentParams as aF, type CreateSponsorshipOfferParams as aG, type CreateSponsorshipProposalIntentParams as aH, type CreateTicketParams as aI, type CreateTierIntentParams as aJ, type CreateWebhookParams as aK, type DropMintStatus as aL, type EmissionParams as aM, type EnforcementDeclaration as aN, type FactoryFamilyServiceId as aO, type FeeConfig as aP, FeeConfigSchema as aQ, type FulfillOrderIntentParams as aR, type IPType as aS, type IntentCall as aT, type IntentStatus as aU, type IntentType as aV, type IpAttribute as aW, type IpNftMetadata as aX, type LaunchCoinIntentParams as aY, type MakeOfferIntentParams as aZ, MedialaneApiError as a_, type ApiSpendByAction as aa, type ApiToken as ab, type ApiTokenBalance as ac, type ApiTokenMetadata as ad, type ApiTxSyncResult as ae, type ApiUserRewards as af, type ApiUserWallet as ag, type ApiWalletActivity as ah, type ApiWebhookCreated as ai, type ApiWebhookEndpoint as aj, type AutoRemixOfferParams as ak, type CancelOrderIntentParams as al, type ChainFilter as am, type CheckoutIntentItem as an, type ClaimConditions as ao, type CollectionServiceId as ap, type CollectionSort as aq, type CollectionTokensSort as ar, type ConfirmRemixOfferParams as as, type ConfirmSelfRemixParams as at, type ConsiderationItem as au, type CreateCheckoutIntentParams as av, type CreateCoinIntentParams as aw, type CreateCollectionIntentParams as ax, type CreateCounterOfferIntentParams as ay, type CreateDropParams as az, type AcceptSponsorshipProposalIntentParams as b, type MedialaneErrorCode as b0, type MintMembershipsParams as b1, type MintTicketsParams as b2, OPEN_LICENSES as b3, type OfferItem as b4, type OpenLicense as b5, type Order as b6, type OrderDetails as b7, type OrderParameters as b8, type OrderStatus as b9, type PlaceSponsorshipBidIntentParams as ba, type PopBatchEligibilityItem as bb, type PopClaimStatus as bc, type PopEventType as bd, type ProposeSponsorshipParams as be, type RejectSponsorshipProposalIntentParams as bf, type RemixOfferStatus as bg, type ResolvedConfig as bh, type RetractSponsorshipBidIntentParams as bi, type RetryOptions as bj, type ServiceEventDeclaration as bk, type SetSponsorshipOfferOpenIntentParams as bl, type SortOrder as bm, type TenantPlan as bn, type TierServiceId as bo, type TxResult as bp, type UpdateCollectionProfileInput as bq, type WebhookEventType as br, type WebhookStatus as bs, type WithdrawSponsorshipProposalIntentParams as bt, resolveConfig as bu, resolveFeeConfig as bv, type ActivityType as c, type ApiActivitiesQuery as d, type ApiActivity as e, type ApiActivityPrice as f, type ApiAdminCollectionClaim as g, type ApiAppSource as h, type ApiBusinessProvisioning as i, type ApiChain as j, type ApiCheckoutIntentResult as k, ApiClient as l, type ApiCoin as m, type ApiCoinClaimResult as n, type ApiCoinPrice as o, type ApiCoinPrices as p, type ApiCoinsQuery as q, type ApiCollection as r, type ApiCollectionClaim as s, type ApiCollectionProfile as t, type ApiCollectionSlugClaim as u, type ApiCollectionsQuery as v, type ApiComment as w, type ApiCounterOffersQuery as x, type ApiCreatorListResult as y, type ApiCreatorProfile as z };
@@ -155,10 +155,10 @@ function normalizeEvm(address) {
155
155
  const m = /^0x([0-9a-fA-F]{40})$/.exec(address);
156
156
  if (!m) throw new Error(`Invalid ETHEREUM/BASE address: "${address}"`);
157
157
  const lower = m[1].toLowerCase();
158
- const hash7 = sha3_js.keccak_256(new TextEncoder().encode(lower));
158
+ const hash8 = sha3_js.keccak_256(new TextEncoder().encode(lower));
159
159
  let out = "0x";
160
160
  for (let i = 0; i < 40; i++) {
161
- const nibble = hash7[i >> 1] >> (i % 2 === 0 ? 4 : 0) & 15;
161
+ const nibble = hash8[i >> 1] >> (i % 2 === 0 ? 4 : 0) & 15;
162
162
  out += nibble >= 8 ? lower[i].toUpperCase() : lower[i];
163
163
  }
164
164
  return out;
@@ -444,6 +444,9 @@ var ApiClient = class {
444
444
  confirmIntent(id, txHash) {
445
445
  return this.patch(`/v1/intents/${id}/confirm`, { txHash });
446
446
  }
447
+ syncTransaction(txHash) {
448
+ return this.post("/v1/tx/sync", { txHash });
449
+ }
447
450
  createMintIntent(params) {
448
451
  return this.post("/v1/intents/mint", params);
449
452
  }
@@ -11620,6 +11623,21 @@ async function confirmIntentBestEffort(client, intentId, txHash) {
11620
11623
  await client.api.confirmIntent(intentId, txHash).catch(() => {
11621
11624
  });
11622
11625
  }
11626
+ var SYNC_TIMEOUT_MS = 6e3;
11627
+ async function syncTransactionBestEffort(client, txHash, timeoutMs = SYNC_TIMEOUT_MS) {
11628
+ let timer;
11629
+ const timeout = new Promise((resolve) => {
11630
+ timer = setTimeout(() => resolve(), timeoutMs);
11631
+ });
11632
+ const sync = client.api.syncTransaction(txHash).then(() => {
11633
+ }, () => {
11634
+ });
11635
+ try {
11636
+ await Promise.race([sync, timeout]);
11637
+ } finally {
11638
+ if (timer) clearTimeout(timer);
11639
+ }
11640
+ }
11623
11641
  var RECEIPT_RETRY_DELAYS_MS = [0, 3e3, 5e3, 7e3, 1e4];
11624
11642
  async function assertTransactionSucceeded(provider, txHash, retryDelaysMs = RECEIPT_RETRY_DELAYS_MS) {
11625
11643
  for (let attempt = 0; attempt < retryDelaysMs.length; attempt++) {
@@ -11631,7 +11649,7 @@ async function assertTransactionSucceeded(provider, txHash, retryDelaysMs = RECE
11631
11649
  if (status === "REVERTED" || status === "REJECTED") {
11632
11650
  throw new Error("Transaction was submitted but reverted onchain. Please check your balance and try again.");
11633
11651
  }
11634
- if (status) return;
11652
+ if (status) return receipt;
11635
11653
  } catch (err) {
11636
11654
  if (err instanceof Error && err.message.includes("reverted onchain")) throw err;
11637
11655
  }
@@ -11648,11 +11666,12 @@ async function executeIntent(provider, signer, client, intent, opts = {}) {
11648
11666
  calls = intent.calls;
11649
11667
  }
11650
11668
  const { txHash } = await signer.execute(calls);
11651
- await assertTransactionSucceeded(provider, txHash);
11652
- if (opts.confirm !== false) {
11653
- await confirmIntentBestEffort(client, intent.id, txHash);
11654
- }
11655
- return { txHash };
11669
+ const receipt = await assertTransactionSucceeded(provider, txHash);
11670
+ await Promise.all([
11671
+ syncTransactionBestEffort(client, txHash),
11672
+ opts.confirm !== false ? confirmIntentBestEffort(client, intent.id, txHash) : void 0
11673
+ ]);
11674
+ return { txHash, receipt };
11656
11675
  }
11657
11676
  async function executeIntents(provider, signer, client, intents, opts = {}) {
11658
11677
  if (intents.some((i) => i.requiresSignature)) {
@@ -11660,17 +11679,357 @@ async function executeIntents(provider, signer, client, intents, opts = {}) {
11660
11679
  }
11661
11680
  const calls = intents.flatMap((i) => i.calls);
11662
11681
  const { txHash } = await signer.execute(calls);
11663
- await assertTransactionSucceeded(provider, txHash);
11664
- if (opts.confirm !== false) {
11665
- await Promise.all(intents.map((i) => confirmIntentBestEffort(client, i.id, txHash)));
11682
+ const receipt = await assertTransactionSucceeded(provider, txHash);
11683
+ await Promise.all([
11684
+ syncTransactionBestEffort(client, txHash),
11685
+ ...opts.confirm !== false ? intents.map((i) => confirmIntentBestEffort(client, i.id, txHash)) : []
11686
+ ]);
11687
+ return { txHash, receipt };
11688
+ }
11689
+
11690
+ // src/services/registry.ts
11691
+ var SN2 = getStarknetCoordinates("STARKNET");
11692
+ var SERVICES = {
11693
+ "mip-erc721": {
11694
+ id: "mip-erc721",
11695
+ displayName: "IP Collection",
11696
+ description: "Tokenize intellectual property as a per-creator ERC-721 collection.",
11697
+ standard: "ERC721",
11698
+ provenance: "MEDIALANE",
11699
+ onchain: {
11700
+ STARKNET: {
11701
+ factoryAddress: SN2.collection721,
11702
+ startBlock: SN2.collection721StartBlock
11703
+ }
11704
+ },
11705
+ uiVariant: "standard",
11706
+ capabilities: ["list", "buy", "make_offer", "cancel", "transfer", "mint", "remix", "license"],
11707
+ events: [
11708
+ { name: "CollectionCreated", emittedBy: "factory" }
11709
+ ],
11710
+ metadataSchema: { licenseDefault: "CC BY-SA" }
11711
+ },
11712
+ "ip-erc721": {
11713
+ id: "ip-erc721",
11714
+ displayName: "Programmable IP",
11715
+ description: "One shared ERC-721 contract any wallet can mint into.",
11716
+ standard: "ERC721",
11717
+ provenance: "MEDIALANE",
11718
+ uiVariant: "standard",
11719
+ capabilities: ["list", "buy", "make_offer", "cancel", "transfer", "mint", "remix", "license"],
11720
+ metadataSchema: { licenseDefault: "CC BY-SA" }
11721
+ },
11722
+ "data-tokenization-erc721": {
11723
+ id: "data-tokenization-erc721",
11724
+ displayName: "Data Tokenization",
11725
+ description: "Establish verifiable ownership of your data, with licensing terms that hold up wherever it travels.",
11726
+ standard: "ERC721",
11727
+ provenance: "MEDIALANE",
11728
+ onchain: {
11729
+ STARKNET: {
11730
+ factoryAddress: SN2.dataTokenization721,
11731
+ startBlock: SN2.dataTokenization721StartBlock
11732
+ }
11733
+ },
11734
+ uiVariant: "standard",
11735
+ capabilities: ["list", "buy", "make_offer", "cancel", "transfer", "mint", "remix", "license"],
11736
+ events: [
11737
+ { name: "CollectionCreated", emittedBy: "factory" }
11738
+ ],
11739
+ metadataSchema: { licenseDefault: "CC BY-SA" }
11740
+ },
11741
+ "mip-erc1155": {
11742
+ id: "mip-erc1155",
11743
+ displayName: "NFT Editions",
11744
+ description: "Per-creator ERC-1155 collection; creator mints editions.",
11745
+ standard: "ERC1155",
11746
+ provenance: "MEDIALANE",
11747
+ onchain: {
11748
+ STARKNET: {
11749
+ factoryAddress: SN2.collection1155,
11750
+ classHash: SN2.collection1155ClassHash,
11751
+ startBlock: SN2.collection1155StartBlock
11752
+ }
11753
+ },
11754
+ uiVariant: "edition",
11755
+ capabilities: ["list", "buy", "make_offer", "cancel", "transfer", "mint", "remix", "license"],
11756
+ events: [
11757
+ { name: "CollectionDeployed", emittedBy: "factory" }
11758
+ ],
11759
+ metadataSchema: { licenseDefault: "CC BY-SA" }
11760
+ },
11761
+ "pop-protocol": {
11762
+ id: "pop-protocol",
11763
+ displayName: "POP Protocol",
11764
+ description: "Soulbound proof-of-presence collectibles per event.",
11765
+ standard: "ERC721",
11766
+ provenance: "MEDIALANE",
11767
+ onchain: {
11768
+ STARKNET: {
11769
+ factoryAddress: SN2.popFactory,
11770
+ classHash: SN2.popCollectionClassHash
11771
+ }
11772
+ },
11773
+ uiVariant: "pop",
11774
+ capabilities: ["claim", "mint"],
11775
+ events: [
11776
+ { name: "CollectionCreated", emittedBy: "factory" },
11777
+ { name: "AllowlistUpdated", emittedBy: "instance", poll: "slow" }
11778
+ ],
11779
+ metadataSchema: { licenseDefault: "CC BY-SA" }
11780
+ },
11781
+ "drop-collection": {
11782
+ id: "drop-collection",
11783
+ displayName: "Collection Drop",
11784
+ description: "Sequential mint with claim windows + allowlist.",
11785
+ standard: "ERC721",
11786
+ provenance: "MEDIALANE",
11787
+ onchain: {
11788
+ STARKNET: {
11789
+ factoryAddress: SN2.dropFactory,
11790
+ classHash: SN2.dropCollectionClassHash
11791
+ }
11792
+ },
11793
+ uiVariant: "drop",
11794
+ capabilities: ["claim", "list", "buy", "make_offer", "cancel", "transfer"],
11795
+ events: [
11796
+ { name: "DropCreated", emittedBy: "factory" },
11797
+ { name: "AllowlistUpdated", emittedBy: "instance", poll: "slow" }
11798
+ ],
11799
+ metadataSchema: { licenseDefault: "CC BY-SA" }
11800
+ },
11801
+ "ip-tickets": {
11802
+ id: "ip-tickets",
11803
+ displayName: "IP Tickets",
11804
+ description: "Create verifiable on-chain tickets \u2014 mint to attendees, trade like any collection.",
11805
+ standard: "ERC1155",
11806
+ provenance: "MEDIALANE",
11807
+ onchain: {
11808
+ STARKNET: {
11809
+ factoryAddress: SN2.ipTicketsFactory,
11810
+ classHash: SN2.ipTicketCollectionClassHash
11811
+ }
11812
+ },
11813
+ uiVariant: "ticket",
11814
+ capabilities: ["mint", "redeem", "list", "buy", "make_offer", "cancel", "transfer"],
11815
+ events: [
11816
+ { name: "CollectionDeployed", emittedBy: "factory" },
11817
+ { name: "TicketCreated", emittedBy: "instance" }
11818
+ ],
11819
+ metadataSchema: { licenseDefault: "CC BY-SA" }
11820
+ },
11821
+ "ip-ticketing": {
11822
+ id: "ip-ticketing",
11823
+ displayName: "IP Ticketing",
11824
+ description: "Distribute verifiable on-chain tickets to a list of recipients in one run \u2014 everyone gets a wallet and their ticket.",
11825
+ standard: "ERC1155",
11826
+ provenance: "MEDIALANE",
11827
+ onchain: {
11828
+ STARKNET: {
11829
+ factoryAddress: SN2.ipTicketsFactory,
11830
+ classHash: SN2.ipTicketCollectionClassHash
11831
+ }
11832
+ },
11833
+ uiVariant: "ticket",
11834
+ capabilities: ["mint", "airdrop", "redeem", "list", "buy", "make_offer", "cancel", "transfer"],
11835
+ events: [
11836
+ { name: "CollectionDeployed", emittedBy: "factory" },
11837
+ { name: "TicketCreated", emittedBy: "instance" }
11838
+ ],
11839
+ metadataSchema: { licenseDefault: "CC BY-SA" }
11840
+ },
11841
+ "ip-club": {
11842
+ id: "ip-club",
11843
+ displayName: "IP Club",
11844
+ description: "Membership clubs \u2014 create tiers, mint membership cards, trade like any collection.",
11845
+ standard: "ERC1155",
11846
+ provenance: "MEDIALANE",
11847
+ onchain: {
11848
+ STARKNET: {
11849
+ factoryAddress: SN2.ipClubFactory,
11850
+ classHash: SN2.ipClubCollectionClassHash
11851
+ }
11852
+ },
11853
+ uiVariant: "club",
11854
+ capabilities: ["mint", "list", "buy", "make_offer", "cancel", "transfer"],
11855
+ events: [
11856
+ { name: "ClubDeployed", emittedBy: "factory" },
11857
+ { name: "MembershipCreated", emittedBy: "instance" }
11858
+ ],
11859
+ metadataSchema: { licenseDefault: "CC BY-SA" }
11860
+ },
11861
+ "ip-sponsorship": {
11862
+ id: "ip-sponsorship",
11863
+ displayName: "IP Sponsorship",
11864
+ description: "Sponsorship offers and licenses anchored to an existing Medialane asset.",
11865
+ standard: "ERC721",
11866
+ provenance: "MEDIALANE",
11867
+ onchain: {
11868
+ STARKNET: {
11869
+ factoryAddress: SN2.ipSponsorship,
11870
+ classHash: SN2.ipSponsorshipClassHash,
11871
+ startBlock: SN2.ipSponsorshipStartBlock
11872
+ }
11873
+ },
11874
+ uiVariant: "standard",
11875
+ capabilities: ["sponsor", "transfer"],
11876
+ events: [
11877
+ { name: "OfferCreated", emittedBy: "factory" },
11878
+ { name: "ProposalCreated", emittedBy: "factory" },
11879
+ { name: "LicenseMinted", emittedBy: "factory" }
11880
+ ],
11881
+ metadataSchema: { licenseDefault: "CC BY-SA" }
11882
+ },
11883
+ "creator-coin": {
11884
+ id: "creator-coin",
11885
+ displayName: "Creator Coin",
11886
+ description: "Launch a fixed-supply social token with permanently-locked Ekubo liquidity.",
11887
+ standard: "ERC20",
11888
+ provenance: "MEDIALANE",
11889
+ onchain: {
11890
+ STARKNET: {
11891
+ factoryAddress: SN2.creatorCoinFactory,
11892
+ classHash: SN2.creatorCoinFactoryClassHash,
11893
+ startBlock: SN2.creatorCoinStartBlock
11894
+ }
11895
+ },
11896
+ uiVariant: "coin",
11897
+ capabilities: ["launch", "swap", "transfer"],
11898
+ events: [
11899
+ { name: "CreatorCoinCreated", emittedBy: "factory" },
11900
+ { name: "CreatorCoinLaunched", emittedBy: "factory" }
11901
+ ]
11902
+ },
11903
+ "medialane-marketplace-erc721": {
11904
+ id: "medialane-marketplace-erc721",
11905
+ displayName: "Medialane Marketplace (ERC-721)",
11906
+ description: "ERC-721 order matching venue.",
11907
+ standard: "ERC721",
11908
+ provenance: "MEDIALANE",
11909
+ onchain: {
11910
+ STARKNET: {
11911
+ factoryAddress: SN2.marketplace721,
11912
+ classHash: SN2.marketplace721ClassHash,
11913
+ startBlock: SN2.marketplace721StartBlock
11914
+ }
11915
+ },
11916
+ uiVariant: "standard",
11917
+ capabilities: ["list", "buy", "make_offer", "cancel"],
11918
+ events: [
11919
+ { name: "OrderCreated", emittedBy: "factory" },
11920
+ { name: "OrderFulfilled", emittedBy: "factory" },
11921
+ { name: "OrderCancelled", emittedBy: "factory" }
11922
+ ]
11923
+ },
11924
+ "medialane-marketplace-erc1155": {
11925
+ id: "medialane-marketplace-erc1155",
11926
+ displayName: "Medialane Marketplace (ERC-1155)",
11927
+ description: "ERC-1155 order matching venue.",
11928
+ standard: "ERC1155",
11929
+ provenance: "MEDIALANE",
11930
+ onchain: {
11931
+ STARKNET: {
11932
+ factoryAddress: SN2.marketplace1155,
11933
+ classHash: SN2.marketplace1155ClassHash,
11934
+ startBlock: SN2.marketplace1155StartBlock
11935
+ }
11936
+ },
11937
+ uiVariant: "edition",
11938
+ capabilities: ["list", "buy", "make_offer", "cancel"],
11939
+ events: [
11940
+ { name: "OrderCreated", emittedBy: "factory" },
11941
+ { name: "OrderFulfilled", emittedBy: "factory" },
11942
+ { name: "OrderCancelled", emittedBy: "factory" }
11943
+ ]
11944
+ },
11945
+ "unruggable-erc20": {
11946
+ id: "unruggable-erc20",
11947
+ displayName: "Unruggable",
11948
+ description: "An ERC-20 launched through the unruggable.meme protocol, the same contract Medialane's Creator Coin is forked from. Not deployed via a Medialane service, but exposes the same on-chain guarantees: capped team allocation, permanently locked liquidity, fixed supply. Brought in by owner claim or admin/partnership \u2014 never bulk-indexed.",
11949
+ standard: "ERC20",
11950
+ provenance: "EXTERNAL",
11951
+ uiVariant: "coin",
11952
+ capabilities: ["swap", "transfer"]
11953
+ },
11954
+ "external-erc20": {
11955
+ id: "external-erc20",
11956
+ displayName: "Memecoin",
11957
+ description: "A plain ERC-20 not deployed via a Medialane service and carrying no protocol-level guarantees. Brought in by owner claim or admin/partnership \u2014 never bulk-indexed. Generalizes to future chains.",
11958
+ standard: "ERC20",
11959
+ provenance: "EXTERNAL",
11960
+ uiVariant: "coin",
11961
+ capabilities: ["swap", "transfer"]
11962
+ },
11963
+ "external-erc721": {
11964
+ id: "external-erc721",
11965
+ displayName: "External ERC-721",
11966
+ description: "ERC-721 contract not deployed via a Medialane service.",
11967
+ standard: "ERC721",
11968
+ provenance: "EXTERNAL",
11969
+ uiVariant: "standard",
11970
+ capabilities: ["list", "buy", "make_offer", "cancel", "transfer"]
11971
+ },
11972
+ "external-erc1155": {
11973
+ id: "external-erc1155",
11974
+ displayName: "External ERC-1155",
11975
+ description: "ERC-1155 contract not deployed via a Medialane service.",
11976
+ standard: "ERC1155",
11977
+ provenance: "EXTERNAL",
11978
+ uiVariant: "edition",
11979
+ capabilities: ["list", "buy", "make_offer", "cancel", "transfer"]
11980
+ }
11981
+ };
11982
+ function getService(id) {
11983
+ return id && id in SERVICES ? SERVICES[id] : void 0;
11984
+ }
11985
+
11986
+ // src/starknet/services/receipts.ts
11987
+ var DEPLOY_EVENTS = {
11988
+ "mip-erc1155": { event: "CollectionDeployed", address: (e) => e.keys?.[1] },
11989
+ "ip-tickets": { event: "CollectionDeployed", address: (e) => e.keys?.[1] },
11990
+ "ip-ticketing": { event: "CollectionDeployed", address: (e) => e.keys?.[1] },
11991
+ "ip-club": { event: "ClubDeployed", address: (e) => e.keys?.[1] },
11992
+ "drop-collection": { event: "DropCreated", address: (e) => e.data?.[0] }
11993
+ };
11994
+ var IP_MINTED_SELECTOR = BigInt(starknet.hash.getSelectorFromName("IPMinted"));
11995
+ var TRANSFER_SELECTOR = BigInt(starknet.hash.getSelectorFromName("Transfer"));
11996
+ function sameFelt(a, b) {
11997
+ if (a === void 0) return false;
11998
+ try {
11999
+ return BigInt(a) === BigInt(b);
12000
+ } catch {
12001
+ return false;
11666
12002
  }
11667
- return { txHash };
12003
+ }
12004
+ function u2562(low, high) {
12005
+ return (BigInt(low ?? 0) + (BigInt(high ?? 0) << 128n)).toString();
12006
+ }
12007
+ function deployedCollectionFromReceipt(receipt, service) {
12008
+ const factory = getService(service)?.onchain?.STARKNET?.factoryAddress;
12009
+ const { event, address } = DEPLOY_EVENTS[service];
12010
+ const selector = BigInt(starknet.hash.getSelectorFromName(event));
12011
+ for (const e of receipt.events ?? []) {
12012
+ if (factory && !sameFelt(e.from_address, factory)) continue;
12013
+ if (!sameFelt(e.keys?.[0], selector)) continue;
12014
+ const value = address(e);
12015
+ if (value) return normalizeAddress("STARKNET", value);
12016
+ }
12017
+ return null;
12018
+ }
12019
+ function mintedTokenIdFromReceipt(receipt, contract) {
12020
+ for (const e of receipt.events ?? []) {
12021
+ if (!sameFelt(e.from_address, contract)) continue;
12022
+ const keys = e.keys ?? [];
12023
+ if (sameFelt(keys[0], IP_MINTED_SELECTOR) && keys.length >= 3) return u2562(keys[1], keys[2]);
12024
+ if (sameFelt(keys[0], TRANSFER_SELECTOR) && keys.length === 5 && sameFelt(keys[1], 0n)) return u2562(keys[3], keys[4]);
12025
+ }
12026
+ return null;
11668
12027
  }
11669
12028
 
11670
12029
  // src/starknet/services/sponsoredExecutor.ts
11671
12030
  var SponsoredCallRejectedError = class extends Error {
11672
12031
  };
11673
- var PRE_BROADCAST_EXECUTE_STATUSES = /* @__PURE__ */ new Set([400, 429, 503]);
12032
+ var SPONSOR_UNAVAILABLE_STATUS = 503;
11674
12033
  async function errorReason(res, fallback) {
11675
12034
  const body = await res.json().catch(() => null);
11676
12035
  return body?.error || fallback;
@@ -11684,7 +12043,9 @@ async function executeSponsored(config, signer, calls) {
11684
12043
  body: JSON.stringify({ userAddress: signer.address, calls })
11685
12044
  });
11686
12045
  if (!buildRes.ok) {
11687
- return { status: "unavailable", reason: await errorReason(buildRes, "We couldn't prepare this transaction.") };
12046
+ const reason = await errorReason(buildRes, "We couldn't prepare this transaction.");
12047
+ if (buildRes.status >= 500) return { status: "unavailable", reason };
12048
+ throw new SponsoredCallRejectedError(reason);
11688
12049
  }
11689
12050
  const { typedData } = await buildRes.json();
11690
12051
  const signature = await signer.signTypedData(typedData);
@@ -11695,7 +12056,7 @@ async function executeSponsored(config, signer, calls) {
11695
12056
  });
11696
12057
  if (!executeRes.ok) {
11697
12058
  const reason = await errorReason(executeRes, "We couldn't submit this transaction.");
11698
- if (PRE_BROADCAST_EXECUTE_STATUSES.has(executeRes.status)) {
12059
+ if (executeRes.status === SPONSOR_UNAVAILABLE_STATUS) {
11699
12060
  return { status: "unavailable", reason };
11700
12061
  }
11701
12062
  throw new SponsoredCallRejectedError(reason);
@@ -12028,6 +12389,7 @@ exports.confirmIntentBestEffort = confirmIntentBestEffort;
12028
12389
  exports.createAdminSessionGrant = createAdminSessionGrant;
12029
12390
  exports.decodeEscapeAndStatus = decodeEscapeAndStatus;
12030
12391
  exports.decodeGuardiansInfo = decodeGuardiansInfo;
12392
+ exports.deployedCollectionFromReceipt = deployedCollectionFromReceipt;
12031
12393
  exports.deriveAesKey = deriveAesKey;
12032
12394
  exports.deriveOwnerKeyPair = deriveOwnerKeyPair;
12033
12395
  exports.encodeAdminHeaders = encodeAdminHeaders;
@@ -12049,6 +12411,7 @@ exports.getOwners = getOwners;
12049
12411
  exports.getSiwsStorageKey = getSiwsStorageKey;
12050
12412
  exports.getStoredSiwsToken = getStoredSiwsToken;
12051
12413
  exports.isSiwsTokenValid = isSiwsTokenValid;
12414
+ exports.mintedTokenIdFromReceipt = mintedTokenIdFromReceipt;
12052
12415
  exports.normalizeSiwsSignature = normalizeSiwsSignature;
12053
12416
  exports.ownerAliveTypedData = ownerAliveTypedData;
12054
12417
  exports.ownerConstructorCalldata = ownerConstructorCalldata;
@@ -12063,6 +12426,7 @@ exports.signAdminRequest = signAdminRequest;
12063
12426
  exports.signWithPrivateKey = signWithPrivateKey;
12064
12427
  exports.starkKeyPairFromPrivateKey = starkKeyPairFromPrivateKey;
12065
12428
  exports.storeSiwsToken = storeSiwsToken;
12429
+ exports.syncTransactionBestEffort = syncTransactionBestEffort;
12066
12430
  exports.teamCoinsRaw = teamCoinsRaw;
12067
12431
  exports.toDropContractConditions = toContractConditions;
12068
12432
  exports.unsealPrivateKey = unsealPrivateKey;