@medialane/sdk 0.153.0 → 0.155.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/README.md +1 -2
- package/dist/{errors-dgfLd7nS.d.ts → errors-BKaHnCOI.d.ts} +2 -35
- package/dist/{errors-DQRDzDiT.d.cts → errors-CAKnNI3N.d.cts} +2 -35
- package/dist/index.cjs +2 -21
- 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 +2 -21
- package/dist/index.js.map +1 -1
- package/dist/starknet/index.cjs +5 -28
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +2 -2
- package/dist/starknet/index.d.ts +2 -2
- package/dist/starknet/index.js +5 -28
- package/dist/starknet/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { bC as ResolvedConfig, bJ as TxResult, aY as CreatePopCollectionParams, aJ as ClaimConditions, aU as CreateDropParams, b1 as CreateTicketParams, bm as MintTicketsParams, aW as CreateMembershipParams, bl as MintMembershipsParams, a$ as CreateSponsorshipOfferParams, bz as ProposeSponsorshipParams, k as ApiClient, bj as MedialaneConfig, bk as MedialaneErrorCode, br as OrderDetails, R as ResolvedFeeConfig, I as ApiFundingIntent, H as ApiFundingInstructions, L as ApiFundingSubmit, N as ApiIntentCreated, bP as SealedOwner, bQ as ReceiptProviderLike, bR as WalletExecutor, bS as ExecutedTransaction, bT as PasskeyOwner, bU as CreatedOwner } from '../errors-CAKnNI3N.cjs';
|
|
2
|
+
export { bV as InvalidRecoveryKeyError, bW as OwnerSigner, bu as PasskeyCancelledError, bX as PasskeyConfig, bY as RecoveryKey, bL as UserFacingError, bZ as createPasskeyOwner, b_ as encodeRecoveryKey, b$ as parseRecoveryKey } from '../errors-CAKnNI3N.cjs';
|
|
3
3
|
import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
|
|
4
4
|
import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-CO6YYHVA.cjs';
|
|
5
5
|
import 'zod';
|
package/dist/starknet/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { bC as ResolvedConfig, bJ as TxResult, aY as CreatePopCollectionParams, aJ as ClaimConditions, aU as CreateDropParams, b1 as CreateTicketParams, bm as MintTicketsParams, aW as CreateMembershipParams, bl as MintMembershipsParams, a$ as CreateSponsorshipOfferParams, bz as ProposeSponsorshipParams, k as ApiClient, bj as MedialaneConfig, bk as MedialaneErrorCode, br as OrderDetails, R as ResolvedFeeConfig, I as ApiFundingIntent, H as ApiFundingInstructions, L as ApiFundingSubmit, N as ApiIntentCreated, bP as SealedOwner, bQ as ReceiptProviderLike, bR as WalletExecutor, bS as ExecutedTransaction, bT as PasskeyOwner, bU as CreatedOwner } from '../errors-BKaHnCOI.js';
|
|
2
|
+
export { bV as InvalidRecoveryKeyError, bW as OwnerSigner, bu as PasskeyCancelledError, bX as PasskeyConfig, bY as RecoveryKey, bL as UserFacingError, bZ as createPasskeyOwner, b_ as encodeRecoveryKey, b$ as parseRecoveryKey } from '../errors-BKaHnCOI.js';
|
|
3
3
|
import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
|
|
4
4
|
import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-CO6YYHVA.js';
|
|
5
5
|
import 'zod';
|
package/dist/starknet/index.js
CHANGED
|
@@ -90,7 +90,6 @@ var MedialaneConfigSchema = z.object({
|
|
|
90
90
|
rpcUrl: z.string().url().optional(),
|
|
91
91
|
backendUrl: z.string().url().optional(),
|
|
92
92
|
apiKey: z.string().optional(),
|
|
93
|
-
appSource: z.string().regex(/^[A-Z][A-Z0-9_]*$/).optional(),
|
|
94
93
|
marketplace721Contract: z.string().optional(),
|
|
95
94
|
marketplaceContract: z.string().optional(),
|
|
96
95
|
marketplace1155Contract: z.string().optional(),
|
|
@@ -115,7 +114,6 @@ function resolveConfig(raw) {
|
|
|
115
114
|
rpcUrl: parsed.rpcUrl ?? coords.rpcUrl,
|
|
116
115
|
backendUrl: parsed.backendUrl,
|
|
117
116
|
apiKey: parsed.apiKey,
|
|
118
|
-
appSource: parsed.appSource,
|
|
119
117
|
marketplace721Contract,
|
|
120
118
|
marketplaceContract: marketplace721Contract,
|
|
121
119
|
marketplace1155Contract: parsed.marketplace1155Contract ?? sn.marketplace1155,
|
|
@@ -266,13 +264,10 @@ function parseRetryAfter(value) {
|
|
|
266
264
|
return void 0;
|
|
267
265
|
}
|
|
268
266
|
var ApiClient = class {
|
|
269
|
-
constructor(baseUrl, apiKey, retryOptions, chain = "STARKNET"
|
|
267
|
+
constructor(baseUrl, apiKey, retryOptions, chain = "STARKNET") {
|
|
270
268
|
this.baseUrl = baseUrl;
|
|
271
269
|
this.chain = chain;
|
|
272
|
-
this.baseHeaders = {
|
|
273
|
-
...apiKey ? { "x-api-key": apiKey } : {},
|
|
274
|
-
...appSource ? { "x-app-source": appSource } : {}
|
|
275
|
-
};
|
|
270
|
+
this.baseHeaders = apiKey ? { "x-api-key": apiKey } : {};
|
|
276
271
|
this.retryOptions = retryOptions;
|
|
277
272
|
}
|
|
278
273
|
addr(a) {
|
|
@@ -323,9 +318,6 @@ var ApiClient = class {
|
|
|
323
318
|
patch(path, body) {
|
|
324
319
|
return this.request(path, { method: "PATCH", body: JSON.stringify(body) });
|
|
325
320
|
}
|
|
326
|
-
del(path) {
|
|
327
|
-
return this.request(path, { method: "DELETE" });
|
|
328
|
-
}
|
|
329
321
|
bearer(siwsToken) {
|
|
330
322
|
return { Authorization: `Bearer ${siwsToken}` };
|
|
331
323
|
}
|
|
@@ -617,17 +609,6 @@ var ApiClient = class {
|
|
|
617
609
|
headers: this.asSubject(siwsToken)
|
|
618
610
|
});
|
|
619
611
|
}
|
|
620
|
-
getWebhooks() {
|
|
621
|
-
return this.get("/v1/portal/webhooks");
|
|
622
|
-
}
|
|
623
|
-
createWebhook(params) {
|
|
624
|
-
return this.post("/v1/portal/webhooks", params);
|
|
625
|
-
}
|
|
626
|
-
deleteWebhook(id) {
|
|
627
|
-
return this.del(
|
|
628
|
-
`/v1/portal/webhooks/${id}`
|
|
629
|
-
);
|
|
630
|
-
}
|
|
631
612
|
async claimCollection(contractAddress, walletAddress, siwsToken) {
|
|
632
613
|
return this.request("/v1/collections/claim", {
|
|
633
614
|
method: "POST",
|
|
@@ -11114,7 +11095,7 @@ var MedialaneClient = class {
|
|
|
11114
11095
|
}
|
|
11115
11096
|
});
|
|
11116
11097
|
} else {
|
|
11117
|
-
this.api = new ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain
|
|
11098
|
+
this.api = new ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain);
|
|
11118
11099
|
}
|
|
11119
11100
|
}
|
|
11120
11101
|
get chain() {
|
|
@@ -11806,13 +11787,9 @@ async function requestSiwsToken({
|
|
|
11806
11787
|
appSource
|
|
11807
11788
|
}) {
|
|
11808
11789
|
const base = backendUrl.replace(/\/$/, "");
|
|
11809
|
-
const headers = {
|
|
11810
|
-
"Content-Type": "application/json",
|
|
11811
|
-
...appSource ? { "x-app-source": appSource } : {}
|
|
11812
|
-
};
|
|
11813
11790
|
const nonceRes = await fetch(`${base}/v1/auth/siws/nonce`, {
|
|
11814
11791
|
method: "POST",
|
|
11815
|
-
headers,
|
|
11792
|
+
headers: { "Content-Type": "application/json" },
|
|
11816
11793
|
body: JSON.stringify({ walletAddress })
|
|
11817
11794
|
});
|
|
11818
11795
|
if (!nonceRes.ok) {
|
|
@@ -11822,7 +11799,7 @@ async function requestSiwsToken({
|
|
|
11822
11799
|
const signature = normalizeSiwsSignature(await signer.signMessage(typedData));
|
|
11823
11800
|
const verifyRes = await fetch(`${base}/v1/auth/siws/verify`, {
|
|
11824
11801
|
method: "POST",
|
|
11825
|
-
headers,
|
|
11802
|
+
headers: { "Content-Type": "application/json" },
|
|
11826
11803
|
body: JSON.stringify({ walletAddress, nonce, signature, ...appSource ? { appSource } : {} })
|
|
11827
11804
|
});
|
|
11828
11805
|
if (!verifyRes.ok) {
|