File tree Expand file tree Collapse file tree 5 files changed +2257
-3471
lines changed Expand file tree Collapse file tree 5 files changed +2257
-3471
lines changed Original file line number Diff line number Diff line change 1+ ### [ 8.4.0] ( https://github.com/xdevguild/nextjs-dapp-template/releases/tag/v8.4.0 ) (2023-07-28)
2+ - update useElven (guardians support)
3+ - update other dependencies
4+
15### [ 8.3.0] ( https://github.com/xdevguild/nextjs-dapp-template/releases/tag/v8.3.0 ) (2023-06-29)
26- update useElven (switch to tsup)
37- update other dependancies
Original file line number Diff line number Diff line change 44 useTransaction ,
55 TransactionCallbackParams ,
66 useConfig ,
7+ useAccount ,
78} from '@useelven/core' ;
89import { useCallback } from 'react' ;
910import { ActionButton } from '../tools/ActionButton' ;
@@ -19,17 +20,25 @@ export const SimpleEGLDTxDemo = ({
1920 cb : ( params : TransactionCallbackParams ) => void ;
2021} ) => {
2122 const { pending, triggerTx } = useTransaction ( { cb } ) ;
23+ const { activeGuardianAddress } = useAccount ( ) ;
2224 const { explorerAddress, chainType } = useConfig ( ) ;
2325
2426 const handleSendTx = useCallback ( ( ) => {
2527 const demoMessage = 'Transaction demo!' ;
28+
29+ let gasLimit = 50000 + 1500 * demoMessage . length ;
30+
31+ if ( activeGuardianAddress ) {
32+ gasLimit = gasLimit + 50000 ;
33+ }
34+
2635 triggerTx ( {
2736 address : egldTransferAddress ,
28- gasLimit : 50000 + 1500 * demoMessage . length ,
37+ gasLimit,
2938 data : new TransactionPayload ( demoMessage ) ,
3039 value : TokenTransfer . egldFromAmount ( egldTransferAmount ) ,
3140 } ) ;
32- } , [ triggerTx ] ) ;
41+ } , [ activeGuardianAddress , triggerTx ] ) ;
3342
3443 return (
3544 < FlexCardWrapper >
Original file line number Diff line number Diff line change 99 useTransaction ,
1010 TransactionCallbackParams ,
1111 useConfig ,
12+ useAccount ,
1213} from '@useelven/core' ;
1314import { useCallback } from 'react' ;
1415import { ActionButton } from '../tools/ActionButton' ;
@@ -27,6 +28,7 @@ export const SimpleNftMintDemo = ({
2728 cb : ( params : TransactionCallbackParams ) => void ;
2829} ) => {
2930 const { pending, triggerTx } = useTransaction ( { cb } ) ;
31+ const { activeGuardianAddress } = useAccount ( ) ;
3032 const { explorerAddress, chainType } = useConfig ( ) ;
3133
3234 const handleSendTx = useCallback ( ( ) => {
@@ -36,13 +38,19 @@ export const SimpleNftMintDemo = ({
3638 . setArgs ( [ new U32Value ( 1 ) ] )
3739 . build ( ) ;
3840
41+ let gasLimit = 14000000 ;
42+
43+ if ( activeGuardianAddress ) {
44+ gasLimit = gasLimit + 50000 ;
45+ }
46+
3947 triggerTx ( {
4048 address : mintSmartContractAddress ,
41- gasLimit : 14000000 ,
49+ gasLimit,
4250 value : TokenTransfer . egldFromAmount ( mintPaymentPerToken ) ,
4351 data,
4452 } ) ;
45- } , [ triggerTx ] ) ;
53+ } , [ activeGuardianAddress , triggerTx ] ) ;
4654
4755 return (
4856 < FlexCardWrapper >
You can’t perform that action at this time.
0 commit comments