Skip to content

Commit 739cd6d

Browse files
committed
initial commit
1 parent 29f11ed commit 739cd6d

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

packages/api-react/src/services/wallet.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,8 @@ export const walletApi = apiWithTag.injectEndpoints({
583583

584584
getNetworkInfo: query(build, WalletService, 'getNetworkInfo'),
585585

586+
getWalletFeeEstimate: query(build, WalletService, 'getFeeEstimate'),
587+
586588
getSyncStatus: query(build, WalletService, 'getSyncStatus', {
587589
onCacheEntryAdded: onCacheEntryAddedInvalidate(baseQuery, api, [
588590
{
@@ -1550,6 +1552,7 @@ export const {
15501552
useLazyGetTimestampForHeightQuery,
15511553
useGetHeightInfoQuery,
15521554
useGetNetworkInfoQuery,
1555+
useGetWalletFeeEstimateQuery,
15531556
useGetSyncStatusQuery,
15541557
useGetWalletConnectionsQuery,
15551558
useGetAllOffersQuery,

packages/api/src/services/WalletService.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ export default class Wallet extends Service {
202202
return this.command<{ networkName: string; networkPrefix: string }>('get_network_info');
203203
}
204204

205+
async getFeeEstimate() {
206+
return this.command<{ feeEstimate: number }>('get_fee_estimate');
207+
}
208+
205209
async getSyncStatus() {
206210
return this.command<{
207211
genesisInitialized: boolean;

packages/gui/src/constants/WalletConnectCommands.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,14 @@ const walletConnectCommands: WalletConnectCommand[] = [
311311
},
312312
],
313313
},
314+
{
315+
command: 'getFeeEstimate',
316+
label: <Trans>Get Fee Estimate</Trans>,
317+
description: <Trans>Requests an estimate of the transaction fee</Trans>,
318+
service: ServiceName.WALLET,
319+
serviceCommand: 'getWalletFeeEstimate',
320+
bypassConfirm: true,
321+
},
314322
{
315323
command: 'getSyncStatus',
316324
label: <Trans>Get Wallet Sync Status</Trans>,

packages/gui/src/electron/constants/AllowedCommands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default [
6565
'chia_wallet.extend_derivation_index',
6666
'chia_wallet.nft_get_info',
6767
'chia_wallet.get_farmed_amount',
68+
'chia_wallet.get_fee_estimate',
6869

6970
'chia_wallet.get_offer',
7071
'chia_wallet.nft_calculate_royalties',

0 commit comments

Comments
 (0)