@aurora-is-near/intents-connect 7.20.0 → 7.20.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 (100) hide show
  1. package/README.md +8 -12
  2. package/dist/chains.d.ts +39 -5
  3. package/dist/chunks/recovery-BzOR1iVj.js +1205 -0
  4. package/dist/chunks/recovery-BzOR1iVj.js.map +1 -0
  5. package/dist/errors.d.ts +6 -1
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.js +144 -139
  8. package/dist/index.js.map +1 -1
  9. package/dist/machine/context.d.ts +0 -2
  10. package/dist/machine/guards/checks/memoPresentForStellar.d.ts +9 -1
  11. package/dist/machine/guards/checks/stepsRequiredForRealCreate.d.ts +1 -1
  12. package/dist/machine/guards/checks/stepsUsePlaceholder.d.ts +9 -0
  13. package/dist/machine/guards/checks/strategiesAreExclusive.d.ts +0 -2
  14. package/dist/machine/guards/index.d.ts +2 -2
  15. package/dist/machine/index.d.ts +1 -1
  16. package/dist/machine/machine.d.ts +2 -2
  17. package/dist/machine/phases.d.ts +21 -0
  18. package/dist/react/context.d.ts +3 -1
  19. package/dist/react/index.js +122 -103
  20. package/dist/react/index.js.map +1 -1
  21. package/dist/react/useExecution.d.ts +13 -1
  22. package/dist/runner/capture.d.ts +19 -0
  23. package/dist/runner/constants.d.ts +33 -0
  24. package/dist/runner/createExecutionRunner.d.ts +6 -0
  25. package/dist/runner/ctx.d.ts +130 -0
  26. package/dist/runner/depositPlan.d.ts +31 -0
  27. package/dist/runner/flows/resume.d.ts +11 -0
  28. package/dist/runner/flows/retryDeposit.d.ts +8 -0
  29. package/dist/runner/flows/run.d.ts +4 -0
  30. package/dist/runner/planHelpers.d.ts +30 -0
  31. package/dist/runner/stages/cancel.d.ts +2 -0
  32. package/dist/runner/stages/create.d.ts +12 -0
  33. package/dist/runner/stages/deposit.d.ts +15 -0
  34. package/dist/runner/stages/fail.d.ts +3 -0
  35. package/dist/runner/stages/planSteps.d.ts +10 -0
  36. package/dist/runner/stages/settle.d.ts +16 -0
  37. package/dist/runner/stages/signAndSubmit.d.ts +3 -0
  38. package/dist/runner/transfer.d.ts +23 -0
  39. package/dist/runner/types.d.ts +27 -3
  40. package/dist/signers/standards/encoding.d.ts +5 -0
  41. package/dist/signers/standards/index.d.ts +1 -1
  42. package/dist/signers/standards/nep413.d.ts +0 -2
  43. package/dist/types/execution.d.ts +11 -0
  44. package/dist/types/signing.d.ts +0 -1
  45. package/dist/types/wallet.d.ts +0 -13
  46. package/package.json +13 -5
  47. package/src/api/createIntentsConnectApi.ts +9 -8
  48. package/src/api/generated/conformance.ts +2 -1
  49. package/src/chains.ts +52 -21
  50. package/src/errors.ts +24 -8
  51. package/src/index.ts +5 -0
  52. package/src/machine/context.ts +0 -4
  53. package/src/machine/guards/checks/memoPresentForStellar.ts +31 -3
  54. package/src/machine/guards/checks/stepsRequiredForRealCreate.ts +2 -2
  55. package/src/machine/guards/checks/stepsUsePlaceholder.ts +27 -0
  56. package/src/machine/guards/checks/strategiesAreExclusive.ts +2 -9
  57. package/src/machine/guards/index.ts +2 -5
  58. package/src/machine/index.ts +2 -0
  59. package/src/machine/machine.ts +8 -13
  60. package/src/machine/phases.ts +28 -2
  61. package/src/react/IntentsConnectProvider.tsx +28 -3
  62. package/src/react/context.ts +3 -5
  63. package/src/react/useExecution.ts +119 -52
  64. package/src/runner/capture.ts +27 -0
  65. package/src/runner/constants.ts +34 -0
  66. package/src/runner/createExecutionRunner.ts +175 -1038
  67. package/src/runner/ctx.ts +132 -0
  68. package/src/runner/depositPlan.ts +91 -0
  69. package/src/runner/flows/resume.ts +148 -0
  70. package/src/runner/flows/retryDeposit.ts +43 -0
  71. package/src/runner/flows/run.ts +135 -0
  72. package/src/runner/planHelpers.ts +122 -0
  73. package/src/runner/stages/cancel.ts +120 -0
  74. package/src/runner/stages/create.ts +136 -0
  75. package/src/runner/stages/deposit.ts +167 -0
  76. package/src/runner/stages/fail.ts +61 -0
  77. package/src/runner/stages/planSteps.ts +99 -0
  78. package/src/runner/stages/settle.ts +228 -0
  79. package/src/runner/stages/signAndSubmit.ts +63 -0
  80. package/src/runner/transfer.ts +84 -0
  81. package/src/runner/types.ts +27 -5
  82. package/src/signers/standards/encoding.ts +8 -23
  83. package/src/signers/standards/index.ts +0 -1
  84. package/src/signers/standards/nep413.ts +2 -8
  85. package/src/signers/standards/sep53.ts +4 -5
  86. package/src/types/execution.ts +15 -0
  87. package/src/types/signing.ts +6 -2
  88. package/src/types/wallet.ts +0 -12
  89. package/dist/chunks/recovery-BBQaAcqE.js +0 -1034
  90. package/dist/chunks/recovery-BBQaAcqE.js.map +0 -1
  91. package/dist/machine/guards/checks/round1MustBeStepless.d.ts +0 -8
  92. package/src/api/createIntentsConnectApi.test.ts +0 -146
  93. package/src/machine/guards/checks/round1MustBeStepless.ts +0 -17
  94. package/src/machine/guards/guards.test.ts +0 -317
  95. package/src/machine/machine.test.ts +0 -131
  96. package/src/react/useExecution.test.tsx +0 -281
  97. package/src/recovery.test.ts +0 -44
  98. package/src/runner/createExecutionRunner.test.ts +0 -1388
  99. package/src/signers/signers.test.ts +0 -415
  100. package/src/tests/setup.ts +0 -4
package/README.md CHANGED
@@ -4,7 +4,7 @@ Headless client for the Aurora **Intents Connect** execution API: bridge any
4
4
  asset from any chain, then execute contract calls on the destination chain from
5
5
  a service-controlled *intermediary* account.
6
6
 
7
- No React, no chain SDKs. Its only runtime dependencies are `valtio-fsm` and
7
+ No React, no chain SDKs. Its only runtime dependencies are `valtio` and
8
8
  `@scure/base`.
9
9
 
10
10
  ## What it does for you
@@ -92,9 +92,10 @@ amount. Two ways out:
92
92
 
93
93
  ## Wallets
94
94
 
95
- `WalletConnector` is the only wallet seam. Bring your own, or use a
96
- `@aurora-is-near/intents-connect-wallet-*` package. It supplies the address,
97
- signing standard, providers, and the deposit transfer.
95
+ `WalletConnector` is the only wallet seam. Bring your own, or use
96
+ [`@aurora-is-near/intents-connect-wallet`](../intents-connect-wallet) (one
97
+ subpath per chain). It supplies the address, signing standard, providers, and
98
+ the deposit transfer.
98
99
 
99
100
  Signing standards implemented: `erc191`, `raw_ed25519`, `nep413`, `sep53`.
100
101
  `tip191` (Tron) and `ton_connect` (TON) are not yet covered.
@@ -131,8 +132,9 @@ Point it at another environment with
131
132
 
132
133
  One deviation is pinned deliberately: the document types step `parameters` as
133
134
  `array` of `object`, which generates an uninhabited element type. Parameters are
134
- ABI scalars, so `Step['parameters']` stays `string[]` and the assertion starts
135
- failing once the spec is corrected.
135
+ ABI scalars or nested arrays of them, so `Step['parameters']` stays the
136
+ recursive `StepParameter[]` and the assertion starts failing once the spec is
137
+ corrected.
136
138
 
137
139
  ## React
138
140
 
@@ -168,9 +170,3 @@ Notes:
168
170
  for fields it actually reads.
169
171
  - `run`, `resume` and `cancel` always **reject** rather than throwing
170
172
  synchronously, so `run(plan).catch(…)` behaves.
171
-
172
- ## Wallets
173
-
174
- Deposit transfers and wallet connection live in
175
- [`@aurora-is-near/intents-connect-wallet`](../intents-connect-wallet), one
176
- subpath per chain.
package/dist/chains.d.ts CHANGED
@@ -2,13 +2,47 @@
2
2
  * Chain-family routing. Mirrors `packages/intents-swap-widget/src/utils/chains`
3
3
  * but carries only what deposit routing needs — no chain SDKs.
4
4
  */
5
- export declare const EVM_CHAINS: Set<string>;
6
5
  /**
7
- * Numeric EVM chain ids for the chains above. Used by `resume()` to rebuild a
8
- * deposit transfer from an execution alone — the EVM transfer path refuses to
9
- * run without a target chain id. Mirrors the widget's `EVM_CHAIN_IDS_MAP`.
6
+ * Numeric EVM chain ids. Used by `resume()` to rebuild a deposit transfer from
7
+ * an execution alone — the EVM transfer path refuses to run without a target
8
+ * chain id. Mirrors the widget's `EVM_CHAIN_IDS_MAP`.
9
+ *
10
+ * This record is the single registry of known EVM chains: `EVM_CHAINS` is
11
+ * derived from its keys, so a chain can never be "EVM" for routing yet missing
12
+ * its id for resume.
13
+ */
14
+ export declare const EVM_CHAIN_IDS: Readonly<Record<string, number>>;
15
+ export declare const EVM_CHAINS: ReadonlySet<string>;
16
+ /**
17
+ * Chains whose shared deposit address attributes incoming funds by memo —
18
+ * a deposit without one is unattributable and effectively lost.
19
+ */
20
+ export declare const MEMO_MODE_CHAINS: Set<string>;
21
+ /**
22
+ * The chain a wallet's signing standard implies, for executions that do not
23
+ * name their origin (`quote.originAsset` absent or not a bridged `*.omft.near`
24
+ * form). Lives here, next to `MEMO_MODE_CHAINS`, on purpose: the memo guard
25
+ * downstream fails OPEN for any wallet standard this map misses, so a new
26
+ * memo-mode chain must land in both registries in the same edit.
27
+ */
28
+ export declare const SIGNING_STANDARD_CHAINS: Readonly<Record<string, string>>;
29
+ /**
30
+ * Signing standards whose origin provably cannot be a memo-mode chain, so the
31
+ * memo guard may be skipped when the origin chain itself is unknown.
32
+ *
33
+ * Deliberately the SAFE list rather than the unsafe one, so the default is to
34
+ * fail CLOSED: a standard nobody has classified here — a new one, or
35
+ * `ton_connect`, whose chain attributes deposits by comment exactly like
36
+ * Stellar — must not slip past the guard just because the inference above
37
+ * came back empty. `sep53` is absent because it resolves to a chain outright.
38
+ */
39
+ export declare const MEMO_FREE_SIGNING_STANDARDS: ReadonlySet<string>;
40
+ /**
41
+ * Chains whose create body must carry `publicKey` — per the API contract, a
42
+ * TON address cannot yield its public key, so `/execution` needs it up front
43
+ * (every other ed25519 origin supplies it at `/submit` instead).
10
44
  */
11
- export declare const EVM_CHAIN_IDS: Record<string, number>;
45
+ export declare const PUBLIC_KEY_REQUIRED_CHAINS: Set<string>;
12
46
  export type ChainFamily = 'evm' | 'sol' | 'stellar' | 'near';
13
47
  /**
14
48
  * Decodes the origin chain and token address baked into a bridged asset id: