{"_id":"@allianceblock/abdex-sdk-v2","_rev":"19-254e177feb85690e8448fa40cc83bf89","name":"@allianceblock/abdex-sdk-v2","description":"This SDK is used to provide all needed functionality and comunication with the ABDEX Smart contrcts. > The main export from this SDK is the `async function initSDK`.","dist-tags":{"latest":"0.1.24"},"versions":{"0.1.24":{"name":"@allianceblock/abdex-sdk-v2","version":"0.1.24","author":{"name":"AllianceBlock"},"license":"MIT","_id":"@allianceblock/abdex-sdk-v2@0.1.24","maintainers":[{"name":"guillermoriv","email":"guillermo@allianceblock.io"},{"name":"jucaffet","email":"julien@allianceblock.io"},{"name":"ochikov","email":"ognqn.chikov@gmail.com"},{"name":"jcaffet","email":"jerome@allianceblock.io"},{"name":"defimati","email":"matthijs@allianceblock.io"},{"name":"gideon","email":"gideongideon@gmail.com"},{"name":"jonathnj","email":"jonathan@allianceblock.io"}],"dist":{"shasum":"b76832d5b637c1c290f8e78c9761f9482be581a6","tarball":"https://registry.npmjs.org/@allianceblock/abdex-sdk-v2/-/abdex-sdk-v2-0.1.24.tgz","fileCount":71,"integrity":"sha512-6rVjZCQTNVTZ+qOz8FyMb8/mr5C9vgo8XfkyqpHU/NIPThkWTB2I8oQ6sWxmYBMLkYrLnaHNC0eKDitB+WCSNw==","signatures":[{"sig":"MEYCIQCLTdAiH6aUKP0Qn+dBRGdG3I9kJ8JumZGITRRYkAB6YwIhAMwvCezlbEgnzuiRavs2H4khQtvbrc5k0kjrKL8nczHW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1658014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCH5FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqnlQ/+K9tyrw0d+ihiw4wrfJytmRwt7iMryPURcnSpn6DcbyCmCGcn\r\nkuaAIjlsGZWzV+lrbm6U+KEj2AjvA98qK0lCUVBgxj+omsX+aveM4mwGPlOC\r\nsN5HNgynISK7GX0BKAWJ8oEiQxEwCKEihhjfbxZ0eWpObCGDfgR84NI64oVM\r\nX2XbZQKQwieF9Ql2IkIV8aaTx/6VLzh8pumahfaM/rh6R7k/hEPQVGptIUeR\r\nQ5dOGn4vyH8y/7BRnvUq7VO6rUAqus80UKrUSH8sGR7wiBCMq7yvDn756mqW\r\nPyQY+GXeAii6UqC5+AmHPIfZBneXN+eUYRflGtn2ObI8qjcLqRFeKepOuwnf\r\nW5WmsGN/COkrFZXNHRrsdUMZjQzyC8/vQ83LOUZyV5SXlVI7xDaKsUEVLjEI\r\nXn9gyrSg6yuRfGX2BNxQcu476smCcO2jNwN9zpWovbQHQqMdyiVu1M2hpnWF\r\nWcyycsgZBHXAwd4yLRgfGYsm80dP928/HLNe5GFQb76dShE84oifAcq2rgUg\r\nEvAWEUDf5wVB2kblDoLw6ZSb6LOvKgsPrWCe/zCEfKgvsjIggZ6lBAQCe70K\r\nI+tb3X86XC38KB9FoAbWl2YV+iSk4XaG6w4eRAzwQjY35hLbpcp6AsVtsDKx\r\nulqBF+OQj55ecmshk1kn02KEPqXUs0wgH0I=\r\n=Y8b1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"pre-commit":"tsdx lint"}},"module":"dist/dex-sdk-v2.esm.js","engines":{"node":">=10"},"scripts":{"lint":"tsdx lint","size":"size-limit","test":"tsdx test ./test/whitelist.test.ts --no-cache --maxWorkers 1","build":"tsdx build","start":"tsdx watch","analyze":"size-limit --why","prepare":"tsdx build","lint:fix":"tsdx lint --fix"},"typings":"dist/index.d.ts","_npmUser":{"name":"guillermoriv","email":"guillermo@allianceblock.io"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/dex-sdk-v2.cjs.production.min.js","limit":"200 KB"},{"path":"dist/dex-sdk-v2.esm.js","limit":"200 KB"}],"description":"This SDK is used to provide all needed functionality and comunication with the ABDEX Smart contrcts. > The main export from this SDK is the `async function initSDK`.","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2021 ochikov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","resolutions":{"**/@typescript-eslint/parser":"^4.4.4","**/@typescript-eslint/eslint-plugin":"^4.4.4"},"dependencies":{"jsbi":"^3.2.5","big.js":"^6.1.1","ethers":"^5.4.7","toformat":"^2.0.0","tiny-warning":"^1.0.3","tiny-invariant":"^1.1.0","ethereumjs-util":"^7.1.3","decimal.js-light":"^2.5.1"},"_hasShrinkwrap":false,"devDependencies":{"tsdx":"^0.14.1","husky":"^7.0.2","tslib":"^2.3.1","size-limit":"^6.0.3","typescript":"^4.4.4","@size-limit/preset-small-lib":"^6.0.3"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/abdex-sdk-v2_0.1.24_1661500997236_0.8577200494631443","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-08-26T08:03:17.173Z","modified":"2024-06-14T10:23:05.804Z","0.1.23":"2022-08-26T07:59:53.204Z","0.1.24":"2022-08-26T08:03:17.449Z"},"maintainers":[{"email":"cyril@feraudet.com","name":"feraudet"},{"email":"nick+mronadasky@vitanick.dev","name":"mr_onadasky"},{"email":"jorn@allianceblock.io","name":"jornf"},{"email":"ramona@allianceblock.io","name":"mrsfusion"},{"email":"gonzalo@thinkanddev.com","name":"lopezgonzalo"},{"email":"lucas@thinkanddev.com","name":"lucas-marc"},{"email":"rafael-mto@allianceblock.io","name":"rafael-ab"},{"email":"julien@allianceblock.io","name":"jucaffet"},{"email":"jerome@allianceblock.io","name":"jcaffet"},{"email":"matthijs@allianceblock.io","name":"defimati"}],"author":{"name":"AllianceBlock"},"license":"MIT","readme":"# ABDEX SDK Usage\nThis SDK is used to provide all needed functionality and comunication with the ABDEX Smart contrcts.\n> The main export from this SDK is the `async function initSDK`.\n\n## initSDK\n- this function is used in instantiating the main SDK classes\n  * input parameter is ethers.js `Wallet` object with attached `JsonRpcProvider`\n  * returns three types of objects:\n  ```   \n    Pool,\n    DEX,\n    UserContribution\n  ```\n  * used like: `const sdk = await initSDK(signerWithProvider)`\n\n## class Pool\n- instantiated from the `async function initSDK`\n- constriction: `const pool = new sdk.Pool(poolTokenA, poolTokenB, weight)`\n  * poolTokenA is one of the tokens in the LP\n  * poolTokenB is the other token in the LP\n  * weight is ethers.js `BigNumber` and is the weight in the virtual pairs inside the ABDEX LP usually like so: `const weight = BigNumber.from('750000000000000000')`\n- Pool properties include: \n```\n  public contract: Contract;\n  public token1: Token;\n  public token0: Token;\n  public weight: BigNumber;\n```\n- Pool methods:\n * `async getLiquidity(address: string): Promise<TokenAmount>`  - returns the balance of the ALBT LP token for the given address\n * `async getTotalSupply(): Promise<TokenAmount>` - returns the total supply of ALBT LP tokens\n * `async getReserves(): Promise<TokenAmount[] | any[]> ` returns the reserve amoutns for both of the tokens inside the LP\n * `public involvesToken(token: Token): boolean` - a util function to check if the Pool consist of the given token token.\n * `public oppositeToken(token: Token): Token` - returns the other token in the Pool\n * `public getLiquidityValue(reserve: TokenAmount, totalSupply: TokenAmount,liquidity: TokenAmount): TokenAmount` - returns the liquidity for a given token amount. This method is ment to be used only by the `class UserContribution`\n\n## class UserContribution\n- instantiated from the `async function initSDK`\n- constriction: `const userPool = new sdk.UserContribution(pool);`\n  * pool is a Pool object \n- UserContribution properties include:\n```\n  public pool: Pool;\n  public userAddress: string;\n```\n- UserContribution methods:\n* `tokenAisWrappedNativeToken(): Boolean` - checks if tokenA in the `Pool` is nateive\n* `tokenBisWrappedNativeToken(): Boolean` - checks if tokenB in the `Pool` is nateive\n* `async getUserDeposit(): Promise<TokenAmount[]>` - returns the user deposited token amounts\n* `async getUserShare(): Promise<Percent | undefined>` - returns the user % in the LP\n* `async liquidity(): Promise<TokenAmount>` - returns the balance of the ALBT LP token for the `userAddress`\n\n## class Treasury\n- instantiated from the `async function initSDK`\n- constriction: `const treasury = new sdk.Treasury(treasuryAddress,token0,token1);`\n  * treasuryAddress is aquired from \n      ```\n      function getTreasuryAddress(\n      dex.orchestratorTreasuryAddress, // dex is a DEX object\n      token0,\n      token1\n      )\n      ```\n  * token0 is one of the tokens in the treasury\n  * token1 is the other token in the treasury\n- UserContribution properties include:\n```\n  public contract: Contract;\n  public token0: Token;\n  public token1: Token;\n  public signer: Wallet;\n```\n- Treasury methods:\n  * `async approveTokenAmount(signer: Wallet, tokenAmount: TokenAmount)` - utility method that approves token to be used in `treasury.invest(...)` method\n  * `async invest(tokenAmount: TokenAmount, signerWithProvider: Wallet)` - used to invest tokens in the treasury\n  * `async investWithPermit(tokenAmount: TokenAmount, onBehalf: Wallet, deadline: number, v, r, s)` - same as `invest` but with permit\n  * `async approve(spenderAddress: string)` - approves addres in the treasury contract\n  * `async allowance(owner: Wallet, spender: string)` - inspects if the address is approved\n  * `sync balanceOf(investor: Wallet, token: Token)` - returns the user investment of the given token\n  * `async totalInvestments(token: Token)` - returns the total investment of the given token\n\n## class DEX\n- instantiated from the `async function initSDK`\n- constriction: `const dex = new sdk.DEX();`\n- DEX methods:\n  * `async getQuote(pool: Pool, tokenAmount: TokenAmount): Promise<TokenAmount>` - returns a quote amount of the oposite token, used when adding liquidity to LP.\n\n  * `async addLiquidity(tokenAmountA: TokenAmount, tokenAmountB: TokenAmount, pool: Pool, slippageTolerance: number = 50)` - provide liquidity to existing LP or create LP with the given tokens. Returns a populated transaction.\n\n  * `async addNativeLiquidity(currencyAmount: CurrencyAmount, tokenAmount: TokenAmount, pool: Pool)` - Provide liquidity to existing LP or create LP with the given nativeCurrency (like ETH, MATIC) - Token. Returns a populated transaction.\n\n  * `async removeLiquidity(percentToRemove: Percent, userPool: UserPoolContribution, slippage: number)` - Builds a transaction to remove a percentage of the user liquidity from the LP. Returns a populated transaction.\n\n  * `async removeLiquidityWithPermit( percentToRemove: Percent, userPool: UserPoolContribution, slippage: number, deadline: number, v: number, r: string, s: string)` - Same as `removeLiquidity` but uses a `permit` in stead of `approve` on the ERC20. Only usable if the ERC20 supports `permit`. Parameters \"deadline, v, r s\" are all part of the `EIP-2612: permit`. Returns a populated transaction.\n\n  * `async removeNativeLiquidity(percentToRemove: Percent, userPool: UserPoolContribution, slippage: number)` - Same as `removeLiquidity` but for nativeCurrency - Token. Returns a populated transaction.\n\n  * `async removeNativeLiquidityWithPermit(percentToRemove: Percent, userPool: UserPoolContribution, slippage: number, deadline: number, v: number, r: string, s: string)` - Same as `removeNativeLiquidity` but uses a `permit` in stead of `approve` on the ERC20. Only usable if the ERC20 supports `permit`. Parameters \"deadline, v, r s\" are all part of the `EIP-2612: permit`. Returns a populated transaction.\n\n  * `async getAmountsOut(tokenAmount: TokenAmount, path: string[])` - Get a quote for a ExactIn swaps. Represents the amount of token that needs to be outputted in order to get the exact input. Parameter `path` consists of special hashes that are build by the `convertToDexPath` function.\n  \n  Example:\n  ```\n  import { convertToDexPath } from '@stichting-allianceblock-foundation/abdex-sdk-v2';\n\n  const path = convertToDexPath(\n    [tokenA, tokenB],\n    weight\n  );\n\n  // A quote for ExactIn swaps!\n  const amountsOutCall: BigNumber[] = await dex.getAmountsOut(\n    tokenAmountA,\n    path\n  );\n  ```\n  \n  * `async getAmountsIn(tokenAmount: TokenAmount, path: string[])` - Get a quote for a ExactOut swaps. Represents the amount of token that needs to be inputed in order to get the exact output. Parameter `path` consists of special hashes that are build by the `convertToDexPath` function.\n  \n  Example:\n  ```\n  import { convertToDexPath } from '@stichting-allianceblock-foundation/abdex-sdk-v2';\n\n  const path = convertToDexPath(\n    [tokenA, tokenB],\n    weight\n  );\n\n  // A quote for ExactOut swaps!\n  const amountsInCall: BigNumber[] = await dex.getAmountsIn(\n    tokenAmountA,\n    path\n  );\n  ```\n\n\n- DEX methods for swaping tokens:\n  * `async swapExactTokensForTokens`\n  Takes in:\n  ```\n    tokenAmountIn: TokenAmount, // Exact amount of token to be swaped\n    tokenAmountOutMin: TokenAmount, // get the quote from getAmountsOut function\n    to: string,\n    path: string[], // get the path from convertToDexPath function\n    deadline: number\n  ```\n  returns a populated transaction\n  \n  Example:\n  ```\n    const path = convertToDexPath(\n      [tokenAmountA.token, tokenHop, tokenB],\n      weight\n    );\n\n    const amountsOutCall: BigNumber[] = await dex.getAmountsOut(\n      tokenAmountA,\n      path\n    );\n\n    const amountsOut = amountsOutCall[amountsOutCall.length - 1];\n\n    tokenAmountB = new TokenAmount(tokenB, amountsOut.toBigInt());\n\n    const tx = await dex.swapExactTokensForTokens(\n      tokenAmountA,\n      tokenAmountB,\n      signerWithProvider.address,\n      path,\n      getDeadline()\n    );\n\n    const signedTransaction = await signerWithProvider.sendTransaction(tx);\n  ```\n\n  * `async swapTokensForExactTokens`\n  Takes in:\n  ```\n    tokenAmountOut: TokenAmount, // Exact amount of token to be swaped\n    tokenAmountInMax: TokenAmount, // get the quote from getAmountsIn function\n    to: string,\n    path: string[], // get the path from convertToDexPath function\n    deadline: number\n  ```\n  returns a populated transaction\n  \n  Example:\n  ```\n    const path = convertToDexPath(\n      [tokenB, tokenHop, tokenAmountA.token],\n      weight\n    );\n\n    let amountsInCall: BigNumber[] = await dex.getAmountsIn(\n      tokenAmountA,\n      path\n    );\n    const amountsIn = amountsInCall[0];\n    tokenAmountB = new TokenAmount(tokenB, amountsIn.toBigInt());\n\n    const tx = await dex.swapTokensForExactTokens(\n      tokenAmountA,\n      tokenAmountB,\n      signerWithProvider.address,\n      path,\n      getDeadline()\n    );\n\n    const signedTransaction = await signerWithProvider.sendTransaction(tx);\n  ```\n\n  * `async swapExactTokensForNative`\n  Takes in:\n  ```\n    tokenAmountIn: TokenAmount, // Exact amount of token to be swaped\n    nativeAmountOutMin: TokenAmount, // get the quote from getAmountsOut function\n    to: string,\n    path: string[], // get the path from convertToDexPath function\n    deadline: number\n  ```\n  returns a populated transaction\n  \n  Example:\n  ```\n    const path = convertToDexPath(\n      [tokenAmountB.token, tokenHop, native], // native is the wraped Coin\n      weight\n    );\n\n    const amountsOutCall: BigNumber[] = await dex.getAmountsOut(\n      tokenAmountB,\n      path\n    );\n    const amountsOut = amountsOutCall[amountsOutCall.length - 1];\n    const nativeOut = new TokenAmount(native, amountsOut.toBigInt());\n\n    const tx = await dex.swapExactTokensForNative(\n      tokenAmountB,\n      nativeOut,\n      signerWithProvider.address,\n      path,\n      getDeadline()\n    );\n\n    const signedTransaction = await signerWithProvider.sendTransaction(tx);\n  ```\n\n  * `async swapTokensForExactNative`\n  Takes in:\n  ```\n    nativeAmountOut: TokenAmount, // Exact amount of token to be swaped\n    tokenAmountInMax: TokenAmount, // get the quote from getAmountsIn function\n    to: string,\n    path: string[], // get the path from convertToDexPath function\n    deadline: number\n  ```\n  returns a populated transaction\n  \n  Example:\n  ```\n    const path = convertToDexPath(\n      [tokenB, tokenHop, exactNativeOut.token], // native is the wraped Coin\n      weight\n    );\n\n    let amountsInCall: BigNumber[] = await dex.getAmountsIn(\n      exactNativeOut,\n      path\n    );\n    const amountsIn = amountsInCall[0];\n    tokenAmountB = new TokenAmount(tokenB, amountsIn.toBigInt());\n\n    const tx = await dex.swapTokensForExactNative(\n      exactNativeOut,\n      tokenAmountB,\n      signerWithProvider.address,\n      path,\n      getDeadline()\n    );\n\n    const signedTransaction = await signerWithProvider.sendTransaction(tx);\n  ```\n\n  * `async swapNativeForExactTokens`\n  Takes in:\n  ```\n    tokenAmountOut: TokenAmount, // Exact amount of token to be swaped\n    nativeAmountInMax: TokenAmount, // get the quote from getAmountsIn function\n    to: string,\n    path: string[], // get the path from convertToDexPath function\n    deadline: number\n  ```\n  returns a populated transaction\n  \n  Example:\n  ```\n    const path = convertToDexPath(\n      [native, tokenHop, tokenAmountB.token], // native is the wraped Coin\n      weight\n    );\n\n    const amountsInCall: BigNumber[] = await dex.getAmountsIn(\n      tokenAmountB,\n      path\n    );\n    const amountsIn = amountsInCall[0];\n    const nativeIn = new TokenAmount(native, amountsIn.toBigInt());\n\n    const tx = await dex.swapNativeForExactTokens(\n      tokenAmountB,\n      nativeIn,\n      signerWithProvider.address,\n      path,\n      getDeadline()\n    );\n\n    const signedTransaction = await signerWithProvider.sendTransaction(tx);\n  ```\n\n  * `async swapExactNativeForTokens`\n  Takes in:\n  ```\n  nativeAmountIn: TokenAmount, // Exact amount of token to be swaped\n  tokenAmountOutMin: TokenAmount, // get the quote from getAmountsOut function\n  to: string,\n  path: string[], // get the path from convertToDexPath function\n  deadline: number\n  ```\n  returns a populated transaction\n  \n  Example:\n  ```\n    const path = convertToDexPath(\n      [nativeExactIn.token, tokenHop, tokenB], // native is the wraped Coin\n      weight\n    );\n    const amountsOutCall: BigNumber[] = await dex.getAmountsOut(\n      nativeExactIn,\n      path\n    );\n    const amountsOut = amountsOutCall[amountsOutCall.length - 1];\n    tokenAmountB = new TokenAmount(tokenB, amountsOut.toBigInt());\n\n    const tx = await dex.swapExactNativeForTokens(\n      nativeExactIn,\n      tokenAmountB,\n      signerWithProvider.address,\n      path,\n      getDeadline()\n    );\n\n    const signedTransaction = await signerWithProvider.sendTransaction(tx);\n  ```\n- DEX treasury methods:\n  * `async addLiquidityTreasuryRouter(tokenAmountA: TokenAmount,tokenAmountB: TokenAmount,amountATreasury: TokenAmount,amountBTreasury: TokenAmount,pool: Pool,signedAllowance: string,slippageTolerance: number = 500)` - provide liquidity to existing LP or create LP with the given tokens. Invests amountATreasury and amountBTreasury to the treasury. Returns a populated transaction.\n\n  * `async addNativeLiquidityTreasuryRouter(currencyAmount: CurrencyAmount, tokenAmount: TokenAmount, amountATreasury: TokenAmount, amountNativeTreasury: CurrencyAmount, pool: Pool, slippageTolerance: number = 500)` - Provide liquidity to existing LP or create LP with the given nativeCurrency (like ETH, MATIC) - Token. Invests amountATreasury and amountNativeTreasury to the treasury. Returns a populated transaction.\n\n  * `async removeLiquidityTreasuryRouter(percentToRemove: Percent, userPool: UserPoolContribution, amountATreasury: TokenAmount, amountBTreasury: TokenAmount, slippage: number)` - Builds a transaction to remove a percentage of the user liquidity from the LP. Withdraws amountATreasury and amountBTreasury to the treasury Returns a populated transaction.\n\n  * `async removeLiquidityWithPermitTreasuryRouter( percentToRemove: Percent, userPool: UserPoolContribution, amountATreasury: TokenAmount, amountBTreasury: TokenAmount, slippage: number, deadline: number, v: number, r: string, s: string)` - Same as `removeLiquidityTreasuryRouter` but uses a `permit` in stead of `approve` on the ERC20. Only usable if the ERC20 supports `permit`. Parameters \"deadline, v, r s\" are all part of the `EIP-2612: permit`. Returns a populated transaction.\n\n  * `async removeNativeLiquidityTreasuryRouter(percentToRemove: Percent, userPool: UserPoolContribution, amountATreasury: TokenAmount, amountNativeTreasury: CurrencyAmount, slippage: number)` - Same as `removeLiquidityTreasuryRouter` but for nativeCurrency - Token. Returns a populated transaction.\n\n  * `async removeNativeLiquidityWithPermitTreasuryRouter(percentToRemove: Percent, userPool: UserPoolContribution, amountATreasury: TokenAmount, amountNativeTreasury: CurrencyAmount, slippage: number, deadline: number, v: number, r: string, s: string)` - Same as `removeNativeLiquidityTreasuryRouter` but uses a `permit` in stead of `approve` on the ERC20. Only usable if the ERC20 supports `permit`. Parameters \"deadline, v, r s\" are all part of the `EIP-2612: permit`. Returns a populated transaction.\n\n  * `async migrateTreasury(pool: Pool, amountADesired: TokenAmount, amountBDesired: TokenAmount, slippageTolerance: number = 500, deadline: Number)` - migrates tokens from a the treasury to the given pool. Returns a populated transaction.\n\n  * `async migrateTreasuryNative(pool: Pool, amountADesired: TokenAmount, amountBDesired: TokenAmount, slippageTolerance: number = 500, deadline: Number)`  - migrates tokens from a the treasury to the given pool. Used when the pool has a native wrapped token. Returns a populated transaction.\n\n  * `async migratePool(percentToRemove: Percent, userPool: UserPoolContribution, signature: string, slippage: number, deadline: number)` - removes liquidity from the given pool and invests the tokens in the treasury. Returns a populated transaction. When `migratePool()` and not `migratePoolWithPermit()` is used it is verry important to approve the spending of the Pool Token like so:\n  ```\n  const txAppr = await pool.contract.approve(\n      dex.treasuryRouterAddress, // dex is a DEX object\n      await pool.contract.balanceOf(signer.address) // pool is a Pool object\n    );\n  await txAppr.wait();\n  ```\n\n  * `async migratePoolWithPermit(percentToRemove: Percent, userPool: UserPoolContribution, signature: string, slippage: number, deadline: number, v: number, r: string, s: string)` - removes liquidity from the given pool and invests the tokens in the treasury. Uses permit. Parameters \"deadline, v, r s\" are all part of the `EIP-2612: permit`. Returns a populated transaction.\n\n  * `async migratePoolNative(percentToRemove: Percent, userPool: UserPoolContribution, signature: string, slippage: number, deadline: number)` - removes liquidity from the given pool and invests the tokens in the treasury. Used when the pool has a native wrapped token. When `migratePoolNative()` and not `migratePoolNativeWithPermit()` is used it is verry important to approve the spending of the Pool Token like so:\n  ```\n  const txAppr = await pool.contract.approve(\n      dex.treasuryRouterAddress, // dex is a DEX object\n      await pool.contract.balanceOf(signer.address) // pool is a Pool object\n    );\n  await txAppr.wait();\n  ```\n\n  * `async migratePoolNativeWithPermit(percentToRemove: Percent, userPool: UserPoolContribution, signature: string, slippage: number, deadline: number, v: number,r: string,s: string)` - removes liquidity from the given pool and invests the tokens in the treasury. Used when the pool has a native wrapped token. Uses permit. Parameters \"deadline, v, r s\" are all part of the `EIP-2612: permit`. Returns a populated transaction.\n","readmeFilename":"README.md"}