@zyfai/sdk 0.10.0 → 0.12.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/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { Chain, PublicClient, Address as Address$1 } from 'viem';
3
3
  /**
4
4
  * Public TypeScript types for `@zyfai/sdk` request/response shapes and events.
5
5
  */
6
+
6
7
  /** Checksummed Ethereum address. */
7
8
  type Address = `0x${string}`;
8
9
  /** Hex-encoded byte string (e.g. signatures, calldata). */
@@ -615,12 +616,122 @@ interface DepositResponse {
615
616
  smartWallet: string;
616
617
  /** Deposited amount in least units (decimal string). */
617
618
  amount: string;
619
+ /**
620
+ * How the collateral reached the Safe.
621
+ * `direct` transfers the collateral itself. `swap` converts another token
622
+ * through Relay. `wrap` turns same-chain native ETH into WETH, then transfers it.
623
+ */
624
+ route?: "direct" | "swap" | "wrap";
625
+ /** Relay funding order id when `route` is `swap`. */
626
+ orderId?: string;
618
627
  /**
619
628
  * Deposit lifecycle record. After `sendDeposit`, status is usually
620
629
  * `handover_pending` until {@link ZyfaiSDK.waitForDepositCredit} completes.
621
630
  */
622
631
  registration: DepositLifecycleResponse;
623
632
  }
633
+ /**
634
+ * Spend a token that is not already the destination collateral.
635
+ * The execution API quotes Relay; the connected wallet signs the steps.
636
+ */
637
+ interface SwapDepositParams {
638
+ /** Funding wallet EOA. */
639
+ userAddress: string;
640
+ /** Chain the spent token is on. May differ from the deposit chain. */
641
+ originChainId: number;
642
+ /** Spent token contract. The zero address is native ETH. */
643
+ originCurrency: string;
644
+ /** Spend amount in the origin token's least units. */
645
+ originAmount: string;
646
+ /** Chain the collateral should arrive on. */
647
+ destinationChainId: SupportedChainId;
648
+ /**
649
+ * Collateral Relay should deliver (`USDC`, `WETH`, `EURC`, `cbBTC`, …).
650
+ * The server resolves the contract.
651
+ */
652
+ destinationAsset: string;
653
+ /** Optional first-deposit {@link Strategy}. */
654
+ strategy?: Strategy;
655
+ /**
656
+ * Max slippage tolerance in basis points (default 200; max 500).
657
+ * Stored on the funding order at quote time. Ignored when `orderId` is set;
658
+ * the stored order's value is used on sign.
659
+ */
660
+ slippageBps?: number;
661
+ /**
662
+ * Existing review quote to sign. Origin chain, origin token, destination
663
+ * chain, and destination asset must match that order. Omit to create a new
664
+ * funding order.
665
+ */
666
+ orderId?: string;
667
+ }
668
+ /** Review quote for a Relay swap deposit. The wallet has not signed yet. */
669
+ interface SwapDepositQuote {
670
+ orderId: string;
671
+ status: string;
672
+ spend: string;
673
+ expectedOutput: string;
674
+ minimumOutput: string;
675
+ destinationChainId: number;
676
+ destinationCurrency: string;
677
+ destinationAsset: string;
678
+ fees: {
679
+ name?: string;
680
+ amount?: string;
681
+ amountUsd?: string;
682
+ }[];
683
+ investEligible: boolean;
684
+ expiresAt: string | null;
685
+ timeEstimate?: number | null;
686
+ }
687
+ /** Stored Relay funding order, including any linked deposit lifecycle. */
688
+ interface SwapDepositOrder {
689
+ id: string;
690
+ status: string;
691
+ depositId: string | null;
692
+ sourceTxHashes: string[];
693
+ destinationTxHashes: string[];
694
+ /** Chain the spent token is on. */
695
+ originChainId: number;
696
+ /** Spent token contract stored with the order. */
697
+ originCurrency: string;
698
+ destinationChainId: number;
699
+ destinationCurrency: string;
700
+ destinationAsset: string;
701
+ minimumOutput: string | null;
702
+ providerStatus?: string | null;
703
+ lastError?: string | null;
704
+ }
705
+ /**
706
+ * `sendDeposit` input. Omit `spendToken` to transfer `asset` on `chainId`.
707
+ * Set `spendToken` when the wallet holds a different token or chain.
708
+ */
709
+ interface SendDepositParams {
710
+ userAddress: string;
711
+ /** Chain the collateral should arrive on. */
712
+ chainId: SupportedChainId;
713
+ /** Collateral that should land in the Safe. */
714
+ asset: string;
715
+ /**
716
+ * Least units of the token being spent.
717
+ * For a direct deposit this is the collateral amount.
718
+ */
719
+ amount: string;
720
+ strategy?: Strategy;
721
+ /**
722
+ * Token the wallet spends. A collateral symbol or its contract on `chainId`
723
+ * stays a direct deposit. Anything else is swapped into `asset`.
724
+ */
725
+ spendToken?: string;
726
+ /** Chain the spend token is on. Defaults to `chainId`. */
727
+ spendChainId?: number;
728
+ /**
729
+ * Max slippage tolerance in basis points when this call swaps (default 200;
730
+ * max 500). Ignored for a direct transfer or a same-chain ETH wrap.
731
+ * Fixed when the funding order is created.
732
+ */
733
+ slippageBps?: number;
734
+ }
624
735
  /**
625
736
  * Custody handover and balance-credit states for a registered deposit.
626
737
  *
@@ -665,6 +776,42 @@ interface WithdrawLifecycleResponse {
665
776
  statusUrl: string;
666
777
  estimatedClaimAt?: string | null;
667
778
  }
779
+ /** Base Merkl campaign slots served by the data API. */
780
+ type BaseMerklCampaignId = "base" | "base-new-tvl" | "base/rzfi";
781
+ /** A Zyfai Merkl incentive campaign on Base, from {@link ZyfaiSDK.getBaseMerklCampaigns}. */
782
+ interface MerklCampaign {
783
+ id: BaseMerklCampaignId;
784
+ name: string;
785
+ /** Current campaign APR as a decimal (0.011 = 1.1%), on top of strategy yield. */
786
+ apr: number;
787
+ tvlUsd: number;
788
+ activeWallets: number;
789
+ rewardToken: Address;
790
+ totalRewards: number;
791
+ dailyRewardAmount: number;
792
+ startDate: string;
793
+ endDate: string;
794
+ /** True while now is between startDate and endDate. */
795
+ isActive: boolean;
796
+ }
797
+ /**
798
+ * Two-step rZFI claim state from {@link ZyfaiSDK.prepareRzfiClaim} and
799
+ * {@link ZyfaiSDK.submitRzfiClaim}.
800
+ */
801
+ interface RzfiClaimResponse {
802
+ success: boolean;
803
+ status: "pending" | "claimed";
804
+ /** Safe that receives the rZFI (Base). */
805
+ safeAddress: Address;
806
+ /** rZFI being claimed, in wei (18 decimals). */
807
+ claimableAmount: string;
808
+ /** Present when pending: sign with the owner EOA (personal_sign of the raw hash). */
809
+ userOpHashToSign?: Hex;
810
+ /** Present when pending: the userOperation behind the hash, for verification. */
811
+ userOperation?: Record<string, unknown>;
812
+ /** Present when claimed. */
813
+ txHash?: Hex;
814
+ }
668
815
  interface LogDepositResponse {
669
816
  success: boolean;
670
817
  message: string;
@@ -1041,20 +1188,6 @@ type DailyApyHistoryPeriod = `${AllowedHistoryDays}D`;
1041
1188
  * Zyfai SDK Main Class
1042
1189
  */
1043
1190
 
1044
- /**
1045
- * Client for Zyfai execution (`api.zyf.ai`) and intelligence (`defiapi.zyf.ai`) APIs.
1046
- *
1047
- * @remarks
1048
- * The connected wallet from {@link ZyfaiSDK.connectAccount} is used for **signing only**
1049
- * (SIWE, on-chain transfers). Pass the user's **EOA** as `userAddress` on execution
1050
- * methods; the backend resolves the assigned Safe.
1051
- *
1052
- * First-time onboarding uses predeployed Safes: {@link ZyfaiSDK.sendDeposit} handles
1053
- * session and deploy-on-first-deposit without {@link ZyfaiSDK.deploySafe} or
1054
- * {@link ZyfaiSDK.createSessionKey}.
1055
- *
1056
- * @see {@link https://docs.zyf.ai/docs/sdk/agent-quickstart | Agent quickstart}
1057
- */
1058
1191
  declare class ZyfaiSDK {
1059
1192
  private httpClient;
1060
1193
  private signer;
@@ -1581,14 +1714,14 @@ declare class ZyfaiSDK {
1581
1714
  status: string;
1582
1715
  }>;
1583
1716
  /**
1584
- * Transfer funds from the connected EOA to the user's Safe and register the deposit.
1717
+ * Transfer a collateral token the wallet already holds into the Safe.
1585
1718
  *
1586
1719
  * @remarks
1587
- * Execution API + on-chain ERC-20 `transfer`. Confirms the transaction, then calls
1588
- * {@link ZyfaiSDK.logDeposit}. Pair with {@link ZyfaiSDK.waitForDepositCredit} for
1589
- * investable balance. Custom-wallet flows: {@link ZyfaiSDK.buildDepositTransfer},
1590
- * {@link ZyfaiSDK.logDeposit}, {@link ZyfaiSDK.getDepositStatus}.
1720
+ * Use this when the connected wallet holds the strategy collateral on the
1721
+ * deposit chain. {@link ZyfaiSDK.sendDeposit} calls this automatically in
1722
+ * that case. A different token uses {@link ZyfaiSDK.sendSwapDeposit}.
1591
1723
  *
1724
+ * Confirms the ERC-20 `transfer`, then calls {@link ZyfaiSDK.logDeposit}.
1592
1725
  * Requires {@link ZyfaiSDK.connectAccount}. Pass the **EOA** as `userAddress`.
1593
1726
  *
1594
1727
  * @group Deposits and withdrawals
@@ -1596,20 +1729,178 @@ declare class ZyfaiSDK {
1596
1729
  * @param userAddress - Owner EOA (not the Safe)
1597
1730
  * @param chainId - Chain for the transfer
1598
1731
  * @param amount - Amount in least units (string integer)
1599
- * @param asset - Asset symbol (`USDC`, `WETH`, `EURC`, `NVDAc`)
1732
+ * @param asset - Collateral symbol (`USDC`, `WETH`, `EURC`, `NVDAc`)
1600
1733
  * @param strategy - Optional first-deposit {@link Strategy}
1601
- * @returns Transfer receipt and deposit registration (not yet credited until polled)
1734
+ * @returns Transfer receipt and deposit registration
1602
1735
  *
1603
- * @throws If validation fails, minimum portfolio is not met, Safe is unavailable, or transfer/register fails
1736
+ * @throws If validation fails, the minimum portfolio is not met, the Safe is unavailable, or transfer/register fails
1737
+ *
1738
+ * @see {@link ZyfaiSDK.sendDeposit}
1604
1739
  *
1605
1740
  * @example
1606
1741
  * ```typescript
1607
1742
  * await sdk.connectAccount(provider);
1608
- * const sent = await sdk.sendDeposit(eoa, 8453, "10000000", "USDC", "conservative");
1609
- * await sdk.waitForDepositCredit(sent.registration.id, 8453);
1743
+ * const sent = await sdk.sendDirectDeposit(eoa, 8453, "10000000", "USDC", "conservative");
1744
+ * await sdk.waitForDepositPosition(sent.registration.id, 8453);
1745
+ * ```
1746
+ */
1747
+ sendDirectDeposit(userAddress: string, chainId: SupportedChainId, amount: string, asset: string, strategy?: Strategy): Promise<DepositResponse>;
1748
+ /**
1749
+ * Fund the Safe with a collateral the wallet already holds, or swap another token into it.
1750
+ *
1751
+ * @remarks
1752
+ * The positional call is unchanged: `asset` must be a collateral symbol, and
1753
+ * the wallet transfers that token on `chainId`.
1754
+ *
1755
+ * The object form spends `spendToken`. When that token is the destination
1756
+ * collateral on `chainId`, this is a direct deposit. Any other token is
1757
+ * quoted through Relay and delivered as `asset`. Same-chain native ETH into
1758
+ * WETH is wrapped in the wallet, because Relay rejects that pair.
1759
+ * Optional `slippageBps` on a swap defaults to 200 (max 500) and is fixed
1760
+ * when the funding order is created.
1761
+ *
1762
+ * Requires {@link ZyfaiSDK.connectAccount}. Pass the **EOA** as `userAddress`.
1763
+ * Follow with {@link ZyfaiSDK.waitForDepositPosition} when the caller should
1764
+ * wait until the deposit is allocated.
1765
+ *
1766
+ * @group Deposits and withdrawals
1767
+ *
1768
+ * @param userAddress - Owner EOA, or a {@link SendDepositParams} object
1769
+ * @param chainId - Deposit chain when using the positional form
1770
+ * @param amount - Least units of the token being spent
1771
+ * @param asset - Collateral that should land in the Safe
1772
+ * @param strategy - Optional first-deposit {@link Strategy}
1773
+ * @returns Transfer receipt and deposit registration
1774
+ *
1775
+ * @throws If the route cannot be quoted, the transfer fails, or registration fails
1776
+ *
1777
+ * @example
1778
+ * ```typescript
1779
+ * await sdk.connectAccount(provider);
1780
+ * // Wallet already holds USDC on Base.
1781
+ * const direct = await sdk.sendDeposit(eoa, 8453, "10000000", "USDC");
1782
+ *
1783
+ * // Wallet holds a different token. Relay delivers USDC to the Safe.
1784
+ * const swapped = await sdk.sendDeposit({
1785
+ * userAddress: eoa,
1786
+ * chainId: 8453,
1787
+ * asset: "USDC",
1788
+ * amount: "1000000000000000000",
1789
+ * spendToken: "0xTokenOnBase",
1790
+ * });
1791
+ * await sdk.waitForDepositPosition(swapped.registration.id, 8453);
1610
1792
  * ```
1611
1793
  */
1612
1794
  sendDeposit(userAddress: string, chainId: SupportedChainId, amount: string, asset: string, strategy?: Strategy): Promise<DepositResponse>;
1795
+ sendDeposit(params: SendDepositParams): Promise<DepositResponse>;
1796
+ /**
1797
+ * Resolve a deposit without signing.
1798
+ *
1799
+ * @remarks
1800
+ * A collateral the wallet already holds on `chainId` returns `route: "direct"`.
1801
+ * Same-chain native ETH into WETH returns `route: "wrap"`. Any other spend
1802
+ * token returns a Relay review quote (`route: "swap"`). Nothing is signed.
1803
+ * Optional `slippageBps` (default 200, max 500) is stored on that funding
1804
+ * order and reused when the quote is refreshed for signing.
1805
+ *
1806
+ * @group Deposits and withdrawals
1807
+ *
1808
+ * @param params - Destination collateral and optional spend token
1809
+ * @returns The route, and a review quote when a swap is required
1810
+ *
1811
+ * @throws If the spend token or destination collateral is not supported
1812
+ */
1813
+ quoteDeposit(params: SendDepositParams): Promise<{
1814
+ route: "direct" | "wrap";
1815
+ asset: string;
1816
+ chainId: SupportedChainId;
1817
+ amount: string;
1818
+ } | ({
1819
+ route: "swap";
1820
+ } & SwapDepositQuote)>;
1821
+ /**
1822
+ * Quote a Relay swap that delivers a collateral token to the Safe.
1823
+ *
1824
+ * @remarks
1825
+ * Creates a funding order on the execution API. The connected wallet does
1826
+ * not sign. Pass `orderId` to {@link ZyfaiSDK.sendSwapDeposit} to sign the
1827
+ * refreshed quote, or call {@link ZyfaiSDK.sendDeposit} to quote and sign
1828
+ * in one step.
1829
+ *
1830
+ * Same-chain native ETH into WETH is rejected here. Use {@link ZyfaiSDK.sendDeposit}
1831
+ * with `spendToken: "ETH"`, which wraps in the wallet.
1832
+ *
1833
+ * Optional `slippageBps` defaults to 200 (max 500) and is fixed when this
1834
+ * funding order is created. Sign-time refresh reuses the stored value.
1835
+ *
1836
+ * @group Deposits and withdrawals
1837
+ *
1838
+ * @param params - Origin token, destination collateral, and funding wallet
1839
+ * @returns Review quote. Not yet signed.
1840
+ *
1841
+ * @throws If the server rejects the pair, the amount, or the quote
1842
+ */
1843
+ quoteSwapDeposit(params: SwapDepositParams): Promise<SwapDepositQuote>;
1844
+ /**
1845
+ * Read a Relay funding order, including a linked deposit once credit starts.
1846
+ *
1847
+ * @group Deposits and withdrawals
1848
+ *
1849
+ * @param orderId - Id from {@link ZyfaiSDK.quoteSwapDeposit}
1850
+ * @returns Stored order
1851
+ *
1852
+ * @throws If `orderId` is missing
1853
+ */
1854
+ getSwapDeposit(orderId: string): Promise<SwapDepositOrder>;
1855
+ /**
1856
+ * Swap or bridge a token into a Zyfai collateral, then register the deposit.
1857
+ *
1858
+ * @remarks
1859
+ * The execution API quotes Relay with the Safe as recipient. This method
1860
+ * refreshes that quote, signs the steps with the connected wallet, waits
1861
+ * for the collateral transfer into the Safe, and calls {@link ZyfaiSDK.logDeposit}.
1862
+ * Credit still requires that verified transfer. A refund or failed fill does
1863
+ * not register a deposit.
1864
+ *
1865
+ * Requires {@link ZyfaiSDK.connectAccount}. Origin chains other than
1866
+ * Ethereum, Base, and Arbitrum need an EIP-1193 wallet that can sign there.
1867
+ *
1868
+ * Optional `slippageBps` defaults to 200 (max 500) and is fixed when the
1869
+ * funding order is created. A later call that passes `orderId` ignores
1870
+ * `slippageBps` and signs the stored order.
1871
+ *
1872
+ * @group Deposits and withdrawals
1873
+ *
1874
+ * @param params - Origin token and destination collateral
1875
+ * @returns Destination transfer and deposit registration
1876
+ *
1877
+ * @throws If the quote, signature, fill, or registration fails, or if
1878
+ * `orderId` names a funding order whose origin or destination differs from
1879
+ * this call
1880
+ *
1881
+ * @see {@link ZyfaiSDK.sendDeposit}
1882
+ *
1883
+ * @example
1884
+ * ```typescript
1885
+ * await sdk.connectAccount(provider);
1886
+ * const sent = await sdk.sendSwapDeposit({
1887
+ * userAddress: eoa,
1888
+ * originChainId: 42161,
1889
+ * originCurrency: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
1890
+ * originAmount: "10000000",
1891
+ * destinationChainId: 8453,
1892
+ * destinationAsset: "WETH",
1893
+ * });
1894
+ * ```
1895
+ */
1896
+ sendSwapDeposit(params: SwapDepositParams): Promise<DepositResponse>;
1897
+ private sendRoutedDeposit;
1898
+ /** Portfolio floor used by a direct deposit, applied before a wrap or swap spends. */
1899
+ private assertCollateralMinimum;
1900
+ private assertSwapDepositParams;
1901
+ private walletClientForOrigin;
1902
+ private wrapNativeEth;
1903
+ private waitForRelayCreditTx;
1613
1904
  /**
1614
1905
  * @deprecated Compatibility convenience method. Prefer {@link ZyfaiSDK.sendDeposit} followed by
1615
1906
  * {@link ZyfaiSDK.waitForDepositCredit} when the caller owns the completion UX.
@@ -1648,6 +1939,37 @@ declare class ZyfaiSDK {
1648
1939
  data: Hex;
1649
1940
  value: "0";
1650
1941
  }>;
1942
+ /**
1943
+ * Prepare a gas-sponsored rZFI claim into the user's Safe on Base.
1944
+ *
1945
+ * @remarks
1946
+ * The SDK never signs. Sign `userOpHashToSign` with the owner EOA as a
1947
+ * personal_sign of the raw 32-byte hash (viem:
1948
+ * `signMessage({ message: { raw: userOpHashToSign } })`), then pass the
1949
+ * signature to {@link ZyfaiSDK.submitRzfiClaim} within 5 minutes.
1950
+ * Requires an authenticated user session.
1951
+ *
1952
+ * @group Rewards
1953
+ *
1954
+ * @param userAddress - Owner EOA
1955
+ * @returns `status: "pending"` with the hash to sign and the amount
1956
+ *
1957
+ * @throws If there is no rZFI to claim, or the reward tree is updating (retry later)
1958
+ */
1959
+ prepareRzfiClaim(userAddress: string): Promise<RzfiClaimResponse>;
1960
+ /**
1961
+ * Submit the owner-signed rZFI claim prepared by {@link ZyfaiSDK.prepareRzfiClaim}.
1962
+ *
1963
+ * @group Rewards
1964
+ *
1965
+ * @param userAddress - Owner EOA
1966
+ * @param userOpSignature - Owner EOA signature over `userOpHashToSign`
1967
+ * @returns `status: "claimed"` with the on-chain `txHash`
1968
+ *
1969
+ * @throws If the signature is not the owner's, the claim expired, or it reverted
1970
+ */
1971
+ submitRzfiClaim(userAddress: string, userOpSignature: Hex): Promise<RzfiClaimResponse>;
1972
+ private assertRzfiClaimUser;
1651
1973
  /** Apply the same per-asset minimum portfolio rule as sendDeposit. */
1652
1974
  private enforceMinimumPortfolioBalance;
1653
1975
  /**
@@ -1675,6 +1997,16 @@ declare class ZyfaiSDK {
1675
1997
  * @internal
1676
1998
  */
1677
1999
  private ensureDepositProfileForPrepare;
2000
+ /**
2001
+ * Persist the deposit asset on one chain before a signing page runs the transfer or swap.
2002
+ * Does not build calldata and does not check the portfolio minimum.
2003
+ */
2004
+ ensureDepositAssetOnChain(params: {
2005
+ asset: SupportedAsset;
2006
+ chainId: SupportedChainId;
2007
+ }): Promise<{
2008
+ applied: boolean;
2009
+ }>;
1678
2010
  /**
1679
2011
  * Prepare a deposit: persist first-deposit profile when needed and return
1680
2012
  * ERC-20 transfer calldata for the user to sign (does not broadcast).
@@ -1993,6 +2325,24 @@ declare class ZyfaiSDK {
1993
2325
  * ```
1994
2326
  */
1995
2327
  getUserDetails(asset?: SupportedAsset): Promise<UpdateUserProfileResponse>;
2328
+ /**
2329
+ * Get Zyfai's Merkl incentive campaigns on Base with their current APR.
2330
+ *
2331
+ * @group Analytics and opportunities
2332
+ *
2333
+ * @remarks Data API. Partner API key only; SIWE not required.
2334
+ *
2335
+ * @returns One entry per campaign slot (rZFI, new TVL, season campaign)
2336
+ *
2337
+ * @example
2338
+ * ```typescript
2339
+ * const campaigns = await sdk.getBaseMerklCampaigns();
2340
+ * for (const c of campaigns.filter((c) => c.isActive)) {
2341
+ * console.log(c.name, `${(c.apr * 100).toFixed(2)}%`);
2342
+ * }
2343
+ * ```
2344
+ */
2345
+ getBaseMerklCampaigns(): Promise<MerklCampaign[]>;
1996
2346
  /**
1997
2347
  * Get total value locked (TVL) across all Zyfai accounts.
1998
2348
  *
@@ -2752,6 +3102,55 @@ type BankrProvider = ReturnType<typeof createBankrProvider>;
2752
3102
  */
2753
3103
  declare function getManagedAssets(): SupportedAsset[];
2754
3104
 
3105
+ type DepositRoute = {
3106
+ kind: "direct";
3107
+ asset: string;
3108
+ } | {
3109
+ kind: "wrap";
3110
+ asset: "WETH";
3111
+ } | {
3112
+ kind: "swap";
3113
+ originChainId: number;
3114
+ originCurrency: string;
3115
+ destinationAsset: string;
3116
+ };
3117
+ type DepositRouteInput = {
3118
+ /** Chain the collateral should arrive on. */
3119
+ chainId: number;
3120
+ /** Collateral symbol that should land in the Safe. */
3121
+ asset: string;
3122
+ /**
3123
+ * Token the wallet spends. Omit to spend `asset` on `chainId`.
3124
+ * A symbol or contract equal to that collateral on `chainId` is a direct deposit.
3125
+ */
3126
+ spendToken?: string;
3127
+ /** Chain the spend token is on. Defaults to `chainId`. */
3128
+ spendChainId?: number;
3129
+ };
3130
+ /**
3131
+ * Choose a direct collateral transfer, a same-chain ETH wrap, or a Relay swap.
3132
+ *
3133
+ * A direct deposit is only when the wallet already holds the destination
3134
+ * collateral on the destination chain. Any other spend token is a swap.
3135
+ * Same-chain native ETH into WETH wraps in the wallet: Relay rejects that pair.
3136
+ */
3137
+ declare const resolveDepositRoute: (input: DepositRouteInput) => DepositRoute;
3138
+
3139
+ /** Matches the execution API and the deposit UI default. */
3140
+ declare const DEFAULT_RELAY_SLIPPAGE_BPS = 200;
3141
+ /** Hard cap accepted by `POST /users/me/funding-orders`. */
3142
+ declare const MAX_RELAY_SLIPPAGE_BPS = 500;
3143
+ /**
3144
+ * Dashboard presets (basis points). Any integer from 1 to
3145
+ * {@link MAX_RELAY_SLIPPAGE_BPS} is valid; these are the usual choices.
3146
+ */
3147
+ declare const RELAY_SLIPPAGE_PRESETS_BPS: readonly [50, 200, 500];
3148
+ /**
3149
+ * Clamp a client slippage to the range the execution API stores.
3150
+ * Omitted or non-finite values use {@link DEFAULT_RELAY_SLIPPAGE_BPS}.
3151
+ */
3152
+ declare const resolveRelaySlippageBps: (clientBps?: number | null) => number;
3153
+
2755
3154
  /**
2756
3155
  * API Endpoints Configuration
2757
3156
  *
@@ -2851,4 +3250,4 @@ declare const ERC7579_LAUNCHPAD_ADDRESS: Address$1;
2851
3250
  */
2852
3251
  declare const POOL_MODULE_ADDRESSES: readonly Address$1[];
2853
3252
 
2854
- export { ALLOWED_HISTORY_DAYS, API_ENDPOINT, type APYPerStrategy, type APYPerStrategyResponse, type ActionData, type ActiveWallet, type ActiveWalletsResponse, type AddWalletToSdkResponse, type Address, type AllocationDetail, type AllowedHistoryDays, type ApyPosition, type AsyncWithdrawal, type AsyncWithdrawalStatus, type BackendEnvironment, type BankrProvider, type BankrProviderConfig, type BestOpportunityDetails, type BestOpportunityResponse, type ChainConfig, type ChainPortfolio, type ChainTokenEarnings, type CustomizationConfig, type CustomizeBatchRequest, type CustomizeBatchResponse, DATA_API_BASE_URLS, DATA_API_ENDPOINT, DEFAULT_TOKEN_ADDRESSES, type DailyApyEntry, type DailyApyHistoryPeriod, type DailyApyHistoryResponse, type DailyEarning, type DailyEarningsResponse, type DebankPortfolioResponse, type DepegEvent, type DeploySafeResponse, type DepositLifecycleResponse, type DepositLifecycleStatus, type DepositPositionOutcome, type DepositResponse, ERC7579_LAUNCHPAD_ADDRESS, type ERC7739Context, type ERC7739Data, EXECUTION_API_BASE_URLS, type ExcludedPool, type FirstTopupResponse, type GetPoolsResponse, type GetSelectedPoolsResponse, type Hex, type HistoryEntry, type HistoryFeeData, type HistoryPosition, type HistoryRebalanceLog, type HistoryResponse, INTENT_EXECUTOR, INTENT_SMART_SESSIONS, LOCAL_DATA_API_BASE_URL, LOCAL_EXECUTION_API_BASE_URL, LOCAL_WS_URL, type LiquidityDropEvent, type LogDepositResponse, type NewCollateralDetectedEvent, OWNABLE_VALIDATOR, type OnchainEarnings, type OnchainEarningsResponse, type OpportunitiesResponse, type Opportunity, type OpportunityPosition, POOL_MODULE_ADDRESSES, PROXY_EXECUTOR, type PolicyData, type Pool, type Portfolio, type PortfolioAssetBalance, type PortfolioByAssetType, type PortfolioByChain, type PortfolioDetailed, type PortfolioDetailedResponse, type PortfolioResponse, type PortfolioToken, type PositionSlot, type Protocol, type ProtocolsResponse, type RebalanceFrequencyResponse, type RegisterAgentResponse, SAFE_7579_ADDRESS, type SDKConfig, SMART_SESSIONS_FALLBACK, SMART_SESSIONS_VALIDATOR, STAGING_DATA_API_BASE_URL, STAGING_EXECUTION_API_BASE_URL, STAGING_WS_URL, type SdkKeyTVLResponse, type Session, type SessionKeyResponse, type SimulateBestPositionsParams, type SimulateBestPositionsResponse, type SimulateCalldataItem, type SimulatedPosition, type SmartWalletByEOAResponse, type SmartWalletResponse, type Strategy, type SupportedAsset, type SupportedChainId, type TVLResponse, type TokenApy, type TokenEarnings, type UpdateUserProfileRequest, type UpdateUserProfileResponse, type UserPosition, type UserSessionAuth, VAULT_ADDRESS, type VaultAsset, type VaultClaimResponse, type VaultDepositResponse, type VaultSharesResponse, type VaultWithdrawResponse, type VaultWithdrawStatusResponse, type VolumeResponse, WS_ENDPOINT, WS_URLS, type WaitForDepositCreditOptions, type WaitForDepositPositionOptions, type WaitForWithdrawCompleteOptions, type WaitForWithdrawSettlementOptions, type WalletTVL, type WithdrawAsyncLeg, type WithdrawLifecycleResponse, type WithdrawLifecycleStatus, type WithdrawResponse, type ZyfaiEventFilters, type ZyfaiEventHandlers, ZyfaiSDK, createBankrProvider, getChainConfig, getDataApiBaseUrl, getDefaultTokenAddress, getExecutionApiBaseUrl, getManagedAssets, getSupportedChainIds, getWsUrl, isSupportedChain, type staleBalances };
3253
+ export { ALLOWED_HISTORY_DAYS, API_ENDPOINT, type APYPerStrategy, type APYPerStrategyResponse, type ActionData, type ActiveWallet, type ActiveWalletsResponse, type AddWalletToSdkResponse, type Address, type AllocationDetail, type AllowedHistoryDays, type ApyPosition, type AsyncWithdrawal, type AsyncWithdrawalStatus, type BackendEnvironment, type BankrProvider, type BankrProviderConfig, type BaseMerklCampaignId, type BestOpportunityDetails, type BestOpportunityResponse, type ChainConfig, type ChainPortfolio, type ChainTokenEarnings, type CustomizationConfig, type CustomizeBatchRequest, type CustomizeBatchResponse, DATA_API_BASE_URLS, DATA_API_ENDPOINT, DEFAULT_RELAY_SLIPPAGE_BPS, DEFAULT_TOKEN_ADDRESSES, type DailyApyEntry, type DailyApyHistoryPeriod, type DailyApyHistoryResponse, type DailyEarning, type DailyEarningsResponse, type DebankPortfolioResponse, type DepegEvent, type DeploySafeResponse, type DepositLifecycleResponse, type DepositLifecycleStatus, type DepositPositionOutcome, type DepositResponse, type DepositRoute, type DepositRouteInput, ERC7579_LAUNCHPAD_ADDRESS, type ERC7739Context, type ERC7739Data, EXECUTION_API_BASE_URLS, type ExcludedPool, type FirstTopupResponse, type GetPoolsResponse, type GetSelectedPoolsResponse, type Hex, type HistoryEntry, type HistoryFeeData, type HistoryPosition, type HistoryRebalanceLog, type HistoryResponse, INTENT_EXECUTOR, INTENT_SMART_SESSIONS, LOCAL_DATA_API_BASE_URL, LOCAL_EXECUTION_API_BASE_URL, LOCAL_WS_URL, type LiquidityDropEvent, type LogDepositResponse, MAX_RELAY_SLIPPAGE_BPS, type MerklCampaign, type NewCollateralDetectedEvent, OWNABLE_VALIDATOR, type OnchainEarnings, type OnchainEarningsResponse, type OpportunitiesResponse, type Opportunity, type OpportunityPosition, POOL_MODULE_ADDRESSES, PROXY_EXECUTOR, type PolicyData, type Pool, type Portfolio, type PortfolioAssetBalance, type PortfolioByAssetType, type PortfolioByChain, type PortfolioDetailed, type PortfolioDetailedResponse, type PortfolioResponse, type PortfolioToken, type PositionSlot, type Protocol, type ProtocolsResponse, RELAY_SLIPPAGE_PRESETS_BPS, type RebalanceFrequencyResponse, type RegisterAgentResponse, type RzfiClaimResponse, SAFE_7579_ADDRESS, type SDKConfig, SMART_SESSIONS_FALLBACK, SMART_SESSIONS_VALIDATOR, STAGING_DATA_API_BASE_URL, STAGING_EXECUTION_API_BASE_URL, STAGING_WS_URL, type SdkKeyTVLResponse, type SendDepositParams, type Session, type SessionKeyResponse, type SimulateBestPositionsParams, type SimulateBestPositionsResponse, type SimulateCalldataItem, type SimulatedPosition, type SmartWalletByEOAResponse, type SmartWalletResponse, type Strategy, type SupportedAsset, type SupportedChainId, type SwapDepositOrder, type SwapDepositParams, type SwapDepositQuote, type TVLResponse, type TokenApy, type TokenEarnings, type UpdateUserProfileRequest, type UpdateUserProfileResponse, type UserPosition, type UserSessionAuth, VAULT_ADDRESS, type VaultAsset, type VaultClaimResponse, type VaultDepositResponse, type VaultSharesResponse, type VaultWithdrawResponse, type VaultWithdrawStatusResponse, type VolumeResponse, WS_ENDPOINT, WS_URLS, type WaitForDepositCreditOptions, type WaitForDepositPositionOptions, type WaitForWithdrawCompleteOptions, type WaitForWithdrawSettlementOptions, type WalletTVL, type WithdrawAsyncLeg, type WithdrawLifecycleResponse, type WithdrawLifecycleStatus, type WithdrawResponse, type ZyfaiEventFilters, type ZyfaiEventHandlers, ZyfaiSDK, createBankrProvider, getChainConfig, getDataApiBaseUrl, getDefaultTokenAddress, getExecutionApiBaseUrl, getManagedAssets, getSupportedChainIds, getWsUrl, isSupportedChain, resolveDepositRoute, resolveRelaySlippageBps, type staleBalances };