-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* custom salt validation * Removes unused package * Adding as salt option * Using uuid as salt * DEFAULT_SALT == uuid * Removes unused function * Moves error into uuidToBytes32 * keccak256 hash the salt * Adds expectedEditionAddress * changeset * salt: string | number * Remove await before returning promise Co-authored-by: Vignesh Hirudayakanth <vigneshkanth@gmail.com>
- Loading branch information
Showing
4 changed files
with
96 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@soundxyz/sdk': minor | ||
--- | ||
|
||
- Enables edition salt to be any string or number, which we hash & format to Bytes32 | ||
- Adds public expectedEditionAddress function |
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 |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import { isAddress } from '@ethersproject/address' | ||
|
||
import { InvalidAddressError } from '../errors' | ||
import keccak256 from 'keccak256' | ||
|
||
export function validateAddress(contractAddress: string) { | ||
if (!isAddress(contractAddress)) { | ||
throw new InvalidAddressError(`Invalid address: ${contractAddress}`) | ||
} | ||
} | ||
|
||
export function getSaltAsBytes32(salt: string | number) { | ||
return '0x' + keccak256(salt).toString('hex') | ||
} |
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