-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #357 from EresDevOrg/development
- Loading branch information
Showing
10 changed files
with
215 additions
and
70 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
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
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,24 @@ | ||
const storageKey = "incompleteMints"; | ||
|
||
export function getIncompleteMintTx(permitNonce: string): string | null { | ||
const incompleteClaims = localStorage.getItem(storageKey); | ||
return incompleteClaims ? JSON.parse(incompleteClaims)[permitNonce] : null; | ||
} | ||
|
||
export function storeIncompleteMintTx(permitNonce: string, txHash: string) { | ||
let incompleteClaims: { [key: string]: string } = { [permitNonce]: txHash }; | ||
const oldIncompleteClaims = localStorage.getItem(storageKey); | ||
if (oldIncompleteClaims) { | ||
incompleteClaims = { ...incompleteClaims, ...JSON.parse(oldIncompleteClaims) }; | ||
} | ||
localStorage.setItem(storageKey, JSON.stringify(incompleteClaims)); | ||
} | ||
|
||
export function removeIncompleteMintTx(permitNonce: string) { | ||
const incompleteClaims = localStorage.getItem(storageKey); | ||
if (incompleteClaims) { | ||
const incompleteClaimsObj = JSON.parse(incompleteClaims); | ||
delete incompleteClaimsObj[permitNonce]; | ||
localStorage.setItem(storageKey, JSON.stringify(incompleteClaimsObj)); | ||
} | ||
} |
Oops, something went wrong.