Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated decoder constants #25

Merged
merged 8 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions services/decoder/decoder.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export enum DECODED_EVENT_CATEGORY {
DEX = "DEX",
TOKEN = "Token",
SWAP = "Swap",
MINT = "Mint",
DEFI = "DeFi",
BRIDGE = "Bridge",
GAMING = "Gaming",
Expand All @@ -19,7 +18,22 @@ export enum DECODED_ACTION {
MULTISIG_ACTION = "MultiSig",
APPROVAL = "Approval",
TRANSFERRED = "Transferred",
NATIVE_TRANSFER = "Native Token Transfer",
RECEIVED_BRIDGE = "Received Bridge",
ACCOUNT_ABSTRACTION = "Account Abstraction Transaction",
WITHDRAWAL = "Withdrawal",
SALE = "Sale",
MINT = "Mint",
BURN = "Burn",
WITHDRAW = "Withdraw",
DEPOSIT = "Deposit",
ADD_LIQUIDITY = "Add Liquidity",
REMOVE_LIQUIDITY = "Remove Liquidity",
UPDATE = "Update",
FLASHLOAN = "Flashloan",
REPAY = "Repay",
BORROW = "Borrow",
LIQUIDATE = "Liquidate",
CLAIM_REWARDS = "Claim Rewards",
GAME_ACTION = "Game Action",
CREATE = "Create Pool",
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ GoldRushDecoder.fallback(
};

return {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.APPROVAL,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Approval For All",
protocol: {
Expand Down
2 changes: 1 addition & 1 deletion services/decoder/fallbacks/approval/approval.fallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ GoldRushDecoder.fallback(
];

const parsedData: EventType = {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.APPROVAL,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Approval",
protocol: {
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 @@ -76,8 +76,8 @@ GoldRushDecoder.fallback(
];

const parsedData: EventType = {
action: DECODED_ACTION.SWAPPED,
category: DECODED_EVENT_CATEGORY.DEX,
action: DECODED_ACTION.TRANSFERRED,
category: DECODED_EVENT_CATEGORY.TOKEN,
name: "Transfer",
protocol: {
logo: log_event.sender_logo_url as string,
Expand Down
2 changes: 1 addition & 1 deletion services/decoder/native/native.decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DECODED_ACTION, DECODED_EVENT_CATEGORY } from "../decoder.constants";

GoldRushDecoder.native((tx): EventType => {
return {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.NATIVE_TRANSFER,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Native Transfer",
protocol: {
Expand Down
12 changes: 6 additions & 6 deletions services/decoder/protocols/aave-v3/aave-v3.decoders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.TRANSFERRED,
action: DECODED_ACTION.BORROW,
category: DECODED_EVENT_CATEGORY.LENDING,
name: "Borrow",
protocol: {
Expand Down Expand Up @@ -234,7 +234,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.TRANSFERRED,
action: DECODED_ACTION.FLASHLOAN,
category: DECODED_EVENT_CATEGORY.LENDING,
name: "Flash Loan",
protocol: {
Expand Down Expand Up @@ -361,7 +361,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.TRANSFERRED,
action: DECODED_ACTION.LIQUIDATE,
category: DECODED_EVENT_CATEGORY.LENDING,
name: "Liquidation Call",
protocol: {
Expand Down Expand Up @@ -461,7 +461,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.TRANSFERRED,
action: DECODED_ACTION.REPAY,
category: DECODED_EVENT_CATEGORY.LENDING,
name: "Repay",
protocol: {
Expand Down Expand Up @@ -558,7 +558,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.TRANSFERRED,
action: DECODED_ACTION.DEPOSIT,
category: DECODED_EVENT_CATEGORY.LENDING,
name: "Supply",
protocol: {
Expand Down Expand Up @@ -652,7 +652,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.TRANSFERRED,
action: DECODED_ACTION.WITHDRAW,
category: DECODED_EVENT_CATEGORY.LENDING,
name: "Withdraw",
protocol: {
Expand Down
12 changes: 6 additions & 6 deletions services/decoder/protocols/lido/lido.decoders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.TRANSFERRED,
action: DECODED_ACTION.WITHDRAW,
category: DECODED_EVENT_CATEGORY.STAKING,
name: "ETH Distributed",
protocol: {
Expand Down Expand Up @@ -492,7 +492,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.TRANSFERRED,
action: DECODED_ACTION.WITHDRAW,
category: DECODED_EVENT_CATEGORY.STAKING,
name: "Withdrawals Received",
protocol: {
Expand Down Expand Up @@ -678,7 +678,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.TRANSFERRED,
action: DECODED_ACTION.WITHDRAW,
category: DECODED_EVENT_CATEGORY.STAKING,
name: "Withdrawal Requested",
protocol: {
Expand Down Expand Up @@ -750,7 +750,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.TRANSFERRED,
action: DECODED_ACTION.WITHDRAW,
category: DECODED_EVENT_CATEGORY.STAKING,
name: "Withdrawal Claimed",
protocol: {
Expand Down Expand Up @@ -797,7 +797,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.TRANSFERRED,
action: DECODED_ACTION.UPDATE,
category: DECODED_EVENT_CATEGORY.STAKING,
name: "Batch Metadata Update",
protocol: {
Expand Down Expand Up @@ -877,7 +877,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.TRANSFERRED,
action: DECODED_ACTION.WITHDRAW,
category: DECODED_EVENT_CATEGORY.STAKING,
name: "Withdrawals Finalized",
protocol: {
Expand Down
4 changes: 2 additions & 2 deletions services/decoder/protocols/opensea/opensea.decoders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ GoldRushDecoder.on(
}

return {
action: DECODED_ACTION.SWAPPED,
category: DECODED_EVENT_CATEGORY.DEX,
action: DECODED_ACTION.SALE,
category: DECODED_EVENT_CATEGORY.NFT,
name: "Basic Order Fulfilled",
protocol: {
logo: log_event.sender_logo_url as string,
Expand Down
8 changes: 4 additions & 4 deletions services/decoder/protocols/renzo/renzo.decoders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.WITHDRAWAL,
action: DECODED_ACTION.WITHDRAW,
category: DECODED_EVENT_CATEGORY.STAKING,
name: "ShareWithdrawalQueued",
protocol: {
Expand Down Expand Up @@ -121,7 +121,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.WITHDRAWAL,
action: DECODED_ACTION.WITHDRAW,
category: DECODED_EVENT_CATEGORY.STAKING,
name: "WithdrawalQueued",
protocol: {
Expand Down Expand Up @@ -179,7 +179,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.WITHDRAWAL,
action: DECODED_ACTION.WITHDRAW,
category: DECODED_EVENT_CATEGORY.STAKING,
name: "WithdrawalCompleted",
protocol: {
Expand Down Expand Up @@ -290,7 +290,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.TRANSFERRED,
action: DECODED_ACTION.DEPOSIT,
category: DECODED_EVENT_CATEGORY.STAKING,
name: "Deposit",
protocol: {
Expand Down
8 changes: 4 additions & 4 deletions services/decoder/protocols/uniswap-v2/uniswap-v2.decoders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ GoldRushDecoder.on(
);

return {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.ADD_LIQUIDITY,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Mint",
protocol: {
Expand Down Expand Up @@ -256,7 +256,7 @@ GoldRushDecoder.on(
);

return {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.REMOVE_LIQUIDITY,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Burn",
protocol: {
Expand Down Expand Up @@ -358,7 +358,7 @@ GoldRushDecoder.on(
);

return {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.UPDATE,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Sync",
protocol: {
Expand Down Expand Up @@ -447,7 +447,7 @@ GoldRushDecoder.on(
);

return {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.CREATE,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Pair Created",
protocol: {
Expand Down
16 changes: 8 additions & 8 deletions services/decoder/protocols/uniswap-v3/uniswap-v3.decoders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.CREATE,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Pool Created",
protocol: {
Expand Down Expand Up @@ -179,7 +179,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.REMOVE_LIQUIDITY,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Burn",
protocol: {
Expand Down Expand Up @@ -255,7 +255,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.MINT,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Mint",
protocol: {
Expand Down Expand Up @@ -401,7 +401,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.CLAIM_REWARDS,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Collect Fees",
protocol: {
Expand Down Expand Up @@ -471,7 +471,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.FLASHLOAN,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Flash Loan",
protocol: {
Expand Down Expand Up @@ -529,7 +529,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.REMOVE_LIQUIDITY,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Decrease Liquidity",
protocol: {
Expand Down Expand Up @@ -587,7 +587,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.ADD_LIQUIDITY,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Increase Liquidity",
protocol: {
Expand Down Expand Up @@ -645,7 +645,7 @@ GoldRushDecoder.on(
];

return {
action: DECODED_ACTION.SWAPPED,
action: DECODED_ACTION.CLAIM_REWARDS,
category: DECODED_EVENT_CATEGORY.DEX,
name: "Collect",
protocol: {
Expand Down