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

Add spec for web3inbox #365

Merged
merged 14 commits into from
Dec 21, 2022
Merged

Add spec for web3inbox #365

merged 14 commits into from
Dec 21, 2022

Conversation

devceline
Copy link
Contributor

@devceline devceline commented Dec 13, 2022

Changes

  • Add Web3Inbox SDK spec

Question: Since web3inbox encompasses 2 separate clients and does not do any separate relay communication, I've placed into a separate folder. Would appreciate recommendations/suggestions for folder naming.

@vercel
Copy link

vercel bot commented Dec 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
walletconnect-docs ✅ Ready (Inspect) Visit Preview Dec 15, 2022 at 1:03PM (UTC)

Co-authored-by: Ben Kremer <ben@walletconnect.com>

// rejects a chat invite by id
public abstract reject(params: {
inviteId: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
inviteId: string;
inviteId: number;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the chat specs: https://github.com/WalletConnect/walletconnect-docs/blob/main/docs/specs/clients/chat/client-api.md

// rejects a chat invite by id
  public abstract reject(params: {
    inviteId: string;
  }): Promise<void>;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just looked at the implementation, you're right it is a number we should reflect this in both specs

docs/specs/meta-clients/web3inbox/README.md Outdated Show resolved Hide resolved
public abstract observe("push_response", Observer<{id: number, response:{error?: Reason, subscription?: PushSubscription }>): () => void;
}

abstract class Web3InboxSDK {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we call it client like we always do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels off to call it a client since it technically doesn't handle any relay communication on its own

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no hight level API client does, they all use core

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it's not like push or chat, I really don't think we can compare web3inboxSDK to push and chat. cc @pedrouid

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah these SDKs are multiple clients so it wouldn't make sense to call it a client


```typescript

abstract class Web3InboxSDKChatFacade {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you call it Web3InboxSDKChatFacade, to me it looks exactly like ChatClient?
do we even need to spec it here? correct me if I am wrong but it looks like a duplicate to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has the same methods, but not the same event listeners and as of now there's no guarantee it'll always be 1:1 with the chat client, as it may have more functionality moving forward

Co-authored-by: Bartosz Rozwarski <bartus000@gmail.com>
@@ -0,0 +1,144 @@
# Web3Inbox SDK API

The Web3InboxSDK will encompass both [Push](../../clients/push/README.md) and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here again and in many other places you use future tense. Make present more sense?

// listens to external events.
public static abstract init(params?: {
relayUrl: string;
projectId: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chat and Push clients are dependent on CoreClient, which is responsible for handling networking. Is that the case here as well? If yes, we should inject CoreClient instead of projectId and relayUrl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W3I will manage push, chat and the core they'll depend on. In the mobile case, the clients will be handled completely externally outside w3i

@flypaper0
Copy link
Contributor

how web3inbox understand do it need to use proxy or chat client? Will be different urls?

@chadyj chadyj added the specs label Dec 21, 2022
@devceline devceline merged commit f123907 into main Dec 21, 2022
@chadyj chadyj deleted the web3inbox-spec branch June 29, 2023 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants