@piprail/sdk 1.21.0 → 1.22.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/CHANGELOG.md +47 -0
- package/dist/{algorand-F3OYB534.js → algorand-677ILBQS.js} +1 -1
- package/dist/{algorand-EJ3S2V7E.cjs → algorand-ZJ53VCTN.cjs} +17 -17
- package/dist/{aptos-SUXOVP7B.js → aptos-3TSKTI4D.js} +1 -1
- package/dist/{aptos-GJGIZHNI.cjs → aptos-XIIHPAOO.cjs} +16 -16
- package/dist/{chunk-ILPABTI2.js → chunk-L6WQRHEZ.js} +4 -0
- package/dist/{chunk-PA6YD3HL.cjs → chunk-U35MG4TF.cjs} +14 -10
- package/dist/index.cjs +159 -105
- package/dist/index.d.cts +17 -4
- package/dist/index.d.ts +17 -4
- package/dist/index.js +81 -27
- package/dist/{near-ZJLZE26R.cjs → near-MG256A3E.cjs} +19 -19
- package/dist/{near-LM7S3WUD.js → near-TWA4PYOD.js} +1 -1
- package/dist/{solana-4EMMGGDR.js → solana-KWNRY5NR.js} +10 -1
- package/dist/{solana-CCVSMOKS.cjs → solana-UEMHFQH5.cjs} +36 -27
- package/dist/{stellar-XHLLNHQP.cjs → stellar-SCRRPCEA.cjs} +21 -21
- package/dist/{stellar-FIJPQZVW.js → stellar-YB7JXKK4.js} +1 -1
- package/dist/{sui-B7AVN7NK.js → sui-IODKU2MA.js} +1 -1
- package/dist/{sui-6CVLEXLA.cjs → sui-LFT65OGU.cjs} +17 -17
- package/dist/{ton-CHJ26BVA.js → ton-QN5GTOCS.js} +1 -1
- package/dist/{ton-RNEFN25G.cjs → ton-RAYJFKJC.cjs} +14 -14
- package/dist/{tron-TKJHNFGM.cjs → tron-KX4VWS7V.cjs} +24 -24
- package/dist/{tron-DD3JDROV.js → tron-QSNCDYRB.js} +1 -1
- package/dist/{xrpl-GTUPP6SK.js → xrpl-ECHK3GIX.js} +1 -1
- package/dist/{xrpl-XN2NBNGI.cjs → xrpl-GXUFDXHU.cjs} +21 -21
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,53 @@ All notable changes to `@piprail/sdk` are documented here. The format
|
|
|
4
4
|
follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the
|
|
5
5
|
versions follow [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [1.22.0] — 2026-06-13 — optional wallet (read-only client)
|
|
8
|
+
|
|
9
|
+
A purely **additive, opt-in** feature: `PipRailClient`'s `wallet` is now **optional**. Omit it for a
|
|
10
|
+
**read-only client** that can `quote`, `estimateCost`, `discover`, and `register` (402 Index) with no
|
|
11
|
+
key — paying, planning, or signing then throws the new typed `WalletRequiredError`. **Supplying a
|
|
12
|
+
wallet is byte-identical to every prior version** — the full suite passes unchanged and the wallet is
|
|
13
|
+
bound exactly as before; this only adds a key-less path. It's what lets `@piprail/mcp` boot read-only
|
|
14
|
+
with no `PIPRAIL_PRIVATE_KEY`.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- **Optional `wallet`** in `PipRailClientOptions` → a read-only client. `quote` / `estimateCost` /
|
|
18
|
+
`discover` / `register` (402 Index) work with no key; `discoverySigner()` returns `null`.
|
|
19
|
+
- **`WalletRequiredError`** (stable code `WALLET_REQUIRED`) — thrown by `fetch` (pay) and `planPayment`
|
|
20
|
+
on a read-only client, so the wallet requirement is explicit and typed.
|
|
21
|
+
|
|
22
|
+
## [1.21.1] — 2026-06-13 — facilitator hardening + gasless auto-routing + agent-facing docs
|
|
23
|
+
|
|
24
|
+
A correctness/robustness patch over 1.21.0, after a full re-review and **live mainnet tests of the
|
|
25
|
+
facilitator path on both Solana and Base (EVM)**. Opt-in surface unchanged; `onchain-proof` still the
|
|
26
|
+
default everywhere.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
- **Gasless auto-routing now works on Solana.** The Solana driver's `estimateCost` now reports the
|
|
30
|
+
`exact` rail as **~0 buyer gas** (the fee payer — a facilitator like PayAI, or your relayer —
|
|
31
|
+
broadcasts and pays the SOL fee), mirroring the EVM driver. Before, it reported the same fee as
|
|
32
|
+
`onchain-proof`, so `planPayment()`/`fetch({ autoRoute: true })` wouldn't prefer the gasless rail —
|
|
33
|
+
now they correctly pick it. (Live-proven: autoRoute chooses `exact` even when the buyer holds SOL.)
|
|
34
|
+
- **Buyer EIP-3009 domain read is resilient to a flaky RPC.** `payExactEvm` now retries the on-chain
|
|
35
|
+
EIP-712 domain read once before concluding a token "isn't EIP-3009", so a rate-limited public RPC can
|
|
36
|
+
no longer misreport real USDC as un-payable and block an otherwise-valid gasless payment. The error
|
|
37
|
+
message, if it still fails, now names the transient-RPC possibility instead of asserting non-EIP-3009.
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
- **Permit2 can't be facilitator-settled — the gate now says so clearly.** A third-party facilitator
|
|
41
|
+
settles the standard EIP-3009 (EVM) / SVM (Solana) schemes, not PipRail's `x402ExactPermit2Proxy`. A
|
|
42
|
+
*forced* `exact: { method: 'permit2', settle: { facilitator } }` now throws a clear config error, and
|
|
43
|
+
an *auto*-selected Permit2 token is dropped to `onchain-proof`-only over a facilitator (rather than
|
|
44
|
+
advertising a rail it could never settle). Keyed off the resolved method, so Solana (`svm`) is unaffected.
|
|
45
|
+
- **Clearer facilitator-unreachable error.** When a Solana facilitator's `GET /supported` can't be read
|
|
46
|
+
at challenge time, the gate now explains the real cause (and points at `exact.settle.feePayer` /
|
|
47
|
+
`settle: 'self'`) instead of the misleading "none of the offered rails support it".
|
|
48
|
+
- **`PIPRAIL_AGENT_GUIDE` now teaches the gasless `exact` rail** — the two rails, that it's operator-opt-in,
|
|
49
|
+
that the on-chain method is auto-selected, and that on a timeout the `exact` `.ref` is an authorization
|
|
50
|
+
**nonce** (re-present the same authorization, never re-sign). Plus docs: the "whole model in 30 seconds"
|
|
51
|
+
(gas vs `onchain-proof` vs `exact`'s three methods), a "when the facilitator fails" breakdown, and
|
|
52
|
+
agent-toolkit/MCP gasless guidance.
|
|
53
|
+
|
|
7
54
|
## [1.21.0] — 2026-06-13 — standard `exact` rail on Solana (SVM) + fully-gasless facilitator mode
|
|
8
55
|
|
|
9
56
|
Opt-in, defaults unchanged. `onchain-proof` stays the default on every chain and is byte-identical.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkU35MG4TFcjs = require('./chunk-U35MG4TF.cjs');
|
|
11
11
|
|
|
12
12
|
// src/drivers/algorand/index.ts
|
|
13
13
|
var _algosdk = require('algosdk'); var _algosdk2 = _interopRequireDefault(_algosdk);
|
|
@@ -55,13 +55,13 @@ async function payAlgorand(params) {
|
|
|
55
55
|
} catch (err) {
|
|
56
56
|
const mapped = mapAlgorandError(err, accept.payTo);
|
|
57
57
|
if (mapped) throw mapped;
|
|
58
|
-
throw _nullishCoalesce(
|
|
58
|
+
throw _nullishCoalesce(_chunkU35MG4TFcjs.toInsufficientFundsError.call(void 0, err), () => ( err));
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
function mapAlgorandError(err, payTo) {
|
|
62
62
|
const m = err instanceof Error ? err.message : String(err);
|
|
63
63
|
if (/must optin/i.test(m) || /missing from/i.test(m) && m.includes(payTo)) {
|
|
64
|
-
return new (0,
|
|
64
|
+
return new (0, _chunkU35MG4TFcjs.RecipientNotReadyError)(
|
|
65
65
|
`Algorand recipient ${payTo} hasn't opted into this asset \u2014 it must opt in (a 0-amount asset transfer to itself) before it can receive. (Algorand: ${firstLine(m)})`,
|
|
66
66
|
{ cause: err }
|
|
67
67
|
);
|
|
@@ -69,7 +69,7 @@ function mapAlgorandError(err, payTo) {
|
|
|
69
69
|
if (/overspend|below min|min(imum)? balance|tried to spend|balance \d+ below|asset \d+ missing from|insufficient|underflow/i.test(
|
|
70
70
|
m
|
|
71
71
|
)) {
|
|
72
|
-
return new (0,
|
|
72
|
+
return new (0, _chunkU35MG4TFcjs.InsufficientFundsError)(
|
|
73
73
|
`Algorand payment failed: the sender can't cover it \u2014 token balance, ALGO for fees, the 0.1-ALGO minimum balance, or a missing asset opt-in on the sender. (Algorand: ${firstLine(m)})`,
|
|
74
74
|
{ cause: err }
|
|
75
75
|
);
|
|
@@ -157,22 +157,22 @@ function rpcFailed(nonce) {
|
|
|
157
157
|
|
|
158
158
|
function assertAlgorandWallet(wallet, network) {
|
|
159
159
|
if (typeof wallet !== "object" || wallet === null) {
|
|
160
|
-
throw new (0,
|
|
160
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
161
161
|
`chain ${network} is Algorand; wallet must be { mnemonic } (25 words) or { account }.`
|
|
162
162
|
);
|
|
163
163
|
}
|
|
164
164
|
if ("privateKey" in wallet || "walletClient" in wallet) {
|
|
165
|
-
throw new (0,
|
|
165
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
166
166
|
`chain ${network} is Algorand; an EVM/Aptos wallet can't be used \u2014 pass { mnemonic } (25 words) or { account }.`
|
|
167
167
|
);
|
|
168
168
|
}
|
|
169
169
|
if ("secretKey" in wallet || "signer" in wallet || "secret" in wallet || "keypair" in wallet || "keyPair" in wallet || "seed" in wallet || "accountId" in wallet) {
|
|
170
|
-
throw new (0,
|
|
170
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
171
171
|
`chain ${network} is Algorand; that looks like another family's wallet \u2014 pass { mnemonic } (25 words) or { account }.`
|
|
172
172
|
);
|
|
173
173
|
}
|
|
174
174
|
if (!("mnemonic" in wallet) && !("account" in wallet)) {
|
|
175
|
-
throw new (0,
|
|
175
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
176
176
|
`chain ${network} is Algorand; wallet must be { mnemonic } (25 words) or { account }.`
|
|
177
177
|
);
|
|
178
178
|
}
|
|
@@ -187,13 +187,13 @@ function resolveAlgorandWallet(config) {
|
|
|
187
187
|
const { addr, sk } = _algosdk2.default.mnemonicToSecretKey(config.mnemonic);
|
|
188
188
|
return { addr: addr.toString(), sk };
|
|
189
189
|
} catch (cause) {
|
|
190
|
-
throw new (0,
|
|
190
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
191
191
|
"Algorand wallet { mnemonic } is not a valid 25-word Algorand mnemonic.",
|
|
192
192
|
{ cause }
|
|
193
193
|
);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
throw new (0,
|
|
196
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)("Algorand wallet needs { mnemonic } (25 words) or { account }.");
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
// src/drivers/algorand/index.ts
|
|
@@ -248,16 +248,16 @@ function makeAlgorandNetwork(preset, algodUrl) {
|
|
|
248
248
|
const info = preset.tokens[token.toUpperCase()];
|
|
249
249
|
if (!info) {
|
|
250
250
|
const known = Object.keys(preset.tokens).join(", ") || "(none built in)";
|
|
251
|
-
throw new (0,
|
|
251
|
+
throw new (0, _chunkU35MG4TFcjs.UnknownTokenError)(
|
|
252
252
|
`token "${token}" isn't built in for Algorand (known: ${known}). Pass { assetId, decimals } for a custom ASA, or use 'native'.`
|
|
253
253
|
);
|
|
254
254
|
}
|
|
255
255
|
return { asset: algorandAssetId(info.assetId), decimals: info.decimals, symbol: info.symbol };
|
|
256
256
|
}
|
|
257
|
-
|
|
257
|
+
_chunkU35MG4TFcjs.rejectForeignToken.call(void 0, token, "algorand", network);
|
|
258
258
|
const t = token;
|
|
259
259
|
if (typeof t.assetId !== "number" || typeof t.decimals !== "number") {
|
|
260
|
-
throw new (0,
|
|
260
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
261
261
|
`chain ${network} is Algorand; a custom token must be { assetId, decimals }.`
|
|
262
262
|
);
|
|
263
263
|
}
|
|
@@ -278,12 +278,12 @@ function makeAlgorandNetwork(preset, algodUrl) {
|
|
|
278
278
|
},
|
|
279
279
|
assertValidPayTo(payTo) {
|
|
280
280
|
if (payTo.startsWith("0x")) {
|
|
281
|
-
throw new (0,
|
|
281
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
282
282
|
`chain ${network} is Algorand, but payTo "${payTo}" looks like an EVM address.`
|
|
283
283
|
);
|
|
284
284
|
}
|
|
285
285
|
if (!_algosdk2.default.isValidAddress(payTo)) {
|
|
286
|
-
throw new (0,
|
|
286
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
287
287
|
`chain ${network} is Algorand, but payTo "${payTo}" is not a valid Algorand address.`
|
|
288
288
|
);
|
|
289
289
|
}
|
|
@@ -300,13 +300,13 @@ function makeAlgorandNetwork(preset, algodUrl) {
|
|
|
300
300
|
const info = await _algosdk2.default.waitForConfirmation(algod, ref, 10);
|
|
301
301
|
return { height: String(_nullishCoalesce(info.confirmedRound, () => ( 0))) };
|
|
302
302
|
} catch (err) {
|
|
303
|
-
throw new (0,
|
|
303
|
+
throw new (0, _chunkU35MG4TFcjs.ConfirmationTimeoutError)(`Algorand tx ${ref} did not confirm in time.`, {
|
|
304
304
|
cause: err
|
|
305
305
|
});
|
|
306
306
|
}
|
|
307
307
|
},
|
|
308
308
|
async estimateCost() {
|
|
309
|
-
return
|
|
309
|
+
return _chunkU35MG4TFcjs.nativeCost.call(void 0, {
|
|
310
310
|
symbol: ALGO_SYMBOL,
|
|
311
311
|
decimals: ALGO_DECIMALS,
|
|
312
312
|
fee: 1000n,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkU35MG4TFcjs = require('./chunk-U35MG4TF.cjs');
|
|
10
10
|
|
|
11
11
|
// src/drivers/aptos/index.ts
|
|
12
12
|
var _tssdk = require('@aptos-labs/ts-sdk');
|
|
@@ -55,14 +55,14 @@ async function payAptos(params) {
|
|
|
55
55
|
const res = await client.signSubmit({ signer, transaction });
|
|
56
56
|
return res.hash;
|
|
57
57
|
} catch (err) {
|
|
58
|
-
if (err instanceof
|
|
58
|
+
if (err instanceof _chunkU35MG4TFcjs.InsufficientFundsError) throw err;
|
|
59
59
|
if (isAptosAffordability(err)) {
|
|
60
|
-
throw new (0,
|
|
60
|
+
throw new (0, _chunkU35MG4TFcjs.InsufficientFundsError)(
|
|
61
61
|
err instanceof Error ? err.message : "Insufficient APT/token balance for the payment.",
|
|
62
62
|
{ cause: err }
|
|
63
63
|
);
|
|
64
64
|
}
|
|
65
|
-
throw _nullishCoalesce(
|
|
65
|
+
throw _nullishCoalesce(_chunkU35MG4TFcjs.toInsufficientFundsError.call(void 0, err), () => ( err));
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
function isAptosAffordability(err) {
|
|
@@ -146,22 +146,22 @@ function txNotFound(hash) {
|
|
|
146
146
|
|
|
147
147
|
function assertAptosWallet(wallet, network) {
|
|
148
148
|
if (typeof wallet !== "object" || wallet === null) {
|
|
149
|
-
throw new (0,
|
|
149
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
150
150
|
`chain ${network} is Aptos; wallet must be { privateKey } (ed25519-priv-0x\u2026) or { account }.`
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
153
|
if ("walletClient" in wallet) {
|
|
154
|
-
throw new (0,
|
|
154
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
155
155
|
`chain ${network} is Aptos; a viem { walletClient } can't be used \u2014 pass { privateKey } (ed25519-priv-0x\u2026) or { account }.`
|
|
156
156
|
);
|
|
157
157
|
}
|
|
158
158
|
if ("secretKey" in wallet || "signer" in wallet || "mnemonic" in wallet || "keypair" in wallet || "keyPair" in wallet || "secret" in wallet || "seed" in wallet || "accountId" in wallet) {
|
|
159
|
-
throw new (0,
|
|
159
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
160
160
|
`chain ${network} is Aptos; that looks like another family's wallet \u2014 pass { privateKey } (ed25519-priv-0x\u2026) or { account }.`
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
if (!("privateKey" in wallet) && !("account" in wallet)) {
|
|
164
|
-
throw new (0,
|
|
164
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
165
165
|
`chain ${network} is Aptos; wallet must be { privateKey } (ed25519-priv-0x\u2026) or { account }.`
|
|
166
166
|
);
|
|
167
167
|
}
|
|
@@ -173,13 +173,13 @@ function resolveAptosAccount(config) {
|
|
|
173
173
|
try {
|
|
174
174
|
return _tssdk.Account.fromPrivateKey({ privateKey: new (0, _tssdk.Ed25519PrivateKey)(config.privateKey) });
|
|
175
175
|
} catch (cause) {
|
|
176
|
-
throw new (0,
|
|
176
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
177
177
|
"Aptos wallet { privateKey } is not a valid ed25519 secret (ed25519-priv-0x\u2026 or 0x\u2026 hex).",
|
|
178
178
|
{ cause }
|
|
179
179
|
);
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
throw new (0,
|
|
182
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)("Aptos wallet needs { privateKey } (ed25519-priv-0x\u2026) or { account }.");
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
// src/drivers/aptos/index.ts
|
|
@@ -251,16 +251,16 @@ function makeAptosNetwork(preset, rpcUrl) {
|
|
|
251
251
|
const info = preset.tokens[token.toUpperCase()];
|
|
252
252
|
if (!info) {
|
|
253
253
|
const known = Object.keys(preset.tokens).join(", ") || "(none built in)";
|
|
254
|
-
throw new (0,
|
|
254
|
+
throw new (0, _chunkU35MG4TFcjs.UnknownTokenError)(
|
|
255
255
|
`token "${token}" isn't built in for Aptos (known: ${known}). Pass { metadata, decimals } for a custom Fungible Asset, or use 'native'.`
|
|
256
256
|
);
|
|
257
257
|
}
|
|
258
258
|
return { asset: info.metadata, decimals: info.decimals, symbol: info.symbol };
|
|
259
259
|
}
|
|
260
|
-
|
|
260
|
+
_chunkU35MG4TFcjs.rejectForeignToken.call(void 0, token, "aptos", network);
|
|
261
261
|
const t = token;
|
|
262
262
|
if (!t.metadata || typeof t.decimals !== "number") {
|
|
263
|
-
throw new (0,
|
|
263
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
264
264
|
`chain ${network} is Aptos; a custom token must be { metadata, decimals }.`
|
|
265
265
|
);
|
|
266
266
|
}
|
|
@@ -287,7 +287,7 @@ function makeAptosNetwork(preset, rpcUrl) {
|
|
|
287
287
|
valid = false;
|
|
288
288
|
}
|
|
289
289
|
if (!valid || evmLike) {
|
|
290
|
-
throw new (0,
|
|
290
|
+
throw new (0, _chunkU35MG4TFcjs.WrongFamilyError)(
|
|
291
291
|
`chain ${network} is Aptos, but payTo "${payTo}" is not a valid Aptos address (0x + 32 bytes).`
|
|
292
292
|
);
|
|
293
293
|
}
|
|
@@ -309,11 +309,11 @@ function makeAptosNetwork(preset, rpcUrl) {
|
|
|
309
309
|
const tx = await aptos.waitForTransaction({ transactionHash: ref });
|
|
310
310
|
return { height: String(_nullishCoalesce(tx.version, () => ( "0"))) };
|
|
311
311
|
} catch (err) {
|
|
312
|
-
throw new (0,
|
|
312
|
+
throw new (0, _chunkU35MG4TFcjs.ConfirmationTimeoutError)(`Aptos tx ${ref} did not finalize in time.`, { cause: err });
|
|
313
313
|
}
|
|
314
314
|
},
|
|
315
315
|
async estimateCost() {
|
|
316
|
-
return
|
|
316
|
+
return _chunkU35MG4TFcjs.nativeCost.call(void 0, {
|
|
317
317
|
symbol: APT_SYMBOL,
|
|
318
318
|
decimals: APT_DECIMALS,
|
|
319
319
|
fee: 100000n,
|
|
@@ -78,6 +78,9 @@ var UnsupportedSchemeError = class extends PipRailError {
|
|
|
78
78
|
var NonReplayableBodyError = class extends PipRailError {
|
|
79
79
|
code = "NON_REPLAYABLE_BODY";
|
|
80
80
|
};
|
|
81
|
+
var WalletRequiredError = class extends PipRailError {
|
|
82
|
+
code = "WALLET_REQUIRED";
|
|
83
|
+
};
|
|
81
84
|
var WrongFamilyError = class extends PipRailError {
|
|
82
85
|
code = "WRONG_FAMILY";
|
|
83
86
|
};
|
|
@@ -186,6 +189,7 @@ export {
|
|
|
186
189
|
NoCompatibleAcceptError,
|
|
187
190
|
UnsupportedSchemeError,
|
|
188
191
|
NonReplayableBodyError,
|
|
192
|
+
WalletRequiredError,
|
|
189
193
|
WrongFamilyError,
|
|
190
194
|
UnknownTokenError,
|
|
191
195
|
MissingDriverError,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16;// src/errors.ts
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16; var _class17;// src/errors.ts
|
|
2
2
|
var PipRailError = class extends Error {
|
|
3
3
|
constructor(message, options) {
|
|
4
4
|
super(message, options);
|
|
@@ -78,18 +78,21 @@ var UnsupportedSchemeError = (_class11 = class extends PipRailError {constructor
|
|
|
78
78
|
var NonReplayableBodyError = (_class12 = class extends PipRailError {constructor(...args9) { super(...args9); _class12.prototype.__init12.call(this); }
|
|
79
79
|
__init12() {this.code = "NON_REPLAYABLE_BODY"}
|
|
80
80
|
}, _class12);
|
|
81
|
-
var
|
|
82
|
-
__init13() {this.code = "
|
|
81
|
+
var WalletRequiredError = (_class13 = class extends PipRailError {constructor(...args10) { super(...args10); _class13.prototype.__init13.call(this); }
|
|
82
|
+
__init13() {this.code = "WALLET_REQUIRED"}
|
|
83
83
|
}, _class13);
|
|
84
|
-
var
|
|
85
|
-
__init14() {this.code = "
|
|
84
|
+
var WrongFamilyError = (_class14 = class extends PipRailError {constructor(...args11) { super(...args11); _class14.prototype.__init14.call(this); }
|
|
85
|
+
__init14() {this.code = "WRONG_FAMILY"}
|
|
86
86
|
}, _class14);
|
|
87
|
-
var
|
|
88
|
-
__init15() {this.code = "
|
|
87
|
+
var UnknownTokenError = (_class15 = class extends PipRailError {constructor(...args12) { super(...args12); _class15.prototype.__init15.call(this); }
|
|
88
|
+
__init15() {this.code = "UNKNOWN_TOKEN"}
|
|
89
89
|
}, _class15);
|
|
90
|
-
var
|
|
91
|
-
__init16() {this.code = "
|
|
90
|
+
var MissingDriverError = (_class16 = class extends PipRailError {constructor(...args13) { super(...args13); _class16.prototype.__init16.call(this); }
|
|
91
|
+
__init16() {this.code = "MISSING_DRIVER"}
|
|
92
92
|
}, _class16);
|
|
93
|
+
var UnsupportedNetworkError = (_class17 = class extends PipRailError {constructor(...args14) { super(...args14); _class17.prototype.__init17.call(this); }
|
|
94
|
+
__init17() {this.code = "UNSUPPORTED_NETWORK"}
|
|
95
|
+
}, _class17);
|
|
93
96
|
|
|
94
97
|
// src/drivers/shared.ts
|
|
95
98
|
var FAMILY_LABEL = {
|
|
@@ -195,4 +198,5 @@ function nativeCost(opts) {
|
|
|
195
198
|
|
|
196
199
|
|
|
197
200
|
|
|
198
|
-
|
|
201
|
+
|
|
202
|
+
exports.PipRailError = PipRailError; exports.InsufficientFundsError = InsufficientFundsError; exports.RecipientNotReadyError = RecipientNotReadyError; exports.toInsufficientFundsError = toInsufficientFundsError; exports.WrongChainError = WrongChainError; exports.PaymentTimeoutError = PaymentTimeoutError; exports.MaxRetriesExceededError = MaxRetriesExceededError; exports.PaymentDeclinedError = PaymentDeclinedError; exports.ConfirmationTimeoutError = ConfirmationTimeoutError; exports.SettlementError = SettlementError; exports.InvalidEnvelopeError = InvalidEnvelopeError; exports.NoCompatibleAcceptError = NoCompatibleAcceptError; exports.UnsupportedSchemeError = UnsupportedSchemeError; exports.NonReplayableBodyError = NonReplayableBodyError; exports.WalletRequiredError = WalletRequiredError; exports.WrongFamilyError = WrongFamilyError; exports.UnknownTokenError = UnknownTokenError; exports.MissingDriverError = MissingDriverError; exports.UnsupportedNetworkError = UnsupportedNetworkError; exports.rejectForeignToken = rejectForeignToken; exports.parseUnits = parseUnits; exports.floorUnits = floorUnits; exports.formatUnits = formatUnits; exports.nativeCost = nativeCost;
|