-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(backend): fill backend todos #8
Conversation
@ShookLyngs is attempting to deploy a commit to the Cell Studio Team on Vercel. To accomplish this, @ShookLyngs needs to request access to the Team. Afterwards, an owner of the Team is required to accept their membership request. If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account. |
public async totalFee( | ||
@Parent() block: BitcoinBaseBlock, | ||
@Loader(BitcoinBlockTransactionsLoader) | ||
blockTxsLoader: DataLoader<string, BitcoinBlockTransactionsLoaderResponse>, | ||
): Promise<number> { | ||
const txs = await blockTxsLoader.load(block.id); | ||
return txs.reduce((sum, tx) => sum + tx.fee, 0); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result of https://mempool.space/docs/api/rest#get-block
has a totalFees
field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the version we use don't have totalFees
and feeRange
in the response; See: https://cell.mempool.space/testnet/api/block/0000000000000017b4ca3cf7748ffb59ba986670b288df26b3ea8cb850673cae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://mempool.space/testnet/api/v1/block/0000000000000017b4ca3cf7748ffb59ba986670b288df26b3ea8cb850673cae contains the extra fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored at: 502a512
} | ||
|
||
@ResolveField(() => FeeRateRange) | ||
public async feeRateRange(@Parent() block: BitcoinBaseBlock): Promise<FeeRateRange> { | ||
// TODO: Implement this resolver | ||
public async feeRateRange( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using the feeRange
field in the response of https://mempool.space/docs/api/rest#get-block
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored at: 502a512
Conclusion after discussing with @Flouse:
|
|
…using mempool extras
The
|
@Flouse is attempting to deploy a commit to the Cell Studio Team on Vercel. To accomplish this, @Flouse needs to request access to the Team. Afterwards, an owner of the Team is required to accept their membership request. If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account. |
…action.resolver.ts
TODOs
BitcoinAddress:
BitcoinApiService.getAddressTxsUtxo()
APIBitcoinApiService.getAddressTxsUtxo()
APIBitcoinApiService.getAddress()
APIBitcoinApiService.getAddressTxs()
API, the implementation comes with pagination and is different from the original design by @ahonn, because the resolver only returns up to 50 records; If the user wishes to load more, aafterTxid
argument is available, like in the following code:BitcoinBlock:
vout[0].address
of the first transaction in a blockBitcoinApiService.getBlockTxs()
API and summarize the results, but there are two issues blocking:BitcoinApiService.getBlockTxs()
API has pagination and only returns up to 25 records per requestBitcoinBlockTransactionsLoader only returns the first 25 transactions of each block #9
BitcoinOutput:
TransactionService:
txid
, this feature looks very similar to the implementaion in btc-assets-api#182