-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
features around space members #19
Conversation
bob2402
commented
Jun 12, 2024
•
edited
Loading
edited
- Revise Member Type
1fb2301
to
4c50e24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's address nostr.ts first and then come back to this PR
// create the channel | ||
const ChannelCreation_event = await sign_event_v2(pri, { | ||
pubkey: pub, | ||
const ctx = InMemoryAccountContext.Generate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can a private key also implement the signer v2 interface? Just a quesiton for thoughts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have a use case because we rarely direclty use PrivateKey
const r = await fetch(`${relay.http_url}`, { | ||
method: "POST", | ||
body: JSON.stringify(add_member_event), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's define a function in nostr.ts
to do the same kind of work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do this when I code for the client tomorrow.
}); | ||
|
||
await t.step("stranger is not member", async () => { | ||
const res = await relay.is_space_member(InMemoryAccountContext.Generate().publicKey.hex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, it would be nice if we can have an automatic way to generating REST APIs based on public methods of the relay object so that we always have up to date APIs in both JavaScript and REST.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we don't need to generate it automatically, we can define the interface in nostr.ts and then implement it in the space and client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a better idea. For exampel,
type func_GetSpaceMembers = xxx
is a local function in relayed
and a network call in nostr.ts