Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/api-react/src/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export const {
useGetPuzzleAndSolutionMutation,
useGetNetworkInfoQuery,
useGetFullNodePeerCountQuery,
useGetWalletFeeEstimateQuery,
useGetSyncStatusQuery,
useGetWalletConnectionsQuery,
useGetAllOffersQuery,
Expand Down
3 changes: 3 additions & 0 deletions packages/api-react/src/services/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,8 @@ export const walletApi = apiWithTag.injectEndpoints({

getFullNodePeerCount: query(build, WalletService, 'getFullNodePeerCount'),

getWalletFeeEstimate: query(build, WalletService, 'getFeeEstimate'),

getSyncStatus: query(build, WalletService, 'getSyncStatus', {
onCacheEntryAdded: onCacheEntryAddedInvalidate(baseQuery, api, [
{
Expand Down Expand Up @@ -1633,6 +1635,7 @@ export const {
useGetPuzzleAndSolutionMutation,
useGetNetworkInfoQuery,
useGetFullNodePeerCountQuery,
useGetWalletFeeEstimateQuery,
Comment thread
cursor[bot] marked this conversation as resolved.
useGetSyncStatusQuery,
useGetWalletConnectionsQuery,
useGetAllOffersQuery,
Expand Down
4 changes: 4 additions & 0 deletions packages/api/src/services/WalletService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ export default class Wallet extends Service {
return this.command<{ peerCount: number }>('get_full_node_peer_count');
}

async getFeeEstimate() {
return this.command<{ feePerCost: number }>('get_fee_estimate');
}

async getSyncStatus() {
return this.command<{
genesisInitialized: boolean;
Expand Down
14 changes: 14 additions & 0 deletions packages/gui/src/electron/commands/Commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,20 @@ export const Commands: Record<string, CommandSchema> = {
},
],
},
'chia_wallet.get_fee_estimate': {
title: () => i18n._(/* i18n */ { id: 'Get Fee Estimate' }),
message: () => i18n._(/* i18n */ { id: 'Requests the current fee per cost estimate from the wallet' }),
confirmLabel: () => i18n._(/* i18n */ { id: 'Proceed' }),
params: [],
dapp: [
{
command: 'chia_getFeeEstimate',
title: () => i18n._(/* i18n */ { id: 'Get Fee Estimate' }),
message: () => i18n._(/* i18n */ { id: 'Requests the current fee per cost estimate from the wallet' }),
allowConfirmationBypass: true,
},
],
},

'chia_wallet.get_height_info': {
title: () => i18n._(/* i18n */ { id: 'Get Height Info' }),
Expand Down
1 change: 1 addition & 0 deletions packages/gui/src/electron/commands/isAllowedCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const ALLOWED_COMMANDS_SET = new Set<keyof typeof Commands>([
'chia_wallet.get_notifications',
'chia_wallet.get_sync_status',
'chia_wallet.get_full_node_peer_count',
'chia_wallet.get_fee_estimate',
'chia_wallet.get_wallets',
'chia_wallet.get_coin_records_by_names',
'chia_wallet.select_coins',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const DAPP_ALLOWED_COMMANDS = new Set<keyof typeof Commands>([
'chia_wallet.get_next_address',
'chia_wallet.get_sync_status',
'chia_wallet.get_full_node_peer_count',
'chia_wallet.get_fee_estimate',
'chia_wallet.get_coin_records_by_names',
'chia_wallet.select_coins',
'chia_wallet.get_height_info',
Expand Down
Loading