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
4 changes: 1 addition & 3 deletions codegen.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
schema:
process.env.CODEGEN_SCHEMA_URL ||
'https://subsquid.quantus.com/green/graphql',
schema: process.env.CODEGEN_SCHEMA_URL || 'http://localhost:4350/graphql',
documents: ['src/**/*.{ts,tsx}'],
generates: {
'./src/__generated__/': {
Expand Down
98 changes: 13 additions & 85 deletions src/__generated__/gql.ts

Large diffs are not rendered by default.

3,568 changes: 1,929 additions & 1,639 deletions src/__generated__/graphql.ts

Large diffs are not rendered by default.

71 changes: 65 additions & 6 deletions src/api/accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { subDays } from 'date-fns/subDays';
import { QUERY_DEFAULT_LIMIT } from '@/constants/query-default-limit';
import type { AccountSorts } from '@/constants/query-sorts';
import { ACCOUNT_SORTS } from '@/constants/query-sorts';
import { QUERY_UNIFIED_LIMIT } from '@/constants/query-unified-limit';
import type {
AccountListResponse,
AccountResponse,
Expand Down Expand Up @@ -64,14 +65,18 @@ export const accounts = {
orderBy: timestamp_DESC
first: $limit
where: {
extrinsicHash_isNull: false
extrinsic_isNull: false
AND: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }
}
) {
edges {
node {
fee
extrinsicHash
extrinsic {
id
pallet
call
}
block {
height
}
Expand All @@ -95,7 +100,13 @@ export const accounts = {
) {
edges {
node {
extrinsicHash
extrinsic {
id
pallet
call
}
timestamp
status
amount
timestamp
scheduledAt
Expand Down Expand Up @@ -132,7 +143,11 @@ export const accounts = {
height
}
scheduledTransfer {
extrinsicHash
extrinsic {
id
pallet
call
}
amount
timestamp
scheduledAt
Expand Down Expand Up @@ -174,7 +189,11 @@ export const accounts = {
id
}
scheduledTransfer {
extrinsicHash
extrinsic {
id
pallet
call
}
amount
timestamp
scheduledAt
Expand Down Expand Up @@ -222,6 +241,10 @@ export const accounts = {
) {
edges {
node {
timestamp
block {
height
}
interceptor {
id
free
Expand All @@ -240,6 +263,10 @@ export const accounts = {
) {
edges {
node {
timestamp
block {
height
}
who {
id
free
Expand All @@ -251,6 +278,38 @@ export const accounts = {

totalCount
}
wormholeOutputs: wormholeOutputs(
orderBy: wormholeExtrinsic_timestamp_DESC
limit: $limit
where: { exitAccount: { id_eq: $id } }
) {
id
amount
exitAccount {
id
}
wormholeExtrinsic {
id
extrinsic {
id
pallet
call
}
totalAmount
outputCount
timestamp
block {
height
}
outputs {
id
exitAccount {
id
}
amount
}
}
}
}
`;

Expand All @@ -260,7 +319,7 @@ export const accounts = {
...config,
variables: {
id,
limit: QUERY_DEFAULT_LIMIT
limit: QUERY_UNIFIED_LIMIT
}
})
};
Expand Down
85 changes: 78 additions & 7 deletions src/api/blocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { QUERY_DEFAULT_LIMIT } from '@/constants/query-default-limit';
import { QUERY_RECENT_LIMIT } from '@/constants/query-recent-limit';
import type { BlockSorts } from '@/constants/query-sorts';
import { BLOCK_SORTS } from '@/constants/query-sorts';
import { QUERY_UNIFIED_LIMIT } from '@/constants/query-unified-limit';
import type {
BlockListResponse,
BlockResponse,
Expand Down Expand Up @@ -38,6 +39,9 @@ export const blocks = {
height
reward
timestamp
extrinsics {
id
}
}
meta: blocksConnection(orderBy: id_ASC) {
totalCount
Expand Down Expand Up @@ -73,6 +77,9 @@ export const blocks = {
height
reward
timestamp
extrinsics {
id
}
}
}
`;
Expand All @@ -97,22 +104,40 @@ export const blocks = {
height
reward
timestamp
extrinsics(orderBy: indexInBlock_ASC) {
id
pallet
call
success
fee
timestamp
indexInBlock
signer {
id
}
}
}
miners: minerRewards(
minerRewards(
where: {
block: { height_eq: $height }
OR: { block: { hash_eq: $hash } }
}
) {
reward
timestamp
miner {
id
}
block {
height
hash
}
}
transactions: transfersConnection(
orderBy: timestamp_DESC
first: $limit
where: {
extrinsicHash_isNull: false
extrinsic_isNull: false
AND: {
block: { height_eq: $height }
OR: { block: { hash_eq: $hash } }
Expand All @@ -122,7 +147,11 @@ export const blocks = {
edges {
node {
fee
extrinsicHash
extrinsic {
id
pallet
call
}
block {
height
}
Expand All @@ -149,7 +178,13 @@ export const blocks = {
) {
edges {
node {
extrinsicHash
extrinsic {
id
pallet
call
}
timestamp
status
amount
timestamp
scheduledAt
Expand Down Expand Up @@ -253,7 +288,11 @@ export const blocks = {
) {
edges {
node {
extrinsicHash
extrinsic {
id
pallet
call
}
timestamp
delay
block {
Expand Down Expand Up @@ -284,7 +323,11 @@ export const blocks = {
errorModule
errorName
errorType
extrinsicHash
extrinsic {
id
pallet
call
}
timestamp
block {
height
Expand All @@ -294,6 +337,34 @@ export const blocks = {

totalCount
}
wormholeExtrinsics(
orderBy: timestamp_DESC
limit: $limit
where: {
block: { height_eq: $height }
OR: { block: { hash_eq: $hash } }
}
) {
id
extrinsic {
id
pallet
call
}
totalAmount
outputCount
timestamp
block {
height
}
outputs {
id
exitAccount {
id
}
amount
}
}
}
`;

Expand All @@ -306,7 +377,7 @@ export const blocks = {
variables: {
height: !isHash ? Number(id) : -1,
hash: isHash ? id : '',
limit: QUERY_DEFAULT_LIMIT
limit: QUERY_UNIFIED_LIMIT
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/chain-status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const chainStatus = {
) {
transactions: transfersConnection(
orderBy: id_ASC
where: { extrinsicHash_isNull: false }
where: { extrinsic_isNull: false }
) {
totalCount
}
Expand Down
20 changes: 16 additions & 4 deletions src/api/errors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export const errors = {
errorModule
errorName
errorType
extrinsicHash
extrinsic {
id
pallet
call
}
id
timestamp
block {
Expand Down Expand Up @@ -86,7 +90,11 @@ export const errors = {
errorModule
errorName
errorType
extrinsicHash
extrinsic {
id
pallet
call
}
id
timestamp
block {
Expand Down Expand Up @@ -138,12 +146,16 @@ export const errors = {
getByHash: () => {
const GET_ERROR_EVENT_BY_HASH = gql`
query GetErrorEventByHash($hash: String!) {
errorEvents: errorEvents(where: { extrinsicHash_eq: $hash }) {
errorEvents: errorEvents(where: { extrinsic: { id_eq: $hash } }) {
errorDocs
errorModule
errorName
errorType
extrinsicHash
extrinsic {
id
pallet
call
}
id
timestamp
block {
Expand Down
Loading