-
Notifications
You must be signed in to change notification settings - Fork 357
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Co-authored-by: Ben Kremer <ben@walletconnect.com>
|
||
// rejects a chat invite by id | ||
public abstract reject(params: { | ||
inviteId: string; |
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.
inviteId: string; | |
inviteId: number; |
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.
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>;
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.
Just looked at the implementation, you're right it is a number we should reflect this in both specs
public abstract observe("push_response", Observer<{id: number, response:{error?: Reason, subscription?: PushSubscription }>): () => void; | ||
} | ||
|
||
abstract class Web3InboxSDK { |
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 we call it client like we always do?
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.
Feels off to call it a client since it technically doesn't handle any relay communication on its own
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.
no hight level API client does, they all use core
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.
But it's not like push
or chat
, I really don't think we can compare web3inboxSDK
to push
and chat
. cc @pedrouid
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.
Yeah these SDKs are multiple clients so it wouldn't make sense to call it a client
|
||
```typescript | ||
|
||
abstract class Web3InboxSDKChatFacade { |
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 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.
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.
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 |
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.
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; |
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.
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
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.
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
how web3inbox understand do it need to use proxy or chat client? Will be different urls? |
Changes
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.