@@ -249,15 +249,15 @@ const addressStETH = await lidoSDK.stake.contractAddressStETH();
249
249
const contractStETH = await lidoSDK .stake .getContractStETH ();
250
250
251
251
// Calls
252
- const stakeResult = await lidoSDK .stake .stakeEth ({
252
+ const stakeTx = await lidoSDK .stake .stakeEth ({
253
253
value ,
254
254
callback ,
255
255
referralAddress ,
256
256
});
257
257
258
258
console .log (addressStETH , ' stETH contract address' );
259
259
console .log (contractStETH , ' stETH contract' );
260
- console .log (stakeResult , ' stake result' );
260
+ console .log (stakeTx , ' stake tx result' );
261
261
```
262
262
263
263
### Withdraw example
@@ -276,15 +276,15 @@ const contractWithdrawalQueue =
276
276
await lidoSDK .withdraw .contract .getContractWithdrawalQueue ();
277
277
278
278
// Calls
279
- const requestResult = await lidoSDK .withdraw .request .requestByToken ({
280
- account ,
279
+ const requestTx = await lidoSDK .withdraw .request .requestWithdrawalWithPermit ({
281
280
amount: 10000000n , // `10000000` string is accepted as well
282
281
token: ' stETH' ,
282
+ // account will be requested from provider
283
283
});
284
284
285
285
console .log (addressWithdrawalQueue , ' Withdrawal Queue contract address' );
286
286
console .log (contractWithdrawalQueue , ' Withdrawal Queue contract' );
287
- console .log (requestResult , ' request result ' );
287
+ console .log (requestTx . result . requests , ' array of created requests ' );
288
288
```
289
289
290
290
### Wrap example
@@ -301,14 +301,16 @@ const addressWstETH = await lidoSDK.wrap.contractAddressWstETH();
301
301
const contractWstETH = await lidoSDK .withdraw .getContractWstETH ();
302
302
303
303
// Calls
304
- const wrapResult = await lidoSDK .wrap .wrapEth ({
304
+ const wrapTx = await lidoSDK .wrap .wrapEth ({
305
305
value ,
306
306
account ,
307
307
});
308
308
309
+ const { stethWrapped, wstethReceived } = wrapTx .result ;
310
+
309
311
console .log (addressWstETH , ' wstETH contract address' );
310
312
console .log (contractWstETH , ' wstETH contract' );
311
- console .log (wrapResult , ' wrap result' );
313
+ console .log ({ stethWrapped , wstethReceived } , ' wrap result' );
312
314
```
313
315
314
316
## Error Codes
@@ -397,16 +399,18 @@ const callback: StakeStageCallback = ({ stage, payload }) => {
397
399
};
398
400
399
401
try {
400
- const stakeResult = await lidoSDK .stake .stakeEth ({
402
+ const stakeTx = await lidoSDK .stake .stakeEth ({
401
403
value ,
402
404
callback ,
403
405
referralAddress ,
404
406
account ,
405
407
});
406
408
407
409
console .log (
408
- stakeResult ,
409
- ' transaction hash, transaction receipt, confirmations' ,
410
+ stakeTx ,
411
+ ' transaction hash, transaction receipt, confirmations, stake result' ,
412
+ stakeTx .result .stethReceived ,
413
+ stakeTx .result .sharesReceived ,
410
414
);
411
415
} catch (error ) {
412
416
console .log ((error as SDKError ).errorMessage , (error as SDKError ).code );
@@ -502,15 +506,17 @@ const callback: TransactionCallback = ({ stage, payload }) => {
502
506
};
503
507
504
508
try {
505
- const wrapResult = await lidoSDK .staking .wrapETH ({
509
+ const wrapTx = await lidoSDK .staking .wrapETH ({
506
510
value ,
507
511
callback ,
508
512
account ,
509
513
});
510
514
511
515
console .log (
512
- stakeResult ,
513
- ' transaction hash, transaction receipt, confirmations' ,
516
+ wrapTx ,
517
+ ' transaction hash, transaction receipt, confirmations, wrap result' ,
518
+ wrapTx .result .stethWrapped ,
519
+ wrapTx .result .wstethReceived ,
514
520
);
515
521
} catch (error ) {
516
522
console .log ((error as SDKError ).errorMessage , (error as SDKError ).code );
@@ -552,10 +558,12 @@ const wrapResult = await lidoSDK.wrap.wrapSteth({ value, callback });
552
558
553
559
``` ts
554
560
// unwrap wstETH to receive stETH
555
- const unwrapResult = await lidoSDK .wrap .unwrap ({
561
+ const unwrapTx = await lidoSDK .wrap .unwrap ({
556
562
value: unwrapAmount ,
557
563
callback ,
558
564
});
565
+
566
+ console .log (unwrapTx .result .stethReceived , unwrapTx .result .wstethUnwrapped );
559
567
```
560
568
561
569
### Wrap utilities
@@ -636,16 +644,18 @@ const callback: TransactionCallback = ({ stage, payload }) => {
636
644
};
637
645
638
646
try {
639
- const requestResult = await lidoSDK .withdrawals .request .requestWithPermit ({
647
+ const requestTx = await lidoSDK .withdrawals .request .requestWithPermit ({
640
648
requests ,
641
649
token , // 'stETH' | 'wstETH'
642
650
callback ,
643
651
account ,
644
652
});
645
653
646
654
console .log (
655
+ ' transaction hash, transaction receipt, confirmations' ,
647
656
requestResult ,
648
- ' transaction hash, transaction receipt, confirmations' ,
657
+ ' array of requests(nfts) created with ids, amounts,creator, owner'
658
+ request .results .requests ,
649
659
);
650
660
} catch (error ) {
651
661
console .log ((error as SDKError ).errorMessage , (error as SDKError ).code );
@@ -709,7 +719,7 @@ const callback: TransactionCallback = ({ stage, payload }) => {
709
719
};
710
720
711
721
try {
712
- const requestResult = await lidoSDK .withdrawals .request .requestWithoutPermit ({
722
+ const requestResult = await lidoSDK .withdrawals .request .requestWithdrawal ({
713
723
amount ,
714
724
token , // 'stETH' | 'wstETH'
715
725
callback ,
@@ -781,14 +791,16 @@ const callback: TransactionCallback = ({ stage, payload }) => {
781
791
};
782
792
783
793
try {
784
- const claimResult = await lidoSDK .withdrawals .claim .claimRequests ({
794
+ const claimTx = await lidoSDK .withdrawals .claim .claimRequests ({
785
795
requestsIds ,
786
796
callback ,
787
797
});
788
798
789
799
console .log (
790
- claimResult ,
800
+ claimTx ,
791
801
' transaction hash, transaction receipt, confirmations' ,
802
+ claim .result .requests ,
803
+ ' array of claimed requests, with amounts of ETH claimed' ,
792
804
);
793
805
} catch (error ) {
794
806
console .log ((error as SDKError ).errorMessage , (error as SDKError ).code );
0 commit comments