+
Note
-
This is an unknown treasury. You can save it by editing its info.
+
+ This is an unknown treasury. You can
save it by editing its info.
+
)
@@ -519,7 +529,7 @@ const DeleteTreasuryButton: NextPage<{
db
.treasuries
.delete(encodeCardanoData(script, 'base64'))
- .then(() => router.push('/treasuries/new'))
+ .then(() => router.push(getTreasuriesPath('new')))
}
return (
@@ -562,7 +572,7 @@ const NativeScriptViewer: NextPage<{
{toHex(keyHash)}
{signature && }
- {hex && }
+ {hex && hex} ms={500}>}
)
})}
@@ -724,7 +734,7 @@ const SaveTreasuryButton: NextPage<{
db
.treasuries
.put({ name, description, script: base64CBOR, updatedAt: new Date() }, base64CBOR)
- .then(() => router.push(`/treasuries/${encodeURIComponent(base64CBOR)}`))
+ .then(() => router.push(getTreasuryPath(script)))
.catch(() => notify('error', 'Failed to save'))
}
@@ -804,14 +814,14 @@ const CopyVkeysButton: NextPage<{
className?: string
vkeys: Vkeywitness[]
}> = ({ cardano, className, children, vkeys }) => {
- const content = cardano.buildSignatureSetHex(vkeys)
return (
-
+ cardano.buildSignatureSetHex(vkeys)}
+ disabled={vkeys.length <= 0}
+ ms={500}
+ className={className}>
{children}
-
+
)
}
diff --git a/src/pages/transactions/[base64CBOR].tsx b/src/pages/transactions/[base64CBOR].tsx
index a9c310b6..d6f98340 100644
--- a/src/pages/transactions/[base64CBOR].tsx
+++ b/src/pages/transactions/[base64CBOR].tsx
@@ -1,13 +1,13 @@
import type { NextPage } from 'next'
import { useRouter } from 'next/router'
-import { Layout, Panel } from '../../components/layout'
+import { Hero, Layout, Panel, ShareCurrentURLButton } from '../../components/layout'
import { toHex, toIter, verifySignature } from '../../cardano/serialization-lib'
import { getResult, useCardanoSerializationLib } from '../../cardano/serialization-lib'
import { ErrorMessage, Loading } from '../../components/status'
import { CopyVkeysButton, NativeScriptViewer, SignatureSync, SignTxButton, SubmitTxButton, TransactionBodyViewer } from '../../components/transaction'
import type { Vkeywitness } from '@adaocommunity/cardano-serialization-lib-browser'
import { useContext, useState } from 'react'
-import { PencilAltIcon } from '@heroicons/react/solid'
+import { ShareIcon, UploadIcon } from '@heroicons/react/solid'
import { ConfigContext } from '../../cardano/config'
const ManualSign: NextPage<{
@@ -28,15 +28,15 @@ const ManualSign: NextPage<{
rows={4}
value={signature}
onChange={(e) => setSignature(e.target.value)}
- placeholder="Signature">
+ placeholder="Input signature here and import">
@@ -107,6 +107,17 @@ const GetTransaction: NextPage = () => {
return (
+
+ Review Transaction
+ Share current page URL to other signers so they can sign. After you have signed the transaction, you may copy your signatures to others to import. If the auto sync switch is on, your signatures would be exchanged automatically.
+
+
{txMessage &&
Message
@@ -129,8 +140,9 @@ const GetTransaction: NextPage = () => {
- Copy all signatures
+ className='flex space-x-1 justify-center items-center p-2 border text-sky-700 rounded w-48 disabled:text-gray-400'>
+
+ Copy my signatures
diff --git a/src/pages/treasuries/[base64CBOR]/index.tsx b/src/pages/treasuries/[base64CBOR]/index.tsx
index da6dd1f5..a78465be 100644
--- a/src/pages/treasuries/[base64CBOR]/index.tsx
+++ b/src/pages/treasuries/[base64CBOR]/index.tsx
@@ -1,7 +1,7 @@
import type { NativeScript } from '@adaocommunity/cardano-serialization-lib-browser'
import { NextPage } from 'next'
import { useRouter } from 'next/router'
-import { encodeCardanoData, getResult, useCardanoSerializationLib } from '../../../cardano/serialization-lib'
+import { getResult, useCardanoSerializationLib } from '../../../cardano/serialization-lib'
import type { Cardano } from '../../../cardano/serialization-lib'
import { Layout, Panel } from '../../../components/layout'
import { ErrorMessage, Loading } from '../../../components/status'
@@ -11,6 +11,7 @@ import { useContext } from 'react'
import { ConfigContext } from '../../../cardano/config'
import { getAssetName, getBalance, getPolicyId, useAddressUTxOsQuery } from '../../../cardano/query-api'
import { ADAAmount, AssetAmount } from '../../../components/currency'
+import { getTreasuryPath } from '../../../route'
const ShowBalance: NextPage<{
cardano: Cardano
@@ -54,9 +55,6 @@ const ShowTreasury: NextPage<{
cardano: Cardano
script: NativeScript
}> = ({ cardano, script }) => {
- const base64CBOR = encodeCardanoData(script, 'base64')
- const path = `/treasuries/${encodeURIComponent(base64CBOR)}`
-
return (
@@ -65,10 +63,10 @@ const ShowTreasury: NextPage<{
diff --git a/src/pages/treasuries/[base64CBOR]/new.tsx b/src/pages/treasuries/[base64CBOR]/new.tsx
index dda13eb5..a8cd01a5 100644
--- a/src/pages/treasuries/[base64CBOR]/new.tsx
+++ b/src/pages/treasuries/[base64CBOR]/new.tsx
@@ -1,17 +1,15 @@
import type { NextPage } from 'next'
import { useRouter } from 'next/router'
-import { Layout, Panel } from '../../../components/layout'
-import { Cardano, encodeCardanoData } from '../../../cardano/serialization-lib'
+import { Layout } from '../../../components/layout'
+import { Cardano } from '../../../cardano/serialization-lib'
import { getResult, useCardanoSerializationLib } from '../../../cardano/serialization-lib'
import { ErrorMessage, Loading } from '../../../components/status'
import { useContext } from 'react'
import { ConfigContext } from '../../../cardano/config'
-import { NewTransaction } from '../../../components/transaction'
+import { NativeScriptInfoViewer, NewTransaction } from '../../../components/transaction'
import type { ProtocolParameters } from '../../../cardano/query-api'
import { useAddressUTxOsQuery, useProtocolParametersQuery } from '../../../cardano/query-api'
import type { NativeScript } from '@adaocommunity/cardano-serialization-lib-browser'
-import { useLiveQuery } from 'dexie-react-hooks'
-import { db } from '../../../db'
const NewMultiSigTransaction: NextPage<{
cardano: Cardano
@@ -22,8 +20,6 @@ const NewMultiSigTransaction: NextPage<{
const [config, _] = useContext(ConfigContext)
const address = cardano.getScriptAddress(script, config.isMainnet)
- const treasury = useLiveQuery(async () => db.treasuries.get(encodeCardanoData(script, 'base64')))
-
const utxos = useAddressUTxOsQuery(address.to_bech32(), config)
if (utxos.type === 'loading') return ;
if (utxos.type === 'error') return An error happened when query balance.;
@@ -34,14 +30,9 @@ const NewMultiSigTransaction: NextPage<{
return (
-
- {treasury?.name || 'No name'}
- {treasury?.description &&
-
- {treasury?.description}
-
- }
-
+