From 9da188108682ef945a35f35b024ed9216710900d Mon Sep 17 00:00:00 2001 From: akashrdev Date: Thu, 20 Feb 2025 15:24:30 -0600 Subject: [PATCH] Feat: Add bio and location records --- js/src/record_v2/const.ts | 2 ++ js/src/types/record.ts | 2 ++ js/tests/records-v2.test.ts | 11 ++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/js/src/record_v2/const.ts b/js/src/record_v2/const.ts index 1989598b..c99a78a2 100644 --- a/js/src/record_v2/const.ts +++ b/js/src/record_v2/const.ts @@ -48,6 +48,8 @@ export const UTF8_ENCODED = new Set([ Record.CNAME, Record.BTC, Record.IPNS, + Record.Location, + Record.Bio, ]); /** diff --git a/js/src/types/record.ts b/js/src/types/record.ts index cca51803..13cbd6c2 100644 --- a/js/src/types/record.ts +++ b/js/src/types/record.ts @@ -29,6 +29,8 @@ export enum Record { Background = "background", BASE = "BASE", IPNS = "IPNS", + Location = "location", + Bio = "bio", } export const RECORD_V1_SIZE: Map = new Map([ diff --git a/js/tests/records-v2.test.ts b/js/tests/records-v2.test.ts index 0e337fe6..85a840ee 100644 --- a/js/tests/records-v2.test.ts +++ b/js/tests/records-v2.test.ts @@ -1,5 +1,5 @@ require("dotenv").config(); -import { test, expect } from "@jest/globals"; +import { test, expect, jest } from "@jest/globals"; import { deserializeRecordV2Content } from "../src/record_v2/deserializeRecordV2Content"; import { getMultipleRecordsV2 } from "../src/record_v2/getMultipleRecordsV2"; import { getRecordV2 } from "../src/record_v2/getRecordV2"; @@ -62,6 +62,15 @@ test("Records V2 des/ser", () => { content: "k51qzi5uqu5dlvj2baxnqndepeb86cbk3ng7n3i46uzyxzyqj2xjonzllnv0v8", record: Record.IPNS, }, + { + content: "AlabamaArkansas", + record: Record.Location, + }, + { + content: + "Hey there my name is SNS! I want to get your web3 identity in your hands now!", + record: Record.Bio, + }, ]; items.forEach((e) => {