Skip to content

Commit

Permalink
!fix: details keys (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
jagnani73 authored Feb 19, 2024
1 parent e0443e4 commit 40f4cea
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Follow the following steps to add a Decoding logic for an event from a contract
};
}[];
details?: {
title: string;
heading: string;
value: string;
type: "address" | "text";
}[];
Expand Down
2 changes: 1 addition & 1 deletion services/decoder/decoder.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type Configs = {
}[];

export type EventDetails = {
title: string;
heading: string;
value: string;
type: "address" | "text";
}[];
Expand Down
4 changes: 2 additions & 2 deletions services/decoder/fallbacks/transfer/transfer.fallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ GoldRushDecoder.fallback(

const details: EventDetails = [
{
title: "From",
heading: "From",
value: decoded.from,
type: "address",
},
{
title: "To",
heading: "To",
value: decoded.to,
type: "address",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,33 +43,33 @@ GoldRushDecoder.on(
},
details: [
{
title: "Gas Cost",
heading: "Gas Cost",
value: (
decoded.actualGasCost /
BigInt(Math.pow(10, sender_contract_decimals))
).toString(),
type: "text",
},
{
title: "Gas Used",
heading: "Gas Used",
value: (
decoded.actualGasUsed /
BigInt(Math.pow(10, sender_contract_decimals))
).toString(),
type: "text",
},
{
title: "Paymaster",
heading: "Paymaster",
value: decoded.paymaster,
type: "address",
},
{
title: "Sender",
heading: "Sender",
value: decoded.sender,
type: "address",
},
{
title: "User Operation Hash",
heading: "User Operation Hash",
value: decoded.userOpHash,
type: "address",
},
Expand Down
52 changes: 26 additions & 26 deletions services/decoder/protocols/aave-v3/aave-v3.decoders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,35 +51,35 @@ GoldRushDecoder.on(

const details: EventDetails = [
{
title: "Reserve",
heading: "Reserve",
value: decoded.reserve,
type: "address",
},
{
title: "User",
heading: "User",
value: decoded.user,
type: "address",
},
{
title: "On Behalf Of",
heading: "On Behalf Of",
value: decoded.onBehalfOf,
type: "address",
},
{
title: "Borrow Rate",
heading: "Borrow Rate",
value:
new Intl.NumberFormat().format(
(Number(decoded.borrowRate) / 1e27) * 100
) + " %",
type: "text",
},
{
title: "Interest Rate Mode",
heading: "Interest Rate Mode",
value: INTEREST_RATE_MODE[decoded.interestRateMode],
type: "text",
},
{
title: "Referal Code",
heading: "Referal Code",
value: String(decoded.referralCode),
type: "text",
},
Expand Down Expand Up @@ -179,22 +179,22 @@ GoldRushDecoder.on(

const details: EventDetails = [
{
title: "Target",
heading: "Target",
value: decoded.target,
type: "address",
},
{
title: "Initiator",
heading: "Initiator",
value: decoded.initiator,
type: "address",
},
{
title: "Asset",
heading: "Asset",
value: decoded.asset,
type: "address",
},
{
title: "Interest Rate Mode",
heading: "Interest Rate Mode",
value: INTEREST_RATE_MODE[decoded.interestRateMode],
type: "text",
},
Expand Down Expand Up @@ -283,27 +283,27 @@ GoldRushDecoder.on(

const details: EventDetails = [
{
title: "Collateral Asset",
heading: "Collateral Asset",
value: decoded.collateralAsset,
type: "address",
},
{
title: "Debt Asset",
heading: "Debt Asset",
value: decoded.debtAsset,
type: "address",
},
{
title: "User",
heading: "User",
value: decoded.user,
type: "address",
},
{
title: "Liquidator",
heading: "Liquidator",
value: decoded.liquidator,
type: "address",
},
{
title: "Receive A Token",
heading: "Receive A Token",
value: decoded.receiveAToken ? "Yes" : "No",
type: "text",
},
Expand Down Expand Up @@ -408,22 +408,22 @@ GoldRushDecoder.on(

const details: EventDetails = [
{
title: "Reserve",
heading: "Reserve",
value: decoded.reserve,
type: "address",
},
{
title: "User",
heading: "User",
value: decoded.user,
type: "address",
},
{
title: "Repayer",
heading: "Repayer",
value: decoded.repayer,
type: "address",
},
{
title: "Use A Tokens",
heading: "Use A Tokens",
value: decoded.useATokens ? "Yes" : "No",
type: "text",
},
Expand Down Expand Up @@ -508,22 +508,22 @@ GoldRushDecoder.on(

const details: EventDetails = [
{
title: "Reserve",
heading: "Reserve",
value: decoded.reserve,
type: "address",
},
{
title: "User",
heading: "User",
value: decoded.user,
type: "address",
},
{
title: "On Behalf Of",
heading: "On Behalf Of",
value: decoded.onBehalfOf,
type: "address",
},
{
title: "Referal Code",
heading: "Referal Code",
value: String(decoded.referralCode),
type: "text",
},
Expand Down Expand Up @@ -604,17 +604,17 @@ GoldRushDecoder.on(

const details: EventDetails = [
{
title: "Reserve",
heading: "Reserve",
value: decoded.reserve,
type: "address",
},
{
title: "User",
heading: "User",
value: decoded.user,
type: "address",
},
{
title: "To",
heading: "To",
value: decoded.to,
type: "address",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ GoldRushDecoder.on(
},
details: [
{
title: "Specimen Hash",
heading: "Specimen Hash",
value: decoded.specimenHash,
type: "address",
},
{
title: "Storage URL",
heading: "Storage URL",
value: decoded.storageURL,
type: "text",
},
{
title: "Submitted Stake",
heading: "Submitted Stake",
value: (
decoded.submittedStake / BigInt(Math.pow(10, 18))
).toString(),
Expand Down
6 changes: 3 additions & 3 deletions services/decoder/protocols/opensea/opensea.decoders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ GoldRushDecoder.on(
const nfts: EventNFTs = [];
const details: EventDetails = [
{
title: "Offerer",
heading: "Offerer",
value: decoded.offerer,
type: "address",
},
{
title: "Recipient",
heading: "Recipient",
value: decoded.recipient,
type: "address",
},
{
title: "Order Hash",
heading: "Order Hash",
value: decoded.orderHash,
type: "address",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@ GoldRushDecoder.on(

const details: EventDetails = [
{
title: "UUID",
heading: "UUID",
value: decoded.uuid,
type: "text",
},
{
title: "Beneficiary",
heading: "Beneficiary",
value: decoded.beneficiary,
type: "address",
},
{
title: "Initiator",
heading: "Initiator",
value: decoded.initiator,
type: "address",
},
{
title: "Expected Amount",
heading: "Expected Amount",
value: calculatePrettyBalance(
decoded.expectedAmount,
destToken?.[0]?.contract_decimals ?? 0
Expand Down
6 changes: 3 additions & 3 deletions services/decoder/protocols/uniswap-v2/uniswap-v2.decoders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ GoldRushDecoder.on(
},
details: [
{
title: "Sender",
heading: "Sender",
type: "address",
value: decoded.sender,
},
{
title: "To",
heading: "To",
type: "address",
value: decoded.to,
},
Expand Down Expand Up @@ -206,7 +206,7 @@ GoldRushDecoder.on(
},
details: [
{
title: "Sender",
heading: "Sender",
type: "address",
value: decoded.sender,
},
Expand Down

0 comments on commit 40f4cea

Please sign in to comment.