Skip to content

Commit

Permalink
Merge pull request #281 from pimlicolabs/feat/add-missing-sponsor-fields
Browse files Browse the repository at this point in the history
Feat/expose-getTokenQuotes-exchangeRateInUsd
  • Loading branch information
mouseless0x authored Sep 20, 2024
2 parents 76d741a + a22d6b5 commit 1d42811
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/real-rabbits-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"permissionless": patch
---

Added tokenDecimals and tokenUsdPrice to pimlico_getTokenQuotes
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ const handleMethod = async (

const quotes = {
[getAddress("0xffffffffffffffffffffffffffffffffffffffff")]: {
exchangeRateNativeToUsd: "0x5cc717fbb3450c0000000",
exchangeRate: "0x5cc717fbb3450c0000",
postOpGas: "0xc350"
}
Expand Down
4 changes: 3 additions & 1 deletion packages/permissionless/actions/pimlico/getTokenQuotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type GetTokenQuotesReturnType = {
token: Address
postOpGas: bigint
exchangeRate: bigint
exchangeRateNativeToUsd: bigint
}[]

/**
Expand Down Expand Up @@ -62,6 +63,7 @@ export const getTokenQuotes = async <
return res.quotes.map((quote) => ({
...quote,
postOpGas: hexToBigInt(quote.postOpGas),
exchangeRate: hexToBigInt(quote.exchangeRate)
exchangeRate: hexToBigInt(quote.exchangeRate),
exchangeRateNativeToUsd: hexToBigInt(quote.exchangeRateNativeToUsd)
}))
}
1 change: 1 addition & 0 deletions packages/permissionless/types/pimlico.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type GetTokenQuotesWithBigIntAsHex = {
token: Address
postOpGas: Hex
exchangeRate: Hex
exchangeRateNativeToUsd: Hex
}[]
}

Expand Down

0 comments on commit 1d42811

Please sign in to comment.