@hawksightco/hawk-sdk
Advanced tools
Comparing version 0.0.46 to 0.0.47
@@ -36,2 +36,3 @@ "use strict"; | ||
exports.getFeeEstimate = exports.resultOrError = exports.createTxMetadata = void 0; | ||
const client = __importStar(require("@hawksightco/swagger-client")); | ||
const web3 = __importStar(require("@solana/web3.js")); | ||
@@ -127,5 +128,22 @@ const Transaction_1 = require("./classes/Transaction"); | ||
}); | ||
return (yield resultOrError(response, (result) => __awaiter(this, void 0, void 0, function* () { return result.priorityFeeEstimate; }))).data; | ||
return (yield resultOrError(response, (result) => __awaiter(this, void 0, void 0, function* () { | ||
let priorityFee; | ||
if (priority === client.PriorityLevel.Default || priority === client.PriorityLevel.Medium) { | ||
priorityFee = result.feeLevels._default; | ||
} | ||
else if (priority === client.PriorityLevel.High) { | ||
priorityFee = result.feeLevels.high; | ||
} | ||
else if (priority === client.PriorityLevel.VeryHigh) { | ||
priorityFee = result.feeLevels.high; | ||
} | ||
else { | ||
const max = result.feeLevels._default; | ||
const min = result.feeLevels.low; | ||
priorityFee = min + ((max - min) / 2); | ||
} | ||
return result.priorityFeeEstimate; | ||
}))).data; | ||
}); | ||
} | ||
exports.getFeeEstimate = getFeeEstimate; |
{ | ||
"name": "@hawksightco/hawk-sdk", | ||
"version": "0.0.46", | ||
"version": "0.0.47", | ||
"description": "Hawksight v2 SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
136710
2467
32