@paxoslabs/amplify-sdk 0.4.2 → 0.4.3-alpha.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +79 -64
  2. package/dist/{chain-utils-CRMbWzu7.d.mts → chain-utils-CbVFMjwR.d.mts} +13 -1
  3. package/dist/{chain-utils-CRMbWzu7.d.ts → chain-utils-CbVFMjwR.d.ts} +13 -1
  4. package/dist/{chunk-5CV25BTQ.js → chunk-4OEL42W2.mjs} +83 -4
  5. package/dist/chunk-4OEL42W2.mjs.map +1 -0
  6. package/dist/{chunk-RW7PZETN.mjs → chunk-7RAFG3NI.mjs} +167 -228
  7. package/dist/chunk-7RAFG3NI.mjs.map +1 -0
  8. package/dist/{chunk-CQZCGPZK.mjs → chunk-E2HBXOZY.js} +92 -3
  9. package/dist/chunk-E2HBXOZY.js.map +1 -0
  10. package/dist/{chunk-WZXCJAKM.js → chunk-EHRZFLWL.js} +12 -12
  11. package/dist/{chunk-WZXCJAKM.js.map → chunk-EHRZFLWL.js.map} +1 -1
  12. package/dist/{chunk-GMMBJB4B.mjs → chunk-GSYGURYO.mjs} +71 -46
  13. package/dist/chunk-GSYGURYO.mjs.map +1 -0
  14. package/dist/{chunk-VZED4E3L.mjs → chunk-HBFBGNRH.mjs} +3 -3
  15. package/dist/{chunk-VZED4E3L.mjs.map → chunk-HBFBGNRH.mjs.map} +1 -1
  16. package/dist/{chunk-TPU2HZAX.mjs → chunk-L3X5UBG6.mjs} +86 -169
  17. package/dist/chunk-L3X5UBG6.mjs.map +1 -0
  18. package/dist/{chunk-BQG3XKTU.js → chunk-R5G6F7RP.js} +168 -227
  19. package/dist/chunk-R5G6F7RP.js.map +1 -0
  20. package/dist/{chunk-OZJNKGW6.js → chunk-WHL5LQRP.js} +120 -95
  21. package/dist/chunk-WHL5LQRP.js.map +1 -0
  22. package/dist/{chunk-2YPKHXFJ.js → chunk-ZJBJFFBQ.js} +180 -263
  23. package/dist/chunk-ZJBJFFBQ.js.map +1 -0
  24. package/dist/core.d.mts +2 -2
  25. package/dist/core.d.ts +2 -2
  26. package/dist/core.js +16 -16
  27. package/dist/core.mjs +4 -4
  28. package/dist/display.d.mts +23 -11
  29. package/dist/display.d.ts +23 -11
  30. package/dist/display.js +10 -10
  31. package/dist/display.mjs +4 -4
  32. package/dist/index.d.mts +107 -7
  33. package/dist/index.d.ts +107 -7
  34. package/dist/index.js +75 -51
  35. package/dist/index.mjs +5 -5
  36. package/dist/utils.d.mts +1 -1
  37. package/dist/utils.d.ts +1 -1
  38. package/dist/utils.js +7 -7
  39. package/dist/utils.mjs +2 -2
  40. package/dist/vaults.d.mts +107 -94
  41. package/dist/vaults.d.ts +107 -94
  42. package/dist/vaults.js +25 -25
  43. package/dist/vaults.mjs +4 -4
  44. package/package.json +18 -11
  45. package/dist/chunk-2YPKHXFJ.js.map +0 -1
  46. package/dist/chunk-5CV25BTQ.js.map +0 -1
  47. package/dist/chunk-BQG3XKTU.js.map +0 -1
  48. package/dist/chunk-CQZCGPZK.mjs.map +0 -1
  49. package/dist/chunk-GMMBJB4B.mjs.map +0 -1
  50. package/dist/chunk-OZJNKGW6.js.map +0 -1
  51. package/dist/chunk-RW7PZETN.mjs.map +0 -1
  52. package/dist/chunk-TPU2HZAX.mjs.map +0 -1
package/dist/vaults.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { erc20Abi, Address, Hex } from 'viem';
2
- import { Y as YieldType, C as ChainId } from './chain-utils-CRMbWzu7.js';
2
+ import { C as ChainId } from './chain-utils-CbVFMjwR.js';
3
3
  import 'viem/chains';
4
4
 
5
5
  /**
@@ -8,15 +8,16 @@ import 'viem/chains';
8
8
  */
9
9
 
10
10
  /**
11
- * Parameters required for preparing an approval transaction
11
+ * Parameters required for preparing an ERC20 approval transaction
12
+ *
12
13
  * @interface PrepareApproveDepositTokenTxParams
13
- * @property {YieldType} yieldType - Yield strategy type (e.g., "CORE", "TREASURY", "FRONTIER")
14
- * @property {Address} depositAsset - Token contract address to approve
15
- * @property {string} [approvalAmount] - Optional amount to approve (defaults to maximum approval)
16
- * @property {ChainId} chainId - ID of the chain where the approval will occur
14
+ * @property {string} vaultName - Human-readable vault name (e.g. "Amplify USDC Core")
15
+ * @property {Address} depositAsset - Token contract address to approve. Must match the vault's supported asset.
16
+ * @property {string} [approvalAmount] - Optional amount to approve as a decimal string (defaults to maximum approval)
17
+ * @property {ChainId} chainId - ID of the chain where the approval will occur. Must match the vault's chain.
17
18
  */
18
19
  interface PrepareApproveDepositTokenTxParams {
19
- yieldType: YieldType;
20
+ vaultName: string;
20
21
  depositAsset: Address;
21
22
  approvalAmount?: string;
22
23
  chainId: ChainId;
@@ -41,11 +42,12 @@ interface ApproveDepositTokenTxData {
41
42
  *
42
43
  * This function prepares an ERC20 approval transaction that allows the vault's
43
44
  * CommunityCodeDepositor contract to spend the user's deposit tokens.
45
+ * The vault is validated against the provided `vaultName`, `chainId`, and `depositAsset`.
44
46
  *
45
47
  * @example
46
48
  * ```typescript
47
49
  * const approveData = await prepareApproveDepositTokenTxData({
48
- * yieldType: "CORE",
50
+ * vaultName: "Amplify USDC Core",
49
51
  * depositAsset: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
50
52
  * approvalAmount: "1000.0", // Approve 1000 USDC
51
53
  * chainId: 1,
@@ -54,9 +56,9 @@ interface ApproveDepositTokenTxData {
54
56
  *
55
57
  * @param {PrepareApproveDepositTokenTxParams} params - Parameters for the approval operation
56
58
  * @returns {Promise<ApproveDepositTokenTxData>} Promise resolving to the prepared transaction data
57
- * @throws {APIError} If parameters are invalid or vault not found
59
+ * @throws {APIError} If vault not found, chain/asset mismatch, or contracts not configured
58
60
  */
59
- declare function prepareApproveDepositTokenTxData({ yieldType, depositAsset, approvalAmount, chainId, }: PrepareApproveDepositTokenTxParams): Promise<ApproveDepositTokenTxData>;
61
+ declare function prepareApproveDepositTokenTxData({ vaultName, depositAsset, approvalAmount, chainId, }: PrepareApproveDepositTokenTxParams): Promise<ApproveDepositTokenTxData>;
60
62
 
61
63
  declare const CommunityCodeDepositorAbi: readonly [{
62
64
  readonly inputs: readonly [{
@@ -395,19 +397,19 @@ interface DepositTxData {
395
397
  chainId: number;
396
398
  }
397
399
  /**
398
- * Parameters for prepareDepositTransactionData()
399
- * Accepts yieldType, to, depositAsset, and chainId for automatic vault resolution
400
+ * Parameters for prepareDepositTxData()
401
+ *
400
402
  * @interface PrepareDepositTxDataParams
401
- * @property {YieldType} yieldType - Yield strategy type (e.g., "CORE", "TREASURY", "FRONTIER")
403
+ * @property {string} vaultName - Human-readable vault name (e.g. "Amplify USDC Core")
402
404
  * @property {Address} to - Ethereum address of the recipient. Must be the same as the address used to sign the deposit transaction.
403
- * @property {Address} depositAsset - Token contract address to deposit. Must be supported by the vault.
405
+ * @property {Address} depositAsset - Token contract address to deposit. Must match the vault's supported asset.
404
406
  * @property {string} depositAmount - Amount of assets to deposit as a decimal string (e.g., "1.5")
405
- * @property {number | string} chainId - ID of the chain where the deposit will occur
407
+ * @property {ChainId} chainId - ID of the chain where the deposit will occur. Must match the vault's chain.
406
408
  * @property {number} [slippage] - Optional (default is 50 (0.5%)): Maximum acceptable slippage in basis points (e.g., 100 for 1%).
407
409
  * @property {string} [distributorCode] - Optional (default is empty string): Distributor code for fee attribution
408
410
  */
409
411
  interface PrepareDepositTxDataParams {
410
- yieldType: YieldType;
412
+ vaultName: string;
411
413
  to: Address;
412
414
  depositAsset: Address;
413
415
  depositAmount: string;
@@ -419,12 +421,12 @@ interface PrepareDepositTxDataParams {
419
421
  * Prepares the transaction data needed to deposit assets into a vault
420
422
  *
421
423
  * This function calculates the minimum amount of vault tokens to be minted based on
422
- * the current exchange rate and the specified slippage tolerance. It automatically
423
- * resolves the vault from yieldType, depositToken, and chainId parameters.
424
+ * the current exchange rate and the specified slippage tolerance. The vault is resolved
425
+ * and validated against the provided `vaultName`, `chainId`, and `depositAsset`.
424
426
  *
425
427
  * ```typescript
426
428
  * const depositData = await prepareDepositTxData({
427
- * yieldType: 'CORE',
429
+ * vaultName: 'Amplify USDC Core',
428
430
  * to: '0x1234...',
429
431
  * depositAsset: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
430
432
  * depositAmount: "1.0",
@@ -434,8 +436,8 @@ interface PrepareDepositTxDataParams {
434
436
  * });
435
437
  * ```
436
438
  *
437
- * @param {PrepareDepositTransactionDataParams} params - Parameters for the deposit operation
438
- * @returns {Promise<DepositTransactionData>} Promise resolving to the prepared transaction data
439
+ * @param {PrepareDepositTxDataParams} params - Parameters for the deposit operation
440
+ * @returns {Promise<DepositTxData>} Promise resolving to the prepared transaction data
439
441
  * @throws {APIError} If vault cannot be resolved, asset not found, or contracts not configured
440
442
  */
441
443
  declare function prepareDepositTxData(params: PrepareDepositTxDataParams): Promise<DepositTxData>;
@@ -562,23 +564,23 @@ interface ParsedPermitSignature {
562
564
  * T009: Parameters for prepareDepositPermitSignature
563
565
  * Input parameters for generating permit typed data
564
566
  *
565
- * @property yieldType - Vault yield strategy
566
- * @property depositAsset - Token contract address to deposit
567
- * @property depositAmount - Deposit amount as decimal string
568
- * @property to - User address (permit owner)
569
- * @property chainId - Blockchain network ID
570
- * @property deadline - Optional permit expiration (defaults to 1 hour)
571
- * @property nonce - Optional pre-fetched nonce (skips RPC call if provided)
572
- * @property decimals - Optional pre-fetched token decimals (skips RPC call)
573
- * @property tokenName - Optional pre-fetched token name (skips RPC call)
574
- * @property tokenVersion - Optional pre-fetched token version (skips RPC call)
567
+ * @property {string} vaultName - Human-readable vault name (e.g. "Amplify USDC Core")
568
+ * @property {Address} depositAsset - Token contract address to deposit. Must match the vault's supported asset.
569
+ * @property {string} depositAmount - Deposit amount as decimal string (e.g., "100.25")
570
+ * @property {Address} to - User address (permit owner)
571
+ * @property {ChainId} chainId - Chain ID where the vault is deployed. Must match the vault's chain.
572
+ * @property {bigint} [deadline] - Optional permit expiration (defaults to 1 hour from now)
573
+ * @property {bigint} [nonce] - Optional pre-fetched nonce (skips RPC call if provided)
574
+ * @property {number} [decimals] - Optional pre-fetched token decimals (skips RPC call)
575
+ * @property {string} [tokenName] - Optional pre-fetched token name for EIP-712 domain (skips RPC call)
576
+ * @property {string} [tokenVersion] - Optional pre-fetched token version for EIP-712 domain (skips RPC call, defaults to "1")
575
577
  */
576
578
  interface PrepareDepositPermitSignatureParams {
577
- yieldType: YieldType;
579
+ vaultName: string;
578
580
  depositAsset: Address;
579
581
  depositAmount: string;
580
582
  to: Address;
581
- chainId: number;
583
+ chainId: ChainId;
582
584
  deadline?: bigint;
583
585
  /** Pre-fetched nonce from getTokenPermitInfoWithAllowance */
584
586
  nonce?: bigint;
@@ -603,7 +605,7 @@ type UnencodedDepositWithPermitData = Awaited<ReturnType<typeof prepareDepositWi
603
605
  * @example
604
606
  * ```typescript
605
607
  * const permitData = await prepareDepositPermitSignature({
606
- * yieldType: 'CORE',
608
+ * vaultName: 'Amplify USDC Core',
607
609
  * depositAsset: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
608
610
  * depositAmount: '1000.0',
609
611
  * to: userAddress,
@@ -669,8 +671,18 @@ declare function prepareDepositPermitSignature(params: PrepareDepositPermitSigna
669
671
  */
670
672
  declare function parsePermitSignature(signature: Hex): ParsedPermitSignature;
671
673
  /**
672
- * T048: Updated parameters for prepareDepositWithPermitTxData()
673
- * Now accepts raw signature and deadline for complete transaction encoding
674
+ * T048: Parameters for prepareDepositWithPermitTxData()
675
+ * Accepts raw signature and deadline for complete transaction encoding.
676
+ *
677
+ * @property {string} vaultName - Human-readable vault name (e.g. "Amplify USDC Core")
678
+ * @property {Address} to - Recipient address for vault shares
679
+ * @property {Address} depositAsset - Token contract address to deposit. Must match the vault's supported asset.
680
+ * @property {string} depositAmount - Amount to deposit as a decimal string (e.g., "100.25")
681
+ * @property {ChainId} chainId - Chain ID where the vault is deployed. Must match the vault's chain.
682
+ * @property {Hex} signature - Raw hex signature from wallet signing of permit typed data
683
+ * @property {bigint} deadline - Permit expiration timestamp (must match the signed permit)
684
+ * @property {number} [slippage] - Optional slippage in basis points (default: 50 = 0.5%)
685
+ * @property {string} [distributorCode] - Optional distributor code for fee attribution
674
686
  *
675
687
  * @example
676
688
  * ```typescript
@@ -678,7 +690,7 @@ declare function parsePermitSignature(signature: Hex): ParsedPermitSignature;
678
690
  * const signature = await signTypedData(permitData);
679
691
  *
680
692
  * const params: PrepareDepositWithPermitTxDataParams = {
681
- * yieldType: "CORE",
693
+ * vaultName: "Amplify USDC Core",
682
694
  * to: "0x1234567890123456789012345678901234567890",
683
695
  * depositAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
684
696
  * depositAmount: "100.25",
@@ -691,11 +703,11 @@ declare function parsePermitSignature(signature: Hex): ParsedPermitSignature;
691
703
  * ```
692
704
  */
693
705
  interface PrepareDepositWithPermitTxDataParams {
694
- yieldType: YieldType;
706
+ vaultName: string;
695
707
  to: Address;
696
708
  depositAsset: Address;
697
709
  depositAmount: string;
698
- chainId: number | ChainId;
710
+ chainId: ChainId;
699
711
  signature: Hex;
700
712
  deadline: bigint;
701
713
  slippage?: number;
@@ -1194,15 +1206,15 @@ declare function isAlreadyApprovedAuth(result: DepositAuthorizationResult): resu
1194
1206
  * Parameters for prepareDepositAuthorization
1195
1207
  */
1196
1208
  interface PrepareDepositAuthorizationParams {
1197
- /** Yield strategy type (e.g., "CORE", "TREASURY", "FRONTIER") */
1198
- yieldType: YieldType;
1199
- /** Token contract address to deposit */
1209
+ /** Human-readable vault name (e.g. "Amplify USDC Core") */
1210
+ vaultName: string;
1211
+ /** Token contract address to deposit. Must match the vault's supported asset. */
1200
1212
  depositAsset: Address;
1201
1213
  /** Amount of assets to deposit as decimal string (e.g., "100.25") */
1202
1214
  depositAmount: string;
1203
1215
  /** User's wallet address (permit owner / approval sender) */
1204
1216
  to: Address;
1205
- /** Blockchain network ID */
1217
+ /** Chain ID where the vault is deployed. Must match the vault's chain. */
1206
1218
  chainId: ChainId;
1207
1219
  /** Optional deadline for permit signature (defaults to 1 hour from now) */
1208
1220
  deadline?: bigint;
@@ -1214,15 +1226,15 @@ interface PrepareDepositAuthorizationParams {
1214
1226
  * Unified deposit function accepting optional permit signature
1215
1227
  */
1216
1228
  interface PrepareDepositParams {
1217
- /** Yield strategy type (e.g., "CORE", "TREASURY", "FRONTIER") */
1218
- yieldType: YieldType;
1219
- /** Token contract address to deposit */
1229
+ /** Human-readable vault name (e.g. "Amplify USDC Core") */
1230
+ vaultName: string;
1231
+ /** Token contract address to deposit. Must match the vault's supported asset. */
1220
1232
  depositAsset: Address;
1221
1233
  /** Amount of assets to deposit as decimal string (e.g., "100.25") */
1222
1234
  depositAmount: string;
1223
1235
  /** Recipient address for vault shares */
1224
1236
  to: Address;
1225
- /** Blockchain network ID */
1237
+ /** Chain ID where the vault is deployed. Must match the vault's chain. */
1226
1238
  chainId: ChainId;
1227
1239
  /** Optional slippage in basis points (default: 50 = 0.5%) */
1228
1240
  slippage?: number;
@@ -1273,7 +1285,7 @@ type PrepareDepositResult = StandardDepositResult | PermitDepositResult;
1273
1285
  * import { prepareDepositAuthorization, DepositAuthMethod } from "@paxoslabs/amplify-sdk";
1274
1286
  *
1275
1287
  * const authResult = await prepareDepositAuthorization({
1276
- * yieldType: "CORE",
1288
+ * vaultName: "Amplify USDC Core",
1277
1289
  * depositAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
1278
1290
  * depositAmount: "1000.0",
1279
1291
  * to: "0x1234...",
@@ -1363,7 +1375,7 @@ declare function prepareDepositAuthorization(params: PrepareDepositAuthorization
1363
1375
  *
1364
1376
  * // Scenario 1: Permit deposit (with signature from prepareDepositAuthorization)
1365
1377
  * const permitDeposit = await prepareDeposit({
1366
- * yieldType: "CORE",
1378
+ * vaultName: "Amplify USDC Core",
1367
1379
  * depositAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
1368
1380
  * depositAmount: "1000.0",
1369
1381
  * to: "0x1234...",
@@ -1375,7 +1387,7 @@ declare function prepareDepositAuthorization(params: PrepareDepositAuthorization
1375
1387
  *
1376
1388
  * // Scenario 2: Standard deposit (after approval)
1377
1389
  * const standardDeposit = await prepareDeposit({
1378
- * yieldType: "CORE",
1390
+ * vaultName: "Amplify USDC Core",
1379
1391
  * depositAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
1380
1392
  * depositAmount: "1000.0",
1381
1393
  * to: "0x1234...",
@@ -2009,15 +2021,17 @@ declare const BoringVaultAbi: readonly [{
2009
2021
  }];
2010
2022
 
2011
2023
  /**
2012
- * Parameters required for preparing an approval transaction (NEW AmplifyVault schema)
2024
+ * Parameters required for preparing a vault-share approval transaction
2025
+ *
2013
2026
  * @interface PrepareApproveWithdrawOrderTxDataParams
2014
- * @property {YieldType} yieldType - Yield strategy type (CORE, TREASURY, or FRONTIER)
2015
- * @property {Address} wantAssetAddress - Address of the want token
2016
- * @property {string} withdrawAmount - Amount to approve as a decimal string (defaults to maximum approval)
2017
- * @property {ChainId} chainId - ID of the chain where the approval will occur
2027
+ * @property {string} vaultName - Human-readable vault name (e.g. "Amplify USDC Core")
2028
+ * @property {Address} wantAssetAddress - Address of the want token. Must match the vault's supported asset.
2029
+ * @property {string} [withdrawAmount] - Optional amount to approve as a decimal string (defaults to maximum approval)
2030
+ * @property {ChainId} chainId - ID of the chain where the vault is deployed. Must match the vault's chain.
2031
+ * @property {number} [shareDecimals] - Optional: Pre-fetched vault share decimals (avoids redundant RPC call)
2018
2032
  */
2019
2033
  interface PrepareApproveWithdrawOrderTxDataParams {
2020
- yieldType: YieldType;
2034
+ vaultName: string;
2021
2035
  wantAssetAddress: Address;
2022
2036
  withdrawAmount?: string;
2023
2037
  chainId: ChainId;
@@ -2042,31 +2056,29 @@ interface ApproveWithdrawOrderTxData {
2042
2056
  /**
2043
2057
  * Prepares the transaction data needed to approve vault shares for the WithdrawQueue contract
2044
2058
  *
2045
- * This function prepares an ERC20 approval transaction that allows the WithdrawQueue
2046
- * contract to spend the user's vault shares. It uses the new AmplifyVault schema
2047
- * with asset decimals from the API (no on-chain calls).
2059
+ * The vault is resolved and validated against `vaultName`, `chainId`, and `wantAssetAddress`
2060
+ * before any calldata is constructed.
2048
2061
  *
2049
2062
  * @example
2050
2063
  * ```typescript
2051
- * const vaults = await fetchVaults({ chainId: 1 });
2052
2064
  * const approveData = await prepareApproveWithdrawOrderTxData({
2053
- * yieldType: 'CORE',
2065
+ * vaultName: "Amplify USDC Core",
2054
2066
  * wantAssetAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
2055
- * withdrawAmount: "10.0", // Approve 10 USDC
2067
+ * withdrawAmount: "10.0", // Approve 10 vault shares
2056
2068
  * chainId: 1,
2057
2069
  * });
2058
2070
  * ```
2059
2071
  *
2060
2072
  * @param {PrepareApproveWithdrawOrderTxDataParams} params - Parameters for the approval operation
2061
- * @param {YieldType} params.yieldType - Yield strategy type (CORE, TREASURY, or FRONTIER)
2073
+ * @param {string} params.vaultName - Human-readable vault name
2062
2074
  * @param {Address} params.wantAssetAddress - Address of the want token
2063
2075
  * @param {string} [params.withdrawAmount] - Optional amount to approve as a decimal string (defaults to maximum approval)
2064
- * @param {number | string} params.chainId - ID of the chain where the approval will occur
2076
+ * @param {ChainId} params.chainId - ID of the chain where the vault is deployed
2065
2077
  *
2066
2078
  * @returns {Promise<ApproveWithdrawOrderTxData>} Promise resolving to the prepared transaction data
2067
- * @throws {APIError} If the vault is not on the correct chain or contracts not configured
2079
+ * @throws {APIError} If vault not found, chain/asset mismatch, or contracts not configured
2068
2080
  */
2069
- declare function prepareApproveWithdrawOrderTxData({ yieldType, wantAssetAddress, withdrawAmount, chainId, shareDecimals, }: PrepareApproveWithdrawOrderTxDataParams): Promise<ApproveWithdrawOrderTxData>;
2081
+ declare function prepareApproveWithdrawOrderTxData({ vaultName, wantAssetAddress, withdrawAmount, chainId, shareDecimals, }: PrepareApproveWithdrawOrderTxDataParams): Promise<ApproveWithdrawOrderTxData>;
2070
2082
 
2071
2083
  declare const WithdrawQueueAbi: readonly [{
2072
2084
  readonly inputs: readonly [{
@@ -3471,13 +3483,13 @@ declare const WithdrawQueueAbi: readonly [{
3471
3483
  * Parameters for preparing a cancel withdrawal order transaction
3472
3484
  *
3473
3485
  * @interface PrepareCancelWithdrawOrderTxDataParams
3474
- * @property {YieldType} yieldType - Yield strategy type (CORE, TREASURY, or FRONTIER)
3475
- * @property {Address} wantAsset - Address of the want token (used to find the correct vault/queue)
3476
- * @property {ChainId} chainId - ID of the chain where the order exists
3486
+ * @property {string} vaultName - Human-readable vault name (e.g. "Amplify USDC Core")
3487
+ * @property {Address} wantAsset - Address of the want token (used to validate the vault). Must match the vault's supported asset.
3488
+ * @property {ChainId} chainId - ID of the chain where the order exists. Must match the vault's chain.
3477
3489
  * @property {bigint} orderIndex - Index of the order to cancel (provided by user)
3478
3490
  */
3479
3491
  interface PrepareCancelWithdrawOrderTxDataParams {
3480
- yieldType: YieldType;
3492
+ vaultName: string;
3481
3493
  wantAsset: Address;
3482
3494
  chainId: ChainId;
3483
3495
  orderIndex: bigint;
@@ -3500,22 +3512,22 @@ interface CancelWithdrawOrderTxData {
3500
3512
  /**
3501
3513
  * Prepares transaction data to cancel a withdrawal order on the WithdrawQueue contract
3502
3514
  *
3503
- * This function prepares the transaction to cancel an existing order in the queue.
3504
- * Only the order owner can cancel their order.
3515
+ * The vault is resolved and validated against `vaultName`, `chainId`, and `wantAsset`
3516
+ * before any calldata is constructed. Only the order owner can cancel their order.
3505
3517
  *
3506
3518
  * @param {PrepareCancelWithdrawOrderTxDataParams} params - Parameters for the cancel operation
3507
3519
  * @returns {Promise<CancelWithdrawOrderTxData>} Promise resolving to the prepared transaction data
3508
- * @throws {APIError} If the vault is not found, chain mismatch, or contracts not configured
3520
+ * @throws {APIError} If vault not found, chain/asset mismatch, or contracts not configured
3509
3521
  *
3510
3522
  * @example
3511
3523
  * ```typescript
3512
3524
  * import { prepareCancelWithdrawOrderTxData } from "@paxoslabs/amplify-sdk";
3513
3525
  *
3514
3526
  * const txData = await prepareCancelWithdrawOrderTxData({
3515
- * yieldType: "CORE",
3527
+ * vaultName: "Amplify USDC Core",
3516
3528
  * wantAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
3517
3529
  * chainId: 1,
3518
- * orderIndex: 42n, // The order index to cancel
3530
+ * orderIndex: 42n,
3519
3531
  * });
3520
3532
  *
3521
3533
  * // Execute with viem
@@ -3526,7 +3538,7 @@ interface CancelWithdrawOrderTxData {
3526
3538
  * await writeContract(txData);
3527
3539
  * ```
3528
3540
  */
3529
- declare const prepareCancelWithdrawOrderTxData: ({ yieldType, wantAsset, chainId, orderIndex, }: PrepareCancelWithdrawOrderTxDataParams) => Promise<CancelWithdrawOrderTxData>;
3541
+ declare const prepareCancelWithdrawOrderTxData: ({ vaultName, wantAsset, chainId, orderIndex, }: PrepareCancelWithdrawOrderTxDataParams) => Promise<CancelWithdrawOrderTxData>;
3530
3542
 
3531
3543
  /**
3532
3544
  * @file Standard withdrawal functionality for WithdrawQueue contract
@@ -3552,14 +3564,14 @@ declare const EMPTY_SIGNATURE_PARAMS: {
3552
3564
  * Parameters for preparing a submit order transaction
3553
3565
  *
3554
3566
  * @interface PrepareWithdrawOrderTxDataParams
3555
- * @property {YieldType} yieldType - Yield strategy type (CORE, TREASURY, or FRONTIER)
3556
- * @property {Address} wantAsset - Address of the token to receive upon withdrawal
3567
+ * @property {string} vaultName - Human-readable vault name (e.g. "Amplify USDC Core")
3568
+ * @property {Address} wantAsset - Address of the token to receive upon withdrawal. Must match the vault's supported asset.
3557
3569
  * @property {Address} userAddress - User's wallet address (used for intendedDepositor, receiver, refundReceiver)
3558
- * @property {ChainId} chainId - ID of the chain where the withdrawal will occur
3570
+ * @property {ChainId} chainId - ID of the chain where the vault is deployed. Must match the vault's chain.
3559
3571
  * @property {string} amountOffer - Amount of vault shares to withdraw as a decimal string
3560
3572
  */
3561
3573
  interface PrepareWithdrawOrderTxDataParams {
3562
- yieldType: YieldType;
3574
+ vaultName: string;
3563
3575
  wantAsset: Address;
3564
3576
  userAddress: Address;
3565
3577
  chainId: ChainId;
@@ -3592,21 +3604,22 @@ interface WithdrawOrderTxData {
3592
3604
  /**
3593
3605
  * Prepares transaction data to submit a withdrawal order to the WithdrawQueue contract
3594
3606
  *
3595
- * This function prepares a user request for the new WithdrawQueue contract.
3596
- * Unlike the old AtomicQueue, this does not require exchange rate queries or slippage parameters.
3607
+ * The vault is resolved and validated against `vaultName`, `chainId`, and `wantAsset`
3608
+ * before any calldata is constructed. Unlike the old AtomicQueue, this does not require
3609
+ * exchange rate queries or slippage parameters.
3597
3610
  * It intentionally does not perform allowance pre-checks; callers should use
3598
3611
  * `prepareWithdrawalAuthorization` when they need approval routing.
3599
3612
  *
3600
3613
  * @param {PrepareWithdrawOrderTxDataParams} params - Parameters for the withdraw operation
3601
3614
  * @returns {Promise<WithdrawOrderTxData>} Promise resolving to the prepared transaction data
3602
- * @throws {APIError} If the vault is not found, chain mismatch, or contracts not configured
3615
+ * @throws {APIError} If vault not found, chain/asset mismatch, or contracts not configured
3603
3616
  *
3604
3617
  * @example
3605
3618
  * ```typescript
3606
3619
  * import { prepareWithdrawOrderTxData } from "@paxoslabs/amplify-sdk";
3607
3620
  *
3608
3621
  * const txData = await prepareWithdrawOrderTxData({
3609
- * yieldType: "CORE",
3622
+ * vaultName: "Amplify USDC Core",
3610
3623
  * wantAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
3611
3624
  * userAddress: "0x1234...",
3612
3625
  * chainId: 1,
@@ -3621,7 +3634,7 @@ interface WithdrawOrderTxData {
3621
3634
  * await writeContract(txData);
3622
3635
  * ```
3623
3636
  */
3624
- declare const prepareWithdrawOrderTxData: ({ yieldType, wantAsset, userAddress, chainId, amountOffer, }: PrepareWithdrawOrderTxDataParams) => Promise<WithdrawOrderTxData>;
3637
+ declare const prepareWithdrawOrderTxData: ({ vaultName, wantAsset, userAddress, chainId, amountOffer, }: PrepareWithdrawOrderTxDataParams) => Promise<WithdrawOrderTxData>;
3625
3638
 
3626
3639
  /**
3627
3640
  * @file Unified withdrawal module with wrapper functions
@@ -3714,15 +3727,15 @@ declare function isWithdrawAlreadyApprovedAuth(result: WithdrawAuthorizationResu
3714
3727
  * Parameters for prepareWithdrawalAuthorization
3715
3728
  */
3716
3729
  interface PrepareWithdrawalAuthorizationParams {
3717
- /** Yield strategy type (e.g., "CORE", "TREASURY", "FRONTIER") */
3718
- yieldType: YieldType;
3719
- /** Token address the user wants to receive upon withdrawal */
3730
+ /** Human-readable vault name (e.g. "Amplify USDC Core") */
3731
+ vaultName: string;
3732
+ /** Token address the user wants to receive upon withdrawal. Must match the vault's supported asset. */
3720
3733
  wantAsset: Address;
3721
3734
  /** Amount of vault shares to withdraw as decimal string */
3722
3735
  withdrawAmount: string;
3723
3736
  /** User's wallet address (owner of vault shares) */
3724
3737
  userAddress: Address;
3725
- /** Blockchain network ID */
3738
+ /** Chain ID where the vault is deployed. Must match the vault's chain. */
3726
3739
  chainId: ChainId;
3727
3740
  /**
3728
3741
  * Force specific authorization routing behavior:
@@ -3736,15 +3749,15 @@ interface PrepareWithdrawalAuthorizationParams {
3736
3749
  * Unified withdrawal wrapper that maps to standard withdraw tx preparation.
3737
3750
  */
3738
3751
  interface PrepareWithdrawalParams {
3739
- /** Yield strategy type (e.g., "CORE", "TREASURY", "FRONTIER") */
3740
- yieldType: YieldType;
3741
- /** Token address the user wants to receive upon withdrawal */
3752
+ /** Human-readable vault name (e.g. "Amplify USDC Core") */
3753
+ vaultName: string;
3754
+ /** Token address the user wants to receive upon withdrawal. Must match the vault's supported asset. */
3742
3755
  wantAsset: Address;
3743
3756
  /** Amount of vault shares to withdraw as decimal string */
3744
3757
  withdrawAmount: string;
3745
3758
  /** User's wallet address (owner of vault shares) */
3746
3759
  userAddress: Address;
3747
- /** Blockchain network ID */
3760
+ /** Chain ID where the vault is deployed. Must match the vault's chain. */
3748
3761
  chainId: ChainId;
3749
3762
  }
3750
3763
  /**
@@ -3785,7 +3798,7 @@ declare function prepareWithdrawal(params: PrepareWithdrawalParams): Promise<Pre
3785
3798
  * } from "@paxoslabs/amplify-sdk";
3786
3799
  *
3787
3800
  * const authResult = await prepareWithdrawalAuthorization({
3788
- * yieldType: "CORE",
3801
+ * vaultName: "Amplify USDC Core",
3789
3802
  * wantAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
3790
3803
  * withdrawAmount: "1.0",
3791
3804
  * userAddress: "0x1234...",
package/dist/vaults.js CHANGED
@@ -1,96 +1,96 @@
1
1
  'use strict';
2
2
 
3
- var chunk2YPKHXFJ_js = require('./chunk-2YPKHXFJ.js');
4
- require('./chunk-5CV25BTQ.js');
5
- require('./chunk-WZXCJAKM.js');
3
+ var chunkZJBJFFBQ_js = require('./chunk-ZJBJFFBQ.js');
4
+ require('./chunk-E2HBXOZY.js');
5
+ require('./chunk-EHRZFLWL.js');
6
6
  require('./chunk-3I3PYX2F.js');
7
- require('./chunk-BQG3XKTU.js');
7
+ require('./chunk-R5G6F7RP.js');
8
8
 
9
9
 
10
10
 
11
11
  Object.defineProperty(exports, "DepositAuthMethod", {
12
12
  enumerable: true,
13
- get: function () { return chunk2YPKHXFJ_js.DepositAuthMethod; }
13
+ get: function () { return chunkZJBJFFBQ_js.DepositAuthMethod; }
14
14
  });
15
15
  Object.defineProperty(exports, "PERMIT_TYPES", {
16
16
  enumerable: true,
17
- get: function () { return chunk2YPKHXFJ_js.PERMIT_TYPES; }
17
+ get: function () { return chunkZJBJFFBQ_js.PERMIT_TYPES; }
18
18
  });
19
19
  Object.defineProperty(exports, "WithdrawAuthMethod", {
20
20
  enumerable: true,
21
- get: function () { return chunk2YPKHXFJ_js.WithdrawAuthMethod; }
21
+ get: function () { return chunkZJBJFFBQ_js.WithdrawAuthMethod; }
22
22
  });
23
23
  Object.defineProperty(exports, "isAlreadyApprovedAuth", {
24
24
  enumerable: true,
25
- get: function () { return chunk2YPKHXFJ_js.isAlreadyApprovedAuth; }
25
+ get: function () { return chunkZJBJFFBQ_js.isAlreadyApprovedAuth; }
26
26
  });
27
27
  Object.defineProperty(exports, "isApprovalAuth", {
28
28
  enumerable: true,
29
- get: function () { return chunk2YPKHXFJ_js.isApprovalAuth; }
29
+ get: function () { return chunkZJBJFFBQ_js.isApprovalAuth; }
30
30
  });
31
31
  Object.defineProperty(exports, "isPermitAuth", {
32
32
  enumerable: true,
33
- get: function () { return chunk2YPKHXFJ_js.isPermitAuth; }
33
+ get: function () { return chunkZJBJFFBQ_js.isPermitAuth; }
34
34
  });
35
35
  Object.defineProperty(exports, "isWithdrawAlreadyApprovedAuth", {
36
36
  enumerable: true,
37
- get: function () { return chunk2YPKHXFJ_js.isWithdrawAlreadyApprovedAuth; }
37
+ get: function () { return chunkZJBJFFBQ_js.isWithdrawAlreadyApprovedAuth; }
38
38
  });
39
39
  Object.defineProperty(exports, "isWithdrawApprovalAuth", {
40
40
  enumerable: true,
41
- get: function () { return chunk2YPKHXFJ_js.isWithdrawApprovalAuth; }
41
+ get: function () { return chunkZJBJFFBQ_js.isWithdrawApprovalAuth; }
42
42
  });
43
43
  Object.defineProperty(exports, "parsePermitSignature", {
44
44
  enumerable: true,
45
- get: function () { return chunk2YPKHXFJ_js.parsePermitSignature; }
45
+ get: function () { return chunkZJBJFFBQ_js.parsePermitSignature; }
46
46
  });
47
47
  Object.defineProperty(exports, "prepareApproveDepositTokenTxData", {
48
48
  enumerable: true,
49
- get: function () { return chunk2YPKHXFJ_js.prepareApproveDepositTokenTxData; }
49
+ get: function () { return chunkZJBJFFBQ_js.prepareApproveDepositTokenTxData; }
50
50
  });
51
51
  Object.defineProperty(exports, "prepareApproveWithdrawOrderTxData", {
52
52
  enumerable: true,
53
- get: function () { return chunk2YPKHXFJ_js.prepareApproveWithdrawOrderTxData; }
53
+ get: function () { return chunkZJBJFFBQ_js.prepareApproveWithdrawOrderTxData; }
54
54
  });
55
55
  Object.defineProperty(exports, "prepareCancelWithdrawOrderTxData", {
56
56
  enumerable: true,
57
- get: function () { return chunk2YPKHXFJ_js.prepareCancelWithdrawOrderTxData; }
57
+ get: function () { return chunkZJBJFFBQ_js.prepareCancelWithdrawOrderTxData; }
58
58
  });
59
59
  Object.defineProperty(exports, "prepareDeposit", {
60
60
  enumerable: true,
61
- get: function () { return chunk2YPKHXFJ_js.prepareDeposit; }
61
+ get: function () { return chunkZJBJFFBQ_js.prepareDeposit; }
62
62
  });
63
63
  Object.defineProperty(exports, "prepareDepositAuthorization", {
64
64
  enumerable: true,
65
- get: function () { return chunk2YPKHXFJ_js.prepareDepositAuthorization; }
65
+ get: function () { return chunkZJBJFFBQ_js.prepareDepositAuthorization; }
66
66
  });
67
67
  Object.defineProperty(exports, "prepareDepositPermitSignature", {
68
68
  enumerable: true,
69
- get: function () { return chunk2YPKHXFJ_js.prepareDepositPermitSignature; }
69
+ get: function () { return chunkZJBJFFBQ_js.prepareDepositPermitSignature; }
70
70
  });
71
71
  Object.defineProperty(exports, "prepareDepositTxData", {
72
72
  enumerable: true,
73
- get: function () { return chunk2YPKHXFJ_js.prepareDepositTxData; }
73
+ get: function () { return chunkZJBJFFBQ_js.prepareDepositTxData; }
74
74
  });
75
75
  Object.defineProperty(exports, "prepareDepositWithPermitTxData", {
76
76
  enumerable: true,
77
- get: function () { return chunk2YPKHXFJ_js.prepareDepositWithPermitTxData; }
77
+ get: function () { return chunkZJBJFFBQ_js.prepareDepositWithPermitTxData; }
78
78
  });
79
79
  Object.defineProperty(exports, "prepareWithdrawOrderTxData", {
80
80
  enumerable: true,
81
- get: function () { return chunk2YPKHXFJ_js.prepareWithdrawOrderTxData; }
81
+ get: function () { return chunkZJBJFFBQ_js.prepareWithdrawOrderTxData; }
82
82
  });
83
83
  Object.defineProperty(exports, "prepareWithdrawal", {
84
84
  enumerable: true,
85
- get: function () { return chunk2YPKHXFJ_js.prepareWithdrawal; }
85
+ get: function () { return chunkZJBJFFBQ_js.prepareWithdrawal; }
86
86
  });
87
87
  Object.defineProperty(exports, "prepareWithdrawalAuthorization", {
88
88
  enumerable: true,
89
- get: function () { return chunk2YPKHXFJ_js.prepareWithdrawalAuthorization; }
89
+ get: function () { return chunkZJBJFFBQ_js.prepareWithdrawalAuthorization; }
90
90
  });
91
91
  Object.defineProperty(exports, "toEthSignTypedDataV4", {
92
92
  enumerable: true,
93
- get: function () { return chunk2YPKHXFJ_js.toEthSignTypedDataV4; }
93
+ get: function () { return chunkZJBJFFBQ_js.toEthSignTypedDataV4; }
94
94
  });
95
95
  //# sourceMappingURL=vaults.js.map
96
96
  //# sourceMappingURL=vaults.js.map
package/dist/vaults.mjs CHANGED
@@ -1,7 +1,7 @@
1
- export { DepositAuthMethod, PERMIT_TYPES, WithdrawAuthMethod, isAlreadyApprovedAuth, isApprovalAuth, isPermitAuth, isWithdrawAlreadyApprovedAuth, isWithdrawApprovalAuth, parsePermitSignature, prepareApproveDepositTokenTxData, prepareApproveWithdrawOrderTxData, prepareCancelWithdrawOrderTxData, prepareDeposit, prepareDepositAuthorization, prepareDepositPermitSignature, prepareDepositTxData, prepareDepositWithPermitTxData, prepareWithdrawOrderTxData, prepareWithdrawal, prepareWithdrawalAuthorization, toEthSignTypedDataV4 } from './chunk-TPU2HZAX.mjs';
2
- import './chunk-CQZCGPZK.mjs';
3
- import './chunk-VZED4E3L.mjs';
1
+ export { DepositAuthMethod, PERMIT_TYPES, WithdrawAuthMethod, isAlreadyApprovedAuth, isApprovalAuth, isPermitAuth, isWithdrawAlreadyApprovedAuth, isWithdrawApprovalAuth, parsePermitSignature, prepareApproveDepositTokenTxData, prepareApproveWithdrawOrderTxData, prepareCancelWithdrawOrderTxData, prepareDeposit, prepareDepositAuthorization, prepareDepositPermitSignature, prepareDepositTxData, prepareDepositWithPermitTxData, prepareWithdrawOrderTxData, prepareWithdrawal, prepareWithdrawalAuthorization, toEthSignTypedDataV4 } from './chunk-L3X5UBG6.mjs';
2
+ import './chunk-4OEL42W2.mjs';
3
+ import './chunk-HBFBGNRH.mjs';
4
4
  import './chunk-7RWWVUHP.mjs';
5
- import './chunk-RW7PZETN.mjs';
5
+ import './chunk-7RAFG3NI.mjs';
6
6
  //# sourceMappingURL=vaults.mjs.map
7
7
  //# sourceMappingURL=vaults.mjs.map