@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.
- package/README.md +8 -12
- package/dist/chains.d.ts +39 -5
- package/dist/chunks/recovery-BzOR1iVj.js +1205 -0
- package/dist/chunks/recovery-BzOR1iVj.js.map +1 -0
- package/dist/errors.d.ts +6 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +144 -139
- package/dist/index.js.map +1 -1
- package/dist/machine/context.d.ts +0 -2
- package/dist/machine/guards/checks/memoPresentForStellar.d.ts +9 -1
- package/dist/machine/guards/checks/stepsRequiredForRealCreate.d.ts +1 -1
- package/dist/machine/guards/checks/stepsUsePlaceholder.d.ts +9 -0
- package/dist/machine/guards/checks/strategiesAreExclusive.d.ts +0 -2
- package/dist/machine/guards/index.d.ts +2 -2
- package/dist/machine/index.d.ts +1 -1
- package/dist/machine/machine.d.ts +2 -2
- package/dist/machine/phases.d.ts +21 -0
- package/dist/react/context.d.ts +3 -1
- package/dist/react/index.js +122 -103
- package/dist/react/index.js.map +1 -1
- package/dist/react/useExecution.d.ts +13 -1
- package/dist/runner/capture.d.ts +19 -0
- package/dist/runner/constants.d.ts +33 -0
- package/dist/runner/createExecutionRunner.d.ts +6 -0
- package/dist/runner/ctx.d.ts +130 -0
- package/dist/runner/depositPlan.d.ts +31 -0
- package/dist/runner/flows/resume.d.ts +11 -0
- package/dist/runner/flows/retryDeposit.d.ts +8 -0
- package/dist/runner/flows/run.d.ts +4 -0
- package/dist/runner/planHelpers.d.ts +30 -0
- package/dist/runner/stages/cancel.d.ts +2 -0
- package/dist/runner/stages/create.d.ts +12 -0
- package/dist/runner/stages/deposit.d.ts +15 -0
- package/dist/runner/stages/fail.d.ts +3 -0
- package/dist/runner/stages/planSteps.d.ts +10 -0
- package/dist/runner/stages/settle.d.ts +16 -0
- package/dist/runner/stages/signAndSubmit.d.ts +3 -0
- package/dist/runner/transfer.d.ts +23 -0
- package/dist/runner/types.d.ts +27 -3
- package/dist/signers/standards/encoding.d.ts +5 -0
- package/dist/signers/standards/index.d.ts +1 -1
- package/dist/signers/standards/nep413.d.ts +0 -2
- package/dist/types/execution.d.ts +11 -0
- package/dist/types/signing.d.ts +0 -1
- package/dist/types/wallet.d.ts +0 -13
- package/package.json +13 -5
- package/src/api/createIntentsConnectApi.ts +9 -8
- package/src/api/generated/conformance.ts +2 -1
- package/src/chains.ts +52 -21
- package/src/errors.ts +24 -8
- package/src/index.ts +5 -0
- package/src/machine/context.ts +0 -4
- package/src/machine/guards/checks/memoPresentForStellar.ts +31 -3
- package/src/machine/guards/checks/stepsRequiredForRealCreate.ts +2 -2
- package/src/machine/guards/checks/stepsUsePlaceholder.ts +27 -0
- package/src/machine/guards/checks/strategiesAreExclusive.ts +2 -9
- package/src/machine/guards/index.ts +2 -5
- package/src/machine/index.ts +2 -0
- package/src/machine/machine.ts +8 -13
- package/src/machine/phases.ts +28 -2
- package/src/react/IntentsConnectProvider.tsx +28 -3
- package/src/react/context.ts +3 -5
- package/src/react/useExecution.ts +119 -52
- package/src/runner/capture.ts +27 -0
- package/src/runner/constants.ts +34 -0
- package/src/runner/createExecutionRunner.ts +175 -1038
- package/src/runner/ctx.ts +132 -0
- package/src/runner/depositPlan.ts +91 -0
- package/src/runner/flows/resume.ts +148 -0
- package/src/runner/flows/retryDeposit.ts +43 -0
- package/src/runner/flows/run.ts +135 -0
- package/src/runner/planHelpers.ts +122 -0
- package/src/runner/stages/cancel.ts +120 -0
- package/src/runner/stages/create.ts +136 -0
- package/src/runner/stages/deposit.ts +167 -0
- package/src/runner/stages/fail.ts +61 -0
- package/src/runner/stages/planSteps.ts +99 -0
- package/src/runner/stages/settle.ts +228 -0
- package/src/runner/stages/signAndSubmit.ts +63 -0
- package/src/runner/transfer.ts +84 -0
- package/src/runner/types.ts +27 -5
- package/src/signers/standards/encoding.ts +8 -23
- package/src/signers/standards/index.ts +0 -1
- package/src/signers/standards/nep413.ts +2 -8
- package/src/signers/standards/sep53.ts +4 -5
- package/src/types/execution.ts +15 -0
- package/src/types/signing.ts +6 -2
- package/src/types/wallet.ts +0 -12
- package/dist/chunks/recovery-BBQaAcqE.js +0 -1034
- package/dist/chunks/recovery-BBQaAcqE.js.map +0 -1
- package/dist/machine/guards/checks/round1MustBeStepless.d.ts +0 -8
- package/src/api/createIntentsConnectApi.test.ts +0 -146
- package/src/machine/guards/checks/round1MustBeStepless.ts +0 -17
- package/src/machine/guards/guards.test.ts +0 -317
- package/src/machine/machine.test.ts +0 -131
- package/src/react/useExecution.test.tsx +0 -281
- package/src/recovery.test.ts +0 -44
- package/src/runner/createExecutionRunner.test.ts +0 -1388
- package/src/signers/signers.test.ts +0 -415
- 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
|
|
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
|
|
96
|
-
`@aurora-is-near/intents-connect-wallet
|
|
97
|
-
signing standard, providers, and
|
|
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
|
|
135
|
-
failing once the spec is
|
|
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
|
|
8
|
-
*
|
|
9
|
-
*
|
|
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
|
|
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:
|