@tangle-network/agent-app 3.0.24 → 3.0.26

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.
@@ -100,13 +100,15 @@ export interface PlatformBillingHttp {
100
100
  getUsageByProduct(userApiKey: string): Promise<PlatformUsageProductRow[]>;
101
101
  /** GET /v1/billing/product-entitlement?product=<id> (user bearer). */
102
102
  getProductEntitlement(userApiKey: string, productId: string): Promise<ProductEntitlement>;
103
- /** POST /v1/billing/deduct (service token). */
103
+ /** POST /v1/billing/deduct (service token). Platform refuses a deduct without
104
+ * `keyId`, the id of a key the charged user owns (their sign-in key). */
104
105
  deduct(input: {
105
106
  platformUserId: string;
106
107
  amountUsd: number;
107
108
  type: string;
108
109
  description: string;
109
110
  referenceId: string;
111
+ keyId?: string;
110
112
  }): Promise<void>;
111
113
  /** Absolute URL of the platform's billing-management surface. */
112
114
  billingUrl(): string;
@@ -576,7 +576,8 @@ function createPlatformBillingHttp(opts) {
576
576
  type: input.type,
577
577
  product: opts.productSlug,
578
578
  description: input.description,
579
- referenceId: input.referenceId
579
+ referenceId: input.referenceId,
580
+ ...input.keyId ? { keyId: input.keyId } : {}
580
581
  })
581
582
  }, headers);
582
583
  },