@rhea-finance/cross-chain-aggregation-dex 2.1.10-beta.1 → 2.1.10-beta.2
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 +24 -11
- package/dist/confidential/adapters.d.mts +1 -0
- package/dist/confidential/adapters.d.ts +1 -0
- package/dist/confidential/adapters.js +14 -0
- package/dist/confidential/adapters.js.map +1 -0
- package/dist/confidential/adapters.mjs +3 -0
- package/dist/confidential/adapters.mjs.map +1 -0
- package/dist/confidential/index.d.mts +2 -0
- package/dist/confidential/index.d.ts +2 -0
- package/dist/confidential/index.js +14 -0
- package/dist/confidential/index.js.map +1 -0
- package/dist/confidential/index.mjs +3 -0
- package/dist/confidential/index.mjs.map +1 -0
- package/dist/executors/aptos.d.mts +1 -1
- package/dist/executors/aptos.d.ts +1 -1
- package/dist/executors/bitcoin.d.mts +1 -1
- package/dist/executors/bitcoin.d.ts +1 -1
- package/dist/executors/dash.d.mts +1 -1
- package/dist/executors/dash.d.ts +1 -1
- package/dist/executors/evm.d.mts +1 -1
- package/dist/executors/evm.d.ts +1 -1
- package/dist/executors/near.d.mts +1 -1
- package/dist/executors/near.d.ts +1 -1
- package/dist/executors/pearl.d.mts +1 -1
- package/dist/executors/pearl.d.ts +1 -1
- package/dist/executors/qtc.d.mts +1 -1
- package/dist/executors/qtc.d.ts +1 -1
- package/dist/executors/solana.d.mts +1 -1
- package/dist/executors/solana.d.ts +1 -1
- package/dist/executors/starknet.d.mts +1 -1
- package/dist/executors/starknet.d.ts +1 -1
- package/dist/executors/sui.d.mts +1 -1
- package/dist/executors/sui.d.ts +1 -1
- package/dist/executors/tron.d.mts +1 -1
- package/dist/executors/tron.d.ts +1 -1
- package/dist/executors/zcash.d.mts +1 -1
- package/dist/executors/zcash.d.ts +1 -1
- package/dist/index.d.mts +18 -88
- package/dist/index.d.ts +18 -88
- package/dist/index.js +127 -399
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +126 -335
- package/dist/index.mjs.map +1 -1
- package/dist/{shared-CimaFxNY.d.mts → shared-DRmoLQfi.d.mts} +1 -10
- package/dist/{shared-CimaFxNY.d.ts → shared-DRmoLQfi.d.ts} +1 -10
- package/package.json +15 -3
package/README.md
CHANGED
|
@@ -6,6 +6,29 @@ This package is a client SDK for the RHEA Cross-Chain Swap API. For endpoint con
|
|
|
6
6
|
|
|
7
7
|
Supported chain families: EVM, Solana, Aptos, NEAR, Tron, Bitcoin, Zcash, Sui, Dash, Pearl, Quantus, and Starknet. How to load the product token list and chain coverage is described in [Supported chains and tokens](#supported-chains-and-tokens).
|
|
8
8
|
|
|
9
|
+
## Separate APIs in one package
|
|
10
|
+
|
|
11
|
+
Import ordinary swaps from the main entry and private swaps from the dedicated `/confidential` entry. The main `SwapClient` does not import or initialize the private client. Private signing adapters have their own `/confidential/adapters` entry:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { SwapClient } from "@rhea-finance/cross-chain-aggregation-dex";
|
|
15
|
+
import { createConfidentialSwapClient } from "@rhea-finance/cross-chain-aggregation-dex/confidential";
|
|
16
|
+
import { createNearSigningAdapter } from "@rhea-finance/cross-chain-aggregation-dex/confidential/adapters";
|
|
17
|
+
|
|
18
|
+
const swapClient = new SwapClient({ baseUrl: swapApiUrl });
|
|
19
|
+
const privateClient = createConfidentialSwapClient({
|
|
20
|
+
api: privateApi,
|
|
21
|
+
signingAdapters: privateSigningAdapters,
|
|
22
|
+
fundingAdapters: privateFundingAdapters,
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The private entry exposes the independent [`@rhea-finance/confidential-swap`](https://www.npmjs.com/package/@rhea-finance/confidential-swap) API. Configure its API and wallet adapters using that package's documentation. Ordinary quote/build APIs reject the legacy `confidentiality` input, including values passed through `extensions`; use the private client directly. Wallet-authorized history remains a separate read API.
|
|
27
|
+
|
|
28
|
+
### Coordinating private SDK releases
|
|
29
|
+
|
|
30
|
+
The `/confidential` entry forwards to the installed private SDK; it does not bundle a separate implementation. This integration revision includes local private SDK changes beyond the published `0.3.9` package. Local tarball overrides validate those changes together, while this package's source dependency and lockfile resolve the registry version. Before publishing this integration, publish the matching private SDK revision under a new version, then update the exact dependency and lockfile here. Do not publish the wrapper against an older private API or reuse an existing published version for changed code.
|
|
31
|
+
|
|
9
32
|
## Supported chains and tokens
|
|
10
33
|
|
|
11
34
|
The product support list matches `multi-chain-lending` Trade: **29 mainnets**. Use the HTTP API chain ID for `fromChain` / `toChain` in Swap calls. Token-list endpoints use the separate numeric ID shown below; for EVM chains the two IDs are the same.
|
|
@@ -333,15 +356,6 @@ const filteredQuote = await client.quote({
|
|
|
333
356
|
});
|
|
334
357
|
```
|
|
335
358
|
|
|
336
|
-
Set `confidentiality: "basic"` or `"advanced"` to use the confidential 1Click route. The SDK preserves it through quote and build, and includes it in automatic or manual report payloads. Omit the field for public swaps:
|
|
337
|
-
|
|
338
|
-
```ts
|
|
339
|
-
const confidentialQuote = await client.quote({
|
|
340
|
-
...quoteRequest,
|
|
341
|
-
confidentiality: "basic",
|
|
342
|
-
});
|
|
343
|
-
```
|
|
344
|
-
|
|
345
359
|
#### 3.3.1 Configure quote timing
|
|
346
360
|
|
|
347
361
|
`quoteWaitingTimeMs`, `sameChainTimeoutMs`, and `crossChainTimeoutMs` are first-class SDK parameters. Pass them directly to `client.quote()`; do not put them in `extensions` or executor configuration.
|
|
@@ -491,7 +505,6 @@ Terminal statuses are `completed`, `failed`, `refunded`, and `expired`.
|
|
|
491
505
|
| `sameChainTimeoutMs` | `number` | No | Same-chain route quote timeout in milliseconds. Must be a non-negative integer. Default: `500`. |
|
|
492
506
|
| `crossChainTimeoutMs` | `number` | No | Cross-chain route quote timeout in milliseconds. Must be a non-negative integer. Default: `3000`. |
|
|
493
507
|
| `excludeDexs` | `string[]` | No | Routing provider identifiers to exclude, for example `["lifi", "rango"]`. Omit or pass `[]` for no exclusions. |
|
|
494
|
-
| `confidentiality` | `"basic"` | No | Enables the confidential 1Click route and marks the resulting report. Omit for public swaps. |
|
|
495
508
|
| `sender` | `string` | Yes | Sender address on the source chain. |
|
|
496
509
|
| `recipient` | `string` | No | Recipient address on the destination chain. Cross-chain requests should normally provide it explicitly. |
|
|
497
510
|
| `extensions` | `Record<string,unknown>` | No | Additional fields forwarded to the API. Regular applications should not use this to replace standard fields. |
|
|
@@ -901,7 +914,7 @@ formatUnits("1250000", 6); // "1.25"
|
|
|
901
914
|
|
|
902
915
|
`parseUnits()` rejects fractional precision beyond the token's decimals. `formatUnits()` accepts only non-negative base-unit decimal integer strings.
|
|
903
916
|
|
|
904
|
-
## QTC and Pearl native transfers (2.1.10-beta.
|
|
917
|
+
## QTC and Pearl native transfers (2.1.10-beta.2)
|
|
905
918
|
|
|
906
919
|
Canonical API chain names are `qtc` and `pearl`; incoming `quantus` and legacy `prl` aliases are accepted. Quote/build requests send `pearl` in `fromChain` / `toChain`; the native token symbol and identifiers remain `PRL`, `prl`, and `nep141:prl.omft.near`. Native quote addresses serialize as `qtc` and `prl` (Dash uses `dash`); OMFT IDs remain registry asset identities. QTC uses 12 decimal places; Pearl uses 8.
|
|
907
920
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@rhea-finance/confidential-swap/adapters';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@rhea-finance/confidential-swap/adapters';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var adapters = require('@rhea-finance/confidential-swap/adapters');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(adapters).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return adapters[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=adapters.js.map
|
|
14
|
+
//# sourceMappingURL=adapters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"adapters.js","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"adapters.mjs","sourcesContent":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var confidentialSwap = require('@rhea-finance/confidential-swap');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(confidentialSwap).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return confidentialSwap[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs","sourcesContent":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.mjs';
|
|
2
2
|
|
|
3
3
|
interface AptosWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.js';
|
|
2
2
|
|
|
3
3
|
interface AptosWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.mjs';
|
|
2
2
|
|
|
3
3
|
interface BitcoinWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.js';
|
|
2
2
|
|
|
3
3
|
interface BitcoinWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.mjs';
|
|
2
2
|
|
|
3
3
|
interface DashWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/dash.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.js';
|
|
2
2
|
|
|
3
3
|
interface DashWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/evm.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, a as EvmTx, T as TransactionSubmission, b as EvmSigningRequest, c as EvmApproval, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.mjs';
|
|
2
2
|
|
|
3
3
|
interface EvmWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
sendTransaction(tx: EvmTx, options: {
|
package/dist/executors/evm.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, a as EvmTx, T as TransactionSubmission, b as EvmSigningRequest, c as EvmApproval, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.js';
|
|
2
2
|
|
|
3
3
|
interface EvmWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
sendTransaction(tx: EvmTx, options: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, N as NearTransaction, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.mjs';
|
|
2
2
|
|
|
3
3
|
interface NearWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/near.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, N as NearTransaction, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.js';
|
|
2
2
|
|
|
3
3
|
interface NearWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.mjs';
|
|
2
2
|
|
|
3
3
|
interface PearlWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.js';
|
|
2
2
|
|
|
3
3
|
interface PearlWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/qtc.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.mjs';
|
|
2
2
|
|
|
3
3
|
interface QtcWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/qtc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.js';
|
|
2
2
|
|
|
3
3
|
interface QtcWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, S as SolanaMetadata, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.mjs';
|
|
2
2
|
|
|
3
3
|
interface SolanaWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, S as SolanaMetadata, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.js';
|
|
2
2
|
|
|
3
3
|
interface SolanaWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, h as StarknetCall, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.mjs';
|
|
2
2
|
|
|
3
3
|
interface StarknetWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, h as StarknetCall, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.js';
|
|
2
2
|
|
|
3
3
|
interface StarknetWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/sui.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.mjs';
|
|
2
2
|
|
|
3
3
|
interface SuiWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/sui.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.js';
|
|
2
2
|
|
|
3
3
|
interface SuiWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, f as TronUnsignedTransaction, g as TronApproval, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.mjs';
|
|
2
2
|
|
|
3
3
|
interface TronWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/tron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, f as TronUnsignedTransaction, g as TronApproval, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.js';
|
|
2
2
|
|
|
3
3
|
interface TronWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.mjs';
|
|
2
2
|
|
|
3
3
|
interface ZcashWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ExecutorErrorAdapter, e as ChainRef, T as TransactionSubmission, d as TransactionConfirmation, C as ChainExecutor } from '../shared-DRmoLQfi.js';
|
|
2
2
|
|
|
3
3
|
interface ZcashWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { ClientConfig, Token, QuoteRequest as QuoteRequest$1, QuotePlan, LinkingIdentity, Login, Balance, ExecuteOptions, ExecutionSnapshot, ConfidentialApi, HttpApiConfig, QuoteResponse, AppFee, BalanceSnapshotEntry, FundingIdentity, SigningAdapter, SignedData, UnsignedData, FundingAdapter, SessionStore, ExecutionStore, PollingOptions, AddressValidator, WithdrawIntentContext, FundingSwapAdapter, HttpConfidentialApi as HttpConfidentialApi$1 } from '@rhea-finance/confidential-swap';
|
|
4
|
-
export { ConfidentialSwapError, MemoryExecutionStore, MemorySessionStore, balanceCanonicalKey, deriveConfidentialAccountId, findCreditedBalanceChange, isTransientPollError, resolveIntentsCreditAsset, resolveLinkingWallet, snapshotBalances, splitConfidentialRawAmount } from '@rhea-finance/confidential-swap';
|
|
5
|
-
export { createCheckedAdapter as createCheckedConfidentialSigningAdapter, createEvmSigningAdapter as createConfidentialEvmSigningAdapter, createNearSigningAdapter as createConfidentialNearSigningAdapter, createSolanaSigningAdapter as createConfidentialSolanaSigningAdapter, createTronSigningAdapter as createConfidentialTronSigningAdapter } from '@rhea-finance/confidential-swap/adapters';
|
|
1
|
+
import { i as SwapQuoteRequestRaw, j as SwapQuoteDataRaw, k as SwapBuildRequestRaw, l as SwapBuildDataRaw, m as SwapOrderSubmitRequestRaw, n as SwapOrderSubmitDataRaw, o as SwapOrderStatusParamsRaw, p as SwapOrderStatusDataRaw, q as SwapReportRequestRaw, r as SwapReportDataRaw, s as SwapHistoryParamsRaw, t as SwapHistoryDataRaw, u as SwapHistoryAuthChallengeRequestRaw, v as SwapHistoryAuthChallengeRaw, w as SwapHistoryAuthVerifyRequestRaw, x as SwapHistoryAuthTokenRaw, y as SwapFromTokensDataRaw, z as SwapCrossChainToTokensDataRaw, Q as QuoteRequest, A as Quote, B as SwapMcaPayloadRaw, W as WaitMode, O as OrderPollingOptions, D as SwapLifecycleEvent, F as SwapExecutionResult, e as ChainRef, G as AssetRef, H as BaseUnitAmount, I as SwapHistoryRecordRaw, C as ChainExecutor, J as ExecutorRegistry, K as SwapBuild, L as ExecuteSwapInput, M as SwapInput, P as OrderReference, R as OrderStatusResult, U as WaitForOrderInput, V as SwapHistoryAuthProofRaw, N as NearTransaction, X as SwapMcaRelayerRequestRaw } from './shared-DRmoLQfi.mjs';
|
|
2
|
+
export { ah as BuildContext, a7 as ChainExecutionResult, ad as DepositInfo, c as EvmApproval, b as EvmSigningRequest, a as EvmTx, a8 as ExecutionContext, aa as ExecutorIdentityProvider, ab as ExecutorMessageSigner, a9 as MessageSignOptions, a5 as OrderStatus, ag as RouteSummary, a4 as SignRequestPreview, S as SolanaMetadata, h as StarknetCall, Y as SwapApiResponse, Z as SwapApiTokenMetaRaw, a1 as SwapBuildApproveRaw, af as SwapExecution, a2 as SwapHistoryWalletChainFamilyRaw, $ as SwapMcaSignerPayloadRaw, ae as SwapReportContext, a0 as SwapSigningRequestRaw, _ as SwapTokenListRowRaw, a3 as SwapWarning, d as TransactionConfirmation, g as TronApproval, f as TronUnsignedTransaction, ac as assertBaseUnitAmount, a6 as normalizeOrderStatus } from './shared-DRmoLQfi.mjs';
|
|
6
3
|
|
|
7
4
|
type SwapErrorCode = "HTTP_ERROR" | "API_ERROR" | "RATE_LIMITED" | "AUTH_FAILED" | "REQUEST_ABORTED" | "REQUEST_TIMEOUT" | "INVALID_REQUEST" | "INVALID_API_RESPONSE" | "QUOTE_EXPIRED" | "ROUTE_NOT_FOUND" | "EXECUTOR_NOT_FOUND" | "UNSUPPORTED_CHAIN" | "CHAIN_MISMATCH" | "INVALID_TRANSACTION" | "USER_REJECTED" | "INSUFFICIENT_BALANCE" | "APPROVAL_FAILED" | "SIGNING_FAILED" | "BROADCAST_FAILED" | "ORDER_SUBMIT_FAILED" | "ORDER_TIMEOUT" | "REPORT_FAILED";
|
|
8
5
|
type SwapErrorStage = "quote" | "build" | "approve" | "sign" | "broadcast" | "submit" | "report" | "status" | "tokens" | "history";
|
|
@@ -71,7 +68,6 @@ declare class ApiClient {
|
|
|
71
68
|
verifyHistoryAuthChallenge(body: SwapHistoryAuthVerifyRequestRaw, options?: ApiRequestOptions): Promise<SwapHistoryAuthTokenRaw>;
|
|
72
69
|
getFromTokenRows(chainId: number, options?: ApiRequestOptions): Promise<SwapFromTokensDataRaw>;
|
|
73
70
|
getCrossChainToTokenRows(chainId: number, options?: ApiRequestOptions): Promise<SwapCrossChainToTokensDataRaw>;
|
|
74
|
-
getConfidentialAppFee(options?: ApiRequestOptions): Promise<SwapConfidentialAppFeeDataRaw>;
|
|
75
71
|
private request;
|
|
76
72
|
private requestOnce;
|
|
77
73
|
private buildUrl;
|
|
@@ -231,59 +227,6 @@ interface SwapTokenListItem extends AssetRef {
|
|
|
231
227
|
raw: Record<string, unknown>;
|
|
232
228
|
}
|
|
233
229
|
|
|
234
|
-
interface ConfidentialPreSwapConfig {
|
|
235
|
-
quoteWaitingTimeMs?: number;
|
|
236
|
-
sameChainTimeoutMs?: number;
|
|
237
|
-
crossChainTimeoutMs?: number;
|
|
238
|
-
/** Maps an Intents registry token to the chain and address accepted by v2. */
|
|
239
|
-
mapAsset?: (token: Token) => {
|
|
240
|
-
chain: string;
|
|
241
|
-
address: string;
|
|
242
|
-
} | undefined;
|
|
243
|
-
/** Included in the advanced funding report when the trade belongs to an MCA. */
|
|
244
|
-
multiAddress?: string | (() => string | undefined);
|
|
245
|
-
/** Defaults to `confidential-batch-withdraw`. */
|
|
246
|
-
txType?: string;
|
|
247
|
-
}
|
|
248
|
-
type ConfidentialSwapConfig = Omit<ClientConfig, "fundingSwapAdapter" | "getAppFees"> & {
|
|
249
|
-
/** Controls the v2 quote/build/execute leg used before confidential deposit. */
|
|
250
|
-
preSwap?: ConfidentialPreSwapConfig;
|
|
251
|
-
};
|
|
252
|
-
interface ConfidentialAppFeeConfig {
|
|
253
|
-
appId: string;
|
|
254
|
-
basisPoints: number;
|
|
255
|
-
recipient: string;
|
|
256
|
-
}
|
|
257
|
-
interface ConfidentialSwapInput extends ExecuteOptions {
|
|
258
|
-
plan: QuotePlan;
|
|
259
|
-
}
|
|
260
|
-
type ConfidentialSwapPreviewRequest = Omit<QuoteRequest$1, "linkingWallet"> & {
|
|
261
|
-
linkingWallet?: LinkingIdentity;
|
|
262
|
-
};
|
|
263
|
-
type ConfidentialToken = Token;
|
|
264
|
-
type ConfidentialProtocolApi = ConfidentialApi;
|
|
265
|
-
type ConfidentialHttpApiConfig = HttpApiConfig;
|
|
266
|
-
type ConfidentialQuoteRequest = QuoteRequest$1;
|
|
267
|
-
type ConfidentialQuotePlan = QuotePlan;
|
|
268
|
-
type ConfidentialQuoteResponse = QuoteResponse;
|
|
269
|
-
type ConfidentialExecutionSnapshot = ExecutionSnapshot;
|
|
270
|
-
type ConfidentialExecuteOptions = ExecuteOptions;
|
|
271
|
-
type ConfidentialAppFee = AppFee;
|
|
272
|
-
type ConfidentialBalance = Balance;
|
|
273
|
-
type ConfidentialBalanceSnapshotEntry = BalanceSnapshotEntry;
|
|
274
|
-
type ConfidentialLogin = Login;
|
|
275
|
-
type ConfidentialLinkingIdentity = LinkingIdentity;
|
|
276
|
-
type ConfidentialFundingIdentity = FundingIdentity;
|
|
277
|
-
type ConfidentialSigningAdapter = SigningAdapter;
|
|
278
|
-
type ConfidentialSignedData = SignedData;
|
|
279
|
-
type ConfidentialUnsignedData = UnsignedData;
|
|
280
|
-
type ConfidentialFundingAdapter = FundingAdapter;
|
|
281
|
-
type ConfidentialSessionStore = SessionStore;
|
|
282
|
-
type ConfidentialExecutionStore = ExecutionStore;
|
|
283
|
-
type ConfidentialPollingOptions = PollingOptions;
|
|
284
|
-
type ConfidentialAddressValidator = AddressValidator;
|
|
285
|
-
type ConfidentialWithdrawIntentContext = WithdrawIntentContext;
|
|
286
|
-
|
|
287
230
|
interface SwapClientConfig extends ApiClientConfig {
|
|
288
231
|
reportMode?: "auto" | "manual" | "disabled";
|
|
289
232
|
executors?: readonly ChainExecutor[];
|
|
@@ -291,8 +234,6 @@ interface SwapClientConfig extends ApiClientConfig {
|
|
|
291
234
|
now?: () => number;
|
|
292
235
|
/** Token-list cache lifetime in milliseconds. Defaults to 10 minutes; use 0 to disable. */
|
|
293
236
|
tokenListCacheTtlMs?: number;
|
|
294
|
-
/** Enables the complete confidential pre-swap, deposit and withdrawal flow. */
|
|
295
|
-
confidential?: ConfidentialSwapConfig;
|
|
296
237
|
}
|
|
297
238
|
interface BuildSwapInput {
|
|
298
239
|
quote: Quote;
|
|
@@ -301,7 +242,6 @@ interface BuildSwapInput {
|
|
|
301
242
|
}
|
|
302
243
|
declare class SwapClient {
|
|
303
244
|
private readonly managedSwapFlow;
|
|
304
|
-
private readonly confidentialSwapFlow?;
|
|
305
245
|
protected readonly api: ApiClient;
|
|
306
246
|
protected readonly registry: ExecutorRegistry;
|
|
307
247
|
protected readonly reportMode: "auto" | "manual" | "disabled";
|
|
@@ -312,23 +252,6 @@ declare class SwapClient {
|
|
|
312
252
|
private readonly tokenListCache;
|
|
313
253
|
private readonly tokenListInflight;
|
|
314
254
|
constructor(config: SwapClientConfig);
|
|
315
|
-
getConfidentialTokens(signal?: AbortSignal): Promise<ConfidentialToken[]>;
|
|
316
|
-
getConfidentialAppFee(options?: ApiRequestOptions): Promise<ConfidentialAppFeeConfig>;
|
|
317
|
-
quoteConfidentialSwap(request: ConfidentialQuoteRequest, options?: ApiRequestOptions): Promise<ConfidentialQuotePlan>;
|
|
318
|
-
previewConfidentialSwap(request: ConfidentialSwapPreviewRequest, options?: ApiRequestOptions): Promise<ConfidentialQuotePlan>;
|
|
319
|
-
prepareConfidentialSwap(plan: ConfidentialQuotePlan, options?: ApiRequestOptions): Promise<ConfidentialQuotePlan>;
|
|
320
|
-
authenticateConfidentialWallet(identity: ConfidentialLinkingIdentity, options?: ApiRequestOptions): Promise<ConfidentialLogin>;
|
|
321
|
-
logoutConfidentialWallet(identity: ConfidentialLinkingIdentity): Promise<void>;
|
|
322
|
-
requiresConfidentialAuthentication(identity: ConfidentialLinkingIdentity, options?: ApiRequestOptions): Promise<boolean>;
|
|
323
|
-
getConfidentialBalances(identity: ConfidentialLinkingIdentity, options?: ApiRequestOptions): Promise<ConfidentialBalance[]>;
|
|
324
|
-
confidentialSwap(input: ConfidentialSwapInput): Promise<ConfidentialExecutionSnapshot>;
|
|
325
|
-
resumeConfidentialSwap(executionId: string, options?: Omit<ConfidentialSwapInput, "plan">): Promise<ConfidentialExecutionSnapshot>;
|
|
326
|
-
getConfidentialExecution(executionId: string): Promise<ConfidentialExecutionSnapshot | undefined>;
|
|
327
|
-
listConfidentialExecutions(): Promise<ConfidentialExecutionSnapshot[]>;
|
|
328
|
-
listRecoverableConfidentialExecutions(): Promise<ConfidentialExecutionSnapshot[]>;
|
|
329
|
-
refreshConfidentialWithdrawalReview(executionId: string, options?: ApiRequestOptions): Promise<ConfidentialQuotePlan>;
|
|
330
|
-
discardPreparedConfidentialSwap(executionId: string): Promise<void>;
|
|
331
|
-
abandonInterruptedConfidentialSwap(executionId: string): Promise<void>;
|
|
332
255
|
quoteRaw(request: SwapQuoteRequestRaw, options?: ApiRequestOptions): Promise<SwapQuoteDataRaw>;
|
|
333
256
|
quote(request: McaQuoteRequest, options?: ApiRequestOptions): Promise<McaQuote>;
|
|
334
257
|
quote(request: QuoteRequest, options?: ApiRequestOptions): Promise<Quote>;
|
|
@@ -363,7 +286,6 @@ declare class SwapClient {
|
|
|
363
286
|
authorizeConfidentialHistory(request: SwapHistoryAuthChallengeRequestRaw, signChallenge: (challenge: SwapHistoryAuthChallengeRaw) => SwapHistoryAuthProofRaw | Promise<SwapHistoryAuthProofRaw>, options?: ApiRequestOptions): Promise<SwapHistoryAuthTokenRaw>;
|
|
364
287
|
getHistory(request: HistoryRequest, options?: ApiRequestOptions): Promise<SwapHistoryPage>;
|
|
365
288
|
protected emit(event: SwapLifecycleEvent): void;
|
|
366
|
-
private requireConfidentialSwapFlow;
|
|
367
289
|
private createReportRequest;
|
|
368
290
|
}
|
|
369
291
|
|
|
@@ -468,7 +390,7 @@ declare function buildMcaWithdrawRelayerRequest(input: BuildMcaWithdrawRelayerRe
|
|
|
468
390
|
declare function shouldPollSwapOrderStatus(input: {
|
|
469
391
|
waitFor?: WaitMode;
|
|
470
392
|
isCrossChain: boolean;
|
|
471
|
-
|
|
393
|
+
requiresOrderStatus?: boolean;
|
|
472
394
|
/** Present when POST /crosschain/swap/report returned a history row id. */
|
|
473
395
|
reportRecordId?: string;
|
|
474
396
|
}): boolean;
|
|
@@ -495,11 +417,19 @@ declare function resolveSourceTxHash(input: {
|
|
|
495
417
|
declare function parseUnits(value: string, decimals: number): BaseUnitAmount;
|
|
496
418
|
declare function formatUnits(value: BaseUnitAmount, decimals: number): string;
|
|
497
419
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
420
|
+
interface SwapQuoteReview {
|
|
421
|
+
amountInUsd?: number;
|
|
422
|
+
amountOutUsd?: number;
|
|
423
|
+
/** Loss relative to the source USD estimate, as a percentage. */
|
|
424
|
+
priceImpactPercent?: number;
|
|
425
|
+
networkFeeUsd?: number;
|
|
426
|
+
estimatedSeconds?: number;
|
|
427
|
+
sourceTransactionCount?: number;
|
|
428
|
+
approvalMayBeRequired?: boolean;
|
|
429
|
+
}
|
|
430
|
+
/** Only values actually supplied by the quote service are presented as estimates. */
|
|
431
|
+
declare function describeSwapQuote(quote: Quote): SwapQuoteReview;
|
|
432
|
+
/** Validate the destination using the selected mainnet chain's address rules. */
|
|
433
|
+
declare function isValidSwapRecipientAddress(chain: ChainRef, value: string): boolean;
|
|
504
434
|
|
|
505
|
-
export { ApiClient, type ApiClientConfig, type ApiRequestOptions, AssetRef, BaseUnitAmount, type BuildMcaWithdrawRelayerRequestInput, type BuildNearMcaWithdrawTransactionsInput, type BuildSwapInput, ChainExecutor, ChainRef,
|
|
435
|
+
export { ApiClient, type ApiClientConfig, type ApiRequestOptions, AssetRef, BaseUnitAmount, type BuildMcaWithdrawRelayerRequestInput, type BuildNearMcaWithdrawTransactionsInput, type BuildSwapInput, ChainExecutor, ChainRef, DEFAULT_MCA_SIGNER_PRIORITY, DEFAULT_SWAP_REFERRAL, ExecuteSwapInput, ExecutorRegistry, type ExtractMcaWithdrawDepositAddressInput, type HistoryRequest, type HistoryStatus, type McaDepositCollateral, type McaDepositQuote, type McaDepositQuoteRequest, type McaFlow, type McaQuote, type McaQuoteRequest, type McaSignerChain, type McaSignerIdentity, type McaSwapInput, type McaSwapResult, type McaWalletDescriptor, type McaWalletKey, type McaWithdrawCollateral, type McaWithdrawNearQuote, type McaWithdrawQuoteRequest, type McaWithdrawRelayerQuote, NearTransaction, OrderPollingOptions, OrderReference, type OrderStatusLookup, OrderStatusResult, PRIVATE_API_BASE_URL, PRODUCTION_API_BASE_URL, Quote, QuoteRequest, type ResolveMcaRequiredCollateralDecreaseInput, type ResolveMcaWithdrawPolicyInput, type SdkLogEntry, type SdkLogLevel, type SdkLogger, SwapBuild, SwapBuildDataRaw, SwapBuildRequestRaw, SwapClient, type SwapClientConfig, SwapCrossChainToTokensDataRaw, type SwapErrorCode, type SwapErrorStage, SwapExecutionResult, SwapFromTokensDataRaw, SwapHistoryAuthChallengeRaw, SwapHistoryAuthChallengeRequestRaw, SwapHistoryAuthProofRaw, SwapHistoryAuthTokenRaw, SwapHistoryAuthVerifyRequestRaw, SwapHistoryDataRaw, type SwapHistoryItem, type SwapHistoryPage, SwapHistoryParamsRaw, SwapHistoryRecordRaw, SwapInput, SwapLifecycleEvent, SwapMcaPayloadRaw, SwapMcaRelayerRequestRaw, SwapOrderStatusDataRaw, SwapOrderStatusParamsRaw, SwapOrderSubmitDataRaw, SwapOrderSubmitRequestRaw, SwapQuoteDataRaw, SwapQuoteRequestRaw, type SwapQuoteReview, SwapReportDataRaw, SwapReportRequestRaw, SwapSdkError, type SwapSdkErrorOptions, type SwapTokenListItem, type TokenListRequest, WaitForOrderInput, WaitMode, asSwapSdkError, assertOrderStatusParams, buildMcaWithdrawRelayerRequest, buildNearMcaWithdrawTransactions, buildOrderStatusQuery, createExecutionId, describeSwapQuote, extractMcaWithdrawBusiness, extractMcaWithdrawDepositAddress, extractMcaWithdrawSignerWallet, formatMcaWallet, formatUnits, fromApiChain, isSameMcaSignerIdentity, isSdkCatchLoggingEnabled, isValidSwapRecipientAddress, logSdkCaughtError, normalizeBuild, normalizeCrossChainToTokenList, normalizeFromTokenList, normalizeHistory, normalizeHistoryStatus, normalizeMcaQuote, normalizeQuote, orderStatusParamsFromHistoryItem, parseUnits, resolveMcaDecreaseCollateral, resolveMcaRequiredCollateralDecrease, resolveMcaWithdrawPolicy, resolveOrderStatusLookup, resolveSourceTxHash, resolveSwapReportRecordId, selectMcaSigner, serializeMcaQuoteRequest, serializeQuoteRequest, setSdkCatchLogging, shouldPollSwapOrderStatus, toApiAssetAddress, toApiChain };
|