@neutral-trade/sdk 0.4.8 → 0.4.9
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.mts +6 -1
- package/dist/index.mjs +5 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -280,6 +280,11 @@ declare function computeDepositFeePreview(grossAmount: number, depositFeeDecimal
|
|
|
280
280
|
feeAmount: number;
|
|
281
281
|
netAmount: number;
|
|
282
282
|
};
|
|
283
|
+
/** Same linear preview as deposit: fee = gross × rate, net = gross − fee. */
|
|
284
|
+
declare function computeWithdrawFeePreview(grossAmount: number, withdrawalFeeDecimal: number): {
|
|
285
|
+
feeAmount: number;
|
|
286
|
+
netAmount: number;
|
|
287
|
+
};
|
|
283
288
|
//#endregion
|
|
284
289
|
//#region src/utils/request-withdraw-shares.d.ts
|
|
285
290
|
/**
|
|
@@ -363,4 +368,4 @@ declare function derivePendingAuthPDA(bundlePDA: PublicKey, programId: PublicKey
|
|
|
363
368
|
*/
|
|
364
369
|
declare function getVaultDepositorAddressSync(programId: PublicKey, vault: PublicKey, authority: PublicKey): PublicKey;
|
|
365
370
|
//#endregion
|
|
366
|
-
export { ALLOWLISTED_BUNDLE_PROGRAM_IDS_BY_CLUSTER, BUNDLE_PROGRAM_ID_V2_MAINNET, type BuildBundleDepositInstructionsParams, type BuildBundleRequestWithdrawInstructionParams, type BundleAccount, type BundleCluster, type BundleProgram, type BundleProvider, DEFAULT_BUNDLE_PROGRAM_ID_DEVNET, DEFAULT_BUNDLE_PROGRAM_ID_MAINNET, DevnetVaultId, type EffectiveFeeBps, type EffectiveVaultFeeDecimals, FEE_OVERRIDE, NeutralTrade, type NeutralTradeConfig, type NeutralTradeCoreContext, type OracleData, SEED_ORACLE, SEED_PENDING_AUTH, SEED_TEMP, SEED_USER, SupportedChain, SupportedToken, type Token, type UserBalanceResult, type UserBundleAccount, type UserBundleTempData, type UserFeeOverrideFields, type VaultBalanceData, VaultCategory, VaultId, type VaultRegistry, type VaultRegistryEntry, VaultType, assertAllowlistedBundleProgramId, bpsToFeeDecimal, bpsToPercentLabel, buildBundleDepositInstructions, buildBundleRequestWithdrawInstruction, buildFeeOverrideMask, computeDepositFeePreview, computeRequestWithdrawalSharesFromAmountRaw, createAllowlistedBundleProgram, createBundleProgramById, createDummyWallet, deriveOraclePDA, derivePendingAuthPDA, deriveTempDataPDA, deriveUserPDA, effectiveFeeBpsToDecimals, estimatePendingBundleFeeToken, feeDecimalToBps, formatFeeOverrideFlags, getBundleProgramId, getDefaultBundleProgramIdByCluster, getSolanaTokenDecimals, getSolanaTokenMint, getVaultByAddress, getVaultById, getVaultDepositorAddressSync, getVaultRegistry, hasAnyFeeOverride, hasCustomFeeRate, hasFeeOverrideFlag, humanFloatToAmountRawString, isAllowlistedBundleProgramId, isValidVaultAddress, parseAmountRawToBigInt, readUserFeeOverrideFields, resolveEffectiveFeeBps, resolveEffectiveFeeBpsFromDefaults, resolveEffectiveVaultFees, tokens, vaultFeeDecimalsToBps, vaults$1 as vaults, vaultsDevnet };
|
|
371
|
+
export { ALLOWLISTED_BUNDLE_PROGRAM_IDS_BY_CLUSTER, BUNDLE_PROGRAM_ID_V2_MAINNET, type BuildBundleDepositInstructionsParams, type BuildBundleRequestWithdrawInstructionParams, type BundleAccount, type BundleCluster, type BundleProgram, type BundleProvider, DEFAULT_BUNDLE_PROGRAM_ID_DEVNET, DEFAULT_BUNDLE_PROGRAM_ID_MAINNET, DevnetVaultId, type EffectiveFeeBps, type EffectiveVaultFeeDecimals, FEE_OVERRIDE, NeutralTrade, type NeutralTradeConfig, type NeutralTradeCoreContext, type OracleData, SEED_ORACLE, SEED_PENDING_AUTH, SEED_TEMP, SEED_USER, SupportedChain, SupportedToken, type Token, type UserBalanceResult, type UserBundleAccount, type UserBundleTempData, type UserFeeOverrideFields, type VaultBalanceData, VaultCategory, VaultId, type VaultRegistry, type VaultRegistryEntry, VaultType, assertAllowlistedBundleProgramId, bpsToFeeDecimal, bpsToPercentLabel, buildBundleDepositInstructions, buildBundleRequestWithdrawInstruction, buildFeeOverrideMask, computeDepositFeePreview, computeRequestWithdrawalSharesFromAmountRaw, computeWithdrawFeePreview, createAllowlistedBundleProgram, createBundleProgramById, createDummyWallet, deriveOraclePDA, derivePendingAuthPDA, deriveTempDataPDA, deriveUserPDA, effectiveFeeBpsToDecimals, estimatePendingBundleFeeToken, feeDecimalToBps, formatFeeOverrideFlags, getBundleProgramId, getDefaultBundleProgramIdByCluster, getSolanaTokenDecimals, getSolanaTokenMint, getVaultByAddress, getVaultById, getVaultDepositorAddressSync, getVaultRegistry, hasAnyFeeOverride, hasCustomFeeRate, hasFeeOverrideFlag, humanFloatToAmountRawString, isAllowlistedBundleProgramId, isValidVaultAddress, parseAmountRawToBigInt, readUserFeeOverrideFields, resolveEffectiveFeeBps, resolveEffectiveFeeBpsFromDefaults, resolveEffectiveVaultFees, tokens, vaultFeeDecimalsToBps, vaults$1 as vaults, vaultsDevnet };
|
package/dist/index.mjs
CHANGED
|
@@ -308,6 +308,10 @@ function computeDepositFeePreview(grossAmount, depositFeeDecimal) {
|
|
|
308
308
|
netAmount: grossAmount - feeAmount
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
|
+
/** Same linear preview as deposit: fee = gross × rate, net = gross − fee. */
|
|
312
|
+
function computeWithdrawFeePreview(grossAmount, withdrawalFeeDecimal) {
|
|
313
|
+
return computeDepositFeePreview(grossAmount, withdrawalFeeDecimal);
|
|
314
|
+
}
|
|
311
315
|
|
|
312
316
|
//#endregion
|
|
313
317
|
//#region src/utils/bundle.ts
|
|
@@ -532,4 +536,4 @@ var NeutralTrade = class NeutralTrade {
|
|
|
532
536
|
};
|
|
533
537
|
|
|
534
538
|
//#endregion
|
|
535
|
-
export { ALLOWLISTED_BUNDLE_PROGRAM_IDS_BY_CLUSTER, BUNDLE_PROGRAM_ID_V2_MAINNET, DEFAULT_BUNDLE_PROGRAM_ID_DEVNET, DEFAULT_BUNDLE_PROGRAM_ID_MAINNET, DevnetVaultId, FEE_OVERRIDE, NeutralTrade, SEED_ORACLE, SEED_PENDING_AUTH, SEED_TEMP, SEED_USER, SupportedChain, SupportedToken, VaultCategory, VaultId, VaultType, assertAllowlistedBundleProgramId, bpsToFeeDecimal, bpsToPercentLabel, buildBundleDepositInstructions, buildBundleRequestWithdrawInstruction, buildFeeOverrideMask, computeDepositFeePreview, computeRequestWithdrawalSharesFromAmountRaw, createAllowlistedBundleProgram, createBundleProgramById, createDummyWallet, deriveOraclePDA, derivePendingAuthPDA, deriveTempDataPDA, deriveUserPDA, effectiveFeeBpsToDecimals, estimatePendingBundleFeeToken, feeDecimalToBps, formatFeeOverrideFlags, getBundleProgramId, getDefaultBundleProgramIdByCluster, getSolanaTokenDecimals, getSolanaTokenMint, getVaultByAddress, getVaultById, getVaultDepositorAddressSync, getVaultRegistry, hasAnyFeeOverride, hasCustomFeeRate, hasFeeOverrideFlag, humanFloatToAmountRawString, isAllowlistedBundleProgramId, isValidVaultAddress, parseAmountRawToBigInt, readUserFeeOverrideFields, resolveEffectiveFeeBps, resolveEffectiveFeeBpsFromDefaults, resolveEffectiveVaultFees, tokens, vaultFeeDecimalsToBps, vaults, vaultsDevnet };
|
|
539
|
+
export { ALLOWLISTED_BUNDLE_PROGRAM_IDS_BY_CLUSTER, BUNDLE_PROGRAM_ID_V2_MAINNET, DEFAULT_BUNDLE_PROGRAM_ID_DEVNET, DEFAULT_BUNDLE_PROGRAM_ID_MAINNET, DevnetVaultId, FEE_OVERRIDE, NeutralTrade, SEED_ORACLE, SEED_PENDING_AUTH, SEED_TEMP, SEED_USER, SupportedChain, SupportedToken, VaultCategory, VaultId, VaultType, assertAllowlistedBundleProgramId, bpsToFeeDecimal, bpsToPercentLabel, buildBundleDepositInstructions, buildBundleRequestWithdrawInstruction, buildFeeOverrideMask, computeDepositFeePreview, computeRequestWithdrawalSharesFromAmountRaw, computeWithdrawFeePreview, createAllowlistedBundleProgram, createBundleProgramById, createDummyWallet, deriveOraclePDA, derivePendingAuthPDA, deriveTempDataPDA, deriveUserPDA, effectiveFeeBpsToDecimals, estimatePendingBundleFeeToken, feeDecimalToBps, formatFeeOverrideFlags, getBundleProgramId, getDefaultBundleProgramIdByCluster, getSolanaTokenDecimals, getSolanaTokenMint, getVaultByAddress, getVaultById, getVaultDepositorAddressSync, getVaultRegistry, hasAnyFeeOverride, hasCustomFeeRate, hasFeeOverrideFlag, humanFloatToAmountRawString, isAllowlistedBundleProgramId, isValidVaultAddress, parseAmountRawToBigInt, readUserFeeOverrideFields, resolveEffectiveFeeBps, resolveEffectiveFeeBpsFromDefaults, resolveEffectiveVaultFees, tokens, vaultFeeDecimalsToBps, vaults, vaultsDevnet };
|