@rhea-finance/cross-chain-aggregation-dex 2.0.3 → 2.0.5
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 +84 -10
- 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/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/solana.d.mts +1 -1
- package/dist/executors/solana.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 +45 -5
- package/dist/index.d.ts +45 -5
- package/dist/index.js +198 -57
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +197 -58
- package/dist/index.mjs.map +1 -1
- package/dist/{shared-BEZXY_BM.d.mts → shared-DmMJXknE.d.mts} +62 -3
- package/dist/{shared-BEZXY_BM.d.ts → shared-DmMJXknE.d.ts} +62 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -192,6 +192,8 @@ The build normalizer accepts EVM chain IDs as numbers, decimal strings, or JSON-
|
|
|
192
192
|
|
|
193
193
|
### 3.2 Create a SwapClient
|
|
194
194
|
|
|
195
|
+
To request API access and an API key, sign in to the [RHEA Boss portal](https://boss.rhea.finance/#/login). Provide the issued credential through `apiKey` for a static credential or `getAccessToken` when your application refreshes access tokens.
|
|
196
|
+
|
|
195
197
|
```ts
|
|
196
198
|
import { SwapClient } from "@rhea-finance/cross-chain-aggregation-dex";
|
|
197
199
|
|
|
@@ -239,7 +241,38 @@ const quoteRequest: QuoteRequest = {
|
|
|
239
241
|
const quote = await client.quote(quoteRequest);
|
|
240
242
|
```
|
|
241
243
|
|
|
242
|
-
`quote()` calls `POST /api/swap/quote`. `quoteWaitingTimeMs`
|
|
244
|
+
`quote()` calls `POST /api/swap/quote`. The frontend can set `quoteWaitingTimeMs` on every `QuoteRequest` to control how long the quote service may wait for Near Intents and similar intent-based routes. The SDK sends `3000` when the field is omitted.
|
|
245
|
+
|
|
246
|
+
Set `confidentiality: "basic"` 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:
|
|
247
|
+
|
|
248
|
+
```ts
|
|
249
|
+
const confidentialQuote = await client.quote({
|
|
250
|
+
...quoteRequest,
|
|
251
|
+
confidentiality: "basic",
|
|
252
|
+
});
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### 3.3.1 Configure the Near Intents quote wait
|
|
256
|
+
|
|
257
|
+
`quoteWaitingTimeMs` is a first-class SDK parameter. Pass it directly to `client.quote()`; do not put it in `extensions` or an executor configuration.
|
|
258
|
+
|
|
259
|
+
```ts
|
|
260
|
+
// Frontend: allow Near Intents up to 5 seconds to return a route quote.
|
|
261
|
+
const quote = await client.quote({
|
|
262
|
+
...quoteRequest,
|
|
263
|
+
quoteWaitingTimeMs: 5000,
|
|
264
|
+
});
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
| Rule | Detail |
|
|
268
|
+
| --- | --- |
|
|
269
|
+
| Who sets it | The frontend or any other SDK caller, on each `client.quote(request)` call. |
|
|
270
|
+
| Unit and range | Milliseconds; must be a non-negative integer. |
|
|
271
|
+
| Default | `3000` (3 seconds) when omitted. Pass it explicitly when the product needs to control the Near Intents latency/route-availability tradeoff. |
|
|
272
|
+
| Typical use | Increase it, for example to `5000`–`10000`, when Near Intents needs more time to return a quote. Decrease it, for example to `0`–`1000`, when a faster response is more important than waiting for that route. |
|
|
273
|
+
| Scope | Quote aggregation for intent-based routes such as `nearintents` and `preswap-nearintents`. It also applies to MCA deposit/withdraw quote requests whose Near Intents previews are produced by the same quote call. |
|
|
274
|
+
|
|
275
|
+
This value limits the server-side route-quote wait only. It does **not** control the SDK HTTP request timeout, wallet signing, source-chain confirmation, bridge settlement, or `waitFor: "completed"` order polling. If the frontend configures a value close to or above the client's `timeoutMs`, increase `timeoutMs` enough to include the quote wait plus network overhead; otherwise the HTTP request may time out first.
|
|
243
276
|
|
|
244
277
|
### 3.4 Execute the swap directly
|
|
245
278
|
|
|
@@ -315,7 +348,7 @@ Terminal statuses are `completed`, `failed`, `refunded`, and `expired`.
|
|
|
315
348
|
| Field | Type | Required | Description and default |
|
|
316
349
|
| --- | --- | --- | --- |
|
|
317
350
|
| `baseUrl` | `string` | Yes | API base URL, for example `https://api.rhea.finance`. A trailing `/` is removed. |
|
|
318
|
-
| `apiKey` | `string` | No | API credential sent with requests. |
|
|
351
|
+
| `apiKey` | `string` | No | Static API credential sent with requests. Request one through the [RHEA Boss portal](https://boss.rhea.finance/#/login). |
|
|
319
352
|
| `getAccessToken` | `() => string \| Promise<string>` | No | Reads an access token before each request. Use this for refreshable sessions. |
|
|
320
353
|
| `fetch` | `typeof globalThis.fetch` | No | Custom fetch implementation. The SDK binds its invocation context to avoid browser `Illegal invocation` errors. It is normally required on Node.js 16. |
|
|
321
354
|
| `headers` | `Record<string,string>` or function | No | Additional request headers. The function form may return a promise. |
|
|
@@ -350,7 +383,8 @@ Terminal statuses are `completed`, `failed`, `refunded`, and `expired`.
|
|
|
350
383
|
| `tokenOut` | `AssetRef` | Yes | Asset being received. |
|
|
351
384
|
| `amountIn` | `string` | Yes | A non-negative base-unit decimal integer string. Do not pass `"1.5"` or scientific notation. |
|
|
352
385
|
| `slippageBps` | `number` | Yes | Slippage in basis points. `50` means 0.5%; `100` means 1%. |
|
|
353
|
-
| `quoteWaitingTimeMs` | `number` | No |
|
|
386
|
+
| `quoteWaitingTimeMs` | `number` | No | **Frontend-configurable Near Intents quote wait.** Milliseconds; must be a non-negative integer. Default: `3000`. See [Configure the Near Intents quote wait](#331-configure-the-near-intents-quote-wait). |
|
|
387
|
+
| `confidentiality` | `"basic"` | No | Enables the confidential 1Click route and marks the resulting report. Omit for public swaps. |
|
|
354
388
|
| `sender` | `string` | Yes | Sender address on the source chain. |
|
|
355
389
|
| `recipient` | `string` | No | Recipient address on the destination chain. Cross-chain requests should normally provide it explicitly. |
|
|
356
390
|
| `extensions` | `Record<string,unknown>` | No | Additional fields forwarded to the API. Regular applications should not use this to replace standard fields. |
|
|
@@ -555,6 +589,16 @@ const result = await client.swap({ quote, waitFor: "completed" });
|
|
|
555
589
|
### Withdraw
|
|
556
590
|
|
|
557
591
|
```ts
|
|
592
|
+
import { resolveMcaWithdrawPolicy } from "@rhea-finance/cross-chain-aggregation-dex";
|
|
593
|
+
|
|
594
|
+
const collateral = resolveMcaWithdrawPolicy({
|
|
595
|
+
amountBurrow, // requested withdraw in Burrow internal decimals
|
|
596
|
+
suppliedBalance, // current token supplied balance, same decimals
|
|
597
|
+
availableBalance, // human/display precision, matching amountInHuman
|
|
598
|
+
amountIn: amountInHuman,
|
|
599
|
+
isMax,
|
|
600
|
+
});
|
|
601
|
+
|
|
558
602
|
const quote = await client.quote({
|
|
559
603
|
flow: "withdraw",
|
|
560
604
|
mcaAccountId: "account.near",
|
|
@@ -567,11 +611,7 @@ const quote = await client.quote({
|
|
|
567
611
|
slippageBps: 50,
|
|
568
612
|
sender: "account.near",
|
|
569
613
|
recipient: "0xYourBaseAddress",
|
|
570
|
-
collateral
|
|
571
|
-
needDecrease: true,
|
|
572
|
-
decreaseAmountBurrow: "1.0",
|
|
573
|
-
withdrawAll: false,
|
|
574
|
-
},
|
|
614
|
+
collateral,
|
|
575
615
|
executionPreference: "relayer",
|
|
576
616
|
});
|
|
577
617
|
|
|
@@ -588,14 +628,16 @@ Withdraw-only fields:
|
|
|
588
628
|
|
|
589
629
|
| Field | Type | Required | Description |
|
|
590
630
|
| --- | --- | --- | --- |
|
|
591
|
-
| `collateral.needDecrease` | `boolean` |
|
|
592
|
-
| `collateral.decreaseAmountBurrow` | `string` | Yes |
|
|
631
|
+
| `collateral.needDecrease` | `boolean` | No | Compatibility hint only. The SDK derives the API value from `decreaseAmountBurrow` and corrects contradictory input. |
|
|
632
|
+
| `collateral.decreaseAmountBurrow` | `string` | Yes | Required collateral decrease in Burrow decimals: `max(amountBurrow - suppliedBalance, 0)`. The SDK canonicalizes the value and sends `"0"` when supplied balance covers the withdrawal. |
|
|
593
633
|
| `collateral.withdrawAll` | `boolean` | No | Whether to withdraw the full available amount. |
|
|
594
634
|
| `executionPreference` | `"auto" \| "near" \| "relayer"` | No | Default: `"auto"`. Set explicitly to force direct NEAR or relayer execution. |
|
|
595
635
|
| `boundNearAccountId` | `string` | Required for automatic NEAR selection | In `auto` mode, direct NEAR execution is selected only when `toChain === "near"` and `recipient` exactly matches this field. Otherwise, the relayer is selected. |
|
|
596
636
|
|
|
597
637
|
For direct NEAR execution, the NEAR executor submits `nearMcaWithdrawTx`. For relayer execution, the executor selected by `signerChain` uses `signMessage()` to sign the API-provided `messageToSign`, after which the SDK submits the order. Application code only calls `swap()`.
|
|
598
638
|
|
|
639
|
+
Derive the collateral policy from the same balances displayed by the application, as shown above. This mirrors Lending Withdraw and multi-chain Trade's 2026-08-20 withdraw fix: `decreaseCollateralAmountBurrow = max(amountBurrow - suppliedBalance, 0)`, and `needDecreaseCollateral` is true exactly when that result is positive. When relayer gas is reserved, use the supplied balance from the gas-adjusted portfolio snapshot, matching the amount used for the quote. `withdrawAll` remains an independent Max/available-balance decision.
|
|
640
|
+
|
|
599
641
|
## 9. Lifecycle, errors, and cancellation
|
|
600
642
|
|
|
601
643
|
Lifecycle events can be observed globally on the client or for an individual swap:
|
|
@@ -678,6 +720,8 @@ await client.buildRaw(rawBuildRequest);
|
|
|
678
720
|
await client.submitOrderRaw(rawSubmitRequest);
|
|
679
721
|
await client.getOrderStatusRaw(rawStatusRequest);
|
|
680
722
|
await client.reportRaw(rawReportRequest);
|
|
723
|
+
await client.createHistoryAuthChallenge(rawChallengeRequest);
|
|
724
|
+
await client.verifyHistoryAuthChallenge(rawVerifyRequest);
|
|
681
725
|
await client.getHistoryRaw(rawHistoryRequest);
|
|
682
726
|
```
|
|
683
727
|
|
|
@@ -710,6 +754,36 @@ const history = await client.getHistory({
|
|
|
710
754
|
|
|
711
755
|
The SDK applies `status` filtering locally. The returned page has `filteredLocally: true`.
|
|
712
756
|
|
|
757
|
+
For confidential history, authorize the connected wallet, then query with the returned short-lived token:
|
|
758
|
+
|
|
759
|
+
```ts
|
|
760
|
+
const authorization = await client.authorizeConfidentialHistory(
|
|
761
|
+
{
|
|
762
|
+
chainFamily: "evm",
|
|
763
|
+
chainId: "1",
|
|
764
|
+
walletAddress: connectedAddress,
|
|
765
|
+
// Include mcaAccountId when authorizing an MCA principal.
|
|
766
|
+
},
|
|
767
|
+
async (challenge) => {
|
|
768
|
+
// Check the wallet/network has not changed, then sign exactly this message.
|
|
769
|
+
const signature = await signer.signMessage(
|
|
770
|
+
challenge.signingInput.message
|
|
771
|
+
);
|
|
772
|
+
return { signature };
|
|
773
|
+
}
|
|
774
|
+
);
|
|
775
|
+
|
|
776
|
+
const confidentialHistory = await client.getHistory({
|
|
777
|
+
sender: authorization.queryAddress,
|
|
778
|
+
mode: "confidential",
|
|
779
|
+
walletToken: authorization.token,
|
|
780
|
+
page: 1,
|
|
781
|
+
pageSize: 20,
|
|
782
|
+
});
|
|
783
|
+
```
|
|
784
|
+
|
|
785
|
+
The callback returns the wallet-specific proof required by `challenge.signingMethod`; NEP-413 and other chain families may require additional proof fields. `authorizeConfidentialHistory()` validates that the challenge and verified token refer to the requested principal before returning them. The SDK sends the normal API credential in `Authorization` and the wallet token separately in `Authentication`. Public history omits `mode` and `walletToken`.
|
|
786
|
+
|
|
713
787
|
## 12. Amount utilities
|
|
714
788
|
|
|
715
789
|
Avoid JavaScript floating-point arithmetic for token amounts:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aa as ExecutorErrorAdapter, C as ChainRef, ab as TransactionSubmission, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.mjs';
|
|
2
2
|
|
|
3
3
|
interface AptosWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aa as ExecutorErrorAdapter, C as ChainRef, ab as TransactionSubmission, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.js';
|
|
2
2
|
|
|
3
3
|
interface AptosWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aa as ExecutorErrorAdapter, C as ChainRef, ab as TransactionSubmission, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.mjs';
|
|
2
2
|
|
|
3
3
|
interface BitcoinWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aa as ExecutorErrorAdapter, C as ChainRef, ab as TransactionSubmission, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.js';
|
|
2
2
|
|
|
3
3
|
interface BitcoinWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/evm.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aa as ExecutorErrorAdapter, a0 as EvmTx, ab as TransactionSubmission, a2 as EvmSigningRequest, a1 as EvmApproval, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.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 { aa as ExecutorErrorAdapter, a0 as EvmTx, ab as TransactionSubmission, a2 as EvmSigningRequest, a1 as EvmApproval, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.js';
|
|
2
2
|
|
|
3
3
|
interface EvmWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
sendTransaction(tx: EvmTx, options: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aa as ExecutorErrorAdapter, C as ChainRef, N as NearTransaction, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.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 { aa as ExecutorErrorAdapter, C as ChainRef, N as NearTransaction, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.js';
|
|
2
2
|
|
|
3
3
|
interface NearWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aa as ExecutorErrorAdapter, C as ChainRef, a3 as SolanaMetadata, ab as TransactionSubmission, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.mjs';
|
|
2
2
|
|
|
3
3
|
interface SolanaWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aa as ExecutorErrorAdapter, C as ChainRef, a3 as SolanaMetadata, ab as TransactionSubmission, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.js';
|
|
2
2
|
|
|
3
3
|
interface SolanaWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/sui.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aa as ExecutorErrorAdapter, C as ChainRef, ab as TransactionSubmission, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.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 { aa as ExecutorErrorAdapter, C as ChainRef, ab as TransactionSubmission, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.js';
|
|
2
2
|
|
|
3
3
|
interface SuiWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aa as ExecutorErrorAdapter, C as ChainRef, ab as TransactionSubmission, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.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 { aa as ExecutorErrorAdapter, C as ChainRef, ab as TransactionSubmission, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.js';
|
|
2
2
|
|
|
3
3
|
interface TronWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aa as ExecutorErrorAdapter, C as ChainRef, ab as TransactionSubmission, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.mjs';
|
|
2
2
|
|
|
3
3
|
interface ZcashWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aa as ExecutorErrorAdapter, C as ChainRef, ab as TransactionSubmission, T as TransactionConfirmation, u as ChainExecutor } from '../shared-DmMJXknE.js';
|
|
2
2
|
|
|
3
3
|
interface ZcashWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SwapQuoteRequestRaw, a as SwapQuoteDataRaw, b as SwapBuildRequestRaw, c as SwapBuildDataRaw, d as SwapOrderSubmitRequestRaw, e as SwapOrderSubmitDataRaw, f as SwapOrderStatusParamsRaw, g as SwapOrderStatusDataRaw, h as SwapReportRequestRaw, i as SwapReportDataRaw, j as SwapHistoryParamsRaw, k as SwapHistoryDataRaw, Q as QuoteRequest,
|
|
2
|
-
export {
|
|
1
|
+
import { S as SwapQuoteRequestRaw, a as SwapQuoteDataRaw, b as SwapBuildRequestRaw, c as SwapBuildDataRaw, d as SwapOrderSubmitRequestRaw, e as SwapOrderSubmitDataRaw, f as SwapOrderStatusParamsRaw, g as SwapOrderStatusDataRaw, h as SwapReportRequestRaw, i as SwapReportDataRaw, j as SwapHistoryParamsRaw, k as SwapHistoryDataRaw, l as SwapHistoryAuthChallengeRequestRaw, m as SwapHistoryAuthChallengeRaw, n as SwapHistoryAuthVerifyRequestRaw, o as SwapHistoryAuthTokenRaw, Q as QuoteRequest, p as Quote, q as SwapMcaPayloadRaw, W as WaitMode, O as OrderPollingOptions, r as SwapLifecycleEvent, s as SwapExecutionResult, C as ChainRef, A as AssetRef, B as BaseUnitAmount, t as SwapHistoryRecordRaw, u as ChainExecutor, E as ExecutorRegistry, v as SwapBuild, w as ExecuteSwapInput, x as SwapInput, y as OrderStatusResult, z as WaitForOrderInput, D as SwapHistoryAuthProofRaw, N as NearTransaction, F as SwapMcaRelayerRequestRaw } from './shared-DmMJXknE.mjs';
|
|
2
|
+
export { a9 as BuildContext, V as ChainExecutionResult, a5 as DepositInfo, a1 as EvmApproval, a2 as EvmSigningRequest, a0 as EvmTx, X as ExecutionContext, Z as ExecutorIdentityProvider, _ as ExecutorMessageSigner, Y as MessageSignOptions, a4 as OrderReference, R as OrderStatus, a8 as RouteSummary, P as SignRequestPreview, a3 as SolanaMetadata, G as SwapApiResponse, H as SwapApiTokenMetaRaw, K as SwapBuildApproveRaw, a7 as SwapExecution, L as SwapHistoryWalletChainFamilyRaw, I as SwapMcaSignerPayloadRaw, a6 as SwapReportContext, J as SwapSigningRequestRaw, M as SwapWarning, T as TransactionConfirmation, $ as assertBaseUnitAmount, U as normalizeOrderStatus } from './shared-DmMJXknE.mjs';
|
|
3
3
|
|
|
4
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";
|
|
5
5
|
type SwapErrorStage = "quote" | "build" | "approve" | "sign" | "broadcast" | "submit" | "report" | "status" | "history";
|
|
@@ -66,6 +66,8 @@ declare class ApiClient {
|
|
|
66
66
|
getOrderStatus(params: SwapOrderStatusParamsRaw, options?: ApiRequestOptions): Promise<SwapOrderStatusDataRaw>;
|
|
67
67
|
report(body: SwapReportRequestRaw, options?: ApiRequestOptions): Promise<SwapReportDataRaw>;
|
|
68
68
|
getHistory(params: SwapHistoryParamsRaw, options?: ApiRequestOptions): Promise<SwapHistoryDataRaw>;
|
|
69
|
+
createHistoryAuthChallenge(body: SwapHistoryAuthChallengeRequestRaw, options?: ApiRequestOptions): Promise<SwapHistoryAuthChallengeRaw>;
|
|
70
|
+
verifyHistoryAuthChallenge(body: SwapHistoryAuthVerifyRequestRaw, options?: ApiRequestOptions): Promise<SwapHistoryAuthTokenRaw>;
|
|
69
71
|
private request;
|
|
70
72
|
private requestOnce;
|
|
71
73
|
private buildUrl;
|
|
@@ -89,7 +91,14 @@ interface McaDepositCollateral {
|
|
|
89
91
|
useAsCollateral: boolean;
|
|
90
92
|
}
|
|
91
93
|
interface McaWithdrawCollateral {
|
|
92
|
-
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated The SDK derives this value from decreaseAmountBurrow.
|
|
96
|
+
*
|
|
97
|
+
* Compatibility hint. The SDK derives the API's needDecreaseCollateral
|
|
98
|
+
* from decreaseAmountBurrow so contradictory values cannot be sent.
|
|
99
|
+
*/
|
|
100
|
+
needDecrease?: boolean;
|
|
101
|
+
/** Required collateral decrease: max(amountBurrow - suppliedBalance, 0). */
|
|
93
102
|
decreaseAmountBurrow: string;
|
|
94
103
|
withdrawAll?: boolean;
|
|
95
104
|
}
|
|
@@ -159,6 +168,10 @@ interface HistoryRequest {
|
|
|
159
168
|
page?: number;
|
|
160
169
|
pageSize?: number;
|
|
161
170
|
status?: HistoryStatus[];
|
|
171
|
+
/** Queries wallet-authorized confidential history. */
|
|
172
|
+
mode?: "confidential";
|
|
173
|
+
/** Token returned by the confidential history auth verify endpoint. */
|
|
174
|
+
walletToken?: string;
|
|
162
175
|
}
|
|
163
176
|
interface SwapHistoryPage {
|
|
164
177
|
items: SwapHistoryItem[];
|
|
@@ -236,6 +249,9 @@ declare class SwapClient {
|
|
|
236
249
|
report(result: SwapExecutionResult): Promise<SwapReportDataRaw>;
|
|
237
250
|
retryReport(result: SwapExecutionResult): Promise<SwapReportDataRaw>;
|
|
238
251
|
getHistoryRaw(params: SwapHistoryParamsRaw, options?: ApiRequestOptions): Promise<SwapHistoryDataRaw>;
|
|
252
|
+
createHistoryAuthChallenge(request: SwapHistoryAuthChallengeRequestRaw, options?: ApiRequestOptions): Promise<SwapHistoryAuthChallengeRaw>;
|
|
253
|
+
verifyHistoryAuthChallenge(request: SwapHistoryAuthVerifyRequestRaw, options?: ApiRequestOptions): Promise<SwapHistoryAuthTokenRaw>;
|
|
254
|
+
authorizeConfidentialHistory(request: SwapHistoryAuthChallengeRequestRaw, signChallenge: (challenge: SwapHistoryAuthChallengeRaw) => SwapHistoryAuthProofRaw | Promise<SwapHistoryAuthProofRaw>, options?: ApiRequestOptions): Promise<SwapHistoryAuthTokenRaw>;
|
|
239
255
|
getHistory(request: HistoryRequest, options?: ApiRequestOptions): Promise<SwapHistoryPage>;
|
|
240
256
|
protected emit(event: SwapLifecycleEvent): void;
|
|
241
257
|
private assertQuoteFresh;
|
|
@@ -256,14 +272,38 @@ declare function serializeQuoteRequest(request: QuoteRequest): SwapQuoteRequestR
|
|
|
256
272
|
declare function normalizeQuote(request: QuoteRequest, raw: SwapQuoteDataRaw, receivedAt?: number): Quote;
|
|
257
273
|
|
|
258
274
|
interface ResolveMcaWithdrawPolicyInput {
|
|
259
|
-
|
|
275
|
+
/** Requested withdraw amount in Burrow internal decimals. */
|
|
276
|
+
amountBurrow: string;
|
|
277
|
+
/** Current supplied balance for the token in Burrow internal decimals. */
|
|
278
|
+
suppliedBalance: string;
|
|
260
279
|
availableBalance: string;
|
|
280
|
+
/** Human/display withdraw amount, in the same precision as availableBalance. */
|
|
261
281
|
amountIn: string;
|
|
262
282
|
isMax: boolean;
|
|
263
283
|
}
|
|
264
284
|
declare function resolveMcaWithdrawPolicy(input: ResolveMcaWithdrawPolicyInput): McaWithdrawCollateral & {
|
|
285
|
+
needDecrease: boolean;
|
|
265
286
|
withdrawAll: boolean;
|
|
266
287
|
};
|
|
288
|
+
interface ResolveMcaRequiredCollateralDecreaseInput {
|
|
289
|
+
amountBurrow: string;
|
|
290
|
+
suppliedBalance: string;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Matches Lending Withdraw and multi-chain-lending's 2026-08-20 hotfix:
|
|
294
|
+
* only the part of the requested withdraw that exceeds supplied balance must
|
|
295
|
+
* be removed from collateral.
|
|
296
|
+
*/
|
|
297
|
+
declare function resolveMcaRequiredCollateralDecrease(input: ResolveMcaRequiredCollateralDecreaseInput): Pick<McaWithdrawCollateral, "needDecrease" | "decreaseAmountBurrow"> & {
|
|
298
|
+
needDecrease: boolean;
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* Derive needDecreaseCollateral from an already-computed required decrease and
|
|
302
|
+
* serialize it in canonical, non-exponential decimal form.
|
|
303
|
+
*/
|
|
304
|
+
declare function resolveMcaDecreaseCollateral(decreaseAmountBurrow: string, field?: string): Pick<McaWithdrawCollateral, "needDecrease" | "decreaseAmountBurrow"> & {
|
|
305
|
+
needDecrease: boolean;
|
|
306
|
+
};
|
|
267
307
|
|
|
268
308
|
declare function serializeMcaQuoteRequest(request: McaQuoteRequest, signer: McaSignerIdentity): SwapQuoteRequestRaw;
|
|
269
309
|
declare function normalizeMcaQuote(request: McaQuoteRequest, signer: McaSignerIdentity, quote: Quote): McaQuote;
|
|
@@ -304,4 +344,4 @@ declare function buildMcaWithdrawRelayerRequest(input: BuildMcaWithdrawRelayerRe
|
|
|
304
344
|
declare function parseUnits(value: string, decimals: number): BaseUnitAmount;
|
|
305
345
|
declare function formatUnits(value: BaseUnitAmount, decimals: number): string;
|
|
306
346
|
|
|
307
|
-
export { ApiClient, type ApiClientConfig, type ApiRequestOptions, AssetRef, BaseUnitAmount, type BuildMcaWithdrawRelayerRequestInput, type BuildNearMcaWithdrawTransactionsInput, type BuildSwapInput, ChainExecutor, ChainRef, DEFAULT_MCA_SIGNER_PRIORITY, 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, OrderStatusResult, Quote, QuoteRequest, type ResolveMcaWithdrawPolicyInput, type RetryConfig, type SdkLogEntry, type SdkLogLevel, type SdkLogger, SwapBuild, SwapBuildDataRaw, SwapBuildRequestRaw, SwapClient, type SwapClientConfig, type SwapErrorCode, type SwapErrorStage, SwapExecutionResult, SwapHistoryDataRaw, type SwapHistoryItem, type SwapHistoryPage, SwapHistoryParamsRaw, SwapHistoryRecordRaw, SwapInput, SwapLifecycleEvent, SwapMcaPayloadRaw, SwapMcaRelayerRequestRaw, SwapOrderStatusDataRaw, SwapOrderStatusParamsRaw, SwapOrderSubmitDataRaw, SwapOrderSubmitRequestRaw, SwapQuoteDataRaw, SwapQuoteRequestRaw, SwapReportDataRaw, SwapReportRequestRaw, SwapSdkError, type SwapSdkErrorOptions, WaitForOrderInput, WaitMode, asSwapSdkError, buildMcaWithdrawRelayerRequest, buildNearMcaWithdrawTransactions, createExecutionId, extractMcaWithdrawBusiness, extractMcaWithdrawDepositAddress, extractMcaWithdrawSignerWallet, formatMcaWallet, formatUnits, fromApiChain, isSameMcaSignerIdentity, normalizeBuild, normalizeHistory, normalizeHistoryStatus, normalizeMcaQuote, normalizeQuote, parseUnits, resolveMcaWithdrawPolicy, selectMcaSigner, serializeMcaQuoteRequest, serializeQuoteRequest, toApiAssetAddress, toApiChain };
|
|
347
|
+
export { ApiClient, type ApiClientConfig, type ApiRequestOptions, AssetRef, BaseUnitAmount, type BuildMcaWithdrawRelayerRequestInput, type BuildNearMcaWithdrawTransactionsInput, type BuildSwapInput, ChainExecutor, ChainRef, DEFAULT_MCA_SIGNER_PRIORITY, 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, OrderStatusResult, Quote, QuoteRequest, type ResolveMcaRequiredCollateralDecreaseInput, type ResolveMcaWithdrawPolicyInput, type RetryConfig, type SdkLogEntry, type SdkLogLevel, type SdkLogger, SwapBuild, SwapBuildDataRaw, SwapBuildRequestRaw, SwapClient, type SwapClientConfig, type SwapErrorCode, type SwapErrorStage, SwapExecutionResult, SwapHistoryAuthChallengeRaw, SwapHistoryAuthChallengeRequestRaw, SwapHistoryAuthProofRaw, SwapHistoryAuthTokenRaw, SwapHistoryAuthVerifyRequestRaw, SwapHistoryDataRaw, type SwapHistoryItem, type SwapHistoryPage, SwapHistoryParamsRaw, SwapHistoryRecordRaw, SwapInput, SwapLifecycleEvent, SwapMcaPayloadRaw, SwapMcaRelayerRequestRaw, SwapOrderStatusDataRaw, SwapOrderStatusParamsRaw, SwapOrderSubmitDataRaw, SwapOrderSubmitRequestRaw, SwapQuoteDataRaw, SwapQuoteRequestRaw, SwapReportDataRaw, SwapReportRequestRaw, SwapSdkError, type SwapSdkErrorOptions, WaitForOrderInput, WaitMode, asSwapSdkError, buildMcaWithdrawRelayerRequest, buildNearMcaWithdrawTransactions, createExecutionId, extractMcaWithdrawBusiness, extractMcaWithdrawDepositAddress, extractMcaWithdrawSignerWallet, formatMcaWallet, formatUnits, fromApiChain, isSameMcaSignerIdentity, normalizeBuild, normalizeHistory, normalizeHistoryStatus, normalizeMcaQuote, normalizeQuote, parseUnits, resolveMcaDecreaseCollateral, resolveMcaRequiredCollateralDecrease, resolveMcaWithdrawPolicy, selectMcaSigner, serializeMcaQuoteRequest, serializeQuoteRequest, toApiAssetAddress, toApiChain };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SwapQuoteRequestRaw, a as SwapQuoteDataRaw, b as SwapBuildRequestRaw, c as SwapBuildDataRaw, d as SwapOrderSubmitRequestRaw, e as SwapOrderSubmitDataRaw, f as SwapOrderStatusParamsRaw, g as SwapOrderStatusDataRaw, h as SwapReportRequestRaw, i as SwapReportDataRaw, j as SwapHistoryParamsRaw, k as SwapHistoryDataRaw, Q as QuoteRequest,
|
|
2
|
-
export {
|
|
1
|
+
import { S as SwapQuoteRequestRaw, a as SwapQuoteDataRaw, b as SwapBuildRequestRaw, c as SwapBuildDataRaw, d as SwapOrderSubmitRequestRaw, e as SwapOrderSubmitDataRaw, f as SwapOrderStatusParamsRaw, g as SwapOrderStatusDataRaw, h as SwapReportRequestRaw, i as SwapReportDataRaw, j as SwapHistoryParamsRaw, k as SwapHistoryDataRaw, l as SwapHistoryAuthChallengeRequestRaw, m as SwapHistoryAuthChallengeRaw, n as SwapHistoryAuthVerifyRequestRaw, o as SwapHistoryAuthTokenRaw, Q as QuoteRequest, p as Quote, q as SwapMcaPayloadRaw, W as WaitMode, O as OrderPollingOptions, r as SwapLifecycleEvent, s as SwapExecutionResult, C as ChainRef, A as AssetRef, B as BaseUnitAmount, t as SwapHistoryRecordRaw, u as ChainExecutor, E as ExecutorRegistry, v as SwapBuild, w as ExecuteSwapInput, x as SwapInput, y as OrderStatusResult, z as WaitForOrderInput, D as SwapHistoryAuthProofRaw, N as NearTransaction, F as SwapMcaRelayerRequestRaw } from './shared-DmMJXknE.js';
|
|
2
|
+
export { a9 as BuildContext, V as ChainExecutionResult, a5 as DepositInfo, a1 as EvmApproval, a2 as EvmSigningRequest, a0 as EvmTx, X as ExecutionContext, Z as ExecutorIdentityProvider, _ as ExecutorMessageSigner, Y as MessageSignOptions, a4 as OrderReference, R as OrderStatus, a8 as RouteSummary, P as SignRequestPreview, a3 as SolanaMetadata, G as SwapApiResponse, H as SwapApiTokenMetaRaw, K as SwapBuildApproveRaw, a7 as SwapExecution, L as SwapHistoryWalletChainFamilyRaw, I as SwapMcaSignerPayloadRaw, a6 as SwapReportContext, J as SwapSigningRequestRaw, M as SwapWarning, T as TransactionConfirmation, $ as assertBaseUnitAmount, U as normalizeOrderStatus } from './shared-DmMJXknE.js';
|
|
3
3
|
|
|
4
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";
|
|
5
5
|
type SwapErrorStage = "quote" | "build" | "approve" | "sign" | "broadcast" | "submit" | "report" | "status" | "history";
|
|
@@ -66,6 +66,8 @@ declare class ApiClient {
|
|
|
66
66
|
getOrderStatus(params: SwapOrderStatusParamsRaw, options?: ApiRequestOptions): Promise<SwapOrderStatusDataRaw>;
|
|
67
67
|
report(body: SwapReportRequestRaw, options?: ApiRequestOptions): Promise<SwapReportDataRaw>;
|
|
68
68
|
getHistory(params: SwapHistoryParamsRaw, options?: ApiRequestOptions): Promise<SwapHistoryDataRaw>;
|
|
69
|
+
createHistoryAuthChallenge(body: SwapHistoryAuthChallengeRequestRaw, options?: ApiRequestOptions): Promise<SwapHistoryAuthChallengeRaw>;
|
|
70
|
+
verifyHistoryAuthChallenge(body: SwapHistoryAuthVerifyRequestRaw, options?: ApiRequestOptions): Promise<SwapHistoryAuthTokenRaw>;
|
|
69
71
|
private request;
|
|
70
72
|
private requestOnce;
|
|
71
73
|
private buildUrl;
|
|
@@ -89,7 +91,14 @@ interface McaDepositCollateral {
|
|
|
89
91
|
useAsCollateral: boolean;
|
|
90
92
|
}
|
|
91
93
|
interface McaWithdrawCollateral {
|
|
92
|
-
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated The SDK derives this value from decreaseAmountBurrow.
|
|
96
|
+
*
|
|
97
|
+
* Compatibility hint. The SDK derives the API's needDecreaseCollateral
|
|
98
|
+
* from decreaseAmountBurrow so contradictory values cannot be sent.
|
|
99
|
+
*/
|
|
100
|
+
needDecrease?: boolean;
|
|
101
|
+
/** Required collateral decrease: max(amountBurrow - suppliedBalance, 0). */
|
|
93
102
|
decreaseAmountBurrow: string;
|
|
94
103
|
withdrawAll?: boolean;
|
|
95
104
|
}
|
|
@@ -159,6 +168,10 @@ interface HistoryRequest {
|
|
|
159
168
|
page?: number;
|
|
160
169
|
pageSize?: number;
|
|
161
170
|
status?: HistoryStatus[];
|
|
171
|
+
/** Queries wallet-authorized confidential history. */
|
|
172
|
+
mode?: "confidential";
|
|
173
|
+
/** Token returned by the confidential history auth verify endpoint. */
|
|
174
|
+
walletToken?: string;
|
|
162
175
|
}
|
|
163
176
|
interface SwapHistoryPage {
|
|
164
177
|
items: SwapHistoryItem[];
|
|
@@ -236,6 +249,9 @@ declare class SwapClient {
|
|
|
236
249
|
report(result: SwapExecutionResult): Promise<SwapReportDataRaw>;
|
|
237
250
|
retryReport(result: SwapExecutionResult): Promise<SwapReportDataRaw>;
|
|
238
251
|
getHistoryRaw(params: SwapHistoryParamsRaw, options?: ApiRequestOptions): Promise<SwapHistoryDataRaw>;
|
|
252
|
+
createHistoryAuthChallenge(request: SwapHistoryAuthChallengeRequestRaw, options?: ApiRequestOptions): Promise<SwapHistoryAuthChallengeRaw>;
|
|
253
|
+
verifyHistoryAuthChallenge(request: SwapHistoryAuthVerifyRequestRaw, options?: ApiRequestOptions): Promise<SwapHistoryAuthTokenRaw>;
|
|
254
|
+
authorizeConfidentialHistory(request: SwapHistoryAuthChallengeRequestRaw, signChallenge: (challenge: SwapHistoryAuthChallengeRaw) => SwapHistoryAuthProofRaw | Promise<SwapHistoryAuthProofRaw>, options?: ApiRequestOptions): Promise<SwapHistoryAuthTokenRaw>;
|
|
239
255
|
getHistory(request: HistoryRequest, options?: ApiRequestOptions): Promise<SwapHistoryPage>;
|
|
240
256
|
protected emit(event: SwapLifecycleEvent): void;
|
|
241
257
|
private assertQuoteFresh;
|
|
@@ -256,14 +272,38 @@ declare function serializeQuoteRequest(request: QuoteRequest): SwapQuoteRequestR
|
|
|
256
272
|
declare function normalizeQuote(request: QuoteRequest, raw: SwapQuoteDataRaw, receivedAt?: number): Quote;
|
|
257
273
|
|
|
258
274
|
interface ResolveMcaWithdrawPolicyInput {
|
|
259
|
-
|
|
275
|
+
/** Requested withdraw amount in Burrow internal decimals. */
|
|
276
|
+
amountBurrow: string;
|
|
277
|
+
/** Current supplied balance for the token in Burrow internal decimals. */
|
|
278
|
+
suppliedBalance: string;
|
|
260
279
|
availableBalance: string;
|
|
280
|
+
/** Human/display withdraw amount, in the same precision as availableBalance. */
|
|
261
281
|
amountIn: string;
|
|
262
282
|
isMax: boolean;
|
|
263
283
|
}
|
|
264
284
|
declare function resolveMcaWithdrawPolicy(input: ResolveMcaWithdrawPolicyInput): McaWithdrawCollateral & {
|
|
285
|
+
needDecrease: boolean;
|
|
265
286
|
withdrawAll: boolean;
|
|
266
287
|
};
|
|
288
|
+
interface ResolveMcaRequiredCollateralDecreaseInput {
|
|
289
|
+
amountBurrow: string;
|
|
290
|
+
suppliedBalance: string;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Matches Lending Withdraw and multi-chain-lending's 2026-08-20 hotfix:
|
|
294
|
+
* only the part of the requested withdraw that exceeds supplied balance must
|
|
295
|
+
* be removed from collateral.
|
|
296
|
+
*/
|
|
297
|
+
declare function resolveMcaRequiredCollateralDecrease(input: ResolveMcaRequiredCollateralDecreaseInput): Pick<McaWithdrawCollateral, "needDecrease" | "decreaseAmountBurrow"> & {
|
|
298
|
+
needDecrease: boolean;
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* Derive needDecreaseCollateral from an already-computed required decrease and
|
|
302
|
+
* serialize it in canonical, non-exponential decimal form.
|
|
303
|
+
*/
|
|
304
|
+
declare function resolveMcaDecreaseCollateral(decreaseAmountBurrow: string, field?: string): Pick<McaWithdrawCollateral, "needDecrease" | "decreaseAmountBurrow"> & {
|
|
305
|
+
needDecrease: boolean;
|
|
306
|
+
};
|
|
267
307
|
|
|
268
308
|
declare function serializeMcaQuoteRequest(request: McaQuoteRequest, signer: McaSignerIdentity): SwapQuoteRequestRaw;
|
|
269
309
|
declare function normalizeMcaQuote(request: McaQuoteRequest, signer: McaSignerIdentity, quote: Quote): McaQuote;
|
|
@@ -304,4 +344,4 @@ declare function buildMcaWithdrawRelayerRequest(input: BuildMcaWithdrawRelayerRe
|
|
|
304
344
|
declare function parseUnits(value: string, decimals: number): BaseUnitAmount;
|
|
305
345
|
declare function formatUnits(value: BaseUnitAmount, decimals: number): string;
|
|
306
346
|
|
|
307
|
-
export { ApiClient, type ApiClientConfig, type ApiRequestOptions, AssetRef, BaseUnitAmount, type BuildMcaWithdrawRelayerRequestInput, type BuildNearMcaWithdrawTransactionsInput, type BuildSwapInput, ChainExecutor, ChainRef, DEFAULT_MCA_SIGNER_PRIORITY, 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, OrderStatusResult, Quote, QuoteRequest, type ResolveMcaWithdrawPolicyInput, type RetryConfig, type SdkLogEntry, type SdkLogLevel, type SdkLogger, SwapBuild, SwapBuildDataRaw, SwapBuildRequestRaw, SwapClient, type SwapClientConfig, type SwapErrorCode, type SwapErrorStage, SwapExecutionResult, SwapHistoryDataRaw, type SwapHistoryItem, type SwapHistoryPage, SwapHistoryParamsRaw, SwapHistoryRecordRaw, SwapInput, SwapLifecycleEvent, SwapMcaPayloadRaw, SwapMcaRelayerRequestRaw, SwapOrderStatusDataRaw, SwapOrderStatusParamsRaw, SwapOrderSubmitDataRaw, SwapOrderSubmitRequestRaw, SwapQuoteDataRaw, SwapQuoteRequestRaw, SwapReportDataRaw, SwapReportRequestRaw, SwapSdkError, type SwapSdkErrorOptions, WaitForOrderInput, WaitMode, asSwapSdkError, buildMcaWithdrawRelayerRequest, buildNearMcaWithdrawTransactions, createExecutionId, extractMcaWithdrawBusiness, extractMcaWithdrawDepositAddress, extractMcaWithdrawSignerWallet, formatMcaWallet, formatUnits, fromApiChain, isSameMcaSignerIdentity, normalizeBuild, normalizeHistory, normalizeHistoryStatus, normalizeMcaQuote, normalizeQuote, parseUnits, resolveMcaWithdrawPolicy, selectMcaSigner, serializeMcaQuoteRequest, serializeQuoteRequest, toApiAssetAddress, toApiChain };
|
|
347
|
+
export { ApiClient, type ApiClientConfig, type ApiRequestOptions, AssetRef, BaseUnitAmount, type BuildMcaWithdrawRelayerRequestInput, type BuildNearMcaWithdrawTransactionsInput, type BuildSwapInput, ChainExecutor, ChainRef, DEFAULT_MCA_SIGNER_PRIORITY, 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, OrderStatusResult, Quote, QuoteRequest, type ResolveMcaRequiredCollateralDecreaseInput, type ResolveMcaWithdrawPolicyInput, type RetryConfig, type SdkLogEntry, type SdkLogLevel, type SdkLogger, SwapBuild, SwapBuildDataRaw, SwapBuildRequestRaw, SwapClient, type SwapClientConfig, type SwapErrorCode, type SwapErrorStage, SwapExecutionResult, SwapHistoryAuthChallengeRaw, SwapHistoryAuthChallengeRequestRaw, SwapHistoryAuthProofRaw, SwapHistoryAuthTokenRaw, SwapHistoryAuthVerifyRequestRaw, SwapHistoryDataRaw, type SwapHistoryItem, type SwapHistoryPage, SwapHistoryParamsRaw, SwapHistoryRecordRaw, SwapInput, SwapLifecycleEvent, SwapMcaPayloadRaw, SwapMcaRelayerRequestRaw, SwapOrderStatusDataRaw, SwapOrderStatusParamsRaw, SwapOrderSubmitDataRaw, SwapOrderSubmitRequestRaw, SwapQuoteDataRaw, SwapQuoteRequestRaw, SwapReportDataRaw, SwapReportRequestRaw, SwapSdkError, type SwapSdkErrorOptions, WaitForOrderInput, WaitMode, asSwapSdkError, buildMcaWithdrawRelayerRequest, buildNearMcaWithdrawTransactions, createExecutionId, extractMcaWithdrawBusiness, extractMcaWithdrawDepositAddress, extractMcaWithdrawSignerWallet, formatMcaWallet, formatUnits, fromApiChain, isSameMcaSignerIdentity, normalizeBuild, normalizeHistory, normalizeHistoryStatus, normalizeMcaQuote, normalizeQuote, parseUnits, resolveMcaDecreaseCollateral, resolveMcaRequiredCollateralDecrease, resolveMcaWithdrawPolicy, selectMcaSigner, serializeMcaQuoteRequest, serializeQuoteRequest, toApiAssetAddress, toApiChain };
|