@metamask/interactive-ui-example-snap 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Changelog
2
+
2
3
  All notable changes to this project will be documented in this file.
3
4
 
4
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
@@ -6,32 +7,62 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
7
 
7
8
  ## [Unreleased]
8
9
 
10
+ ## [2.3.0]
11
+
12
+ ### Added
13
+
14
+ - Add example for `Selector` component ([#2724](https://github.com/MetaMask/snaps/pull/2724))
15
+
16
+ ### Fixed
17
+
18
+ - Fix wrong address being shown on transaction insights ([#2733](https://github.com/MetaMask/snaps/pull/2733))
19
+
20
+ ## [2.2.1]
21
+
22
+ ### Fixed
23
+
24
+ - Bump MetaMask dependencies
25
+
9
26
  ## [2.2.0]
27
+
10
28
  ### Added
11
- - Add `RadioButton` to interactive UI example ([#2592](https://github.com/MetaMask/snaps-skunkworks.git/pull/2592))
29
+
30
+ - Add `RadioGroup` to interactive UI example ([#2592](https://github.com/MetaMask/snaps/pull/2592))
12
31
 
13
32
  ## [2.1.0]
33
+
14
34
  ### Added
35
+
15
36
  - Add `Checkbox` to interactive UI example ([#2515](https://github.com/MetaMask/snaps/pull/2515))
16
37
 
17
38
  ## [2.0.0]
39
+
18
40
  ### Changed
41
+
19
42
  - **BREAKING:** Revamp interactive UI example using JSX ([#2427](https://github.com/MetaMask/snaps/pull/2427))
20
43
  - The `getState` RPC method was removed as part of this refactor.
21
44
 
22
45
  ## [1.0.2]
46
+
23
47
  ### Fixed
48
+
24
49
  - Fix a crash when submitting an empty string ([#2333](https://github.com/MetaMask/snaps/pull/2333))
25
50
 
26
51
  ## [1.0.1]
52
+
27
53
  ### Changed
54
+
28
55
  - Use error wrappers ([#2178](https://github.com/MetaMask/snaps/pull/2178))
29
56
 
30
57
  ## [1.0.0]
58
+
31
59
  ### Added
60
+
32
61
  - Add interactive UI example Snap ([#2171](https://github.com/MetaMask/snaps/pull/2171))
33
62
 
34
- [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/interactive-ui-example-snap@2.2.0...HEAD
63
+ [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/interactive-ui-example-snap@2.3.0...HEAD
64
+ [2.3.0]: https://github.com/MetaMask/snaps/compare/@metamask/interactive-ui-example-snap@2.2.1...@metamask/interactive-ui-example-snap@2.3.0
65
+ [2.2.1]: https://github.com/MetaMask/snaps/compare/@metamask/interactive-ui-example-snap@2.2.0...@metamask/interactive-ui-example-snap@2.2.1
35
66
  [2.2.0]: https://github.com/MetaMask/snaps/compare/@metamask/interactive-ui-example-snap@2.1.0...@metamask/interactive-ui-example-snap@2.2.0
36
67
  [2.1.0]: https://github.com/MetaMask/snaps/compare/@metamask/interactive-ui-example-snap@2.0.0...@metamask/interactive-ui-example-snap@2.1.0
37
68
  [2.0.0]: https://github.com/MetaMask/snaps/compare/@metamask/interactive-ui-example-snap@1.0.2...@metamask/interactive-ui-example-snap@2.0.0
package/dist/bundle.js CHANGED
@@ -1 +1 @@
1
- (()=>{var e={12:e=>{e.exports=o,o.default=o,o.stable=d,o.stableStringify=d;var t="[...]",n="[Circular]",r=[],a=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function o(e,t,n,o){var s;void 0===o&&(o=i()),c(e,"",0,[],void 0,0,o);try{s=0===a.length?JSON.stringify(e,t,n):JSON.stringify(e,p(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function s(e,t,n,i){var o=Object.getOwnPropertyDescriptor(i,n);void 0!==o.get?o.configurable?(Object.defineProperty(i,n,{value:e}),r.push([i,n,t,o])):a.push([t,n,e]):(i[n]=e,r.push([i,n,t]))}function c(e,r,a,i,o,u,d){var l;if(u+=1,"object"==typeof e&&null!==e){for(l=0;l<i.length;l++)if(i[l]===e)return void s(n,e,r,o);if(void 0!==d.depthLimit&&u>d.depthLimit)return void s(t,e,r,o);if(void 0!==d.edgesLimit&&a+1>d.edgesLimit)return void s(t,e,r,o);if(i.push(e),Array.isArray(e))for(l=0;l<e.length;l++)c(e[l],l,l,i,e,u,d);else{var p=Object.keys(e);for(l=0;l<p.length;l++){var f=p[l];c(e[f],f,l,i,e,u,d)}}i.pop()}}function u(e,t){return e<t?-1:e>t?1:0}function d(e,t,n,o){void 0===o&&(o=i());var s,c=l(e,"",0,[],void 0,0,o)||e;try{s=0===a.length?JSON.stringify(c,t,n):JSON.stringify(c,p(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function l(e,a,i,o,c,d,p){var f;if(d+=1,"object"==typeof e&&null!==e){for(f=0;f<o.length;f++)if(o[f]===e)return void s(n,e,a,c);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==p.depthLimit&&d>p.depthLimit)return void s(t,e,a,c);if(void 0!==p.edgesLimit&&i+1>p.edgesLimit)return void s(t,e,a,c);if(o.push(e),Array.isArray(e))for(f=0;f<e.length;f++)l(e[f],f,f,o,e,d,p);else{var m={},h=Object.keys(e).sort(u);for(f=0;f<h.length;f++){var v=h[f];l(e[v],v,f,o,e,d,p),m[v]=e[v]}if(void 0===c)return m;r.push([c,a,e]),c[a]=m}o.pop()}}function p(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(a.length>0)for(var r=0;r<a.length;r++){var i=a[r];if(i[1]===t&&i[0]===n){n=i[2],a.splice(r,1);break}}return e.call(this,t,n)}}}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";function e(e,t,n){if("string"==typeof e)throw new Error(`An HTML element ("${String(e)}") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`);if(!e)throw new Error("A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.");return e({...t,key:n})}function t(t,n,r){return e(t,n,r)}function a(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)}n.r(r),n.d(r,{onHomePage:()=>Lr,onRpcRequest:()=>Dr,onTransaction:()=>Gr,onUserInput:()=>Wr});const i=(e,t)=>Object.hasOwnProperty.call(e,t);var o;!function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(o=o||(o={}));function s(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}class c extends TypeError{constructor(e,t){let n;const{message:r,explanation:a,...i}=e,{path:o}=e,s=0===o.length?r:`At path: ${o.join(".")} -- ${r}`;super(a??s),null!=a&&(this.cause=s),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...t()])}}function u(e){return"object"==typeof e&&null!==e}function d(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function l(e,t,n,r){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:a,branch:i}=t,{type:o}=n,{refinement:s,message:c=`Expected a value of type \`${o}\`${s?` with refinement \`${s}\``:""}, but received: \`${d(r)}\``}=e;return{value:r,type:o,refinement:s,key:a[a.length-1],path:a,branch:i,...e,message:c}}function*p(e,t,n,r){(function(e){return u(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const a of e){const e=l(a,t,n,r);e&&(yield e)}}function*f(e,t,n={}){const{path:r=[],branch:a=[e],coerce:i=!1,mask:o=!1}=n,s={path:r,branch:a};if(i&&(e=t.coercer(e,s),o&&"type"!==t.type&&u(t.schema)&&u(e)&&!Array.isArray(e)))for(const n in e)void 0===t.schema[n]&&delete e[n];let c="valid";for(const r of t.validator(e,s))r.explanation=n.message,c="not_valid",yield[r,void 0];for(let[d,l,p]of t.entries(e,s)){const t=f(l,p,{path:void 0===d?r:[...r,d],branch:void 0===d?a:[...a,l],coerce:i,mask:o,message:n.message});for(const n of t)n[0]?(c=null===n[0].refinement||void 0===n[0].refinement?"not_valid":"not_refined",yield[n[0],void 0]):i&&(l=n[1],void 0===d?e=l:e instanceof Map?e.set(d,l):e instanceof Set?e.add(l):u(e)&&(void 0!==l||d in e)&&(e[d]=l))}if("not_valid"!==c)for(const r of t.refiner(e,s))r.explanation=n.message,c="not_refined",yield[r,void 0];"valid"===c&&(yield[void 0,e])}class m{constructor(e){const{type:t,schema:n,validator:r,refiner:a,coercer:i=(e=>e),entries:o=function*(){}}=e;this.type=t,this.schema=n,this.entries=o,this.coercer=i,this.validator=r?(e,t)=>p(r(e,t),t,this,e):()=>[],this.refiner=a?(e,t)=>p(a(e,t),t,this,e):()=>[]}assert(e,t){return h(e,this,t)}create(e,t){return v(e,this,t)}is(e){return y(e,this)}mask(e,t){return function(e,t,n){const r=g(e,t,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}(e,this,t)}validate(e,t={}){return g(e,this,t)}}function h(e,t,n){const r=g(e,t,{message:n});if(r[0])throw r[0]}function v(e,t,n){const r=g(e,t,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function y(e,t){return!g(e,t)[0]}function g(e,t,n={}){const r=f(e,t,n),a=function(e){const{done:t,value:n}=e.next();return t?void 0:n}(r);if(a[0]){return[new c(a[0],(function*(){for(const e of r)e[0]&&(yield e[0])})),void 0]}return[void 0,a[1]]}function b(...e){const t="type"===e[0]?.type,n=e.map((({schema:e})=>e)),r=Object.assign({},...n);return t?function(e){const t=Object.keys(e);return new m({type:"type",schema:e,*entries(n){if(u(n))for(const r of t)yield[r,n[r],e[r]]},validator:e=>u(e)||`Expected an object, but received: ${d(e)}`,coercer:e=>u(e)?{...e}:e})}(r):N(r)}function w(e,t){return new m({type:e,schema:null,validator:t})}function x(e){let t;return new m({type:"lazy",schema:null,*entries(n,r){t??(t=e()),yield*t.entries(n,r)},validator:(n,r)=>(t??(t=e()),t.validator(n,r)),coercer:(n,r)=>(t??(t=e()),t.coercer(n,r)),refiner:(n,r)=>(t??(t=e()),t.refiner(n,r))})}function E(e){return new m({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${d(e)}`})}function S(){return w("boolean",(e=>"boolean"==typeof e))}function O(e){const t=d(e),n=typeof e;return new m({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?e:null,validator:n=>n===e||`Expected the literal \`${t}\`, but received: ${d(n)}`})}function k(){return w("never",(()=>!1))}function I(e){return new m({...e,validator:(t,n)=>null===t||e.validator(t,n),refiner:(t,n)=>null===t||e.refiner(t,n)})}function j(){return w("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${d(e)}`))}function N(e){const t=e?Object.keys(e):[],n=k();return new m({type:"object",schema:e??null,*entries(r){if(e&&u(r)){const a=new Set(Object.keys(r));for(const n of t)a.delete(n),yield[n,r[n],e[n]];for(const e of a)yield[e,r[e],n]}},validator:e=>u(e)||`Expected an object, but received: ${d(e)}`,coercer:e=>u(e)?{...e}:e})}function C(e){return new m({...e,validator:(t,n)=>void 0===t||e.validator(t,n),refiner:(t,n)=>void 0===t||e.refiner(t,n)})}function A(e,t){return new m({type:"record",schema:null,*entries(n){if(u(n))for(const r in n){const a=n[r];yield[r,r,e],yield[r,a,t]}},validator:e=>u(e)||`Expected an object, but received: ${d(e)}`})}function P(){return w("string",(e=>"string"==typeof e||`Expected a string, but received: ${d(e)}`))}function R(e){const t=k();return new m({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(e.length,n.length);for(let a=0;a<r;a++)yield[a,n[a],e[a]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${d(e)}`})}function $(e){const t=e.map((e=>e.type)).join(" | ");return new m({type:"union",schema:null,coercer(t){for(const n of e){const[e,r]=n.validate(t,{coerce:!0});if(!e)return r}return t},validator(n,r){const a=[];for(const t of e){const[...e]=f(n,t,r),[i]=e;if(!i?.[0])return[];for(const[t]of e)t&&a.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${d(n)}`,...a]}})}function T(){return w("unknown",(()=>!0))}function F(e,t,n){return new m({...e,coercer:(r,a)=>y(r,t)?e.coercer(n(r,a),a):e.coercer(r,a)})}function _(e){return function(e){return function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)&&"string"==typeof e.message?e.message:null==e?"":String(e)}(e).replace(/\.$/u,"")}function J(e,t){return n=e,Boolean("string"==typeof n?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var n}class B extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}function q(e,t,n="Assertion failed",r=B){try{h(e,t)}catch(e){throw J(r,`${n}: ${_(e)}.`)}}const M=e=>N(e);function U({path:e,branch:t}){const n=e[e.length-1];return i(t[t.length-2],n)}function z(e){return new m({...e,type:`optional ${e.type}`,validator:(t,n)=>!U(n)||e.validator(t,n),refiner:(t,n)=>!U(n)||e.refiner(t,n)})}const D=$([O(null),S(),w("finite number",(e=>y(e,j())&&Number.isFinite(e))),P(),E(x((()=>D))),A(P(),x((()=>D)))]),L=F(D,w("any",(()=>!0)),(e=>(q(e,D),JSON.parse(JSON.stringify(e,((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t}))))));function G(e){try{return function(e){v(e,L)}(e),!0}catch{return!1}}const W=O("2.0"),V=I($([j(),P()])),H=M({code:w("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${d(e)}`)),message:P(),data:z(L),stack:z(P())}),X=$([A(P(),L),E(L)]);M({id:V,jsonrpc:W,method:P(),params:z(X)}),M({jsonrpc:W,method:P(),params:z(X)});N({id:V,jsonrpc:W,result:C(T()),error:C(H)});const Q=M({id:V,jsonrpc:W,result:L}),Y=M({id:V,jsonrpc:W,error:H});$([Q,Y]);function K(e,t){return Z(e,"pattern",(n=>t.test(n)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${n}"`))}function Z(e,t,n){return new m({...e,*refiner(r,a){yield*e.refiner(r,a);const i=p(n(r,a),a,e,r);for(const e of i)yield{...e,refinement:t}}})}var ee={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},te={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901},ne={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},re=ee.internal,ae="Unspecified error message. This is a bug, please report it.",ie=(oe(re),"Unspecified server error.");function oe(e,t=ae){if(function(e){return Number.isInteger(e)}(e)){const t=e.toString();if(i(ne,t))return ne[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return ie}return t}function se(e){return Array.isArray(e)?e.map((e=>G(e)?e:a(e)?ce(e):null)):a(e)?ce(e):G(e)?e:null}function ce(e){return Object.getOwnPropertyNames(e).reduce(((t,n)=>{const r=e[n];return G(r)&&(t[n]=r),t}),{})}var ue=n(12),de=class extends Error{constructor(e,t,n){var r=(...e)=>{super(...e)};if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a non-empty string.');!function(e){return a(e)&&i(e,"cause")&&a(e.cause)}(n)?r(t):(r(t,{cause:n.cause}),i(this,"cause")||Object.assign(this,{cause:n.cause})),void 0!==n&&(this.data=n),this.code=e}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,s(this.data)&&(e.data.cause=se(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return ue(this.serialize(),pe,2)}},le=class extends de{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}};function pe(e,t){if("[Circular]"!==t)return t}var fe=e=>Ce(ee.parse,e),me=e=>Ce(ee.invalidRequest,e),he=e=>Ce(ee.invalidParams,e),ve=e=>Ce(ee.methodNotFound,e),ye=e=>Ce(ee.internal,e),ge=e=>Ce(ee.invalidInput,e),be=e=>Ce(ee.resourceNotFound,e),we=e=>Ce(ee.resourceUnavailable,e),xe=e=>Ce(ee.transactionRejected,e),Ee=e=>Ce(ee.methodNotSupported,e),Se=e=>Ce(ee.limitExceeded,e),Oe=e=>Ae(te.userRejectedRequest,e),ke=e=>Ae(te.unauthorized,e),Ie=e=>Ae(te.unsupportedMethod,e),je=e=>Ae(te.disconnected,e),Ne=e=>Ae(te.chainDisconnected,e);function Ce(e,t){const[n,r]=Pe(t);return new de(e,n??oe(e),r)}function Ae(e,t){const[n,r]=Pe(t);return new le(e,n??oe(e),r)}function Pe(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t??void 0,n]}}return[]}K(P(),/^(?:0x)?[0-9a-f]+$/iu),K(P(),/^0x[0-9a-f]+$/iu),K(P(),/^0x[0-9a-f]{40}$/u);const Re=K(P(),/^0x[0-9a-fA-F]{40}$/u);function $e(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}var Te,Fe,_e,Je,Be=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},qe=(e,t,n)=>(Be(e,t,"read from private field"),n?n.call(e):t.get(e)),Me=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ue=(e,t,n,r)=>(Be(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ze=class extends Error{constructor(e,t={}){const n=function(e){if(a(e)&&i(e,"message")&&"string"==typeof e.message)return e.message;return String(e)}(e);super(n),Me(this,Te,void 0),Me(this,Fe,void 0),Me(this,_e,void 0),Me(this,Je,void 0),Ue(this,Fe,n),Ue(this,Te,function(e){if(a(e)&&i(e,"code")&&"number"==typeof e.code&&Number.isInteger(e.code))return e.code;return-32603}(e));const r={...We(e),...t};Object.keys(r).length>0&&Ue(this,_e,r),Ue(this,Je,super.stack)}get name(){return"SnapError"}get code(){return qe(this,Te)}get message(){return qe(this,Fe)}get data(){return qe(this,_e)}get stack(){return qe(this,Je)}toJSON(){return{code:Le,message:Ge,data:{cause:{code:this.code,message:this.message,stack:this.stack,...this.data?{data:this.data}:{}}}}}serialize(){return this.toJSON()}};function De(e){return class extends ze{constructor(t,n){if("object"==typeof t){const n=e();return void super({code:n.code,message:n.message,data:t})}const r=e(t);super({code:r.code,message:r.message,data:n})}}}Te=new WeakMap,Fe=new WeakMap,_e=new WeakMap,Je=new WeakMap;var Le=-31002,Ge="Snap Error";function We(e){return a(e)&&i(e,"data")&&"object"==typeof e.data&&null!==e.data&&G(e.data)&&!Array.isArray(e.data)?e.data:{}}function Ve(e){return w(JSON.stringify(e),O(e).validator)}function He(e){return Ve(e)}function Xe(e){return new m({type:"union",schema:null,*entries(t,n){if(!s(t)||!i(t,"type"))return;const{type:r}=t,a=e.find((({schema:e})=>y(r,e.type)));if(a)for(const e of a.entries(t,n))yield e},validator(t,n){const r=e.map((({schema:e})=>e.type.type));if(!s(t)||!i(t,"type")||"string"!=typeof t.type)return`Expected type to be one of: ${r.join(", ")}, but received: undefined`;const{type:a}=t,o=e.find((({schema:e})=>y(a,e.type)));return o?o.validator(t,n):`Expected type to be one of: ${r.join(", ")}, but received: "${a}"`}})}function Qe(e){return function([e,...t]){const n=$([e,...t]);return new m({...n,schema:[e,...t]})}(e)}function Ye(){return Z(P(),"SVG",(e=>!!e.includes("<svg")||"Value is not a valid SVG."))}De(ye),De(ge),De(he),De(me),De(Se);var Ke=De(ve);De(Ee),De(fe),De(be),De(we),De(xe),De(Ne),De(je),De(ke),De(Ie),De(Oe);function Ze(e,t,n=[]){return(...r)=>{if(1===r.length&&s(r[0])){const n={...r[0],type:e};return q(n,t,`Invalid ${e} component`),n}const a=n.reduce(((e,t,n)=>void 0!==r[n]?{...e,[t]:r[n]}:e),{type:e});return q(a,t,`Invalid ${e} component`),a}}var et,tt,nt,rt,at,it=((et=it||{}).Copyable="copyable",et.Divider="divider",et.Heading="heading",et.Panel="panel",et.Spinner="spinner",et.Text="text",et.Image="image",et.Row="row",et.Address="address",et.Button="button",et.Input="input",et.Form="form",et),ot=N({type:P()}),st=b(ot,N({value:T()})),ct=b(st,N({type:O("address"),value:Re})),ut=(Ze("address",ct,["value"]),b(st,N({type:O("copyable"),value:P(),sensitive:C(S())}))),dt=(Ze("copyable",ut,["value","sensitive"]),b(ot,N({type:O("divider")}))),lt=(Ze("divider",dt),b(st,N({type:O("heading"),value:P()}))),pt=(Ze("heading",lt,["value"]),b(ot,N({type:O("image"),value:Ye()}))),ft=(Ze("image",pt,["value"]),(tt=ft||{}).Primary="primary",tt.Secondary="secondary",tt),mt=((nt=mt||{}).Button="button",nt.Submit="submit",nt),ht=b(st,N({type:O("button"),value:P(),variant:C($([He("primary"),He("secondary")])),buttonType:C($([He("button"),He("submit")])),name:C(P())})),vt=(Ze("button",ht,["value","buttonType","name","variant"]),(rt=vt||{}).Text="text",rt.Number="number",rt.Password="password",rt),yt=b(st,N({type:O("input"),value:C(P()),name:P(),inputType:C($([He("text"),He("password"),He("number")])),placeholder:C(P()),label:C(P()),error:C(P())})),gt=(Ze("input",yt,["name","inputType","placeholder","value","label"]),$([yt,ht])),bt=b(ot,N({type:O("form"),children:E(gt),name:P()})),wt=(Ze("form",bt,["name","children"]),b(st,N({type:O("text"),value:P(),markdown:C(S())}))),xt=(Ze("text",wt,["value","markdown"]),(at=xt||{}).Default="default",at.Critical="critical",at.Warning="warning",at),Et=$([pt,wt,ct]),St=b(st,N({type:O("row"),variant:C($([He("default"),He("critical"),He("warning")])),label:P(),value:Et})),Ot=(Ze("row",St,["label","value","variant"]),b(ot,N({type:O("spinner")}))),kt=(Ze("spinner",Ot),b(ot,N({children:E(x((()=>jt)))}))),It=b(kt,N({type:O("panel")})),jt=(Ze("panel",It,["children"]),Xe([ut,dt,lt,pt,It,Ot,wt,St,ct,yt,bt,ht]));var Nt,Ct,At,Pt,Rt,$t,Tt=((Nt=Tt||{}).Critical="critical",Nt),Ft=((Ct=Ft||{}).ButtonClickEvent="ButtonClickEvent",Ct.FormSubmitEvent="FormSubmitEvent",Ct.InputChangeEvent="InputChangeEvent",Ct.FileUploadEvent="FileUploadEvent",Ct),_t=N({type:P(),name:C(P())}),Jt=b(_t,N({type:O("ButtonClickEvent"),name:C(P())})),Bt=N({name:P(),size:j(),contentType:P(),contents:P()}),qt=b(_t,N({type:O("FormSubmitEvent"),value:A(P(),I($([P(),Bt,S()]))),name:P()})),Mt=b(_t,N({type:O("InputChangeEvent"),name:P(),value:$([P(),S()])})),Ut=($([Jt,qt,Mt,b(_t,N({type:O("FileUploadEvent"),name:P(),file:I(Bt)}))]),(At=Ut||{}).Alert="alert",At.Confirmation="confirmation",At.Prompt="prompt",At),zt=((Pt=zt||{}).Base64="base64",Pt.Hex="hex",Pt.Utf8="utf8",Pt),Dt=((Rt=Dt||{}).ClearState="clear",Rt.GetState="get",Rt.UpdateState="update",Rt),Lt=(($t=Lt||{}).InApp="inApp",$t.Native="native",$t),Gt=Qe([P(),j()]),Wt=Vt([P()]);N({type:P(),props:A(P(),L),key:I(Gt)});function Vt(e){return function(e){const t=Qe([e,E(x((()=>t)))]);return t}(I(Qe([...e,S()])))}function Ht(e,t={}){return N({type:Ve(e),props:N(t),key:I(Gt)})}var Xt=Ht("Button",{children:Wt,name:C(P()),type:C(Qe([Ve("button"),Ve("submit")])),variant:C(Qe([Ve("primary"),Ve("destructive")])),disabled:C(S())}),Qt=Ht("Checkbox",{name:P(),checked:C(S()),label:C(P()),variant:C(Qe([Ve("default"),Ve("toggle")]))}),Yt=Ht("Input",{name:P(),type:C(Qe([Ve("text"),Ve("password"),Ve("number")])),value:C(P()),placeholder:C(P())}),Kt=Ht("Option",{value:P(),children:P()}),Zt=Ht("Dropdown",{name:P(),value:C(P()),children:Vt([Kt])}),en=Ht("Radio",{value:P(),children:P()}),tn=Ht("RadioGroup",{name:P(),value:C(P()),children:Vt([en])}),nn=Ht("FileInput",{name:P(),accept:Qe([C(E(P()))]),compact:C(S())}),rn=[Yt,Xt],an=[Yt,Zt,tn,nn,Qt],on=(Qe([...an,...rn]),Qe([R(rn),...an])),sn=Ht("Field",{label:C(P()),error:C(P()),children:on}),cn=Ht("Form",{children:Vt([sn,x((()=>Cn))]),name:P()}),un=Ht("Bold",{children:Vt([P(),x((()=>dn))])}),dn=Ht("Italic",{children:Vt([P(),x((()=>un))])}),ln=Qe([un,dn]),pn=Ht("Address",{address:Re}),fn=Ht("Box",{children:Vt([x((()=>Cn))]),direction:C(Qe([Ve("horizontal"),Ve("vertical")])),alignment:C(Qe([Ve("start"),Ve("center"),Ve("end"),Ve("space-between"),Ve("space-around")]))}),mn=Ht("Footer",{children:Qe([R([Xt,Xt]),Xt])}),hn=Ht("Container",{children:Qe([R([fn,mn]),fn])}),vn=Ht("Copyable",{value:P(),sensitive:C(S())}),yn=Ht("Divider"),gn=Ht("Value",{value:P(),extra:P()}),bn=Ht("Card",{image:C(P()),title:P(),description:C(P()),value:P(),extra:C(P())}),wn=Ht("Heading",{children:Wt}),xn=Ht("Image",{src:Ye(),alt:C(P())}),En=Ht("Link",{href:P(),children:Vt([ln,P()])}),Sn=Ht("Text",{children:Vt([P(),un,dn,En]),alignment:C(Qe([Ve("start"),Ve("center"),Ve("end")]))}),On=Qe([Sn,un,dn,En,xn,S()]),kn=Qe([Sn,un,dn,En,P()]),In=Ht("Tooltip",{children:I(On),content:kn}),jn=Ht("Row",{label:P(),children:Qe([pn,xn,Sn,gn]),variant:C(Qe([Ve("default"),Ve("warning"),Ve("critical")])),tooltip:C(P())}),Nn=Ht("Spinner"),Cn=Xe([pn,un,fn,Xt,vn,yn,Zt,tn,nn,cn,wn,Yt,xn,dn,En,jn,Nn,Sn,In,Qt,bn]),An=Qe([Cn,hn]),Pn=(Xe([Xt,Yt,nn,sn,cn,un,dn,pn,fn,vn,yn,wn,xn,En,jn,Nn,Sn,Zt,Kt,tn,en,gn,In,Qt,mn,hn,bn]),$([Bt,P(),S()])),Rn=A(P(),I(Pn));A(P(),$([Rn,I(Pn)])),$([jt,An]),A(P(),L);function $n(e){return Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e)))}function Tn(e){return t=>{const{key:n=null,...r}=t;return{type:e,props:$n(r),key:n}}}var Fn=Tn("Button"),_n=Tn("Checkbox"),Jn=Tn("Dropdown"),Bn=Tn("Option"),qn=Tn("Radio"),Mn=Tn("RadioGroup"),Un=Tn("Field"),zn=(Tn("FileInput"),Tn("Form")),Dn=Tn("Input"),Ln=Tn("Bold"),Gn=(Tn("Italic"),Tn("Address")),Wn=Tn("Box"),Vn=(Tn("Card"),Tn("Copyable")),Hn=(Tn("Divider"),Tn("Value"),Tn("Heading")),Xn=(Tn("Image"),Tn("Link"),Tn("Row")),Qn=(Tn("Spinner"),Tn("Text"));Tn("Tooltip"),Tn("Footer"),Tn("Container");function Yn(e){return w(JSON.stringify(e),O(e).validator)}function Kn(e){return new m({type:"union",schema:null,*entries(t,n){if(!s(t)||!i(t,"type"))return;const{type:r}=t,a=e.find((({schema:e})=>y(r,e.type)));if(a)for(const e of a.entries(t,n))yield e},validator(t,n){const r=e.map((({schema:e})=>e.type.type));if(!s(t)||!i(t,"type")||"string"!=typeof t.type)return`Expected type to be one of: ${r.join(", ")}, but received: undefined`;const{type:a}=t,o=e.find((({schema:e})=>y(a,e.type)));return o?o.validator(t,n):`Expected type to be one of: ${r.join(", ")}, but received: "${a}"`}})}function Zn(e){return function([e,...t]){const n=$([e,...t]);return new m({...n,schema:[e,...t]})}(e)}var er=Zn([P(),j()]),tr=nr([P()]);N({type:P(),props:A(P(),L),key:I(er)});function nr(e){return function(e){const t=Zn([e,E(x((()=>t)))]);return t}(I(Zn([...e,S()])))}function rr(e,t={}){return N({type:Yn(e),props:N(t),key:I(er)})}var ar=rr("Button",{children:tr,name:C(P()),type:C(Zn([Yn("button"),Yn("submit")])),variant:C(Zn([Yn("primary"),Yn("destructive")])),disabled:C(S())}),ir=rr("Checkbox",{name:P(),checked:C(S()),label:C(P()),variant:C(Zn([Yn("default"),Yn("toggle")]))}),or=rr("Input",{name:P(),type:C(Zn([Yn("text"),Yn("password"),Yn("number")])),value:C(P()),placeholder:C(P())}),sr=rr("Option",{value:P(),children:P()}),cr=rr("Dropdown",{name:P(),value:C(P()),children:nr([sr])}),ur=rr("Radio",{value:P(),children:P()}),dr=rr("RadioGroup",{name:P(),value:C(P()),children:nr([ur])}),lr=rr("FileInput",{name:P(),accept:Zn([C(E(P()))]),compact:C(S())}),pr=[or,ar],fr=[or,cr,dr,lr,ir],mr=(Zn([...fr,...pr]),Zn([R(pr),...fr])),hr=rr("Field",{label:C(P()),error:C(P()),children:mr}),vr=rr("Form",{children:nr([hr,x((()=>Jr))]),name:P()}),yr=rr("Bold",{children:nr([P(),x((()=>gr))])}),gr=rr("Italic",{children:nr([P(),x((()=>yr))])}),br=Zn([yr,gr]),wr=rr("Address",{address:Re}),xr=rr("Box",{children:nr([x((()=>Jr))]),direction:C(Zn([Yn("horizontal"),Yn("vertical")])),alignment:C(Zn([Yn("start"),Yn("center"),Yn("end"),Yn("space-between"),Yn("space-around")]))}),Er=rr("Footer",{children:Zn([R([ar,ar]),ar])}),Sr=rr("Container",{children:Zn([R([xr,Er]),xr])}),Or=rr("Copyable",{value:P(),sensitive:C(S())}),kr=rr("Divider"),Ir=rr("Value",{value:P(),extra:P()}),jr=rr("Card",{image:C(P()),title:P(),description:C(P()),value:P(),extra:C(P())}),Nr=rr("Heading",{children:tr}),Cr=rr("Image",{src:Z(P(),"SVG",(e=>!!e.includes("<svg")||"Value is not a valid SVG.")),alt:C(P())}),Ar=rr("Link",{href:P(),children:nr([br,P()])}),Pr=rr("Text",{children:nr([P(),yr,gr,Ar]),alignment:C(Zn([Yn("start"),Yn("center"),Yn("end")]))}),Rr=Zn([Pr,yr,gr,Ar,Cr,S()]),$r=Zn([Pr,yr,gr,Ar,P()]),Tr=rr("Tooltip",{children:I(Rr),content:$r}),Fr=rr("Row",{label:P(),children:Zn([wr,Cr,Pr,Ir]),variant:C(Zn([Yn("default"),Yn("warning"),Yn("critical")])),tooltip:C(P())}),_r=rr("Spinner"),Jr=Kn([wr,yr,xr,ar,Or,kr,cr,dr,lr,vr,Nr,or,Cr,gr,Ar,Fr,_r,Pr,Tr,ir,jr]);Zn([Jr,Sr]),Kn([ar,or,lr,hr,vr,yr,gr,wr,xr,Or,kr,Nr,Cr,Ar,Fr,_r,Pr,cr,sr,dr,ur,Ir,Tr,ir,Er,Sr,jr]);const Br=()=>t(Wn,{children:[e(Hn,{children:"Interactive UI Example Snap"}),t(zn,{name:"example-form",children:[e(Un,{label:"Example Input",children:e(Dn,{name:"example-input",placeholder:"Enter something..."})}),e(Un,{label:"Example Dropdown",children:t(Jn,{name:"example-dropdown",children:[e(Bn,{value:"option1",children:"Option 1"}),e(Bn,{value:"option2",children:"Option 2"}),e(Bn,{value:"option3",children:"Option 3"})]})}),e(Un,{label:"Example RadioGroup",children:t(Mn,{name:"example-radiogroup",children:[e(qn,{value:"option1",children:"Option 1"}),e(qn,{value:"option2",children:"Option 2"}),e(qn,{value:"option3",children:"Option 3"})]})}),e(Un,{label:"Example Checkbox",children:e(_n,{name:"example-checkbox",label:"Checkbox"})}),e(Fn,{type:"submit",name:"submit",children:"Submit"})]})]}),qr=({from:n,to:r})=>t(Wn,{children:[e(Xn,{label:"From",children:e(Gn,{address:n})}),e(Xn,{label:"To",children:r?e(Gn,{address:n}):e(Qn,{children:"None"})}),e(Fn,{name:"transaction-type",children:"See transaction type"})]}),Mr=({type:n})=>t(Wn,{children:[e(Xn,{label:"Transaction Type",children:e(Qn,{children:e(Ln,{children:n})})}),e(Fn,{name:"go-back",children:"Back"})]}),Ur=({values:n})=>t(Wn,{children:[e(Hn,{children:"Interactive UI Example Snap"}),e(Qn,{children:"You submitted the following values:"}),e(Wn,{children:Object.values(n).map((t=>{var n;return e(Vn,{value:(null===(n=t)||void 0===n?void 0:n.toString())??""})}))}),e(Fn,{name:"back",children:"Back"})]}),zr=[{name:"ERC-20",signature:"a9059cbb"},{name:"ERC-721",signature:"23b872dd"},{name:"ERC-1155",signature:"f242432a"}];const Dr=async({request:t})=>{if("dialog"===t.method)return await snap.request({method:"snap_dialog",params:{type:"confirmation",content:e(Br,{})}});throw new Ke({method:t.method})},Lr=async()=>({content:e(Br,{})}),Gr=async({transaction:t})=>{const{from:n,to:r}=t;return{id:await snap.request({method:"snap_createInterface",params:{ui:e(qr,{from:n,to:r}),context:{transaction:t}}})}},Wr=async({id:t,event:n,context:r})=>{if(n.type===Ft.ButtonClickEvent)switch(n.name){case"transaction-type":{var a;const n=function(e){if(e&&"string"==typeof e){var t;const n=$e(e).slice(0,8);return(null===(t=zr.find((e=>e.signature===n)))||void 0===t?void 0:t.name)??"Unknown"}return"Unknown"}((null===(a=r)||void 0===a?void 0:a.transaction).data);await snap.request({method:"snap_updateInterface",params:{id:t,ui:e(Mr,{type:n})}});break}case"go-back":{var i;const n=null===(i=r)||void 0===i?void 0:i.transaction;await snap.request({method:"snap_updateInterface",params:{id:t,ui:e(qr,{from:n.from,to:n.to})}});break}case"back":await snap.request({method:"snap_updateInterface",params:{id:t,ui:e(Br,{})}})}if(n.type===Ft.FormSubmitEvent&&"example-form"===n.name){const r=n.value;await snap.request({method:"snap_updateInterface",params:{id:t,ui:e(Ur,{values:r})}})}}})();var a=exports;for(var i in r)a[i]=r[i];r.__esModule&&Object.defineProperty(a,"__esModule",{value:!0})})();
1
+ (()=>{var e={12:e=>{e.exports=a,a.default=a,a.stable=d,a.stableStringify=d;var t="[...]",n="[Circular]",r=[],o=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(e,t,n,a){var s;void 0===a&&(a=i()),c(e,"",0,[],void 0,0,a);try{s=0===o.length?JSON.stringify(e,t,n):JSON.stringify(e,p(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function s(e,t,n,i){var a=Object.getOwnPropertyDescriptor(i,n);void 0!==a.get?a.configurable?(Object.defineProperty(i,n,{value:e}),r.push([i,n,t,a])):o.push([t,n,e]):(i[n]=e,r.push([i,n,t]))}function c(e,r,o,i,a,u,d){var l;if(u+=1,"object"==typeof e&&null!==e){for(l=0;l<i.length;l++)if(i[l]===e)return void s(n,e,r,a);if(void 0!==d.depthLimit&&u>d.depthLimit)return void s(t,e,r,a);if(void 0!==d.edgesLimit&&o+1>d.edgesLimit)return void s(t,e,r,a);if(i.push(e),Array.isArray(e))for(l=0;l<e.length;l++)c(e[l],l,l,i,e,u,d);else{var p=Object.keys(e);for(l=0;l<p.length;l++){var f=p[l];c(e[f],f,l,i,e,u,d)}}i.pop()}}function u(e,t){return e<t?-1:e>t?1:0}function d(e,t,n,a){void 0===a&&(a=i());var s,c=l(e,"",0,[],void 0,0,a)||e;try{s=0===o.length?JSON.stringify(c,t,n):JSON.stringify(c,p(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function l(e,o,i,a,c,d,p){var f;if(d+=1,"object"==typeof e&&null!==e){for(f=0;f<a.length;f++)if(a[f]===e)return void s(n,e,o,c);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==p.depthLimit&&d>p.depthLimit)return void s(t,e,o,c);if(void 0!==p.edgesLimit&&i+1>p.edgesLimit)return void s(t,e,o,c);if(a.push(e),Array.isArray(e))for(f=0;f<e.length;f++)l(e[f],f,f,a,e,d,p);else{var h={},m=Object.keys(e).sort(u);for(f=0;f<m.length;f++){var v=m[f];l(e[v],v,f,a,e,d,p),h[v]=e[v]}if(void 0===c)return h;r.push([c,o,e]),c[o]=h}a.pop()}}function p(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(o.length>0)for(var r=0;r<o.length;r++){var i=o[r];if(i[1]===t&&i[0]===n){n=i[2],o.splice(r,1);break}}return e.call(this,t,n)}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";function e(e,t,n){if("string"==typeof e)throw new Error(`An HTML element ("${String(e)}") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`);if(!e)throw new Error("A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.");return e({...t,key:n})}function t(t,n,r){return e(t,n,r)}n.r(r),n.d(r,{onHomePage:()=>pt,onRpcRequest:()=>lt,onTransaction:()=>ft,onUserInput:()=>ht});var o={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},i={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901},a={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};function s(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)}const c=(e,t)=>Object.hasOwnProperty.call(e,t);var u;!function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(u=u||(u={}));class d extends TypeError{constructor(e,t){let n;const{message:r,explanation:o,...i}=e,{path:a}=e,s=0===a.length?r:`At path: ${a.join(".")} -- ${r}`;super(o??s),null!=o&&(this.cause=s),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...t()])}}function l(e){return"object"==typeof e&&null!==e}function p(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function f(e,t,n,r){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:o,branch:i}=t,{type:a}=n,{refinement:s,message:c=`Expected a value of type \`${a}\`${s?` with refinement \`${s}\``:""}, but received: \`${p(r)}\``}=e;return{value:r,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:c}}function*h(e,t,n,r){(function(e){return l(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const o of e){const e=f(o,t,n,r);e&&(yield e)}}function*m(e,t,n={}){const{path:r=[],branch:o=[e],coerce:i=!1,mask:a=!1}=n,s={path:r,branch:o};if(i&&(e=t.coercer(e,s),a&&"type"!==t.type&&l(t.schema)&&l(e)&&!Array.isArray(e)))for(const n in e)void 0===t.schema[n]&&delete e[n];let c="valid";for(const r of t.validator(e,s))r.explanation=n.message,c="not_valid",yield[r,void 0];for(let[u,d,p]of t.entries(e,s)){const t=m(d,p,{path:void 0===u?r:[...r,u],branch:void 0===u?o:[...o,d],coerce:i,mask:a,message:n.message});for(const n of t)n[0]?(c=null===n[0].refinement||void 0===n[0].refinement?"not_valid":"not_refined",yield[n[0],void 0]):i&&(d=n[1],void 0===u?e=d:e instanceof Map?e.set(u,d):e instanceof Set?e.add(d):l(e)&&(void 0!==d||u in e)&&(e[u]=d))}if("not_valid"!==c)for(const r of t.refiner(e,s))r.explanation=n.message,c="not_refined",yield[r,void 0];"valid"===c&&(yield[void 0,e])}class v{constructor(e){const{type:t,schema:n,validator:r,refiner:o,coercer:i=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=n,this.entries=a,this.coercer=i,this.validator=r?(e,t)=>h(r(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>h(o(e,t),t,this,e):()=>[]}assert(e,t){return y(e,this,t)}create(e,t){return g(e,this,t)}is(e){return b(e,this)}mask(e,t){return function(e,t,n){const r=E(e,t,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}(e,this,t)}validate(e,t={}){return E(e,this,t)}}function y(e,t,n){const r=E(e,t,{message:n});if(r[0])throw r[0]}function g(e,t,n){const r=E(e,t,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function b(e,t){return!E(e,t)[0]}function E(e,t,n={}){const r=m(e,t,n),o=function(e){const{done:t,value:n}=e.next();return t?void 0:n}(r);if(o[0]){return[new d(o[0],(function*(){for(const e of r)e[0]&&(yield e[0])})),void 0]}return[void 0,o[1]]}function O(...e){const t="type"===e[0]?.type,n=e.map((({schema:e})=>e)),r=Object.assign({},...n);return t?function(e){const t=Object.keys(e);return new v({type:"type",schema:e,*entries(n){if(l(n))for(const r of t)yield[r,n[r],e[r]]},validator:e=>l(e)||`Expected an object, but received: ${p(e)}`,coercer:e=>l(e)?{...e}:e})}(r):A(r)}function S(e,t){return new v({type:e,schema:null,validator:t})}function w(e){let t;return new v({type:"lazy",schema:null,*entries(n,r){t??(t=e()),yield*t.entries(n,r)},validator:(n,r)=>(t??(t=e()),t.validator(n,r)),coercer:(n,r)=>(t??(t=e()),t.coercer(n,r)),refiner:(n,r)=>(t??(t=e()),t.refiner(n,r))})}function x(e){return new v({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${p(e)}`})}function j(){return S("boolean",(e=>"boolean"==typeof e))}function N(e){const t=p(e),n=typeof e;return new v({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?e:null,validator:n=>n===e||`Expected the literal \`${t}\`, but received: ${p(n)}`})}function k(){return S("never",(()=>!1))}function I(e){return new v({...e,validator:(t,n)=>null===t||e.validator(t,n),refiner:(t,n)=>null===t||e.refiner(t,n)})}function P(){return S("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${p(e)}`))}function A(e){const t=e?Object.keys(e):[],n=k();return new v({type:"object",schema:e??null,*entries(r){if(e&&l(r)){const o=new Set(Object.keys(r));for(const n of t)o.delete(n),yield[n,r[n],e[n]];for(const e of o)yield[e,r[e],n]}},validator:e=>l(e)||`Expected an object, but received: ${p(e)}`,coercer:e=>l(e)?{...e}:e})}function R(e){return new v({...e,validator:(t,n)=>void 0===t||e.validator(t,n),refiner:(t,n)=>void 0===t||e.refiner(t,n)})}function $(e,t){return new v({type:"record",schema:null,*entries(n){if(l(n))for(const r in n){const o=n[r];yield[r,r,e],yield[r,o,t]}},validator:e=>l(e)||`Expected an object, but received: ${p(e)}`})}function C(){return S("string",(e=>"string"==typeof e||`Expected a string, but received: ${p(e)}`))}function _(e){const t=e.map((e=>e.type)).join(" | ");return new v({type:"union",schema:null,coercer(t){for(const n of e){const[e,r]=n.validate(t,{coerce:!0});if(!e)return r}return t},validator(n,r){const o=[];for(const t of e){const[...e]=m(n,t,r),[i]=e;if(!i?.[0])return[];for(const[t]of e)t&&o.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${p(n)}`,...o]}})}function T(e,t,n){return new v({...e,coercer:(r,o)=>b(r,t)?e.coercer(n(r,o),o):e.coercer(r,o)})}function J(e){return function(e){return function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)&&"string"==typeof e.message?e.message:null==e?"":String(e)}(e).replace(/\.$/u,"")}function F(e,t){return n=e,Boolean("string"==typeof n?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var n}class q extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}const U=e=>A(e);function z({path:e,branch:t}){const n=e[e.length-1];return c(t[t.length-2],n)}function M(e){return new v({...e,type:`optional ${e.type}`,validator:(t,n)=>!z(n)||e.validator(t,n),refiner:(t,n)=>!z(n)||e.refiner(t,n)})}const B=_([N(null),j(),S("finite number",(e=>b(e,P())&&Number.isFinite(e))),C(),x(w((()=>B))),$(C(),w((()=>B)))]),L=T(B,S("any",(()=>!0)),(e=>(function(e,t,n="Assertion failed",r=q){try{y(e,t)}catch(e){throw F(r,`${n}: ${J(e)}.`)}}(e,B),JSON.parse(JSON.stringify(e,((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t}))))));function D(e){try{return function(e){g(e,L)}(e),!0}catch{return!1}}const G=N("2.0"),W=I(_([P(),C()])),X=U({code:S("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${p(e)}`)),message:C(),data:M(L),stack:M(C())}),H=_([$(C(),L),x(L)]);U({id:W,jsonrpc:G,method:C(),params:M(H)}),U({jsonrpc:G,method:C(),params:M(H)});A({id:W,jsonrpc:G,result:R(S("unknown",(()=>!0))),error:R(X)});const Q=U({id:W,jsonrpc:G,result:L}),Y=U({id:W,jsonrpc:G,error:X});_([Q,Y]);var K=o.internal,V="Unspecified error message. This is a bug, please report it.",Z=(ee(K),"Unspecified server error.");function ee(e,t=V){if(function(e){return Number.isInteger(e)}(e)){const t=e.toString();if(c(a,t))return a[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return Z}return t}function te(e){return Array.isArray(e)?e.map((e=>D(e)?e:s(e)?ne(e):null)):s(e)?ne(e):D(e)?e:null}function ne(e){return Object.getOwnPropertyNames(e).reduce(((t,n)=>{const r=e[n];return D(r)&&(t[n]=r),t}),{})}var re=n(12),oe=class extends Error{constructor(e,t,n){var r=(...e)=>{super(...e)};if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a non-empty string.');!function(e){return s(e)&&c(e,"cause")&&s(e.cause)}(n)?r(t):(r(t,{cause:n.cause}),c(this,"cause")||Object.assign(this,{cause:n.cause})),void 0!==n&&(this.data=n),this.code=e}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}(this.data)&&(e.data.cause=te(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return re(this.serialize(),ae,2)}},ie=class extends oe{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}};function ae(e,t){if("[Circular]"!==t)return t}var se=e=>we(o.parse,e),ce=e=>we(o.invalidRequest,e),ue=e=>we(o.invalidParams,e),de=e=>we(o.methodNotFound,e),le=e=>we(o.internal,e),pe=e=>we(o.invalidInput,e),fe=e=>we(o.resourceNotFound,e),he=e=>we(o.resourceUnavailable,e),me=e=>we(o.transactionRejected,e),ve=e=>we(o.methodNotSupported,e),ye=e=>we(o.limitExceeded,e),ge=e=>xe(i.userRejectedRequest,e),be=e=>xe(i.unauthorized,e),Ee=e=>xe(i.unsupportedMethod,e),Oe=e=>xe(i.disconnected,e),Se=e=>xe(i.chainDisconnected,e);function we(e,t){const[n,r]=je(t);return new oe(e,n??ee(e),r)}function xe(e,t){const[n,r]=je(t);return new ie(e,n??ee(e),r)}function je(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t??void 0,n]}}return[]}function Ne(e){return s(e)&&c(e,"data")&&"object"==typeof e.data&&null!==e.data&&D(e.data)&&!Array.isArray(e.data)?e.data:{}}class ke extends Error{#e;#t;#n;#r;constructor(e,t={}){const n=function(e){return s(e)&&c(e,"message")&&"string"==typeof e.message?e.message:String(e)}(e);super(n),this.#t=n,this.#e=function(e){return s(e)&&c(e,"code")&&"number"==typeof e.code&&Number.isInteger(e.code)?e.code:-32603}(e);const r={...Ne(e),...t};Object.keys(r).length>0&&(this.#n=r),this.#r=super.stack}get name(){return"SnapError"}get code(){return this.#e}get message(){return this.#t}get data(){return this.#n}get stack(){return this.#r}toJSON(){return{code:-31002,message:"Snap Error",data:{cause:{code:this.code,message:this.message,stack:this.stack,...this.data?{data:this.data}:{}}}}}serialize(){return this.toJSON()}}function Ie(e){return class extends ke{constructor(t,n){if("object"==typeof t){const n=e();return void super({code:n.code,message:n.message,data:t})}const r=e(t);super({code:r.code,message:r.message,data:n})}}}Ie(le),Ie(pe),Ie(ue),Ie(ce),Ie(ye);const Pe=Ie(de);Ie(ve),Ie(se),Ie(fe),Ie(he),Ie(me),Ie(Se),Ie(Oe),Ie(be),Ie(Ee),Ie(ge);var Ae;!function(e){e.ButtonClickEvent="ButtonClickEvent",e.FormSubmitEvent="FormSubmitEvent",e.InputChangeEvent="InputChangeEvent",e.FileUploadEvent="FileUploadEvent"}(Ae||(Ae={}));const Re=A({type:C(),name:R(C())}),$e=O(Re,A({type:N(Ae.ButtonClickEvent),name:R(C())})),Ce=A({name:C(),size:P(),contentType:C(),contents:C()}),_e=O(Re,A({type:N(Ae.FormSubmitEvent),value:$(C(),I(_([C(),Ce,j()]))),name:C()})),Te=O(Re,A({type:N(Ae.InputChangeEvent),name:C(),value:_([C(),j()])}));_([$e,_e,Te,O(Re,A({type:N(Ae.FileUploadEvent),name:C(),file:I(Ce)}))]);function Je(e){return Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e)))}function Fe(e){return t=>{const{key:n=null,...r}=t;return{type:e,props:Je(r),key:n}}}const qe=Fe("Box"),Ue=Fe("Heading"),ze=Fe("Form"),Me=Fe("Field"),Be=Fe("Input"),Le=Fe("Dropdown"),De=Fe("Option"),Ge=Fe("RadioGroup"),We=Fe("Radio"),Xe=Fe("Checkbox"),He=Fe("Selector"),Qe=Fe("SelectorOption"),Ye=Fe("Card"),Ke=Fe("Button"),Ve=()=>t(qe,{children:[e(Ue,{children:"Interactive UI Example Snap"}),t(ze,{name:"example-form",children:[e(Me,{label:"Example Input",children:e(Be,{name:"example-input",placeholder:"Enter something..."})}),e(Me,{label:"Example Dropdown",children:t(Le,{name:"example-dropdown",children:[e(De,{value:"option1",children:"Option 1"}),e(De,{value:"option2",children:"Option 2"}),e(De,{value:"option3",children:"Option 3"})]})}),e(Me,{label:"Example RadioGroup",children:t(Ge,{name:"example-radiogroup",children:[e(We,{value:"option1",children:"Option 1"}),e(We,{value:"option2",children:"Option 2"}),e(We,{value:"option3",children:"Option 3"})]})}),e(Me,{label:"Example Checkbox",children:e(Xe,{name:"example-checkbox",label:"Checkbox"})}),e(Me,{label:"Example Selector",children:t(He,{name:"example-selector",title:"Choose an option",value:"option1",children:[e(Qe,{value:"option1",children:e(Ye,{title:"Option 1",value:"option1"})}),e(Qe,{value:"option2",children:e(Ye,{title:"Option 2",value:"option2"})}),e(Qe,{value:"option3",children:e(Ye,{title:"Option 3",value:"option3"})})]})}),e(qe,{center:!0,children:e(Ke,{type:"submit",name:"submit",children:"Submit"})})]})]}),Ze=Fe("Row"),et=Fe("Address"),tt=Fe("Text"),nt=({from:n,to:r})=>t(qe,{children:[e(Ze,{label:"From",children:e(et,{address:n})}),e(Ze,{label:"To",children:r?e(et,{address:r}):e(tt,{children:"None"})}),e(Ke,{name:"transaction-type",children:"See transaction type"})]}),rt=Fe("Bold"),ot=({type:n})=>t(qe,{children:[e(Ze,{label:"Transaction Type",children:e(tt,{children:e(rt,{children:n})})}),e(Ke,{name:"go-back",children:"Back"})]}),it=Fe("Copyable"),at=({values:n})=>t(qe,{children:[e(Ue,{children:"Interactive UI Example Snap"}),e(tt,{children:"You submitted the following values:"}),e(qe,{children:Object.values(n).map((t=>{var n;return e(it,{value:(null===(n=t)||void 0===n?void 0:n.toString())??""})}))}),e(qe,{center:!0,children:e(Ke,{name:"back",children:"Back"})})]});function st(e,t){return ct(e,"pattern",(n=>t.test(n)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${n}"`))}function ct(e,t,n){return new v({...e,*refiner(r,o){yield*e.refiner(r,o);const i=h(n(r,o),o,e,r);for(const e of i)yield{...e,refinement:t}}})}st(C(),/^(?:0x)?[0-9a-f]+$/iu),st(C(),/^0x[0-9a-f]+$/iu),st(C(),/^0x[0-9a-f]{40}$/u),st(C(),/^0x[0-9a-fA-F]{40}$/u);function ut(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}const dt=[{name:"ERC-20",signature:"a9059cbb"},{name:"ERC-721",signature:"23b872dd"},{name:"ERC-1155",signature:"f242432a"}];const lt=async({request:t})=>{if("dialog"===t.method)return await snap.request({method:"snap_dialog",params:{type:"confirmation",content:e(Ve,{})}});throw new Pe({method:t.method})},pt=async()=>({content:e(Ve,{})}),ft=async({transaction:t})=>{const{from:n,to:r}=t;return{id:await snap.request({method:"snap_createInterface",params:{ui:e(nt,{from:n,to:r}),context:{transaction:t}}})}},ht=async({id:t,event:n,context:r})=>{if(n.type===Ae.ButtonClickEvent)switch(n.name){case"transaction-type":{var o;const n=function(e){if(e&&"string"==typeof e){var t;const n=ut(e).slice(0,8);return(null===(t=dt.find((e=>e.signature===n)))||void 0===t?void 0:t.name)??"Unknown"}return"Unknown"}((null===(o=r)||void 0===o?void 0:o.transaction).data);await snap.request({method:"snap_updateInterface",params:{id:t,ui:e(ot,{type:n})}});break}case"go-back":{var i;const n=null===(i=r)||void 0===i?void 0:i.transaction;await snap.request({method:"snap_updateInterface",params:{id:t,ui:e(nt,{from:n.from,to:n.to})}});break}case"back":await snap.request({method:"snap_updateInterface",params:{id:t,ui:e(Ve,{})}})}if(n.type===Ae.FormSubmitEvent&&"example-form"===n.name){const r=n.value;await snap.request({method:"snap_updateInterface",params:{id:t,ui:e(at,{values:r})}})}}})();var o=exports;for(var i in r)o[i]=r[i];r.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
package/package.json CHANGED
@@ -1,7 +1,16 @@
1
1
  {
2
2
  "name": "@metamask/interactive-ui-example-snap",
3
- "version": "2.2.0",
4
- "description": "MetaMask example snap demonstrating the use of interactive UI.",
3
+ "version": "2.3.0",
4
+ "description": "MetaMask example snap demonstrating the use of interactive UI",
5
+ "keywords": [
6
+ "MetaMask",
7
+ "Snaps",
8
+ "Ethereum"
9
+ ],
10
+ "homepage": "https://github.com/MetaMask/snaps/tree/main/packages/examples/packages/interactive-ui#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/MetaMask/snaps/issues"
13
+ },
5
14
  "repository": {
6
15
  "type": "git",
7
16
  "url": "https://github.com/MetaMask/snaps.git"
@@ -10,28 +19,32 @@
10
19
  "sideEffects": false,
11
20
  "main": "./dist/bundle.js",
12
21
  "files": [
13
- "dist/",
22
+ "dist",
14
23
  "snap.manifest.json"
15
24
  ],
16
25
  "scripts": {
17
26
  "build": "mm-snap build",
18
27
  "build:clean": "yarn clean && yarn build",
28
+ "changelog:update": "../../../../scripts/update-changelog.sh @metamask/interactive-ui-example-snap",
29
+ "changelog:validate": "../../../../scripts/validate-changelog.sh @metamask/interactive-ui-example-snap",
19
30
  "clean": "rimraf \"dist\"",
20
- "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies",
21
- "lint:changelog": "../../../../scripts/validate-changelog.sh @metamask/interactive-ui-example-snap",
31
+ "lint": "yarn lint:eslint && yarn lint:misc --check && yarn changelog:validate && yarn lint:dependencies",
22
32
  "lint:ci": "yarn lint",
33
+ "lint:dependencies": "depcheck",
23
34
  "lint:eslint": "eslint . --cache --ext js,ts,jsx,tsx",
24
35
  "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
25
36
  "lint:misc": "prettier --no-error-on-unmatched-pattern --loglevel warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore",
26
- "start": "mm-snap watch",
27
- "test": "yarn test:e2e",
28
- "test:e2e": "jest",
29
37
  "publish:preview": "yarn npm publish --tag preview",
30
- "lint:dependencies": "depcheck"
38
+ "since-latest-release": "../../../../scripts/since-latest-release.sh",
39
+ "start": "mm-snap watch",
40
+ "test": "jest --reporters=jest-silent-reporter",
41
+ "test:clean": "jest --clearCache",
42
+ "test:verbose": "jest --verbose",
43
+ "test:watch": "jest --watch"
31
44
  },
32
45
  "dependencies": {
33
- "@metamask/snaps-sdk": "^6.2.0",
34
- "@metamask/utils": "^9.1.0"
46
+ "@metamask/snaps-sdk": "^6.6.0",
47
+ "@metamask/utils": "^9.2.1"
35
48
  },
36
49
  "devDependencies": {
37
50
  "@jest/globals": "^29.5.0",
@@ -41,28 +54,29 @@
41
54
  "@metamask/eslint-config-jest": "^12.1.0",
42
55
  "@metamask/eslint-config-nodejs": "^12.1.0",
43
56
  "@metamask/eslint-config-typescript": "^12.1.0",
44
- "@metamask/snaps-cli": "^6.3.0",
45
- "@metamask/snaps-jest": "^8.3.0",
57
+ "@metamask/snaps-cli": "^6.3.3",
58
+ "@metamask/snaps-jest": "^8.4.0",
46
59
  "@swc/core": "1.3.78",
47
60
  "@swc/jest": "^0.2.26",
48
61
  "@typescript-eslint/eslint-plugin": "^5.42.1",
49
- "@typescript-eslint/parser": "^5.42.1",
62
+ "@typescript-eslint/parser": "^6.21.0",
50
63
  "deepmerge": "^4.2.2",
51
64
  "depcheck": "^1.4.7",
52
65
  "eslint": "^8.27.0",
53
66
  "eslint-config-prettier": "^8.5.0",
54
67
  "eslint-plugin-import": "^2.26.0",
55
68
  "eslint-plugin-jest": "^27.1.5",
56
- "eslint-plugin-jsdoc": "^39.6.2",
69
+ "eslint-plugin-jsdoc": "^41.1.2",
57
70
  "eslint-plugin-n": "^15.7.0",
58
71
  "eslint-plugin-prettier": "^4.2.1",
59
72
  "eslint-plugin-promise": "^6.1.1",
60
73
  "jest": "^29.0.2",
61
- "prettier": "^2.7.1",
62
- "prettier-plugin-packagejson": "^2.2.11",
74
+ "jest-silent-reporter": "^0.6.0",
75
+ "prettier": "^2.8.8",
76
+ "prettier-plugin-packagejson": "^2.5.2",
63
77
  "rimraf": "^4.1.2",
64
78
  "ts-node": "^10.9.1",
65
- "typescript": "~5.0.4"
79
+ "typescript": "~5.3.3"
66
80
  },
67
81
  "engines": {
68
82
  "node": "^18.16 || >=20"
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.2.0",
2
+ "version": "2.3.0",
3
3
  "description": "MetaMask example snap demonstrating the use of interactive UI",
4
4
  "proposedName": "Interactive UI Example Snap",
5
5
  "repository": {
@@ -7,7 +7,7 @@
7
7
  "url": "https://github.com/MetaMask/snaps.git"
8
8
  },
9
9
  "source": {
10
- "shasum": "gAlUmrpqDhqJ7Suu3Fpr7Do1y7MFEi7qR22uyjhRDb8=",
10
+ "shasum": "1sEjG59gm8iGvsIT9oa2WLRjcr7XQz5k6gkNXjBvuPg=",
11
11
  "location": {
12
12
  "npm": {
13
13
  "filePath": "dist/bundle.js",