3939
4040<script >
4141import { mapGetters } from ' vuex' ;
42+ import { Name } from ' @aeternity/aepp-sdk-next' ;
4243import { MAX_AUCTION_NAME_LENGTH } from ' ../../lib/constants' ;
4344import { handleUnknownError , isNotFoundError } from ' ../../lib/utils' ;
4445import { i18n } from ' ../../store/plugins/ui/languages' ;
@@ -62,7 +63,6 @@ export default {
6263 async handleSubmit () {
6364 if (! (await this .$validator .validateAll ())) return ;
6465 this .busy = true ;
65- let claimTxHash;
6666
6767 try {
6868 await this .$store .getters .node .getAuctionEntryByName (this .name );
@@ -82,11 +82,11 @@ export default {
8282 }
8383 }
8484
85+ const name = new Name (this .name , this .$store .getters .sdk .getContext ());
86+ let claimTxHash;
8587 try {
86- const { salt } = await this .$store .state .sdk .aensPreclaim (this .name );
87- claimTxHash = (await this .$store .state .sdk .aensClaim (this .name , salt, { waitMined: false }))
88- .hash ;
89-
88+ await name .preclaim ();
89+ claimTxHash = (await name .claim ({ waitMined: false })).hash ;
9090 this .$store .dispatch (' modals/open' , {
9191 name: ' notification' ,
9292 text: this .$t (' name.new.notification.claim-sent' , { name: this .name }),
@@ -102,7 +102,7 @@ export default {
102102
103103 try {
104104 this .$store .dispatch (' names/fetchOwned' );
105- await this .$store .state .sdk .poll (claimTxHash);
105+ await this .$store .getters .sdk .poll (claimTxHash);
106106 const isAuction = MAX_AUCTION_NAME_LENGTH >= this .name .length ;
107107 if (! isAuction) {
108108 await this .$store .dispatch (' names/updatePointer' , {
0 commit comments