@medialane/sdk 0.153.0 → 0.154.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 +0 -1
- package/dist/{errors-DQRDzDiT.d.cts → errors-BfiX06G4.d.cts} +2 -9
- package/dist/{errors-dgfLd7nS.d.ts → errors-CKO_JGDP.d.ts} +2 -9
- package/dist/index.cjs +2 -7
- 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 -7
- package/dist/index.js.map +1 -1
- package/dist/starknet/index.cjs +5 -14
- 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 -14
- package/dist/starknet/index.js.map +1 -1
- package/package.json +1 -1
package/dist/starknet/index.cjs
CHANGED
|
@@ -92,7 +92,6 @@ var MedialaneConfigSchema = zod.z.object({
|
|
|
92
92
|
rpcUrl: zod.z.string().url().optional(),
|
|
93
93
|
backendUrl: zod.z.string().url().optional(),
|
|
94
94
|
apiKey: zod.z.string().optional(),
|
|
95
|
-
appSource: zod.z.string().regex(/^[A-Z][A-Z0-9_]*$/).optional(),
|
|
96
95
|
marketplace721Contract: zod.z.string().optional(),
|
|
97
96
|
marketplaceContract: zod.z.string().optional(),
|
|
98
97
|
marketplace1155Contract: zod.z.string().optional(),
|
|
@@ -117,7 +116,6 @@ function resolveConfig(raw) {
|
|
|
117
116
|
rpcUrl: parsed.rpcUrl ?? coords.rpcUrl,
|
|
118
117
|
backendUrl: parsed.backendUrl,
|
|
119
118
|
apiKey: parsed.apiKey,
|
|
120
|
-
appSource: parsed.appSource,
|
|
121
119
|
marketplace721Contract,
|
|
122
120
|
marketplaceContract: marketplace721Contract,
|
|
123
121
|
marketplace1155Contract: parsed.marketplace1155Contract ?? sn.marketplace1155,
|
|
@@ -268,13 +266,10 @@ function parseRetryAfter(value) {
|
|
|
268
266
|
return void 0;
|
|
269
267
|
}
|
|
270
268
|
var ApiClient = class {
|
|
271
|
-
constructor(baseUrl, apiKey, retryOptions, chain = "STARKNET"
|
|
269
|
+
constructor(baseUrl, apiKey, retryOptions, chain = "STARKNET") {
|
|
272
270
|
this.baseUrl = baseUrl;
|
|
273
271
|
this.chain = chain;
|
|
274
|
-
this.baseHeaders = {
|
|
275
|
-
...apiKey ? { "x-api-key": apiKey } : {},
|
|
276
|
-
...appSource ? { "x-app-source": appSource } : {}
|
|
277
|
-
};
|
|
272
|
+
this.baseHeaders = apiKey ? { "x-api-key": apiKey } : {};
|
|
278
273
|
this.retryOptions = retryOptions;
|
|
279
274
|
}
|
|
280
275
|
addr(a) {
|
|
@@ -11116,7 +11111,7 @@ var MedialaneClient = class {
|
|
|
11116
11111
|
}
|
|
11117
11112
|
});
|
|
11118
11113
|
} else {
|
|
11119
|
-
this.api = new ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain
|
|
11114
|
+
this.api = new ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain);
|
|
11120
11115
|
}
|
|
11121
11116
|
}
|
|
11122
11117
|
get chain() {
|
|
@@ -11808,13 +11803,9 @@ async function requestSiwsToken({
|
|
|
11808
11803
|
appSource
|
|
11809
11804
|
}) {
|
|
11810
11805
|
const base = backendUrl.replace(/\/$/, "");
|
|
11811
|
-
const headers = {
|
|
11812
|
-
"Content-Type": "application/json",
|
|
11813
|
-
...appSource ? { "x-app-source": appSource } : {}
|
|
11814
|
-
};
|
|
11815
11806
|
const nonceRes = await fetch(`${base}/v1/auth/siws/nonce`, {
|
|
11816
11807
|
method: "POST",
|
|
11817
|
-
headers,
|
|
11808
|
+
headers: { "Content-Type": "application/json" },
|
|
11818
11809
|
body: JSON.stringify({ walletAddress })
|
|
11819
11810
|
});
|
|
11820
11811
|
if (!nonceRes.ok) {
|
|
@@ -11824,7 +11815,7 @@ async function requestSiwsToken({
|
|
|
11824
11815
|
const signature = normalizeSiwsSignature(await signer.signMessage(typedData));
|
|
11825
11816
|
const verifyRes = await fetch(`${base}/v1/auth/siws/verify`, {
|
|
11826
11817
|
method: "POST",
|
|
11827
|
-
headers,
|
|
11818
|
+
headers: { "Content-Type": "application/json" },
|
|
11828
11819
|
body: JSON.stringify({ walletAddress, nonce, signature, ...appSource ? { appSource } : {} })
|
|
11829
11820
|
});
|
|
11830
11821
|
if (!verifyRes.ok) {
|