Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mayanfinance/wormhole-sdk-route

Package Overview
Dependencies
Maintainers
3
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mayanfinance/wormhole-sdk-route - npm Package Compare versions

Comparing version 0.0.2-beta.15 to 0.0.2-beta.16

2

dist/cjs/index.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc