Show pubkey as bech32
This commit is contained in:
parent
1542a11f56
commit
6b06289b49
@ -1,5 +1,6 @@
|
|||||||
import { useEffect, useMemo, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
ServiceProvider,
|
ServiceProvider,
|
||||||
ServiceConfig,
|
ServiceConfig,
|
||||||
@ -20,7 +21,8 @@ import useProfile from "../feed/ProfileFeed";
|
|||||||
import useEventPublisher from "../feed/EventPublisher";
|
import useEventPublisher from "../feed/EventPublisher";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { resetProfile } from "../state/Users";
|
import { resetProfile } from "../state/Users";
|
||||||
import { useNavigate } from "react-router-dom";
|
// @ts-ignore
|
||||||
|
import { hexToBech32 } from "../Util";
|
||||||
|
|
||||||
type Nip05ServiceProps = {
|
type Nip05ServiceProps = {
|
||||||
name: string,
|
name: string,
|
||||||
@ -169,7 +171,7 @@ export default function Nip5Service(props: Nip05ServiceProps) {
|
|||||||
{availabilityResponse.quote?.price.toLocaleString()} sats<br />
|
{availabilityResponse.quote?.price.toLocaleString()} sats<br />
|
||||||
<small>{availabilityResponse.quote?.data.type}</small>
|
<small>{availabilityResponse.quote?.data.type}</small>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" className="f-grow mr10" placeholder="pubkey" value={pubkey} disabled={pubkey ? true : false} />
|
<input type="text" className="f-grow mr10" placeholder="pubkey" value={hexToBech32("npub", pubkey)} disabled />
|
||||||
<AsyncButton onClick={() => startBuy(handle, domain)}>Buy Now</AsyncButton>
|
<AsyncButton onClick={() => startBuy(handle, domain)}>Buy Now</AsyncButton>
|
||||||
</div>}
|
</div>}
|
||||||
{availabilityResponse?.available === false && !registerStatus && <div className="flex">
|
{availabilityResponse?.available === false && !registerStatus && <div className="flex">
|
||||||
|
@ -61,7 +61,12 @@ export class ServiceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async RegisterHandle(handle: string, domain: string, pubkey: string): Promise<HandleRegisterResponse | ServiceError> {
|
async RegisterHandle(handle: string, domain: string, pubkey: string): Promise<HandleRegisterResponse | ServiceError> {
|
||||||
return await this._GetJson("/registration/register", "PUT", { name: handle, domain, pk: pubkey, ref: "snort" });
|
return await this._GetJson("/registration/register", "PUT", {
|
||||||
|
name: handle,
|
||||||
|
domain,
|
||||||
|
pk: pubkey,
|
||||||
|
ref: "snort"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async CheckRegistration(token: string): Promise<CheckRegisterResponse | ServiceError> {
|
async CheckRegistration(token: string): Promise<CheckRegisterResponse | ServiceError> {
|
||||||
|
Loading…
Reference in New Issue
Block a user