@walletconnect/relay-api
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -6,5 +6,2 @@ "use strict"; | ||
waku: { | ||
info: "waku_info", | ||
connect: "waku_connect", | ||
disconnect: "waku_disconnect", | ||
publish: "waku_publish", | ||
@@ -16,5 +13,2 @@ subscribe: "waku_subscribe", | ||
iridium: { | ||
info: "iridium_info", | ||
connect: "iridium_connect", | ||
disconnect: "iridium_disconnect", | ||
publish: "iridium_publish", | ||
@@ -21,0 +15,0 @@ subscribe: "iridium_subscribe", |
export declare namespace RelayJsonRpc { | ||
interface Methods { | ||
info: string; | ||
connect: string; | ||
disconnect: string; | ||
publish: string; | ||
@@ -19,2 +16,3 @@ subscribe: string; | ||
prompt?: boolean; | ||
tag?: number; | ||
} | ||
@@ -21,0 +19,0 @@ interface SubscriptionData { |
@@ -29,3 +29,3 @@ "use strict"; | ||
const required = ["message", "topic", "ttl"]; | ||
const optional = ["prompt"]; | ||
const optional = ["prompt", "tag"]; | ||
return misc_1.checkParams(params, required, optional); | ||
@@ -32,0 +32,0 @@ } |
export const RELAY_JSONRPC = { | ||
waku: { | ||
info: "waku_info", | ||
connect: "waku_connect", | ||
disconnect: "waku_disconnect", | ||
publish: "waku_publish", | ||
@@ -12,5 +9,2 @@ subscribe: "waku_subscribe", | ||
iridium: { | ||
info: "iridium_info", | ||
connect: "iridium_connect", | ||
disconnect: "iridium_disconnect", | ||
publish: "iridium_publish", | ||
@@ -17,0 +11,0 @@ subscribe: "iridium_subscribe", |
export declare namespace RelayJsonRpc { | ||
interface Methods { | ||
info: string; | ||
connect: string; | ||
disconnect: string; | ||
publish: string; | ||
@@ -19,2 +16,3 @@ subscribe: string; | ||
prompt?: boolean; | ||
tag?: number; | ||
} | ||
@@ -21,0 +19,0 @@ interface SubscriptionData { |
@@ -21,3 +21,3 @@ import { checkParams, methodEndsWith } from "./misc"; | ||
const required = ["message", "topic", "ttl"]; | ||
const optional = ["prompt"]; | ||
const optional = ["prompt", "tag"]; | ||
return checkParams(params, required, optional); | ||
@@ -24,0 +24,0 @@ } |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("RelayProvider",[],t):"object"==typeof exports?exports.RelayProvider=t():e.RelayProvider=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 o(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=o,t.checkParams=function(e,t,r){return!!(!r.length?i(e,t.length):o(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 o(e){return n.checkParams(e,["topic"],[])}function u(e){return n.methodEndsWith(e,"publish")}function s(e){return n.checkParams(e,["message","topic","ttl"],["prompt"])}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 l(e){return n.checkParams(e,["id","data"],[])}t.isSubscribeRequest=function(e){return i(e.method)&&o(e.params)},t.isSubscribeMethod=i,t.isSubscribeParams=o,t.isPublishRequest=function(e){return u(e.method)&&s(e.params)},t.isPublishMethod=u,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)&&l(e.params)},t.isSubscriptionMethod=f,t.isSubscriptionParams=l},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 o})),r.d(t,"__rest",(function(){return u})),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 l})),r.d(t,"__createBinding",(function(){return d})),r.d(t,"__exportStar",(function(){return p})),r.d(t,"__values",(function(){return b})),r.d(t,"__read",(function(){return h})),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 v})),r.d(t,"__asyncDelegator",(function(){return P})),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 o(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=o,t.checkParams=function(e,t,r){return!!(!r.length?i(e,t.length):o(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 o(e){return n.checkParams(e,["topic"],[])}function u(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 l(e){return n.checkParams(e,["id","data"],[])}t.isSubscribeRequest=function(e){return i(e.method)&&o(e.params)},t.isSubscribeMethod=i,t.isSubscribeParams=o,t.isPublishRequest=function(e){return u(e.method)&&s(e.params)},t.isPublishMethod=u,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)&&l(e.params)},t.isSubscriptionMethod=f,t.isSubscriptionParams=l},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 o})),r.d(t,"__rest",(function(){return u})),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 l})),r.d(t,"__createBinding",(function(){return p})),r.d(t,"__exportStar",(function(){return b})),r.d(t,"__values",(function(){return d})),r.d(t,"__read",(function(){return h})),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 v})),r.d(t,"__asyncDelegator",(function(){return P})),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 o=function(){return(o=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 u(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,o=arguments.length,u=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(u=(o<3?i(u):o>3?i(t,r,u):i(t,r))||u);return o>3&&u&&Object.defineProperty(t,r,u),u}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,o){function u(e){try{a(n.next(e))}catch(e){o(e)}}function s(e){try{a(n.throw(e))}catch(e){o(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(u,s)}a((n=n.apply(e,t||[])).next())}))}function l(e,t){var r,n,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,n=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function d(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function p(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function b(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 h(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(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 o=arguments[t],u=0,s=o.length;u<s;u++,i++)n[i]=o[u];return n}function _(e){return this instanceof _?(this.v=e,this):new _(e)}function v(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n={},u("next"),u("throw"),u("return"),n[Symbol.asyncIterator]=function(){return this},n;function u(e){i[e]&&(n[e]=function(t){return new Promise((function(r,n){o.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(o[0][2],r)}catch(e){f(o[0][3],e)}var r}function a(e){s("next",e)}function c(e){s("throw",e)}function f(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function P(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=b(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:{info:"waku_info",connect:"waku_connect",disconnect:"waku_disconnect",publish:"waku_publish",subscribe:"waku_subscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe"},iridium:{info:"iridium_info",connect:"iridium_connect",disconnect:"iridium_disconnect",publish:"iridium_publish",subscribe:"iridium_subscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe"}}}])})); | ||
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 o=function(){return(o=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 u(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,o=arguments.length,u=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(u=(o<3?i(u):o>3?i(t,r,u):i(t,r))||u);return o>3&&u&&Object.defineProperty(t,r,u),u}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,o){function u(e){try{a(n.next(e))}catch(e){o(e)}}function s(e){try{a(n.throw(e))}catch(e){o(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(u,s)}a((n=n.apply(e,t||[])).next())}))}function l(e,t){var r,n,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,n=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function p(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function b(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function d(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 h(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(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 o=arguments[t],u=0,s=o.length;u<s;u++,i++)n[i]=o[u];return n}function _(e){return this instanceof _?(this.v=e,this):new _(e)}function v(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n={},u("next"),u("throw"),u("return"),n[Symbol.asyncIterator]=function(){return this},n;function u(e){i[e]&&(n[e]=function(t){return new Promise((function(r,n){o.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(o[0][2],r)}catch(e){f(o[0][3],e)}var r}function a(e){s("next",e)}function c(e){s("throw",e)}function f(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function P(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=d(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",subscribe:"waku_subscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe"},iridium:{publish:"iridium_publish",subscribe:"iridium_subscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe"}}}])})); |
{ | ||
"name": "@walletconnect/relay-api", | ||
"description": "PubSub Relay JSON-RPC Provider", | ||
"version": "1.0.4", | ||
"description": "Relay JSON-RPC API", | ||
"version": "1.0.5", | ||
"author": "WalletConnect, Inc. <walletconnect.com>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -1,3 +0,3 @@ | ||
# relay-provider [![npm version](https://badge.fury.io/js/relay-provider.svg)](https://badge.fury.io/js/relay-provider) | ||
# relay-api [![npm version](https://badge.fury.io/js/relay-api.svg)](https://badge.fury.io/js/relay-api) | ||
PubSub Relay JSON-RPC Provider | ||
Relay JSON-RPC API |
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
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
261300
0
500