commit
987970ab95
5 changed files with 5 additions and 5 deletions
|
|
@ -478,7 +478,7 @@ The nostr server will send back a message response, and inside the body there wi
|
|||
- GetNPubLinkingState
|
||||
- auth type: __App__
|
||||
- http method: __post__
|
||||
- http route: __/api/app/user/npub/token__
|
||||
- http route: __/api/app/user/npub/state__
|
||||
- input: [GetNPubLinking](#GetNPubLinking)
|
||||
- output: [NPubLinking](#NPubLinking)
|
||||
|
||||
|
|
|
|||
|
|
@ -840,7 +840,7 @@ func NewClient(params ClientParams) *Client {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
finalRoute := "/api/app/user/npub/token"
|
||||
finalRoute := "/api/app/user/npub/state"
|
||||
body, err := json.Marshal(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -879,7 +879,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
|
|||
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e }
|
||||
})
|
||||
if (!opts.allowNotImplementedMethods && !methods.GetNPubLinkingState) throw new Error('method: GetNPubLinkingState is not implemented')
|
||||
app.post('/api/app/user/npub/token', async (req, res) => {
|
||||
app.post('/api/app/user/npub/state', async (req, res) => {
|
||||
const info: Types.RequestInfo = { rpcName: 'GetNPubLinkingState', batch: false, nostr: false, batchSize: 0}
|
||||
const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n }
|
||||
let authCtx: Types.AuthContext = {}
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ export default (params: ClientParams) => ({
|
|||
GetNPubLinkingState: async (request: Types.GetNPubLinking): Promise<ResultError | ({ status: 'OK' }& Types.NPubLinking)> => {
|
||||
const auth = await params.retrieveAppAuth()
|
||||
if (auth === null) throw new Error('retrieveAppAuth() returned null')
|
||||
let finalRoute = '/api/app/user/npub/token'
|
||||
let finalRoute = '/api/app/user/npub/state'
|
||||
const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } })
|
||||
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
|
||||
if (data.status === 'OK') {
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ service LightningPub {
|
|||
rpc GetNPubLinkingState(structs.GetNPubLinking) returns (structs.NPubLinking) {
|
||||
option (auth_type) = "App";
|
||||
option (http_method) = "post";
|
||||
option (http_route) = "/api/app/user/npub/token";
|
||||
option (http_route) = "/api/app/user/npub/state";
|
||||
}
|
||||
rpc RequestNPubLinkingToken(structs.RequestNPubLinkingTokenRequest) returns (structs.RequestNPubLinkingTokenResponse) {
|
||||
option (auth_type) = "App";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue