Skip to content

Commit

Permalink
feat: add surplus pool collateral (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
KedziaPawel authored Mar 8, 2024
1 parent 30ec545 commit 128fed7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/silent-shrimps-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@enzymefinance/sdk": patch
---

Get surplus pool collateral
24 changes: 24 additions & 0 deletions packages/sdk/src/Portfolio/Integrations/Liquity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,3 +551,27 @@ export async function getApproxHint(

return { hintAddress, diff, latestRandomSeed };
}

export function getSurplusPoolCollaterall(
client: PublicClient,
args: Viem.ContractCallParameters<{
collSurplusPool: Address;
account: Address;
}>,
) {
return readContract(client, {
...Viem.extractBlockParameters(args),
abi: [
{
inputs: [{ internalType: "address", name: "_account", type: "address" }],
name: "getCollateral",
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
stateMutability: "view",
type: "function",
},
],
functionName: "getCollateral",
address: args.collSurplusPool,
args: [args.account],
});
}

0 comments on commit 128fed7

Please sign in to comment.