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
+
1
5
### [ 8.3.0] ( https://github.com/xdevguild/nextjs-dapp-template/releases/tag/v8.3.0 ) (2023-06-29)
2
6
- update useElven (switch to tsup)
3
7
- update other dependancies
Original file line number Diff line number Diff line change 4
4
useTransaction ,
5
5
TransactionCallbackParams ,
6
6
useConfig ,
7
+ useAccount ,
7
8
} from '@useelven/core' ;
8
9
import { useCallback } from 'react' ;
9
10
import { ActionButton } from '../tools/ActionButton' ;
@@ -19,17 +20,25 @@ export const SimpleEGLDTxDemo = ({
19
20
cb : ( params : TransactionCallbackParams ) => void ;
20
21
} ) => {
21
22
const { pending, triggerTx } = useTransaction ( { cb } ) ;
23
+ const { activeGuardianAddress } = useAccount ( ) ;
22
24
const { explorerAddress, chainType } = useConfig ( ) ;
23
25
24
26
const handleSendTx = useCallback ( ( ) => {
25
27
const demoMessage = 'Transaction demo!' ;
28
+
29
+ let gasLimit = 50000 + 1500 * demoMessage . length ;
30
+
31
+ if ( activeGuardianAddress ) {
32
+ gasLimit = gasLimit + 50000 ;
33
+ }
34
+
26
35
triggerTx ( {
27
36
address : egldTransferAddress ,
28
- gasLimit : 50000 + 1500 * demoMessage . length ,
37
+ gasLimit,
29
38
data : new TransactionPayload ( demoMessage ) ,
30
39
value : TokenTransfer . egldFromAmount ( egldTransferAmount ) ,
31
40
} ) ;
32
- } , [ triggerTx ] ) ;
41
+ } , [ activeGuardianAddress , triggerTx ] ) ;
33
42
34
43
return (
35
44
< FlexCardWrapper >
Original file line number Diff line number Diff line change 9
9
useTransaction ,
10
10
TransactionCallbackParams ,
11
11
useConfig ,
12
+ useAccount ,
12
13
} from '@useelven/core' ;
13
14
import { useCallback } from 'react' ;
14
15
import { ActionButton } from '../tools/ActionButton' ;
@@ -27,6 +28,7 @@ export const SimpleNftMintDemo = ({
27
28
cb : ( params : TransactionCallbackParams ) => void ;
28
29
} ) => {
29
30
const { pending, triggerTx } = useTransaction ( { cb } ) ;
31
+ const { activeGuardianAddress } = useAccount ( ) ;
30
32
const { explorerAddress, chainType } = useConfig ( ) ;
31
33
32
34
const handleSendTx = useCallback ( ( ) => {
@@ -36,13 +38,19 @@ export const SimpleNftMintDemo = ({
36
38
. setArgs ( [ new U32Value ( 1 ) ] )
37
39
. build ( ) ;
38
40
41
+ let gasLimit = 14000000 ;
42
+
43
+ if ( activeGuardianAddress ) {
44
+ gasLimit = gasLimit + 50000 ;
45
+ }
46
+
39
47
triggerTx ( {
40
48
address : mintSmartContractAddress ,
41
- gasLimit : 14000000 ,
49
+ gasLimit,
42
50
value : TokenTransfer . egldFromAmount ( mintPaymentPerToken ) ,
43
51
data,
44
52
} ) ;
45
- } , [ triggerTx ] ) ;
53
+ } , [ activeGuardianAddress , triggerTx ] ) ;
46
54
47
55
return (
48
56
< FlexCardWrapper >
You can’t perform that action at this time.
0 commit comments