@mayanfinance/swap-sdk
Advanced tools
Comparing version 3.2.0 to 3.3.0
@@ -5,2 +5,3 @@ define(['exports','cross-fetch','@ethersproject/bytes','ethers','@solana/web3.js','buffer','js-sha3','@solana/buffer-layout'],(function(exports,fetch,bytes,ethers,web3_js,buffer,jsSha3,bufferLayout){'use strict';var addresses = { | ||
"MAYAN_EVM_CONTRACT": "0xB663E1Fc039F83e2dd3Df16f52CB203d615272f5", | ||
"MAYAN_L2_CONTRACT": "0xa2e9add1A212649F06efc21cFa4D7555748d5E40", | ||
"TOKEN_PROGRAM_ID": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", | ||
@@ -75,3 +76,3 @@ "ASSOCIATED_TOKEN_PROGRAM_ID": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", | ||
} | ||
const sdkVersion = [3, 0, 0]; | ||
const sdkVersion = [3, 3, 0]; | ||
function checkSdkVersionSupport(minimumVersion) { | ||
@@ -692,2 +693,4 @@ //major | ||
} | ||
const contractAddress = signerWormholeChainId === 23 ? | ||
addresses.MAYAN_L2_CONTRACT : addresses.MAYAN_EVM_CONTRACT; | ||
const recipientStruct = { | ||
@@ -719,6 +722,6 @@ mayanAddr: recipientHex, | ||
if (quote.fromToken.contract === ethers.ethers.constants.AddressZero) { | ||
return wrapAndSwapETH(addresses.MAYAN_EVM_CONTRACT, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, amountIn, signer, overrides); | ||
return wrapAndSwapETH(contractAddress, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, amountIn, signer, overrides); | ||
} | ||
else { | ||
return swap(addresses.MAYAN_EVM_CONTRACT, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, quote.fromToken.contract, amountIn, signer, overrides); | ||
return swap(contractAddress, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, quote.fromToken.contract, amountIn, signer, overrides); | ||
} | ||
@@ -725,0 +728,0 @@ } |
@@ -5,2 +5,3 @@ 'use strict';var fetch=require('cross-fetch'),bytes=require('@ethersproject/bytes'),ethers=require('ethers'),web3_js=require('@solana/web3.js'),buffer=require('buffer'),jsSha3=require('js-sha3'),bufferLayout=require('@solana/buffer-layout');var addresses = { | ||
"MAYAN_EVM_CONTRACT": "0xB663E1Fc039F83e2dd3Df16f52CB203d615272f5", | ||
"MAYAN_L2_CONTRACT": "0xa2e9add1A212649F06efc21cFa4D7555748d5E40", | ||
"TOKEN_PROGRAM_ID": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", | ||
@@ -75,3 +76,3 @@ "ASSOCIATED_TOKEN_PROGRAM_ID": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", | ||
} | ||
const sdkVersion = [3, 0, 0]; | ||
const sdkVersion = [3, 3, 0]; | ||
function checkSdkVersionSupport(minimumVersion) { | ||
@@ -692,2 +693,4 @@ //major | ||
} | ||
const contractAddress = signerWormholeChainId === 23 ? | ||
addresses.MAYAN_L2_CONTRACT : addresses.MAYAN_EVM_CONTRACT; | ||
const recipientStruct = { | ||
@@ -719,6 +722,6 @@ mayanAddr: recipientHex, | ||
if (quote.fromToken.contract === ethers.ethers.constants.AddressZero) { | ||
return wrapAndSwapETH(addresses.MAYAN_EVM_CONTRACT, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, amountIn, signer, overrides); | ||
return wrapAndSwapETH(contractAddress, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, amountIn, signer, overrides); | ||
} | ||
else { | ||
return swap(addresses.MAYAN_EVM_CONTRACT, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, quote.fromToken.contract, amountIn, signer, overrides); | ||
return swap(contractAddress, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, quote.fromToken.contract, amountIn, signer, overrides); | ||
} | ||
@@ -725,0 +728,0 @@ } |
@@ -5,2 +5,3 @@ import fetch from'cross-fetch';import {zeroPad}from'@ethersproject/bytes';import {ethers}from'ethers';import {PublicKey,Connection,Keypair,Transaction,SystemProgram,SYSVAR_CLOCK_PUBKEY,SYSVAR_RENT_PUBKEY,TransactionInstruction}from'@solana/web3.js';import {Buffer as Buffer$1}from'buffer';import {sha3_256}from'js-sha3';import {struct,u8,nu64,u16,blob}from'@solana/buffer-layout';var addresses = { | ||
"MAYAN_EVM_CONTRACT": "0xB663E1Fc039F83e2dd3Df16f52CB203d615272f5", | ||
"MAYAN_L2_CONTRACT": "0xa2e9add1A212649F06efc21cFa4D7555748d5E40", | ||
"TOKEN_PROGRAM_ID": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", | ||
@@ -75,3 +76,3 @@ "ASSOCIATED_TOKEN_PROGRAM_ID": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", | ||
} | ||
const sdkVersion = [3, 0, 0]; | ||
const sdkVersion = [3, 3, 0]; | ||
function checkSdkVersionSupport(minimumVersion) { | ||
@@ -692,2 +693,4 @@ //major | ||
} | ||
const contractAddress = signerWormholeChainId === 23 ? | ||
addresses.MAYAN_L2_CONTRACT : addresses.MAYAN_EVM_CONTRACT; | ||
const recipientStruct = { | ||
@@ -719,6 +722,6 @@ mayanAddr: recipientHex, | ||
if (quote.fromToken.contract === ethers.constants.AddressZero) { | ||
return wrapAndSwapETH(addresses.MAYAN_EVM_CONTRACT, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, amountIn, signer, overrides); | ||
return wrapAndSwapETH(contractAddress, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, amountIn, signer, overrides); | ||
} | ||
else { | ||
return swap(addresses.MAYAN_EVM_CONTRACT, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, quote.fromToken.contract, amountIn, signer, overrides); | ||
return swap(contractAddress, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, quote.fromToken.contract, amountIn, signer, overrides); | ||
} | ||
@@ -725,0 +728,0 @@ } |
@@ -5,2 +5,3 @@ (function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports,require('cross-fetch'),require('@ethersproject/bytes'),require('ethers'),require('@solana/web3.js'),require('buffer'),require('js-sha3'),require('@solana/buffer-layout')):typeof define==='function'&&define.amd?define(['exports','cross-fetch','@ethersproject/bytes','ethers','@solana/web3.js','buffer','js-sha3','@solana/buffer-layout'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g.MAYAN={},g.fetch,g.bytes,g.ethers,g.web3_js,g.buffer,g.jsSha3,g.bufferLayout));})(this,(function(exports,fetch,bytes,ethers,web3_js,buffer,jsSha3,bufferLayout){'use strict';var addresses = { | ||
"MAYAN_EVM_CONTRACT": "0xB663E1Fc039F83e2dd3Df16f52CB203d615272f5", | ||
"MAYAN_L2_CONTRACT": "0xa2e9add1A212649F06efc21cFa4D7555748d5E40", | ||
"TOKEN_PROGRAM_ID": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", | ||
@@ -75,3 +76,3 @@ "ASSOCIATED_TOKEN_PROGRAM_ID": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", | ||
} | ||
const sdkVersion = [3, 0, 0]; | ||
const sdkVersion = [3, 3, 0]; | ||
function checkSdkVersionSupport(minimumVersion) { | ||
@@ -692,2 +693,4 @@ //major | ||
} | ||
const contractAddress = signerWormholeChainId === 23 ? | ||
addresses.MAYAN_L2_CONTRACT : addresses.MAYAN_EVM_CONTRACT; | ||
const recipientStruct = { | ||
@@ -719,6 +722,6 @@ mayanAddr: recipientHex, | ||
if (quote.fromToken.contract === ethers.ethers.constants.AddressZero) { | ||
return wrapAndSwapETH(addresses.MAYAN_EVM_CONTRACT, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, amountIn, signer, overrides); | ||
return wrapAndSwapETH(contractAddress, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, amountIn, signer, overrides); | ||
} | ||
else { | ||
return swap(addresses.MAYAN_EVM_CONTRACT, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, quote.fromToken.contract, amountIn, signer, overrides); | ||
return swap(contractAddress, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, quote.fromToken.contract, amountIn, signer, overrides); | ||
} | ||
@@ -725,0 +728,0 @@ } |
@@ -5,2 +5,3 @@ declare const _default: { | ||
MAYAN_EVM_CONTRACT: string; | ||
MAYAN_L2_CONTRACT: string; | ||
TOKEN_PROGRAM_ID: string; | ||
@@ -7,0 +8,0 @@ ASSOCIATED_TOKEN_PROGRAM_ID: string; |
@@ -5,2 +5,3 @@ export default { | ||
"MAYAN_EVM_CONTRACT": "0xB663E1Fc039F83e2dd3Df16f52CB203d615272f5", | ||
"MAYAN_L2_CONTRACT": "0xa2e9add1A212649F06efc21cFa4D7555748d5E40", | ||
"TOKEN_PROGRAM_ID": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", | ||
@@ -7,0 +8,0 @@ "ASSOCIATED_TOKEN_PROGRAM_ID": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", |
@@ -22,2 +22,4 @@ import { ethers } from 'ethers'; | ||
} | ||
const contractAddress = signerWormholeChainId === 23 ? | ||
addresses.MAYAN_L2_CONTRACT : addresses.MAYAN_EVM_CONTRACT; | ||
const recipientStruct = { | ||
@@ -49,6 +51,6 @@ mayanAddr: recipientHex, | ||
if (quote.fromToken.contract === ethers.constants.AddressZero) { | ||
return wrapAndSwapETH(addresses.MAYAN_EVM_CONTRACT, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, amountIn, signer, overrides); | ||
return wrapAndSwapETH(contractAddress, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, amountIn, signer, overrides); | ||
} | ||
else { | ||
return swap(addresses.MAYAN_EVM_CONTRACT, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, quote.fromToken.contract, amountIn, signer, overrides); | ||
return swap(contractAddress, contractRelayerFees, recipientStruct, tokenOut, quote.toToken.realOriginChainId, criteria, quote.fromToken.contract, amountIn, signer, overrides); | ||
} | ||
@@ -55,0 +57,0 @@ } |
@@ -75,3 +75,3 @@ import { zeroPad } from '@ethersproject/bytes'; | ||
} | ||
const sdkVersion = [3, 0, 0]; | ||
const sdkVersion = [3, 3, 0]; | ||
export function checkSdkVersionSupport(minimumVersion) { | ||
@@ -78,0 +78,0 @@ //major |
{ | ||
"name": "@mayanfinance/swap-sdk", | ||
"description": "A SDK to swap with Mayan", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"source": "src/main.ts", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
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
218514
5251