@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.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -272,6 +272,7 @@ var PLATFORM_FEE_POLICY = {
|
|
|
272
272
|
ratified: "2026-04-30"
|
|
273
273
|
};
|
|
274
274
|
var MIN_INTEGRATOR_PRICE_SATS = 1;
|
|
275
|
+
var MAX_INTEGRATOR_PRICE_SATS = 1e7;
|
|
275
276
|
var MAX_DROP_WINDOW_DAYS = 92;
|
|
276
277
|
function computeFees(cfg, payment_amount_sats, opts) {
|
|
277
278
|
const is_agent = opts?.is_agent === true;
|
|
@@ -292,6 +293,7 @@ function computeFees(cfg, payment_amount_sats, opts) {
|
|
|
292
293
|
Math.round(payment_amount_sats * effective_site_pays.pct)
|
|
293
294
|
);
|
|
294
295
|
}
|
|
296
|
+
gross = Math.min(gross, MAX_INTEGRATOR_PRICE_SATS);
|
|
295
297
|
const platform_fee_sats = Math.min(
|
|
296
298
|
gross,
|
|
297
299
|
Math.max(PLATFORM_FEE_POLICY.min_floor_sats, Math.round(gross * PLATFORM_FEE_POLICY.pct))
|
|
@@ -362,6 +364,11 @@ async function fire(options) {
|
|
|
362
364
|
if (!options.subtype) {
|
|
363
365
|
throw new Error("event.fire requires subtype");
|
|
364
366
|
}
|
|
367
|
+
if (options.userAddress && !options.signingSecret) {
|
|
368
|
+
throw new Error(
|
|
369
|
+
"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."
|
|
370
|
+
);
|
|
371
|
+
}
|
|
365
372
|
const requestBody = {
|
|
366
373
|
project_key: options.project_key,
|
|
367
374
|
subtype: options.subtype
|
|
@@ -371,6 +378,7 @@ async function fire(options) {
|
|
|
371
378
|
if (options.action_label !== void 0) requestBody.action_label = options.action_label;
|
|
372
379
|
if (options.metadata !== void 0) requestBody.metadata = options.metadata;
|
|
373
380
|
if (options.is_agent !== void 0) requestBody.is_agent = options.is_agent;
|
|
381
|
+
if (options.userAddress !== void 0) requestBody.user_address = options.userAddress;
|
|
374
382
|
const headers = {};
|
|
375
383
|
if (options.idempotencyKey) headers["idempotency-key"] = options.idempotencyKey;
|
|
376
384
|
if (options.signingSecret) {
|