@orangecheck/me-client 0.25.3 → 0.26.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.
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -1
- package/dist/integrator.js +2 -0
- package/dist/integrator.js.map +1 -1
- package/dist/integrator.mjs +2 -0
- package/dist/integrator.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -250,6 +250,7 @@ var PLATFORM_FEE_POLICY = {
|
|
|
250
250
|
ratified: "2026-04-30"
|
|
251
251
|
};
|
|
252
252
|
var MIN_INTEGRATOR_PRICE_SATS = 1;
|
|
253
|
+
var MAX_INTEGRATOR_PRICE_SATS = 1e7;
|
|
253
254
|
var MAX_DROP_WINDOW_DAYS = 92;
|
|
254
255
|
function computeFees(cfg, payment_amount_sats, opts) {
|
|
255
256
|
const is_agent = opts?.is_agent === true;
|
|
@@ -270,6 +271,7 @@ function computeFees(cfg, payment_amount_sats, opts) {
|
|
|
270
271
|
Math.round(payment_amount_sats * effective_site_pays.pct)
|
|
271
272
|
);
|
|
272
273
|
}
|
|
274
|
+
gross = Math.min(gross, MAX_INTEGRATOR_PRICE_SATS);
|
|
273
275
|
const platform_fee_sats = Math.min(
|
|
274
276
|
gross,
|
|
275
277
|
Math.max(PLATFORM_FEE_POLICY.min_floor_sats, Math.round(gross * PLATFORM_FEE_POLICY.pct))
|
|
@@ -340,6 +342,11 @@ async function fire(options) {
|
|
|
340
342
|
if (!options.subtype) {
|
|
341
343
|
throw new Error("event.fire requires subtype");
|
|
342
344
|
}
|
|
345
|
+
if (options.userAddress && !options.signingSecret) {
|
|
346
|
+
throw new Error(
|
|
347
|
+
"event.fire: userAddress names who earns, so it requires signingSecret \u2014 the signature over the request body is what authorises that earner. Without the secret, pass bearerToken (or rely on the oc_session cookie) and the caller earns instead."
|
|
348
|
+
);
|
|
349
|
+
}
|
|
343
350
|
const requestBody = {
|
|
344
351
|
project_key: options.project_key,
|
|
345
352
|
subtype: options.subtype
|
|
@@ -349,6 +356,7 @@ async function fire(options) {
|
|
|
349
356
|
if (options.action_label !== void 0) requestBody.action_label = options.action_label;
|
|
350
357
|
if (options.metadata !== void 0) requestBody.metadata = options.metadata;
|
|
351
358
|
if (options.is_agent !== void 0) requestBody.is_agent = options.is_agent;
|
|
359
|
+
if (options.userAddress !== void 0) requestBody.user_address = options.userAddress;
|
|
352
360
|
const headers = {};
|
|
353
361
|
if (options.idempotencyKey) headers["idempotency-key"] = options.idempotencyKey;
|
|
354
362
|
if (options.signingSecret) {
|