@invonetwork/web-sdk 0.5.0 → 0.7.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.
@@ -26,6 +26,10 @@ declare class InvoError extends Error {
26
26
  get isReceiverNotEnrolled(): boolean;
27
27
  /** True if the session/SDK token has expired and the caller should re-mint + retry. */
28
28
  get isTokenExpired(): boolean;
29
+ /** True if `enrollPasskey()` needs the OTP-grant flow (`enrollmentBegin`/`enrollmentVerify`). */
30
+ get isEnrollmentAuthorizationRequired(): boolean;
31
+ /** True if enrolling is blocked because another method exists — use `linkDevice`. */
32
+ get isEnrollmentProofRequired(): boolean;
29
33
  /**
30
34
  * True if an item purchase failed because the player's balance was too low (§4.8 → 400).
31
35
  * The backend carries `required_amount` + `current_balance` on the body for the UI.
@@ -308,9 +312,101 @@ interface ApproveResult {
308
312
  /** transfer-approve returns the sender's claim code; send-approve does not. */
309
313
  claimCode?: string;
310
314
  claimCodeExpiresAt?: string;
315
+ /**
316
+ * Present when the approve came back as an HTTP 202 **hold** rather than success —
317
+ * e.g. `"RISK_HOLD"`, `"GUARDIAN_APPROVAL_PENDING"`, `"STEP_UP_REQUIRED"` (the last
318
+ * only on non-passkey approvals). Success carries no holdReason. Terminal guardian
319
+ * outcomes (`GUARDIAN_APPROVAL_REJECTED`/`_EXPIRED` 410, `..._CHECK_UNAVAILABLE` 503)
320
+ * are thrown as `InvoError` instead.
321
+ */
322
+ holdReason?: string;
323
+ /** Risk-engine detail on a RISK_HOLD: `{ decision, reasons[] }`. */
324
+ risk?: Record<string, unknown>;
325
+ /** The guardian_approval audit object on GUARDIAN_APPROVAL_PENDING. */
326
+ guardianApproval?: unknown;
327
+ /** Poll endpoint for guardian status (transfer holds only). */
328
+ pollEndpoint?: string;
311
329
  raw: Record<string, unknown>;
312
330
  }
313
331
  interface ConfirmReceiptResult {
332
+ status: string;
333
+ /** Present on a 202 hold — e.g. `"RECIPIENT_IDENTITY_PENDING"`. */
334
+ holdReason?: string;
335
+ raw: Record<string, unknown>;
336
+ }
337
+ interface PendingCollectItem {
338
+ /** The transaction id — note the backend key is `transfer_id`. */
339
+ transferId: string;
340
+ /** "identity_gate" (you initiated → call approve*) | "receiving_confirm" (peer send → call confirmReceipt*). */
341
+ kind: string;
342
+ /** "transfer" | "send". */
343
+ flow: string;
344
+ amount: string | null;
345
+ /** Currency name (not id). */
346
+ currency: string;
347
+ /** Tenant name — destination (identity_gate) or source (receiving_confirm). */
348
+ counterpartyGame: string;
349
+ expiresAt: string | null;
350
+ stepUpRequired: boolean;
351
+ held: boolean;
352
+ /** "guardian_pending" | "device_requires_elevation" | null. */
353
+ holdReason: string | null;
354
+ raw: Record<string, unknown>;
355
+ }
356
+ interface PendingCollectResult {
357
+ pending: PendingCollectItem[];
358
+ raw: Record<string, unknown>;
359
+ }
360
+ interface DestinationsQuery {
361
+ /** "transfer" | "send". Defaults "transfer" (the set is identical for both today). */
362
+ direction?: "transfer" | "send";
363
+ }
364
+ /** A game/tenant this player can send/transfer to, with display metadata inline. */
365
+ interface DestinationGame {
366
+ gameId: string | number;
367
+ gameName: string;
368
+ tenantType?: string;
369
+ developerName?: string;
370
+ publisherName?: string;
371
+ genre?: string;
372
+ platform?: string;
373
+ gameStatus?: string;
374
+ gameIcon?: string;
375
+ gamePoster?: string;
376
+ gameUrl?: string;
377
+ gameDescription?: string;
378
+ currencyName: string;
379
+ currencySymbol: string;
380
+ currencySymbolUrl?: string;
381
+ /** Limits are decimal strings. */
382
+ minimumTransfer: string;
383
+ maximumTransfer: string;
384
+ raw: Record<string, unknown>;
385
+ }
386
+ interface DestinationsResult {
387
+ status: string;
388
+ sourceGameId: string | number;
389
+ sourceGameName: string;
390
+ sourceGameIcon?: string;
391
+ sourceCurrencyName: string;
392
+ sourceCurrencyIcon?: string;
393
+ universalTransfers: boolean;
394
+ /** "universal" (every live tenant) | "linked" (intersect linkedGameIds). */
395
+ transferMode: string;
396
+ availableGames: DestinationGame[];
397
+ totalDestinations: number;
398
+ direction: string;
399
+ /** Present in "linked" mode. */
400
+ linkedGameIds?: (string | number)[];
401
+ raw: Record<string, unknown>;
402
+ }
403
+ interface EnrollmentBeginResult {
404
+ status: string;
405
+ /** Channels the OTP was sent to, e.g. ["sms","email"]. */
406
+ channels: string[];
407
+ raw: Record<string, unknown>;
408
+ }
409
+ interface EnrollmentVerifyResult {
314
410
  status: string;
315
411
  raw: Record<string, unknown>;
316
412
  }
@@ -320,4 +416,4 @@ interface LinkDeviceResult {
320
416
  raw: Record<string, unknown>;
321
417
  }
322
418
 
323
- export { type ApproveResult as A, type ClientConfig as C, InvoError as I, type LinkDeviceResult as L, type OrderDetailsResult as O, type PlayerToken as P, type Rail as R, type ServerConfig as S, type VerificationMethod as V, type CallOptions as a, type ConfirmReceiptResult as b, type InvoErrorInfo as c, type InvoHooks as d, type InvoRequestInfo as e, type InvoResponseInfo as f, type InitiateSendInput as g, type InitiateResult as h, type InitiateTransferInput as i, type CreateCheckoutInput as j, type CreateCheckoutResult as k, type PurchaseInput as l, type PurchaseResult as m, type ConfirmPaymentResult as n, type PurchaseItemInput as o, type PurchaseItemResult as p, type ItemHistoryQuery as q, type ItemHistoryResult as r, type ItemOrderQuery as s, type PlayerBalanceQuery as t, type PlayerBalanceResult as u, type InboundPendingQuery as v, type InboundPendingResult as w, type CurrencyBalance as x, type InboundPendingItem as y };
419
+ export { type ApproveResult as A, type InboundPendingQuery as B, type ClientConfig as C, type DestinationsQuery as D, type EnrollmentBeginResult as E, type InboundPendingResult as F, type CurrencyBalance as G, type InboundPendingItem as H, InvoError as I, type LinkDeviceResult as L, type OrderDetailsResult as O, type PendingCollectResult as P, type Rail as R, type ServerConfig as S, type VerificationMethod as V, type CallOptions as a, type ConfirmReceiptResult as b, type DestinationsResult as c, type EnrollmentVerifyResult as d, type DestinationGame as e, type InvoErrorInfo as f, type InvoHooks as g, type InvoRequestInfo as h, type InvoResponseInfo as i, type PendingCollectItem as j, type PlayerToken as k, type InitiateSendInput as l, type InitiateResult as m, type InitiateTransferInput as n, type CreateCheckoutInput as o, type CreateCheckoutResult as p, type PurchaseInput as q, type PurchaseResult as r, type ConfirmPaymentResult as s, type PurchaseItemInput as t, type PurchaseItemResult as u, type ItemHistoryQuery as v, type ItemHistoryResult as w, type ItemOrderQuery as x, type PlayerBalanceQuery as y, type PlayerBalanceResult as z };
package/package.json CHANGED
@@ -1,76 +1,76 @@
1
- {
2
- "name": "@invonetwork/web-sdk",
3
- "version": "0.5.0",
4
- "description": "INVO Web SDK — currency purchase + passkey (WebAuthn) verification for partner web platforms.",
5
- "license": "SEE LICENSE IN LICENSE",
6
- "private": false,
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/Invo-Technologies/invo-web-sdk.git"
10
- },
11
- "homepage": "https://docs.invo.network",
12
- "bugs": {
13
- "url": "https://github.com/Invo-Technologies/invo-web-sdk/issues"
14
- },
15
- "type": "module",
16
- "engines": {
17
- "node": ">=18"
18
- },
19
- "sideEffects": false,
20
- "files": [
21
- "dist",
22
- "!dist/**/*.map",
23
- "README.md",
24
- "LICENSE",
25
- "CHANGELOG.md"
26
- ],
27
- "exports": {
28
- ".": {
29
- "types": "./dist/index.d.ts",
30
- "import": "./dist/index.js",
31
- "require": "./dist/index.cjs"
32
- },
33
- "./server": {
34
- "types": "./dist/server.d.ts",
35
- "import": "./dist/server.js",
36
- "require": "./dist/server.cjs"
37
- }
38
- },
39
- "main": "./dist/index.cjs",
40
- "module": "./dist/index.js",
41
- "types": "./dist/index.d.ts",
42
- "scripts": {
43
- "build": "tsup",
44
- "dev": "tsup --watch",
45
- "typecheck": "tsc --noEmit",
46
- "lint": "eslint .",
47
- "test": "vitest run",
48
- "test:watch": "vitest",
49
- "clean": "rimraf dist",
50
- "changeset": "changeset",
51
- "version-packages": "changeset version",
52
- "release": "npm run build && changeset publish",
53
- "prepublishOnly": "npm run clean && npm run build"
54
- },
55
- "keywords": [
56
- "invo",
57
- "webauthn",
58
- "passkey",
59
- "payments",
60
- "game-currency",
61
- "sdk"
62
- ],
63
- "publishConfig": {
64
- "access": "public"
65
- },
66
- "devDependencies": {
67
- "@changesets/cli": "^2.31.0",
68
- "@eslint/js": "^10.0.1",
69
- "eslint": "^10.6.0",
70
- "rimraf": "^5.0.5",
71
- "tsup": "^8.0.1",
72
- "typescript": "^5.4.5",
73
- "typescript-eslint": "^8.62.1",
74
- "vitest": "^1.5.0"
75
- }
76
- }
1
+ {
2
+ "name": "@invonetwork/web-sdk",
3
+ "version": "0.7.0",
4
+ "description": "INVO Web SDK — currency purchase + passkey (WebAuthn) verification for partner web platforms.",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "private": false,
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Invo-Technologies/invo-web-sdk.git"
10
+ },
11
+ "homepage": "https://docs.invo.network",
12
+ "bugs": {
13
+ "url": "https://github.com/Invo-Technologies/invo-web-sdk/issues"
14
+ },
15
+ "type": "module",
16
+ "engines": {
17
+ "node": ">=18"
18
+ },
19
+ "sideEffects": false,
20
+ "files": [
21
+ "dist",
22
+ "!dist/**/*.map",
23
+ "README.md",
24
+ "LICENSE",
25
+ "CHANGELOG.md"
26
+ ],
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.js",
31
+ "require": "./dist/index.cjs"
32
+ },
33
+ "./server": {
34
+ "types": "./dist/server.d.ts",
35
+ "import": "./dist/server.js",
36
+ "require": "./dist/server.cjs"
37
+ }
38
+ },
39
+ "main": "./dist/index.cjs",
40
+ "module": "./dist/index.js",
41
+ "types": "./dist/index.d.ts",
42
+ "scripts": {
43
+ "build": "tsup",
44
+ "dev": "tsup --watch",
45
+ "typecheck": "tsc --noEmit",
46
+ "lint": "eslint .",
47
+ "test": "vitest run",
48
+ "test:watch": "vitest",
49
+ "clean": "rimraf dist",
50
+ "changeset": "changeset",
51
+ "version-packages": "changeset version",
52
+ "release": "npm run build && changeset publish",
53
+ "prepublishOnly": "npm run clean && npm run build"
54
+ },
55
+ "keywords": [
56
+ "invo",
57
+ "webauthn",
58
+ "passkey",
59
+ "payments",
60
+ "game-currency",
61
+ "sdk"
62
+ ],
63
+ "publishConfig": {
64
+ "access": "public"
65
+ },
66
+ "devDependencies": {
67
+ "@changesets/cli": "^2.31.0",
68
+ "@eslint/js": "^10.0.1",
69
+ "eslint": "^10.6.0",
70
+ "rimraf": "^5.0.5",
71
+ "tsup": "^8.0.1",
72
+ "typescript": "^5.4.5",
73
+ "typescript-eslint": "^8.62.1",
74
+ "vitest": "^1.5.0"
75
+ }
76
+ }