@walletconnect/http-connection
Advanced tools
Comparing version 1.0.0-beta.97 to 1.0.0-beta.98
/// <reference types="node" /> | ||
import EventEmitter from "events"; | ||
interface IXHRPost { | ||
method: string; | ||
headers: { | ||
[key: string]: string; | ||
}; | ||
body: any; | ||
} | ||
declare class HTTPConnection extends EventEmitter { | ||
url: string; | ||
post: IXHRPost; | ||
constructor(url: string); | ||
@@ -14,0 +6,0 @@ formatError(payload: any, message: string, code?: number): { |
@@ -14,7 +14,2 @@ "use strict"; | ||
this.url = url; | ||
this.post = { | ||
body: null, | ||
headers: { "Content-Type": "application/json" }, | ||
method: "POST", | ||
}; | ||
} | ||
@@ -52,9 +47,4 @@ formatError(payload, message, code = -1) { | ||
}; | ||
try { | ||
this.post.body = JSON.stringify(payload); | ||
} | ||
catch (e) { | ||
return res(e); | ||
} | ||
xhr.open("POST", this.url, true); | ||
xhr.setRequestHeader("Content-Type", "application/json"); | ||
xhr.timeout = 60 * 1000; | ||
@@ -61,0 +51,0 @@ xhr.onerror = res; |
{ | ||
"name": "@walletconnect/http-connection", | ||
"version": "1.0.0-beta.97", | ||
"version": "1.0.0-beta.98", | ||
"description": "Http Connection for WalletConnect Providers", | ||
@@ -59,4 +59,4 @@ "scripts": { | ||
"dependencies": { | ||
"@walletconnect/types": "^1.0.0-beta.97", | ||
"@walletconnect/utils": "^1.0.0-beta.97", | ||
"@walletconnect/types": "^1.0.0-beta.98", | ||
"@walletconnect/utils": "^1.0.0-beta.98", | ||
"xhr2-cookies": "1.1.0" | ||
@@ -63,0 +63,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
288274
373