@invonetwork/web-sdk 2.3.0 → 2.4.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/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@ All notable changes to `@invonetwork/web-sdk` are documented here. This project
4
4
  [Semantic Versioning](https://semver.org/). Releases are managed with
5
5
  [changesets](https://github.com/changesets/changesets).
6
6
 
7
+ ## [2.4.0] — 2026-07-10
8
+
9
+ **Steam transfer policy.** Steam-purchased currency is locked to Steam titles; the backend now
10
+ enforces this at transfer/send initiate and annotates destinations. Additive, and inert until a
11
+ title is flagged Steam-distributed. (Design doc: `docs/features/steam-transfer-policy.md`.)
12
+
13
+ - New `InvoError` classifiers on `initiateSend`/`initiateTransfer` 409s:
14
+ `isSteamValueNonTransferable` (with `steamTransferableMax` / `steamOriginAmount` — decimal
15
+ strings) and `isNonSteamValueIntoSteamBlocked`. Surface `err.message` verbatim.
16
+ - New `DestinationGame.acceptsSteamOriginValue` (maps `accepts_steam_origin_value`; `false` when
17
+ omitted) — disable non-Steam destinations for a player holding Steam value so they never hit
18
+ the 409.
19
+
20
+ No breaking changes.
21
+
7
22
  ## [2.3.0] — 2026-07-07
8
23
 
9
24
  **Claim-time phone-share approval.** The backend closed a security gap: claiming/collecting a
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  First-party TypeScript SDK for integrating **INVO** into partner **web** platforms (storefronts, web games, dashboards). It wraps INVO's web money flows behind a typed, versioned API — the web analog of the Unity/Unreal plugins.
4
4
 
5
- > **Status:** `v2.3.0` — stable, published on npm. The backend it wraps is **live** on sandbox + production. The API is covered by a [stability commitment](#stability): no breaking changes without a major bump. Recent highlights: **2.2.0** reconciled with the backend (`mintPlayerToken` is a session mint — `playerPhone` optional; send-by-phone-alone; email-only `getPlayerBalance`); **2.3.0** surfaces the claim-time phone-share `409` on `confirmReceipt*`/`claim*` (+ `err.phoneShareLast4`). Full history in the [CHANGELOG](CHANGELOG.md).
5
+ > **Status:** `v2.3.0` — stable, published on npm. The backend it wraps is **live** on sandbox + production. The API is covered by a [stability commitment](#stability): no breaking changes without a major bump. Recent highlights: **2.2.0** reconciled with the backend (`mintPlayerToken` is a session mint — `playerPhone` optional; send-by-phone-alone; email-only `getPlayerBalance`); **2.3.0** surfaces the claim-time phone-share `409` on `confirmReceipt*`/`claim*` (+ `err.phoneShareLast4`); **2.4.0** adds Steam transfer-policy handling (`isSteamValueNonTransferable`/`isNonSteamValueIntoSteamBlocked` + `DestinationGame.acceptsSteamOriginValue`). Full history in the [CHANGELOG](CHANGELOG.md).
6
6
  > Canonical partner reference: **https://docs.invo.network/docs/currency-purchase** and **https://docs.invo.network/docs/game-developer-integration**.
7
7
 
8
8
  ## What it does
@@ -382,6 +382,7 @@ try {
382
382
  - **Claim codes** are returned only by `approveTransfer`; they're the out-of-band fallback when the recipient isn't enrolled.
383
383
  - **`err.isReceiverNotEnrolled`** on `confirmReceipt*` is the explicit signal to switch to claim-code entry.
384
384
  - **`err.isPhoneShareApprovalRequired` on `confirmReceipt*` / `claimTransfer` / `claimCurrency`** (409): the receiver phone is contested, so INVO **holds the money** and texts the phone owner to approve. Not a failure — show `err.message` verbatim (`err.phoneShareLast4` names the phone), then **retry the same call** once approved (it succeeds idempotently); on denial/expiry the sender is refunded. Same handling as the initiate-time phone-share 409.
385
+ - **Steam titles** (dark until a title is Steam-distributed): `initiateSend`/`initiateTransfer` can throw `err.isSteamValueNonTransferable` (moving more than the non-Steam balance to a non-Steam destination — show `err.message`, cap the amount at `err.steamTransferableMax`; `err.steamOriginAmount` is the Steam-locked portion) or `err.isNonSteamValueIntoSteamBlocked` (non-Steam value into a Steam title). Prevent both up front: `getDestinations` rows carry **`acceptsSteamOriginValue`** — disable non-Steam destinations for a player holding Steam-purchased currency.
385
386
  - Transfer self-claim may be disabled for your tenant; if it is, surface the claim-code path instead.
386
387
  - **Holds:** an approve/claim can return an HTTP 202 hold instead of success — inspect `result.holdReason` (`"RISK_HOLD"`, `"GUARDIAN_APPROVAL_PENDING"`, and on confirm-receipt `"RECIPIENT_IDENTITY_PENDING"`); success has no `holdReason` (and `next: "pending_claim"`). Terminal guardian outcomes throw (`GUARDIAN_APPROVAL_REJECTED`/`_EXPIRED`).
387
388
 
@@ -573,6 +574,8 @@ Helpers:
573
574
  | `.isEnrollmentAuthorizationRequired` | first-enrollment needs the OTP grant → `enrollmentBegin`/`enrollmentVerify` |
574
575
  | `.isEnrollmentProofRequired` | another method exists → prove it via `linkDevice` |
575
576
  | `.isPhoneShareApprovalRequired` | phone needs owner approval — at register/mint **or** at claim/`confirmReceipt*` (contested receiver phone) → show `.message` (+ `.phoneShareLast4`), retry the same call after approval |
577
+ | `.isSteamValueNonTransferable` | initiate blocked (409): would move more than the non-Steam balance to a non-Steam destination → show `.message`, cap input at `.steamTransferableMax` (`.steamOriginAmount` = Steam-locked portion) |
578
+ | `.isNonSteamValueIntoSteamBlocked` | initiate blocked (409): non-Steam value can't move into a Steam title → show `.message`, pick a non-Steam destination |
576
579
  | `.isPhoneShareAlreadyApproved` | phone-share was already approved (e.g. from a `/reject`) |
577
580
 
578
581
  Client-side guards (bad amount, missing idempotency key, `rail:"steam"` on `purchaseCurrency`, item validation) throw `InvoError` with `.status === 0` **before** any network call. Notable backend codes: `SDK_TOKEN_EXPIRED`, `TENANT_NOT_MIGRATED`, `WEBAUTHN_NOT_ENABLED_FOR_TENANT`, `WEBAUTHN_UV_REQUIRED`, `ENROLLMENT_REQUIRES_PROOF`, `ENROLLMENT_CODE_INVALID`, `PASSKEY_RECOVERY_COOLDOWN` (403, `retryAfterAt`), `no_channel_on_file`, `rate_limited`, `WRONG_RAIL_ENDPOINT`, `flow_paused`.
@@ -97,6 +97,35 @@ var InvoError = class _InvoError extends Error {
97
97
  const v = this.bodyObject()["phone_last4"];
98
98
  return typeof v === "string" && v ? v : void 0;
99
99
  }
100
+ /**
101
+ * True if a transfer/send initiate was blocked because it would move more than the player's
102
+ * NON-Steam balance to a non-Steam destination (`STEAM_VALUE_NON_TRANSFERABLE`, 409).
103
+ * Steam-purchased currency is locked to Steam titles. NOT retryable as-is — show
104
+ * `err.message` and cap the amount at `err.steamTransferableMax` (`err.steamOriginAmount`
105
+ * is the Steam-locked portion). Prevent it up front by hiding non-Steam destinations for a
106
+ * holder of Steam value (`DestinationGame.acceptsSteamOriginValue`).
107
+ */
108
+ get isSteamValueNonTransferable() {
109
+ return this.code === "STEAM_VALUE_NON_TRANSFERABLE";
110
+ }
111
+ /** Max the player can still send to this (non-Steam) destination (`transferable_max`), a decimal string. */
112
+ get steamTransferableMax() {
113
+ const v = this.bodyObject()["transferable_max"];
114
+ return typeof v === "string" && v ? v : void 0;
115
+ }
116
+ /** The Steam-purchased portion locked to Steam titles (`steam_origin_amount`), a decimal string. */
117
+ get steamOriginAmount() {
118
+ const v = this.bodyObject()["steam_origin_amount"];
119
+ return typeof v === "string" && v ? v : void 0;
120
+ }
121
+ /**
122
+ * True if a transfer/send initiate was blocked because it moves NON-Steam value INTO a
123
+ * Steam title (`NON_STEAM_VALUE_INTO_STEAM_BLOCKED`, 409). Show `err.message`; the fix is to
124
+ * pick a non-Steam destination (surfaced via `DestinationGame.acceptsSteamOriginValue`).
125
+ */
126
+ get isNonSteamValueIntoSteamBlocked() {
127
+ return this.code === "NON_STEAM_VALUE_INTO_STEAM_BLOCKED";
128
+ }
100
129
  /** True if the phone-share (phone, requesting_email) pair was already approved. */
101
130
  get isPhoneShareAlreadyApproved() {
102
131
  return this.code === "PHONE_SHARE_ALREADY_APPROVED";
@@ -358,6 +387,7 @@ function toDestinationGame(row) {
358
387
  currencySymbolUrl: s("currency_symbol_url"),
359
388
  minimumTransfer: String(row["minimum_transfer"] ?? ""),
360
389
  maximumTransfer: String(row["maximum_transfer"] ?? ""),
390
+ acceptsSteamOriginValue: row["accepts_steam_origin_value"] === true,
361
391
  raw: row
362
392
  };
363
393
  }
@@ -381,5 +411,5 @@ function toDestinationsResult(raw, direction) {
381
411
  }
382
412
 
383
413
  export { Http, InvoError, assertSecureBaseUrl, toDestinationsResult };
384
- //# sourceMappingURL=chunk-SNFO5THM.js.map
385
- //# sourceMappingURL=chunk-SNFO5THM.js.map
414
+ //# sourceMappingURL=chunk-SSTZKXPC.js.map
415
+ //# sourceMappingURL=chunk-SSTZKXPC.js.map
package/dist/index.cjs CHANGED
@@ -99,6 +99,35 @@ var InvoError = class _InvoError extends Error {
99
99
  const v = this.bodyObject()["phone_last4"];
100
100
  return typeof v === "string" && v ? v : void 0;
101
101
  }
102
+ /**
103
+ * True if a transfer/send initiate was blocked because it would move more than the player's
104
+ * NON-Steam balance to a non-Steam destination (`STEAM_VALUE_NON_TRANSFERABLE`, 409).
105
+ * Steam-purchased currency is locked to Steam titles. NOT retryable as-is — show
106
+ * `err.message` and cap the amount at `err.steamTransferableMax` (`err.steamOriginAmount`
107
+ * is the Steam-locked portion). Prevent it up front by hiding non-Steam destinations for a
108
+ * holder of Steam value (`DestinationGame.acceptsSteamOriginValue`).
109
+ */
110
+ get isSteamValueNonTransferable() {
111
+ return this.code === "STEAM_VALUE_NON_TRANSFERABLE";
112
+ }
113
+ /** Max the player can still send to this (non-Steam) destination (`transferable_max`), a decimal string. */
114
+ get steamTransferableMax() {
115
+ const v = this.bodyObject()["transferable_max"];
116
+ return typeof v === "string" && v ? v : void 0;
117
+ }
118
+ /** The Steam-purchased portion locked to Steam titles (`steam_origin_amount`), a decimal string. */
119
+ get steamOriginAmount() {
120
+ const v = this.bodyObject()["steam_origin_amount"];
121
+ return typeof v === "string" && v ? v : void 0;
122
+ }
123
+ /**
124
+ * True if a transfer/send initiate was blocked because it moves NON-Steam value INTO a
125
+ * Steam title (`NON_STEAM_VALUE_INTO_STEAM_BLOCKED`, 409). Show `err.message`; the fix is to
126
+ * pick a non-Steam destination (surfaced via `DestinationGame.acceptsSteamOriginValue`).
127
+ */
128
+ get isNonSteamValueIntoSteamBlocked() {
129
+ return this.code === "NON_STEAM_VALUE_INTO_STEAM_BLOCKED";
130
+ }
102
131
  /** True if the phone-share (phone, requesting_email) pair was already approved. */
103
132
  get isPhoneShareAlreadyApproved() {
104
133
  return this.code === "PHONE_SHARE_ALREADY_APPROVED";
@@ -451,6 +480,7 @@ function toDestinationGame(row) {
451
480
  currencySymbolUrl: s("currency_symbol_url"),
452
481
  minimumTransfer: String(row["minimum_transfer"] ?? ""),
453
482
  maximumTransfer: String(row["maximum_transfer"] ?? ""),
483
+ acceptsSteamOriginValue: row["accepts_steam_origin_value"] === true,
454
484
  raw: row
455
485
  };
456
486
  }
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as ClientConfig, a as CallOptions, A as ApproveResult, b as ConfirmReceiptResult, L as LinkDeviceResult, P as PendingCollectResult, D as DestinationsQuery, c as DestinationsResult, B as BalanceResult, E as EnrollmentBeginResult, d as EnrollmentVerifyResult, R as RecoveryBeginResult, e as RecoveryCompleteResult } from './types-Cpo5Fvf9.cjs';
2
- export { f as BalanceRow, g as DestinationGame, I as InvoError, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, l as PendingCollectItem, m as Rail, V as VerificationMethod } from './types-Cpo5Fvf9.cjs';
1
+ import { C as ClientConfig, a as CallOptions, A as ApproveResult, b as ConfirmReceiptResult, L as LinkDeviceResult, P as PendingCollectResult, D as DestinationsQuery, c as DestinationsResult, B as BalanceResult, E as EnrollmentBeginResult, d as EnrollmentVerifyResult, R as RecoveryBeginResult, e as RecoveryCompleteResult } from './types-7Hl0Z1Ta.cjs';
2
+ export { f as BalanceRow, g as DestinationGame, I as InvoError, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, l as PendingCollectItem, m as Rail, V as VerificationMethod } from './types-7Hl0Z1Ta.cjs';
3
3
 
4
4
  declare class InvoClient {
5
5
  private readonly http;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as ClientConfig, a as CallOptions, A as ApproveResult, b as ConfirmReceiptResult, L as LinkDeviceResult, P as PendingCollectResult, D as DestinationsQuery, c as DestinationsResult, B as BalanceResult, E as EnrollmentBeginResult, d as EnrollmentVerifyResult, R as RecoveryBeginResult, e as RecoveryCompleteResult } from './types-Cpo5Fvf9.js';
2
- export { f as BalanceRow, g as DestinationGame, I as InvoError, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, l as PendingCollectItem, m as Rail, V as VerificationMethod } from './types-Cpo5Fvf9.js';
1
+ import { C as ClientConfig, a as CallOptions, A as ApproveResult, b as ConfirmReceiptResult, L as LinkDeviceResult, P as PendingCollectResult, D as DestinationsQuery, c as DestinationsResult, B as BalanceResult, E as EnrollmentBeginResult, d as EnrollmentVerifyResult, R as RecoveryBeginResult, e as RecoveryCompleteResult } from './types-7Hl0Z1Ta.js';
2
+ export { f as BalanceRow, g as DestinationGame, I as InvoError, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, l as PendingCollectItem, m as Rail, V as VerificationMethod } from './types-7Hl0Z1Ta.js';
3
3
 
4
4
  declare class InvoClient {
5
5
  private readonly http;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { assertSecureBaseUrl, Http, toDestinationsResult, InvoError } from './chunk-SNFO5THM.js';
2
- export { InvoError } from './chunk-SNFO5THM.js';
1
+ import { assertSecureBaseUrl, Http, toDestinationsResult, InvoError } from './chunk-SSTZKXPC.js';
2
+ export { InvoError } from './chunk-SSTZKXPC.js';
3
3
 
4
4
  // src/shared/webauthn.ts
5
5
  function malformedOptions(field) {
package/dist/server.cjs CHANGED
@@ -101,6 +101,35 @@ var InvoError = class _InvoError extends Error {
101
101
  const v = this.bodyObject()["phone_last4"];
102
102
  return typeof v === "string" && v ? v : void 0;
103
103
  }
104
+ /**
105
+ * True if a transfer/send initiate was blocked because it would move more than the player's
106
+ * NON-Steam balance to a non-Steam destination (`STEAM_VALUE_NON_TRANSFERABLE`, 409).
107
+ * Steam-purchased currency is locked to Steam titles. NOT retryable as-is — show
108
+ * `err.message` and cap the amount at `err.steamTransferableMax` (`err.steamOriginAmount`
109
+ * is the Steam-locked portion). Prevent it up front by hiding non-Steam destinations for a
110
+ * holder of Steam value (`DestinationGame.acceptsSteamOriginValue`).
111
+ */
112
+ get isSteamValueNonTransferable() {
113
+ return this.code === "STEAM_VALUE_NON_TRANSFERABLE";
114
+ }
115
+ /** Max the player can still send to this (non-Steam) destination (`transferable_max`), a decimal string. */
116
+ get steamTransferableMax() {
117
+ const v = this.bodyObject()["transferable_max"];
118
+ return typeof v === "string" && v ? v : void 0;
119
+ }
120
+ /** The Steam-purchased portion locked to Steam titles (`steam_origin_amount`), a decimal string. */
121
+ get steamOriginAmount() {
122
+ const v = this.bodyObject()["steam_origin_amount"];
123
+ return typeof v === "string" && v ? v : void 0;
124
+ }
125
+ /**
126
+ * True if a transfer/send initiate was blocked because it moves NON-Steam value INTO a
127
+ * Steam title (`NON_STEAM_VALUE_INTO_STEAM_BLOCKED`, 409). Show `err.message`; the fix is to
128
+ * pick a non-Steam destination (surfaced via `DestinationGame.acceptsSteamOriginValue`).
129
+ */
130
+ get isNonSteamValueIntoSteamBlocked() {
131
+ return this.code === "NON_STEAM_VALUE_INTO_STEAM_BLOCKED";
132
+ }
104
133
  /** True if the phone-share (phone, requesting_email) pair was already approved. */
105
134
  get isPhoneShareAlreadyApproved() {
106
135
  return this.code === "PHONE_SHARE_ALREADY_APPROVED";
@@ -362,6 +391,7 @@ function toDestinationGame(row) {
362
391
  currencySymbolUrl: s("currency_symbol_url"),
363
392
  minimumTransfer: String(row["minimum_transfer"] ?? ""),
364
393
  maximumTransfer: String(row["maximum_transfer"] ?? ""),
394
+ acceptsSteamOriginValue: row["accepts_steam_origin_value"] === true,
365
395
  raw: row
366
396
  };
367
397
  }
@@ -548,7 +578,7 @@ async function hmacHexSubtle(secret, message) {
548
578
  }
549
579
 
550
580
  // src/server.ts
551
- var DEFAULT_UA = "invonetwork-web-sdk/2.3.0 (+https://invo.network)";
581
+ var DEFAULT_UA = "invonetwork-web-sdk/2.4.0 (+https://invo.network)";
552
582
  var MAX_USD_AMOUNT = 999.99;
553
583
  var MAX_ITEM_PRICE = 999999.99;
554
584
  function invalidInput(label, value, why) {
@@ -762,7 +792,14 @@ var InvoServer = class {
762
792
  identityId: String(raw["identity_id"] ?? "")
763
793
  };
764
794
  }
765
- /** Initiate a cross-game currency SEND. Inspect result.verificationMethod. */
795
+ /**
796
+ * Initiate a cross-game currency SEND. Inspect result.verificationMethod.
797
+ *
798
+ * Steam titles: can throw a 409 `err.isSteamValueNonTransferable` (moving more than the
799
+ * player's non-Steam balance to a non-Steam destination — cap at `err.steamTransferableMax`)
800
+ * or `err.isNonSteamValueIntoSteamBlocked` (non-Steam value into a Steam title). Prevent both
801
+ * up front with `DestinationGame.acceptsSteamOriginValue`.
802
+ */
766
803
  async initiateSend(input, opts) {
767
804
  const raw = await this.http.post(
768
805
  "/api/currency-sends/initiate-send",
@@ -782,7 +819,9 @@ var InvoServer = class {
782
819
  );
783
820
  return this.toInitiateResult(raw);
784
821
  }
785
- /** Initiate a cross-game TRANSFER. Inspect result.verificationMethod. */
822
+ /** Initiate a cross-game TRANSFER. Inspect result.verificationMethod. Can throw the same
823
+ * Steam-policy 409s as {@link initiateSend} (`isSteamValueNonTransferable` /
824
+ * `isNonSteamValueIntoSteamBlocked`). */
786
825
  async initiateTransfer(input, opts) {
787
826
  const raw = await this.http.post(
788
827
  "/api/transfers/initiate-transfer",
package/dist/server.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as InvoError, S as ServerConfig, a as CallOptions, n as PlayerToken, o as InitiateSendInput, p as InitiateResult, q as InitiateTransferInput, r as CreateCheckoutInput, s as CreateCheckoutResult, t as PurchaseInput, u as PurchaseResult, v as ConfirmPaymentResult, O as OrderDetailsResult, w as PurchaseItemInput, x as PurchaseItemResult, y as ItemHistoryQuery, z as ItemHistoryResult, F as ItemOrderQuery, G as PlayerBalanceQuery, H as PlayerBalanceResult, J as InboundPendingQuery, K as InboundPendingResult, M as LinkedIdentitiesQuery, N as LinkedIdentitiesResult, Q as SmsVerifyResult, T as ClaimTransferInput, U as ClaimResult, W as ClaimCurrencyInput, X as TransactionStatusResult, Y as GuardianApprovalStatusResult, Z as ServerDestinationsQuery, c as DestinationsResult, _ as PhoneShareContact, $ as PhoneShareInitiateResult, a0 as PhoneShareApproveInput, a1 as PhoneShareApproveResult, a2 as PhoneShareStatusResult } from './types-Cpo5Fvf9.cjs';
2
- export { a3 as CurrencyBalance, g as DestinationGame, a4 as InboundPendingItem, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, a5 as LinkedIdentityEmail, m as Rail, V as VerificationMethod } from './types-Cpo5Fvf9.cjs';
1
+ import { I as InvoError, S as ServerConfig, a as CallOptions, n as PlayerToken, o as InitiateSendInput, p as InitiateResult, q as InitiateTransferInput, r as CreateCheckoutInput, s as CreateCheckoutResult, t as PurchaseInput, u as PurchaseResult, v as ConfirmPaymentResult, O as OrderDetailsResult, w as PurchaseItemInput, x as PurchaseItemResult, y as ItemHistoryQuery, z as ItemHistoryResult, F as ItemOrderQuery, G as PlayerBalanceQuery, H as PlayerBalanceResult, J as InboundPendingQuery, K as InboundPendingResult, M as LinkedIdentitiesQuery, N as LinkedIdentitiesResult, Q as SmsVerifyResult, T as ClaimTransferInput, U as ClaimResult, W as ClaimCurrencyInput, X as TransactionStatusResult, Y as GuardianApprovalStatusResult, Z as ServerDestinationsQuery, c as DestinationsResult, _ as PhoneShareContact, $ as PhoneShareInitiateResult, a0 as PhoneShareApproveInput, a1 as PhoneShareApproveResult, a2 as PhoneShareStatusResult } from './types-7Hl0Z1Ta.cjs';
2
+ export { a3 as CurrencyBalance, g as DestinationGame, a4 as InboundPendingItem, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, a5 as LinkedIdentityEmail, m as Rail, V as VerificationMethod } from './types-7Hl0Z1Ta.cjs';
3
3
 
4
4
  interface VerifyWebhookOptions {
5
5
  /** Max age of the signed timestamp, in seconds. Default 300 (5 min). */
@@ -167,9 +167,18 @@ declare class InvoServer {
167
167
  playerEmail: string;
168
168
  playerPhone?: string;
169
169
  }, opts?: CallOptions): Promise<PlayerToken>;
170
- /** Initiate a cross-game currency SEND. Inspect result.verificationMethod. */
170
+ /**
171
+ * Initiate a cross-game currency SEND. Inspect result.verificationMethod.
172
+ *
173
+ * Steam titles: can throw a 409 `err.isSteamValueNonTransferable` (moving more than the
174
+ * player's non-Steam balance to a non-Steam destination — cap at `err.steamTransferableMax`)
175
+ * or `err.isNonSteamValueIntoSteamBlocked` (non-Steam value into a Steam title). Prevent both
176
+ * up front with `DestinationGame.acceptsSteamOriginValue`.
177
+ */
171
178
  initiateSend(input: InitiateSendInput, opts?: CallOptions): Promise<InitiateResult>;
172
- /** Initiate a cross-game TRANSFER. Inspect result.verificationMethod. */
179
+ /** Initiate a cross-game TRANSFER. Inspect result.verificationMethod. Can throw the same
180
+ * Steam-policy 409s as {@link initiateSend} (`isSteamValueNonTransferable` /
181
+ * `isNonSteamValueIntoSteamBlocked`). */
173
182
  initiateTransfer(input: InitiateTransferInput, opts?: CallOptions): Promise<InitiateResult>;
174
183
  /** Create a hosted checkout session (the recommended purchase path). Open the
175
184
  * returned checkoutUrl in a WebView/redirect or an iframe; the INVO-hosted page
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as InvoError, S as ServerConfig, a as CallOptions, n as PlayerToken, o as InitiateSendInput, p as InitiateResult, q as InitiateTransferInput, r as CreateCheckoutInput, s as CreateCheckoutResult, t as PurchaseInput, u as PurchaseResult, v as ConfirmPaymentResult, O as OrderDetailsResult, w as PurchaseItemInput, x as PurchaseItemResult, y as ItemHistoryQuery, z as ItemHistoryResult, F as ItemOrderQuery, G as PlayerBalanceQuery, H as PlayerBalanceResult, J as InboundPendingQuery, K as InboundPendingResult, M as LinkedIdentitiesQuery, N as LinkedIdentitiesResult, Q as SmsVerifyResult, T as ClaimTransferInput, U as ClaimResult, W as ClaimCurrencyInput, X as TransactionStatusResult, Y as GuardianApprovalStatusResult, Z as ServerDestinationsQuery, c as DestinationsResult, _ as PhoneShareContact, $ as PhoneShareInitiateResult, a0 as PhoneShareApproveInput, a1 as PhoneShareApproveResult, a2 as PhoneShareStatusResult } from './types-Cpo5Fvf9.js';
2
- export { a3 as CurrencyBalance, g as DestinationGame, a4 as InboundPendingItem, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, a5 as LinkedIdentityEmail, m as Rail, V as VerificationMethod } from './types-Cpo5Fvf9.js';
1
+ import { I as InvoError, S as ServerConfig, a as CallOptions, n as PlayerToken, o as InitiateSendInput, p as InitiateResult, q as InitiateTransferInput, r as CreateCheckoutInput, s as CreateCheckoutResult, t as PurchaseInput, u as PurchaseResult, v as ConfirmPaymentResult, O as OrderDetailsResult, w as PurchaseItemInput, x as PurchaseItemResult, y as ItemHistoryQuery, z as ItemHistoryResult, F as ItemOrderQuery, G as PlayerBalanceQuery, H as PlayerBalanceResult, J as InboundPendingQuery, K as InboundPendingResult, M as LinkedIdentitiesQuery, N as LinkedIdentitiesResult, Q as SmsVerifyResult, T as ClaimTransferInput, U as ClaimResult, W as ClaimCurrencyInput, X as TransactionStatusResult, Y as GuardianApprovalStatusResult, Z as ServerDestinationsQuery, c as DestinationsResult, _ as PhoneShareContact, $ as PhoneShareInitiateResult, a0 as PhoneShareApproveInput, a1 as PhoneShareApproveResult, a2 as PhoneShareStatusResult } from './types-7Hl0Z1Ta.js';
2
+ export { a3 as CurrencyBalance, g as DestinationGame, a4 as InboundPendingItem, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, a5 as LinkedIdentityEmail, m as Rail, V as VerificationMethod } from './types-7Hl0Z1Ta.js';
3
3
 
4
4
  interface VerifyWebhookOptions {
5
5
  /** Max age of the signed timestamp, in seconds. Default 300 (5 min). */
@@ -167,9 +167,18 @@ declare class InvoServer {
167
167
  playerEmail: string;
168
168
  playerPhone?: string;
169
169
  }, opts?: CallOptions): Promise<PlayerToken>;
170
- /** Initiate a cross-game currency SEND. Inspect result.verificationMethod. */
170
+ /**
171
+ * Initiate a cross-game currency SEND. Inspect result.verificationMethod.
172
+ *
173
+ * Steam titles: can throw a 409 `err.isSteamValueNonTransferable` (moving more than the
174
+ * player's non-Steam balance to a non-Steam destination — cap at `err.steamTransferableMax`)
175
+ * or `err.isNonSteamValueIntoSteamBlocked` (non-Steam value into a Steam title). Prevent both
176
+ * up front with `DestinationGame.acceptsSteamOriginValue`.
177
+ */
171
178
  initiateSend(input: InitiateSendInput, opts?: CallOptions): Promise<InitiateResult>;
172
- /** Initiate a cross-game TRANSFER. Inspect result.verificationMethod. */
179
+ /** Initiate a cross-game TRANSFER. Inspect result.verificationMethod. Can throw the same
180
+ * Steam-policy 409s as {@link initiateSend} (`isSteamValueNonTransferable` /
181
+ * `isNonSteamValueIntoSteamBlocked`). */
173
182
  initiateTransfer(input: InitiateTransferInput, opts?: CallOptions): Promise<InitiateResult>;
174
183
  /** Create a hosted checkout session (the recommended purchase path). Open the
175
184
  * returned checkoutUrl in a WebView/redirect or an iframe; the INVO-hosted page
package/dist/server.js CHANGED
@@ -1,5 +1,5 @@
1
- import { InvoError, assertSecureBaseUrl, Http, toDestinationsResult } from './chunk-SNFO5THM.js';
2
- export { InvoError } from './chunk-SNFO5THM.js';
1
+ import { InvoError, assertSecureBaseUrl, Http, toDestinationsResult } from './chunk-SSTZKXPC.js';
2
+ export { InvoError } from './chunk-SSTZKXPC.js';
3
3
  import { createHmac, timingSafeEqual } from 'crypto';
4
4
 
5
5
  var DEFAULT_TOLERANCE_SEC = 300;
@@ -167,7 +167,7 @@ async function hmacHexSubtle(secret, message) {
167
167
  }
168
168
 
169
169
  // src/server.ts
170
- var DEFAULT_UA = "invonetwork-web-sdk/2.3.0 (+https://invo.network)";
170
+ var DEFAULT_UA = "invonetwork-web-sdk/2.4.0 (+https://invo.network)";
171
171
  var MAX_USD_AMOUNT = 999.99;
172
172
  var MAX_ITEM_PRICE = 999999.99;
173
173
  function invalidInput(label, value, why) {
@@ -381,7 +381,14 @@ var InvoServer = class {
381
381
  identityId: String(raw["identity_id"] ?? "")
382
382
  };
383
383
  }
384
- /** Initiate a cross-game currency SEND. Inspect result.verificationMethod. */
384
+ /**
385
+ * Initiate a cross-game currency SEND. Inspect result.verificationMethod.
386
+ *
387
+ * Steam titles: can throw a 409 `err.isSteamValueNonTransferable` (moving more than the
388
+ * player's non-Steam balance to a non-Steam destination — cap at `err.steamTransferableMax`)
389
+ * or `err.isNonSteamValueIntoSteamBlocked` (non-Steam value into a Steam title). Prevent both
390
+ * up front with `DestinationGame.acceptsSteamOriginValue`.
391
+ */
385
392
  async initiateSend(input, opts) {
386
393
  const raw = await this.http.post(
387
394
  "/api/currency-sends/initiate-send",
@@ -401,7 +408,9 @@ var InvoServer = class {
401
408
  );
402
409
  return this.toInitiateResult(raw);
403
410
  }
404
- /** Initiate a cross-game TRANSFER. Inspect result.verificationMethod. */
411
+ /** Initiate a cross-game TRANSFER. Inspect result.verificationMethod. Can throw the same
412
+ * Steam-policy 409s as {@link initiateSend} (`isSteamValueNonTransferable` /
413
+ * `isNonSteamValueIntoSteamBlocked`). */
405
414
  async initiateTransfer(input, opts) {
406
415
  const raw = await this.http.post(
407
416
  "/api/transfers/initiate-transfer",
@@ -81,6 +81,25 @@ declare class InvoError extends Error {
81
81
  get phoneShareApprovalId(): string | undefined;
82
82
  /** Last 4 digits of the phone that must approve (`phone_last4`), for the UI message. */
83
83
  get phoneShareLast4(): string | undefined;
84
+ /**
85
+ * True if a transfer/send initiate was blocked because it would move more than the player's
86
+ * NON-Steam balance to a non-Steam destination (`STEAM_VALUE_NON_TRANSFERABLE`, 409).
87
+ * Steam-purchased currency is locked to Steam titles. NOT retryable as-is — show
88
+ * `err.message` and cap the amount at `err.steamTransferableMax` (`err.steamOriginAmount`
89
+ * is the Steam-locked portion). Prevent it up front by hiding non-Steam destinations for a
90
+ * holder of Steam value (`DestinationGame.acceptsSteamOriginValue`).
91
+ */
92
+ get isSteamValueNonTransferable(): boolean;
93
+ /** Max the player can still send to this (non-Steam) destination (`transferable_max`), a decimal string. */
94
+ get steamTransferableMax(): string | undefined;
95
+ /** The Steam-purchased portion locked to Steam titles (`steam_origin_amount`), a decimal string. */
96
+ get steamOriginAmount(): string | undefined;
97
+ /**
98
+ * True if a transfer/send initiate was blocked because it moves NON-Steam value INTO a
99
+ * Steam title (`NON_STEAM_VALUE_INTO_STEAM_BLOCKED`, 409). Show `err.message`; the fix is to
100
+ * pick a non-Steam destination (surfaced via `DestinationGame.acceptsSteamOriginValue`).
101
+ */
102
+ get isNonSteamValueIntoSteamBlocked(): boolean;
84
103
  /** True if the phone-share (phone, requesting_email) pair was already approved. */
85
104
  get isPhoneShareAlreadyApproved(): boolean;
86
105
  /** True if an idempotency-keyed request was a duplicate (item purchase → 409). */
@@ -483,6 +502,10 @@ interface DestinationGame {
483
502
  /** Limits are decimal strings. */
484
503
  minimumTransfer: string;
485
504
  maximumTransfer: string;
505
+ /** True for Steam-distributed titles — they accept Steam-purchased (Steam-origin) value.
506
+ * Disable non-Steam destinations for a player holding Steam value so they never hit the
507
+ * `STEAM_VALUE_NON_TRANSFERABLE` 409. Defaults to `false` when the backend omits it. */
508
+ acceptsSteamOriginValue: boolean;
486
509
  raw: Record<string, unknown>;
487
510
  }
488
511
  interface DestinationsResult {
@@ -81,6 +81,25 @@ declare class InvoError extends Error {
81
81
  get phoneShareApprovalId(): string | undefined;
82
82
  /** Last 4 digits of the phone that must approve (`phone_last4`), for the UI message. */
83
83
  get phoneShareLast4(): string | undefined;
84
+ /**
85
+ * True if a transfer/send initiate was blocked because it would move more than the player's
86
+ * NON-Steam balance to a non-Steam destination (`STEAM_VALUE_NON_TRANSFERABLE`, 409).
87
+ * Steam-purchased currency is locked to Steam titles. NOT retryable as-is — show
88
+ * `err.message` and cap the amount at `err.steamTransferableMax` (`err.steamOriginAmount`
89
+ * is the Steam-locked portion). Prevent it up front by hiding non-Steam destinations for a
90
+ * holder of Steam value (`DestinationGame.acceptsSteamOriginValue`).
91
+ */
92
+ get isSteamValueNonTransferable(): boolean;
93
+ /** Max the player can still send to this (non-Steam) destination (`transferable_max`), a decimal string. */
94
+ get steamTransferableMax(): string | undefined;
95
+ /** The Steam-purchased portion locked to Steam titles (`steam_origin_amount`), a decimal string. */
96
+ get steamOriginAmount(): string | undefined;
97
+ /**
98
+ * True if a transfer/send initiate was blocked because it moves NON-Steam value INTO a
99
+ * Steam title (`NON_STEAM_VALUE_INTO_STEAM_BLOCKED`, 409). Show `err.message`; the fix is to
100
+ * pick a non-Steam destination (surfaced via `DestinationGame.acceptsSteamOriginValue`).
101
+ */
102
+ get isNonSteamValueIntoSteamBlocked(): boolean;
84
103
  /** True if the phone-share (phone, requesting_email) pair was already approved. */
85
104
  get isPhoneShareAlreadyApproved(): boolean;
86
105
  /** True if an idempotency-keyed request was a duplicate (item purchase → 409). */
@@ -483,6 +502,10 @@ interface DestinationGame {
483
502
  /** Limits are decimal strings. */
484
503
  minimumTransfer: string;
485
504
  maximumTransfer: string;
505
+ /** True for Steam-distributed titles — they accept Steam-purchased (Steam-origin) value.
506
+ * Disable non-Steam destinations for a player holding Steam value so they never hit the
507
+ * `STEAM_VALUE_NON_TRANSFERABLE` 409. Defaults to `false` when the backend omits it. */
508
+ acceptsSteamOriginValue: boolean;
486
509
  raw: Record<string, unknown>;
487
510
  }
488
511
  interface DestinationsResult {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invonetwork/web-sdk",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "INVO Web SDK — currency purchase + passkey (WebAuthn) verification for partner web platforms.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "private": false,