@streamflow/distributor 13.2.0 → 13.2.1-alpha.p371.2d28b7a
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/cjs/index.cjs +5 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/solana/index.cjs +5 -3
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +3 -0
- package/dist/esm/index.js +5 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.d.ts +3 -0
- package/dist/esm/solana/index.js +5 -3
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -5563,7 +5563,8 @@ function calculateDynamicFeeFromSolParams(params) {
|
|
|
5563
5563
|
return raw;
|
|
5564
5564
|
}
|
|
5565
5565
|
async function resolveAirdropFeeLamportsUsingApi(params) {
|
|
5566
|
-
const { distributorAddress, mintAccount, claimableAmount, cluster, apiUrl, apiKey } = params;
|
|
5566
|
+
const { distributorAddress, mintAccount, claimableAmount, cluster, apiUrl, apiKey, claimMaxFeeLamports } = params;
|
|
5567
|
+
const maxFeeBigint = claimMaxFeeLamports !== void 0 ? BigInt(claimMaxFeeLamports) : void 0;
|
|
5567
5568
|
let apiFeesResponse = void 0;
|
|
5568
5569
|
try {
|
|
5569
5570
|
apiFeesResponse = await fetchAirdropFee(distributorAddress, apiUrl, apiKey);
|
|
@@ -5584,7 +5585,7 @@ async function resolveAirdropFeeLamportsUsingApi(params) {
|
|
|
5584
5585
|
}
|
|
5585
5586
|
const claimFeeDynamic = response?.claimFeeDynamic ?? defaultAPIFeesResponse.claimFeeDynamic;
|
|
5586
5587
|
if (!tokenPrice?.value || !solPrice?.value) {
|
|
5587
|
-
return MINIMUM_FEE_FALLBACK;
|
|
5588
|
+
return maxFeeBigint ?? MINIMUM_FEE_FALLBACK;
|
|
5588
5589
|
}
|
|
5589
5590
|
const baseLamports = calculateClaimableLamportsFromPrices({
|
|
5590
5591
|
claimableAmount,
|
|
@@ -5592,9 +5593,10 @@ async function resolveAirdropFeeLamportsUsingApi(params) {
|
|
|
5592
5593
|
solPriceUsd: solPrice.value,
|
|
5593
5594
|
tokenDecimals: mintAccount.decimals
|
|
5594
5595
|
});
|
|
5596
|
+
const maxPriceOverride = maxFeeBigint !== void 0 ? lamportsToSolString(maxFeeBigint) : claimFeeDynamic.maxPrice;
|
|
5595
5597
|
return calculateDynamicFeeFromSolParams({
|
|
5596
5598
|
minPrice: claimFeeDynamic.minPrice,
|
|
5597
|
-
maxPrice:
|
|
5599
|
+
maxPrice: maxPriceOverride,
|
|
5598
5600
|
allocationFactor: claimFeeDynamic.allocationFactor,
|
|
5599
5601
|
claimableLamports: baseLamports
|
|
5600
5602
|
});
|