Skip to content

Commit

Permalink
fix(util): add FQDN regex that matches ArNS contract
Browse files Browse the repository at this point in the history
  • Loading branch information
kunstmusik committed May 2, 2024
1 parent 42302ef commit e6d7396
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
export const ARWEAVE_TX_REGEX = new RegExp('^[a-zA-Z0-9_-]{43}$');

/** FQDN regex that matches the one used in the ArNS contract. */
export const FQDN_REGEX = new RegExp(
'^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$',
);

// sortkey: padded blockheight to 12, JS timestamp, hash of transactionID + block hash. Timestamp only applicable to L2 and normally is all zeros.
export const SORT_KEY_REGEX = new RegExp(
'^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$',
Expand Down

0 comments on commit e6d7396

Please sign in to comment.