@mayanfinance/wormhole-sdk-route
Advanced tools
Comparing version 0.0.2-beta.15 to 0.0.2-beta.16
@@ -10,3 +10,3 @@ import { Quote as MayanQuote, Token } from "@mayanfinance/swap-sdk"; | ||
type NormalizedParams = { | ||
amount: string; | ||
slippagePercentage: number; | ||
}; | ||
@@ -13,0 +13,0 @@ interface ValidatedParams extends routes.ValidatedTransferParams<Options> { |
@@ -15,3 +15,3 @@ import { fetchQuote, swapFromEvm, swapFromSolana, } from "@mayanfinance/swap-sdk"; | ||
gasDrop: 0, | ||
slippage: 5, // this means 5% not 500% dont worry | ||
slippage: 0.05, | ||
deadlineInSeconds: getDefaultDeadline(this.request.from.chain), | ||
@@ -46,3 +46,9 @@ }; | ||
throw new Error("Deadline must be at least 60 seconds"); | ||
return { valid: true, params }; | ||
return { | ||
valid: true, | ||
params, | ||
normalizedParams: { | ||
slippagePercentage: params.options.slippage * 100, | ||
}, | ||
}; | ||
} | ||
@@ -81,3 +87,10 @@ catch (e) { | ||
const { from, to } = this.request; | ||
const quote = await this.fetchQuote(params); | ||
const quote = await this.fetchQuote({ | ||
...params, | ||
options: { | ||
...params.options, | ||
// overwrite slippage with mayan-normalized value | ||
slippage: params.normalizedParams.slippagePercentage, | ||
}, | ||
}); | ||
const fullQuote = { | ||
@@ -84,0 +97,0 @@ success: true, |
@@ -10,3 +10,3 @@ import { Quote as MayanQuote, Token } from "@mayanfinance/swap-sdk"; | ||
type NormalizedParams = { | ||
amount: string; | ||
slippagePercentage: number; | ||
}; | ||
@@ -13,0 +13,0 @@ interface ValidatedParams extends routes.ValidatedTransferParams<Options> { |
@@ -15,3 +15,3 @@ import { fetchQuote, swapFromEvm, swapFromSolana, } from "@mayanfinance/swap-sdk"; | ||
gasDrop: 0, | ||
slippage: 5, // this means 5% not 500% dont worry | ||
slippage: 0.05, | ||
deadlineInSeconds: getDefaultDeadline(this.request.from.chain), | ||
@@ -46,3 +46,9 @@ }; | ||
throw new Error("Deadline must be at least 60 seconds"); | ||
return { valid: true, params }; | ||
return { | ||
valid: true, | ||
params, | ||
normalizedParams: { | ||
slippagePercentage: params.options.slippage * 100, | ||
}, | ||
}; | ||
} | ||
@@ -81,3 +87,10 @@ catch (e) { | ||
const { from, to } = this.request; | ||
const quote = await this.fetchQuote(params); | ||
const quote = await this.fetchQuote({ | ||
...params, | ||
options: { | ||
...params.options, | ||
// overwrite slippage with mayan-normalized value | ||
slippage: params.normalizedParams.slippagePercentage, | ||
}, | ||
}); | ||
const fullQuote = { | ||
@@ -84,0 +97,0 @@ success: true, |
{ | ||
"name": "@mayanfinance/wormhole-sdk-route", | ||
"version": "0.0.2-beta.15", | ||
"version": "0.0.2-beta.16", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
966997
4116