@canton-network/wallet-gateway-remote 0.17.3 → 0.17.5

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.
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Wallet Gateway - Not found</title>
7
- <script type="module" crossorigin src="../assets/404-C5sXhYIJ.js"></script>
8
- <link rel="modulepreload" crossorigin href="../assets/index-Dfw8gEND.js">
7
+ <script type="module" crossorigin src="../assets/404-3YSiuYdC.js"></script>
8
+ <link rel="modulepreload" crossorigin href="../assets/index-BZBzarOZ.js">
9
9
  <link rel="stylesheet" crossorigin href="../assets/index-CxDOwxiY.css">
10
10
  </head>
11
11
 
@@ -4,9 +4,9 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Wallet Gateway - Approve Write Request</title>
7
- <script type="module" crossorigin src="../assets/approve-DLsPdBvo.js"></script>
8
- <link rel="modulepreload" crossorigin href="../assets/index-Dfw8gEND.js">
9
- <link rel="modulepreload" crossorigin href="../assets/state-CziDYJOu.js">
7
+ <script type="module" crossorigin src="../assets/approve-D9guEADN.js"></script>
8
+ <link rel="modulepreload" crossorigin href="../assets/index-BZBzarOZ.js">
9
+ <link rel="modulepreload" crossorigin href="../assets/state-Cz5Fy8N-.js">
10
10
  <link rel="modulepreload" crossorigin href="../assets/decode-CLJkuAIr.js">
11
11
  <link rel="stylesheet" crossorigin href="../assets/index-CxDOwxiY.css">
12
12
  </head>
@@ -0,0 +1,12 @@
1
+ import{i as g,a as k,z as O,b as P,t as C}from"./index-BZBzarOZ.js";var E=Object.create,s=Object.defineProperty,I=Object.getOwnPropertyDescriptor,x=(r,e)=>(e=Symbol[r])?e:Symbol.for("Symbol."+r),h=r=>{throw TypeError(r)},j=(r,e,a)=>e in r?s(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,A=(r,e)=>s(r,"name",{value:e,configurable:!0}),D=r=>[,,,E(r?.[x("metadata")]??null)],F=["class","method","getter","setter","accessor","field","value","get","set"],y=r=>r!==void 0&&typeof r!="function"?h("Function expected"):r,$=(r,e,a,n,t)=>({kind:F[r],name:e,metadata:n,addInitializer:o=>a._?h("Already initialized"):t.push(y(o||null))}),M=(r,e)=>j(e,x("metadata"),r[3]),N=(r,e,a,n)=>{for(var t=0,o=r[e>>1],i=o&&o.length;t<i;t++)o[t].call(a);return n},T=(r,e,a,n,t,o)=>{var i,u,f,l=e&7,b=!1,m=0,S=r[m]||(r[m]=[]),c=l&&(t=t.prototype,l<5&&(l>3||!b)&&I(t,a));A(t,a);for(var _=n.length-1;_>=0;_--)f=$(l,a,u={},r[3],S),i=(0,n[_])(t,f),u._=1,y(i)&&(t=i);return M(r,t),c&&s(t,a,c),b?l^4?o:c:t},w,v,z;w=[C("user-ui-404")];const p=class p extends(z=g){connectedCallback(){super.connectedCallback()}render(){return P`<not-found href=${O("/")}></not-found>`}};p.styles=k`
2
+ :host {
3
+ display: block;
4
+ box-sizing: border-box;
5
+ padding: 0rem;
6
+ max-width: 900px;
7
+ margin: 20% auto;
8
+ font-family: var(--swk-font, Arial, sans-serif);
9
+ color: var(--text-color, #222);
10
+ padding: 20px;
11
+ }
12
+ `;let d=p;v=D(z);d=T(v,0,"ApproveUi",w,d);N(v,1,d);
@@ -1,4 +1,4 @@
1
- import{c as j,s as J,d as ue,A as y,b,a as ge,i as me,t as _e}from"./index-Dfw8gEND.js";import{r as u}from"./state-CziDYJOu.js";import{p as be}from"./decode-CLJkuAIr.js";var ve=Object.create,C=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,X=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),x=t=>{throw TypeError(t)},fe=(t,e,a)=>e in t?C(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,K=(t,e)=>C(t,"name",{value:e,configurable:!0}),we=t=>[,,,ve(t?.[X("metadata")]??null)],Y=["class","method","getter","setter","accessor","field","value","get","set"],w=t=>t!==void 0&&typeof t!="function"?x("Function expected"):t,ye=(t,e,a,n,o)=>({kind:Y[t],name:e,metadata:n,addInitializer:d=>a._?x("Already initialized"):o.push(w(d||null))}),ke=(t,e)=>fe(e,X("metadata"),t[3]),i=(t,e,a,n)=>{for(var o=0,d=t[e>>1],v=d&&d.length;o<v;o++)e&1?d[o].call(a):n=d[o].call(a,n);return n},l=(t,e,a,n,o,d)=>{var v,p,F,f,k,s=e&7,A=!!(e&8),_=!!(e&16),T=s>3?t.length+1:s?A?1:2:0,G=Y[s+5],L=s>3&&(t[T-1]=[]),pe=t[T]||(t[T]=[]),m=s&&(!_&&!A&&(o=o.prototype),s<5&&(s>3||!_)&&xe(s<4?o:{get[a](){return Q(this,d)},set[a](h){return V(this,d,h)}},a));s?_&&s<4&&K(d,(s>2?"set ":s>1?"get ":"")+a):K(o,a);for(var $=n.length-1;$>=0;$--)f=ye(s,a,F={},t[3],pe),s&&(f.static=A,f.private=_,k=f.access={has:_?h=>Ae(o,h):h=>a in h},s^3&&(k.get=_?h=>(s^1?Q:Te)(h,o,s^4?d:m.get):h=>h[a]),s>2&&(k.set=_?(h,I)=>V(h,o,I,s^4?d:m.set):(h,I)=>h[a]=I)),p=(0,n[$])(s?s<4?_?d:m[G]:s>4?void 0:{get:m.get,set:m.set}:o,f),F._=1,s^4||p===void 0?w(p)&&(s>4?L.unshift(p):s?_?d=p:m[G]=p:o=p):typeof p!="object"||p===null?x("Object expected"):(w(v=p.get)&&(m.get=v),w(v=p.set)&&(m.set=v),w(v=p.init)&&L.unshift(v));return s||ke(t,o),m&&C(o,a,m),_?s^4?d:m:o},z=(t,e,a)=>e.has(t)||x("Cannot "+a),Ae=(t,e)=>Object(e)!==e?x('Cannot use the "in" operator on this value'):t.has(e),Q=(t,e,a)=>(z(t,e,"read from private field"),a?a.call(t):e.get(t)),g=(t,e,a)=>e.has(t)?x("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),V=(t,e,a,n)=>(z(t,e,"write to private field"),n?n.call(t,a):e.set(t,a),a),Te=(t,e,a)=>(z(t,e,"access private method"),a),Z,ee,te,ae,re,se,ie,oe,ne,de,ce,he,P,le,r,S,M,W,N,H,E,O,q,U,D,R,B;le=[_e("user-ui-approve")];class c extends(P=me,he=[u()],ce=[u()],de=[u()],ne=[u()],oe=[u()],ie=[u()],se=[u()],re=[u()],ae=[u()],te=[u()],ee=[u()],Z=[u()],P){constructor(){super(...arguments),g(this,S,i(r,8,this,!1)),i(r,11,this),g(this,M,i(r,12,this,"")),i(r,15,this),g(this,W,i(r,16,this,"")),i(r,19,this),g(this,N,i(r,20,this,"")),i(r,23,this),g(this,H,i(r,24,this,"")),i(r,27,this),g(this,E,i(r,28,this,null)),i(r,31,this),g(this,O,i(r,32,this,"")),i(r,35,this),g(this,q,i(r,36,this,null)),i(r,39,this),g(this,U,i(r,40,this,null)),i(r,43,this),g(this,D,i(r,44,this,null)),i(r,47,this),g(this,R,i(r,48,this,null)),i(r,51,this),g(this,B,i(r,52,this,null)),i(r,55,this)}connectedCallback(){super.connectedCallback();const e=new URL(window.location.href);this.commandId=e.searchParams.get("commandId")||"",this.updateState()}async updateState(){const e=await j(J.accessToken.get());e.request("getTransaction",{commandId:this.commandId}).then(a=>{this.txHash=a.preparedTransactionHash,this.tx=a.preparedTransaction,this.status=a.status,this.createdAt=a.createdAt||null,this.signedAt=a.signedAt||null,this.origin=a.origin||null;try{this.txParsed=be(this.tx)}catch(n){console.error("Error parsing prepared transaction:",n),this.txParsed=null}}),e.request("listWallets",[]).then(a=>{this.partyId=a.find(n=>n.primary===!0)?.partyId||""})}async handleExecute(){this.loading=!0,this.message="Executing transaction...",this.messageType="info";try{const e={commandId:this.commandId,partyId:this.partyId,preparedTransactionHash:this.txHash,preparedTransaction:this.tx},a=await j(J.accessToken.get()),{signature:n,signedBy:o}=await a.request("sign",e),d={signature:n,signedBy:o,commandId:this.commandId,partyId:this.partyId};await a.request("execute",d),this.message="Transaction executed successfully ✅",this.messageType="info",this.status="executed",window.opener&&setTimeout(()=>window.close(),1e3)}catch(e){console.error(e),this.message=null,this.messageType=null,ue(e,{message:"Error executing transaction"})}finally{this.loading=!1}}render(){return b`
1
+ import{c as j,s as J,f as ue,A as y,b,a as ge,i as me,t as _e}from"./index-BZBzarOZ.js";import{r as u}from"./state-Cz5Fy8N-.js";import{p as be}from"./decode-CLJkuAIr.js";var ve=Object.create,C=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,X=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),x=t=>{throw TypeError(t)},fe=(t,e,a)=>e in t?C(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,K=(t,e)=>C(t,"name",{value:e,configurable:!0}),we=t=>[,,,ve(t?.[X("metadata")]??null)],Y=["class","method","getter","setter","accessor","field","value","get","set"],w=t=>t!==void 0&&typeof t!="function"?x("Function expected"):t,ye=(t,e,a,n,o)=>({kind:Y[t],name:e,metadata:n,addInitializer:d=>a._?x("Already initialized"):o.push(w(d||null))}),ke=(t,e)=>fe(e,X("metadata"),t[3]),i=(t,e,a,n)=>{for(var o=0,d=t[e>>1],v=d&&d.length;o<v;o++)e&1?d[o].call(a):n=d[o].call(a,n);return n},l=(t,e,a,n,o,d)=>{var v,p,F,f,k,s=e&7,A=!!(e&8),_=!!(e&16),T=s>3?t.length+1:s?A?1:2:0,G=Y[s+5],L=s>3&&(t[T-1]=[]),pe=t[T]||(t[T]=[]),m=s&&(!_&&!A&&(o=o.prototype),s<5&&(s>3||!_)&&xe(s<4?o:{get[a](){return Q(this,d)},set[a](h){return V(this,d,h)}},a));s?_&&s<4&&K(d,(s>2?"set ":s>1?"get ":"")+a):K(o,a);for(var $=n.length-1;$>=0;$--)f=ye(s,a,F={},t[3],pe),s&&(f.static=A,f.private=_,k=f.access={has:_?h=>Ae(o,h):h=>a in h},s^3&&(k.get=_?h=>(s^1?Q:Te)(h,o,s^4?d:m.get):h=>h[a]),s>2&&(k.set=_?(h,I)=>V(h,o,I,s^4?d:m.set):(h,I)=>h[a]=I)),p=(0,n[$])(s?s<4?_?d:m[G]:s>4?void 0:{get:m.get,set:m.set}:o,f),F._=1,s^4||p===void 0?w(p)&&(s>4?L.unshift(p):s?_?d=p:m[G]=p:o=p):typeof p!="object"||p===null?x("Object expected"):(w(v=p.get)&&(m.get=v),w(v=p.set)&&(m.set=v),w(v=p.init)&&L.unshift(v));return s||ke(t,o),m&&C(o,a,m),_?s^4?d:m:o},z=(t,e,a)=>e.has(t)||x("Cannot "+a),Ae=(t,e)=>Object(e)!==e?x('Cannot use the "in" operator on this value'):t.has(e),Q=(t,e,a)=>(z(t,e,"read from private field"),a?a.call(t):e.get(t)),g=(t,e,a)=>e.has(t)?x("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),V=(t,e,a,n)=>(z(t,e,"write to private field"),n?n.call(t,a):e.set(t,a),a),Te=(t,e,a)=>(z(t,e,"access private method"),a),Z,ee,te,ae,re,se,ie,oe,ne,de,ce,he,P,le,r,S,M,W,N,H,E,O,q,U,D,R,B;le=[_e("user-ui-approve")];class c extends(P=me,he=[u()],ce=[u()],de=[u()],ne=[u()],oe=[u()],ie=[u()],se=[u()],re=[u()],ae=[u()],te=[u()],ee=[u()],Z=[u()],P){constructor(){super(...arguments),g(this,S,i(r,8,this,!1)),i(r,11,this),g(this,M,i(r,12,this,"")),i(r,15,this),g(this,W,i(r,16,this,"")),i(r,19,this),g(this,N,i(r,20,this,"")),i(r,23,this),g(this,H,i(r,24,this,"")),i(r,27,this),g(this,E,i(r,28,this,null)),i(r,31,this),g(this,O,i(r,32,this,"")),i(r,35,this),g(this,q,i(r,36,this,null)),i(r,39,this),g(this,U,i(r,40,this,null)),i(r,43,this),g(this,D,i(r,44,this,null)),i(r,47,this),g(this,R,i(r,48,this,null)),i(r,51,this),g(this,B,i(r,52,this,null)),i(r,55,this)}connectedCallback(){super.connectedCallback();const e=new URL(window.location.href);this.commandId=e.searchParams.get("commandId")||"",this.updateState()}async updateState(){const e=await j(J.accessToken.get());e.request("getTransaction",{commandId:this.commandId}).then(a=>{this.txHash=a.preparedTransactionHash,this.tx=a.preparedTransaction,this.status=a.status,this.createdAt=a.createdAt||null,this.signedAt=a.signedAt||null,this.origin=a.origin||null;try{this.txParsed=be(this.tx)}catch(n){console.error("Error parsing prepared transaction:",n),this.txParsed=null}}),e.request("listWallets",[]).then(a=>{this.partyId=a.find(n=>n.primary===!0)?.partyId||""})}async handleExecute(){this.loading=!0,this.message="Executing transaction...",this.messageType="info";try{const e={commandId:this.commandId,partyId:this.partyId,preparedTransactionHash:this.txHash,preparedTransaction:this.tx},a=await j(J.accessToken.get()),{signature:n,signedBy:o}=await a.request("sign",e),d={signature:n,signedBy:o,commandId:this.commandId,partyId:this.partyId};await a.request("execute",d),this.message="Transaction executed successfully ✅",this.messageType="info",this.status="executed",window.opener&&setTimeout(()=>window.close(),1e3)}catch(e){console.error(e),this.message=null,this.messageType=null,ue(e,{message:"Error executing transaction"})}finally{this.loading=!1}}render(){return b`
2
2
  <div class="card">
3
3
  <h1>Pending Transaction Request</h1>
4
4
 
@@ -0,0 +1 @@
1
+ import{i as O,z as x,s as f,d as C,r as P,b as z,t as I}from"./index-BZBzarOZ.js";var L=Object.create,v=Object.defineProperty,R=Object.getOwnPropertyDescriptor,w=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),b=e=>{throw TypeError(e)},U=(e,t,r)=>t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,D=(e,t)=>v(e,"name",{value:t,configurable:!0}),T=e=>[,,,L(e?.[w("metadata")]??null)],j=["class","method","getter","setter","accessor","field","value","get","set"],k=e=>e!==void 0&&typeof e!="function"?b("Function expected"):e,E=(e,t,r,o,a)=>({kind:j[e],name:t,metadata:o,addInitializer:n=>r._?b("Already initialized"):a.push(k(n||null))}),N=(e,t)=>U(t,w("metadata"),e[3]),F=(e,t,r,o)=>{for(var a=0,n=e[t>>1],i=n&&n.length;a<i;a++)n[a].call(r);return o},J=(e,t,r,o,a,n)=>{var i,d,l,s=t&7,c=!1,_=0,y=e[_]||(e[_]=[]),p=s&&(a=a.prototype,s<5&&(s>3||!c)&&R(a,r));D(a,r);for(var u=o.length-1;u>=0;u--)l=E(s,r,d={},e[3],y),i=(0,o[u])(a,l),d._=1,k(i)&&(a=i);return N(e,a),p&&v(a,r,p),c?s^4?n:p:a},m,g,S;m=[I("login-callback")];class h extends(S=O){connectedCallback(){super.connectedCallback(),this.handleRedirect()}async handleRedirect(){const t=new URL(window.location.href),r=t.searchParams.get("code"),o=t.searchParams.get("state");if(!r&&!o){console.error("missing state and code");return}if(r&&o){const a=JSON.parse(atob(o)),d=(await(await fetch(a.configUrl)).json()).token_endpoint,l=new URL(x("/callback"),window.location.origin).toString(),c=await(await fetch(d,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:r,redirect_uri:l,client_id:a.clientId,audience:a.audience})})).json();if(c.access_token){const _=JSON.parse(atob(c.access_token.split(".")[1]));f.expirationDate.set(new Date(_.exp*1e3).toISOString()),f.accessToken.set(c.access_token),C(c.access_token,f.networkId.get()||"").then(()=>{P()})}}}render(){return z`<h2>Logged in!</h2>`}}g=T(S);h=J(g,0,"LoginCallback",m,h);F(g,1,h);