From 72a32c72d73f7bdd47668173d468723496d5af7a Mon Sep 17 00:00:00 2001 From: ahonn Date: Fri, 27 Sep 2024 11:28:37 +1000 Subject: [PATCH 1/8] refactor: refactor cacheable decorator and implement cron jobs for indexing --- backend/package.json | 1 + .../core/bitcoin-api/bitcoin-api.service.ts | 2 + .../src/core/blockchain/blockchain.service.ts | 33 ++++- backend/src/core/indexer/flow/assets.flow.ts | 14 +- .../core/indexer/flow/transactions.flow.ts | 22 ++- backend/src/core/indexer/indexer.factory.ts | 3 + backend/src/core/indexer/indexer.service.ts | 4 + backend/src/decorators/cacheable.decorator.ts | 136 +++++++++--------- .../bitcoin/address/address.dataloader.ts | 6 - .../transaction/transaction.dataloader.ts | 6 - .../rgbpp/transaction/transaction.resolver.ts | 3 +- .../rgbpp/transaction/transaction.service.ts | 23 +-- pnpm-lock.yaml | 3 + 13 files changed, 144 insertions(+), 112 deletions(-) diff --git a/backend/package.json b/backend/package.json index f96cd7b1..df75afa7 100644 --- a/backend/package.json +++ b/backend/package.json @@ -75,6 +75,7 @@ "reflect-metadata": "^0.2.0", "rpc-websockets": "^7.11.2", "rxjs": "^7.8.1", + "serialize-javascript": "^6.0.2", "ws": "^8.18.0", "zod": "^3.23.8" }, diff --git a/backend/src/core/bitcoin-api/bitcoin-api.service.ts b/backend/src/core/bitcoin-api/bitcoin-api.service.ts index 2de9098b..cc4f5945 100644 --- a/backend/src/core/bitcoin-api/bitcoin-api.service.ts +++ b/backend/src/core/bitcoin-api/bitcoin-api.service.ts @@ -10,6 +10,7 @@ import { ChainInfo, Transaction } from './bitcoin-api.schema'; import { ONE_HOUR_MS, ONE_MONTH_MS, TEN_MINUTES_MS } from 'src/common/date'; import { Cacheable } from 'src/decorators/cacheable.decorator'; import * as Sentry from '@sentry/nestjs'; +import { PLimit } from 'src/decorators/plimit.decorator'; type MethodParameters = T[K] extends (...args: infer P) => any ? P : never; type MethodReturnType = T[K] extends (...args: any[]) => infer R ? R : never; @@ -87,6 +88,7 @@ export class BitcoinApiService { } } + @PLimit({ concurrency: 200 }) private async call( method: K, ...args: MethodParameters diff --git a/backend/src/core/blockchain/blockchain.service.ts b/backend/src/core/blockchain/blockchain.service.ts index 47f1e122..86bc882d 100644 --- a/backend/src/core/blockchain/blockchain.service.ts +++ b/backend/src/core/blockchain/blockchain.service.ts @@ -14,6 +14,7 @@ import { ONE_MONTH_MS } from 'src/common/date'; import { CKB_MIN_SAFE_CONFIRMATIONS } from 'src/constants'; import * as Sentry from '@sentry/nestjs'; import { Chain } from '@prisma/client'; +import { PLimit } from 'src/decorators/plimit.decorator'; class WebsocketError extends Error { constructor(message: string) { @@ -70,6 +71,12 @@ export class BlockchainService { }); } + @PLimit({ concurrency: 200 }) + private async call(method: string, params: any[]): Promise { + await this.websocketReady; + return this.websocket.call(method, params); + } + private handleReconnection() { if (this.reconnectAttempts < this.maxReconnectAttempts) { this.reconnectAttempts++; @@ -122,7 +129,7 @@ export class BlockchainService { ): Promise { await this.websocketReady; this.logger.debug(`get_transaction - txHash: ${txHash}`); - const response = await this.websocket.call('get_transaction', [txHash]); + const response = await this.call('get_transaction', [txHash]); const tx = response as TransactionWithStatusResponse; // XXX: we don't need these fields by default, remove them to save cache/memory space if (!withData) { @@ -162,7 +169,7 @@ export class BlockchainService { ): Promise { await this.websocketReady; this.logger.debug(`get_block - blockHash: ${blockHash}`); - const response = await this.websocket.call('get_block', [blockHash]); + const response = await this.call('get_block', [blockHash]); const block = response as Block; if (!withTxData) { block.transactions = block.transactions.map((tx) => { @@ -204,7 +211,7 @@ export class BlockchainService { ): Promise { await this.websocketReady; this.logger.debug(`get_block_by_number - blockNumber: ${blockNumber}`); - const response = await this.websocket.call('get_block_by_number', [ + const response = await this.call('get_block_by_number', [ BI.from(blockNumber).toHexString(), ]); const block = response as Block; @@ -231,7 +238,7 @@ export class BlockchainService { public async getBlockEconomicState(blockHash: string): Promise { await this.websocketReady; this.logger.debug(`get_block_economic_state - blockHash: ${blockHash}`); - const blockEconomicState = await this.websocket.call('get_block_economic_state', [blockHash]); + const blockEconomicState = await this.call('get_block_economic_state', [blockHash]); return blockEconomicState as BlockEconomicState; } @@ -244,10 +251,16 @@ export class BlockchainService { public async getTipBlockNumber(): Promise { await this.websocketReady; this.logger.debug('get_tip_block_number'); - const tipBlockNumber = await this.websocket.call('get_tip_block_number', []); + const tipBlockNumber = await this.call('get_tip_block_number', []); return BI.from(tipBlockNumber).toNumber(); } + @Cacheable({ + namespace: 'BlockchainService', + key: (searchKey: SearchKey, order: 'asc' | 'desc', limit: string, after?: string) => + `getTransactions:${JSON.stringify(searchKey)}:${order}:${limit}:${after}`, + ttl: 10_000, + }) public async getTransactions( searchKey: SearchKey, order: 'asc' | 'desc', @@ -258,11 +271,17 @@ export class BlockchainService { this.logger.debug( `get_transactions - searchKey: ${JSON.stringify(searchKey)}, order: ${order}, limit: ${limit}, after: ${after}`, ); - const result = await this.websocket.call('get_transactions', [searchKey, order, limit, after]); + const result = await this.call('get_transactions', [searchKey, order, limit, after]); const transactions = result as GetTransactionsResult; return transactions; } + @Cacheable({ + namespace: 'BlockchainService', + key: (searchKey: SearchKey, order: 'asc' | 'desc', limit: string, after?: string) => + `getCells:${JSON.stringify(searchKey)}:${order}:${limit}:${after}`, + ttl: 10_000, + }) public async getCells( searchKey: SearchKey, order: 'asc' | 'desc', @@ -274,7 +293,7 @@ export class BlockchainService { this.logger.debug( `get_cells - searchKey: ${JSON.stringify(searchKey)}, order: ${order}, limit: ${limit}, after: ${after}`, ); - const result = await this.websocket.call('get_cells', [searchKey, order, limit, after]); + const result = await this.call('get_cells', [searchKey, order, limit, after]); const cells = result as GetCellsResult; cells.objects = cells.objects.map((cell) => { if (!withData) { diff --git a/backend/src/core/indexer/flow/assets.flow.ts b/backend/src/core/indexer/flow/assets.flow.ts index e3523e95..8dae2c7f 100644 --- a/backend/src/core/indexer/flow/assets.flow.ts +++ b/backend/src/core/indexer/flow/assets.flow.ts @@ -5,6 +5,8 @@ import { CKB_MIN_SAFE_CONFIRMATIONS, CKB_ONE_DAY_BLOCKS } from 'src/constants'; import { BlockchainService } from 'src/core/blockchain/blockchain.service'; import { PrismaService } from 'src/core/database/prisma/prisma.service'; import { IndexerQueueService } from '../indexer.queue'; +import { CronExpression, SchedulerRegistry } from '@nestjs/schedule'; +import { CronJob } from 'cron'; export enum IndexerAssetsEvent { AssetIndexed = 'asset-indexed', @@ -19,6 +21,7 @@ export class IndexerAssetsFlow extends EventEmitter { private blockchainService: BlockchainService, private prismaService: PrismaService, private indexerQueueService: IndexerQueueService, + private schedulerRegistry: SchedulerRegistry, ) { super(); } @@ -112,7 +115,16 @@ export class IndexerAssetsFlow extends EventEmitter { private setupBlockAssetsIndexedListener() { this.on(IndexerAssetsEvent.BlockAssetsIndexed, () => { - setTimeout(this.startBlockAssetsIndexing.bind(this), 1000 * 10); + if (this.schedulerRegistry.doesExist('cron', 'indexer-block-assets')) { + return; + } + + this.logger.log(`Scheduling block assets indexing cron job`); + const job = new CronJob(CronExpression.EVERY_10_SECONDS, () => { + this.startBlockAssetsIndexing(); + }); + this.schedulerRegistry.addCronJob('indexer-block-assets', job); + job.start(); }); } } diff --git a/backend/src/core/indexer/flow/transactions.flow.ts b/backend/src/core/indexer/flow/transactions.flow.ts index 4ec9f41d..d2698b6c 100644 --- a/backend/src/core/indexer/flow/transactions.flow.ts +++ b/backend/src/core/indexer/flow/transactions.flow.ts @@ -6,6 +6,8 @@ import { BlockchainService } from 'src/core/blockchain/blockchain.service'; import { PrismaService } from 'src/core/database/prisma/prisma.service'; import { IndexerQueueService } from '../indexer.queue'; import { ONE_DAY_MS } from 'src/common/date'; +import { CronExpression, SchedulerRegistry } from '@nestjs/schedule'; +import { CronJob } from 'cron'; const CKB_24_HOURS_BLOCK_NUMBER = ONE_DAY_MS / 10000; @@ -21,16 +23,17 @@ export class IndexerTransactionsFlow extends EventEmitter { private blockchainService: BlockchainService, private prismaService: PrismaService, private indexerQueueService: IndexerQueueService, + private schedulerRegistry: SchedulerRegistry, ) { super(); } public async start() { - this.startBlockAssetsIndexing(); - this.setupBlockAssetsIndexedListener(); + this.startBlockIndexing(); + this.setupBlockIndexedListener(); } - public async startBlockAssetsIndexing() { + public async startBlockIndexing() { const tipBlockNumber = await this.blockchainService.getTipBlockNumber(); let startBlockNumber = tipBlockNumber - CKB_24_HOURS_BLOCK_NUMBER; const targetBlockNumber = tipBlockNumber - CKB_MIN_SAFE_CONFIRMATIONS; @@ -55,9 +58,18 @@ export class IndexerTransactionsFlow extends EventEmitter { }); } - private setupBlockAssetsIndexedListener() { + private setupBlockIndexedListener() { this.on(IndexerTransactionsEvent.BlockIndexed, () => { - setTimeout(this.startBlockAssetsIndexing.bind(this), 1000 * 10); + if (this.schedulerRegistry.doesExist('cron', 'indexer-transactions')) { + return; + } + + this.logger.log(`Scheduling block transactions indexing cron job`); + const job = new CronJob(CronExpression.EVERY_10_SECONDS, () => { + this.startBlockIndexing(); + }); + this.schedulerRegistry.addCronJob('indexer-transactions', job); + job.start(); }); } } diff --git a/backend/src/core/indexer/indexer.factory.ts b/backend/src/core/indexer/indexer.factory.ts index d3d6fb71..093a4bd6 100644 --- a/backend/src/core/indexer/indexer.factory.ts +++ b/backend/src/core/indexer/indexer.factory.ts @@ -4,6 +4,7 @@ import { IndexerService } from './indexer.service'; import { BlockchainServiceFactory } from '../blockchain/blockchain.factory'; import { IndexerQueueService } from './indexer.queue'; import { ModuleRef } from '@nestjs/core'; +import { SchedulerRegistry } from '@nestjs/schedule'; export class IndexerServiceFactoryError extends Error { constructor(message: string) { @@ -19,6 +20,7 @@ export class IndexerServiceFactory implements OnModuleDestroy { constructor( private blockchainServiceFactory: BlockchainServiceFactory, private prismaService: PrismaService, + private schedulerRegistry: SchedulerRegistry, private moduleRef: ModuleRef, ) {} @@ -43,6 +45,7 @@ export class IndexerServiceFactory implements OnModuleDestroy { blockchainService, this.prismaService, indexerQueueService, + this.schedulerRegistry, ); this.services.set(chain.id, service); } diff --git a/backend/src/core/indexer/indexer.service.ts b/backend/src/core/indexer/indexer.service.ts index af8da99d..0e53181a 100644 --- a/backend/src/core/indexer/indexer.service.ts +++ b/backend/src/core/indexer/indexer.service.ts @@ -4,6 +4,7 @@ import { BlockchainService } from '../blockchain/blockchain.service'; import { PrismaService } from '../database/prisma/prisma.service'; import { IndexerQueueService } from './indexer.queue'; import { IndexerTransactionsFlow } from './flow/transactions.flow'; +import { SchedulerRegistry } from '@nestjs/schedule'; export class IndexerService { public assetsFlow: IndexerAssetsFlow; @@ -14,18 +15,21 @@ export class IndexerService { private blockchainService: BlockchainService, private prismaService: PrismaService, private indexerQueueService: IndexerQueueService, + private schedulerRegistry: SchedulerRegistry, ) { this.assetsFlow = new IndexerAssetsFlow( this.chain, this.blockchainService, this.prismaService, this.indexerQueueService, + this.schedulerRegistry, ); this.transactionsFlow = new IndexerTransactionsFlow( this.chain, this.blockchainService, this.prismaService, this.indexerQueueService, + this.schedulerRegistry, ); } diff --git a/backend/src/decorators/cacheable.decorator.ts b/backend/src/decorators/cacheable.decorator.ts index 430add61..a552f9a5 100644 --- a/backend/src/decorators/cacheable.decorator.ts +++ b/backend/src/decorators/cacheable.decorator.ts @@ -1,76 +1,84 @@ -// eslint-disable-next-line no-restricted-imports import { Cache, CACHE_MANAGER } from '@nestjs/cache-manager'; import { Inject, Logger } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; -import { CacheableRegisterOptions, Cacheable as _Cacheable } from 'nestjs-cacheable'; -import { cacheableHandle, generateComposedKey } from 'nestjs-cacheable/dist/cacheable.helper'; import { Env } from 'src/env'; +import serialize from 'serialize-javascript'; +import { createHash } from 'crypto'; -export interface CustomCacheableRegisterOptions extends CacheableRegisterOptions { +const logger = new Logger('Cacheable'); + +type KeyBuilder = string | ((...args: any[]) => string | string[]); + +interface CacheOptions { + key?: KeyBuilder; + namespace?: KeyBuilder; + ttl?: number; shouldCache?: (result: any, target: any) => boolean | Promise; } -const logger = new Logger('Cacheable'); +function extractKeys(keyBuilder: KeyBuilder, args: any[]): string[] { + const keys = typeof keyBuilder === 'function' ? keyBuilder(...args) : keyBuilder; + return Array.isArray(keys) ? keys : [keys]; +} + +function generateCacheKey(options: { + key?: KeyBuilder; + namespace?: KeyBuilder; + methodName: string; + args: any[]; +}): string { + let keys: string[]; + if (options.key) { + keys = extractKeys(options.key, options.args); + } else { + const hash = createHash('md5').update(serialize(options.args)).digest('hex'); + keys = [`${options.methodName}@${hash}`]; + } + + const namespace = options.namespace && extractKeys(options.namespace, options.args); + const composedKey = keys.map((key) => (namespace ? `${namespace[0]}:${key}` : key))[0]; + + return composedKey; +} -/** - * Cacheable decorator with custom options, based on the original Cacheable decorator from the nestjs-cacheable package. - * Adds a shouldCache option to determine whether the result should be cached. - * - * @example - * @Cacheable({ - * ttl: 1000, - * key: (args: any[]) => args[0], - * shouldCache: (result: any) => result !== null, - * }); - */ -export function Cacheable(options: CustomCacheableRegisterOptions): MethodDecorator { - const injectCacheService = Inject(CACHE_MANAGER); - const injectConfigService = Inject(ConfigService); - - return function (target, propertyKey, descriptor) { - // eslint-disable-next-line @typescript-eslint/ban-types - const originalMethod = descriptor.value as unknown as Function; - - injectCacheService(target, '__cacheManager'); - injectConfigService(target, '__configService'); - return { - ...descriptor, - value: async function (...args: any[]) { - const cacheManager = this.__cacheManager as Cache; - if (!cacheManager) return originalMethod.apply(this, args); - const composeOptions: Parameters[0] = { - methodName: String(propertyKey), - key: options.key, - namespace: options.namespace, - args, - }; - const [key] = generateComposedKey(composeOptions); - - const configService = this.__configService as ConfigService; - const branch = configService.get('GIT_BRANCH') || 'unknown'; - const prefix = configService.get('CACHE_KEY_PREFIX'); - - const cacheKey = `${prefix}-${branch}/${key}`; - if (await cacheManager.get(cacheKey)) { - logger.debug(`Cache hit for key: ${key}`); - return cacheManager.get(cacheKey); - } - - const returnVal = await cacheableHandle( - cacheKey, - () => originalMethod.apply(this, args), - options.ttl, - ); - - // Remove the cache if shouldCache returns false - const shouldCache = options.shouldCache ? await options.shouldCache(returnVal, this) : true; - if (!shouldCache) { - logger.debug(`Removing cache for key: ${key}`); - await cacheManager.del(key); - } - return returnVal; - } as any, +export function Cacheable(options: CacheOptions = {}): MethodDecorator { + return function(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) { + const originalMethod = descriptor.value; + + Inject(CACHE_MANAGER)(target, '__cacheManager'); + Inject(ConfigService)(target, '__configService'); + + descriptor.value = async function(...args: any[]) { + const cacheManager = this.__cacheManager as Cache; + if (!cacheManager) return originalMethod.apply(this, args); + + const configService = this.__configService as ConfigService; + const branch = configService.get('GIT_BRANCH') || 'unknown'; + const prefix = configService.get('CACHE_KEY_PREFIX'); + + const baseKey = generateCacheKey({ + methodName: String(propertyKey), + key: options.key, + namespace: options.namespace, + args, + }); + const fullCacheKey = `${prefix}-${branch}/${baseKey}`; + + const cachedValue = await cacheManager.get(fullCacheKey); + if (cachedValue) { + logger.debug(`Cache hit for key: ${baseKey}`); + return cachedValue; + } + + const result = await originalMethod.apply(this, args); + const shouldCache = options.shouldCache ? await options.shouldCache(result, this) : true; + + if (shouldCache) { + await cacheManager.set(fullCacheKey, result, options.ttl); + } + + return result; }; + return descriptor; }; } - diff --git a/backend/src/modules/bitcoin/address/address.dataloader.ts b/backend/src/modules/bitcoin/address/address.dataloader.ts index 69ceb493..7a430f68 100644 --- a/backend/src/modules/bitcoin/address/address.dataloader.ts +++ b/backend/src/modules/bitcoin/address/address.dataloader.ts @@ -13,12 +13,6 @@ export class BitcoinAddressLoader implements NestDataLoader { this.logger.debug(`Loading bitcoin addresses stats: ${addresses.join(', ')}`); diff --git a/backend/src/modules/bitcoin/transaction/transaction.dataloader.ts b/backend/src/modules/bitcoin/transaction/transaction.dataloader.ts index 2a7c2a3a..b9af4cfe 100644 --- a/backend/src/modules/bitcoin/transaction/transaction.dataloader.ts +++ b/backend/src/modules/bitcoin/transaction/transaction.dataloader.ts @@ -14,12 +14,6 @@ export class BitcoinTransactionLoader constructor(private bitcoinApiService: BitcoinApiService) {} - public getOptions() { - return { - maxBatchSize: 20, - }; - } - public getBatchFunction() { return async (ids: string[]) => { this.logger.debug(`Loading bitcoin transactions: ${ids.join(', ')}`); diff --git a/backend/src/modules/rgbpp/transaction/transaction.resolver.ts b/backend/src/modules/rgbpp/transaction/transaction.resolver.ts index 7b1a679c..0a1065b2 100644 --- a/backend/src/modules/rgbpp/transaction/transaction.resolver.ts +++ b/backend/src/modules/rgbpp/transaction/transaction.resolver.ts @@ -17,6 +17,7 @@ import { BitcoinApiService } from 'src/core/bitcoin-api/bitcoin-api.service'; import { BI } from '@ckb-lumos/bi'; import { LeapDirection } from '@prisma/client'; import { ComplexityType } from 'src/modules/complexity.plugin'; +import { isDate } from 'lodash'; @Resolver(() => RgbppTransaction) export class RgbppTransactionResolver { @@ -112,7 +113,7 @@ export class RgbppTransactionResolver { const ckbTx = await ckbTxLoader.load(tx.ckbTxHash); return new Date(BI.from(ckbTx?.time_added_to_pool).toNumber()); } - return tx.blockTime; + return isDate(tx.blockTime) ? tx.blockTime : new Date(tx.blockTime); } @ResolveField(() => LeapDirection, { nullable: true, complexity: ComplexityType.RequestField }) diff --git a/backend/src/modules/rgbpp/transaction/transaction.service.ts b/backend/src/modules/rgbpp/transaction/transaction.service.ts index 2537dd0f..057008b9 100644 --- a/backend/src/modules/rgbpp/transaction/transaction.service.ts +++ b/backend/src/modules/rgbpp/transaction/transaction.service.ts @@ -14,7 +14,7 @@ import { Cacheable } from 'src/decorators/cacheable.decorator'; import { ONE_MONTH_MS } from 'src/common/date'; import { LeapDirection } from '@prisma/client'; import { PrismaService } from 'src/core/database/prisma/prisma.service'; -import { CKB_CHAIN_ID, CKB_MIN_SAFE_CONFIRMATIONS } from 'src/constants'; +import { CKB_CHAIN_ID } from 'src/constants'; @Injectable() export class RgbppTransactionService { @@ -29,15 +29,6 @@ export class RgbppTransactionService { private configService: ConfigService, ) { } - private async isSafeConfirmations(blockNumber: string): Promise { - try { - const tipBlockNumber = await this.ckbRpcService.getTipBlockNumber(); - return BI.from(blockNumber).lt(BI.from(tipBlockNumber).sub(CKB_MIN_SAFE_CONFIRMATIONS)); - } catch { - return false; - } - } - public async getLatestTransactions(limit: number) { const transactions = await this.prismaService.transaction.findMany({ where: { @@ -167,12 +158,6 @@ export class RgbppTransactionService { namespace: 'RgbppTransactionService', key: (btcTx: BitcoinApiInterface.Transaction) => `queryRgbppLockTx:${btcTx.txid}`, ttl: ONE_MONTH_MS, - shouldCache: (tx: RgbppTransaction, that: RgbppTransactionService) => { - if (!tx) { - return false; - } - return that.isSafeConfirmations(BI.from(tx.blockNumber).toHexString()); - }, }) public async queryRgbppLockTx(btcTx: BitcoinApiInterface.Transaction) { const ckbTxs = await Promise.all( @@ -215,12 +200,6 @@ export class RgbppTransactionService { namespace: 'RgbppTransactionService', key: (btcTx: BitcoinApiInterface.Transaction) => `queryRgbppBtcTimeLockTx:${btcTx.txid}`, ttl: ONE_MONTH_MS, - shouldCache: (tx: RgbppTransaction, that: RgbppTransactionService) => { - if (!tx) { - return false; - } - return that.isSafeConfirmations(BI.from(tx.blockNumber).toHexString()); - }, }) public async queryRgbppBtcTimeLockTx(btcTx: BitcoinApiInterface.Transaction) { const ckbTxs = ( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9d6962da..29910e38 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -148,6 +148,9 @@ importers: rxjs: specifier: ^7.8.1 version: 7.8.1 + serialize-javascript: + specifier: ^6.0.2 + version: 6.0.2 ws: specifier: ^8.18.0 version: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) From 7ba2c7737cc94949c616a07049b18b31ca7dbe4c Mon Sep 17 00:00:00 2001 From: ahonn Date: Fri, 27 Sep 2024 11:30:28 +1000 Subject: [PATCH 2/8] chore: remove nestjs-cacheable --- backend/package.json | 1 - backend/src/core/core.service.ts | 2 +- pnpm-lock.yaml | 20 -------------------- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/backend/package.json b/backend/package.json index df75afa7..751f6542 100644 --- a/backend/package.json +++ b/backend/package.json @@ -68,7 +68,6 @@ "graphql-query-complexity": "^1.0.0", "ioredis": "^5.4.1", "lodash": "^4.17.21", - "nestjs-cacheable": "^1.0.0", "p-limit": "^3.1.0", "prisma": "^5.16.2", "redis": "^4.6.7", diff --git a/backend/src/core/core.service.ts b/backend/src/core/core.service.ts index 3f7d05c6..7ab16874 100644 --- a/backend/src/core/core.service.ts +++ b/backend/src/core/core.service.ts @@ -14,8 +14,8 @@ import { Env } from 'src/env'; import { Transaction } from './blockchain/blockchain.interface'; import { BlockchainServiceFactory } from './blockchain/blockchain.factory'; import { LeapDirection } from '@prisma/client'; -import { Cacheable } from 'nestjs-cacheable'; import { ONE_MONTH_MS } from 'src/common/date'; +import { Cacheable } from 'src/decorators/cacheable.decorator'; export const CELLBASE_TX_HASH = '0x0000000000000000000000000000000000000000000000000000000000000000'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 29910e38..da9e15b9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -127,9 +127,6 @@ importers: lodash: specifier: ^4.17.21 version: 4.17.21 - nestjs-cacheable: - specifier: ^1.0.0 - version: 1.0.0(@nestjs/cache-manager@2.2.2(@nestjs/common@10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))(cache-manager@5.7.4)(rxjs@7.8.1))(@nestjs/common@10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))(cache-manager@5.7.4)(serialize-javascript@6.0.2) p-limit: specifier: ^3.1.0 version: 3.1.0 @@ -6939,15 +6936,6 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - nestjs-cacheable@1.0.0: - resolution: {integrity: sha512-eNbTO38FFsvED7T01in7Ktr1JrYNDcRZ20gQB9ePy4O3Zp879oV3AnhAuInXvxhq4EgjW/U/d5t83K5GvGJQAg==} - peerDependencies: - '@nestjs/cache-manager': '*' - '@nestjs/common': '*' - '@nestjs/core': '*' - cache-manager: '*' - serialize-javascript: '*' - next-nprogress-bar@2.3.13: resolution: {integrity: sha512-eJQDvPSUwZ2yRyNKqAH6xTFI4RtIFvs+qtY8essTtfooyaxLGmkanEO7vL83U166bullMtVpixD6FQk5SQkhMw==} @@ -17572,14 +17560,6 @@ snapshots: neo-async@2.6.2: {} - nestjs-cacheable@1.0.0(@nestjs/cache-manager@2.2.2(@nestjs/common@10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))(cache-manager@5.7.4)(rxjs@7.8.1))(@nestjs/common@10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))(cache-manager@5.7.4)(serialize-javascript@6.0.2): - dependencies: - '@nestjs/cache-manager': 2.2.2(@nestjs/common@10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1))(cache-manager@5.7.4)(rxjs@7.8.1) - '@nestjs/common': 10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1) - '@nestjs/core': 10.3.10(@nestjs/common@10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(reflect-metadata@0.2.2)(rxjs@7.8.1) - cache-manager: 5.7.4 - serialize-javascript: 6.0.2 - next-nprogress-bar@2.3.13: dependencies: nprogress: 0.2.0 From a339ecc6b240c49c936a08e8464643f688a21194 Mon Sep 17 00:00:00 2001 From: ahonn Date: Fri, 27 Sep 2024 11:35:34 +1000 Subject: [PATCH 3/8] fix: remove nestjs-cacheable --- backend/src/app.module.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/backend/src/app.module.ts b/backend/src/app.module.ts index ae754497..7171aea5 100644 --- a/backend/src/app.module.ts +++ b/backend/src/app.module.ts @@ -7,7 +7,6 @@ import { redisStore } from 'cache-manager-redis-yet'; import { Env } from './env'; import { CoreModule } from './core/core.module'; import { ApiModule } from './modules/api.module'; -import { CacheableModule } from 'nestjs-cacheable'; import { ScheduleModule } from '@nestjs/schedule'; import { BullModule } from '@nestjs/bullmq'; import configModule from './config'; @@ -18,7 +17,6 @@ import { BootstrapService } from './bootstrap.service'; imports: [ configModule, SentryModule.forRoot(), - CacheableModule.register(), CacheModule.registerAsync({ isGlobal: true, imports: [ConfigModule], From 8c5add2d54e27ca950f093e724db3d5f6b6880b7 Mon Sep 17 00:00:00 2001 From: INS Date: Fri, 27 Sep 2024 09:39:06 +0800 Subject: [PATCH 4/8] fix(frontend): fix background (#215) --- frontend/src/app/layout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index 3bae3270..6451b89f 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -26,7 +26,7 @@ export default function RootLayout({ children }: PropsWithChildren) { const locale = getLocaleFromHeaders() return ( - + {children} From ed1acea1fd0157d351cde89ffd0df211a8c172ce Mon Sep 17 00:00:00 2001 From: ahonn Date: Fri, 27 Sep 2024 14:05:56 +1000 Subject: [PATCH 5/8] perf(graphql): improve complexity calculation for list fields --- backend/src/modules/bitcoin/address/address.resolver.ts | 2 +- backend/src/modules/bitcoin/block/block.resolver.ts | 2 +- .../src/modules/bitcoin/transaction/transaction.model.ts | 5 +++-- backend/src/modules/ckb/block/block.resolver.ts | 2 +- backend/src/modules/complexity.plugin.ts | 6 +++++- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/backend/src/modules/bitcoin/address/address.resolver.ts b/backend/src/modules/bitcoin/address/address.resolver.ts index fa28dfdc..00abbfc6 100644 --- a/backend/src/modules/bitcoin/address/address.resolver.ts +++ b/backend/src/modules/bitcoin/address/address.resolver.ts @@ -60,7 +60,7 @@ export class BitcoinAddressResolver { @ResolveField(() => [BitcoinTransaction], { nullable: true, - complexity: ({ childComplexity }) => ComplexityType.ListField + childComplexity, + complexity: ({ childComplexity }) => ComplexityType.ListField * childComplexity, }) public async transactions( @Parent() address: BitcoinAddress, diff --git a/backend/src/modules/bitcoin/block/block.resolver.ts b/backend/src/modules/bitcoin/block/block.resolver.ts index 71460497..20a225da 100644 --- a/backend/src/modules/bitcoin/block/block.resolver.ts +++ b/backend/src/modules/bitcoin/block/block.resolver.ts @@ -99,7 +99,7 @@ export class BitcoinBlockResolver { @ResolveField(() => [BitcoinTransaction], { nullable: true, - complexity: ({ childComplexity }) => ComplexityType.ListField + childComplexity, + complexity: ({ childComplexity }) => ComplexityType.ListField * childComplexity, }) public async transactions( @Parent() block: BitcoinBlock, diff --git a/backend/src/modules/bitcoin/transaction/transaction.model.ts b/backend/src/modules/bitcoin/transaction/transaction.model.ts index 929e395b..c6c694aa 100644 --- a/backend/src/modules/bitcoin/transaction/transaction.model.ts +++ b/backend/src/modules/bitcoin/transaction/transaction.model.ts @@ -2,6 +2,7 @@ import { Field, Float, Int, ObjectType } from '@nestjs/graphql'; import * as BitcoinApi from 'src/core/bitcoin-api/bitcoin-api.schema'; import { BitcoinOutput } from '../output/output.model'; import { BitcoinInput } from '../input/input.model'; +import { ComplexityType } from 'src/modules/complexity.plugin'; @ObjectType({ description: 'Bitcoin Transaction' }) export class BitcoinTransaction { @@ -20,10 +21,10 @@ export class BitcoinTransaction { @Field(() => Int) version: number; - @Field(() => [BitcoinInput], { nullable: true }) + @Field(() => [BitcoinInput], { nullable: true, complexity: ComplexityType.ListField }) vin: BitcoinInput[]; - @Field(() => [BitcoinOutput]) + @Field(() => [BitcoinOutput], { complexity: ComplexityType.ListField }) vout: BitcoinOutput[]; @Field(() => Float) diff --git a/backend/src/modules/ckb/block/block.resolver.ts b/backend/src/modules/ckb/block/block.resolver.ts index a2415d21..20b88d36 100644 --- a/backend/src/modules/ckb/block/block.resolver.ts +++ b/backend/src/modules/ckb/block/block.resolver.ts @@ -78,7 +78,7 @@ export class CkbBlockResolver { @ResolveField(() => [CkbTransaction], { nullable: true, - complexity: ({ childComplexity }) => ComplexityType.ListField + childComplexity, + complexity: ({ childComplexity }) => ComplexityType.ListField * childComplexity, }) public async transactions( @Parent() { hash }: CkbBlock, diff --git a/backend/src/modules/complexity.plugin.ts b/backend/src/modules/complexity.plugin.ts index a4b4f44e..888727cd 100644 --- a/backend/src/modules/complexity.plugin.ts +++ b/backend/src/modules/complexity.plugin.ts @@ -6,6 +6,7 @@ import { fieldExtensionsEstimator, getComplexity, simpleEstimator } from 'graphq import * as Sentry from '@sentry/nestjs'; import { ConfigService } from '@nestjs/config'; import { Env } from 'src/env'; +import { Logger } from '@nestjs/common'; export enum ComplexityType { RequestField = 3, @@ -14,6 +15,8 @@ export enum ComplexityType { @Plugin() export class ComplexityPlugin implements ApolloServerPlugin { + private logger = new Logger(ComplexityPlugin.name); + constructor( private gqlSchemaHost: GraphQLSchemaHost, private configSErvice: ConfigService, @@ -24,7 +27,7 @@ export class ComplexityPlugin implements ApolloServerPlugin { const { schema } = this.gqlSchemaHost; return { - async didResolveOperation({ request, document }) { + didResolveOperation: async ({ request, document }) => { const complexity = getComplexity({ schema, operationName: request.operationName, @@ -39,6 +42,7 @@ export class ComplexityPlugin implements ApolloServerPlugin { } Sentry.setMeasurement('graphql.complexity', complexity, 'none'); + this.logger.debug(`Query complexity: ${request.operationName} ${complexity}`); if (complexity > maxComplexity) { Sentry.setContext('graphql', { query: request.query, From f374e46500f434fb2ab5ae00aaceacefd023d0eb Mon Sep 17 00:00:00 2001 From: INS Date: Fri, 27 Sep 2024 13:25:58 +0800 Subject: [PATCH 6/8] perf(frontend): pref query (#216) * to(frontend): query * feat(frontend): lazy load transaction in address * feat(frontend): lazy load transaction in address * feat(frontend): lazy load transaction in address * feat(frontend): lazy load transaction in address --- frontend/package.json | 1 + frontend/panda.config.ts | 2 + .../[address]/transactions/btc-tx-list.tsx | 67 ++++ .../[address]/transactions/ckb-tx-list.tsx | 69 ++++ .../address/[address]/transactions/page.tsx | 324 +----------------- .../btc/btc-transaction-card-in-address.tsx | 28 +- ...transaction-card-with-query-in-address.tsx | 173 ++++++++++ ...transaction-card-with-query-in-address.tsx | 128 +++++++ .../src/components/infinite-list-bottom.tsx | 32 ++ .../src/components/intersection-observer.tsx | 22 ++ .../src/components/ui/primitives/skeleton.tsx | 28 ++ frontend/src/configs/ui-preset/skeleton.ts | 18 + frontend/src/constants/query-key.ts | 2 + frontend/src/gql/gql.ts | 23 +- frontend/src/gql/graphql.ts | 34 +- pnpm-lock.yaml | 38 +- 16 files changed, 636 insertions(+), 353 deletions(-) create mode 100644 frontend/src/app/[lang]/address/[address]/transactions/btc-tx-list.tsx create mode 100644 frontend/src/app/[lang]/address/[address]/transactions/ckb-tx-list.tsx create mode 100644 frontend/src/components/btc/btc-transaction-card-with-query-in-address.tsx create mode 100644 frontend/src/components/ckb/ckb-transaction-card-with-query-in-address.tsx create mode 100644 frontend/src/components/infinite-list-bottom.tsx create mode 100644 frontend/src/components/intersection-observer.tsx create mode 100644 frontend/src/components/ui/primitives/skeleton.tsx create mode 100644 frontend/src/configs/ui-preset/skeleton.ts diff --git a/frontend/package.json b/frontend/package.json index a4044881..306fcf3c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -38,6 +38,7 @@ "next-nprogress-bar": "^2.3.13", "react": "^18", "react-dom": "^18", + "react-intersection-observer": "^9.13.1", "typed.js": "^2.1.0", "usehooks-ts": "^3.1.0", "zod": "^3.23.8" diff --git a/frontend/panda.config.ts b/frontend/panda.config.ts index ca5dcdb5..408bd0f7 100644 --- a/frontend/panda.config.ts +++ b/frontend/panda.config.ts @@ -7,6 +7,7 @@ import { iconButton } from '@/configs/ui-preset/icon-button' import { numberInput } from '@/configs/ui-preset/number-input' import { pagination } from '@/configs/ui-preset/pagination' import { popover } from '@/configs/ui-preset/popover' +import { skeleton } from '@/configs/ui-preset/skeleton' import { table } from '@/configs/ui-preset/table' import { tabs } from '@/configs/ui-preset/tabs' import { tooltip } from '@/configs/ui-preset/tooltip' @@ -54,6 +55,7 @@ export default defineConfig({ recipes: { button, iconButton, + skeleton, }, slotRecipes: { table, diff --git a/frontend/src/app/[lang]/address/[address]/transactions/btc-tx-list.tsx b/frontend/src/app/[lang]/address/[address]/transactions/btc-tx-list.tsx new file mode 100644 index 00000000..398c534b --- /dev/null +++ b/frontend/src/app/[lang]/address/[address]/transactions/btc-tx-list.tsx @@ -0,0 +1,67 @@ +'use client' + +import { Trans } from '@lingui/macro' +import { useInfiniteQuery } from '@tanstack/react-query' +import { compact } from 'lodash-es' +import { Center } from 'styled-system/jsx' + +import { BtcTransactionCardWithQueryInAddress } from '@/components/btc/btc-transaction-card-with-query-in-address' +import { InfiniteListBottom } from '@/components/infinite-list-bottom' +import { Loading } from '@/components/loading' +import { NoData } from '@/components/no-data' +import { QueryKey } from '@/constants/query-key' +import { graphql } from '@/gql' +import { graphQLClient } from '@/lib/graphql' + +const btcAddressTxsQuery = graphql(` + query BtcTransactionByAddress($address: String!, $afterTxid: String) { + btcAddress(address: $address) { + transactions(afterTxid: $afterTxid) { + txid + } + } + } +`) + +export function BtcTxList({ address }: { address: string }) { + const { data, isLoading, ...query } = useInfiniteQuery({ + queryKey: [QueryKey.BtcTransactionCardInAddressList, address], + async queryFn({ pageParam }) { + const { btcAddress } = await graphQLClient.request(btcAddressTxsQuery, { + address, + afterTxid: pageParam ? pageParam : undefined, + }) + return btcAddress + }, + select(data) { + return compact(data.pages.flatMap((page) => page?.transactions)) + }, + getNextPageParam(lastPage) { + if (!lastPage?.transactions?.length) return + return lastPage?.transactions?.[lastPage?.transactions?.length - 1].txid + }, + initialData: undefined, + initialPageParam: '', + }) + + if (isLoading) { + return + } + + if (!query.hasNextPage && !data?.length) { + return ( +
+ + No Transaction + +
+ ) + } + + return ( + <> + {data?.map(({ txid }) => )} + + + ) +} diff --git a/frontend/src/app/[lang]/address/[address]/transactions/ckb-tx-list.tsx b/frontend/src/app/[lang]/address/[address]/transactions/ckb-tx-list.tsx new file mode 100644 index 00000000..0bd76d5f --- /dev/null +++ b/frontend/src/app/[lang]/address/[address]/transactions/ckb-tx-list.tsx @@ -0,0 +1,69 @@ +'use client' + +import { Trans } from '@lingui/macro' +import { useInfiniteQuery } from '@tanstack/react-query' +import { compact } from 'lodash-es' +import { Center } from 'styled-system/jsx' + +import { CkbTransactionCardWithQueryInAddress } from '@/components/ckb/ckb-transaction-card-with-query-in-address' +import { InfiniteListBottom } from '@/components/infinite-list-bottom' +import { Loading } from '@/components/loading' +import { NoData } from '@/components/no-data' +import { QueryKey } from '@/constants/query-key' +import { graphql } from '@/gql' +import { graphQLClient } from '@/lib/graphql' + +const ckbAddressTxsQuery = graphql(` + query CkbTransactionByAddress($address: String!, $page: Int!, $pageSize: Int!) { + ckbAddress(address: $address) { + transactionsCount + transactions(page: $page, pageSize: $pageSize) { + hash + } + } + } +`) + +export function CKBTxList({ address }: { address: string }) { + const { data, isLoading, ...query } = useInfiniteQuery({ + queryKey: [QueryKey.CkbTransactionCardInAddressList, address], + async queryFn({ pageParam }) { + const { ckbAddress } = await graphQLClient.request(ckbAddressTxsQuery, { + address, + page: pageParam, + pageSize: 10, + }) + return ckbAddress + }, + select(data) { + return compact(data.pages.flatMap((page) => page?.transactions)) + }, + getNextPageParam(lastPage, _, pageParam) { + if (lastPage?.transactionsCount && pageParam * 10 >= lastPage?.transactionsCount) return + return pageParam + 1 + }, + initialData: undefined, + initialPageParam: 1, + }) + + if (isLoading) { + return + } + + if (!query.hasNextPage && !data?.length) { + return ( +
+ + No Transaction + +
+ ) + } + + return ( + <> + {data?.map(({ hash }) => )} + + + ) +} diff --git a/frontend/src/app/[lang]/address/[address]/transactions/page.tsx b/frontend/src/app/[lang]/address/[address]/transactions/page.tsx index 129187fb..d57adad2 100644 --- a/frontend/src/app/[lang]/address/[address]/transactions/page.tsx +++ b/frontend/src/app/[lang]/address/[address]/transactions/page.tsx @@ -1,333 +1,19 @@ -import { t } from '@lingui/macro' -import { last } from 'lodash-es' import { notFound } from 'next/navigation' -import { Center, HStack, VStack } from 'styled-system/jsx' -import { getI18nInstance } from '@/app/[lang]/appRouterI18n' -import { BtcTransactionCardInAddress } from '@/components/btc/btc-transaction-card-in-address' -import { CkbCellTables } from '@/components/ckb/ckb-cell-tables' -import { IfBreakpoint } from '@/components/if-breakpoint' -import { NoData } from '@/components/no-data' -import { PaginationSearchParams } from '@/components/pagination-searchparams' -import { TransactionHeaderInAddress } from '@/components/transaction-header-in-address' -import { Button, Text } from '@/components/ui' -import Link from '@/components/ui/link' -import { UtxoOrCellFooter } from '@/components/utxo-or-cell-footer' -import { graphql } from '@/gql' -import { BitcoinTransaction, CkbTransaction } from '@/gql/graphql' +import { BtcTxList } from '@/app/[lang]/address/[address]/transactions/btc-tx-list' +import { CKBTxList } from '@/app/[lang]/address/[address]/transactions/ckb-tx-list' import { isValidBTCAddress } from '@/lib/btc/is-valid-btc-address' import { isValidCkbAddress } from '@/lib/ckb/is-valid-ckb-address' -import { graphQLClient } from '@/lib/graphql' -import { resolvePage } from '@/lib/resolve-page' -import { formatNumber } from '@/lib/string/format-number' export const maxDuration = 30 -const btcAddressTxsQuery = graphql(` - query BtcTransactionByAddress($address: String!, $afterTxid: String) { - btcAddress(address: $address) { - transactions(afterTxid: $afterTxid) { - txid - rgbppTransaction { - ckbTransaction { - outputs { - txHash - index - capacity - cellType - type { - codeHash - hashType - args - } - lock { - codeHash - hashType - args - } - status { - consumed - txHash - index - } - xudtInfo { - symbol - amount - decimal - typeHash - } - } - inputs { - txHash - index - capacity - cellType - type { - codeHash - hashType - args - } - lock { - codeHash - hashType - args - } - xudtInfo { - symbol - amount - decimal - typeHash - } - status { - consumed - txHash - index - } - } - } - } - blockHeight - blockHash - txid - version - size - locktime - weight - fee - feeRate - confirmed - confirmations - transactionTime - vin { - txid - vout - scriptsig - scriptsigAsm - isCoinbase - sequence - prevout { - scriptpubkey - scriptpubkeyAsm - scriptpubkeyType - scriptpubkeyAddress - value - status { - spent - txid - vin - } - address { - address - satoshi - pendingSatoshi - transactionsCount - } - } - } - vout { - scriptpubkey - scriptpubkeyAsm - scriptpubkeyType - scriptpubkeyAddress - value - status { - spent - txid - vin - } - address { - address - satoshi - pendingSatoshi - transactionsCount - } - } - } - } - } -`) - -const ckbAddressTxsQuery = graphql(` - query CkbAddress($address: String!, $page: Int!, $pageSize: Int!) { - ckbAddress(address: $address) { - transactionsCount - transactions(page: $page, pageSize: $pageSize) { - isCellbase - blockNumber - hash - fee - size - feeRate - confirmations - inputs { - cellType - status { - consumed - txHash - index - } - txHash - index - capacity - type { - codeHash - hashType - args - } - lock { - codeHash - hashType - args - } - xudtInfo { - symbol - amount - decimal - typeHash - } - } - outputs { - txHash - cellType - index - capacity - type { - codeHash - hashType - args - } - lock { - codeHash - hashType - args - } - xudtInfo { - symbol - amount - decimal - typeHash - } - status { - consumed - txHash - index - } - } - block { - timestamp - } - } - } - } -`) - -export default async function Page({ - params: { address, lang }, - searchParams, -}: { - params: { address: string; lang: string } - searchParams: { page?: string; afterTxid?: string } -}) { - const { afterTxid } = searchParams - const i18n = getI18nInstance(lang) +export default async function Page({ params: { address } }: { params: { address: string; lang: string } }) { if (isValidBTCAddress(address)) { - const { btcAddress } = await graphQLClient.request(btcAddressTxsQuery, { - address, - afterTxid, - }) - - const nextCursor = last(btcAddress?.transactions)?.txid - - if (!btcAddress) notFound() - - return ( - <> - {!btcAddress.transactions?.length ? ( -
- {t(i18n)`No Transaction`} -
- ) : ( - btcAddress.transactions?.map(({ rgbppTransaction, ...tx }) => { - return ( - } - key={tx.txid} - /> - ) - }) - )} -
- - {afterTxid ? ( - - - - ) : null} - {nextCursor ? ( - - - - ) : null} - -
- - ) + return } if (isValidCkbAddress(address)) { - const page = resolvePage(searchParams.page) - const pageSize = 10 - const { ckbAddress } = await graphQLClient.request(ckbAddressTxsQuery, { - address, - page, - pageSize, - }) - - if (!ckbAddress) notFound() - - const total = ckbAddress?.transactionsCount ?? 0 - - return ( - <> - {!ckbAddress.transactions?.length ? ( -
- {t(i18n)`No Transaction`} -
- ) : ( - ckbAddress.transactions?.map((tx) => { - return ( - - - - - - ) - }) - )} - - - {t(i18n)`Total ${formatNumber(total)} Items`} - - - - - ) + return } return notFound() } diff --git a/frontend/src/components/btc/btc-transaction-card-in-address.tsx b/frontend/src/components/btc/btc-transaction-card-in-address.tsx index c52f8df6..7d9bb272 100644 --- a/frontend/src/components/btc/btc-transaction-card-in-address.tsx +++ b/frontend/src/components/btc/btc-transaction-card-in-address.tsx @@ -1,7 +1,7 @@ 'use client' -import { t } from '@lingui/macro' -import { useLingui } from '@lingui/react' +import { Trans } from '@lingui/macro' +import { forwardRef } from 'react' import { VStack } from 'styled-system/jsx' import { BtcUtxoTables } from '@/components/btc/btc-utxo-tables' @@ -9,18 +9,16 @@ import { TransactionHeaderInAddress } from '@/components/transaction-header-in-a import { UtxoOrCellFooter } from '@/components/utxo-or-cell-footer' import { BitcoinInput, BitcoinOutput, BitcoinTransaction, CkbTransaction } from '@/gql/graphql' -export function BtcTransactionCardInAddress({ - tx, - address, - ckbCell, -}: { - tx: BitcoinTransaction - ckbCell?: Pick - address: string -}) { - const { i18n } = useLingui() +export const BtcTransactionCardInAddress = forwardRef< + HTMLDivElement, + { + tx: Pick + ckbCell?: Pick + address: string + } +>(function BtcTransactionCardInAddress({ tx, address, ckbCell }, ref) { return ( - + sats} address={address} btcUtxo={{ vin: tx.vin as BitcoinInput[], vout: tx.vout as BitcoinOutput[] }} ckbCell={ckbCell} /> ) -} +}) diff --git a/frontend/src/components/btc/btc-transaction-card-with-query-in-address.tsx b/frontend/src/components/btc/btc-transaction-card-with-query-in-address.tsx new file mode 100644 index 00000000..4eefa6b1 --- /dev/null +++ b/frontend/src/components/btc/btc-transaction-card-with-query-in-address.tsx @@ -0,0 +1,173 @@ +'use client' + +import { useQuery } from '@tanstack/react-query' +import { useState } from 'react' +import { useInView } from 'react-intersection-observer' + +import { BtcTransactionCardInAddress } from '@/components/btc/btc-transaction-card-in-address' +import { Skeleton } from '@/components/ui/primitives/skeleton' +import { QueryKey } from '@/constants/query-key' +import { graphql } from '@/gql' +import { BitcoinTransaction, CkbTransaction } from '@/gql/graphql' +import { graphQLClient } from '@/lib/graphql' + +const btcTransactionQuery = graphql(` + query BtcTransactionByTxId($txid: String!) { + btcTransaction(txid: $txid) { + txid + fee + feeRate + confirmations + transactionTime + vin { + txid + vout + isCoinbase + prevout { + txid + vout + value + address { + address + } + status { + spent + txid + vin + } + } + } + vout { + txid + vout + value + address { + address + } + status { + spent + txid + vin + } + } + } + } +`) + +const btcRgbppTransactionQuery = graphql(` + query BtcRgbppTransactionByTxId($txid: String!) { + btcTransaction(txid: $txid) { + rgbppTransaction { + ckbTransaction { + outputs { + txHash + index + capacity + cellType + type { + codeHash + hashType + args + } + lock { + codeHash + hashType + args + } + status { + consumed + txHash + index + } + xudtInfo { + symbol + amount + decimal + typeHash + } + } + inputs { + txHash + index + capacity + cellType + type { + codeHash + hashType + args + } + lock { + codeHash + hashType + args + } + xudtInfo { + symbol + amount + decimal + typeHash + } + status { + consumed + txHash + index + } + } + } + } + } + } +`) + +interface Props { + txid: string + ckbTxHash?: string + address: string +} + +export function BtcTransactionCardWithQueryInAddress({ txid, address }: Props) { + const [enabled, setEnabled] = useState(false) + const [ref] = useInView({ + threshold: 0, + onChange(view) { + if (view) setEnabled(true) + }, + }) + const { data, isLoading, error } = useQuery({ + queryKey: [QueryKey.BtcTransactionCardWithQueryInAddress, txid], + async queryFn() { + const { btcTransaction } = await graphQLClient.request(btcTransactionQuery, { + txid, + }) + return btcTransaction + }, + enabled, + refetchOnReconnect: false, + refetchOnWindowFocus: false, + retryOnMount: false, + }) + + const { data: ckbTx } = useQuery({ + queryKey: [QueryKey.BtcTransactionCardWithQueryInAddress, txid, 'rgbpp'], + async queryFn() { + const { btcTransaction } = await graphQLClient.request(btcRgbppTransactionQuery, { + txid, + }) + return btcTransaction?.rgbppTransaction?.ckbTransaction + }, + }) + + if (error) return null + + return ( + + {data ? ( + } + /> + ) : null} + + ) +} diff --git a/frontend/src/components/ckb/ckb-transaction-card-with-query-in-address.tsx b/frontend/src/components/ckb/ckb-transaction-card-with-query-in-address.tsx new file mode 100644 index 00000000..6892b5e5 --- /dev/null +++ b/frontend/src/components/ckb/ckb-transaction-card-with-query-in-address.tsx @@ -0,0 +1,128 @@ +import { Trans } from '@lingui/macro' +import { useQuery } from '@tanstack/react-query' +import { useState } from 'react' +import { useInView } from 'react-intersection-observer' +import { VStack } from 'styled-system/jsx' + +import { CkbCellTables } from '@/components/ckb/ckb-cell-tables' +import { TransactionHeaderInAddress } from '@/components/transaction-header-in-address' +import { Skeleton } from '@/components/ui/primitives/skeleton' +import { UtxoOrCellFooter } from '@/components/utxo-or-cell-footer' +import { QueryKey } from '@/constants/query-key' +import { graphql } from '@/gql' +import { graphQLClient } from '@/lib/graphql' + +const query = graphql(` + query CkbTransactionByHash($hash: String!) { + ckbTransaction(txHash: $hash) { + hash + isCellbase + blockNumber + fee + size + feeRate + confirmations + inputs { + cellType + status { + consumed + txHash + index + } + txHash + index + capacity + type { + codeHash + hashType + args + } + lock { + codeHash + hashType + args + } + xudtInfo { + symbol + amount + decimal + typeHash + } + } + outputs { + txHash + cellType + index + capacity + type { + codeHash + hashType + args + } + lock { + codeHash + hashType + args + } + xudtInfo { + symbol + amount + decimal + typeHash + } + status { + consumed + txHash + index + } + } + block { + timestamp + } + } + } +`) + +export function CkbTransactionCardWithQueryInAddress({ hash, address }: { address: string; hash: string }) { + const [enabled, setEnabled] = useState(false) + const [ref] = useInView({ + threshold: 0, + onChange(view) { + if (view) setEnabled(true) + }, + }) + const { data, isLoading, error } = useQuery({ + queryKey: [QueryKey.CkbTransactionCardInAddressList, hash], + async queryFn() { + const { ckbTransaction } = await graphQLClient.request(query, { + hash, + }) + return ckbTransaction + }, + enabled, + refetchOnReconnect: false, + refetchOnWindowFocus: false, + retryOnMount: false, + }) + + if (error) return null + + return ( + + {data ? ( + + + + shannons} + address={address} + /> + + ) : null} + + ) +} diff --git a/frontend/src/components/infinite-list-bottom.tsx b/frontend/src/components/infinite-list-bottom.tsx new file mode 100644 index 00000000..6bcefb09 --- /dev/null +++ b/frontend/src/components/infinite-list-bottom.tsx @@ -0,0 +1,32 @@ +import { Trans } from '@lingui/macro' + +import { IntersectionObserver } from '@/components/intersection-observer' +import { Loading } from '@/components/loading' + +export interface InfiniteListBottomProps { + fetchNextPage: () => Promise + hasNextPage?: boolean + isFetchingNextPage?: boolean +} + +export function InfiniteListBottom({ fetchNextPage, hasNextPage, isFetchingNextPage }: InfiniteListBottomProps) { + return ( + { + if (isIntersecting && hasNextPage) { + fetchNextPage() + } + }} + > + {isFetchingNextPage ? : null} + {!isFetchingNextPage && !hasNextPage ? No More : null} + + ) +} diff --git a/frontend/src/components/intersection-observer.tsx b/frontend/src/components/intersection-observer.tsx new file mode 100644 index 00000000..479086d4 --- /dev/null +++ b/frontend/src/components/intersection-observer.tsx @@ -0,0 +1,22 @@ +'use client' + +import { Box, BoxProps } from 'styled-system/jsx' +import { useIntersectionObserver } from 'usehooks-ts' + +export interface IntersectionObserverProps extends Omit { + onChange?: (isIntersecting: boolean, entry: IntersectionObserverEntry) => void + threshold?: number +} + +export function IntersectionObserver({ threshold = 0.5, children, onChange, ...props }: IntersectionObserverProps) { + const { ref } = useIntersectionObserver({ + threshold, + onChange, + }) + + return ( + + {children} + + ) +} diff --git a/frontend/src/components/ui/primitives/skeleton.tsx b/frontend/src/components/ui/primitives/skeleton.tsx new file mode 100644 index 00000000..e5c485f7 --- /dev/null +++ b/frontend/src/components/ui/primitives/skeleton.tsx @@ -0,0 +1,28 @@ +'use client' +import type { Assign, HTMLArkProps } from '@ark-ui/react' +import { ark } from '@ark-ui/react/factory' +import { forwardRef } from 'react' +import { styled } from 'styled-system/jsx' +import { skeleton, type SkeletonVariantProps } from 'styled-system/recipes' +import type { JsxStyleProps } from 'styled-system/types' + +const StyledSkeleton = styled(ark.div, skeleton) + +export interface SkeletonProps extends Assign>, SkeletonVariantProps { + /** + * + * @default false + */ + isLoaded?: boolean +} + +export const Skeleton = forwardRef((props, ref) => { + const { isLoaded, ...otherProps } = props + + if (isLoaded) { + return + } + return +}) + +Skeleton.displayName = 'Skeleton' diff --git a/frontend/src/configs/ui-preset/skeleton.ts b/frontend/src/configs/ui-preset/skeleton.ts new file mode 100644 index 00000000..81868542 --- /dev/null +++ b/frontend/src/configs/ui-preset/skeleton.ts @@ -0,0 +1,18 @@ +import { defineRecipe } from '@pandacss/dev' + +export const skeleton = defineRecipe({ + className: 'skeleton', + base: { + animation: 'skeleton-pulse', + backgroundClip: 'padding-box', + backgroundColor: 'white.a2', + borderRadius: 'l3', + color: 'transparent', + cursor: 'default', + pointerEvents: 'none', + userSelect: 'none', + '&::before, &::after, *': { + visibility: 'hidden', + }, + }, +}) diff --git a/frontend/src/constants/query-key.ts b/frontend/src/constants/query-key.ts index 4dace96d..9fa1147c 100644 --- a/frontend/src/constants/query-key.ts +++ b/frontend/src/constants/query-key.ts @@ -2,4 +2,6 @@ export enum QueryKey { LastRgbppTxns = 'LastRgbppTxns', BlockHeightAndTxns24H = 'BlockHeightAndTxns24H', BtcTransactionCardInAddressList = 'BtcTransactionCardInAddressList', + CkbTransactionCardInAddressList = 'CkbTransactionCardInAddressList', + BtcTransactionCardWithQueryInAddress = 'BtcTransactionCardWithQueryInAddress', } diff --git a/frontend/src/gql/gql.ts b/frontend/src/gql/gql.ts index 80792cec..e7109e2a 100644 --- a/frontend/src/gql/gql.ts +++ b/frontend/src/gql/gql.ts @@ -15,8 +15,8 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ const documents = { "\n query BtcAddressBase($address: String!) {\n btcAddress(address: $address) {\n address\n satoshi\n pendingSatoshi\n transactionsCount\n }\n }\n": types.BtcAddressBaseDocument, "\n query CkbAddressBase($address: String!) {\n ckbAddress(address: $address) {\n address\n shannon\n balance {\n total\n available\n occupied\n }\n transactionsCount\n }\n }\n": types.CkbAddressBaseDocument, - "\n query BtcTransactionByAddress($address: String!, $afterTxid: String) {\n btcAddress(address: $address) {\n transactions(afterTxid: $afterTxid) {\n txid\n rgbppTransaction {\n ckbTransaction {\n outputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n status {\n consumed\n txHash\n index\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n inputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n }\n }\n blockHeight\n blockHash\n txid\n version\n size\n locktime\n weight\n fee\n feeRate\n confirmed\n confirmations\n transactionTime\n vin {\n txid\n vout\n scriptsig\n scriptsigAsm\n isCoinbase\n sequence\n prevout {\n scriptpubkey\n scriptpubkeyAsm\n scriptpubkeyType\n scriptpubkeyAddress\n value\n status {\n spent\n txid\n vin\n }\n address {\n address\n satoshi\n pendingSatoshi\n transactionsCount\n }\n }\n }\n vout {\n scriptpubkey\n scriptpubkeyAsm\n scriptpubkeyType\n scriptpubkeyAddress\n value\n status {\n spent\n txid\n vin\n }\n address {\n address\n satoshi\n pendingSatoshi\n transactionsCount\n }\n }\n }\n }\n }\n": types.BtcTransactionByAddressDocument, - "\n query CkbAddress($address: String!, $page: Int!, $pageSize: Int!) {\n ckbAddress(address: $address) {\n transactionsCount\n transactions(page: $page, pageSize: $pageSize) {\n isCellbase\n blockNumber\n hash\n fee\n size\n feeRate\n confirmations\n inputs {\n cellType\n status {\n consumed\n txHash\n index\n }\n txHash\n index\n capacity\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n outputs {\n txHash\n cellType\n index\n capacity\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n block {\n timestamp\n }\n }\n }\n }\n": types.CkbAddressDocument, + "\n query BtcTransactionByAddress($address: String!, $afterTxid: String) {\n btcAddress(address: $address) {\n transactions(afterTxid: $afterTxid) {\n txid\n }\n }\n }\n": types.BtcTransactionByAddressDocument, + "\n query CkbTransactionByAddress($address: String!, $page: Int!, $pageSize: Int!) {\n ckbAddress(address: $address) {\n transactionsCount\n transactions(page: $page, pageSize: $pageSize) {\n hash\n }\n }\n }\n": types.CkbTransactionByAddressDocument, "\n query RgbppCoin($typeHash: String!) {\n rgbppCoin(typeHash: $typeHash) {\n name\n symbol\n icon\n }\n }\n": types.RgbppCoinDocument, "\n query RgbppCoinTransactionsByTypeHash($typeHash: String!, $page: Int!, $pageSize: Int!) {\n rgbppCoin(typeHash: $typeHash) {\n transactionsCount\n transactions(page: $page, pageSize: $pageSize) {\n ckbTxHash\n btcTxid\n leapDirection\n blockNumber\n timestamp\n ckbTransaction {\n inputs {\n txHash\n index\n capacity\n status {\n consumed\n txHash\n index\n }\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n outputs {\n txHash\n index\n capacity\n status {\n consumed\n txHash\n index\n }\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n }\n }\n }\n }\n": types.RgbppCoinTransactionsByTypeHashDocument, "\n query RgbppCoins($page: Int!, $pageSize: Int!) {\n rgbppCoins(page: $page, pageSize: $pageSize) {\n total\n pageSize\n coins {\n icon\n name\n symbol\n l1HoldersCount: holdersCount(layer: L1)\n l2HoldersCount: holdersCount(layer: L2)\n h24CkbTransactionsCount\n totalAmount\n deployedAt\n decimal\n typeHash\n }\n }\n }\n": types.RgbppCoinsDocument, @@ -31,6 +31,9 @@ const documents = { "\n query RgbppTransaction($txidOrTxHash: String!) {\n rgbppTransaction(txidOrTxHash: $txidOrTxHash) {\n ckbTxHash\n btcTxid\n leapDirection\n blockNumber\n timestamp\n btcTransaction {\n txid\n blockHeight\n blockHash\n size\n fee\n feeRate\n confirmed\n confirmations\n vin {\n txid\n vout\n isCoinbase\n prevout {\n txid\n vout\n value\n address {\n address\n }\n status {\n spent\n txid\n vin\n }\n }\n }\n vout {\n txid\n vout\n value\n address {\n address\n }\n status {\n spent\n txid\n vin\n }\n }\n }\n ckbTransaction {\n isCellbase\n blockNumber\n hash\n fee\n feeRate\n outputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n status {\n consumed\n txHash\n index\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n inputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n block {\n timestamp\n hash\n }\n }\n }\n }\n": types.RgbppTransactionDocument, "\n query BtcTx($txid: String!) {\n btcTransaction(txid: $txid) {\n blockHeight\n blockHash\n txid\n version\n size\n transactionTime\n weight\n fee\n feeRate\n confirmed\n confirmations\n vin {\n txid\n vout\n scriptsig\n scriptsigAsm\n isCoinbase\n sequence\n prevout {\n txid\n vout\n scriptpubkey\n scriptpubkeyAsm\n scriptpubkeyType\n scriptpubkeyAddress\n value\n address {\n address\n satoshi\n pendingSatoshi\n transactionsCount\n }\n status {\n spent\n txid\n vin\n }\n }\n }\n vout {\n txid\n vout\n scriptpubkey\n scriptpubkeyAsm\n scriptpubkeyType\n scriptpubkeyAddress\n value\n address {\n address\n satoshi\n pendingSatoshi\n transactionsCount\n }\n status {\n spent\n txid\n vin\n }\n }\n }\n }\n": types.BtcTxDocument, "\n query CkbTx($hash: String!) {\n ckbTransaction(txHash: $hash) {\n isCellbase\n blockNumber\n hash\n fee\n feeRate\n size\n confirmed\n confirmations\n outputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n status {\n consumed\n txHash\n index\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n inputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n block {\n timestamp\n hash\n }\n }\n }\n": types.CkbTxDocument, + "\n query BtcTransactionByTxId($txid: String!) {\n btcTransaction(txid: $txid) {\n txid\n fee\n feeRate\n confirmations\n transactionTime\n vin {\n txid\n vout\n isCoinbase\n prevout {\n txid\n vout\n value\n address {\n address\n }\n status {\n spent\n txid\n vin\n }\n }\n }\n vout {\n txid\n vout\n value\n address {\n address\n }\n status {\n spent\n txid\n vin\n }\n }\n }\n }\n": types.BtcTransactionByTxIdDocument, + "\n query BtcRgbppTransactionByTxId($txid: String!) {\n btcTransaction(txid: $txid) {\n rgbppTransaction {\n ckbTransaction {\n outputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n status {\n consumed\n txHash\n index\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n inputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n }\n }\n }\n }\n": types.BtcRgbppTransactionByTxIdDocument, + "\n query CkbTransactionByHash($hash: String!) {\n ckbTransaction(txHash: $hash) {\n hash\n isCellbase\n blockNumber\n fee\n size\n feeRate\n confirmations\n inputs {\n cellType\n status {\n consumed\n txHash\n index\n }\n txHash\n index\n capacity\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n outputs {\n txHash\n cellType\n index\n capacity\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n block {\n timestamp\n }\n }\n }\n": types.CkbTransactionByHashDocument, "\n query RgbppStatistic {\n rgbppStatistic {\n l1HoldersCount: holdersCount(layer: L1)\n l2HoldersCount: holdersCount(layer: L2)\n latest24HoursL2TransactionsCount\n latest24HoursL1TransactionsCountLeapIn: latest24HoursL1TransactionsCount(leapDirection: LeapIn)\n latest24HoursL1TransactionsCountLeapOutput: latest24HoursL1TransactionsCount(leapDirection: LeapOut)\n latest24HoursL1TransactionsCountLeapWithin: latest24HoursL1TransactionsCount(leapDirection: Within)\n }\n }\n ": types.RgbppStatisticDocument, "\n query RgbppLatestTransactions($limit: Int!) {\n rgbppLatestTransactions(limit: $limit) {\n txs {\n ckbTxHash\n btcTxid\n leapDirection\n blockNumber\n timestamp\n ckbTransaction {\n outputs {\n txHash\n index\n capacity\n cellType\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n }\n status {\n consumed\n txHash\n index\n }\n }\n }\n }\n total\n pageSize\n }\n }\n": types.RgbppLatestTransactionsDocument, "\n query CkbAndBtcChainInfo {\n ckbChainInfo {\n tipBlockNumber\n transactionsCountIn24Hours\n }\n btcChainInfo {\n tipBlockHeight\n transactionsCountIn24Hours\n }\n }\n ": types.CkbAndBtcChainInfoDocument, @@ -63,11 +66,11 @@ export function graphql(source: "\n query CkbAddressBase($address: String!) {\n /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n query BtcTransactionByAddress($address: String!, $afterTxid: String) {\n btcAddress(address: $address) {\n transactions(afterTxid: $afterTxid) {\n txid\n rgbppTransaction {\n ckbTransaction {\n outputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n status {\n consumed\n txHash\n index\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n inputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n }\n }\n blockHeight\n blockHash\n txid\n version\n size\n locktime\n weight\n fee\n feeRate\n confirmed\n confirmations\n transactionTime\n vin {\n txid\n vout\n scriptsig\n scriptsigAsm\n isCoinbase\n sequence\n prevout {\n scriptpubkey\n scriptpubkeyAsm\n scriptpubkeyType\n scriptpubkeyAddress\n value\n status {\n spent\n txid\n vin\n }\n address {\n address\n satoshi\n pendingSatoshi\n transactionsCount\n }\n }\n }\n vout {\n scriptpubkey\n scriptpubkeyAsm\n scriptpubkeyType\n scriptpubkeyAddress\n value\n status {\n spent\n txid\n vin\n }\n address {\n address\n satoshi\n pendingSatoshi\n transactionsCount\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query BtcTransactionByAddress($address: String!, $afterTxid: String) {\n btcAddress(address: $address) {\n transactions(afterTxid: $afterTxid) {\n txid\n rgbppTransaction {\n ckbTransaction {\n outputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n status {\n consumed\n txHash\n index\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n inputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n }\n }\n blockHeight\n blockHash\n txid\n version\n size\n locktime\n weight\n fee\n feeRate\n confirmed\n confirmations\n transactionTime\n vin {\n txid\n vout\n scriptsig\n scriptsigAsm\n isCoinbase\n sequence\n prevout {\n scriptpubkey\n scriptpubkeyAsm\n scriptpubkeyType\n scriptpubkeyAddress\n value\n status {\n spent\n txid\n vin\n }\n address {\n address\n satoshi\n pendingSatoshi\n transactionsCount\n }\n }\n }\n vout {\n scriptpubkey\n scriptpubkeyAsm\n scriptpubkeyType\n scriptpubkeyAddress\n value\n status {\n spent\n txid\n vin\n }\n address {\n address\n satoshi\n pendingSatoshi\n transactionsCount\n }\n }\n }\n }\n }\n"]; +export function graphql(source: "\n query BtcTransactionByAddress($address: String!, $afterTxid: String) {\n btcAddress(address: $address) {\n transactions(afterTxid: $afterTxid) {\n txid\n }\n }\n }\n"): (typeof documents)["\n query BtcTransactionByAddress($address: String!, $afterTxid: String) {\n btcAddress(address: $address) {\n transactions(afterTxid: $afterTxid) {\n txid\n }\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n query CkbAddress($address: String!, $page: Int!, $pageSize: Int!) {\n ckbAddress(address: $address) {\n transactionsCount\n transactions(page: $page, pageSize: $pageSize) {\n isCellbase\n blockNumber\n hash\n fee\n size\n feeRate\n confirmations\n inputs {\n cellType\n status {\n consumed\n txHash\n index\n }\n txHash\n index\n capacity\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n outputs {\n txHash\n cellType\n index\n capacity\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n block {\n timestamp\n }\n }\n }\n }\n"): (typeof documents)["\n query CkbAddress($address: String!, $page: Int!, $pageSize: Int!) {\n ckbAddress(address: $address) {\n transactionsCount\n transactions(page: $page, pageSize: $pageSize) {\n isCellbase\n blockNumber\n hash\n fee\n size\n feeRate\n confirmations\n inputs {\n cellType\n status {\n consumed\n txHash\n index\n }\n txHash\n index\n capacity\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n outputs {\n txHash\n cellType\n index\n capacity\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n block {\n timestamp\n }\n }\n }\n }\n"]; +export function graphql(source: "\n query CkbTransactionByAddress($address: String!, $page: Int!, $pageSize: Int!) {\n ckbAddress(address: $address) {\n transactionsCount\n transactions(page: $page, pageSize: $pageSize) {\n hash\n }\n }\n }\n"): (typeof documents)["\n query CkbTransactionByAddress($address: String!, $page: Int!, $pageSize: Int!) {\n ckbAddress(address: $address) {\n transactionsCount\n transactions(page: $page, pageSize: $pageSize) {\n hash\n }\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -124,6 +127,18 @@ export function graphql(source: "\n query BtcTx($txid: String!) {\n btcTrans * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function graphql(source: "\n query CkbTx($hash: String!) {\n ckbTransaction(txHash: $hash) {\n isCellbase\n blockNumber\n hash\n fee\n feeRate\n size\n confirmed\n confirmations\n outputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n status {\n consumed\n txHash\n index\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n inputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n block {\n timestamp\n hash\n }\n }\n }\n"): (typeof documents)["\n query CkbTx($hash: String!) {\n ckbTransaction(txHash: $hash) {\n isCellbase\n blockNumber\n hash\n fee\n feeRate\n size\n confirmed\n confirmations\n outputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n status {\n consumed\n txHash\n index\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n inputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n block {\n timestamp\n hash\n }\n }\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n query BtcTransactionByTxId($txid: String!) {\n btcTransaction(txid: $txid) {\n txid\n fee\n feeRate\n confirmations\n transactionTime\n vin {\n txid\n vout\n isCoinbase\n prevout {\n txid\n vout\n value\n address {\n address\n }\n status {\n spent\n txid\n vin\n }\n }\n }\n vout {\n txid\n vout\n value\n address {\n address\n }\n status {\n spent\n txid\n vin\n }\n }\n }\n }\n"): (typeof documents)["\n query BtcTransactionByTxId($txid: String!) {\n btcTransaction(txid: $txid) {\n txid\n fee\n feeRate\n confirmations\n transactionTime\n vin {\n txid\n vout\n isCoinbase\n prevout {\n txid\n vout\n value\n address {\n address\n }\n status {\n spent\n txid\n vin\n }\n }\n }\n vout {\n txid\n vout\n value\n address {\n address\n }\n status {\n spent\n txid\n vin\n }\n }\n }\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n query BtcRgbppTransactionByTxId($txid: String!) {\n btcTransaction(txid: $txid) {\n rgbppTransaction {\n ckbTransaction {\n outputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n status {\n consumed\n txHash\n index\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n inputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query BtcRgbppTransactionByTxId($txid: String!) {\n btcTransaction(txid: $txid) {\n rgbppTransaction {\n ckbTransaction {\n outputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n status {\n consumed\n txHash\n index\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n inputs {\n txHash\n index\n capacity\n cellType\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n }\n }\n }\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n query CkbTransactionByHash($hash: String!) {\n ckbTransaction(txHash: $hash) {\n hash\n isCellbase\n blockNumber\n fee\n size\n feeRate\n confirmations\n inputs {\n cellType\n status {\n consumed\n txHash\n index\n }\n txHash\n index\n capacity\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n outputs {\n txHash\n cellType\n index\n capacity\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n block {\n timestamp\n }\n }\n }\n"): (typeof documents)["\n query CkbTransactionByHash($hash: String!) {\n ckbTransaction(txHash: $hash) {\n hash\n isCellbase\n blockNumber\n fee\n size\n feeRate\n confirmations\n inputs {\n cellType\n status {\n consumed\n txHash\n index\n }\n txHash\n index\n capacity\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n }\n outputs {\n txHash\n cellType\n index\n capacity\n type {\n codeHash\n hashType\n args\n }\n lock {\n codeHash\n hashType\n args\n }\n xudtInfo {\n symbol\n amount\n decimal\n typeHash\n }\n status {\n consumed\n txHash\n index\n }\n }\n block {\n timestamp\n }\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/frontend/src/gql/graphql.ts b/frontend/src/gql/graphql.ts index b21bd50b..2de18556 100644 --- a/frontend/src/gql/graphql.ts +++ b/frontend/src/gql/graphql.ts @@ -575,16 +575,16 @@ export type BtcTransactionByAddressQueryVariables = Exact<{ }>; -export type BtcTransactionByAddressQuery = { __typename?: 'Query', btcAddress?: { __typename?: 'BitcoinAddress', transactions?: Array<{ __typename?: 'BitcoinTransaction', txid: string, blockHeight?: number | null, blockHash?: string | null, version: number, size: number, locktime: number, weight: number, fee: number, feeRate: number, confirmed: boolean, confirmations: number, transactionTime?: any | null, rgbppTransaction?: { __typename?: 'RgbppTransaction', ckbTransaction?: { __typename?: 'CkbTransaction', outputs: Array<{ __typename?: 'CkbCell', txHash: string, index: number, capacity: number, cellType?: CellType | null, type?: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string } | null, lock: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string }, status?: { __typename?: 'CkbCellStatus', consumed: boolean, txHash?: string | null, index?: number | null } | null, xudtInfo?: { __typename?: 'CkbXUDTInfo', symbol: string, amount: string, decimal: number, typeHash: string } | null }>, inputs?: Array<{ __typename?: 'CkbCell', txHash: string, index: number, capacity: number, cellType?: CellType | null, type?: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string } | null, lock: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string }, xudtInfo?: { __typename?: 'CkbXUDTInfo', symbol: string, amount: string, decimal: number, typeHash: string } | null, status?: { __typename?: 'CkbCellStatus', consumed: boolean, txHash?: string | null, index?: number | null } | null }> | null } | null } | null, vin?: Array<{ __typename?: 'BitcoinInput', txid: string, vout: number, scriptsig: string, scriptsigAsm: string, isCoinbase: boolean, sequence: number, prevout?: { __typename?: 'BitcoinOutput', scriptpubkey: string, scriptpubkeyAsm: string, scriptpubkeyType: string, scriptpubkeyAddress?: string | null, value: number, status?: { __typename?: 'BitcoinOutputStatus', spent: boolean, txid?: string | null, vin?: number | null } | null, address?: { __typename?: 'BitcoinAddress', address: string, satoshi: number, pendingSatoshi: number, transactionsCount?: number | null } | null } | null }> | null, vout: Array<{ __typename?: 'BitcoinOutput', scriptpubkey: string, scriptpubkeyAsm: string, scriptpubkeyType: string, scriptpubkeyAddress?: string | null, value: number, status?: { __typename?: 'BitcoinOutputStatus', spent: boolean, txid?: string | null, vin?: number | null } | null, address?: { __typename?: 'BitcoinAddress', address: string, satoshi: number, pendingSatoshi: number, transactionsCount?: number | null } | null }> }> | null } | null }; +export type BtcTransactionByAddressQuery = { __typename?: 'Query', btcAddress?: { __typename?: 'BitcoinAddress', transactions?: Array<{ __typename?: 'BitcoinTransaction', txid: string }> | null } | null }; -export type CkbAddressQueryVariables = Exact<{ +export type CkbTransactionByAddressQueryVariables = Exact<{ address: Scalars['String']['input']; page: Scalars['Int']['input']; pageSize: Scalars['Int']['input']; }>; -export type CkbAddressQuery = { __typename?: 'Query', ckbAddress?: { __typename?: 'CkbAddress', transactionsCount?: number | null, transactions?: Array<{ __typename?: 'CkbTransaction', isCellbase: boolean, blockNumber: number, hash: string, fee?: number | null, size: number, feeRate?: number | null, confirmations: number, inputs?: Array<{ __typename?: 'CkbCell', cellType?: CellType | null, txHash: string, index: number, capacity: number, status?: { __typename?: 'CkbCellStatus', consumed: boolean, txHash?: string | null, index?: number | null } | null, type?: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string } | null, lock: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string }, xudtInfo?: { __typename?: 'CkbXUDTInfo', symbol: string, amount: string, decimal: number, typeHash: string } | null }> | null, outputs: Array<{ __typename?: 'CkbCell', txHash: string, cellType?: CellType | null, index: number, capacity: number, type?: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string } | null, lock: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string }, xudtInfo?: { __typename?: 'CkbXUDTInfo', symbol: string, amount: string, decimal: number, typeHash: string } | null, status?: { __typename?: 'CkbCellStatus', consumed: boolean, txHash?: string | null, index?: number | null } | null }>, block?: { __typename?: 'CkbBlock', timestamp: any } | null }> | null } | null }; +export type CkbTransactionByAddressQuery = { __typename?: 'Query', ckbAddress?: { __typename?: 'CkbAddress', transactionsCount?: number | null, transactions?: Array<{ __typename?: 'CkbTransaction', hash: string }> | null } | null }; export type RgbppCoinQueryVariables = Exact<{ typeHash: Scalars['String']['input']; @@ -683,6 +683,27 @@ export type CkbTxQueryVariables = Exact<{ export type CkbTxQuery = { __typename?: 'Query', ckbTransaction?: { __typename?: 'CkbTransaction', isCellbase: boolean, blockNumber: number, hash: string, fee?: number | null, feeRate?: number | null, size: number, confirmed: boolean, confirmations: number, outputs: Array<{ __typename?: 'CkbCell', txHash: string, index: number, capacity: number, cellType?: CellType | null, type?: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string } | null, lock: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string }, status?: { __typename?: 'CkbCellStatus', consumed: boolean, txHash?: string | null, index?: number | null } | null, xudtInfo?: { __typename?: 'CkbXUDTInfo', symbol: string, amount: string, decimal: number, typeHash: string } | null }>, inputs?: Array<{ __typename?: 'CkbCell', txHash: string, index: number, capacity: number, cellType?: CellType | null, type?: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string } | null, lock: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string }, xudtInfo?: { __typename?: 'CkbXUDTInfo', symbol: string, amount: string, decimal: number, typeHash: string } | null, status?: { __typename?: 'CkbCellStatus', consumed: boolean, txHash?: string | null, index?: number | null } | null }> | null, block?: { __typename?: 'CkbBlock', timestamp: any, hash: string } | null } | null }; +export type BtcTransactionByTxIdQueryVariables = Exact<{ + txid: Scalars['String']['input']; +}>; + + +export type BtcTransactionByTxIdQuery = { __typename?: 'Query', btcTransaction?: { __typename?: 'BitcoinTransaction', txid: string, fee: number, feeRate: number, confirmations: number, transactionTime?: any | null, vin?: Array<{ __typename?: 'BitcoinInput', txid: string, vout: number, isCoinbase: boolean, prevout?: { __typename?: 'BitcoinOutput', txid: string, vout: number, value: number, address?: { __typename?: 'BitcoinAddress', address: string } | null, status?: { __typename?: 'BitcoinOutputStatus', spent: boolean, txid?: string | null, vin?: number | null } | null } | null }> | null, vout: Array<{ __typename?: 'BitcoinOutput', txid: string, vout: number, value: number, address?: { __typename?: 'BitcoinAddress', address: string } | null, status?: { __typename?: 'BitcoinOutputStatus', spent: boolean, txid?: string | null, vin?: number | null } | null }> } | null }; + +export type BtcRgbppTransactionByTxIdQueryVariables = Exact<{ + txid: Scalars['String']['input']; +}>; + + +export type BtcRgbppTransactionByTxIdQuery = { __typename?: 'Query', btcTransaction?: { __typename?: 'BitcoinTransaction', rgbppTransaction?: { __typename?: 'RgbppTransaction', ckbTransaction?: { __typename?: 'CkbTransaction', outputs: Array<{ __typename?: 'CkbCell', txHash: string, index: number, capacity: number, cellType?: CellType | null, type?: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string } | null, lock: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string }, status?: { __typename?: 'CkbCellStatus', consumed: boolean, txHash?: string | null, index?: number | null } | null, xudtInfo?: { __typename?: 'CkbXUDTInfo', symbol: string, amount: string, decimal: number, typeHash: string } | null }>, inputs?: Array<{ __typename?: 'CkbCell', txHash: string, index: number, capacity: number, cellType?: CellType | null, type?: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string } | null, lock: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string }, xudtInfo?: { __typename?: 'CkbXUDTInfo', symbol: string, amount: string, decimal: number, typeHash: string } | null, status?: { __typename?: 'CkbCellStatus', consumed: boolean, txHash?: string | null, index?: number | null } | null }> | null } | null } | null } | null }; + +export type CkbTransactionByHashQueryVariables = Exact<{ + hash: Scalars['String']['input']; +}>; + + +export type CkbTransactionByHashQuery = { __typename?: 'Query', ckbTransaction?: { __typename?: 'CkbTransaction', hash: string, isCellbase: boolean, blockNumber: number, fee?: number | null, size: number, feeRate?: number | null, confirmations: number, inputs?: Array<{ __typename?: 'CkbCell', cellType?: CellType | null, txHash: string, index: number, capacity: number, status?: { __typename?: 'CkbCellStatus', consumed: boolean, txHash?: string | null, index?: number | null } | null, type?: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string } | null, lock: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string }, xudtInfo?: { __typename?: 'CkbXUDTInfo', symbol: string, amount: string, decimal: number, typeHash: string } | null }> | null, outputs: Array<{ __typename?: 'CkbCell', txHash: string, cellType?: CellType | null, index: number, capacity: number, type?: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string } | null, lock: { __typename?: 'CkbScript', codeHash: string, hashType: string, args: string }, xudtInfo?: { __typename?: 'CkbXUDTInfo', symbol: string, amount: string, decimal: number, typeHash: string } | null, status?: { __typename?: 'CkbCellStatus', consumed: boolean, txHash?: string | null, index?: number | null } | null }>, block?: { __typename?: 'CkbBlock', timestamp: any } | null } | null }; + export type RgbppStatisticQueryVariables = Exact<{ [key: string]: never; }>; @@ -715,8 +736,8 @@ export type BtcAndCkbChainInfoQuery = { __typename?: 'Query', ckbChainInfo: { __ export const BtcAddressBaseDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BtcAddressBase"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"btcAddress"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"satoshi"}},{"kind":"Field","name":{"kind":"Name","value":"pendingSatoshi"}},{"kind":"Field","name":{"kind":"Name","value":"transactionsCount"}}]}}]}}]} as unknown as DocumentNode; export const CkbAddressBaseDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CkbAddressBase"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ckbAddress"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"shannon"}},{"kind":"Field","name":{"kind":"Name","value":"balance"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"total"}},{"kind":"Field","name":{"kind":"Name","value":"available"}},{"kind":"Field","name":{"kind":"Name","value":"occupied"}}]}},{"kind":"Field","name":{"kind":"Name","value":"transactionsCount"}}]}}]}}]} as unknown as DocumentNode; -export const BtcTransactionByAddressDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BtcTransactionByAddress"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"afterTxid"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"btcAddress"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"afterTxid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"afterTxid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"rgbppTransaction"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ckbTransaction"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"outputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"cellType"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"inputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"cellType"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"blockHeight"}},{"kind":"Field","name":{"kind":"Name","value":"blockHash"}},{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"locktime"}},{"kind":"Field","name":{"kind":"Name","value":"weight"}},{"kind":"Field","name":{"kind":"Name","value":"fee"}},{"kind":"Field","name":{"kind":"Name","value":"feeRate"}},{"kind":"Field","name":{"kind":"Name","value":"confirmed"}},{"kind":"Field","name":{"kind":"Name","value":"confirmations"}},{"kind":"Field","name":{"kind":"Name","value":"transactionTime"}},{"kind":"Field","name":{"kind":"Name","value":"vin"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vout"}},{"kind":"Field","name":{"kind":"Name","value":"scriptsig"}},{"kind":"Field","name":{"kind":"Name","value":"scriptsigAsm"}},{"kind":"Field","name":{"kind":"Name","value":"isCoinbase"}},{"kind":"Field","name":{"kind":"Name","value":"sequence"}},{"kind":"Field","name":{"kind":"Name","value":"prevout"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"scriptpubkey"}},{"kind":"Field","name":{"kind":"Name","value":"scriptpubkeyAsm"}},{"kind":"Field","name":{"kind":"Name","value":"scriptpubkeyType"}},{"kind":"Field","name":{"kind":"Name","value":"scriptpubkeyAddress"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spent"}},{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vin"}}]}},{"kind":"Field","name":{"kind":"Name","value":"address"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"satoshi"}},{"kind":"Field","name":{"kind":"Name","value":"pendingSatoshi"}},{"kind":"Field","name":{"kind":"Name","value":"transactionsCount"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"vout"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"scriptpubkey"}},{"kind":"Field","name":{"kind":"Name","value":"scriptpubkeyAsm"}},{"kind":"Field","name":{"kind":"Name","value":"scriptpubkeyType"}},{"kind":"Field","name":{"kind":"Name","value":"scriptpubkeyAddress"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spent"}},{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vin"}}]}},{"kind":"Field","name":{"kind":"Name","value":"address"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"satoshi"}},{"kind":"Field","name":{"kind":"Name","value":"pendingSatoshi"}},{"kind":"Field","name":{"kind":"Name","value":"transactionsCount"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const CkbAddressDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CkbAddress"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"page"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ckbAddress"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactionsCount"}},{"kind":"Field","name":{"kind":"Name","value":"transactions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"page"},"value":{"kind":"Variable","name":{"kind":"Name","value":"page"}}},{"kind":"Argument","name":{"kind":"Name","value":"pageSize"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCellbase"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"hash"}},{"kind":"Field","name":{"kind":"Name","value":"fee"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"feeRate"}},{"kind":"Field","name":{"kind":"Name","value":"confirmations"}},{"kind":"Field","name":{"kind":"Name","value":"inputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cellType"}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"outputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"cellType"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"block"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"timestamp"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const BtcTransactionByAddressDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BtcTransactionByAddress"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"afterTxid"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"btcAddress"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"afterTxid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"afterTxid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txid"}}]}}]}}]}}]} as unknown as DocumentNode; +export const CkbTransactionByAddressDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CkbTransactionByAddress"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"page"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ckbAddress"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactionsCount"}},{"kind":"Field","name":{"kind":"Name","value":"transactions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"page"},"value":{"kind":"Variable","name":{"kind":"Name","value":"page"}}},{"kind":"Argument","name":{"kind":"Name","value":"pageSize"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hash"}}]}}]}}]}}]} as unknown as DocumentNode; export const RgbppCoinDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"RgbppCoin"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"typeHash"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"rgbppCoin"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"typeHash"},"value":{"kind":"Variable","name":{"kind":"Name","value":"typeHash"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}}]}}]}}]} as unknown as DocumentNode; export const RgbppCoinTransactionsByTypeHashDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"RgbppCoinTransactionsByTypeHash"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"typeHash"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"page"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"rgbppCoin"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"typeHash"},"value":{"kind":"Variable","name":{"kind":"Name","value":"typeHash"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactionsCount"}},{"kind":"Field","name":{"kind":"Name","value":"transactions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"page"},"value":{"kind":"Variable","name":{"kind":"Name","value":"page"}}},{"kind":"Argument","name":{"kind":"Name","value":"pageSize"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ckbTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"btcTxid"}},{"kind":"Field","name":{"kind":"Name","value":"leapDirection"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"ckbTransaction"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"inputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"outputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const RgbppCoinsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"RgbppCoins"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"page"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"rgbppCoins"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"page"},"value":{"kind":"Variable","name":{"kind":"Name","value":"page"}}},{"kind":"Argument","name":{"kind":"Name","value":"pageSize"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"total"}},{"kind":"Field","name":{"kind":"Name","value":"pageSize"}},{"kind":"Field","name":{"kind":"Name","value":"coins"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","alias":{"kind":"Name","value":"l1HoldersCount"},"name":{"kind":"Name","value":"holdersCount"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"layer"},"value":{"kind":"EnumValue","value":"L1"}}]},{"kind":"Field","alias":{"kind":"Name","value":"l2HoldersCount"},"name":{"kind":"Name","value":"holdersCount"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"layer"},"value":{"kind":"EnumValue","value":"L2"}}]},{"kind":"Field","name":{"kind":"Name","value":"h24CkbTransactionsCount"}},{"kind":"Field","name":{"kind":"Name","value":"totalAmount"}},{"kind":"Field","name":{"kind":"Name","value":"deployedAt"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}}]}}]}}]} as unknown as DocumentNode; @@ -731,6 +752,9 @@ export const RgbppLatestL2TransactionsDocument = {"kind":"Document","definitions export const RgbppTransactionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"RgbppTransaction"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"txidOrTxHash"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"rgbppTransaction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"txidOrTxHash"},"value":{"kind":"Variable","name":{"kind":"Name","value":"txidOrTxHash"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ckbTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"btcTxid"}},{"kind":"Field","name":{"kind":"Name","value":"leapDirection"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"btcTransaction"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"blockHeight"}},{"kind":"Field","name":{"kind":"Name","value":"blockHash"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"fee"}},{"kind":"Field","name":{"kind":"Name","value":"feeRate"}},{"kind":"Field","name":{"kind":"Name","value":"confirmed"}},{"kind":"Field","name":{"kind":"Name","value":"confirmations"}},{"kind":"Field","name":{"kind":"Name","value":"vin"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vout"}},{"kind":"Field","name":{"kind":"Name","value":"isCoinbase"}},{"kind":"Field","name":{"kind":"Name","value":"prevout"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vout"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"address"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spent"}},{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vin"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"vout"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vout"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"address"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spent"}},{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vin"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"ckbTransaction"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCellbase"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"hash"}},{"kind":"Field","name":{"kind":"Name","value":"fee"}},{"kind":"Field","name":{"kind":"Name","value":"feeRate"}},{"kind":"Field","name":{"kind":"Name","value":"outputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"cellType"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"inputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"cellType"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"block"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"hash"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const BtcTxDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BtcTx"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"txid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"btcTransaction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"txid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"txid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blockHeight"}},{"kind":"Field","name":{"kind":"Name","value":"blockHash"}},{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"transactionTime"}},{"kind":"Field","name":{"kind":"Name","value":"weight"}},{"kind":"Field","name":{"kind":"Name","value":"fee"}},{"kind":"Field","name":{"kind":"Name","value":"feeRate"}},{"kind":"Field","name":{"kind":"Name","value":"confirmed"}},{"kind":"Field","name":{"kind":"Name","value":"confirmations"}},{"kind":"Field","name":{"kind":"Name","value":"vin"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vout"}},{"kind":"Field","name":{"kind":"Name","value":"scriptsig"}},{"kind":"Field","name":{"kind":"Name","value":"scriptsigAsm"}},{"kind":"Field","name":{"kind":"Name","value":"isCoinbase"}},{"kind":"Field","name":{"kind":"Name","value":"sequence"}},{"kind":"Field","name":{"kind":"Name","value":"prevout"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vout"}},{"kind":"Field","name":{"kind":"Name","value":"scriptpubkey"}},{"kind":"Field","name":{"kind":"Name","value":"scriptpubkeyAsm"}},{"kind":"Field","name":{"kind":"Name","value":"scriptpubkeyType"}},{"kind":"Field","name":{"kind":"Name","value":"scriptpubkeyAddress"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"address"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"satoshi"}},{"kind":"Field","name":{"kind":"Name","value":"pendingSatoshi"}},{"kind":"Field","name":{"kind":"Name","value":"transactionsCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spent"}},{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vin"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"vout"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vout"}},{"kind":"Field","name":{"kind":"Name","value":"scriptpubkey"}},{"kind":"Field","name":{"kind":"Name","value":"scriptpubkeyAsm"}},{"kind":"Field","name":{"kind":"Name","value":"scriptpubkeyType"}},{"kind":"Field","name":{"kind":"Name","value":"scriptpubkeyAddress"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"address"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"satoshi"}},{"kind":"Field","name":{"kind":"Name","value":"pendingSatoshi"}},{"kind":"Field","name":{"kind":"Name","value":"transactionsCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spent"}},{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vin"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const CkbTxDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CkbTx"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"hash"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ckbTransaction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"txHash"},"value":{"kind":"Variable","name":{"kind":"Name","value":"hash"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCellbase"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"hash"}},{"kind":"Field","name":{"kind":"Name","value":"fee"}},{"kind":"Field","name":{"kind":"Name","value":"feeRate"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"confirmed"}},{"kind":"Field","name":{"kind":"Name","value":"confirmations"}},{"kind":"Field","name":{"kind":"Name","value":"outputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"cellType"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"inputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"cellType"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"block"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"hash"}}]}}]}}]}}]} as unknown as DocumentNode; +export const BtcTransactionByTxIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BtcTransactionByTxId"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"txid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"btcTransaction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"txid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"txid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"fee"}},{"kind":"Field","name":{"kind":"Name","value":"feeRate"}},{"kind":"Field","name":{"kind":"Name","value":"confirmations"}},{"kind":"Field","name":{"kind":"Name","value":"transactionTime"}},{"kind":"Field","name":{"kind":"Name","value":"vin"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vout"}},{"kind":"Field","name":{"kind":"Name","value":"isCoinbase"}},{"kind":"Field","name":{"kind":"Name","value":"prevout"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vout"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"address"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spent"}},{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vin"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"vout"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vout"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"address"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"spent"}},{"kind":"Field","name":{"kind":"Name","value":"txid"}},{"kind":"Field","name":{"kind":"Name","value":"vin"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const BtcRgbppTransactionByTxIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BtcRgbppTransactionByTxId"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"txid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"btcTransaction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"txid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"txid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"rgbppTransaction"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ckbTransaction"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"outputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"cellType"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"inputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"cellType"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const CkbTransactionByHashDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CkbTransactionByHash"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"hash"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ckbTransaction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"txHash"},"value":{"kind":"Variable","name":{"kind":"Name","value":"hash"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hash"}},{"kind":"Field","name":{"kind":"Name","value":"isCellbase"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"fee"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"feeRate"}},{"kind":"Field","name":{"kind":"Name","value":"confirmations"}},{"kind":"Field","name":{"kind":"Name","value":"inputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cellType"}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"outputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"cellType"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"type"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}},{"kind":"Field","name":{"kind":"Name","value":"typeHash"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"block"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"timestamp"}}]}}]}}]}}]} as unknown as DocumentNode; export const RgbppStatisticDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"RgbppStatistic"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"rgbppStatistic"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"l1HoldersCount"},"name":{"kind":"Name","value":"holdersCount"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"layer"},"value":{"kind":"EnumValue","value":"L1"}}]},{"kind":"Field","alias":{"kind":"Name","value":"l2HoldersCount"},"name":{"kind":"Name","value":"holdersCount"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"layer"},"value":{"kind":"EnumValue","value":"L2"}}]},{"kind":"Field","name":{"kind":"Name","value":"latest24HoursL2TransactionsCount"}},{"kind":"Field","alias":{"kind":"Name","value":"latest24HoursL1TransactionsCountLeapIn"},"name":{"kind":"Name","value":"latest24HoursL1TransactionsCount"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leapDirection"},"value":{"kind":"EnumValue","value":"LeapIn"}}]},{"kind":"Field","alias":{"kind":"Name","value":"latest24HoursL1TransactionsCountLeapOutput"},"name":{"kind":"Name","value":"latest24HoursL1TransactionsCount"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leapDirection"},"value":{"kind":"EnumValue","value":"LeapOut"}}]},{"kind":"Field","alias":{"kind":"Name","value":"latest24HoursL1TransactionsCountLeapWithin"},"name":{"kind":"Name","value":"latest24HoursL1TransactionsCount"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leapDirection"},"value":{"kind":"EnumValue","value":"Within"}}]}]}}]}}]} as unknown as DocumentNode; export const RgbppLatestTransactionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"RgbppLatestTransactions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"rgbppLatestTransactions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ckbTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"btcTxid"}},{"kind":"Field","name":{"kind":"Name","value":"leapDirection"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"timestamp"}},{"kind":"Field","name":{"kind":"Name","value":"ckbTransaction"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"outputs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"capacity"}},{"kind":"Field","name":{"kind":"Name","value":"cellType"}},{"kind":"Field","name":{"kind":"Name","value":"lock"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"codeHash"}},{"kind":"Field","name":{"kind":"Name","value":"hashType"}},{"kind":"Field","name":{"kind":"Name","value":"args"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xudtInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"decimal"}}]}},{"kind":"Field","name":{"kind":"Name","value":"status"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"consumed"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"total"}},{"kind":"Field","name":{"kind":"Name","value":"pageSize"}}]}}]}}]} as unknown as DocumentNode; export const CkbAndBtcChainInfoDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CkbAndBtcChainInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ckbChainInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tipBlockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"transactionsCountIn24Hours"}}]}},{"kind":"Field","name":{"kind":"Name","value":"btcChainInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tipBlockHeight"}},{"kind":"Field","name":{"kind":"Name","value":"transactionsCountIn24Hours"}}]}}]}}]} as unknown as DocumentNode; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index da9e15b9..fdc99d14 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -305,6 +305,9 @@ importers: react-dom: specifier: ^18 version: 18.3.1(react@18.3.1) + react-intersection-observer: + specifier: ^9.13.1 + version: 9.13.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) typed.js: specifier: ^2.1.0 version: 2.1.0 @@ -380,7 +383,7 @@ importers: version: 14.2.4(eslint@8.57.0)(typescript@5.5.3) eslint-plugin-import: specifier: ^2.29.0 - version: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + version: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) eslint-plugin-no-relative-import-paths: specifier: ^1.5.3 version: 1.5.5 @@ -7514,6 +7517,15 @@ packages: peerDependencies: react: ^18.3.1 + react-intersection-observer@9.13.1: + resolution: {integrity: sha512-tSzDaTy0qwNPLJHg8XZhlyHTgGW6drFKTtvjdL+p6um12rcnp8Z5XstE+QNBJ7c64n5o0Lj4ilUleA41bmDoMw==} + peerDependencies: + react: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + react-dom: + optional: true + react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} @@ -15580,8 +15592,8 @@ snapshots: '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.5.3) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.9.0(eslint@8.57.0) eslint-plugin-react: 7.35.0(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) @@ -15603,13 +15615,13 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0): + eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 4.3.6 enhanced-resolve: 5.17.0 eslint: 8.57.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.6 is-core-module: 2.14.0 @@ -15620,18 +15632,18 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.5.3) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0) transitivePeerDependencies: - supports-color - eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -15641,7 +15653,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.14.0 is-glob: 4.0.3 @@ -18130,6 +18142,12 @@ snapshots: react: 18.3.1 scheduler: 0.23.2 + react-intersection-observer@9.13.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + dependencies: + react: 18.3.1 + optionalDependencies: + react-dom: 18.3.1(react@18.3.1) + react-is@16.13.1: {} react-is@18.3.1: {} From eba194cab6059d18cb0a4e71ba3c5754489d02c0 Mon Sep 17 00:00:00 2001 From: ahonn Date: Fri, 27 Sep 2024 16:06:05 +1000 Subject: [PATCH 7/8] chore: update default graphql complexity limit --- backend/src/env.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/env.ts b/backend/src/env.ts index ee925bc0..4afe3a93 100644 --- a/backend/src/env.ts +++ b/backend/src/env.ts @@ -10,7 +10,8 @@ export const envSchema = z .string() .default('true') .transform((value) => value === 'true'), - GRAPHQL_COMPLEXITY_LIMIT: z.coerce.number().default(100), + + GRAPHQL_COMPLEXITY_LIMIT: z.coerce.number().default(1000), CLUSTER_WORKERS_NUM: z.coerce.number().default(2), From 7b7168cc3f7af86e1d7027b909fa4b3e80a4105d Mon Sep 17 00:00:00 2001 From: ahonn Date: Fri, 27 Sep 2024 16:35:53 +1000 Subject: [PATCH 8/8] bump(backend): v0.2.0 --- backend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index 751f6542..7578c85c 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "@utxo-stack-explorer/backend", - "version": "0.1.1", + "version": "0.2.0", "description": "", "author": "", "private": true,