File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
examples/ibc-asset-list/hooks Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ import { toast, ToastShape } from '@interchain-ui/react';
55import { useChain } from '@interchain-kit/react' ;
66import { TxRaw } from 'osmo-query/dist/codegen/cosmos/tx/v1beta1/tx' ;
77import { assetLists } from '@chain-registry/v2' ;
8+ import {
9+ toConverters ,
10+ toEncoders ,
11+ } from '@interchainjs/cosmos/utils' ;
12+ import { MsgTransfer } from 'interchainjs/ibc/applications/transfer/v1/tx' ;
813
914interface Msg {
1015 typeUrl : string ;
@@ -47,12 +52,14 @@ export const useTx = (chainName: string) => {
4752 amount : [
4853 {
4954 denom : denomUnit ?. denom ! ,
50- amount : ( BigInt ( 10 ** ( denomUnit ?. exponent || 6 ) ) / 100n ) . toString ( )
55+ amount : ( BigInt ( 10 ** ( denomUnit ?. exponent || 6 ) ) / 10n ) . toString ( )
5156 }
5257 ] ,
53- gas : '200000 '
58+ gas : '800000 '
5459 }
5560 client = await getSigningClient ( ) ;
61+ client . addEncoders ( toEncoders ( MsgTransfer ) )
62+ client . addConverters ( toConverters ( MsgTransfer ) )
5663 signed = await client . sign ( address , msgs , fee , '' ) ;
5764 } catch ( e : any ) {
5865 console . error ( e ) ;
@@ -74,7 +81,7 @@ export const useTx = (chainName: string) => {
7481 if ( options . onSuccess ) options . onSuccess ( ) ;
7582 return options . toast ?. title || TxStatus . Successful ;
7683 } else {
77- console . error ( data ?. rawLog ) ;
84+ console . error ( data ) ;
7885 return {
7986 message : TxStatus . Failed ,
8087 toastType : 'error' ,
You can’t perform that action at this time.
0 commit comments