Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
llbartekll committed Jan 21, 2022
1 parent 05b25b2 commit d484172
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,30 @@ Sessions are always proposed by the `Proposer` client so `Responder` client need
```Swift
class ClientDelegate: WalletConnectClientDelegate {
...
func didReceive(sessionProposal: SessionProposal) {
client.approve(proposal: proposal, accounts: [String]) { result in ... }
func didReceive(sessionProposal: Session.Proposal) {
client.approve(proposal: proposal, accounts: [String])
}
...
```
or
```Swift
func didReceive(sessionProposal: SessionProposal) {
func didReceive(sessionProposal: Session.Proposal) {
client.reject(proposal: proposal, reason: Reason)
}
```
NOTE: addresses provided in `accounts` array should follow [CAPI10](https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md) semantics.
#### Handle Delegate methods
```Swift
func didReceive(sessionProposal: SessionProposal) {
func didReceive(sessionProposal: Session.Proposal) {
// handle session proposal
}
func didReceive(sessionRequest: SessionRequest) {
func didReceive(sessionRequest: Request) {
// handle session request
}
```
#### JSON-RPC Payloads
#### Receive
You can parse JSON-RPC Requests received from "Requester" in `didReceive(sessionRequest: SessionRequest)` delegate function.
You can parse JSON-RPC Requests received from "Requester" in `didReceive(sessionRequest: Request)` delegate function.

Request parameters can be type casted based on request method as below:
```Swift
Expand Down

0 comments on commit d484172

Please sign in to comment.