Skip to content

Commit

Permalink
Merge branch 'main' into chore/start-documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
iherger committed Jan 29, 2024
2 parents 4c40fb9 + 25eaffe commit 13267c0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
6 changes: 6 additions & 0 deletions packages/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @enzymefinance/sdk

## 0.7.9

### Patch Changes

- [#378](https://github.com/enzymefinance/sdk/pull/378) [`0f3a059`](https://github.com/enzymefinance/sdk/commit/0f3a05922ea26c4b85e6fbd53bdc815442be6ced) Thanks [@KedziaPawel](https://github.com/KedziaPawel)! - Add uniswap v3 get pool

## 0.7.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@enzymefinance/sdk",
"description": "Enzyme is an Ethereum-based protocol for decentralized on-chain asset management.",
"version": "0.7.8",
"version": "0.7.9",
"type": "module",
"publishConfig": {
"access": "public",
Expand Down
19 changes: 18 additions & 1 deletion packages/sdk/src/Portfolio/Integrations/UniswapV3.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Address, type Hex, PublicClient, decodeAbiParameters, encodeAbiParameters } from "viem";
import { type Address, type Hex, PublicClient, decodeAbiParameters, encodeAbiParameters, parseAbi } from "viem";
import { Viem } from "../../Utils.js";
import * as ExternalPositionManager from "../../_internal/ExternalPositionManager.js";
import * as IntegrationManager from "../../_internal/IntegrationManager.js";
Expand Down Expand Up @@ -527,3 +527,20 @@ export async function getPendingFees(

return { pendingFees0, pendingFees1 };
}

export function getPool(
client: PublicClient,
args: Viem.ContractCallParameters<{
factory: Address;
tokenA: Address;
tokenB: Address;
fee: number;
}>,
) {
return Viem.readContract(client, args, {
abi: parseAbi(["function getPool(address,address,uint24) view returns (address)"]),
functionName: "getPool",
address: args.factory,
args: [args.tokenA, args.tokenB, args.fee],
});
}

0 comments on commit 13267c0

Please sign in to comment.