use latest mango client to add confirming transaction notification
This commit is contained in:
parent
05bd420fce
commit
41fa096294
|
@ -1,7 +1,7 @@
|
||||||
const Loading = ({ className = '' }) => {
|
const Loading = ({ className = '' }) => {
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
className={`${className} animate-spin h-5 w-5`}
|
className={`${className} animate-spin-fast h-5 w-5`}
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
fill="none"
|
fill="none"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
|
|
|
@ -103,7 +103,7 @@ const Notification = ({ notification }: { notification: Notification }) => {
|
||||||
hideNotification()
|
hideNotification()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
parsedTitle || type === 'confirm' || type === 'error' ? 30000 : 10000
|
parsedTitle || type === 'confirm' || type === 'error' ? 30000 : 8000
|
||||||
)
|
)
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
@ -129,7 +129,7 @@ const Notification = ({ notification }: { notification: Notification }) => {
|
||||||
<XCircleIcon className={`text-th-red h-7 w-7 mr-1`} />
|
<XCircleIcon className={`text-th-red h-7 w-7 mr-1`} />
|
||||||
)}
|
)}
|
||||||
{type === 'confirm' && (
|
{type === 'confirm' && (
|
||||||
<Loading className={`text-th-fgd-3 h-7 w-7 mr-1`} />
|
<Loading className="text-th-fgd-3 h-7 w-7 mr-1" />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className={`ml-2 flex-1`}>
|
<div className={`ml-2 flex-1`}>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@blockworks-foundation/mango-client": "^3.2.17",
|
"@blockworks-foundation/mango-client": "latest",
|
||||||
"@headlessui/react": "^1.2.0",
|
"@headlessui/react": "^1.2.0",
|
||||||
"@heroicons/react": "^1.0.0",
|
"@heroicons/react": "^1.0.0",
|
||||||
"@jup-ag/react-hook": "latest",
|
"@jup-ag/react-hook": "latest",
|
||||||
|
|
|
@ -299,7 +299,7 @@
|
||||||
"stop-limit": "Stop Limit",
|
"stop-limit": "Stop Limit",
|
||||||
"stop-loss": "Stop Loss",
|
"stop-loss": "Stop Loss",
|
||||||
"stop-price": "Stop Price",
|
"stop-price": "Stop Price",
|
||||||
"successfully-placed": "Successfully sent order",
|
"successfully-placed": "Successfully placed order",
|
||||||
"supported-assets": "Please fund wallet with one of the supported assets.",
|
"supported-assets": "Please fund wallet with one of the supported assets.",
|
||||||
"swap": "Swap",
|
"swap": "Swap",
|
||||||
"take-profit": "Take Profit",
|
"take-profit": "Take Profit",
|
||||||
|
|
|
@ -193,7 +193,16 @@ const useMangoStore = create<MangoStore>((set, get) => {
|
||||||
cluster: CLUSTER,
|
cluster: CLUSTER,
|
||||||
current: connection,
|
current: connection,
|
||||||
websocket: WEBSOCKET_CONNECTION,
|
websocket: WEBSOCKET_CONNECTION,
|
||||||
client: new MangoClient(connection, programId),
|
client: new MangoClient(connection, programId, {
|
||||||
|
postSignTxCallback: ({ txid }) => {
|
||||||
|
notify({
|
||||||
|
title: 'Transaction sent',
|
||||||
|
description: 'Waiting for confirmation',
|
||||||
|
type: 'confirm',
|
||||||
|
txid,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}),
|
||||||
endpoint: ENDPOINT.url,
|
endpoint: ENDPOINT.url,
|
||||||
slot: 0,
|
slot: 0,
|
||||||
},
|
},
|
||||||
|
|
|
@ -15,12 +15,13 @@ module.exports = {
|
||||||
body: ['Lato, sans-serif'],
|
body: ['Lato, sans-serif'],
|
||||||
},
|
},
|
||||||
extend: {
|
extend: {
|
||||||
|
animation: {
|
||||||
|
shake: 'shake 0.4s linear 4',
|
||||||
|
'spin-fast': 'spin 0.5s linear infinite',
|
||||||
|
},
|
||||||
cursor: {
|
cursor: {
|
||||||
help: 'help',
|
help: 'help',
|
||||||
},
|
},
|
||||||
fontSize: {
|
|
||||||
xxs: '.65rem',
|
|
||||||
},
|
|
||||||
colors: {
|
colors: {
|
||||||
'light-theme': {
|
'light-theme': {
|
||||||
orange: {
|
orange: {
|
||||||
|
@ -90,6 +91,9 @@ module.exports = {
|
||||||
'th-green-muted': 'var(--green-muted)',
|
'th-green-muted': 'var(--green-muted)',
|
||||||
'th-orange': 'var(--orange)',
|
'th-orange': 'var(--orange)',
|
||||||
},
|
},
|
||||||
|
fontSize: {
|
||||||
|
xxs: '.65rem',
|
||||||
|
},
|
||||||
keyframes: {
|
keyframes: {
|
||||||
shake: {
|
shake: {
|
||||||
'0%, 100%': {
|
'0%, 100%': {
|
||||||
|
@ -103,9 +107,6 @@ module.exports = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
animation: {
|
|
||||||
shake: 'shake 0.4s linear 4',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
variants: {
|
variants: {
|
||||||
|
|
20
yarn.lock
20
yarn.lock
|
@ -1004,10 +1004,10 @@
|
||||||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||||
|
|
||||||
"@blockworks-foundation/mango-client@^3.2.17":
|
"@blockworks-foundation/mango-client@latest":
|
||||||
version "3.2.17"
|
version "3.2.18"
|
||||||
resolved "https://registry.yarnpkg.com/@blockworks-foundation/mango-client/-/mango-client-3.2.17.tgz#96ccdeeb91dcde3d403fe90d3fc87f79cae97112"
|
resolved "https://registry.yarnpkg.com/@blockworks-foundation/mango-client/-/mango-client-3.2.18.tgz#9367485d5e31b6afe4aa7deea1e6f882486d42c1"
|
||||||
integrity sha512-vAG48N89VATQ4BxfI9XwEnrIBroaDWK5r7CEhCY+zzMwCd6SOKckiMmJn8k7W/o35TUbNsXH3UOG8bwutkoupQ==
|
integrity sha512-mI/44VjZWp2XyFunAv4wagUFrOuIBz9xtyGZYMYZb8lpx50Y7n29I/YNs3gkTS2qw46FlDVraMERELqhYi81eQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@project-serum/anchor" "^0.16.2"
|
"@project-serum/anchor" "^0.16.2"
|
||||||
"@project-serum/serum" "0.13.55"
|
"@project-serum/serum" "0.13.55"
|
||||||
|
@ -2100,14 +2100,14 @@
|
||||||
integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==
|
integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==
|
||||||
|
|
||||||
"@types/node@*":
|
"@types/node@*":
|
||||||
version "17.0.4"
|
version "17.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.4.tgz#fec0ce0526abb6062fd206d72a642811b887a111"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.5.tgz#57ca67ec4e57ad9e4ef5a6bab48a15387a1c83e0"
|
||||||
integrity sha512-6xwbrW4JJiJLgF+zNypN5wr2ykM9/jHcL7rQ8fZe2vuftggjzZeRSM4OwRc6Xk8qWjwJ99qVHo/JgOGmomWRog==
|
integrity sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw==
|
||||||
|
|
||||||
"@types/node@^12.12.54":
|
"@types/node@^12.12.54":
|
||||||
version "12.20.38"
|
version "12.20.39"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.38.tgz#74801983c0558a7a31a4ead18bce2edded2b0e2f"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.39.tgz#ef3cb119eaba80e9f1012c78b9384a7489a18bf6"
|
||||||
integrity sha512-NxmtBRGipjx1B225OeMdI+CQmLbYqvvmYbukDTJGDgzIDgPQ1EcjGmYxGhOk5hTBqeB558S6RgHSpq2iiqifAQ==
|
integrity sha512-U7PMwkDmc3bnL0e4U8oA0POpi1vfsYDc+DEUS2+rPxm9NlLcW1dBa5JcRhO633PoPUcCSWMNXrMsqhmAVEo+IQ==
|
||||||
|
|
||||||
"@types/node@^14.14.25":
|
"@types/node@^14.14.25":
|
||||||
version "14.17.3"
|
version "14.17.3"
|
||||||
|
|
Loading…
Reference in New Issue