@medialane/sdk 0.129.2 → 0.130.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/{errors-Fgqpww_8.d.cts → errors-C_zqe9TI.d.cts} +46 -1
- package/dist/{errors-DQJIxfVu.d.ts → errors-Dc-g0mMr.d.ts} +46 -1
- package/dist/index.cjs +47 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -1
- package/dist/starknet/index.cjs +114 -0
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +63 -3
- package/dist/starknet/index.d.ts +63 -3
- package/dist/starknet/index.js +111 -1
- package/dist/starknet/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -822,6 +822,31 @@ interface ApiCreditPayment {
|
|
|
822
822
|
status: string;
|
|
823
823
|
createdAt: string;
|
|
824
824
|
}
|
|
825
|
+
interface ApiFundingMethod {
|
|
826
|
+
id: string;
|
|
827
|
+
[detail: string]: unknown;
|
|
828
|
+
}
|
|
829
|
+
type ApiFundingStatus = "PENDING" | "SETTLED" | "FAILED" | "EXPIRED";
|
|
830
|
+
interface ApiFundingIntent {
|
|
831
|
+
id: string;
|
|
832
|
+
method: string;
|
|
833
|
+
status: ApiFundingStatus;
|
|
834
|
+
expiresAt: string;
|
|
835
|
+
payer?: string | null;
|
|
836
|
+
}
|
|
837
|
+
interface ApiFundingInstructions {
|
|
838
|
+
chain: string;
|
|
839
|
+
payTo: string;
|
|
840
|
+
asset: string;
|
|
841
|
+
amountAtomic: string;
|
|
842
|
+
}
|
|
843
|
+
type ApiFundingSubmit = {
|
|
844
|
+
status: "SETTLED";
|
|
845
|
+
credited?: number;
|
|
846
|
+
} | {
|
|
847
|
+
status: "PENDING";
|
|
848
|
+
reason: string;
|
|
849
|
+
};
|
|
825
850
|
interface ApiSpendByAction {
|
|
826
851
|
actionKey: string;
|
|
827
852
|
credits: number;
|
|
@@ -1138,9 +1163,29 @@ declare class ApiClient {
|
|
|
1138
1163
|
}>>;
|
|
1139
1164
|
getCreditHistory(siwsToken?: string): Promise<ApiResponse<ApiCreditPayment[]>>;
|
|
1140
1165
|
getSpend(siwsToken?: string): Promise<ApiResponse<ApiPortalSpend>>;
|
|
1166
|
+
/** @deprecated Use the funding methods (`createFunding`, or `fundWithChainTransfer` from `@medialane/sdk/starknet`). This call only nudges a legacy scanner and never credits anything itself. */
|
|
1141
1167
|
checkDeposit(txHash: string, siwsToken?: string): Promise<ApiResponse<{
|
|
1142
1168
|
deposits: number;
|
|
1143
1169
|
}>>;
|
|
1170
|
+
getFundingMethods(siwsToken?: string): Promise<ApiResponse<ApiFundingMethod[]>>;
|
|
1171
|
+
createFunding(input: {
|
|
1172
|
+
method: string;
|
|
1173
|
+
params: Record<string, unknown>;
|
|
1174
|
+
}, siwsToken?: string): Promise<ApiResponse<ApiFundingIntent>>;
|
|
1175
|
+
getFunding(id: string, siwsToken?: string): Promise<ApiResponse<ApiFundingIntent>>;
|
|
1176
|
+
getFundingChallenge(id: string, payer: string, siwsToken?: string): Promise<ApiResponse<{
|
|
1177
|
+
typedData: unknown;
|
|
1178
|
+
}>>;
|
|
1179
|
+
authorizeFunding(id: string, input: {
|
|
1180
|
+
payer: string;
|
|
1181
|
+
signature: string[];
|
|
1182
|
+
}, siwsToken?: string): Promise<ApiResponse<{
|
|
1183
|
+
instructions: ApiFundingInstructions;
|
|
1184
|
+
}>>;
|
|
1185
|
+
submitFunding(id: string, txHash: string, siwsToken?: string): Promise<ApiResponse<ApiFundingSubmit>>;
|
|
1186
|
+
cancelFunding(id: string, siwsToken?: string): Promise<ApiResponse<{
|
|
1187
|
+
status: string;
|
|
1188
|
+
}>>;
|
|
1144
1189
|
getWebhooks(): Promise<ApiResponse<ApiWebhookEndpoint[]>>;
|
|
1145
1190
|
createWebhook(params: CreateWebhookParams): Promise<ApiResponse<ApiWebhookCreated>>;
|
|
1146
1191
|
deleteWebhook(id: string): Promise<ApiResponse<{
|
|
@@ -1439,4 +1484,4 @@ declare class UserFacingError extends Error {
|
|
|
1439
1484
|
constructor(message: string);
|
|
1440
1485
|
}
|
|
1441
1486
|
|
|
1442
|
-
export { type
|
|
1487
|
+
export { type ApiPortalMe as $, type AcceptSponsorshipBidIntentParams as A, type ApiCreditPayment as B, type ApiEmissionCall as C, type ApiEmissionResult as D, type ApiFundingInstructions as E, type ApiFundingIntent as F, type ApiFundingMethod as G, type ApiFundingStatus as H, type ApiFundingSubmit as I, type ApiIntent as J, type ApiIntentCreated as K, type ApiKeyStatus as L, type ApiMeta as M, type ApiMetadataSignedUrl as N, type ApiMetadataUpload as O, type ApiOrder as P, type ApiOrderConsideration as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiOrderOffer as T, type ApiOrderPrice as U, type ApiOrderTokenMeta as V, type ApiOrderTxHash as W, type ApiOrdersQuery as X, type ApiPointEvent as Y, type ApiPortalKey as Z, type ApiPortalKeyCreated as _, type ServiceCapability as a, type IpAttribute as a$, type ApiPortalSpend as a0, type ApiPublicRemix as a1, type ApiRemixOffer as a2, type ApiRemixOfferPrice as a3, type ApiRemixOffersQuery as a4, type ApiResponse as a5, type ApiRewardsBadge as a6, type ApiRewardsBatchEntry as a7, type ApiRewardsConfig as a8, type ApiRewardsLeaderboardEntry as a9, type CreateCheckoutIntentParams as aA, type CreateCoinIntentParams as aB, type CreateCollectionIntentParams as aC, type CreateCounterOfferIntentParams as aD, type CreateDropParams as aE, type CreateListingIntentParams as aF, type CreateMembershipParams as aG, type CreateMintIntentParams as aH, type CreatePopCollectionParams as aI, type CreateRemixOfferParams as aJ, type CreateSponsorshipOfferIntentParams as aK, type CreateSponsorshipOfferParams as aL, type CreateSponsorshipProposalIntentParams as aM, type CreateTicketParams as aN, type CreateTierIntentParams as aO, type CreateWebhookParams as aP, type DropMintStatus as aQ, type EmissionParams as aR, type EnforcementDeclaration as aS, type FactoryFamilyServiceId as aT, type FeeConfig as aU, FeeConfigSchema as aV, type FulfillOrderIntentParams as aW, type IPType as aX, type IntentCall as aY, type IntentStatus as aZ, type IntentType as a_, type ApiRewardsLevel as aa, type ApiSearchCollectionResult as ab, type ApiSearchCreatorResult as ac, type ApiSearchResult as ad, type ApiSearchTokenResult as ae, type ApiSpendByAction as af, type ApiToken as ag, type ApiTokenBalance as ah, type ApiTokenMetadata as ai, type ApiTxSyncResult as aj, type ApiUserRewards as ak, type ApiUserWallet as al, type ApiWalletActivity as am, type ApiWebhookCreated as an, type ApiWebhookEndpoint as ao, type AutoRemixOfferParams as ap, type CancelOrderIntentParams as aq, type ChainFilter as ar, type CheckoutIntentItem as as, type ClaimConditions as at, type CollectionServiceId as au, type CollectionSort as av, type CollectionTokensSort as aw, type ConfirmRemixOfferParams as ax, type ConfirmSelfRemixParams as ay, type ConsiderationItem as az, type AcceptSponsorshipProposalIntentParams as b, type IpNftMetadata as b0, type LaunchCoinIntentParams as b1, type MakeOfferIntentParams as b2, MedialaneApiError as b3, type MedialaneConfig as b4, type MedialaneErrorCode as b5, type MintMembershipsParams as b6, type MintTicketsParams as b7, OPEN_LICENSES as b8, type OfferItem as b9, type WithdrawSponsorshipProposalIntentParams as bA, resolveConfig as bB, resolveFeeConfig as bC, type SealedOwner as bD, type ReceiptProviderLike as bE, type WalletExecutor as bF, type ExecutedTransaction as bG, type PasskeyOwner as bH, type CreatedOwner as bI, type OwnerSigner as bJ, type PasskeyConfig as bK, createPasskeyOwner as bL, type OpenLicense as ba, type Order as bb, type OrderDetails as bc, type OrderParameters as bd, type OrderStatus as be, PasskeyCancelledError as bf, type PlaceSponsorshipBidIntentParams as bg, type PopBatchEligibilityItem as bh, type PopClaimStatus as bi, type PopEventType as bj, type ProposeSponsorshipParams as bk, type RejectSponsorshipProposalIntentParams as bl, type RemixOfferStatus as bm, type ResolvedConfig as bn, type RetractSponsorshipBidIntentParams as bo, type RetryOptions as bp, type ServiceEventDeclaration as bq, type SetSponsorshipOfferOpenIntentParams as br, type SortOrder as bs, type TenantPlan as bt, type TierServiceId as bu, type TxResult as bv, type UpdateCollectionProfileInput as bw, UserFacingError as bx, type WebhookEventType as by, type WebhookStatus as bz, 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 };
|
|
@@ -822,6 +822,31 @@ interface ApiCreditPayment {
|
|
|
822
822
|
status: string;
|
|
823
823
|
createdAt: string;
|
|
824
824
|
}
|
|
825
|
+
interface ApiFundingMethod {
|
|
826
|
+
id: string;
|
|
827
|
+
[detail: string]: unknown;
|
|
828
|
+
}
|
|
829
|
+
type ApiFundingStatus = "PENDING" | "SETTLED" | "FAILED" | "EXPIRED";
|
|
830
|
+
interface ApiFundingIntent {
|
|
831
|
+
id: string;
|
|
832
|
+
method: string;
|
|
833
|
+
status: ApiFundingStatus;
|
|
834
|
+
expiresAt: string;
|
|
835
|
+
payer?: string | null;
|
|
836
|
+
}
|
|
837
|
+
interface ApiFundingInstructions {
|
|
838
|
+
chain: string;
|
|
839
|
+
payTo: string;
|
|
840
|
+
asset: string;
|
|
841
|
+
amountAtomic: string;
|
|
842
|
+
}
|
|
843
|
+
type ApiFundingSubmit = {
|
|
844
|
+
status: "SETTLED";
|
|
845
|
+
credited?: number;
|
|
846
|
+
} | {
|
|
847
|
+
status: "PENDING";
|
|
848
|
+
reason: string;
|
|
849
|
+
};
|
|
825
850
|
interface ApiSpendByAction {
|
|
826
851
|
actionKey: string;
|
|
827
852
|
credits: number;
|
|
@@ -1138,9 +1163,29 @@ declare class ApiClient {
|
|
|
1138
1163
|
}>>;
|
|
1139
1164
|
getCreditHistory(siwsToken?: string): Promise<ApiResponse<ApiCreditPayment[]>>;
|
|
1140
1165
|
getSpend(siwsToken?: string): Promise<ApiResponse<ApiPortalSpend>>;
|
|
1166
|
+
/** @deprecated Use the funding methods (`createFunding`, or `fundWithChainTransfer` from `@medialane/sdk/starknet`). This call only nudges a legacy scanner and never credits anything itself. */
|
|
1141
1167
|
checkDeposit(txHash: string, siwsToken?: string): Promise<ApiResponse<{
|
|
1142
1168
|
deposits: number;
|
|
1143
1169
|
}>>;
|
|
1170
|
+
getFundingMethods(siwsToken?: string): Promise<ApiResponse<ApiFundingMethod[]>>;
|
|
1171
|
+
createFunding(input: {
|
|
1172
|
+
method: string;
|
|
1173
|
+
params: Record<string, unknown>;
|
|
1174
|
+
}, siwsToken?: string): Promise<ApiResponse<ApiFundingIntent>>;
|
|
1175
|
+
getFunding(id: string, siwsToken?: string): Promise<ApiResponse<ApiFundingIntent>>;
|
|
1176
|
+
getFundingChallenge(id: string, payer: string, siwsToken?: string): Promise<ApiResponse<{
|
|
1177
|
+
typedData: unknown;
|
|
1178
|
+
}>>;
|
|
1179
|
+
authorizeFunding(id: string, input: {
|
|
1180
|
+
payer: string;
|
|
1181
|
+
signature: string[];
|
|
1182
|
+
}, siwsToken?: string): Promise<ApiResponse<{
|
|
1183
|
+
instructions: ApiFundingInstructions;
|
|
1184
|
+
}>>;
|
|
1185
|
+
submitFunding(id: string, txHash: string, siwsToken?: string): Promise<ApiResponse<ApiFundingSubmit>>;
|
|
1186
|
+
cancelFunding(id: string, siwsToken?: string): Promise<ApiResponse<{
|
|
1187
|
+
status: string;
|
|
1188
|
+
}>>;
|
|
1144
1189
|
getWebhooks(): Promise<ApiResponse<ApiWebhookEndpoint[]>>;
|
|
1145
1190
|
createWebhook(params: CreateWebhookParams): Promise<ApiResponse<ApiWebhookCreated>>;
|
|
1146
1191
|
deleteWebhook(id: string): Promise<ApiResponse<{
|
|
@@ -1439,4 +1484,4 @@ declare class UserFacingError extends Error {
|
|
|
1439
1484
|
constructor(message: string);
|
|
1440
1485
|
}
|
|
1441
1486
|
|
|
1442
|
-
export { type
|
|
1487
|
+
export { type ApiPortalMe as $, type AcceptSponsorshipBidIntentParams as A, type ApiCreditPayment as B, type ApiEmissionCall as C, type ApiEmissionResult as D, type ApiFundingInstructions as E, type ApiFundingIntent as F, type ApiFundingMethod as G, type ApiFundingStatus as H, type ApiFundingSubmit as I, type ApiIntent as J, type ApiIntentCreated as K, type ApiKeyStatus as L, type ApiMeta as M, type ApiMetadataSignedUrl as N, type ApiMetadataUpload as O, type ApiOrder as P, type ApiOrderConsideration as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiOrderOffer as T, type ApiOrderPrice as U, type ApiOrderTokenMeta as V, type ApiOrderTxHash as W, type ApiOrdersQuery as X, type ApiPointEvent as Y, type ApiPortalKey as Z, type ApiPortalKeyCreated as _, type ServiceCapability as a, type IpAttribute as a$, type ApiPortalSpend as a0, type ApiPublicRemix as a1, type ApiRemixOffer as a2, type ApiRemixOfferPrice as a3, type ApiRemixOffersQuery as a4, type ApiResponse as a5, type ApiRewardsBadge as a6, type ApiRewardsBatchEntry as a7, type ApiRewardsConfig as a8, type ApiRewardsLeaderboardEntry as a9, type CreateCheckoutIntentParams as aA, type CreateCoinIntentParams as aB, type CreateCollectionIntentParams as aC, type CreateCounterOfferIntentParams as aD, type CreateDropParams as aE, type CreateListingIntentParams as aF, type CreateMembershipParams as aG, type CreateMintIntentParams as aH, type CreatePopCollectionParams as aI, type CreateRemixOfferParams as aJ, type CreateSponsorshipOfferIntentParams as aK, type CreateSponsorshipOfferParams as aL, type CreateSponsorshipProposalIntentParams as aM, type CreateTicketParams as aN, type CreateTierIntentParams as aO, type CreateWebhookParams as aP, type DropMintStatus as aQ, type EmissionParams as aR, type EnforcementDeclaration as aS, type FactoryFamilyServiceId as aT, type FeeConfig as aU, FeeConfigSchema as aV, type FulfillOrderIntentParams as aW, type IPType as aX, type IntentCall as aY, type IntentStatus as aZ, type IntentType as a_, type ApiRewardsLevel as aa, type ApiSearchCollectionResult as ab, type ApiSearchCreatorResult as ac, type ApiSearchResult as ad, type ApiSearchTokenResult as ae, type ApiSpendByAction as af, type ApiToken as ag, type ApiTokenBalance as ah, type ApiTokenMetadata as ai, type ApiTxSyncResult as aj, type ApiUserRewards as ak, type ApiUserWallet as al, type ApiWalletActivity as am, type ApiWebhookCreated as an, type ApiWebhookEndpoint as ao, type AutoRemixOfferParams as ap, type CancelOrderIntentParams as aq, type ChainFilter as ar, type CheckoutIntentItem as as, type ClaimConditions as at, type CollectionServiceId as au, type CollectionSort as av, type CollectionTokensSort as aw, type ConfirmRemixOfferParams as ax, type ConfirmSelfRemixParams as ay, type ConsiderationItem as az, type AcceptSponsorshipProposalIntentParams as b, type IpNftMetadata as b0, type LaunchCoinIntentParams as b1, type MakeOfferIntentParams as b2, MedialaneApiError as b3, type MedialaneConfig as b4, type MedialaneErrorCode as b5, type MintMembershipsParams as b6, type MintTicketsParams as b7, OPEN_LICENSES as b8, type OfferItem as b9, type WithdrawSponsorshipProposalIntentParams as bA, resolveConfig as bB, resolveFeeConfig as bC, type SealedOwner as bD, type ReceiptProviderLike as bE, type WalletExecutor as bF, type ExecutedTransaction as bG, type PasskeyOwner as bH, type CreatedOwner as bI, type OwnerSigner as bJ, type PasskeyConfig as bK, createPasskeyOwner as bL, type OpenLicense as ba, type Order as bb, type OrderDetails as bc, type OrderParameters as bd, type OrderStatus as be, PasskeyCancelledError as bf, type PlaceSponsorshipBidIntentParams as bg, type PopBatchEligibilityItem as bh, type PopClaimStatus as bi, type PopEventType as bj, type ProposeSponsorshipParams as bk, type RejectSponsorshipProposalIntentParams as bl, type RemixOfferStatus as bm, type ResolvedConfig as bn, type RetractSponsorshipBidIntentParams as bo, type RetryOptions as bp, type ServiceEventDeclaration as bq, type SetSponsorshipOfferOpenIntentParams as br, type SortOrder as bs, type TenantPlan as bt, type TierServiceId as bu, type TxResult as bv, type UpdateCollectionProfileInput as bw, UserFacingError as bx, type WebhookEventType as by, type WebhookStatus as bz, 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 };
|
package/dist/index.cjs
CHANGED
|
@@ -593,6 +593,7 @@ var ApiClient = class {
|
|
|
593
593
|
headers: this.asSubject(siwsToken)
|
|
594
594
|
});
|
|
595
595
|
}
|
|
596
|
+
/** @deprecated Use the funding methods (`createFunding`, or `fundWithChainTransfer` from `@medialane/sdk/starknet`). This call only nudges a legacy scanner and never credits anything itself. */
|
|
596
597
|
checkDeposit(txHash, siwsToken) {
|
|
597
598
|
return this.request("/v1/portal/credits/check", {
|
|
598
599
|
method: "POST",
|
|
@@ -600,6 +601,52 @@ var ApiClient = class {
|
|
|
600
601
|
headers: this.asSubject(siwsToken)
|
|
601
602
|
});
|
|
602
603
|
}
|
|
604
|
+
getFundingMethods(siwsToken) {
|
|
605
|
+
return this.request("/v1/portal/funding/methods", {
|
|
606
|
+
method: "GET",
|
|
607
|
+
headers: this.asSubject(siwsToken)
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
createFunding(input, siwsToken) {
|
|
611
|
+
return this.request("/v1/portal/funding", {
|
|
612
|
+
method: "POST",
|
|
613
|
+
body: JSON.stringify({ method: input.method, params: input.params }),
|
|
614
|
+
headers: this.asSubject(siwsToken)
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
getFunding(id, siwsToken) {
|
|
618
|
+
return this.request(`/v1/portal/funding/${encodeURIComponent(id)}`, {
|
|
619
|
+
method: "GET",
|
|
620
|
+
headers: this.asSubject(siwsToken)
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
getFundingChallenge(id, payer, siwsToken) {
|
|
624
|
+
return this.request(`/v1/portal/funding/${encodeURIComponent(id)}/challenge`, {
|
|
625
|
+
method: "POST",
|
|
626
|
+
body: JSON.stringify({ payer }),
|
|
627
|
+
headers: this.asSubject(siwsToken)
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
authorizeFunding(id, input, siwsToken) {
|
|
631
|
+
return this.request(
|
|
632
|
+
`/v1/portal/funding/${encodeURIComponent(id)}/authorize`,
|
|
633
|
+
{ method: "POST", body: JSON.stringify({ payer: input.payer, signature: input.signature }), headers: this.asSubject(siwsToken) }
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
submitFunding(id, txHash, siwsToken) {
|
|
637
|
+
return this.request(`/v1/portal/funding/${encodeURIComponent(id)}/submit`, {
|
|
638
|
+
method: "POST",
|
|
639
|
+
body: JSON.stringify({ txHash }),
|
|
640
|
+
headers: this.asSubject(siwsToken)
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
cancelFunding(id, siwsToken) {
|
|
644
|
+
return this.request(`/v1/portal/funding/${encodeURIComponent(id)}/cancel`, {
|
|
645
|
+
method: "POST",
|
|
646
|
+
body: JSON.stringify({}),
|
|
647
|
+
headers: this.asSubject(siwsToken)
|
|
648
|
+
});
|
|
649
|
+
}
|
|
603
650
|
getWebhooks() {
|
|
604
651
|
return this.get("/v1/portal/webhooks");
|
|
605
652
|
}
|