-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed transfer implementation and reports response for each NFT trans…
…ferred
- Loading branch information
Showing
9 changed files
with
118 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/app/@core/services/build5-error-lookup/build5-error-lookup.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { WenError } from '@build-5/interfaces'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class Build5ErrorLookupService { | ||
|
||
constructor() { } | ||
|
||
public getErrorMessage(errorCode: number): string { | ||
// Convert WenError object to an array and find the entry by error code | ||
const errorEntry = Object.values(WenError).find(entry => entry.code === errorCode); | ||
return errorEntry ? errorEntry.key : 'Unknown error'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
src/app/@core/services/nft-selection/nft-selection.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { BehaviorSubject } from 'rxjs'; | ||
import { BehaviorSubject, Subject } from 'rxjs'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class NftSelectionService { | ||
private selectedNftIdsSubject = new BehaviorSubject<string[]>([]); | ||
selectedNftIds$ = this.selectedNftIdsSubject.asObservable(); | ||
private modalClosedSource = new Subject<void>(); | ||
public modalClosed$ = this.modalClosedSource.asObservable(); | ||
|
||
public selectNft(nftId: string) { | ||
//console.log('nft-selection.service deselectNft - initial nfts: ', this.selectedNftIdsSubject.getValue()); | ||
const currentSelectedNftIds = this.selectedNftIdsSubject.getValue(); | ||
if (!currentSelectedNftIds.includes(nftId)) { | ||
//console.log('nft-selection.service deselectNft - selected nfts missing this nft, adding this nft: ', nftId); | ||
this.selectedNftIdsSubject.next([...currentSelectedNftIds, nftId]); | ||
} | ||
//console.log('nft-selection.service deselectNft - ending nfts: ', this.selectedNftIdsSubject.getValue()); | ||
} | ||
|
||
public deselectNft(nftId: string) { | ||
//console.log('nft-selection.service deselectNft - initial nfts: ', this.selectedNftIdsSubject.getValue()); | ||
const updatedSelectedNftIds = this.selectedNftIdsSubject.getValue().filter(id => id !== nftId); | ||
this.selectedNftIdsSubject.next(updatedSelectedNftIds); | ||
//console.log('nft-selection.service deselectNft - ending nfts: ', updatedSelectedNftIds); | ||
} | ||
|
||
public clearSelection() { | ||
//console.log('nft-selection.service clearSelection fired.'); | ||
this.selectedNftIdsSubject.next([]); | ||
} | ||
|
||
public notifyModalClosed(): void { | ||
this.modalClosedSource.next(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters