@effectstream/sm 0.100.16 → 0.100.17
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/README.md +5 -5
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ it inside a per-block postgres transaction. You author the DSL here;
|
|
|
27
27
|
the runtime executes it.
|
|
28
28
|
|
|
29
29
|
The DSL is also directly testable in a pure-TS unit test (parse + dispatch
|
|
30
|
-
without a database)
|
|
30
|
+
without a database) - see
|
|
31
31
|
[`primitives/src/evm-erc20/erc20-primitive.test.ts`](https://github.com/effectstream/effectstream/blob/main/packages/node-sdk/sm/primitives/src/evm-erc20/erc20-primitive.test.ts).
|
|
32
32
|
|
|
33
33
|
```typescript
|
|
@@ -62,15 +62,15 @@ yields `World.resolve(...)` so the runtime can execute the pgtyped queries.
|
|
|
62
62
|
loop wires each user input through the corresponding `Stm` instance,
|
|
63
63
|
collects yielded SQL, and commits it inside the per-block transaction.
|
|
64
64
|
The built-in primitives package (`@effectstream/sm/builtin`) covers
|
|
65
|
-
common on-chain events
|
|
66
|
-
Midnight events, etc.
|
|
65
|
+
common on-chain events - ERC-20/721/1155 transfers, Cardano transfers,
|
|
66
|
+
Midnight events, etc. - so you don't re-implement them.
|
|
67
67
|
|
|
68
68
|
## Key exports
|
|
69
69
|
|
|
70
70
|
- `Stm<Grammar, Events>`: the state machine. `.addStateTransition(prefix, handler)`, `.processInput(input)`, `.grammar`, `.fullJsonGrammar`, `.keyedJsonGrammar`.
|
|
71
71
|
- `ParamToData<Params>` derives the typed argument shape from a grammar entry.
|
|
72
72
|
- `BaseStfInput`: input shape passed to every handler. Includes `msTimestamp`, `blockHeight`, etc.
|
|
73
|
-
- `delegate-wallet` helpers
|
|
73
|
+
- `delegate-wallet` helpers - account delegation primitives reused by built-ins.
|
|
74
74
|
|
|
75
75
|
`MessageListener<Events, Params>` is exported as the handler type but is
|
|
76
76
|
inferred at call sites rather than imported directly.
|
|
@@ -82,7 +82,7 @@ Subpath exports:
|
|
|
82
82
|
|
|
83
83
|
## Examples
|
|
84
84
|
|
|
85
|
-
- [`primitives/src/evm-erc20/erc20-primitive.test.ts`](https://github.com/effectstream/effectstream/blob/main/packages/node-sdk/sm/primitives/src/evm-erc20/erc20-primitive.test.ts)
|
|
85
|
+
- [`primitives/src/evm-erc20/erc20-primitive.test.ts`](https://github.com/effectstream/effectstream/blob/main/packages/node-sdk/sm/primitives/src/evm-erc20/erc20-primitive.test.ts) - a real primitive's behavior unit-tested.
|
|
86
86
|
- Game logic in
|
|
87
87
|
[`templates/dice/packages/node/`](https://github.com/effectstream/effectstream/tree/main/templates/dice/packages/node)
|
|
88
88
|
shows the full `new Stm(...).addStateTransition(...)` pattern.
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effectstream/sm",
|
|
3
|
-
"version": "0.100.
|
|
3
|
+
"version": "0.100.17",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://effectstream.github.io/docs/",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/
|
|
8
|
+
"url": "https://github.com/effectstream/effectstream",
|
|
9
9
|
"directory": "packages/node-sdk/sm"
|
|
10
10
|
},
|
|
11
11
|
"bugs": {
|
|
12
|
-
"url": "https://github.com/
|
|
12
|
+
"url": "https://github.com/effectstream/effectstream/issues"
|
|
13
13
|
},
|
|
14
14
|
"exports": {
|
|
15
15
|
".": "./mod.ts",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"./grammar": "./primitives/src/grammar.ts"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@effectstream/concise": "0.100.
|
|
21
|
-
"@effectstream/config": "0.100.
|
|
22
|
-
"@effectstream/coroutine": "0.100.
|
|
23
|
-
"@effectstream/crypto": "0.100.
|
|
24
|
-
"@effectstream/db": "0.100.
|
|
25
|
-
"@effectstream/event-client": "0.100.
|
|
26
|
-
"@effectstream/log": "0.100.
|
|
27
|
-
"@effectstream/utils": "0.100.
|
|
20
|
+
"@effectstream/concise": "0.100.17",
|
|
21
|
+
"@effectstream/config": "0.100.17",
|
|
22
|
+
"@effectstream/coroutine": "0.100.17",
|
|
23
|
+
"@effectstream/crypto": "0.100.17",
|
|
24
|
+
"@effectstream/db": "0.100.17",
|
|
25
|
+
"@effectstream/event-client": "0.100.17",
|
|
26
|
+
"@effectstream/log": "0.100.17",
|
|
27
|
+
"@effectstream/utils": "0.100.17",
|
|
28
28
|
"pg": "8.17.2",
|
|
29
29
|
"pg-tx": "^1.0.1",
|
|
30
30
|
"@sinclair/typebox": "0.34.41",
|