From a1812cd8f22491c81a4e52b0c9b29f4d760458a2 Mon Sep 17 00:00:00 2001 From: HeesungB Date: Sat, 17 Dec 2022 22:40:40 +0900 Subject: [PATCH] Add remove contract --- messages/icns.ts | 18 ++++++++++ pages/verification/index.tsx | 67 +++++++++++++++++++++++++++++++++++- 2 files changed, 84 insertions(+), 1 deletion(-) diff --git a/messages/icns.ts b/messages/icns.ts index 50108f7..e85faa5 100644 --- a/messages/icns.ts +++ b/messages/icns.ts @@ -70,3 +70,21 @@ export const makeSetRecordMessage = ( [], ); }; + +export const makeRemoveRecordMessage = ( + twitterUserName: string, + senderAddress: string, + removeAddress: string, +): CosmwasmExecuteMessageResult => { + return makeCosmwasmExecMsg( + senderAddress, + RESOLVER_ADDRESS, + { + remove_record: { + name: twitterUserName, + bech32_address: removeAddress, + }, + }, + [], + ); +}; diff --git a/pages/verification/index.tsx b/pages/verification/index.tsx index ddf705c..1294eed 100644 --- a/pages/verification/index.tsx +++ b/pages/verification/index.tsx @@ -51,7 +51,11 @@ import { KEPLR_NOT_FOUND_ERROR, TWITTER_LOGIN_ERROR, } from "../../constants/error-message"; -import { makeClaimMessage, makeSetRecordMessage } from "../../messages"; +import { + makeClaimMessage, + makeRemoveRecordMessage, + makeSetRecordMessage, +} from "../../messages"; import Axios from "axios"; import { BackButton } from "../../components/back-button"; @@ -360,6 +364,67 @@ export default function VerificationPage() { ) : ( +
+ +