How to use the @walletconnect/utils.uuid function in @walletconnect/utils

To help you get started, we’ve selected a few @walletconnect/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WalletConnect / walletconnect-monorepo / packages / eth-provider / src / http.ts View on Github external
constructor (url: string) {
    super()
    this.closed = false
    this.connected = false
    this.subscriptions = false
    this.status = 'loading'
    this.url = url
    this.pollId = uuid()
    this.post = {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: null
    }
    setTimeout(() => this.create(), 0)
  }
  public create (): void {
github WalletConnect / walletconnect-monorepo / packages / core / src / index.ts View on Github external
this._key = await this._generateKey()

    const request: IJsonRpcRequest = this._formatRequest({
      method: 'wc_sessionRequest',
      params: [
        {
          peerId: this.clientId,
          peerMeta: this.clientMeta,
          chainId: opts && opts.chainId ? opts.chainId : null
        }
      ]
    })

    this.handshakeId = request.id
    this.handshakeTopic = uuid()

    this._sendSessionRequest(
      request,
      'Session update rejected',
      this.handshakeTopic
    )

    this._eventManager.trigger({
      event: 'display_uri',
      params: [this.uri]
    })
  }
github WalletConnect / walletconnect-monorepo / packages / core / src / index.ts View on Github external
get clientId () {
    let clientId: string | null = this._clientId
    if (!clientId) {
      clientId = this._clientId = uuid()
    }

    return this._clientId
  }