1
1
import { useCallback , useMemo , useState } from 'react' ;
2
- import {
3
- RawBankSendMessage ,
4
- RawTx ,
5
- RawVmAddPackageMessage ,
6
- RawVmCallMessage ,
7
- strToSignedTx ,
8
- } from 'adena-module' ;
2
+ import { RawTx , strToSignedTx } from 'adena-module' ;
9
3
import { Tx } from '@gnolang/tm2-js-client' ;
10
4
11
5
import { makeGnotAmountByRaw } from '@common/utils/amount-utils' ;
@@ -54,7 +48,7 @@ function makeTypeName(rawTx: RawTx): string {
54
48
}
55
49
56
50
function mapBankSendTransactionInfo ( rawTx : RawTx ) : TransactionDisplayInfo [ ] {
57
- const message = rawTx . msg [ 0 ] as RawBankSendMessage ;
51
+ const message = rawTx . msg [ 0 ] as any ;
58
52
const amount = makeGnotAmountByRaw ( message . amount ) ;
59
53
const amountStr = `${ amount ?. value } ${ amount ?. denom } ` ;
60
54
const networkFee = makeGnotAmountByRaw ( rawTx . fee . gas_fee ) ;
@@ -70,7 +64,7 @@ function mapBankSendTransactionInfo(rawTx: RawTx): TransactionDisplayInfo[] {
70
64
}
71
65
72
66
function mapVmCallTransactionInfo ( rawTx : RawTx ) : TransactionDisplayInfo [ ] {
73
- const message = rawTx . msg [ 0 ] as RawVmCallMessage ;
67
+ const message = rawTx . msg [ 0 ] as any ;
74
68
const networkFee = makeGnotAmountByRaw ( rawTx . fee . gas_fee ) ;
75
69
const networkFeeStr = `${ networkFee ?. value } ${ networkFee ?. denom } ` ;
76
70
const extraInfo = rawTx . msg . length > 1 ? `${ rawTx . msg . length } ` : '' ;
@@ -84,7 +78,7 @@ function mapVmCallTransactionInfo(rawTx: RawTx): TransactionDisplayInfo[] {
84
78
}
85
79
86
80
function mapVmAddPackageTransactionInfo ( rawTx : RawTx ) : TransactionDisplayInfo [ ] {
87
- const message = rawTx . msg [ 0 ] as RawVmAddPackageMessage ;
81
+ const message = rawTx . msg [ 0 ] as any ;
88
82
const networkFee = makeGnotAmountByRaw ( rawTx . fee . gas_fee ) ;
89
83
const networkFeeStr = `${ networkFee ?. value } ${ networkFee ?. denom } ` ;
90
84
const extraInfo = rawTx . msg . length > 1 ? `${ rawTx . msg . length } ` : '' ;
@@ -169,7 +163,10 @@ const useBroadcastTransactionScreen = (): UseBroadcastTransactionScreenReturn =>
169
163
. then ( ( response ) => {
170
164
return Boolean ( response ?. hash ) ;
171
165
} )
172
- . catch ( ( ) => false ) ;
166
+ . catch ( ( e ) => {
167
+ console . error ( e ) ;
168
+ return false ;
169
+ } ) ;
173
170
174
171
if ( isSuccessBroadcasting ) {
175
172
navigate ( RoutePath . Wallet ) ;
0 commit comments