@canton-network/wallet-gateway-remote 0.16.0 → 0.17.1
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/dapp-api/controller.d.ts.map +1 -1
- package/dist/dapp-api/controller.js +15 -3
- package/dist/index.js +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/web/frontend/404/index.html +6 -5
- package/dist/web/frontend/approve/index.html +6 -5
- package/dist/web/frontend/assets/{404-Dtgkdx8n.js → 404-C5sXhYIJ.js} +1 -1
- package/dist/web/frontend/assets/{approve-BngitDiu.js → approve-DLsPdBvo.js} +1 -1
- package/dist/web/frontend/assets/{callback-BZOvs1pj.js → callback-B-wmBVDs.js} +1 -1
- package/dist/web/frontend/assets/index-CxDOwxiY.css +1 -0
- package/dist/web/frontend/assets/index-Dfw8gEND.js +1158 -0
- package/dist/web/frontend/assets/{login-lehCoCJX.js → login-BiJNU2kh.js} +1 -1
- package/dist/web/frontend/assets/{settings-lrbuWERD.js → settings-B8ayu_0I.js} +1 -1
- package/dist/web/frontend/assets/{state-UchZlNDY.js → state-CziDYJOu.js} +1 -1
- package/dist/web/frontend/assets/{transactions-OQYrtI6P.js → transactions-D2Yx5LYD.js} +1 -1
- package/dist/web/frontend/assets/{wallets-BIhi0xp5.js → wallets-nCed0fPk.js} +1 -1
- package/dist/web/frontend/callback/index.html +5 -4
- package/dist/web/frontend/index.html +4 -3
- package/dist/web/frontend/login/index.html +6 -5
- package/dist/web/frontend/settings/index.html +6 -5
- package/dist/web/frontend/transactions/index.html +6 -5
- package/dist/web/frontend/wallets/index.html +6 -5
- package/package.json +19 -19
- package/dist/web/frontend/assets/index-7OK83THX.css +0 -1
- package/dist/web/frontend/assets/index-chWxxmO7.js +0 -1158
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/dapp-api/controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAS/E,OAAO,EAAE,KAAK,EAAe,MAAM,mCAAmC,CAAA;AAQtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAC5E,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAG7B,eAAO,MAAM,cAAc,GACvB,YAAY,gBAAgB,EAC5B,SAAS,MAAM,EACf,SAAS,MAAM,EACf,OAAO,KAAK,EACZ,qBAAqB,mBAAmB,EACxC,SAAS,MAAM,EACf,QAAQ,MAAM,GAAG,IAAI,EACrB,UAAU,WAAW;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/dapp-api/controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAS/E,OAAO,EAAE,KAAK,EAAe,MAAM,mCAAmC,CAAA;AAQtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAC5E,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAG7B,eAAO,MAAM,cAAc,GACvB,YAAY,gBAAgB,EAC5B,SAAS,MAAM,EACf,SAAS,MAAM,EACf,OAAO,KAAK,EACZ,qBAAqB,mBAAmB,EACxC,SAAS,MAAM,EACf,QAAQ,MAAM,GAAG,IAAI,EACrB,UAAU,WAAW;;;;;;;;;;;;;CAwPxB,CAAA"}
|
|
@@ -111,16 +111,28 @@ export const dappController = (kernelInfo, dappUrl, userUrl, store, notification
|
|
|
111
111
|
notifier.emit('txChanged', { status: 'pending', commandId });
|
|
112
112
|
const synchronizerId = network.synchronizerId ??
|
|
113
113
|
(await ledgerClient.getSynchronizerId());
|
|
114
|
-
const
|
|
114
|
+
const response = await prepareSubmission(context.userId, wallet.partyId, synchronizerId, params, ledgerClient);
|
|
115
|
+
//TODO: remove and handle normally when v3_3 is not supported anymore
|
|
116
|
+
const costEstimation = 'costEstimation' in response
|
|
117
|
+
? response.costEstimation
|
|
118
|
+
: undefined;
|
|
115
119
|
const transaction = {
|
|
116
120
|
commandId,
|
|
117
121
|
status: 'pending',
|
|
118
|
-
preparedTransaction,
|
|
119
|
-
preparedTransactionHash,
|
|
122
|
+
preparedTransaction: response.preparedTransaction,
|
|
123
|
+
preparedTransactionHash: response.preparedTransactionHash,
|
|
120
124
|
payload: params,
|
|
121
125
|
origin: origin || null,
|
|
122
126
|
createdAt: new Date(),
|
|
123
127
|
};
|
|
128
|
+
logger.info({
|
|
129
|
+
actAs: params.actAs || [wallet.partyId],
|
|
130
|
+
readAs: params.readAs || [],
|
|
131
|
+
userId: context.userId,
|
|
132
|
+
commandId,
|
|
133
|
+
commands: params.commands?.[0],
|
|
134
|
+
confirmationRequestTrafficCostEstimation: costEstimation?.confirmationRequestTrafficCostEstimation,
|
|
135
|
+
}, 'prepared transaction traffic estimation');
|
|
124
136
|
store.setTransaction(transaction);
|
|
125
137
|
return {
|
|
126
138
|
userUrl: `${userUrl}/approve/index.html?commandId=${commandId}`,
|
package/dist/index.js
CHANGED
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LedgerClient,
|
|
1
|
+
import { LedgerClient, Types } from '@canton-network/core-ledger-client';
|
|
2
2
|
import type { DisclosedContracts, PackageIdSelectionPreference } from './dapp-api/rpc-gen/typings.js';
|
|
3
3
|
type NetworkStatus = {
|
|
4
4
|
isConnected: boolean;
|
|
@@ -17,6 +17,6 @@ export interface PrepareParams {
|
|
|
17
17
|
packageIdSelectionPreference?: PackageIdSelectionPreference;
|
|
18
18
|
[k: string]: unknown;
|
|
19
19
|
}
|
|
20
|
-
export declare function ledgerPrepareParams(userId: string, partyId: string, synchronizerId: string, params: PrepareParams):
|
|
20
|
+
export declare function ledgerPrepareParams(userId: string, partyId: string, synchronizerId: string, params: PrepareParams): Types['JsPrepareSubmissionRequest'];
|
|
21
21
|
export {};
|
|
22
22
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAA;AACxE,OAAO,KAAK,EACR,kBAAkB,EAClB,4BAA4B,EAC/B,MAAM,+BAA+B,CAAA;AAEtC,KAAK,aAAa,GAAG;IACjB,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,wBAAsB,aAAa,CAC/B,YAAY,EAAE,YAAY,GAC3B,OAAO,CAAC,aAAa,CAAC,CAaxB;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAA;IACnC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;IACvC,4BAA4B,CAAC,EAAE,4BAA4B,CAAA;IAC3D,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,wBAAgB,mBAAmB,CAC/B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,aAAa,GACtB,KAAK,CAAC,4BAA4B,CAAC,CAuBrC"}
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
<link rel="
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
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">
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CxDOwxiY.css">
|
|
9
10
|
</head>
|
|
10
11
|
|
|
11
12
|
<body>
|
|
12
|
-
<app-layout iconSrc="
|
|
13
|
+
<app-layout iconSrc="./icon.png">
|
|
13
14
|
<user-ui-auth-redirect></user-ui-auth-redirect>
|
|
14
15
|
<user-ui-404></user-ui-404>
|
|
15
16
|
</app-layout>
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
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">
|
|
9
10
|
<link rel="modulepreload" crossorigin href="/assets/decode-CLJkuAIr.js">
|
|
10
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
11
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CxDOwxiY.css">
|
|
11
12
|
</head>
|
|
12
13
|
|
|
13
14
|
<body>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as k,a as z,b as O,t as P}from"./index-
|
|
1
|
+
import{i as k,a as z,b as O,t as P}from"./index-Dfw8gEND.js";var C=Object.create,s=Object.defineProperty,E=Object.getOwnPropertyDescriptor,x=(r,e)=>(e=Symbol[r])?e:Symbol.for("Symbol."+r),h=r=>{throw TypeError(r)},I=(r,e,a)=>e in r?s(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,j=(r,e)=>s(r,"name",{value:e,configurable:!0}),A=r=>[,,,C(r?.[x("metadata")]??null)],D=["class","method","getter","setter","accessor","field","value","get","set"],w=r=>r!==void 0&&typeof r!="function"?h("Function expected"):r,F=(r,e,a,n,t)=>({kind:D[r],name:e,metadata:n,addInitializer:o=>a._?h("Already initialized"):t.push(w(o||null))}),M=(r,e)=>I(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,g=r[m]||(r[m]=[]),c=l&&(t=t.prototype,l<5&&(l>3||!b)&&E(t,a));j(t,a);for(var _=n.length-1;_>=0;_--)f=F(l,a,u={},r[3],g),i=(0,n[_])(t,f),u._=1,w(i)&&(t=i);return M(r,t),c&&s(t,a,c),b?l^4?o:c:t},y,v,S;y=[P("user-ui-404")];const p=class p extends(S=k){connectedCallback(){super.connectedCallback()}render(){return O`
|
|
2
2
|
<div class="wrapper">
|
|
3
3
|
<not-found href="/"></not-found>
|
|
4
4
|
</div>
|
|
@@ -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-
|
|
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`
|
|
2
2
|
<div class="card">
|
|
3
3
|
<h1>Pending Transaction Request</h1>
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as O,s as u,e as x,r as C,b as P,t as I}from"./index-
|
|
1
|
+
import{i as O,s as u,e as x,r as C,b as P,t as I}from"./index-Dfw8gEND.js";var L=Object.create,h=Object.defineProperty,z=Object.getOwnPropertyDescriptor,w=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),b=e=>{throw TypeError(e)},D=(e,t,r)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,R=(e,t)=>h(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:c=>r._?b("Already initialized"):a.push(k(c||null))}),U=(e,t)=>D(t,w("metadata"),e[3]),N=(e,t,r,o)=>{for(var a=0,c=e[t>>1],i=c&&c.length;a<i;a++)c[a].call(r);return o},F=(e,t,r,o,a,c)=>{var i,s,l,n=t&7,d=!1,g=0,y=e[g]||(e[g]=[]),_=n&&(a=a.prototype,n<5&&(n>3||!d)&&z(a,r));R(a,r);for(var p=o.length-1;p>=0;p--)l=E(n,r,s={},e[3],y),i=(0,o[p])(a,l),s._=1,k(i)&&(a=i);return U(e,a),_&&h(a,r,_),d?n^4?c:_:a},m,v,S;m=[I("login-callback")];class f 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)),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:r,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).toISOString()),u.accessToken.set(n.access_token),x(n.access_token,u.networkId.get()||"").then(()=>{C()})}}}render(){return P`<h2>Logged in!</h2>`}}v=T(S);f=F(v,0,"LoginCallback",m,f);N(v,1,f);
|