@idoa/wpis-core 0.1.0 → 0.1.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.
Files changed (3) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +33 -7
  3. package/package.json +1 -1
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 WPIS contributors
3
+ Copyright (c) 2026 Milan Matejic
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,29 +1,55 @@
1
1
  # @idoa/wpis-core
2
2
 
3
- Core WPIS types and deterministic intent lifecycle utilities.
3
+ Core WPIS primitives for deterministic payment intent lifecycle and verification state handling.
4
4
 
5
- ## Install
5
+ ## Installation
6
6
 
7
7
  ```bash
8
8
  npm i @idoa/wpis-core
9
9
  ```
10
10
 
11
- ## Usage
11
+ ## Lifecycle Diagram
12
+
13
+ ```text
14
+ PENDING --(match found)--> DETECTED --(confirmations >= policy)--> CONFIRMED
15
+ | |
16
+ |--(expiresAt reached)------>|-------------------------------> EXPIRED
17
+ |--(verification failure)-----------------------------------> FAILED
18
+ ```
19
+
20
+ ## Deterministic State Machine
21
+ The core package enforces legal status transitions and blocks regressions.
22
+ Transition rules are explicit and typed, so downstream tooling gets predictable lifecycle behavior.
23
+
24
+ ## Quick Example
12
25
 
13
26
  ```ts
14
- import { validateCreateIntentInput, transitionStatus, type CreateIntentInput } from "@idoa/wpis-core";
27
+ import { transitionStatus, validateCreateIntentInput, type CreateIntentInput } from "@idoa/wpis-core";
15
28
 
16
29
  const input: CreateIntentInput = {
17
- chainId: "eip155:421614",
30
+ chainId: "eip155:42161",
18
31
  recipient: "0x1111111111111111111111111111111111111111",
19
32
  amount: "1000000000000000",
20
- reference: "example-reference",
33
+ reference: "order-123",
21
34
  expiresAt: new Date(Date.now() + 15 * 60 * 1000).toISOString(),
22
35
  asset: { symbol: "ETH", decimals: 18, type: "native" }
23
36
  };
24
37
 
25
38
  validateCreateIntentInput(input);
26
39
  const next = transitionStatus("PENDING", "DETECTED");
40
+ console.log(next);
27
41
  ```
28
42
 
29
- For monorepo development, see the repository root README.
43
+ ## Design Principles
44
+ - Deterministic lifecycle transitions.
45
+ - Strict input validation and explicit error taxonomy.
46
+ - Non-custodial architecture boundaries.
47
+ - Chain adapter separation from core domain logic.
48
+
49
+ ## Intended Usage
50
+ Use this package as the typed lifecycle foundation for verifier services, adapters, and integration tooling.
51
+ It is infrastructure-focused and not intended to be a checkout or merchant product layer.
52
+
53
+ ## License (MIT)
54
+
55
+ Licensed under the MIT License.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idoa/wpis-core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Deterministic payment intent primitives for WPIS.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",