@walletconnect/relay-api
Advanced tools
Comparing version 1.0.8 to 1.0.9-canary.0
@@ -7,10 +7,10 @@ "use strict"; | ||
function parseSubscribeRequest(request) { | ||
if (!validators_1.isSubscribeMethod(request.method)) { | ||
if (!(0, validators_1.isSubscribeMethod)(request.method)) { | ||
throw new Error("JSON-RPC Request has invalid subscribe method"); | ||
} | ||
if (!validators_1.isSubscribeParams(request.params)) { | ||
if (!(0, validators_1.isSubscribeParams)(request.params)) { | ||
throw new Error("JSON-RPC Request has invalid subscribe params"); | ||
} | ||
const params = request.params; | ||
misc_1.assertType(params, "topic"); | ||
(0, misc_1.assertType)(params, "topic"); | ||
return params; | ||
@@ -20,12 +20,12 @@ } | ||
function parsePublishRequest(request) { | ||
if (!validators_1.isPublishMethod(request.method)) { | ||
if (!(0, validators_1.isPublishMethod)(request.method)) { | ||
throw new Error("JSON-RPC Request has invalid publish method"); | ||
} | ||
if (!validators_1.isPublishParams(request.params)) { | ||
if (!(0, validators_1.isPublishParams)(request.params)) { | ||
throw new Error("JSON-RPC Request has invalid publish params"); | ||
} | ||
const params = request.params; | ||
misc_1.assertType(params, "topic"); | ||
misc_1.assertType(params, "message"); | ||
misc_1.assertType(params, "ttl", "number"); | ||
(0, misc_1.assertType)(params, "topic"); | ||
(0, misc_1.assertType)(params, "message"); | ||
(0, misc_1.assertType)(params, "ttl", "number"); | ||
return params; | ||
@@ -35,10 +35,10 @@ } | ||
function parseUnsubscribeRequest(request) { | ||
if (!validators_1.isUnsubscribeMethod(request.method)) { | ||
if (!(0, validators_1.isUnsubscribeMethod)(request.method)) { | ||
throw new Error("JSON-RPC Request has invalid unsubscribe method"); | ||
} | ||
if (!validators_1.isUnsubscribeParams(request.params)) { | ||
if (!(0, validators_1.isUnsubscribeParams)(request.params)) { | ||
throw new Error("JSON-RPC Request has invalid unsubscribe params"); | ||
} | ||
const params = request.params; | ||
misc_1.assertType(params, "id"); | ||
(0, misc_1.assertType)(params, "id"); | ||
return params; | ||
@@ -48,11 +48,11 @@ } | ||
function parseSubscriptionRequest(request) { | ||
if (!validators_1.isSubscriptionMethod(request.method)) { | ||
if (!(0, validators_1.isSubscriptionMethod)(request.method)) { | ||
throw new Error("JSON-RPC Request has invalid subscription method"); | ||
} | ||
if (!validators_1.isSubscriptionParams(request.params)) { | ||
if (!(0, validators_1.isSubscriptionParams)(request.params)) { | ||
throw new Error("JSON-RPC Request has invalid subscription params"); | ||
} | ||
const params = request.params; | ||
misc_1.assertType(params, "id"); | ||
misc_1.assertType(params, "data"); | ||
(0, misc_1.assertType)(params, "id"); | ||
(0, misc_1.assertType)(params, "data"); | ||
return params; | ||
@@ -59,0 +59,0 @@ } |
@@ -33,2 +33,3 @@ export declare namespace RelayJsonRpc { | ||
message: string; | ||
publishedAt: number; | ||
} | ||
@@ -35,0 +36,0 @@ interface SubscriptionParams { |
@@ -10,3 +10,3 @@ "use strict"; | ||
function isSubscribeMethod(method) { | ||
return misc_1.methodEndsWith(method, "subscribe"); | ||
return (0, misc_1.methodEndsWith)(method, "subscribe"); | ||
} | ||
@@ -17,3 +17,3 @@ exports.isSubscribeMethod = isSubscribeMethod; | ||
const optional = []; | ||
return misc_1.checkParams(params, required, optional); | ||
return (0, misc_1.checkParams)(params, required, optional); | ||
} | ||
@@ -26,3 +26,3 @@ exports.isSubscribeParams = isSubscribeParams; | ||
function isPublishMethod(method) { | ||
return misc_1.methodEndsWith(method, "publish"); | ||
return (0, misc_1.methodEndsWith)(method, "publish"); | ||
} | ||
@@ -33,3 +33,3 @@ exports.isPublishMethod = isPublishMethod; | ||
const optional = ["prompt", "tag"]; | ||
return misc_1.checkParams(params, required, optional); | ||
return (0, misc_1.checkParams)(params, required, optional); | ||
} | ||
@@ -42,3 +42,3 @@ exports.isPublishParams = isPublishParams; | ||
function isUnsubscribeMethod(method) { | ||
return misc_1.methodEndsWith(method, "unsubscribe"); | ||
return (0, misc_1.methodEndsWith)(method, "unsubscribe"); | ||
} | ||
@@ -49,3 +49,3 @@ exports.isUnsubscribeMethod = isUnsubscribeMethod; | ||
const optional = []; | ||
return misc_1.checkParams(params, required, optional); | ||
return (0, misc_1.checkParams)(params, required, optional); | ||
} | ||
@@ -58,3 +58,3 @@ exports.isUnsubscribeParams = isUnsubscribeParams; | ||
function isSubscriptionMethod(method) { | ||
return misc_1.methodEndsWith(method, "subscription"); | ||
return (0, misc_1.methodEndsWith)(method, "subscription"); | ||
} | ||
@@ -65,5 +65,5 @@ exports.isSubscriptionMethod = isSubscriptionMethod; | ||
const optional = []; | ||
return misc_1.checkParams(params, required, optional); | ||
return (0, misc_1.checkParams)(params, required, optional); | ||
} | ||
exports.isSubscriptionParams = isSubscriptionParams; | ||
//# sourceMappingURL=validators.js.map |
@@ -33,2 +33,3 @@ export declare namespace RelayJsonRpc { | ||
message: string; | ||
publishedAt: number; | ||
} | ||
@@ -35,0 +36,0 @@ interface SubscriptionParams { |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=types.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("RelayAPI",[],t):"object"==typeof exports?exports.RelayAPI=t():e.RelayAPI=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){"use strict";function n(e,t){let r=!0;return t.forEach(t=>{t in e||(r=!1)}),r}function i(e,t){return Array.isArray(e)?e.length===t:Object.keys(e).length===t}function u(e,t){return Array.isArray(e)?e.length>=t:Object.keys(e).length>=t}Object.defineProperty(t,"__esModule",{value:!0}),t.methodEndsWith=t.checkParams=t.hasRequiredParamsLength=t.hasExactParamsLength=t.hasRequiredParams=t.assertType=void 0,t.assertType=function(e,t,r="string"){if(!e[t]||typeof e[t]!==r)throw new Error(`Missing or invalid "${t}" param`)},t.hasRequiredParams=n,t.hasExactParamsLength=i,t.hasRequiredParamsLength=u,t.checkParams=function(e,t,r){return!!(!r.length?i(e,t.length):u(e,t.length))&&n(e,t)},t.methodEndsWith=function(e,t,r="_"){const n=e.split(r);return n[n.length-1].trim().toLowerCase()===t.trim().toLowerCase()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSubscriptionParams=t.isSubscriptionMethod=t.isSubscriptionRequest=t.isUnsubscribeParams=t.isUnsubscribeMethod=t.isUnsubscribeRequest=t.isPublishParams=t.isPublishMethod=t.isPublishRequest=t.isSubscribeParams=t.isSubscribeMethod=t.isSubscribeRequest=void 0;const n=r(0);function i(e){return n.methodEndsWith(e,"subscribe")}function u(e){return n.checkParams(e,["topic"],[])}function o(e){return n.methodEndsWith(e,"publish")}function s(e){return n.checkParams(e,["message","topic","ttl"],["prompt","tag"])}function a(e){return n.methodEndsWith(e,"unsubscribe")}function c(e){return n.checkParams(e,["id","topic"],[])}function f(e){return n.methodEndsWith(e,"subscription")}function b(e){return n.checkParams(e,["id","data"],[])}t.isSubscribeRequest=function(e){return i(e.method)&&u(e.params)},t.isSubscribeMethod=i,t.isSubscribeParams=u,t.isPublishRequest=function(e){return o(e.method)&&s(e.params)},t.isPublishMethod=o,t.isPublishParams=s,t.isUnsubscribeRequest=function(e){return a(e.method)&&c(e.params)},t.isUnsubscribeMethod=a,t.isUnsubscribeParams=c,t.isSubscriptionRequest=function(e){return f(e.method)&&b(e.params)},t.isSubscriptionMethod=f,t.isSubscriptionParams=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3);n.__exportStar(r(4),t),n.__exportStar(r(5),t),n.__exportStar(r(6),t),n.__exportStar(r(1),t)},function(e,t,r){"use strict";r.r(t),r.d(t,"__extends",(function(){return i})),r.d(t,"__assign",(function(){return u})),r.d(t,"__rest",(function(){return o})),r.d(t,"__decorate",(function(){return s})),r.d(t,"__param",(function(){return a})),r.d(t,"__metadata",(function(){return c})),r.d(t,"__awaiter",(function(){return f})),r.d(t,"__generator",(function(){return b})),r.d(t,"__createBinding",(function(){return l})),r.d(t,"__exportStar",(function(){return h})),r.d(t,"__values",(function(){return p})),r.d(t,"__read",(function(){return d})),r.d(t,"__spread",(function(){return y})),r.d(t,"__spreadArrays",(function(){return m})),r.d(t,"__await",(function(){return _})),r.d(t,"__asyncGenerator",(function(){return P})),r.d(t,"__asyncDelegator",(function(){return v})),r.d(t,"__asyncValues",(function(){return w})),r.d(t,"__makeTemplateObject",(function(){return S})),r.d(t,"__importStar",(function(){return O})),r.d(t,"__importDefault",(function(){return R})),r.d(t,"__classPrivateFieldGet",(function(){return g})),r.d(t,"__classPrivateFieldSet",(function(){return j})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("RelayAPI",[],t):"object"==typeof exports?exports.RelayAPI=t():e.RelayAPI=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){"use strict";function n(e,t){let r=!0;return t.forEach(t=>{t in e||(r=!1)}),r}function i(e,t){return Array.isArray(e)?e.length===t:Object.keys(e).length===t}function u(e,t){return Array.isArray(e)?e.length>=t:Object.keys(e).length>=t}Object.defineProperty(t,"__esModule",{value:!0}),t.methodEndsWith=t.checkParams=t.hasRequiredParamsLength=t.hasExactParamsLength=t.hasRequiredParams=t.assertType=void 0,t.assertType=function(e,t,r="string"){if(!e[t]||typeof e[t]!==r)throw new Error(`Missing or invalid "${t}" param`)},t.hasRequiredParams=n,t.hasExactParamsLength=i,t.hasRequiredParamsLength=u,t.checkParams=function(e,t,r){return!!(!r.length?i(e,t.length):u(e,t.length))&&n(e,t)},t.methodEndsWith=function(e,t,r="_"){const n=e.split(r);return n[n.length-1].trim().toLowerCase()===t.trim().toLowerCase()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSubscriptionParams=t.isSubscriptionMethod=t.isSubscriptionRequest=t.isUnsubscribeParams=t.isUnsubscribeMethod=t.isUnsubscribeRequest=t.isPublishParams=t.isPublishMethod=t.isPublishRequest=t.isSubscribeParams=t.isSubscribeMethod=t.isSubscribeRequest=void 0;const n=r(0);function i(e){return(0,n.methodEndsWith)(e,"subscribe")}function u(e){return(0,n.checkParams)(e,["topic"],[])}function o(e){return(0,n.methodEndsWith)(e,"publish")}function s(e){return(0,n.checkParams)(e,["message","topic","ttl"],["prompt","tag"])}function a(e){return(0,n.methodEndsWith)(e,"unsubscribe")}function c(e){return(0,n.checkParams)(e,["id","topic"],[])}function f(e){return(0,n.methodEndsWith)(e,"subscription")}function b(e){return(0,n.checkParams)(e,["id","data"],[])}t.isSubscribeRequest=function(e){return i(e.method)&&u(e.params)},t.isSubscribeMethod=i,t.isSubscribeParams=u,t.isPublishRequest=function(e){return o(e.method)&&s(e.params)},t.isPublishMethod=o,t.isPublishParams=s,t.isUnsubscribeRequest=function(e){return a(e.method)&&c(e.params)},t.isUnsubscribeMethod=a,t.isUnsubscribeParams=c,t.isSubscriptionRequest=function(e){return f(e.method)&&b(e.params)},t.isSubscriptionMethod=f,t.isSubscriptionParams=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3);n.__exportStar(r(4),t),n.__exportStar(r(5),t),n.__exportStar(r(6),t),n.__exportStar(r(1),t)},function(e,t,r){"use strict";r.r(t),r.d(t,"__extends",(function(){return i})),r.d(t,"__assign",(function(){return u})),r.d(t,"__rest",(function(){return o})),r.d(t,"__decorate",(function(){return s})),r.d(t,"__param",(function(){return a})),r.d(t,"__metadata",(function(){return c})),r.d(t,"__awaiter",(function(){return f})),r.d(t,"__generator",(function(){return b})),r.d(t,"__createBinding",(function(){return l})),r.d(t,"__exportStar",(function(){return h})),r.d(t,"__values",(function(){return p})),r.d(t,"__read",(function(){return d})),r.d(t,"__spread",(function(){return y})),r.d(t,"__spreadArrays",(function(){return m})),r.d(t,"__await",(function(){return _})),r.d(t,"__asyncGenerator",(function(){return P})),r.d(t,"__asyncDelegator",(function(){return v})),r.d(t,"__asyncValues",(function(){return w})),r.d(t,"__makeTemplateObject",(function(){return S})),r.d(t,"__importStar",(function(){return O})),r.d(t,"__importDefault",(function(){return R})),r.d(t,"__classPrivateFieldGet",(function(){return g})),r.d(t,"__classPrivateFieldSet",(function(){return j})); | ||
/*! ***************************************************************************** | ||
@@ -16,2 +16,2 @@ Copyright (c) Microsoft Corporation. | ||
***************************************************************************** */ | ||
var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var u=function(){return(u=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function s(e,t,r,n){var i,u=arguments.length,o=u<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(u<3?i(o):u>3?i(t,r,o):i(t,r))||o);return u>3&&o&&Object.defineProperty(t,r,o),o}function a(e,t){return function(r,n){t(r,n,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,r,n){return new(r||(r=Promise))((function(i,u){function o(e){try{a(n.next(e))}catch(e){u(e)}}function s(e){try{a(n.throw(e))}catch(e){u(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}a((n=n.apply(e,t||[])).next())}))}function b(e,t){var r,n,i,u,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return u={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function s(u){return function(s){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}}function l(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function h(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,u=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=u.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}return o}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(d(arguments[t]));return e}function m(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var u=arguments[t],o=0,s=u.length;o<s;o++,i++)n[i]=u[o];return n}function _(e){return this instanceof _?(this.v=e,this):new _(e)}function P(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),u=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(e){i[e]&&(n[e]=function(t){return new Promise((function(r,n){u.push([e,t,r,n])>1||s(e,t)}))})}function s(e,t){try{(r=i[e](t)).value instanceof _?Promise.resolve(r.value.v).then(a,c):f(u[0][2],r)}catch(e){f(u[0][3],e)}var r}function a(e){s("next",e)}function c(e){s("throw",e)}function f(e,t){e(t),u.shift(),u.length&&s(u[0][0],u[0][1])}}function v(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:_(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function w(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function O(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function R(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function j(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSubscriptionRequest=t.parseUnsubscribeRequest=t.parsePublishRequest=t.parseSubscribeRequest=void 0;const n=r(0),i=r(1);t.parseSubscribeRequest=function(e){if(!i.isSubscribeMethod(e.method))throw new Error("JSON-RPC Request has invalid subscribe method");if(!i.isSubscribeParams(e.params))throw new Error("JSON-RPC Request has invalid subscribe params");const t=e.params;return n.assertType(t,"topic"),t},t.parsePublishRequest=function(e){if(!i.isPublishMethod(e.method))throw new Error("JSON-RPC Request has invalid publish method");if(!i.isPublishParams(e.params))throw new Error("JSON-RPC Request has invalid publish params");const t=e.params;return n.assertType(t,"topic"),n.assertType(t,"message"),n.assertType(t,"ttl","number"),t},t.parseUnsubscribeRequest=function(e){if(!i.isUnsubscribeMethod(e.method))throw new Error("JSON-RPC Request has invalid unsubscribe method");if(!i.isUnsubscribeParams(e.params))throw new Error("JSON-RPC Request has invalid unsubscribe params");const t=e.params;return n.assertType(t,"id"),t},t.parseSubscriptionRequest=function(e){if(!i.isSubscriptionMethod(e.method))throw new Error("JSON-RPC Request has invalid subscription method");if(!i.isSubscriptionParams(e.params))throw new Error("JSON-RPC Request has invalid subscription params");const t=e.params;return n.assertType(t,"id"),n.assertType(t,"data"),t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RELAY_JSONRPC=void 0,t.RELAY_JSONRPC={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}}}])})); | ||
var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var u=function(){return(u=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function s(e,t,r,n){var i,u=arguments.length,o=u<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(u<3?i(o):u>3?i(t,r,o):i(t,r))||o);return u>3&&o&&Object.defineProperty(t,r,o),o}function a(e,t){return function(r,n){t(r,n,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,r,n){return new(r||(r=Promise))((function(i,u){function o(e){try{a(n.next(e))}catch(e){u(e)}}function s(e){try{a(n.throw(e))}catch(e){u(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}a((n=n.apply(e,t||[])).next())}))}function b(e,t){var r,n,i,u,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return u={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function s(u){return function(s){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}}function l(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function h(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,u=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=u.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}return o}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(d(arguments[t]));return e}function m(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var u=arguments[t],o=0,s=u.length;o<s;o++,i++)n[i]=u[o];return n}function _(e){return this instanceof _?(this.v=e,this):new _(e)}function P(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),u=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(e){i[e]&&(n[e]=function(t){return new Promise((function(r,n){u.push([e,t,r,n])>1||s(e,t)}))})}function s(e,t){try{(r=i[e](t)).value instanceof _?Promise.resolve(r.value.v).then(a,c):f(u[0][2],r)}catch(e){f(u[0][3],e)}var r}function a(e){s("next",e)}function c(e){s("throw",e)}function f(e,t){e(t),u.shift(),u.length&&s(u[0][0],u[0][1])}}function v(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:_(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function w(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function O(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function R(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function j(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSubscriptionRequest=t.parseUnsubscribeRequest=t.parsePublishRequest=t.parseSubscribeRequest=void 0;const n=r(0),i=r(1);t.parseSubscribeRequest=function(e){if(!(0,i.isSubscribeMethod)(e.method))throw new Error("JSON-RPC Request has invalid subscribe method");if(!(0,i.isSubscribeParams)(e.params))throw new Error("JSON-RPC Request has invalid subscribe params");const t=e.params;return(0,n.assertType)(t,"topic"),t},t.parsePublishRequest=function(e){if(!(0,i.isPublishMethod)(e.method))throw new Error("JSON-RPC Request has invalid publish method");if(!(0,i.isPublishParams)(e.params))throw new Error("JSON-RPC Request has invalid publish params");const t=e.params;return(0,n.assertType)(t,"topic"),(0,n.assertType)(t,"message"),(0,n.assertType)(t,"ttl","number"),t},t.parseUnsubscribeRequest=function(e){if(!(0,i.isUnsubscribeMethod)(e.method))throw new Error("JSON-RPC Request has invalid unsubscribe method");if(!(0,i.isUnsubscribeParams)(e.params))throw new Error("JSON-RPC Request has invalid unsubscribe params");const t=e.params;return(0,n.assertType)(t,"id"),t},t.parseSubscriptionRequest=function(e){if(!(0,i.isSubscriptionMethod)(e.method))throw new Error("JSON-RPC Request has invalid subscription method");if(!(0,i.isSubscriptionParams)(e.params))throw new Error("JSON-RPC Request has invalid subscription params");const t=e.params;return(0,n.assertType)(t,"id"),(0,n.assertType)(t,"data"),t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RELAY_JSONRPC=void 0,t.RELAY_JSONRPC={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}}}])})); |
{ | ||
"name": "@walletconnect/relay-api", | ||
"description": "Relay JSON-RPC API", | ||
"version": "1.0.8", | ||
"version": "1.0.9-canary.0", | ||
"author": "WalletConnect, Inc. <walletconnect.com>", | ||
@@ -37,3 +37,6 @@ "license": "MIT", | ||
"test": "env TS_NODE_PROJECT=\"tsconfig.cjs.json\" mocha --timeout 5000 --exit -r ts-node/register ./test/**/*.test.ts", | ||
"lint": "eslint -c '../../.eslintrc' --fix './src/**/*.ts'" | ||
"lint": "eslint -c '../../.eslintrc' --fix './src/**/*.ts'", | ||
"npm-publish:latest": "npm publish --access public --tag latest", | ||
"npm-publish:canary": "npm publish --access public --tag canary", | ||
"prepublishOnly": "npm run test && npm run build" | ||
}, | ||
@@ -44,3 +47,3 @@ "devDependencies": { | ||
"husky": "^4.3.0", | ||
"typescript": "^3.7.5", | ||
"typescript": "^4.9.5", | ||
"webpack": "^4.41.6", | ||
@@ -61,5 +64,5 @@ "webpack-cli": "^3.3.11" | ||
"dependencies": { | ||
"@walletconnect/jsonrpc-types": "^1.0.2", | ||
"@walletconnect/jsonrpc-types": "1.0.3-rc.0", | ||
"tslib": "1.14.1" | ||
} | ||
} |
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 not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
557
102758
1
+ Added@walletconnect/jsonrpc-types@1.0.3-rc.0(transitive)
- Removed@walletconnect/jsonrpc-types@1.0.4(transitive)
- Removedevents@3.3.0(transitive)