@canton-network/wallet-gateway-remote 0.10.0 → 0.11.2
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/dist/config/Config.test.js +3 -3
- package/dist/dapp-api/controller.d.ts.map +1 -1
- package/dist/dapp-api/controller.js +4 -0
- package/dist/dapp-api/server.d.ts.map +1 -1
- package/dist/dapp-api/server.js +29 -29
- package/dist/dapp-api/server.test.js +3 -8
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +7 -23
- package/dist/ledger/wallet-sync-service.d.ts +2 -1
- package/dist/ledger/wallet-sync-service.d.ts.map +1 -1
- package/dist/ledger/wallet-sync-service.js +3 -2
- package/dist/ledger/wallet-sync-service.test.js +2 -2
- package/dist/middleware/sessionHandler.d.ts +13 -0
- package/dist/middleware/sessionHandler.d.ts.map +1 -0
- package/dist/middleware/sessionHandler.js +37 -0
- package/dist/notification/NotificationService.d.ts +8 -1
- package/dist/notification/NotificationService.d.ts.map +1 -1
- package/dist/notification/NotificationService.js +22 -1
- package/dist/user-api/controller.d.ts.map +1 -1
- package/dist/user-api/controller.js +19 -3
- package/dist/user-api/rpc-gen/typings.d.ts +2 -0
- package/dist/user-api/rpc-gen/typings.d.ts.map +1 -1
- package/dist/user-api/server.test.js +5 -9
- package/dist/web/frontend/404/index.html +2 -2
- package/dist/web/frontend/approve/index.html +4 -3
- package/dist/web/frontend/assets/{404-D9f6dBKB.js → 404-DOEElx02.js} +1 -1
- package/dist/web/frontend/assets/approve-D15QJVvX.js +185 -0
- package/dist/web/frontend/assets/callback-D0wYdJFr.js +1 -0
- package/dist/web/frontend/assets/decode-CLJkuAIr.js +2 -0
- package/dist/web/frontend/assets/index-EdAN1_qe.js +1011 -0
- package/dist/web/frontend/assets/login-CqVgGYZA.js +186 -0
- package/dist/web/frontend/assets/{settings-DI34Qjg8.js → settings-DgcggvCV.js} +1 -1
- package/dist/web/frontend/assets/{state-DxRr-Cgg.js → state-DcvVyWZr.js} +1 -1
- package/dist/web/frontend/assets/transactions-C-931My3.js +140 -0
- package/dist/web/frontend/assets/{wallets-CMKMTBj2.js → wallets-Cf2MBnzs.js} +1 -1
- package/dist/web/frontend/callback/index.html +2 -2
- package/dist/web/frontend/index.html +1 -1
- package/dist/web/frontend/login/index.html +3 -3
- package/dist/web/frontend/settings/index.html +3 -3
- package/dist/web/frontend/transactions/index.html +17 -0
- package/dist/web/frontend/wallets/index.html +3 -3
- package/package.json +17 -17
- package/dist/web/frontend/assets/approve-CvvaOTF9.js +0 -182
- package/dist/web/frontend/assets/callback-C2tlJhDI.js +0 -1
- package/dist/web/frontend/assets/index-ChQxMkmX.js +0 -1011
- package/dist/web/frontend/assets/login-295tArUb.js +0 -186
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import{c as J,s as K,w as ge,E as k,x as v,a as me,i as ue,t as _e}from"./index-EdAN1_qe.js";import{r as g}from"./state-DcvVyWZr.js";import{p as ve}from"./decode-CLJkuAIr.js";var fe=Object.create,z=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,Y=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),x=t=>{throw TypeError(t)},be=(t,e,a)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,Q=(t,e)=>z(t,"name",{value:e,configurable:!0}),we=t=>[,,,fe(t?.[Y("metadata")]??null)],Z=["class","method","getter","setter","accessor","field","value","get","set"],w=t=>t!==void 0&&typeof t!="function"?x("Function expected"):t,ke=(t,e,a,n,o)=>({kind:Z[t],name:e,metadata:n,addInitializer:d=>a._?x("Already initialized"):o.push(w(d||null))}),ye=(t,e)=>be(e,Y("metadata"),t[3]),i=(t,e,a,n)=>{for(var o=0,d=t[e>>1],f=d&&d.length;o<f;o++)e&1?d[o].call(a):n=d[o].call(a,n);return n},l=(t,e,a,n,o,d)=>{var f,p,F,b,y,r=e&7,A=!!(e&8),_=!!(e&16),I=r>3?t.length+1:r?A?1:2:0,G=Z[r+5],L=r>3&&(t[I-1]=[]),pe=t[I]||(t[I]=[]),u=r&&(!_&&!A&&(o=o.prototype),r<5&&(r>3||!_)&&xe(r<4?o:{get[a](){return V(this,d)},set[a](h){return X(this,d,h)}},a));r?_&&r<4&&Q(d,(r>2?"set ":r>1?"get ":"")+a):Q(o,a);for(var $=n.length-1;$>=0;$--)b=ke(r,a,F={},t[3],pe),r&&(b.static=A,b.private=_,y=b.access={has:_?h=>Ae(o,h):h=>a in h},r^3&&(y.get=_?h=>(r^1?V:Ie)(h,o,r^4?d:u.get):h=>h[a]),r>2&&(y.set=_?(h,T)=>X(h,o,T,r^4?d:u.set):(h,T)=>h[a]=T)),p=(0,n[$])(r?r<4?_?d:u[G]:r>4?void 0:{get:u.get,set:u.set}:o,b),F._=1,r^4||p===void 0?w(p)&&(r>4?L.unshift(p):r?_?d=p:u[G]=p:o=p):typeof p!="object"||p===null?x("Object expected"):(w(f=p.get)&&(u.get=f),w(f=p.set)&&(u.set=f),w(f=p.init)&&L.unshift(f));return r||ye(t,o),u&&z(o,a,u),_?r^4?d:u:o},M=(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),V=(t,e,a)=>(M(t,e,"read from private field"),a?a.call(t):e.get(t)),m=(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),X=(t,e,a,n)=>(M(t,e,"write to private field"),n?n.call(t,a):e.set(t,a),a),Ie=(t,e,a)=>(M(t,e,"access private method"),a),j,ee,te,ae,se,re,ie,oe,ne,de,ce,he,P,le,s,S,W,C,N,E,H,O,q,U,D,R,B;le=[_e("user-ui-approve")];class c extends(P=ue,he=[g()],ce=[g()],de=[g()],ne=[g()],oe=[g()],ie=[g()],re=[g()],se=[g()],ae=[g()],te=[g()],ee=[g()],j=[g()],P){constructor(){super(...arguments),m(this,S,i(s,8,this,!1)),i(s,11,this),m(this,W,i(s,12,this,"")),i(s,15,this),m(this,C,i(s,16,this,"")),i(s,19,this),m(this,N,i(s,20,this,"")),i(s,23,this),m(this,E,i(s,24,this,"")),i(s,27,this),m(this,H,i(s,28,this,null)),i(s,31,this),m(this,O,i(s,32,this,"")),i(s,35,this),m(this,q,i(s,36,this,null)),i(s,39,this),m(this,U,i(s,40,this,null)),i(s,43,this),m(this,D,i(s,44,this,null)),i(s,47,this),m(this,R,i(s,48,this,null)),i(s,51,this),m(this,B,i(s,52,this,null)),i(s,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(K.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=ve(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(K.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",window.opener&&setTimeout(()=>window.close(),1e3)}catch(e){console.error(e),this.message=null,this.messageType=null,ge(e,{message:"Error executing transaction"})}finally{this.loading=!1}}render(){return v`
|
|
2
|
+
<div class="card">
|
|
3
|
+
<h1>Pending Transaction Request</h1>
|
|
4
|
+
|
|
5
|
+
<h2>Transaction Details</h2>
|
|
6
|
+
|
|
7
|
+
<h3>Command Id</h3>
|
|
8
|
+
<p>${this.commandId}</p>
|
|
9
|
+
|
|
10
|
+
<h3>Status</h3>
|
|
11
|
+
<p>${this.status}</p>
|
|
12
|
+
|
|
13
|
+
${this.createdAt?v`<h3>Created At</h3>
|
|
14
|
+
<p>${this.createdAt}</p>`:k}
|
|
15
|
+
${this.signedAt?v`<h3>Signed At</h3>
|
|
16
|
+
<p>${this.signedAt}</p>`:k}
|
|
17
|
+
${this.origin?v`<h3>Origin</h3>
|
|
18
|
+
<p>${this.origin}</p>`:k}
|
|
19
|
+
|
|
20
|
+
<h3>Template</h3>
|
|
21
|
+
<p>
|
|
22
|
+
${this.txParsed?.packageName||"N/A"}:${this.txParsed?.moduleName||"N/A"}:${this.txParsed?.entityName||"N/A"}
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<h3>Signatories</h3>
|
|
26
|
+
<ul>
|
|
27
|
+
${this.txParsed?.signatories?.map(e=>v`<li>${e}</li>`)||v`<li>N/A</li>`}
|
|
28
|
+
</ul>
|
|
29
|
+
|
|
30
|
+
<h3>Stakeholders</h3>
|
|
31
|
+
<ul>
|
|
32
|
+
${this.txParsed?.stakeholders?.map(e=>v`<li>${e}</li>`)||v`<li>N/A</li>`}
|
|
33
|
+
</ul>
|
|
34
|
+
|
|
35
|
+
<h3>Transaction Hash</h3>
|
|
36
|
+
<p>${this.txHash}</p>
|
|
37
|
+
|
|
38
|
+
<h3>Base64 Transaction</h3>
|
|
39
|
+
<div class="tx-box">${this.tx}</div>
|
|
40
|
+
|
|
41
|
+
<h3>Decoded Transaction</h3>
|
|
42
|
+
<div class="tx-box">${this.txParsed?.jsonString||"N/A"}</div>
|
|
43
|
+
|
|
44
|
+
${this.status==="executed"?k:v`
|
|
45
|
+
<button
|
|
46
|
+
?disabled=${this.loading}
|
|
47
|
+
@click=${this.handleExecute}
|
|
48
|
+
>
|
|
49
|
+
${this.loading?"Processing...":"Approve"}
|
|
50
|
+
</button>
|
|
51
|
+
`}
|
|
52
|
+
${this.message?v`<div class="message ${this.messageType}">
|
|
53
|
+
${this.message}
|
|
54
|
+
</div>`:null}
|
|
55
|
+
</div>
|
|
56
|
+
`}}s=we(P);S=new WeakMap;W=new WeakMap;C=new WeakMap;N=new WeakMap;E=new WeakMap;H=new WeakMap;O=new WeakMap;q=new WeakMap;U=new WeakMap;D=new WeakMap;R=new WeakMap;B=new WeakMap;l(s,4,"loading",he,c,S);l(s,4,"commandId",ce,c,W);l(s,4,"partyId",de,c,C);l(s,4,"txHash",ne,c,N);l(s,4,"tx",oe,c,E);l(s,4,"txParsed",ie,c,H);l(s,4,"status",re,c,O);l(s,4,"message",se,c,q);l(s,4,"messageType",ae,c,U);l(s,4,"createdAt",te,c,D);l(s,4,"signedAt",ee,c,R);l(s,4,"origin",j,c,B);c=l(s,0,"ApproveUi",le,c);c.styles=me`
|
|
57
|
+
:host {
|
|
58
|
+
display: block;
|
|
59
|
+
box-sizing: border-box;
|
|
60
|
+
padding: 0rem;
|
|
61
|
+
max-width: 900px;
|
|
62
|
+
margin: 0 auto;
|
|
63
|
+
font-family: var(--swk-font, Arial, sans-serif);
|
|
64
|
+
color: var(--text-color, #222);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([theme='dark']) {
|
|
68
|
+
--card-bg: #1e1e1e;
|
|
69
|
+
--border-color: #333;
|
|
70
|
+
--text-color: #fff;
|
|
71
|
+
--button-bg: #4caf50;
|
|
72
|
+
--button-hover: #66bb6a;
|
|
73
|
+
--message-info: #81c784;
|
|
74
|
+
--message-error: #ff6b6b;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host(:not([theme='dark'])) {
|
|
78
|
+
--card-bg: #fff;
|
|
79
|
+
--border-color: #ddd;
|
|
80
|
+
--text-color: #222;
|
|
81
|
+
--button-bg: #4caf50;
|
|
82
|
+
--button-hover: #43a047;
|
|
83
|
+
--message-info: #388e3c;
|
|
84
|
+
--message-error: #d32f2f;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.card {
|
|
88
|
+
background: var(--card-bg);
|
|
89
|
+
border: 1px solid var(--border-color);
|
|
90
|
+
border-radius: 16px;
|
|
91
|
+
padding: 1.5rem;
|
|
92
|
+
width: 100%;
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
gap: 1rem;
|
|
97
|
+
overflow-x: hidden;
|
|
98
|
+
word-break: break-word;
|
|
99
|
+
margin-top: 2rem;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
h1 {
|
|
103
|
+
font-size: 1.25rem;
|
|
104
|
+
margin: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
h2 {
|
|
108
|
+
font-size: 1rem;
|
|
109
|
+
margin: 0.5rem 0 0.25rem 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
h3 {
|
|
113
|
+
font-size: 0.875rem;
|
|
114
|
+
margin: 0.25rem 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
p {
|
|
118
|
+
font-size: 0.85rem;
|
|
119
|
+
margin: 0.25rem 0;
|
|
120
|
+
word-break: break-word;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.tx-box {
|
|
124
|
+
background: rgba(0, 0, 0, 0.05);
|
|
125
|
+
border-radius: 8px;
|
|
126
|
+
padding: 0.5rem;
|
|
127
|
+
max-height: 150px;
|
|
128
|
+
overflow-y: auto;
|
|
129
|
+
overflow-x: auto;
|
|
130
|
+
font-family: monospace;
|
|
131
|
+
color: var(--text-color);
|
|
132
|
+
word-break: break-word;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
button {
|
|
136
|
+
padding: 0.75rem;
|
|
137
|
+
border-radius: 8px;
|
|
138
|
+
border: none;
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
background: var(--button-bg);
|
|
141
|
+
color: white;
|
|
142
|
+
font-weight: 600;
|
|
143
|
+
font-size: 1rem;
|
|
144
|
+
transition: background 0.2s ease;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
button:hover {
|
|
148
|
+
background: var(--button-hover);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
button[disabled] {
|
|
152
|
+
opacity: 0.6;
|
|
153
|
+
cursor: not-allowed;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.message {
|
|
157
|
+
padding: 0.5rem;
|
|
158
|
+
border-radius: 6px;
|
|
159
|
+
font-size: 0.875rem;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.message.info {
|
|
163
|
+
background-color: var(--message-info);
|
|
164
|
+
color: white;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.message.error {
|
|
168
|
+
background-color: var(--message-error);
|
|
169
|
+
color: white;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@media (max-width: 480px) {
|
|
173
|
+
.card {
|
|
174
|
+
padding: 1rem;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
h1 {
|
|
178
|
+
font-size: 1.1rem;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
button {
|
|
182
|
+
font-size: 0.95rem;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
`;i(s,1,c);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as y,s as u,b as C,D as P,x as E,t as O}from"./index-EdAN1_qe.js";var D=Object.create,h=Object.defineProperty,L=Object.getOwnPropertyDescriptor,g=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),b=e=>{throw TypeError(e)},R=(e,t,o)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,I=(e,t)=>h(e,"name",{value:t,configurable:!0}),T=e=>[,,,D(e?.[g("metadata")]??null)],z=["class","method","getter","setter","accessor","field","value","get","set"],k=e=>e!==void 0&&typeof e!="function"?b("Function expected"):e,U=(e,t,o,r,a)=>({kind:z[e],name:t,metadata:r,addInitializer:c=>o._?b("Already initialized"):a.push(k(c||null))}),j=(e,t)=>R(t,g("metadata"),e[3]),A=(e,t,o,r)=>{for(var a=0,c=e[t>>1],i=c&&c.length;a<i;a++)c[a].call(o);return r},F=(e,t,o,r,a,c)=>{var i,s,l,n=t&7,d=!1,w=0,x=e[w]||(e[w]=[]),_=n&&(a=a.prototype,n<5&&(n>3||!d)&&L(a,o));I(a,o);for(var p=r.length-1;p>=0;p--)l=U(n,o,s={},e[3],x),i=(0,r[p])(a,l),s._=1,k(i)&&(a=i);return j(e,a),_&&h(a,o,_),d?n^4?c:_:a},m,v,S;m=[O("login-callback")];class f extends(S=y){connectedCallback(){super.connectedCallback(),this.handleRedirect()}async handleRedirect(){const t=new URL(window.location.href),o=t.searchParams.get("code"),r=t.searchParams.get("state");if(!o&&!r){console.error("missing state and code");return}if(o&&r){const a=JSON.parse(atob(r)),s=(await(await fetch(a.configUrl)).json()).token_endpoint,n=await(await fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:o,redirect_uri:window.location.origin+"/callback/",client_id:a.clientId,audience:a.audience})})).json();if(n.access_token){const d=JSON.parse(atob(n.access_token.split(".")[1]));u.expirationDate.set(new Date(d.exp*1e3).toString()),u.accessToken.set(n.access_token),C(n.access_token,u.networkId.get()||"").then(()=>{window.location.replace(P)})}}}render(){return E`<h2>Logged in!</h2>`}}v=T(S);f=F(v,0,"LoginCallback",m,f);A(v,1,f);
|