Skip to content
Open
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
22 changes: 11 additions & 11 deletions src/lib/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,61 +19,57 @@ import {
} from "viem/chains";

export const CHAINS = {
MAINNET: "mainnet",
ARBITRUM_ONE: "arbitrum_one",
AVALANCHE: "avalanche",
BASE: "base",
BSC: "bsc",
CELO: "celo",
ETHEREUM: "mainnet",
FANTOM: "fantom",
FUSE: "fuse",
MATIC: "matic",
MOONBEAM: "moonbeam",
OPTIMISM: "optimism",
SEPOLIA: "sepolia",
XDAI: "xdai",
GNOSIS: "gnosis",
ZKSYNCERA: "zksyncera",
};

export const CHAIN_SCAN_URLS = {
[CHAINS.MAINNET]: "https://etherscan.io",
[CHAINS.ARBITRUM_ONE]: "https://arbiscan.io",
[CHAINS.AVALANCHE]: "https://cchain.explorer.avax.network",
[CHAINS.BASE]: "https://basescan.org",
[CHAINS.BSC]: "https://bscscan.com",
[CHAINS.CELO]: "https://explorer.celo.org",
[CHAINS.ETHEREUM]: "https://etherscan.io",
[CHAINS.FANTOM]: "https://ftmscan.com",
[CHAINS.FUSE]: "https://explorer.fuse.io",
[CHAINS.MATIC]: "https://explorer-mainnet.maticvigil.com",
[CHAINS.MOONBEAM]: "https://moonbeam-explorer.netlify.app",
[CHAINS.OPTIMISM]: "https://optimistic.etherscan.io",
[CHAINS.SEPOLIA]: "https://sepolia.etherscan.io",
[CHAINS.XDAI]: "https://gnosisscan.io",
[CHAINS.GNOSIS]: "https://gnosisscan.io",
[CHAINS.ZKSYNCERA]: "https://explorer.zksync.io",
};

export enum PAYMENT_CHAINS {
MAINNET = "payment_mainnet",
ARBITRUM_ONE = "payment_arbitrum_one",
AVALANCHE = "payment_avalanche",
BASE = "payment_base",
BSC = "payment_bsc",
CELO = "payment_celo",
ETHEREUM = "payment_ethereum",
FANTOM = "payment_fantom",
FUSE = "payment_fuse",
MATIC = "payment_matic",
MOONBEAM = "payment_moonbeam",
OPTIMISM = "payment_optimism",
SEPOLIA = "payment_sepolia",
XDAI = "payment_xdai",
GNOSIS = "payment_gnosis",
ZKSYNCERA = "payment_zksyncera",
}

export const PUBLIC_CLIENTS = {
[CHAINS.MAINNET]: createPublicClient({
chain: mainnet,
transport: http(),
}),
[CHAINS.ARBITRUM_ONE]: createPublicClient({
chain: arbitrum,
transport: http(),
Expand All @@ -94,6 +90,10 @@ export const PUBLIC_CLIENTS = {
chain: celo,
transport: http(),
}),
[CHAINS.ETHEREUM]: createPublicClient({
chain: mainnet,
transport: http(),
}),
[CHAINS.FANTOM]: createPublicClient({
chain: fantom,
transport: http(),
Expand All @@ -118,7 +118,7 @@ export const PUBLIC_CLIENTS = {
chain: sepolia,
transport: http(),
}),
[CHAINS.XDAI]: createPublicClient({
[CHAINS.GNOSIS]: createPublicClient({
chain: gnosis,
transport: http(),
}),
Expand Down
14 changes: 7 additions & 7 deletions src/lib/hooks/payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const PAYMENTS_QUERY = gql`
${CORE_PAYMENT_FIELDS}
query PaymentsQuery($first: Int, $skip: Int!) {
#
payment_mainnet {
payment_arbitrum_one {
payments(
first: $first
skip: $skip
Expand All @@ -20,7 +20,7 @@ export const PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_arbitrum_one {
payment_avalanche {
payments(
first: $first
skip: $skip
Expand All @@ -30,7 +30,7 @@ export const PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_avalanche {
payment_base {
payments(
first: $first
skip: $skip
Expand All @@ -40,7 +40,7 @@ export const PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_base {
payment_bsc {
payments(
first: $first
skip: $skip
Expand All @@ -50,7 +50,7 @@ export const PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_bsc {
payment_celo {
payments(
first: $first
skip: $skip
Expand All @@ -60,7 +60,7 @@ export const PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_celo {
payment_ethereum {
payments(
first: $first
skip: $skip
Expand Down Expand Up @@ -130,7 +130,7 @@ export const PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_xdai {
payment_gnosis {
payments(
first: $first
skip: $skip
Expand Down
14 changes: 7 additions & 7 deletions src/lib/queries/address-payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { CORE_PAYMENT_FIELDS } from "./utils";
export const ADDRESS_PAYMENTS_QUERY = gql`
${CORE_PAYMENT_FIELDS}
query AddressPaymentsQuery($first: Int, $skip: Int!, $address: Bytes) {
payment_mainnet {
payment_arbitrum_one {
payments(
first: $first
skip: $skip
Expand All @@ -20,7 +20,7 @@ export const ADDRESS_PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_arbitrum_one {
payment_avalanche {
payments(
first: $first
skip: $skip
Expand All @@ -31,7 +31,7 @@ export const ADDRESS_PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_avalanche {
payment_base {
payments(
first: $first
skip: $skip
Expand All @@ -42,7 +42,7 @@ export const ADDRESS_PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_base {
payment_bsc {
payments(
first: $first
skip: $skip
Expand All @@ -53,7 +53,7 @@ export const ADDRESS_PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_bsc {
payment_celo {
payments(
first: $first
skip: $skip
Expand All @@ -64,7 +64,7 @@ export const ADDRESS_PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_celo {
payment_ethereum {
payments(
first: $first
skip: $skip
Expand Down Expand Up @@ -141,7 +141,7 @@ export const ADDRESS_PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_xdai {
payment_gnosis {
payments(
first: $first
skip: $skip
Expand Down
14 changes: 7 additions & 7 deletions src/lib/queries/payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const PAYMENTS_QUERY = gql`
${CORE_PAYMENT_FIELDS}
query PaymentsQuery($first: Int, $skip: Int!) {
#
payment_mainnet {
payment_arbitrum_one {
payments(
first: $first
skip: $skip
Expand All @@ -20,7 +20,7 @@ export const PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_arbitrum_one {
payment_avalanche {
payments(
first: $first
skip: $skip
Expand All @@ -30,7 +30,7 @@ export const PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_avalanche {
payment_base {
payments(
first: $first
skip: $skip
Expand All @@ -40,7 +40,7 @@ export const PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_base {
payment_bsc {
payments(
first: $first
skip: $skip
Expand All @@ -50,7 +50,7 @@ export const PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_bsc {
payment_celo {
payments(
first: $first
skip: $skip
Expand All @@ -60,7 +60,7 @@ export const PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_celo {
payment_ethereum {
payments(
first: $first
skip: $skip
Expand Down Expand Up @@ -130,7 +130,7 @@ export const PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_xdai {
payment_gnosis {
payments(
first: $first
skip: $skip
Expand Down
18 changes: 9 additions & 9 deletions src/lib/queries/request-payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ export const REQUEST_PAYMENTS_QUERY = gql`

query RequestPaymentsQuery($reference: Bytes!) @cached {
#
payment_mainnet {
payment_arbitrum_one {
payments(
where: { reference: $reference }
Comment on lines +14 to +16
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent parameter ordering: where comes before orderBy in payment_arbitrum_one block, while the old payment_mainnet had it after. Consider keeping same order as other blocks.

Suggested change
payment_arbitrum_one {
payments(
where: { reference: $reference }
payment_arbitrum_one {
payments(
where: { reference: $reference }

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/lib/queries/request-payments.ts
Line: 14:16

Comment:
Inconsistent parameter ordering: `where` comes before `orderBy` in `payment_arbitrum_one` block, while the old `payment_mainnet` had it after. Consider keeping same order as other blocks.

```suggestion
    payment_arbitrum_one {
      payments(
        where: { reference: $reference }
```

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

orderBy: timestamp
orderDirection: desc
where: { reference: $reference }
) {
...PaymentFields
}
}
payment_arbitrum_one {
payment_avalanche {
payments(
where: { reference: $reference }
orderBy: timestamp
Expand All @@ -29,7 +29,7 @@ export const REQUEST_PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_avalanche {
payment_base {
payments(
where: { reference: $reference }
orderBy: timestamp
Expand All @@ -38,7 +38,7 @@ export const REQUEST_PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_base {
payment_bsc {
payments(
where: { reference: $reference }
orderBy: timestamp
Expand All @@ -47,7 +47,7 @@ export const REQUEST_PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_bsc {
payment_celo {
payments(
where: { reference: $reference }
orderBy: timestamp
Expand All @@ -56,11 +56,11 @@ export const REQUEST_PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_celo {
payment_ethereum {
payments(
where: { reference: $reference }
orderBy: timestamp
orderDirection: desc
where: { reference: $reference }
Comment on lines +59 to +63
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent parameter ordering: where comes after orderBy in payment_ethereum block, while all other blocks have where first.

Suggested change
payment_ethereum {
payments(
where: { reference: $reference }
orderBy: timestamp
orderDirection: desc
where: { reference: $reference }
payment_ethereum {
payments(
where: { reference: $reference }
orderBy: timestamp
orderDirection: desc
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/lib/queries/request-payments.ts
Line: 59:63

Comment:
Inconsistent parameter ordering: `where` comes after `orderBy` in `payment_ethereum` block, while all other blocks have `where` first.

```suggestion
    payment_ethereum {
      payments(
        where: { reference: $reference }
        orderBy: timestamp
        orderDirection: desc
```

How can I resolve this? If you propose a fix, please make it concise.

) {
...PaymentFields
}
Expand Down Expand Up @@ -119,7 +119,7 @@ export const REQUEST_PAYMENTS_QUERY = gql`
...PaymentFields
}
}
payment_xdai {
payment_gnosis {
payments(
where: { reference: $reference }
orderBy: timestamp
Expand Down
Loading