@streamflow/distributor 13.3.0-alpha.p370.7748e31 → 13.3.1-alpha.p371.561653f
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
package/dist/cjs/index.cjs
CHANGED
|
@@ -5595,7 +5595,8 @@ function calculateDynamicFeeFromSolParams(params) {
|
|
|
5595
5595
|
return raw;
|
|
5596
5596
|
}
|
|
5597
5597
|
async function resolveAirdropFeeLamportsUsingApi(params) {
|
|
5598
|
-
const { distributorAddress, mintAccount, claimableAmount, cluster, apiUrl, apiKey } = params;
|
|
5598
|
+
const { distributorAddress, mintAccount, claimableAmount, cluster, apiUrl, apiKey, claimMaxFeeLamports } = params;
|
|
5599
|
+
const maxFeeBigint = claimMaxFeeLamports !== void 0 ? BigInt(claimMaxFeeLamports) : void 0;
|
|
5599
5600
|
let apiFeesResponse = void 0;
|
|
5600
5601
|
try {
|
|
5601
5602
|
apiFeesResponse = await fetchAirdropFee(distributorAddress, apiUrl, apiKey);
|
|
@@ -5616,7 +5617,7 @@ async function resolveAirdropFeeLamportsUsingApi(params) {
|
|
|
5616
5617
|
}
|
|
5617
5618
|
const claimFeeDynamic = response?.claimFeeDynamic ?? defaultAPIFeesResponse.claimFeeDynamic;
|
|
5618
5619
|
if (!tokenPrice?.value || !solPrice?.value) {
|
|
5619
|
-
return MINIMUM_FEE_FALLBACK;
|
|
5620
|
+
return maxFeeBigint ?? MINIMUM_FEE_FALLBACK;
|
|
5620
5621
|
}
|
|
5621
5622
|
const baseLamports = calculateClaimableLamportsFromPrices({
|
|
5622
5623
|
claimableAmount,
|
|
@@ -5624,9 +5625,10 @@ async function resolveAirdropFeeLamportsUsingApi(params) {
|
|
|
5624
5625
|
solPriceUsd: solPrice.value,
|
|
5625
5626
|
tokenDecimals: mintAccount.decimals
|
|
5626
5627
|
});
|
|
5628
|
+
const maxPriceOverride = maxFeeBigint !== void 0 ? lamportsToSolString(maxFeeBigint) : claimFeeDynamic.maxPrice;
|
|
5627
5629
|
return calculateDynamicFeeFromSolParams({
|
|
5628
5630
|
minPrice: claimFeeDynamic.minPrice,
|
|
5629
|
-
maxPrice:
|
|
5631
|
+
maxPrice: maxPriceOverride,
|
|
5630
5632
|
allocationFactor: claimFeeDynamic.allocationFactor,
|
|
5631
5633
|
claimableLamports: baseLamports
|
|
5632
5634
|
});
|