Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
137 lines (108 sloc) 2.34 KB

Bridge API Reference

For Dapps

Create a new Session

  POST https://bridge.walletconnect.org/session/new

  Response:
  Status: 200
  Content-Type: application/json; charset=utf-8
  Body:
  {
    "sessionId": <someSessionId>
  }

Get Session details (short-polling)

  GET https://bridge.walletconnect.org/session/<sessionId>

  Response (when details exist):
  Status: 200
  Content-Type: application/json; charset=utf-8
  Body:
  {
    "encryptionPayload": <encryptedSessionPayload>
  }

  Response (when details do not yet exist):
  Status: 204

Create new Call Request

  POST https://bridge.walletconnect.org/session/<sessionId>/call/new
  Content-Type: application/json
  Body:
  {
    "encryptionPayload": <encryptedCallRequestPayload>,
    "dappName": <ExampleDappName>
  }

  Response:
  Status: 200
  Content-Type: application/json; charset=utf-8
  Body:
  {
      "callId": <callId>
  }

Get Call status (short-polling)

  GET https://bridge.walletconnect.org/call-status/<callId>

  Response (when status does exist):
  Status: 200
  Content-Type: application/json; charset=utf-8
  {
    "encryptionPayload": <encryptedCallStatus>
  }

  Response (when status does not yet exist):
  Status: 204

For Wallets

Update Session details

  PUT https://bridge.walletconnect.org/session/<sessionId>
  Content-Type: application/json
  Body:
  {
    "encryptionPayload":<someEncryptedSessionPayload>,
    "push": {
      "type": <pushType>,
      "token": <pushToken>,
      "webhook": <pushWebhook>
    }
  }

  Response:
  Status: 200

Get Call Request details

  GET https://bridge.walletconnect.org/session/<sessionId>/call/<callId>

  Response:
  Status: 200
  Content-Type: application/json; charset=utf-8
  Body:
  {
    "encryptionPayload": <encryptedCallRequest>
  }

Get All Call Requests available

  GET https://bridge.walletconnect.org/session/<sessionId>/calls

  Response:
  Status: 200
  Content-Type: application/json; charset=utf-8
  Body:
  {
    <callId>: {
      "encryptionPayload": <encryptedCallRequest>
    },
    ...
  }

Add Call Status

  POST https://bridge.walletconnect.org/call-status/<callId>/new
  Content-Type: application/json
  Body:
  {
    "encryptionPayload": <encryptedCallStatus>
  }

  Response:
  Status: 200