Skip to content
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

Merged
merged 15 commits into from
Jun 17, 2024
Merged

features around space members #19

merged 15 commits into from
Jun 17, 2024

Conversation

bob2402
Copy link
Collaborator

@bob2402 bob2402 commented Jun 12, 2024

  • Revise Member Type

@bob2402 bob2402 mentioned this pull request Jun 12, 2024
@bob2402 bob2402 force-pushed the invite-pubkey branch 2 times, most recently from 1fb2301 to 4c50e24 Compare June 12, 2024 14:21
@bob2402 bob2402 changed the title invite a pubkey add member Jun 12, 2024
@bob2402 bob2402 requested a review from BlowaterNostr June 13, 2024 15:02
Copy link
Owner

@BlowaterNostr BlowaterNostr left a 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

graphql-schema.ts Outdated Show resolved Hide resolved
main.ts Outdated Show resolved Hide resolved
main.ts Outdated Show resolved Hide resolved
resolvers/policy.ts Outdated Show resolved Hide resolved
resolvers/policy.ts Outdated Show resolved Hide resolved
resolvers/policy.ts Outdated Show resolved Hide resolved
main.ts Outdated Show resolved Hide resolved
main.ts Outdated Show resolved Hide resolved
main.ts Show resolved Hide resolved
// create the channel
const ChannelCreation_event = await sign_event_v2(pri, {
pubkey: pub,
const ctx = InMemoryAccountContext.Generate();
Copy link
Owner

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

Copy link
Collaborator Author

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?

Copy link
Owner

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),
});
Copy link
Owner

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.

Copy link
Collaborator Author

@bob2402 bob2402 Jun 17, 2024

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);
Copy link
Owner

@BlowaterNostr BlowaterNostr Jun 17, 2024

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.

Copy link
Collaborator Author

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

Copy link
Owner

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

@bob2402 bob2402 requested a review from BlowaterNostr June 17, 2024 14:47
@BlowaterNostr BlowaterNostr changed the title add member features around space members Jun 17, 2024
@BlowaterNostr BlowaterNostr merged commit dbcbe77 into main Jun 17, 2024
1 check passed
@BlowaterNostr BlowaterNostr deleted the invite-pubkey branch June 17, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants