@canton-network/example-portfolio 0.21.0 → 0.22.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/dist/assets/{Avatar-CacKr2RU.js → Avatar-Cvc50mRz.js} +1 -1
- package/dist/assets/{TableRow-CT-92ySa.js → TableRow-c-kQ4Wq1.js} +1 -1
- package/dist/assets/{copyable-identifier-DLqOdel0.js → copyable-identifier-Ca2EKaNz.js} +1 -1
- package/dist/assets/{index-CqwZW05Z.js → index-BXJTw44D.js} +1 -1
- package/dist/assets/index-DaIPIehr.js +1846 -0
- package/dist/assets/index-rFWAfy-Q.css +1 -0
- package/dist/assets/old-BSQsRLaR.css +1 -0
- package/dist/assets/{old-BLozOtDy.js → old-CopCO6dl.js} +1 -1
- package/dist/assets/{query-options-z3xkzkwq.js → query-options-DAhRNWw7.js} +1 -1
- package/dist/assets/{settings-CnXMtMoE.js → settings-CjDNJL8O.js} +1 -1
- package/dist/assets/{useTransactionHistory-5tZMcYOd.js → useTransactionHistory-CMGwF8RV.js} +1 -1
- package/dist/assets/{useWithdrawAllocation-u2PaZjMe.js → useWithdrawAllocation-DaVlMNjj.js} +1 -1
- package/dist/assets/wallet._walletId-DS9B7ADe.js +1 -0
- package/dist/index.html +2 -2
- package/package.json +39 -38
- package/dist/assets/index-Cs7nV1m0.css +0 -1
- package/dist/assets/index-mTLQZXyn.js +0 -1892
- package/dist/assets/wallet._walletId-CHnhr21k.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
body{@apply m-0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#root{max-width:1280px;display:flex;flex-direction:column;height:100%;margin:0 auto;padding:2rem;text-align:center}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media(prefers-reduced-motion:no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.card{padding:2em}.read-the-docs{color:#888}.error{color:#f08080}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as R,j as e,v as P,r as h,n as I,p as x,q as b,f,A as C,e as H,y,C as D}from"./index-mTLQZXyn.js";import{a as V,b as N,c as U}from"./query-options-z3xkzkwq.js";import{u as E,a as M}from"./useTransactionHistory-5tZMcYOd.js";import{u as O,a as q}from"./useWithdrawAllocation-u2PaZjMe.js";const p=({name:t,amount:s,instrument:o})=>{const i=R(o),a=`${o.id} from admin ${o.admin}`;return e.jsxs("span",{children:[t&&e.jsx("span",{children:t}),e.jsx("strong",{children:s}),i?e.jsxs("span",{title:a,children:[" ",i.instrument.symbol]}):e.jsxs("span",{title:a,children:[" ",o.id," (warning: unknown instrument)"]})]})},w=({value:t,onChange:s})=>{const o=P(),i=new Map;let a="";for(const[c,u]of o)for(const d of u){if(i.has(d.symbol))throw new Error(`duplicate symbol: ${d.symbol}`);i.set(d.symbol,{admin:c,id:d.id}),d.id===t?.id&&c===t?.admin&&(a=d.symbol)}const l=[...i.keys()].sort(),[r,n]=h.useState(a);return e.jsxs("select",{className:"select-instrument",value:r,onChange:c=>{n(c.target.value),s(i.get(c.target.value))},children:[e.jsx("option",{value:"",children:"Select an option..."},""),l.map(c=>e.jsx("option",{value:c,children:c},c))]})},F=()=>{const t=I().status?.session?.accessToken,s=x()?.partyId,{listHoldings:o,tap:i}=b(),a=f(),[l,r]=h.useState(void 0),[n,c]=h.useState(void 0),[u,d]=h.useState(1e4),g=new Date,j=h.useCallback(async()=>{if(s){const m=await o({party:s});r(m)}else r(void 0)},[s,o]);return h.useEffect(()=>{let m=!1;return(async()=>{if(s){const k=await o({party:s});m||r(k)}else r(void 0)})(),()=>{m=!0}},[s,o]),e.jsxs("div",{children:[e.jsxs("form",{onSubmit:m=>m.preventDefault(),className:"tap",children:[e.jsx(w,{value:n,onChange:m=>c(m)}),e.jsx("input",{type:"number",value:u,onChange:m=>d(Number(m.target.value))}),e.jsx("button",{type:"submit",disabled:!t||!s||!n,onClick:()=>{i({registryUrls:a,party:s,sessionToken:t,instrumentId:n,amount:u}).then(()=>j())},children:"TAP"})]}),e.jsx("ul",{children:l?.map(m=>e.jsxs("li",{children:[C.isHoldingLocked(m,g)&&e.jsx("span",{children:"🔒"}),e.jsx(p,{amount:m.amount,instrument:m.instrumentId})]},m.contractId))})]})},B=()=>{const t=H(),s=f(),[o,i]=h.useState(""),[a,l]=h.useState(""),r=[...s.keys()];return r.sort(),e.jsxs("div",{children:[e.jsx("h2",{children:"Registries"}),e.jsxs("table",{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Party ID"}),e.jsx("th",{children:"Registry URL"})]})}),e.jsx("tbody",{children:r.map(n=>e.jsxs("tr",{children:[e.jsx("td",{children:n}),e.jsx("td",{children:s.get(n)}),e.jsx("td",{children:e.jsx("button",{type:"submit",onClick:()=>t.deleteRegistryUrl(n),children:"🗑️"})})]},n))})]}),e.jsx("h2",{children:"Add new registry"}),e.jsxs("form",{onSubmit:n=>n.preventDefault(),children:[e.jsx("p",{children:"The party ID is optional and will be retrieved from the URL if not specified. Note that in this case you need to trust the URL to provide the right information."}),e.jsx("label",{htmlFor:"partyId",children:"Party ID: "}),e.jsx("input",{id:"partyId",value:o,onChange:n=>i(n.target.value)}),e.jsx("br",{}),e.jsx("label",{htmlFor:"url",children:"Registry URL: "}),e.jsx("input",{id:"url",value:a,onChange:n=>l(n.target.value)}),e.jsx("br",{}),e.jsx("button",{type:"submit",onClick:async()=>t.setRegistryUrl(o&&void 0,a),children:"Add registry"})]})]})},L=()=>{const t=x()?.partyId;return y(V(t))},A=({party:t,contractId:s,transferInstructionView:o})=>{const i=f(),{exerciseTransfer:a}=b(),l=o.transfer,r=o.status,{meta:n}=l,c=n.values[C.MEMO_KEY],u="tag"in r?r.tag:r.current?.tag;return e.jsxs("div",{children:["status: ",e.jsx("strong",{children:u})," ",e.jsx("br",{}),"sender: ",e.jsx("strong",{children:l.sender})," ",e.jsx("br",{}),"receiver: ",e.jsx("strong",{children:l.receiver})," ",e.jsx("br",{}),c&&e.jsxs("span",{children:["message: ",e.jsx("strong",{children:c})," ",e.jsx("br",{})]}),e.jsx(p,{amount:l.amount,instrument:l.instrumentId}),u==="TransferPendingReceiverAcceptance"&&l.receiver===t&&e.jsxs("div",{children:[e.jsx("button",{disabled:!s,onClick:()=>{a({registryUrls:i,party:t,contractId:s,instrumentId:l.instrumentId,instructionChoice:"Accept"})},children:"Accept"}),e.jsx("button",{disabled:!s,onClick:()=>{a({registryUrls:i,party:t,contractId:s,instrumentId:l.instrumentId,instructionChoice:"Reject"})},children:"Reject"})]}),l.status=="pending"&&!l.incoming&&e.jsx("button",{onClick:()=>{a({registryUrls:i,party:t,contractId:l.contractId,instrumentId:l.instrumentId,instructionChoice:"Withdraw"})},children:"Withdraw"})]})},W=()=>{const t=x()?.partyId,{data:s}=L();return e.jsxs("div",{children:[e.jsx("h2",{children:"Pending transfers"}),t&&e.jsx("ul",{children:s?.map(o=>e.jsx("li",{children:e.jsx(A,{party:t,contractId:o.contractId,transferInstructionView:o.interfaceViewValue})},o.contractId))})]})},$=()=>{const t=x()?.partyId,{mutate:s}=D(),[o,i]=h.useState(""),[a,l]=h.useState(100),[r,n]=h.useState(""),[c,u]=h.useState(void 0);return e.jsxs("form",{onSubmit:d=>d.preventDefault(),children:[e.jsx("label",{htmlFor:"instrument",children:"Instrument "}),e.jsx(w,{value:c,onChange:d=>u(d)}),e.jsx("br",{}),e.jsx("label",{htmlFor:"receiver",children:"Receiver: "}),e.jsx("input",{id:"receiver",value:o,onChange:d=>i(d.target.value)}),e.jsx("br",{}),e.jsx("label",{htmlFor:"amount",children:"Amount to transfer: "}),e.jsx("input",{id:"amount",type:"number",value:a,onChange:d=>l(Number(d.target.value))}),e.jsx("br",{}),e.jsx("label",{htmlFor:"memo",children:"Message for receiver: "}),e.jsx("input",{id:"memo",value:r,onChange:d=>n(d.target.value)}),e.jsx("br",{}),e.jsx("button",{type:"submit",disabled:!t||!c,onClick:()=>{s({instrumentId:c,sender:t,receiver:o,amount:`${a}`,expiry:new Date(Date.now()+1440*60*1e3),memo:r||void 0})},children:"Transfer"})]})},v=({change:t})=>e.jsxs("span",{children:["In:",e.jsx(p,{instrument:t.instrumentId,amount:t.inputAmount}),", Out:",e.jsx(p,{instrument:t.instrumentId,amount:t.outputAmount}),", Change:",e.jsx(p,{instrument:t.instrumentId,amount:t.amountChange})]}),Q=()=>{const t=x()?.partyId,{status:s,fetchNextPage:o,isFetchingNextPage:i,hasNextPage:a}=E(),l=M();return e.jsxs("div",{children:[e.jsx("h2",{children:"Transaction History"}),t&&l.map(r=>e.jsxs("div",{children:[e.jsxs("code",{children:["At ",r.offset," (",r.recordTime,")"]}),e.jsx("br",{}),r.events.map((n,c)=>e.jsx("div",{children:n.transferInstruction?e.jsx(A,{party:t,transferInstructionView:n.transferInstruction}):e.jsxs("div",{children:[e.jsx("strong",{children:n.label.type}),n.lockedHoldingsChangeSummaries.length>0&&e.jsxs("div",{children:[e.jsx("strong",{children:"Locked:"}),n.lockedHoldingsChangeSummaries.map((u,d)=>e.jsx(v,{change:u},d))]}),n.unlockedHoldingsChangeSummaries.length>0&&e.jsxs("div",{children:[e.jsx("strong",{children:"Locked:"}),n.unlockedHoldingsChangeSummaries.map((u,d)=>e.jsx(v,{change:u},d))]})]})},c))]},r.updateId)),!a&&e.jsx("span",{children:"(end)"}),s==="pending"&&e.jsx("span",{children:"⏳"}),!i&&a&&t&&e.jsx("button",{disabled:i||!a||!t,onClick:()=>o(),children:"load more"})]})},K=()=>{const{error:t,status:s,connect:o,open:i,disconnect:a}=I(),l=s?.connection?.isConnected,r=x()?.partyId;return e.jsxs("div",{className:"card",children:[!l&&e.jsx("button",{onClick:()=>o(),children:"connect to Wallet"}),l&&e.jsx("button",{onClick:()=>a(),children:"disconnect"}),e.jsx("button",{onClick:()=>i(),children:"open Wallet"}),t&&e.jsxs("p",{className:"error",children:[e.jsx("b",{children:"Error:"})," ",e.jsx("i",{children:t})]}),e.jsx("br",{}),l&&e.jsxs("div",{children:["Party: ",r,e.jsx("br",{}),"SessionToken: ",s?.session?.accessToken?"ok":"nope"]})]})},X=()=>{const t=x()?.partyId;return y(N(t))},T=()=>{const t=x()?.partyId;return y(U(t))},S=({transferLegId:t,transferLeg:s})=>e.jsxs("div",{children:[e.jsxs("h3",{children:["Transfer leg ",t]}),e.jsx("strong",{children:"sender:"})," ",s.sender,e.jsx("br",{}),e.jsx("strong",{children:"receiver:"})," ",s.receiver,e.jsx("br",{}),e.jsx(p,{amount:s.amount,instrument:s.instrumentId})]}),z=({party:t,contractId:s,allocation:o})=>{const{settlement:i,transferLeg:a,transferLegId:l}=o.allocation,r=f(),{withdrawAllocation:n}=b(),{refetch:c}=T();return e.jsxs("div",{children:[e.jsx("h3",{children:"Settlement"}),e.jsx("strong",{children:"executor:"})," ",i.executor,e.jsx("br",{}),e.jsx("strong",{children:"allocateBefore:"})," ",i.allocateBefore,new Date(i.allocateBefore)<=new Date&&"(EXPIRED!)",e.jsx("br",{}),e.jsx(S,{transferLegId:l,transferLeg:a}),a.sender===t&&e.jsx("button",{onClick:async()=>{await n({registryUrls:r,party:t,instrumentId:a.instrumentId,contractId:s}),c()},children:"Withdraw"})]})},J=({settlementInfo:t})=>e.jsxs("div",{children:[e.jsx("h3",{children:"Settlement"}),e.jsx("strong",{children:"executor:"})," ",t.executor,e.jsx("br",{}),e.jsx("strong",{children:"allocateBefore:"})," ",t.allocateBefore,new Date(t.allocateBefore)<=new Date&&"(EXPIRED!)",e.jsx("br",{})]}),Y=({party:t,allocationRequest:s,allocationsByTransferLegId:o})=>{const{settlement:i,transferLegs:a}=s,{mutate:l}=O(),{mutate:r}=q();return e.jsxs("div",{children:[e.jsx(J,{settlementInfo:i}),e.jsx("h3",{children:"Transfer Legs"}),Object.entries(a).map(([n,c])=>e.jsxs("div",{children:[e.jsx(S,{transferLegId:n,transferLeg:c}),c.sender===t&&e.jsx("button",{onClick:()=>l({party:t,allocationSpecification:{settlement:i,transferLegId:n,transferLeg:c}}),children:"Create Allocation"}),o?.get(n)?.map(u=>e.jsxs("div",{children:[e.jsx("span",{children:"Allocation Made"}),c.sender===t&&e.jsx("button",{onClick:()=>r({party:t,instrumentId:c.instrumentId,contractId:u.contractId}),children:"Withdraw Allocation"})]},u.contractId))]},n))]})},_=()=>{const t=b(),s=x()?.partyId,{data:o}=X(),{data:i}=T(),a=h.useCallback((n,c)=>JSON.stringify([n.settlementRef.id,n.settlementRef.cid,c]),[]),[l,r]=h.useMemo(()=>{const n=new Map,c=[];for(const u of o??[]){const{settlement:d,transferLegs:g}=u.interfaceViewValue;for(const j in g){const m=a(d,j);n.set(m,[])}}for(const u of i??[]){const{settlement:d,transferLegId:g}=u.interfaceViewValue.allocation,j=a(d,g);n.has(j)?n.get(j).push(u):(console.log(n),c.push(u))}return[n,c]},[o,i,a]);return h.useEffect(()=>{s&&(async()=>{const n=await t.listAllocationInstructions({party:s});console.log("allocationInstructions",n)})()},[t,s]),e.jsxs("div",{children:[e.jsx("h2",{children:"Allocation requests"}),s&&o?.map(n=>e.jsx("div",{children:e.jsx(Y,{party:s,allocationRequest:n.interfaceViewValue,allocationsByTransferLegId:new Map(Object.keys(n.interfaceViewValue.transferLegs).map(c=>[c,l.get(a(n.interfaceViewValue.settlement,c))??[]]))})},n.contractId)),e.jsx("h2",{children:"Unknown Allocations"}),s&&r?.map(n=>e.jsx("div",{children:e.jsx(z,{party:s,contractId:n.contractId,allocation:n.interfaceViewValue})},n.contractId))]})},G=({tabs:t,initialValue:s})=>{const o=s??t[0]?.value,[i,a]=h.useState(o),l=t.find(r=>r.value===i);return e.jsxs("div",{children:[e.jsx("div",{role:"tablist",className:"flex gap-2 border-b",children:t.map(r=>e.jsx("button",{role:"tab","aria-selected":i===r.value,className:`${i===r.value?"bg-blue-500":"opacity-60"}`,onClick:()=>a(r.value),children:i===r.value?`[${r.label}]`:r.label},r.value))}),e.jsx("div",{role:"tabpanel",children:l?.content})]})};function re(){return e.jsxs(e.Fragment,{children:[e.jsx("h1",{children:"dApp Portfolio"}),e.jsx(K,{}),e.jsx(G,{tabs:[{label:"Holdings",value:"holdings",content:e.jsx(F,{})},{label:"Transfer",value:"twoStepTransfer",content:e.jsx($,{})},{label:"Pending Transfers",value:"pendingTransfers",content:e.jsx(W,{})},{label:"Transaction History",value:"transactionHistory",content:e.jsx(Q,{})},{label:"Allocations",value:"allocations",content:e.jsx(_,{})},{label:"Registry Settings",value:"registries",content:e.jsx(B,{})}]})]})}export{re as component};
|
|
1
|
+
import{z as R,j as e,v as P,r as h,n as I,p as x,q as b,f,A as C,e as H,y,C as D}from"./index-DaIPIehr.js";import{a as V,b as N,c as U}from"./query-options-DAhRNWw7.js";import{u as E,a as M}from"./useTransactionHistory-CMGwF8RV.js";import{u as O,a as q}from"./useWithdrawAllocation-DaVlMNjj.js";const p=({name:t,amount:s,instrument:o})=>{const i=R(o),a=`${o.id} from admin ${o.admin}`;return e.jsxs("span",{children:[t&&e.jsx("span",{children:t}),e.jsx("strong",{children:s}),i?e.jsxs("span",{title:a,children:[" ",i.instrument.symbol]}):e.jsxs("span",{title:a,children:[" ",o.id," (warning: unknown instrument)"]})]})},w=({value:t,onChange:s})=>{const o=P(),i=new Map;let a="";for(const[c,u]of o)for(const d of u){if(i.has(d.symbol))throw new Error(`duplicate symbol: ${d.symbol}`);i.set(d.symbol,{admin:c,id:d.id}),d.id===t?.id&&c===t?.admin&&(a=d.symbol)}const l=[...i.keys()].sort(),[r,n]=h.useState(a);return e.jsxs("select",{className:"select-instrument",value:r,onChange:c=>{n(c.target.value),s(i.get(c.target.value))},children:[e.jsx("option",{value:"",children:"Select an option..."},""),l.map(c=>e.jsx("option",{value:c,children:c},c))]})},F=()=>{const t=I().status?.session?.accessToken,s=x()?.partyId,{listHoldings:o,tap:i}=b(),a=f(),[l,r]=h.useState(void 0),[n,c]=h.useState(void 0),[u,d]=h.useState(1e4),g=new Date,j=h.useCallback(async()=>{if(s){const m=await o({party:s});r(m)}else r(void 0)},[s,o]);return h.useEffect(()=>{let m=!1;return(async()=>{if(s){const k=await o({party:s});m||r(k)}else r(void 0)})(),()=>{m=!0}},[s,o]),e.jsxs("div",{children:[e.jsxs("form",{onSubmit:m=>m.preventDefault(),className:"tap",children:[e.jsx(w,{value:n,onChange:m=>c(m)}),e.jsx("input",{type:"number",value:u,onChange:m=>d(Number(m.target.value))}),e.jsx("button",{type:"submit",disabled:!t||!s||!n,onClick:()=>{i({registryUrls:a,party:s,sessionToken:t,instrumentId:n,amount:u}).then(()=>j())},children:"TAP"})]}),e.jsx("ul",{children:l?.map(m=>e.jsxs("li",{children:[C.isHoldingLocked(m,g)&&e.jsx("span",{children:"🔒"}),e.jsx(p,{amount:m.amount,instrument:m.instrumentId})]},m.contractId))})]})},B=()=>{const t=H(),s=f(),[o,i]=h.useState(""),[a,l]=h.useState(""),r=[...s.keys()];return r.sort(),e.jsxs("div",{children:[e.jsx("h2",{children:"Registries"}),e.jsxs("table",{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Party ID"}),e.jsx("th",{children:"Registry URL"})]})}),e.jsx("tbody",{children:r.map(n=>e.jsxs("tr",{children:[e.jsx("td",{children:n}),e.jsx("td",{children:s.get(n)}),e.jsx("td",{children:e.jsx("button",{type:"submit",onClick:()=>t.deleteRegistryUrl(n),children:"🗑️"})})]},n))})]}),e.jsx("h2",{children:"Add new registry"}),e.jsxs("form",{onSubmit:n=>n.preventDefault(),children:[e.jsx("p",{children:"The party ID is optional and will be retrieved from the URL if not specified. Note that in this case you need to trust the URL to provide the right information."}),e.jsx("label",{htmlFor:"partyId",children:"Party ID: "}),e.jsx("input",{id:"partyId",value:o,onChange:n=>i(n.target.value)}),e.jsx("br",{}),e.jsx("label",{htmlFor:"url",children:"Registry URL: "}),e.jsx("input",{id:"url",value:a,onChange:n=>l(n.target.value)}),e.jsx("br",{}),e.jsx("button",{type:"submit",onClick:async()=>t.setRegistryUrl(o&&void 0,a),children:"Add registry"})]})]})},L=()=>{const t=x()?.partyId;return y(V(t))},A=({party:t,contractId:s,transferInstructionView:o})=>{const i=f(),{exerciseTransfer:a}=b(),l=o.transfer,r=o.status,{meta:n}=l,c=n.values[C.MEMO_KEY],u="tag"in r?r.tag:r.current?.tag;return e.jsxs("div",{children:["status: ",e.jsx("strong",{children:u})," ",e.jsx("br",{}),"sender: ",e.jsx("strong",{children:l.sender})," ",e.jsx("br",{}),"receiver: ",e.jsx("strong",{children:l.receiver})," ",e.jsx("br",{}),c&&e.jsxs("span",{children:["message: ",e.jsx("strong",{children:c})," ",e.jsx("br",{})]}),e.jsx(p,{amount:l.amount,instrument:l.instrumentId}),u==="TransferPendingReceiverAcceptance"&&l.receiver===t&&e.jsxs("div",{children:[e.jsx("button",{disabled:!s,onClick:()=>{a({registryUrls:i,party:t,contractId:s,instrumentId:l.instrumentId,instructionChoice:"Accept"})},children:"Accept"}),e.jsx("button",{disabled:!s,onClick:()=>{a({registryUrls:i,party:t,contractId:s,instrumentId:l.instrumentId,instructionChoice:"Reject"})},children:"Reject"})]}),l.status=="pending"&&!l.incoming&&e.jsx("button",{onClick:()=>{a({registryUrls:i,party:t,contractId:l.contractId,instrumentId:l.instrumentId,instructionChoice:"Withdraw"})},children:"Withdraw"})]})},W=()=>{const t=x()?.partyId,{data:s}=L();return e.jsxs("div",{children:[e.jsx("h2",{children:"Pending transfers"}),t&&e.jsx("ul",{children:s?.map(o=>e.jsx("li",{children:e.jsx(A,{party:t,contractId:o.contractId,transferInstructionView:o.interfaceViewValue})},o.contractId))})]})},$=()=>{const t=x()?.partyId,{mutate:s}=D(),[o,i]=h.useState(""),[a,l]=h.useState(100),[r,n]=h.useState(""),[c,u]=h.useState(void 0);return e.jsxs("form",{onSubmit:d=>d.preventDefault(),children:[e.jsx("label",{htmlFor:"instrument",children:"Instrument "}),e.jsx(w,{value:c,onChange:d=>u(d)}),e.jsx("br",{}),e.jsx("label",{htmlFor:"receiver",children:"Receiver: "}),e.jsx("input",{id:"receiver",value:o,onChange:d=>i(d.target.value)}),e.jsx("br",{}),e.jsx("label",{htmlFor:"amount",children:"Amount to transfer: "}),e.jsx("input",{id:"amount",type:"number",value:a,onChange:d=>l(Number(d.target.value))}),e.jsx("br",{}),e.jsx("label",{htmlFor:"memo",children:"Message for receiver: "}),e.jsx("input",{id:"memo",value:r,onChange:d=>n(d.target.value)}),e.jsx("br",{}),e.jsx("button",{type:"submit",disabled:!t||!c,onClick:()=>{s({instrumentId:c,sender:t,receiver:o,amount:`${a}`,expiry:new Date(Date.now()+1440*60*1e3),memo:r||void 0})},children:"Transfer"})]})},v=({change:t})=>e.jsxs("span",{children:["In:",e.jsx(p,{instrument:t.instrumentId,amount:t.inputAmount}),", Out:",e.jsx(p,{instrument:t.instrumentId,amount:t.outputAmount}),", Change:",e.jsx(p,{instrument:t.instrumentId,amount:t.amountChange})]}),Q=()=>{const t=x()?.partyId,{status:s,fetchNextPage:o,isFetchingNextPage:i,hasNextPage:a}=E(),l=M();return e.jsxs("div",{children:[e.jsx("h2",{children:"Transaction History"}),t&&l.map(r=>e.jsxs("div",{children:[e.jsxs("code",{children:["At ",r.offset," (",r.recordTime,")"]}),e.jsx("br",{}),r.events.map((n,c)=>e.jsx("div",{children:n.transferInstruction?e.jsx(A,{party:t,transferInstructionView:n.transferInstruction}):e.jsxs("div",{children:[e.jsx("strong",{children:n.label.type}),n.lockedHoldingsChangeSummaries.length>0&&e.jsxs("div",{children:[e.jsx("strong",{children:"Locked:"}),n.lockedHoldingsChangeSummaries.map((u,d)=>e.jsx(v,{change:u},d))]}),n.unlockedHoldingsChangeSummaries.length>0&&e.jsxs("div",{children:[e.jsx("strong",{children:"Locked:"}),n.unlockedHoldingsChangeSummaries.map((u,d)=>e.jsx(v,{change:u},d))]})]})},c))]},r.updateId)),!a&&e.jsx("span",{children:"(end)"}),s==="pending"&&e.jsx("span",{children:"⏳"}),!i&&a&&t&&e.jsx("button",{disabled:i||!a||!t,onClick:()=>o(),children:"load more"})]})},K=()=>{const{error:t,status:s,connect:o,open:i,disconnect:a}=I(),l=s?.connection?.isConnected,r=x()?.partyId;return e.jsxs("div",{className:"card",children:[!l&&e.jsx("button",{onClick:()=>o(),children:"connect to Wallet"}),l&&e.jsx("button",{onClick:()=>a(),children:"disconnect"}),e.jsx("button",{onClick:()=>i(),children:"open Wallet"}),t&&e.jsxs("p",{className:"error",children:[e.jsx("b",{children:"Error:"})," ",e.jsx("i",{children:t})]}),e.jsx("br",{}),l&&e.jsxs("div",{children:["Party: ",r,e.jsx("br",{}),"SessionToken: ",s?.session?.accessToken?"ok":"nope"]})]})},X=()=>{const t=x()?.partyId;return y(N(t))},T=()=>{const t=x()?.partyId;return y(U(t))},S=({transferLegId:t,transferLeg:s})=>e.jsxs("div",{children:[e.jsxs("h3",{children:["Transfer leg ",t]}),e.jsx("strong",{children:"sender:"})," ",s.sender,e.jsx("br",{}),e.jsx("strong",{children:"receiver:"})," ",s.receiver,e.jsx("br",{}),e.jsx(p,{amount:s.amount,instrument:s.instrumentId})]}),z=({party:t,contractId:s,allocation:o})=>{const{settlement:i,transferLeg:a,transferLegId:l}=o.allocation,r=f(),{withdrawAllocation:n}=b(),{refetch:c}=T();return e.jsxs("div",{children:[e.jsx("h3",{children:"Settlement"}),e.jsx("strong",{children:"executor:"})," ",i.executor,e.jsx("br",{}),e.jsx("strong",{children:"allocateBefore:"})," ",i.allocateBefore,new Date(i.allocateBefore)<=new Date&&"(EXPIRED!)",e.jsx("br",{}),e.jsx(S,{transferLegId:l,transferLeg:a}),a.sender===t&&e.jsx("button",{onClick:async()=>{await n({registryUrls:r,party:t,instrumentId:a.instrumentId,contractId:s}),c()},children:"Withdraw"})]})},J=({settlementInfo:t})=>e.jsxs("div",{children:[e.jsx("h3",{children:"Settlement"}),e.jsx("strong",{children:"executor:"})," ",t.executor,e.jsx("br",{}),e.jsx("strong",{children:"allocateBefore:"})," ",t.allocateBefore,new Date(t.allocateBefore)<=new Date&&"(EXPIRED!)",e.jsx("br",{})]}),Y=({party:t,allocationRequest:s,allocationsByTransferLegId:o})=>{const{settlement:i,transferLegs:a}=s,{mutate:l}=O(),{mutate:r}=q();return e.jsxs("div",{children:[e.jsx(J,{settlementInfo:i}),e.jsx("h3",{children:"Transfer Legs"}),Object.entries(a).map(([n,c])=>e.jsxs("div",{children:[e.jsx(S,{transferLegId:n,transferLeg:c}),c.sender===t&&e.jsx("button",{onClick:()=>l({party:t,allocationSpecification:{settlement:i,transferLegId:n,transferLeg:c}}),children:"Create Allocation"}),o?.get(n)?.map(u=>e.jsxs("div",{children:[e.jsx("span",{children:"Allocation Made"}),c.sender===t&&e.jsx("button",{onClick:()=>r({party:t,instrumentId:c.instrumentId,contractId:u.contractId}),children:"Withdraw Allocation"})]},u.contractId))]},n))]})},_=()=>{const t=b(),s=x()?.partyId,{data:o}=X(),{data:i}=T(),a=h.useCallback((n,c)=>JSON.stringify([n.settlementRef.id,n.settlementRef.cid,c]),[]),[l,r]=h.useMemo(()=>{const n=new Map,c=[];for(const u of o??[]){const{settlement:d,transferLegs:g}=u.interfaceViewValue;for(const j in g){const m=a(d,j);n.set(m,[])}}for(const u of i??[]){const{settlement:d,transferLegId:g}=u.interfaceViewValue.allocation,j=a(d,g);n.has(j)?n.get(j).push(u):(console.log(n),c.push(u))}return[n,c]},[o,i,a]);return h.useEffect(()=>{s&&(async()=>{const n=await t.listAllocationInstructions({party:s});console.log("allocationInstructions",n)})()},[t,s]),e.jsxs("div",{children:[e.jsx("h2",{children:"Allocation requests"}),s&&o?.map(n=>e.jsx("div",{children:e.jsx(Y,{party:s,allocationRequest:n.interfaceViewValue,allocationsByTransferLegId:new Map(Object.keys(n.interfaceViewValue.transferLegs).map(c=>[c,l.get(a(n.interfaceViewValue.settlement,c))??[]]))})},n.contractId)),e.jsx("h2",{children:"Unknown Allocations"}),s&&r?.map(n=>e.jsx("div",{children:e.jsx(z,{party:s,contractId:n.contractId,allocation:n.interfaceViewValue})},n.contractId))]})},G=({tabs:t,initialValue:s})=>{const o=s??t[0]?.value,[i,a]=h.useState(o),l=t.find(r=>r.value===i);return e.jsxs("div",{children:[e.jsx("div",{role:"tablist",className:"flex gap-2 border-b",children:t.map(r=>e.jsx("button",{role:"tab","aria-selected":i===r.value,className:`${i===r.value?"bg-blue-500":"opacity-60"}`,onClick:()=>a(r.value),children:i===r.value?`[${r.label}]`:r.label},r.value))}),e.jsx("div",{role:"tabpanel",children:l?.content})]})};function Z(){return e.jsxs(e.Fragment,{children:[e.jsx("h1",{children:"dApp Portfolio"}),e.jsx(K,{}),e.jsx(G,{tabs:[{label:"Holdings",value:"holdings",content:e.jsx(F,{})},{label:"Transfer",value:"twoStepTransfer",content:e.jsx($,{})},{label:"Pending Transfers",value:"pendingTransfers",content:e.jsx(W,{})},{label:"Transaction History",value:"transactionHistory",content:e.jsx(Q,{})},{label:"Allocations",value:"allocations",content:e.jsx(_,{})},{label:"Registry Settings",value:"registries",content:e.jsx(B,{})}]})]})}const oe=Z;export{oe as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as n,R as t}from"./index-
|
|
1
|
+
import{q as n,R as t}from"./index-DaIPIehr.js";const o=e=>{const{listPendingTransfers:s}=n();return{retry:10,queryKey:t.listPendingTransfers.forParty(e),queryFn:async()=>e?s({party:e}):[]}},u=e=>{const{listAllocationRequests:s}=n();return{queryKey:t.listAllocationRequests.forParty(e),queryFn:()=>s({party:e}),enabled:!!e}},i=e=>{const{listAllocations:s}=n();return{queryKey:t.listAllocations.forParty(e),queryFn:()=>s({party:e}),enabled:!!e}},l=e=>{const{isDevNet:s}=n();return{queryKey:t.isDevNet.forSession(e),queryFn:async()=>e?s({sessionToken:e}):!1,enabled:!!e,staleTime:1/0}};export{o as a,u as b,i as c,l as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as S,a as R,r as v,u as U,j as e,c as f,b as B,s as
|
|
1
|
+
import{g as S,a as R,r as v,u as U,j as e,c as f,b as B,s as P,P as C,d as A,e as L,f as M,h as N,t as g,T as p,B as x,i as j,k,D as $,I as z,o as D,l as W,m as y,n as F,p as V,q as H,v as q,F as E,w as Q,S as K,M as T,x as O,y as G}from"./index-DaIPIehr.js";import{C as J}from"./copyable-identifier-Ca2EKaNz.js";import{T as X,a as Y,b as Z,c as b,d as h,e as _}from"./TableRow-c-kQ4Wq1.js";import{u as ee}from"./query-options-DAhRNWw7.js";function te(r){return S("MuiCard",r)}R("MuiCard",["root"]);const se=r=>{const{classes:a}=r;return B({root:["root"]},te,a)},re=P(C,{name:"MuiCard",slot:"Root"})({overflow:"hidden"}),ne=v.forwardRef(function(a,l){const o=U({props:a,name:"MuiCard"}),{className:u,raised:t=!1,...n}=o,m={...o,raised:t},s=se(m);return e.jsx(re,{className:f(s.root,u),elevation:t?8:void 0,ref:l,ownerState:m,...n})});function ae(r){return S("MuiCardContent",r)}R("MuiCardContent",["root"]);const oe=r=>{const{classes:a}=r;return B({root:["root"]},ae,a)},ie=P("div",{name:"MuiCardContent",slot:"Root"})({padding:16,"&:last-child":{paddingBottom:24}}),le=v.forwardRef(function(a,l){const o=U({props:a,name:"MuiCardContent"}),{className:u,component:t="div",...n}=o,m={...o,component:t},s=oe(m);return e.jsx(ie,{as:t,className:f(s.root,u),ownerState:m,ref:l,...n})}),ce=A(e.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"})),ue=D({partyId:y().min(1,"Party ID is required"),registryUrl:W("Must be a valid URL")});function de(){const r=L(),a=M(),l=Array.from(a.entries()).map(([t,n])=>({partyId:t,registryUrl:n})),o=N({defaultValues:{partyId:"",registryUrl:""},onSubmit:async({value:t})=>{const n=t.partyId.trim()===""?void 0:t.partyId;r.setRegistryUrl(n,t.registryUrl),g.success("Registry URL set"),o.reset()},validators:{onChange:ue}}),u=t=>{r.deleteRegistryUrl(t),g.success("Registry URL deleted")};return e.jsx(ne,{sx:{mb:3},children:e.jsxs(le,{children:[e.jsx(p,{variant:"h6",component:"h2",gutterBottom:!0,children:"Registries"}),e.jsx(p,{variant:"body2",color:"text.secondary",sx:{mb:3},children:"The API URLs provided by the party managing the token standard compliant instruments"}),e.jsx(x,{sx:{mb:3},children:e.jsx("form",{onSubmit:t=>{t.preventDefault(),t.stopPropagation(),o.handleSubmit()},children:e.jsxs(x,{sx:{display:"flex",gap:2,mb:2},children:[e.jsx(o.Field,{name:"partyId",children:t=>e.jsx(j,{label:"Party ID",value:t.state.value,onChange:n=>t.handleChange(n.target.value),onBlur:t.handleBlur,error:t.state.meta.isTouched&&t.state.meta.errors.length>0,helperText:t.state.meta.isTouched&&t.state.meta.errors[0]?.message,fullWidth:!0,size:"small"})}),e.jsx(o.Field,{name:"registryUrl",children:t=>e.jsx(j,{label:"Registry URL",value:t.state.value,onChange:n=>t.handleChange(n.target.value),onBlur:t.handleBlur,error:t.state.meta.isTouched&&t.state.meta.errors.length>0,helperText:t.state.meta.isTouched&&t.state.meta.errors[0]?.message,fullWidth:!0,size:"small"})}),e.jsx(o.Subscribe,{selector:t=>({canSubmit:t.canSubmit,isSubmitting:t.isSubmitting}),children:({canSubmit:t,isSubmitting:n})=>e.jsx(k,{type:"submit",variant:"contained",disabled:!t||n,children:n?"Submitting...":"Add"})})]})})}),e.jsx($,{sx:{mb:3}}),e.jsx(X,{component:C,variant:"outlined",sx:{borderRadius:1},children:e.jsxs(Y,{size:"medium",children:[e.jsx(Z,{children:e.jsxs(b,{sx:{backgroundColor:"action.hover"},children:[e.jsx(h,{sx:{py:2,px:3,fontWeight:"medium"},children:"Party ID"}),e.jsx(h,{sx:{py:2,px:3,fontWeight:"medium"},children:"Registry URL"}),e.jsx(h,{sx:{py:2,px:3,fontWeight:"medium"},children:"Actions"})]})}),e.jsx(_,{children:l.length>0?l.map(t=>e.jsxs(b,{sx:{"&:hover":{backgroundColor:"action.hover"}},children:[e.jsx(h,{sx:{py:2.5,px:3},children:e.jsx(J,{value:t.partyId,maxLength:30})}),e.jsx(h,{sx:{py:2.5,px:3},children:t.registryUrl}),e.jsx(h,{sx:{py:2.5,px:3},children:e.jsx(x,{sx:{display:"flex",gap:1},children:e.jsx(z,{size:"small",onClick:()=>u(t.partyId),color:"error",children:e.jsx(ce,{fontSize:"small"})})})})]},t.partyId)):e.jsx(b,{children:e.jsx(h,{colSpan:3,sx:{py:4,px:3},children:e.jsx(x,{sx:{textAlign:"center"},children:e.jsx(p,{variant:"body1",color:"text.secondary",children:"No registries configured"})})})})})]})})]})})}const me=D({admin:y(),id:y()}).nullable().refine(r=>r!==null,"Please select an instrument"),he=()=>{const r=F().status?.session?.accessToken,a=V()?.partyId,{tap:l}=H(),o=M(),u=q(),t=v.useMemo(()=>{const s=[];for(const[i,c]of u)for(const d of c)s.push({instrumentId:{admin:i,id:d.id},symbol:d.symbol});return s.sort((i,c)=>i.symbol.localeCompare(c.symbol))},[u]),n=N({defaultValues:{instrumentId:null,amount:"10000"},onSubmit:async({value:s})=>{if(!(!r||!a||!s.instrumentId))try{await l({registryUrls:o,party:a,sessionToken:r,instrumentId:s.instrumentId,amount:Number(s.amount)}),g.success("Tap successful")}catch(i){g.error(`Tap failed: ${i instanceof Error?i.message:"Unknown error"}`)}}}),m=y().min(1,"Amount is required").refine(s=>{const i=Number(s);return!isNaN(i)&&i>0},"Amount must be a positive number");return e.jsxs(C,{elevation:1,sx:{p:3,mt:4},children:[e.jsx(p,{variant:"h5",component:"h2",gutterBottom:!0,children:"DevNet Tap"}),e.jsx(p,{variant:"body2",color:"text.secondary",sx:{mb:3},children:"For testing purposes (DevNet only)"}),e.jsx("form",{onSubmit:s=>{s.preventDefault(),s.stopPropagation(),n.handleSubmit()},children:e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:3},children:[e.jsx(n.Field,{name:"instrumentId",validators:{onChange:me},children:s=>{const i=s.state.value?`${s.state.value.admin}::${s.state.value.id}`:"";return e.jsxs(E,{fullWidth:!0,error:s.state.meta.isTouched&&s.state.meta.errors.length>0,children:[e.jsx(Q,{id:"tap-instrument-label",children:"Instrument"}),e.jsxs(K,{labelId:"tap-instrument-label",value:i,onChange:c=>{const d=c.target.value;if(!d){s.handleChange(null);return}const w=t.find(I=>`${I.instrumentId.admin}::${I.instrumentId.id}`===d);s.handleChange(w?.instrumentId??null)},label:"Instrument",children:[e.jsx(T,{value:"",children:e.jsx("em",{children:"Select an instrument..."})}),t.map(c=>{const d=`${c.instrumentId.admin}::${c.instrumentId.id}`;return e.jsx(T,{value:d,children:c.symbol},d)})]}),s.state.meta.isTouched&&s.state.meta.errors.length>0&&e.jsx(O,{children:s.state.meta.errors[0]?.message})]})}}),e.jsx(n.Field,{name:"amount",validators:{onChange:m},children:s=>e.jsx(j,{label:"Amount",type:"number",value:s.state.value,onChange:i=>s.handleChange(i.target.value),onBlur:s.handleBlur,error:s.state.meta.isTouched&&s.state.meta.errors.length>0,helperText:s.state.meta.isTouched&&s.state.meta.errors.length>0?s.state.meta.errors[0]?.message:"",fullWidth:!0})}),e.jsx(n.Subscribe,{selector:s=>({canSubmit:s.canSubmit}),children:({canSubmit:s})=>e.jsx(k,{type:"submit",disabled:!s||!r||!a,variant:"contained",sx:{width:200},children:"TAP"})})]})})]})},xe=()=>{const r=F().status?.session?.accessToken;return G(ee(r))};function pe(){const{data:r}=xe();return e.jsxs(x,{sx:{mt:4},children:[e.jsx(p,{variant:"h4",component:"h1",gutterBottom:!0,children:"Settings"}),e.jsx(de,{}),r&&e.jsx(he,{})]})}const ve=pe;export{ve as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Q as v,ae as P,af as l,ag as b,E as x,p as d,q as m,r as N,ah as g,R}from"./index-
|
|
1
|
+
import{Q as v,ae as P,af as l,ag as b,E as x,p as d,q as m,r as N,ah as g,R}from"./index-DaIPIehr.js";var E=class extends v{constructor(e,r){super(e,r)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:P()})}getOptimisticResult(e){return e.behavior=P(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,r){const{state:t}=e,a=super.createResult(e,r),{isFetching:i,isRefetching:s,isError:o,isRefetchError:p}=a,n=t.fetchMeta?.fetchMore?.direction,c=o&&n==="forward",u=i&&n==="forward",h=o&&n==="backward",f=i&&n==="backward";return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(r,t.data),hasPreviousPage:l(r,t.data),isFetchNextPageError:c,isFetchingNextPage:u,isFetchPreviousPageError:h,isFetchingPreviousPage:f,isRefetchError:p&&!c&&!h,isRefetching:s&&!u&&!f}}};function F(e,r){return x(e,E)}const y=e=>{const{getTransactionHistory:r}=m();return F({initialPageParam:null,queryKey:R.getTransactionHistory.forParty(e),queryFn:({pageParam:t})=>e?r({party:e,request:t}):g,getNextPageParam:t=>{if(t!==g&&!t.beginIsLedgerStart)return{endInclusive:t.beginExclusive}},staleTime:1/0})},H=()=>{const e=d()?.partyId;return y(e)},T=e=>{const{data:r}=y(e);return N.useMemo(()=>{const t=new Set,a=[];for(const i of r?.pages??[])for(const s of i?.transactions??[])t.has(s.offset)||(t.add(s.offset),s.events.length>0&&a.push(s));return a},[r])},O=()=>{const e=d()?.partyId;return T(e)};export{O as a,y as b,T as c,H as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as o,f as n,N as i,O as l,R as c}from"./index-
|
|
1
|
+
import{q as o,f as n,N as i,O as l,R as c}from"./index-DaIPIehr.js";const y=()=>{const{createAllocation:s}=o(),a=n(),e=i();return l({mutationFn:t=>s({registryUrls:a,...t}),onSuccess:async(t,r)=>{await e.invalidateQueries({queryKey:c.listAllocations.forParty(r.party)})}})},q=()=>{const{withdrawAllocation:s}=o(),a=n(),e=i();return l({mutationFn:async t=>s({registryUrls:a,...t}),onSuccess:async(t,r)=>{await e.invalidateQueries({queryKey:c.listAllocations.forParty(r.party)})}})};export{q as a,y as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as tt,a as et,r as h,u as nt,a1 as Wt,a2 as Et,a3 as Mt,a4 as zt,a5 as $t,H as I,c as Q,j as e,b as ot,s as R,K as U,a6 as ut,a7 as Dt,P as _,a8 as Ht,d as ct,v as Nt,y as Lt,a9 as Ft,aa as Bt,ab as Gt,R as Ut,A as Ot,B as u,T as b,k as ft,ac as Vt,a0 as qt,$ as Kt,ad as Qt}from"./index-DaIPIehr.js";import{b as Jt,c as Xt}from"./useTransactionHistory-CMGwF8RV.js";import{C as lt}from"./copyable-identifier-Ca2EKaNz.js";import{A as Yt,S as G}from"./Avatar-Cvc50mRz.js";import{T as xt,a as mt,b as ht,c as X,d as l,e as gt}from"./TableRow-c-kQ4Wq1.js";function Zt(t){return tt("MuiCollapse",t)}et("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const _t=t=>{const{orientation:n,classes:o}=t;return ot({root:["root",n],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",n],wrapperInner:["wrapperInner",n]},Zt,o)},te=R("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,n)=>{const{ownerState:o}=t;return[n.root,n[o.orientation],o.state==="entered"&&n.entered,o.state==="exited"&&!o.in&&o.collapsedSize==="0px"&&n.hidden]}})(U(({theme:t})=>({height:0,overflow:"hidden",transition:t.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:t.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:n})=>n.state==="exited"&&!n.in&&n.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),ee=R("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),ne=R("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),at=h.forwardRef(function(n,o){const s=nt({props:n,name:"MuiCollapse"}),{addEndListener:i,children:c,className:d,collapsedSize:a="0px",component:g,easing:C,in:x,onEnter:j,onEntered:f,onEntering:A,onExit:p,onExited:P,onExiting:y,orientation:T="vertical",slots:k={},slotProps:W={},style:N,timeout:v=Wt.standard,TransitionComponent:E=Et,...L}=s,M={...s,orientation:T,collapsedSize:a},z=_t(M),m=Mt(),O=zt(),$=h.useRef(null),J=h.useRef(),V=typeof a=="number"?`${a}px`:a,F=T==="horizontal",B=F?"width":"height",q=h.useRef(null),st=$t(o,q),H=r=>w=>{if(r){const S=q.current;w===void 0?r(S):r(S,w)}},rt=()=>$.current?$.current[F?"clientWidth":"clientHeight"]:0,bt=H((r,w)=>{$.current&&F&&($.current.style.position="absolute"),r.style[B]=V,j&&j(r,w)}),jt=H((r,w)=>{const S=rt();$.current&&F&&($.current.style.position="");const{duration:D,easing:Y}=ut({style:N,timeout:v,easing:C},{mode:"enter"});if(v==="auto"){const pt=m.transitions.getAutoHeightDuration(S);r.style.transitionDuration=`${pt}ms`,J.current=pt}else r.style.transitionDuration=typeof D=="string"?D:`${D}ms`;r.style[B]=`${S}px`,r.style.transitionTimingFunction=Y,A&&A(r,w)}),vt=H((r,w)=>{r.style[B]="auto",f&&f(r,w)}),wt=H(r=>{r.style[B]=`${rt()}px`,p&&p(r)}),St=H(P),Ct=H(r=>{const w=rt(),{duration:S,easing:D}=ut({style:N,timeout:v,easing:C},{mode:"exit"});if(v==="auto"){const Y=m.transitions.getAutoHeightDuration(w);r.style.transitionDuration=`${Y}ms`,J.current=Y}else r.style.transitionDuration=typeof S=="string"?S:`${S}ms`;r.style[B]=V,r.style.transitionTimingFunction=D,y&&y(r)}),At=r=>{v==="auto"&&O.start(J.current||0,r),i&&i(q.current,r)},it={slots:k,slotProps:W,component:g},[Tt,dt]=I("root",{ref:st,className:Q(z.root,d),elementType:te,externalForwardedProps:it,ownerState:M,additionalProps:{style:{[F?"minWidth":"minHeight"]:V,...N}}}),[It,Rt]=I("wrapper",{ref:$,className:z.wrapper,elementType:ee,externalForwardedProps:it,ownerState:M}),[Pt,kt]=I("wrapperInner",{className:z.wrapperInner,elementType:ne,externalForwardedProps:it,ownerState:M});return e.jsx(E,{in:x,onEnter:bt,onEntered:vt,onEntering:jt,onExit:wt,onExited:St,onExiting:Ct,addEndListener:At,nodeRef:q,timeout:v==="auto"?null:v,...L,children:(r,{ownerState:w,...S})=>{const D={...M,state:r};return e.jsx(Tt,{...dt,className:Q(dt.className,{entered:z.entered,exited:!x&&V==="0px"&&z.hidden}[r]),ownerState:D,...S,children:e.jsx(It,{...Rt,ownerState:D,children:e.jsx(Pt,{...kt,ownerState:D,children:c})})})}})});at&&(at.muiSupportAuto=!0);const yt=h.createContext({});function oe(t){return tt("MuiAccordion",t)}const Z=et("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),se=t=>{const{classes:n,square:o,expanded:s,disabled:i,disableGutters:c}=t;return ot({root:["root",!o&&"rounded",s&&"expanded",i&&"disabled",!c&&"gutters"],heading:["heading"],region:["region"]},oe,n)},re=R(_,{name:"MuiAccordion",slot:"Root",overridesResolver:(t,n)=>{const{ownerState:o}=t;return[{[`& .${Z.region}`]:n.region},n.root,!o.square&&n.rounded,!o.disableGutters&&n.gutters]}})(U(({theme:t})=>{const n={duration:t.transitions.duration.shortest};return{position:"relative",transition:t.transitions.create(["margin"],n),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(t.vars||t).palette.divider,transition:t.transitions.create(["opacity","background-color"],n)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${Z.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${Z.disabled}`]:{backgroundColor:(t.vars||t).palette.action.disabledBackground}}}),U(({theme:t})=>({variants:[{props:n=>!n.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(t.vars||t).shape.borderRadius,borderBottomRightRadius:(t.vars||t).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:n=>!n.disableGutters,style:{[`&.${Z.expanded}`]:{margin:"16px 0"}}}]}))),ie=R("h3",{name:"MuiAccordion",slot:"Heading"})({all:"unset"}),ae=R("div",{name:"MuiAccordion",slot:"Region"})({}),ce=h.forwardRef(function(n,o){const s=nt({props:n,name:"MuiAccordion"}),{children:i,className:c,defaultExpanded:d=!1,disabled:a=!1,disableGutters:g=!1,expanded:C,onChange:x,slots:j={},slotProps:f={},TransitionComponent:A,TransitionProps:p,...P}=s,[y,T]=Dt({controlled:C,default:d,name:"Accordion",state:"expanded"}),k=h.useCallback(H=>{T(!y),x&&x(H,!y)},[y,x,T]),[W,...N]=h.Children.toArray(i),v=h.useMemo(()=>({expanded:y,disabled:a,disableGutters:g,toggle:k}),[y,a,g,k]),E={...s,disabled:a,disableGutters:g,expanded:y},L=se(E),M={transition:A,...j},z={transition:p,...f},m={slots:M,slotProps:z},[O,$]=I("root",{elementType:re,externalForwardedProps:{...m,...P},className:Q(L.root,c),shouldForwardComponentProp:!0,ownerState:E,ref:o}),[J,V]=I("heading",{elementType:ie,externalForwardedProps:m,className:L.heading,ownerState:E}),[F,B]=I("transition",{elementType:at,externalForwardedProps:m,ownerState:E}),[q,st]=I("region",{elementType:ae,externalForwardedProps:m,ownerState:E,className:L.region,additionalProps:{"aria-labelledby":W.props.id,id:W.props["aria-controls"],role:"region"}});return e.jsxs(O,{...$,children:[e.jsx(J,{...V,children:e.jsx(yt.Provider,{value:v,children:W})}),e.jsx(F,{in:y,timeout:"auto",...B,children:e.jsx(q,{...st,children:N})})]})});function le(t){return tt("MuiAccordionDetails",t)}et("MuiAccordionDetails",["root"]);const de=t=>{const{classes:n}=t;return ot({root:["root"]},le,n)},pe=R("div",{name:"MuiAccordionDetails",slot:"Root"})(U(({theme:t})=>({padding:t.spacing(1,2,2)}))),ue=h.forwardRef(function(n,o){const s=nt({props:n,name:"MuiAccordionDetails"}),{className:i,...c}=s,d=s,a=de(d);return e.jsx(pe,{className:Q(a.root,i),ref:o,ownerState:d,...c})});function xe(t){return tt("MuiAccordionSummary",t)}const K=et("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),me=t=>{const{classes:n,expanded:o,disabled:s,disableGutters:i}=t;return ot({root:["root",o&&"expanded",s&&"disabled",!i&&"gutters"],focusVisible:["focusVisible"],content:["content",o&&"expanded",!i&&"contentGutters"],expandIconWrapper:["expandIconWrapper",o&&"expanded"]},xe,n)},he=R(Ht,{name:"MuiAccordionSummary",slot:"Root"})(U(({theme:t})=>{const n={duration:t.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:t.spacing(0,2),transition:t.transitions.create(["min-height","background-color"],n),[`&.${K.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${K.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`&:hover:not(.${K.disabled})`]:{cursor:"pointer"},variants:[{props:o=>!o.disableGutters,style:{[`&.${K.expanded}`]:{minHeight:64}}}]}})),ge=R("span",{name:"MuiAccordionSummary",slot:"Content"})(U(({theme:t})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:n=>!n.disableGutters,style:{transition:t.transitions.create(["margin"],{duration:t.transitions.duration.shortest}),[`&.${K.expanded}`]:{margin:"20px 0"}}}]}))),fe=R("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper"})(U(({theme:t})=>({display:"flex",color:(t.vars||t).palette.action.active,transform:"rotate(0deg)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest}),[`&.${K.expanded}`]:{transform:"rotate(180deg)"}}))),ye=h.forwardRef(function(n,o){const s=nt({props:n,name:"MuiAccordionSummary"}),{children:i,className:c,expandIcon:d,focusVisibleClassName:a,onClick:g,slots:C,slotProps:x,...j}=s,{disabled:f=!1,disableGutters:A,expanded:p,toggle:P}=h.useContext(yt),y=m=>{P&&P(m),g&&g(m)},T={...s,expanded:p,disabled:f,disableGutters:A},k=me(T),W={slots:C,slotProps:x},[N,v]=I("root",{ref:o,shouldForwardComponentProp:!0,className:Q(k.root,c),elementType:he,externalForwardedProps:{...W,...j},ownerState:T,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:f,"aria-expanded":p,focusVisibleClassName:Q(k.focusVisible,a)},getSlotProps:m=>({...m,onClick:O=>{m.onClick?.(O),y(O)}})}),[E,L]=I("content",{className:k.content,elementType:ge,externalForwardedProps:W,ownerState:T}),[M,z]=I("expandIconWrapper",{className:k.expandIconWrapper,elementType:fe,externalForwardedProps:W,ownerState:T});return e.jsxs(N,{...v,children:[e.jsx(E,{...L,children:i}),d&&e.jsx(M,{...z,children:d})]})}),be=ct(e.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"})),je=t=>{const n=Nt(),o=Lt({queryKey:Ut.listHoldings.forParty(t),queryFn:()=>Gt({party:t}),enabled:!!t});return{instruments:h.useMemo(()=>o.data?Ft(Bt(o.data),n):[],[o.data,n]),holdings:o.data??[],isLoading:o.isLoading,isError:o.isError,error:o.error,refetch:o.refetch}},ve=ct(e.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),we=ct(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Se=({holding:t,symbol:n})=>{const o=Ot.isHoldingLocked(t,new Date);return e.jsxs(u,{sx:{py:1.5,px:2,display:"flex",alignItems:"center",justifyContent:"space-between","&:not(:last-child)":{borderBottom:s=>`1px solid ${s.palette.divider}`}},children:[e.jsxs(u,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsxs(b,{variant:"body2",children:[t.amount," ",n]}),o&&e.jsx(we,{fontSize:"small",color:"warning",sx:{fontSize:16}})]}),e.jsx(lt,{value:t.contractId,maxLength:12})]})},Ce=({aggregatedHolding:t,holdings:n})=>{const o=t.instrument?.symbol??t.instrumentId.id,s=t.instrument?.name??t.instrumentId.id,i=t.lockedAmount!=="0";return e.jsxs(ce,{disableGutters:!0,sx:{"&:before":{display:"none"},boxShadow:"none","&:not(:last-child)":{borderBottom:c=>`1px solid ${c.palette.divider}`}},children:[e.jsx(ye,{expandIcon:e.jsx(ve,{}),sx:{"&:hover":{backgroundColor:"action.hover"}},children:e.jsxs(u,{sx:{display:"flex",alignItems:"center",gap:2,width:"100%",pr:2},children:[e.jsx(Yt,{sx:{width:32,height:32,fontSize:14},children:o[0]}),e.jsxs(u,{sx:{flexGrow:1},children:[e.jsx(b,{variant:"body2",color:"textSecondary",sx:{maxWidth:"150px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}),e.jsxs(b,{variant:"body1",fontWeight:"bold",children:[t.totalAmount," ",o]})]}),i&&e.jsxs(u,{sx:{textAlign:"right"},children:[e.jsxs(b,{variant:"body2",color:"success.main",children:[t.availableAmount," available"]}),e.jsxs(b,{variant:"body2",color:"textSecondary",children:[t.lockedAmount," locked"]})]})]})}),e.jsxs(ue,{sx:{p:0,pl:6},children:[e.jsxs(b,{variant:"caption",color:"textSecondary",sx:{px:2,pt:1,display:"block",textTransform:"uppercase",letterSpacing:.5},children:[t.numOfHoldings," holding",t.numOfHoldings!==1?"s":""]}),e.jsx(u,{children:n.map(c=>e.jsx(Se,{holding:c,symbol:o},c.contractId))})]})]})},Ae=t=>new Date(t).toLocaleString(),Te=t=>{const n=t.events[0];return n?n.label.type:"Unknown"},Ie=t=>{const n=t.events[0];if(!n)return"-";if(n.transferInstruction?.transfer?.instrumentId){const{admin:s,id:i}=n.transferInstruction.transfer.instrumentId;return i||s}const o=n.unlockedHoldingsChangeSummaries[0]||n.lockedHoldingsChangeSummaries[0];return o?.instrumentId?o.instrumentId.id||o.instrumentId.admin:"-"},Re=(t,n)=>{const o=t.events[0];if(!o)return{amount:"-",isOutgoing:!1};if(o.transferInstruction?.transfer){const i=o.transferInstruction.transfer,c=i.amount||"0",d=i.sender===n;return{amount:c,isOutgoing:d}}const s=o.unlockedHoldingsChangeSummaries[0]||o.lockedHoldingsChangeSummaries[0];if(s){const i=s.amountChange||"0",d=new Vt(i).isNegative();return{amount:i,isOutgoing:d}}return{amount:"-",isOutgoing:!1}},Pe=(t,n)=>{const o=t.events[0];if(!o)return"-";if(o.transferInstruction?.transfer){const s=o.transferInstruction.transfer;if(s.sender===n)return s.receiver||"-";if(s.receiver===n)return s.sender||"-"}return"-"},ke=({transactions:t,walletId:n,hasNextPage:o,isFetching:s,isFetchingNextPage:i,onLoadMore:c})=>{const d=t.length>0;return console.log("transactions",t),s&&!d?e.jsx(xt,{component:_,variant:"outlined",sx:{borderRadius:1,overflow:"hidden"},children:e.jsxs(mt,{size:"medium",children:[e.jsx(ht,{children:e.jsxs(X,{sx:{backgroundColor:"action.hover"},children:[e.jsx(l,{sx:{py:2,px:3,fontWeight:"medium"},children:"Type"}),e.jsx(l,{sx:{py:2,px:3,fontWeight:"medium"},children:"Date"}),e.jsx(l,{sx:{py:2,px:3,fontWeight:"medium"},children:"Asset"}),e.jsx(l,{sx:{py:2,px:3,fontWeight:"medium"},children:"Amount"}),e.jsx(l,{sx:{py:2,px:3,fontWeight:"medium"},children:"Counterparty"})]})}),e.jsx(gt,{children:[1,2,3].map(a=>e.jsxs(X,{children:[e.jsx(l,{sx:{py:2.5,px:3},children:e.jsx(G,{variant:"text",width:80})}),e.jsx(l,{sx:{py:2.5,px:3},children:e.jsx(G,{variant:"text",width:120})}),e.jsx(l,{sx:{py:2.5,px:3},children:e.jsx(G,{variant:"text",width:60})}),e.jsx(l,{sx:{py:2.5,px:3},children:e.jsx(G,{variant:"text",width:80})}),e.jsx(l,{sx:{py:2.5,px:3},children:e.jsx(G,{variant:"text",width:150})})]},a))})]})}):e.jsxs(u,{children:[e.jsx(xt,{component:_,variant:"outlined",sx:{borderRadius:1,overflow:"hidden"},children:e.jsxs(mt,{size:"medium",children:[e.jsx(ht,{children:e.jsxs(X,{sx:{backgroundColor:"action.hover"},children:[e.jsx(l,{sx:{py:2,px:3,fontWeight:"medium"},children:"Type"}),e.jsx(l,{sx:{py:2,px:3,fontWeight:"medium"},children:"Date"}),e.jsx(l,{sx:{py:2,px:3,fontWeight:"medium"},children:"Asset"}),e.jsx(l,{sx:{py:2,px:3,fontWeight:"medium"},children:"Amount"}),e.jsx(l,{sx:{py:2,px:3,fontWeight:"medium"},children:"Counterparty"})]})}),e.jsx(gt,{children:d?t.map(a=>{const g=Te(a),C=Ie(a),{amount:x,isOutgoing:j}=Re(a,n),f=Pe(a,n),A=j?"-":"+",p=j?"error.main":"success.main";return e.jsxs(X,{sx:{"&:hover":{backgroundColor:"action.hover"},"&:last-child td":{border:0}},children:[e.jsx(l,{component:"th",scope:"row",sx:{py:2.5,px:3},children:g}),e.jsx(l,{sx:{py:2.5,px:3},children:Ae(a.recordTime)}),e.jsx(l,{sx:{py:2.5,px:3},children:e.jsx(u,{component:"span",sx:{px:1.5,py:.5,backgroundColor:"action.selected",color:"text.primary",borderRadius:1,fontSize:"0.875rem",display:"inline-block"},children:C})}),e.jsx(l,{sx:{py:2.5,px:3,color:p,fontWeight:"medium"},children:x==="-"?"-":`${A}${x}`}),e.jsx(l,{sx:{py:2.5,px:3},children:f==="-"?"-":e.jsx(lt,{value:f})})]},a.updateId)}):e.jsx(X,{children:e.jsx(l,{colSpan:5,sx:{py:4,px:3},children:e.jsx(u,{sx:{textAlign:"center"},children:e.jsx(b,{variant:"body1",color:"text.secondary",children:"There are currently no transactions in this wallet"})})})})})]})}),o&&e.jsx(u,{sx:{mt:2,textAlign:"center"},children:e.jsx(ft,{variant:"outlined",onClick:c,disabled:i,size:"small",children:i?"Loading...":"Load more"})})]})},We=Qt("/wallet/$walletId");function Ee(){const{walletId:t}=We.useParams(),s=qt().find(p=>p.partyId===t)?.hint??"Unknown Wallet",{instruments:i,holdings:c,isLoading:d,isError:a}=je(t),{status:g,fetchNextPage:C,isFetchingNextPage:x,hasNextPage:j}=Jt(t),f=Xt(t),A=p=>c.filter(P=>P.instrumentId.admin===p.admin&&P.instrumentId.id===p.id);return e.jsxs(u,{sx:{my:4},children:[e.jsx(ft,{component:Kt,to:"/",startIcon:e.jsx(be,{}),sx:{mb:2},children:"Back to Dashboard"}),e.jsxs(u,{sx:{mb:4},children:[e.jsx(b,{variant:"h4",component:"h1",fontWeight:"bold",children:s}),e.jsx(u,{sx:{mt:1},children:e.jsx(lt,{value:t,maxLength:16})})]}),e.jsx(b,{variant:"h6",sx:{mb:2,textTransform:"uppercase"},fontWeight:"bold",children:"Holdings"}),e.jsx(_,{variant:"outlined",children:d?e.jsxs(u,{sx:{p:2},children:[e.jsx(G,{variant:"rectangular",height:60}),e.jsx(G,{variant:"rectangular",height:60,sx:{mt:1}})]}):a?e.jsx(u,{sx:{p:4,textAlign:"center"},children:e.jsx(b,{color:"error",children:"Failed to load holdings"})}):i.length===0?e.jsx(u,{sx:{p:4,textAlign:"center"},children:e.jsx(b,{color:"textSecondary",children:"No holdings in this wallet"})}):i.map(p=>e.jsx(Ce,{aggregatedHolding:p,holdings:A(p.instrumentId)},`${p.instrumentId.admin}::${p.instrumentId.id}`))}),e.jsx(b,{variant:"h6",sx:{mb:2,mt:4,textTransform:"uppercase"},fontWeight:"bold",children:"Transaction History"}),e.jsx(ke,{transactions:f,walletId:t,hasNextPage:j,isFetching:g==="pending",isFetchingNextPage:x,onLoadMore:C})]})}const Ne=Ee;export{Ne as component};
|
package/dist/index.html
CHANGED
|
@@ -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>dApp Portfolio</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-DaIPIehr.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-rFWAfy-Q.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="app"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canton-network/example-portfolio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
@@ -10,56 +10,57 @@
|
|
|
10
10
|
"otc-trade": "tsx ./scripts/otc-trade.ts"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@canton-network/core-amulet-service": "^0.
|
|
14
|
-
"@canton-network/core-ledger-client": "^0.
|
|
15
|
-
"@canton-network/core-
|
|
16
|
-
"@canton-network/core-
|
|
17
|
-
"@canton-network/core-token-standard
|
|
18
|
-
"@canton-network/core-
|
|
19
|
-
"@canton-network/core-
|
|
20
|
-
"@canton-network/
|
|
13
|
+
"@canton-network/core-amulet-service": "^0.3.0",
|
|
14
|
+
"@canton-network/core-ledger-client": "^0.30.0",
|
|
15
|
+
"@canton-network/core-provider-ledger": "^0.4.0",
|
|
16
|
+
"@canton-network/core-splice-client": "^0.24.0",
|
|
17
|
+
"@canton-network/core-token-standard": "^0.22.0",
|
|
18
|
+
"@canton-network/core-token-standard-service": "^0.3.0",
|
|
19
|
+
"@canton-network/core-tx-parser": "^0.3.0",
|
|
20
|
+
"@canton-network/core-types": "^0.21.0",
|
|
21
|
+
"@canton-network/dapp-sdk": "^0.23.0",
|
|
21
22
|
"@emotion/react": "^11.14.0",
|
|
22
23
|
"@emotion/styled": "^11.14.1",
|
|
23
|
-
"@mui/icons-material": "^7.3.
|
|
24
|
-
"@mui/material": "^7.3.
|
|
25
|
-
"@mui/system": "^7.3.
|
|
26
|
-
"@mui/x-date-pickers": "^8.
|
|
27
|
-
"@tanstack/devtools-vite": "^0.
|
|
28
|
-
"@tanstack/react-devtools": "^0.9.
|
|
29
|
-
"@tanstack/react-form": "^1.
|
|
30
|
-
"@tanstack/react-query": "^5.90.
|
|
31
|
-
"@tanstack/react-query-devtools": "^5.91.
|
|
32
|
-
"@tanstack/react-router": "^1.
|
|
33
|
-
"@tanstack/react-router-devtools": "^1.
|
|
34
|
-
"@tanstack/router-core": "^1.
|
|
35
|
-
"@tanstack/router-plugin": "^1.
|
|
24
|
+
"@mui/icons-material": "^7.3.8",
|
|
25
|
+
"@mui/material": "^7.3.8",
|
|
26
|
+
"@mui/system": "^7.3.8",
|
|
27
|
+
"@mui/x-date-pickers": "^8.27.2",
|
|
28
|
+
"@tanstack/devtools-vite": "^0.5.2",
|
|
29
|
+
"@tanstack/react-devtools": "^0.9.6",
|
|
30
|
+
"@tanstack/react-form": "^1.28.3",
|
|
31
|
+
"@tanstack/react-query": "^5.90.21",
|
|
32
|
+
"@tanstack/react-query-devtools": "^5.91.3",
|
|
33
|
+
"@tanstack/react-router": "^1.163.3",
|
|
34
|
+
"@tanstack/react-router-devtools": "^1.163.3",
|
|
35
|
+
"@tanstack/router-core": "^1.163.3",
|
|
36
|
+
"@tanstack/router-plugin": "^1.164.0",
|
|
36
37
|
"date-fns": "^4.1.0",
|
|
37
38
|
"decimal.js": "^10.6.0",
|
|
38
|
-
"pino": "^10.
|
|
39
|
-
"react": "^19.2.
|
|
40
|
-
"react-dom": "^19.2.
|
|
39
|
+
"pino": "^10.3.1",
|
|
40
|
+
"react": "^19.2.4",
|
|
41
|
+
"react-dom": "^19.2.4",
|
|
41
42
|
"sonner": "^2.0.7",
|
|
42
43
|
"uuid": "^11.1.0",
|
|
43
|
-
"zod": "^4.3.
|
|
44
|
+
"zod": "^4.3.6"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"@canton-network/core-wallet-test-utils": "^0.
|
|
47
|
+
"@canton-network/core-wallet-test-utils": "^0.6.0",
|
|
47
48
|
"@canton-network/wallet-sdk": "^0.21.0",
|
|
48
|
-
"@eslint/js": "^
|
|
49
|
-
"@inquirer/prompts": "^8.
|
|
50
|
-
"@playwright/test": "^1.
|
|
51
|
-
"@types/node": "^25.
|
|
52
|
-
"@types/react": "^19.2.
|
|
49
|
+
"@eslint/js": "^10.0.1",
|
|
50
|
+
"@inquirer/prompts": "^8.3.0",
|
|
51
|
+
"@playwright/test": "^1.58.2",
|
|
52
|
+
"@types/node": "^25.3.3",
|
|
53
|
+
"@types/react": "^19.2.14",
|
|
53
54
|
"@types/react-dom": "^19.2.3",
|
|
54
|
-
"@vitejs/plugin-react": "^5.1.
|
|
55
|
-
"eslint": "^
|
|
55
|
+
"@vitejs/plugin-react": "^5.1.4",
|
|
56
|
+
"eslint": "^10.0.2",
|
|
56
57
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
57
|
-
"eslint-plugin-react-refresh": "^0.
|
|
58
|
-
"globals": "^17.
|
|
59
|
-
"nx": "^22.
|
|
58
|
+
"eslint-plugin-react-refresh": "^0.5.2",
|
|
59
|
+
"globals": "^17.4.0",
|
|
60
|
+
"nx": "^22.5.3",
|
|
60
61
|
"tsx": "^4.21.0",
|
|
61
62
|
"typescript": "~5.9.3",
|
|
62
|
-
"typescript-eslint": "^8.
|
|
63
|
+
"typescript-eslint": "^8.56.1",
|
|
63
64
|
"vite": "^7.3.1"
|
|
64
65
|
},
|
|
65
66
|
"files": [
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
body{@apply m-0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}#root{max-width:1280px;display:flex;flex-direction:column;height:100%;margin:0 auto;padding:2rem;text-align:center}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media(prefers-reduced-motion:no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.card{padding:2em}.read-the-docs{color:#888}.error{color:#f08080}
|