@medialane/sdk 0.87.0 → 0.88.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 +32 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -3
- package/dist/index.d.ts +27 -3
- package/dist/index.js +30 -1
- package/dist/index.js.map +1 -1
- package/dist/{services-BMVi2U8T.d.ts → services-CELm1bdL.d.ts} +1 -1
- package/dist/{services-yppVbYf6.d.cts → services-vwXIiRBm.d.cts} +1 -1
- package/dist/starknet/index.d.cts +1 -1
- package/dist/starknet/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -80,6 +80,22 @@ function resolveFeeConfig(raw) {
|
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
// src/fee/app-config.ts
|
|
84
|
+
var DEFAULT_BPS = 100;
|
|
85
|
+
function bps(raw) {
|
|
86
|
+
if (!raw) return DEFAULT_BPS;
|
|
87
|
+
const n = Number(raw);
|
|
88
|
+
return Number.isFinite(n) ? n : DEFAULT_BPS;
|
|
89
|
+
}
|
|
90
|
+
function resolveAppFeeConfig(env = {}) {
|
|
91
|
+
return resolveFeeConfig({
|
|
92
|
+
enabled: env.NEXT_PUBLIC_FEE_ENABLED !== "false",
|
|
93
|
+
fundAddress: env.NEXT_PUBLIC_FEE_FUND_ADDRESS || void 0,
|
|
94
|
+
marketplaceBps: bps(env.NEXT_PUBLIC_FEE_MARKETPLACE_BPS),
|
|
95
|
+
launchpadBps: bps(env.NEXT_PUBLIC_FEE_LAUNCHPAD_BPS)
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
83
99
|
// src/config.ts
|
|
84
100
|
var MedialaneConfigSchema = zod.z.object({
|
|
85
101
|
chain: zod.z.enum(CHAINS).default(DEFAULT_CHAIN),
|
|
@@ -1419,6 +1435,19 @@ function buildAssetMetadata(input) {
|
|
|
1419
1435
|
};
|
|
1420
1436
|
}
|
|
1421
1437
|
|
|
1438
|
+
// src/remix-policy.ts
|
|
1439
|
+
function getDerivativesTerm(attributes) {
|
|
1440
|
+
const v = (Array.isArray(attributes) ? attributes : []).find(
|
|
1441
|
+
(a) => a.trait_type === "Derivatives"
|
|
1442
|
+
)?.value;
|
|
1443
|
+
return v === "Allowed" || v === "Not Allowed" ? v : null;
|
|
1444
|
+
}
|
|
1445
|
+
function resolveRemixPolicy(input) {
|
|
1446
|
+
const canRemixDirect = input.viewerIsParentOwner || !input.parentNoDerivatives;
|
|
1447
|
+
const showDealOption = input.dealAvailable && !input.viewerIsParentOwner;
|
|
1448
|
+
return { ...input, canRemixDirect, showDealOption };
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1422
1451
|
// src/utils/ipfs-gateway.ts
|
|
1423
1452
|
var CID_PATH_PATTERN = /^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[a-z2-7]{58,})(\/[\w.\-/]*)?$/;
|
|
1424
1453
|
function isValidIpfsCidPath(cidPath) {
|
|
@@ -1502,6 +1531,7 @@ exports.createRpcProxyHandler = createRpcProxyHandler;
|
|
|
1502
1531
|
exports.encodeU256 = encodeU256;
|
|
1503
1532
|
exports.formatAmount = formatAmount;
|
|
1504
1533
|
exports.getCoordinates = getCoordinates;
|
|
1534
|
+
exports.getDerivativesTerm = getDerivativesTerm;
|
|
1505
1535
|
exports.getListableTokens = getListableTokens;
|
|
1506
1536
|
exports.getService = getService;
|
|
1507
1537
|
exports.getServicesByCapability = getServicesByCapability;
|
|
@@ -1518,8 +1548,10 @@ exports.normalizeAddress = normalizeAddress;
|
|
|
1518
1548
|
exports.normalizeHash = normalizeHash;
|
|
1519
1549
|
exports.parseAmount = parseAmount;
|
|
1520
1550
|
exports.requestIp = requestIp;
|
|
1551
|
+
exports.resolveAppFeeConfig = resolveAppFeeConfig;
|
|
1521
1552
|
exports.resolveConfig = resolveConfig;
|
|
1522
1553
|
exports.resolveFeeConfig = resolveFeeConfig;
|
|
1554
|
+
exports.resolveRemixPolicy = resolveRemixPolicy;
|
|
1523
1555
|
exports.resolveSafeImageContentType = resolveSafeImageContentType;
|
|
1524
1556
|
exports.shortenAddress = shortenAddress;
|
|
1525
1557
|
exports.stringifyBigInts = stringifyBigInts;
|