@defuse-protocol/nearintents-mpp-sdk 0.0.0 → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +241 -0
- package/dist/Errors.d.ts +57 -0
- package/dist/Errors.d.ts.map +1 -0
- package/dist/Errors.js +54 -0
- package/dist/Errors.js.map +1 -0
- package/dist/Methods.d.ts +44 -0
- package/dist/Methods.d.ts.map +1 -0
- package/dist/Methods.js +23 -0
- package/dist/Methods.js.map +1 -0
- package/dist/Types.d.ts +125 -0
- package/dist/Types.d.ts.map +1 -0
- package/dist/Types.js +195 -0
- package/dist/Types.js.map +1 -0
- package/dist/client/Charge.d.ts +141 -0
- package/dist/client/Charge.d.ts.map +1 -0
- package/dist/client/Charge.js +167 -0
- package/dist/client/Charge.js.map +1 -0
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +5 -0
- package/dist/client/index.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/OneClick.d.ts +243 -0
- package/dist/internal/OneClick.d.ts.map +1 -0
- package/dist/internal/OneClick.js +422 -0
- package/dist/internal/OneClick.js.map +1 -0
- package/dist/server/Charge.d.ts +241 -0
- package/dist/server/Charge.d.ts.map +1 -0
- package/dist/server/Charge.js +404 -0
- package/dist/server/Charge.js.map +1 -0
- package/dist/server/index.d.ts +5 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +5 -0
- package/dist/server/index.js.map +1 -0
- package/package.json +87 -9
- package/src/Errors.ts +86 -0
- package/src/Methods.ts +24 -0
- package/src/Types.ts +256 -0
- package/src/client/Charge.ts +268 -0
- package/src/client/index.ts +4 -0
- package/src/index.ts +4 -0
- package/src/internal/OneClick.ts +634 -0
- package/src/server/Charge.ts +621 -0
- package/src/server/index.ts +4 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Iker Alustiza
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# nearintents-mpp-sdk
|
|
2
|
+
|
|
3
|
+
Reference implementation of the **`nearintents` payment method** for
|
|
4
|
+
[MPP (Machine Payments Protocol)](https://mpp.dev) enabling cross-chain HTTP 402
|
|
5
|
+
payments settled by [NEAR Intents](https://near-intents.org): clients pay on
|
|
6
|
+
any supported chain, merchants receive an exact amount on theirs. Extends
|
|
7
|
+
[`mppx`](https://github.com/wevm/mppx). The original spec this implementation is based on is found at [Tempo's MPP specs repository](https://github.com/tempoxyz/mpp-specs/blob/main/specs/methods/nearintents/draft-nearintents-charge-00.md).
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
Server (see [`src/server/Charge.ts`](src/server/Charge.ts) for all options):
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { Mppx } from 'mppx/server'
|
|
15
|
+
import { nearintents } from '@defuse-protocol/nearintents-mpp-sdk/server'
|
|
16
|
+
|
|
17
|
+
const mppx = Mppx.create({
|
|
18
|
+
secretKey: process.env.MPP_SECRET_KEY!,
|
|
19
|
+
methods: [
|
|
20
|
+
nearintents.charge({
|
|
21
|
+
originAsset: 'eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
|
|
22
|
+
destinationAsset: 'near:mainnet/nep141:1720…33a1',
|
|
23
|
+
destinationRecipient: 'merchant.near',
|
|
24
|
+
refundTo: '0x2527…C317', // merchant origin-chain refund address
|
|
25
|
+
amountOut: '1000000', // exact amount the merchant receives (EXACT_OUTPUT)
|
|
26
|
+
oneClick: { jwt: process.env.ONE_CLICK_JWT },
|
|
27
|
+
// production: store: Store.redis(client) — replay protection needs an atomic store
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
})
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Client (policy is the safety surface — the client pays before delivery):
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { Mppx } from 'mppx/client'
|
|
37
|
+
import { nearintents } from '@defuse-protocol/nearintents-mpp-sdk/client'
|
|
38
|
+
|
|
39
|
+
const mppx = Mppx.create({
|
|
40
|
+
methods: [
|
|
41
|
+
nearintents.charge({
|
|
42
|
+
walletClient, // viem WalletClient (+ public actions) for eip155 origins
|
|
43
|
+
policy: {
|
|
44
|
+
allowedOriginNetworks: ['eip155:42161'],
|
|
45
|
+
maxAmountIn: { 'eip155:42161/erc20:0xaf88…5831': '5000000' },
|
|
46
|
+
},
|
|
47
|
+
}),
|
|
48
|
+
],
|
|
49
|
+
})
|
|
50
|
+
const response = await mppx.fetch('https://api.example.com/paid-resource')
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Non-EVM origins (BTC, Solana, …) pay via the `sendDeposit` callback or present
|
|
54
|
+
an already-broadcast tx hash as `context.hash`.
|
|
55
|
+
|
|
56
|
+
A `policy` is **strongly recommended for any autonomous payer.** The client
|
|
57
|
+
always schema-validates the challenge and refuses to pay past `expires`, but
|
|
58
|
+
the *value* checks — allowed origin networks/assets, per-asset `maxAmountIn`
|
|
59
|
+
caps, and the expected destination leg — only run when a `policy` is
|
|
60
|
+
configured. Without one, the client will pay any authentic challenge the
|
|
61
|
+
server presents; the policy is the client's safety surface since it pays
|
|
62
|
+
before delivery.
|
|
63
|
+
|
|
64
|
+
## Demo
|
|
65
|
+
|
|
66
|
+
[`demo/`](demo/README.md) is a browser storefront that runs the real client in
|
|
67
|
+
the page: unlock a paid endpoint with an injected EVM wallet on Arbitrum, or
|
|
68
|
+
from any Bitcoin wallet by pasting the deposit txid. `pnpm demo:server` +
|
|
69
|
+
`pnpm demo:app` (dev), or `pnpm demo:build && pnpm demo:server` (same-origin
|
|
70
|
+
production shape; the root [`Dockerfile`](Dockerfile) packages it).
|
|
71
|
+
|
|
72
|
+
## Examples
|
|
73
|
+
|
|
74
|
+
[`examples/server.ts`](examples/server.ts) is a two-route merchant (Arbitrum
|
|
75
|
+
USDC origin with a 5-minute window, native BTC origin with a 45-minute
|
|
76
|
+
window); [`examples/client.ts`](examples/client.ts) pays it — or dry-runs,
|
|
77
|
+
printing the decoded challenge, when no key/hash is provided.
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
cp .env.example .env # add ONE_CLICK_JWT (and merchant addresses)
|
|
81
|
+
pnpm example:server # http://localhost:8402
|
|
82
|
+
pnpm example:client # dry run: shows what /premium asks for
|
|
83
|
+
pnpm example:client http://localhost:8402/premium-btc
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
To execute a real payment (real funds!): set `PRIVATE_KEY` to a funded
|
|
87
|
+
Arbitrum account and run `pnpm example:client`, or send the deposit yourself
|
|
88
|
+
and re-run with `DEPOSIT_TX_HASH=0x…`. The client refuses anything beyond its
|
|
89
|
+
configured `policy.maxAmountIn` caps.
|
|
90
|
+
|
|
91
|
+
## Operational notes
|
|
92
|
+
|
|
93
|
+
- **Trust model.** Settlement is not trustless: for the duration of the swap
|
|
94
|
+
the deposit is custodied by the NEAR Intents settlement system
|
|
95
|
+
(`methodDetails.settlementBackend: "near-intents"`), which either delivers
|
|
96
|
+
the destination asset to the merchant or refunds the deposit. Comparable to
|
|
97
|
+
entrusting a payment processor with a transfer; agents applying per-method
|
|
98
|
+
risk policies can key off the `method` and `settlementBackend` fields.
|
|
99
|
+
- **Refunds.** `methodDetails.refundTo` is a **merchant-configured** address
|
|
100
|
+
on the origin chain (the server cannot know the payer before payment).
|
|
101
|
+
Every non-success terminal refunds the deposit there; payers recover
|
|
102
|
+
off-band per the merchant's terms. Disclose this in your terms of service.
|
|
103
|
+
- **Per-origin expiry.** Size `expiresWindow` (and the mppx route `expires`)
|
|
104
|
+
to the origin chain: minutes for fast chains, 45–60 minutes for Bitcoin.
|
|
105
|
+
The example server creates the route handler per request so the absolute
|
|
106
|
+
mppx `expires` becomes a rolling window. **`charge({ expiresWindow })` MUST
|
|
107
|
+
equal the `expires` you pass to `mppx.charge({ expires })`** — mppx computes
|
|
108
|
+
the challenge `expires` before this method can read it, so the coupling is
|
|
109
|
+
manual. Setting the route `expires` *larger* than `expiresWindow` can make a
|
|
110
|
+
challenge advertise an `expires` past the quote deadline; a client depositing
|
|
111
|
+
just before it is refunded instead of swapped (recoverable, but wasteful).
|
|
112
|
+
The example/demo servers keep the two in lock-step.
|
|
113
|
+
- **Under-deposits are terminal.** If a deposit lands below
|
|
114
|
+
`methodDetails.minAmountIn`, 1Click reports `INCOMPLETE_DEPOSIT`, which this
|
|
115
|
+
method treats as a terminal outcome (per spec §Settlement): the deposit is
|
|
116
|
+
refunded to `refundTo`, the credential is consumed, and the client recovers
|
|
117
|
+
with a fresh challenge — it does **not** hold the quote open waiting for a
|
|
118
|
+
top-up (that is async-delivery territory, out of scope here). Backend
|
|
119
|
+
aggregation of multiple deposits that reach `SUCCESS` *is* honored: any one
|
|
120
|
+
of the observed origin-chain tx hashes is accepted as the credential.
|
|
121
|
+
- **Per-origin minimums.** Bridged origins enforce minimum deposit amounts
|
|
122
|
+
(e.g. native BTC rides the PoA bridge, minimum ≈ a few USD at the time of
|
|
123
|
+
writing — live 1Click rejects quotes below it with `400 Amount is too low
|
|
124
|
+
for bridge`). Micro-prices belong on fast, cheap origins like Arbitrum/Base.
|
|
125
|
+
- **Slow settlements.** `verify` holds the connection at most
|
|
126
|
+
`settlementTimeout` seconds, then returns **504** with a problem body —
|
|
127
|
+
the credential is *not* consumed and the client re-presents the same
|
|
128
|
+
credential later (the deposit keeps settling in the background). Backend
|
|
129
|
+
unavailability returns **503**, never `verification-failed`. Long-running
|
|
130
|
+
origins can layer a `202 Accepted`/webhook pattern on top; that is out of
|
|
131
|
+
scope for this package.
|
|
132
|
+
- **After a failed settlement** the immediate 402 echoes the spent challenge
|
|
133
|
+
(mppx computes the retry challenge before `verify` runs); the client's next
|
|
134
|
+
request receives a fresh quote. Conformant clients re-request on 402.
|
|
135
|
+
|
|
136
|
+
## Observability
|
|
137
|
+
|
|
138
|
+
The library never logs on its own. Merchant-side visibility comes from two
|
|
139
|
+
layers:
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
const method = nearintents.charge({
|
|
143
|
+
// in-flight settlement progress (structured events → your logger):
|
|
144
|
+
// quote.minted / quote.reused / deposit.submitted / settlement.status /
|
|
145
|
+
// settlement.terminal / settlement.suspended / receipt.issued
|
|
146
|
+
onEvent: (event) => logger.info(event),
|
|
147
|
+
/* … */
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
const mppx = Mppx.create({ secretKey, methods: [method] })
|
|
151
|
+
// outcome-level events, from mppx itself:
|
|
152
|
+
mppx.on('payment.success', ({ receipt }) => logger.info(receipt))
|
|
153
|
+
mppx.on('payment.failed', ({ error }) => logger.warn(error.type, error.message))
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
`settlement.suspended` (backend unavailable / settlement timeout) means the
|
|
157
|
+
credential was **not** consumed and the client will re-present it. Handler
|
|
158
|
+
errors are swallowed — observers can never affect payment processing. The
|
|
159
|
+
example and demo servers wire `onEvent` to the console, so `pnpm
|
|
160
|
+
example:server` shows each payment progressing live. Everything the events
|
|
161
|
+
carry (deposit addresses, tx hashes) is public on-chain data.
|
|
162
|
+
|
|
163
|
+
## Advanced: the settlement core
|
|
164
|
+
|
|
165
|
+
The spec's server steps 7 ("verify deposit") and 8 ("submit + await swap
|
|
166
|
+
finality") are implemented *inside* the method's `verify()` — merchants never
|
|
167
|
+
call them directly, and the safety rails (atomic in-flight hash claim,
|
|
168
|
+
consume-on-terminal, release-on-5xx) live in that sequence. This package uses
|
|
169
|
+
**status observation** (spec §Verification step 3, second mode): 1Click
|
|
170
|
+
detecting a qualifying deposit *is* the origin-chain verification, and on
|
|
171
|
+
`SUCCESS` the presented `payload.hash` must appear among the backend's
|
|
172
|
+
observed `originChainTxHashes`. Direct per-chain RPC verification is a
|
|
173
|
+
possible future hardening hook, deliberately not part of v1.
|
|
174
|
+
|
|
175
|
+
For advanced integrations (custom settlement flows, background workers, ops
|
|
176
|
+
tooling), the underlying 1Click client is exported as the `OneClick`
|
|
177
|
+
namespace: `quote`, `submitDeposit`, `getStatus`, `pollToTerminal`,
|
|
178
|
+
`matchesOriginTx`, `destinationTxHash`, `terminalError`, plus the CAIP-19 ↔
|
|
179
|
+
1Click asset mapping (`createAssetMap`). If you drive settlement yourself you
|
|
180
|
+
also own replay protection — prefer re-presenting the credential to the
|
|
181
|
+
method (the 503/504 flow) over hand-rolling steps 7–8.
|
|
182
|
+
|
|
183
|
+
## How it works
|
|
184
|
+
|
|
185
|
+
1. The server answers an unpaid request with `402` + `WWW-Authenticate:
|
|
186
|
+
Payment` whose `request` carries a unique, single-use **1Click deposit
|
|
187
|
+
address** as `recipient`, the origin-chain leg the client pays (`amount`,
|
|
188
|
+
`currency`), and the merchant's destination leg in `methodDetails`.
|
|
189
|
+
2. The client pays the source asset on its origin chain and retries with the
|
|
190
|
+
confirmed transaction hash as a `{type: "hash"}` credential.
|
|
191
|
+
3. The server verifies the deposit via the 1Click status endpoint, drives the
|
|
192
|
+
cross-chain swap to `SUCCESS`, and returns the resource with a
|
|
193
|
+
`Payment-Receipt` carrying `challengeId`, `originTxHash`, and the
|
|
194
|
+
destination-chain delivery hash.
|
|
195
|
+
|
|
196
|
+
Quotes use `EXACT_OUTPUT`, so the merchant receives a deterministic amount of
|
|
197
|
+
its chosen asset on its chosen chain.
|
|
198
|
+
|
|
199
|
+
Note that settlement is not trustless: deposits
|
|
200
|
+
are custodied by the NEAR Intents settlement system for the duration of the
|
|
201
|
+
swap, with automatic refunds to `methodDetails.refundTo` on every non-success
|
|
202
|
+
outcome. See the spec's Trust Model section.
|
|
203
|
+
|
|
204
|
+
## Spec
|
|
205
|
+
|
|
206
|
+
The normative wire contract is
|
|
207
|
+
[`docs/spec/draft-nearintents-charge-00.md`](docs/spec/draft-nearintents-charge-00.md)
|
|
208
|
+
(registered in
|
|
209
|
+
[`tempoxyz/mpp-specs`](https://github.com/tempoxyz/mpp-specs) under
|
|
210
|
+
`specs/methods/nearintents/`). Conformance vectors in
|
|
211
|
+
[`test/vectors.test.ts`](test/vectors.test.ts) are generated through mppx
|
|
212
|
+
primitives from the spec's examples.
|
|
213
|
+
|
|
214
|
+
## Development
|
|
215
|
+
|
|
216
|
+
```sh
|
|
217
|
+
npx pnpm@11 install # pnpm pinned via packageManager
|
|
218
|
+
pnpm check # typecheck + lint + tests
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Tests are **mock-only** (in-process mock 1Click server in
|
|
222
|
+
[`test/OneClickMock.ts`](test/OneClickMock.ts)); the suite never calls live
|
|
223
|
+
1Click.
|
|
224
|
+
|
|
225
|
+
Note: `mppx` **0.8.6 or later** is required — it ships the upstream
|
|
226
|
+
receipt-extensibility fix ([wevm/mppx#612](https://github.com/wevm/mppx/pull/612))
|
|
227
|
+
that lets the method-specific receipt fields (`challengeId`, `originTxHash`,
|
|
228
|
+
`destinationNetwork`) survive the `Payment-Receipt` codec; earlier releases
|
|
229
|
+
strip them. mppx is an exact-pinned peer dependency while it is pre-1.0.
|
|
230
|
+
|
|
231
|
+
### Releasing
|
|
232
|
+
|
|
233
|
+
Releases are automated with [changesets](https://github.com/changesets/changesets):
|
|
234
|
+
PRs that change published behavior include one (`pnpm changeset`). On merge to
|
|
235
|
+
`main`, the release workflow maintains a "Version Packages" PR; merging *that*
|
|
236
|
+
builds and publishes to npm with
|
|
237
|
+
[provenance](https://docs.npmjs.com/generating-provenance-statements).
|
|
238
|
+
|
|
239
|
+
## License
|
|
240
|
+
|
|
241
|
+
[MIT](LICENSE)
|
package/dist/Errors.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Errors } from 'mppx';
|
|
2
|
+
/**
|
|
3
|
+
* The deposit was verified but the cross-chain swap did not complete
|
|
4
|
+
* (1Click terminal status `FAILED` or `REFUNDED`). The deposit is refunded to
|
|
5
|
+
* `methodDetails.refundTo`; the client recovers with a fresh challenge.
|
|
6
|
+
*
|
|
7
|
+
* Additional error code registered by the `nearintents` spec (§Error Codes).
|
|
8
|
+
*/
|
|
9
|
+
export declare class SettlementFailedError extends Errors.PaymentError {
|
|
10
|
+
readonly name = "SettlementFailedError";
|
|
11
|
+
readonly title = "Settlement Failed";
|
|
12
|
+
readonly status: number;
|
|
13
|
+
readonly type = "https://paymentauth.org/problems/settlement-failed";
|
|
14
|
+
constructor(options?: SettlementFailedError.Options);
|
|
15
|
+
}
|
|
16
|
+
export declare namespace SettlementFailedError {
|
|
17
|
+
type Options = {
|
|
18
|
+
/** Reason settlement failed (e.g. the 1Click refund reason). */
|
|
19
|
+
reason?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The 1Click backend was unreachable during a required check. Per the spec
|
|
24
|
+
* (§Verification), this MUST surface as an HTTP 5xx — never as
|
|
25
|
+
* `verification-failed` — and the credential MUST NOT be settled or consumed.
|
|
26
|
+
* The client retries the same credential once the backend recovers.
|
|
27
|
+
*/
|
|
28
|
+
export declare class SettlementUnavailableError extends Errors.PaymentError {
|
|
29
|
+
readonly name = "SettlementUnavailableError";
|
|
30
|
+
readonly title = "Settlement Backend Unavailable";
|
|
31
|
+
readonly status: number;
|
|
32
|
+
readonly type = "https://paymentauth.org/problems/server-error";
|
|
33
|
+
constructor(options?: SettlementUnavailableError.Options);
|
|
34
|
+
}
|
|
35
|
+
export declare namespace SettlementUnavailableError {
|
|
36
|
+
type Options = {
|
|
37
|
+
reason?: string | undefined;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Settlement did not reach a terminal state within the server's time budget.
|
|
42
|
+
* The swap may still complete; the credential is NOT consumed, so the client
|
|
43
|
+
* can re-present the same credential later (or wait for the refund path).
|
|
44
|
+
*/
|
|
45
|
+
export declare class SettlementTimeoutError extends Errors.PaymentError {
|
|
46
|
+
readonly name = "SettlementTimeoutError";
|
|
47
|
+
readonly title = "Settlement Timeout";
|
|
48
|
+
readonly status: number;
|
|
49
|
+
readonly type = "https://paymentauth.org/problems/server-error";
|
|
50
|
+
constructor(options?: SettlementTimeoutError.Options);
|
|
51
|
+
}
|
|
52
|
+
export declare namespace SettlementTimeoutError {
|
|
53
|
+
type Options = {
|
|
54
|
+
timeoutMs?: number | undefined;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=Errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../src/Errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM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Errors } from 'mppx';
|
|
2
|
+
/**
|
|
3
|
+
* The deposit was verified but the cross-chain swap did not complete
|
|
4
|
+
* (1Click terminal status `FAILED` or `REFUNDED`). The deposit is refunded to
|
|
5
|
+
* `methodDetails.refundTo`; the client recovers with a fresh challenge.
|
|
6
|
+
*
|
|
7
|
+
* Additional error code registered by the `nearintents` spec (§Error Codes).
|
|
8
|
+
*/
|
|
9
|
+
export class SettlementFailedError extends Errors.PaymentError {
|
|
10
|
+
name = 'SettlementFailedError';
|
|
11
|
+
title = 'Settlement Failed';
|
|
12
|
+
status = 402;
|
|
13
|
+
type = 'https://paymentauth.org/problems/settlement-failed';
|
|
14
|
+
constructor(options = {}) {
|
|
15
|
+
const { reason } = options;
|
|
16
|
+
super(reason
|
|
17
|
+
? `Settlement failed: ${reason}.`
|
|
18
|
+
: 'Settlement failed: the cross-chain swap did not complete; the deposit is refunded to the refund address.');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The 1Click backend was unreachable during a required check. Per the spec
|
|
23
|
+
* (§Verification), this MUST surface as an HTTP 5xx — never as
|
|
24
|
+
* `verification-failed` — and the credential MUST NOT be settled or consumed.
|
|
25
|
+
* The client retries the same credential once the backend recovers.
|
|
26
|
+
*/
|
|
27
|
+
export class SettlementUnavailableError extends Errors.PaymentError {
|
|
28
|
+
name = 'SettlementUnavailableError';
|
|
29
|
+
title = 'Settlement Backend Unavailable';
|
|
30
|
+
status = 503;
|
|
31
|
+
type = 'https://paymentauth.org/problems/server-error';
|
|
32
|
+
constructor(options = {}) {
|
|
33
|
+
const { reason } = options;
|
|
34
|
+
super(reason
|
|
35
|
+
? `Settlement backend unavailable: ${reason}.`
|
|
36
|
+
: 'Settlement backend unavailable; retry the same credential later.');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Settlement did not reach a terminal state within the server's time budget.
|
|
41
|
+
* The swap may still complete; the credential is NOT consumed, so the client
|
|
42
|
+
* can re-present the same credential later (or wait for the refund path).
|
|
43
|
+
*/
|
|
44
|
+
export class SettlementTimeoutError extends Errors.PaymentError {
|
|
45
|
+
name = 'SettlementTimeoutError';
|
|
46
|
+
title = 'Settlement Timeout';
|
|
47
|
+
status = 504;
|
|
48
|
+
type = 'https://paymentauth.org/problems/server-error';
|
|
49
|
+
constructor(options = {}) {
|
|
50
|
+
const { timeoutMs } = options;
|
|
51
|
+
super(`Settlement did not reach a terminal state${timeoutMs !== undefined ? ` within ${timeoutMs}ms` : ''}; re-present the same credential later.`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=Errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Errors.js","sourceRoot":"","sources":["../src/Errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAE7B;;;;;;GAMG;AACH,MAAM,OAAO,qBAAsB,SAAQ,MAAM,CAAC,YAAY;IAC1C,IAAI,GAAG,uBAAuB,CAAA;IACvC,KAAK,GAAG,mBAAmB,CAAA;IAClB,MAAM,GAAW,GAAG,CAAA;IAC7B,IAAI,GAAG,oDAAoD,CAAA;IAEpE,YAAY,UAAyC,EAAE;QACrD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;QAC1B,KAAK,CACH,MAAM;YACJ,CAAC,CAAC,sBAAsB,MAAM,GAAG;YACjC,CAAC,CAAC,0GAA0G,CAC/G,CAAA;IACH,CAAC;CACF;AASD;;;;;GAKG;AACH,MAAM,OAAO,0BAA2B,SAAQ,MAAM,CAAC,YAAY;IAC/C,IAAI,GAAG,4BAA4B,CAAA;IAC5C,KAAK,GAAG,gCAAgC,CAAA;IAC/B,MAAM,GAAW,GAAG,CAAA;IAC7B,IAAI,GAAG,+CAA+C,CAAA;IAE/D,YAAY,UAA8C,EAAE;QAC1D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;QAC1B,KAAK,CACH,MAAM;YACJ,CAAC,CAAC,mCAAmC,MAAM,GAAG;YAC9C,CAAC,CAAC,kEAAkE,CACvE,CAAA;IACH,CAAC;CACF;AAQD;;;;GAIG;AACH,MAAM,OAAO,sBAAuB,SAAQ,MAAM,CAAC,YAAY;IAC3C,IAAI,GAAG,wBAAwB,CAAA;IACxC,KAAK,GAAG,oBAAoB,CAAA;IACnB,MAAM,GAAW,GAAG,CAAA;IAC7B,IAAI,GAAG,+CAA+C,CAAA;IAE/D,YAAY,UAA0C,EAAE;QACtD,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAA;QAC7B,KAAK,CACH,4CACE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,SAAS,IAAI,CAAC,CAAC,CAAC,EACvD,yCAAyC,CAC1C,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NEAR Intents charge method — shared schema used by both server and client.
|
|
3
|
+
*
|
|
4
|
+
* The challenge `request` carries the origin-chain leg the client must pay
|
|
5
|
+
* (`recipient` is a unique single-use 1Click deposit address) plus the
|
|
6
|
+
* merchant's destination leg in `methodDetails`. The credential payload is
|
|
7
|
+
* the client's confirmed origin-chain deposit transaction hash (push mode).
|
|
8
|
+
*
|
|
9
|
+
* Spec: docs/spec/draft-nearintents-charge-00.md
|
|
10
|
+
*/
|
|
11
|
+
export declare const charge: {
|
|
12
|
+
readonly name: "nearintents";
|
|
13
|
+
readonly intent: "charge";
|
|
14
|
+
readonly schema: {
|
|
15
|
+
readonly credential: {
|
|
16
|
+
readonly payload: import("zod/mini").ZodMiniObject<{
|
|
17
|
+
type: import("zod/mini").ZodMiniLiteral<"hash">;
|
|
18
|
+
hash: import("zod/mini").ZodMiniString<string>;
|
|
19
|
+
}, import("zod/v4/core").$strip>;
|
|
20
|
+
};
|
|
21
|
+
readonly request: import("zod/mini").ZodMiniObject<{
|
|
22
|
+
amount: import("zod/mini").ZodMiniString<string>;
|
|
23
|
+
currency: import("zod/mini").ZodMiniString<string>;
|
|
24
|
+
recipient: import("zod/mini").ZodMiniString<string>;
|
|
25
|
+
description: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
|
|
26
|
+
externalId: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
|
|
27
|
+
methodDetails: import("zod/mini").ZodMiniObject<{
|
|
28
|
+
originNetwork: import("zod/mini").ZodMiniString<string>;
|
|
29
|
+
destinationNetwork: import("zod/mini").ZodMiniString<string>;
|
|
30
|
+
destinationAsset: import("zod/mini").ZodMiniString<string>;
|
|
31
|
+
destinationRecipient: import("zod/mini").ZodMiniString<string>;
|
|
32
|
+
amountOut: import("zod/mini").ZodMiniString<string>;
|
|
33
|
+
minAmountIn: import("zod/mini").ZodMiniString<string>;
|
|
34
|
+
depositMemo: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniNullable<import("zod/mini").ZodMiniString<string>>>;
|
|
35
|
+
slippageTolerance: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniNumber<number>>;
|
|
36
|
+
timeEstimate: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniNumber<number>>;
|
|
37
|
+
refundTo: import("zod/mini").ZodMiniString<string>;
|
|
38
|
+
settlementBackend: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniLiteral<"near-intents">>;
|
|
39
|
+
credentialTypes: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniArray<import("zod/mini").ZodMiniLiteral<"hash">>>;
|
|
40
|
+
}, import("zod/v4/core").$strip>;
|
|
41
|
+
}, import("zod/v4/core").$strip>;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=Methods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Methods.d.ts","sourceRoot":"","sources":["../src/Methods.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASjB,CAAA"}
|
package/dist/Methods.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Method } from 'mppx';
|
|
2
|
+
import * as Types from './Types.js';
|
|
3
|
+
/**
|
|
4
|
+
* NEAR Intents charge method — shared schema used by both server and client.
|
|
5
|
+
*
|
|
6
|
+
* The challenge `request` carries the origin-chain leg the client must pay
|
|
7
|
+
* (`recipient` is a unique single-use 1Click deposit address) plus the
|
|
8
|
+
* merchant's destination leg in `methodDetails`. The credential payload is
|
|
9
|
+
* the client's confirmed origin-chain deposit transaction hash (push mode).
|
|
10
|
+
*
|
|
11
|
+
* Spec: docs/spec/draft-nearintents-charge-00.md
|
|
12
|
+
*/
|
|
13
|
+
export const charge = Method.from({
|
|
14
|
+
name: Types.paymentMethod,
|
|
15
|
+
intent: Types.chargeIntent,
|
|
16
|
+
schema: {
|
|
17
|
+
credential: {
|
|
18
|
+
payload: Types.HashPayloadSchema,
|
|
19
|
+
},
|
|
20
|
+
request: Types.ChargeRequestSchema,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=Methods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Methods.js","sourceRoot":"","sources":["../src/Methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAE7B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAEnC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;IAChC,IAAI,EAAE,KAAK,CAAC,aAAa;IACzB,MAAM,EAAE,KAAK,CAAC,YAAY;IAC1B,MAAM,EAAE;QACN,UAAU,EAAE;YACV,OAAO,EAAE,KAAK,CAAC,iBAAiB;SACjC;QACD,OAAO,EAAE,KAAK,CAAC,mBAAmB;KACnC;CACF,CAAC,CAAA"}
|
package/dist/Types.d.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Receipt, z } from 'mppx';
|
|
2
|
+
/** Payment method name for `nearintents` challenges. */
|
|
3
|
+
export declare const paymentMethod: "nearintents";
|
|
4
|
+
/** Payment intent name for one-time cross-chain charges. */
|
|
5
|
+
export declare const chargeIntent: "charge";
|
|
6
|
+
/** `methodDetails.settlementBackend` disclosure value for this method. */
|
|
7
|
+
export declare const settlementBackend: "near-intents";
|
|
8
|
+
/** Credential types supported by this method (spec: the only valid value is "hash"). */
|
|
9
|
+
export declare const credentialTypes: readonly ["hash"];
|
|
10
|
+
/** Parsed CAIP-2 chain identifier. */
|
|
11
|
+
export type Caip2 = {
|
|
12
|
+
namespace: string;
|
|
13
|
+
reference: string;
|
|
14
|
+
};
|
|
15
|
+
/** Parsed CAIP-19 asset identifier. */
|
|
16
|
+
export type Caip19 = {
|
|
17
|
+
chain: Caip2;
|
|
18
|
+
assetNamespace: string;
|
|
19
|
+
assetReference: string;
|
|
20
|
+
};
|
|
21
|
+
/** Parses a CAIP-2 chain identifier (e.g. `eip155:42161`). Throws on invalid input. */
|
|
22
|
+
export declare function parseCaip2(id: string): Caip2;
|
|
23
|
+
/** Parses a CAIP-19 asset identifier (e.g. `eip155:42161/erc20:0xaf88…`). Throws on invalid input. */
|
|
24
|
+
export declare function parseCaip19(id: string): Caip19;
|
|
25
|
+
/** Returns the CAIP-2 chain component of a CAIP-19 asset identifier. */
|
|
26
|
+
export declare function chainOf(assetId: string): string;
|
|
27
|
+
/** Compares two CAIP-2 identifiers by parsed components. */
|
|
28
|
+
export declare function networkEqual(a: string, b: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Compares two CAIP-19 identifiers by parsed components.
|
|
31
|
+
*
|
|
32
|
+
* The asset reference is compared in the chain's canonical form: for `eip155`
|
|
33
|
+
* chains (hex addresses) the comparison is case-insensitive; for all other
|
|
34
|
+
* chains it is exact (e.g. base58 references are case-sensitive).
|
|
35
|
+
*/
|
|
36
|
+
export declare function assetEqual(a: string, b: string): boolean;
|
|
37
|
+
/** Formats a payer identity as a `did:pkh` source (CAIP-2 network + payer address). */
|
|
38
|
+
export declare function toSource(parameters: {
|
|
39
|
+
network: string;
|
|
40
|
+
address: string;
|
|
41
|
+
}): string;
|
|
42
|
+
/** Base-unit integer amount (e.g. "1000000" for 1 USDC at 6 decimals). */
|
|
43
|
+
export declare function atomicAmount(): z.ZodMiniString<string>;
|
|
44
|
+
/** CAIP-2 chain identifier string. */
|
|
45
|
+
export declare function caip2(): z.ZodMiniString<string>;
|
|
46
|
+
/** CAIP-19 asset identifier string. */
|
|
47
|
+
export declare function caip19(): z.ZodMiniString<string>;
|
|
48
|
+
/** NEAR Intents-specific `methodDetails` for the charge request (spec §Method Details). */
|
|
49
|
+
export declare const MethodDetailsSchema: z.ZodMiniObject<{
|
|
50
|
+
originNetwork: z.ZodMiniString<string>;
|
|
51
|
+
destinationNetwork: z.ZodMiniString<string>;
|
|
52
|
+
destinationAsset: z.ZodMiniString<string>;
|
|
53
|
+
destinationRecipient: z.ZodMiniString<string>;
|
|
54
|
+
amountOut: z.ZodMiniString<string>;
|
|
55
|
+
minAmountIn: z.ZodMiniString<string>;
|
|
56
|
+
depositMemo: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
57
|
+
slippageTolerance: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
58
|
+
timeEstimate: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
59
|
+
refundTo: z.ZodMiniString<string>;
|
|
60
|
+
settlementBackend: z.ZodMiniOptional<z.ZodMiniLiteral<"near-intents">>;
|
|
61
|
+
credentialTypes: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniLiteral<"hash">>>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export type MethodDetails = z.infer<typeof MethodDetailsSchema>;
|
|
64
|
+
/**
|
|
65
|
+
* Canonical `nearintents` charge request (the decoded challenge `request` parameter).
|
|
66
|
+
*
|
|
67
|
+
* The standard fields describe the payment the client makes on the origin
|
|
68
|
+
* chain (`recipient` is the single-use 1Click deposit address); the merchant's
|
|
69
|
+
* destination leg is carried in `methodDetails`.
|
|
70
|
+
*/
|
|
71
|
+
export declare const ChargeRequestSchema: z.ZodMiniObject<{
|
|
72
|
+
amount: z.ZodMiniString<string>;
|
|
73
|
+
currency: z.ZodMiniString<string>;
|
|
74
|
+
recipient: z.ZodMiniString<string>;
|
|
75
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
76
|
+
externalId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
77
|
+
methodDetails: z.ZodMiniObject<{
|
|
78
|
+
originNetwork: z.ZodMiniString<string>;
|
|
79
|
+
destinationNetwork: z.ZodMiniString<string>;
|
|
80
|
+
destinationAsset: z.ZodMiniString<string>;
|
|
81
|
+
destinationRecipient: z.ZodMiniString<string>;
|
|
82
|
+
amountOut: z.ZodMiniString<string>;
|
|
83
|
+
minAmountIn: z.ZodMiniString<string>;
|
|
84
|
+
depositMemo: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
85
|
+
slippageTolerance: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
86
|
+
timeEstimate: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
87
|
+
refundTo: z.ZodMiniString<string>;
|
|
88
|
+
settlementBackend: z.ZodMiniOptional<z.ZodMiniLiteral<"near-intents">>;
|
|
89
|
+
credentialTypes: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniLiteral<"hash">>>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export type ChargeRequest = z.infer<typeof ChargeRequestSchema>;
|
|
93
|
+
/** Push-mode credential payload: the confirmed origin-chain deposit transaction hash. */
|
|
94
|
+
export declare const HashPayloadSchema: z.ZodMiniObject<{
|
|
95
|
+
type: z.ZodMiniLiteral<"hash">;
|
|
96
|
+
hash: z.ZodMiniString<string>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
export type HashPayload = z.infer<typeof HashPayloadSchema>;
|
|
99
|
+
/**
|
|
100
|
+
* `nearintents` Payment-Receipt payload (spec §Receipt).
|
|
101
|
+
*
|
|
102
|
+
* Extends the mppx base receipt with the method's REQUIRED `challengeId` and
|
|
103
|
+
* `originTxHash` fields (and optional `destinationNetwork`). `reference` is
|
|
104
|
+
* the destination-chain transaction hash of the merchant delivery.
|
|
105
|
+
*/
|
|
106
|
+
export type NearIntentsReceipt = Receipt.Receipt & {
|
|
107
|
+
method: typeof paymentMethod;
|
|
108
|
+
/** The `id` from the original challenge. */
|
|
109
|
+
challengeId: string;
|
|
110
|
+
/** The client's origin-chain deposit transaction hash (`payload.hash`). */
|
|
111
|
+
originTxHash: string;
|
|
112
|
+
/** CAIP-2 identifier of the chain where the merchant was paid. */
|
|
113
|
+
destinationNetwork?: string | undefined;
|
|
114
|
+
};
|
|
115
|
+
/** Builds a spec-conformant `nearintents` receipt through `Receipt.from`. */
|
|
116
|
+
export declare function toReceipt(parameters: {
|
|
117
|
+
challengeId: string;
|
|
118
|
+
/** Destination-chain transaction hash of the merchant delivery. */
|
|
119
|
+
reference: string;
|
|
120
|
+
originTxHash: string;
|
|
121
|
+
destinationNetwork?: string | undefined;
|
|
122
|
+
externalId?: string | undefined;
|
|
123
|
+
timestamp?: string | undefined;
|
|
124
|
+
}): NearIntentsReceipt;
|
|
125
|
+
//# sourceMappingURL=Types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../src/Types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,MAAM,CAAA;AAEjC,wDAAwD;AACxD,eAAO,MAAM,aAAa,EAAG,aAAsB,CAAA;AAEnD,4DAA4D;AAC5D,eAAO,MAAM,YAAY,EAAG,QAAiB,CAAA;AAE7C,0EAA0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