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

Refactor RPC and rewrite aepp-rpc to TypeScript #1542

Merged
merged 11 commits into from
May 30, 2022
Merged

Conversation

davidyuk
Copy link
Member

No description provided.

BREAKING CHANGE: AeppRpc doesn't accept `connection` anymore
Use `connectToWallet` method instead.
BREAKING CHANGE: `handlers` parameter is removed in RpcClient
Provide a `methods` parameter instead of `handlers[0]`.
Provide an `onDisconnect` parameter instead of `handlers[1]`.
BREAKING CHANGE: `sendMessage` of RpcClient is a private method
Use `request` or `notify` instead.

BREAKING CHANGE: `shareWalletInfo` of WalletRpc accepts rpcClientId instead of callback
For example, rewrite
```
const connection = new BrowserRuntimeConnection({ port })
aeSdk.addRpcClient(connection)
aeSdk.shareWalletInfo(port.postMessage.bind(port))
```
to
```
const connection = new BrowserRuntimeConnection({ port })
const rpcClientId = aeSdk.addRpcClient(connection)
aeSdk.shareWalletInfo(rpcClientId)
```
BREAKING CHANGE: `connectToWallet` accepts wallet connection as the first argument
See connect-aepp-to-wallet.md for details.

BREAKING CHANGE: `disconnectWallet` runs in sync and `sendDisconnect` arg removed
So, aepp would always send `closeConnection` notification.

BREAKING CHANGE: `sendConnectRequest` removed
Use `connectToWallet` instead.
Message counted is maintained locally, so this shouldn't be a case
@lgtm-com
Copy link

lgtm-com bot commented May 29, 2022

This pull request introduces 1 alert and fixes 1 when merging 1a8e830 into a169e5e - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

fixed alerts:

  • 1 for Superfluous trailing arguments

@davidyuk davidyuk requested a review from subhod-i May 29, 2022 11:26
@davidyuk davidyuk merged commit 791eb9a into develop May 30, 2022
@davidyuk davidyuk deleted the feature/refactor-rpc branch May 30, 2022 13:45
@davidyuk davidyuk mentioned this pull request Jun 14, 2022
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.

1 participant