Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: transaction request screen #43

Merged
merged 3 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export namespace Button {
default:
'text-gray12 bg-blackA1 dark:bg-whiteA1 border border-blackA1 dark:border-whiteA1',
primary: 'text-white bg-blue10',
destructive: 'text-white bg-red10',
success: 'text-white bg-green10',
destructive: 'text-red10 bg-red3',
success: 'text-white bg-green9',
warning: 'text-white bg-amber8',
},
size: {
Expand Down
7 changes: 3 additions & 4 deletions app/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export namespace Layout {
<div>
<div className="flex items-center gap-2">
<div className={Default.className({ variant })}>
<Icon className="size-4 text-current" />
<Icon className="size-[18px] text-current" />
</div>
<div className="font-medium text-[18px] text-gray12">{title}</div>
</div>
Expand Down Expand Up @@ -86,6 +86,7 @@ export namespace Layout {
default: 'bg-blueA3 text-blue10',
primary: 'bg-blueA3 text-blue10',
warning: 'bg-amberA2 text-amber8',
destructive: 'bg-red3 text-red10',
},
},
defaultVariants: {
Expand Down Expand Up @@ -140,9 +141,7 @@ export namespace Layout {

// Wallet Footer
export function Wallet(props: Wallet.Props) {
const address =
props.address ??
Hooks.usePortoStore(porto, (state) => state.accounts[0]?.address)
const address = props.address ?? Hooks.useAccount(porto)?.address
if (!address) return null
return (
<div className="flex justify-between border-blackA1 border-t px-3 pt-3 dark:border-whiteA1">
Expand Down
1 change: 1 addition & 0 deletions app/src/lib/Query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const client = new QueryClient({
defaultOptions: {
queries: {
gcTime: 1000 * 60 * 60 * 24, // 24 hours
retry: 0,
},
},
})
Expand Down
58 changes: 57 additions & 1 deletion app/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
import { Route as rootRoute } from './routes/__root'
import { Route as DialogImport } from './routes/_dialog'
import { Route as IndexImport } from './routes/index'
import { Route as DialogDialogWalletsendCallsImport } from './routes/_dialog.dialog/wallet_sendCalls'
import { Route as DialogDialogWalletconnectImport } from './routes/_dialog.dialog/wallet_connect'
import { Route as DialogDialogPersonalsignImport } from './routes/_dialog.dialog/personal_sign'
import { Route as DialogDialogExperimentalcreateAccountImport } from './routes/_dialog.dialog/experimental_createAccount'
import { Route as DialogDialogExperimentalauthorizeKeyImport } from './routes/_dialog.dialog/experimental_authorizeKey'
import { Route as DialogDialogEthsendTransactionImport } from './routes/_dialog.dialog/eth_sendTransaction'
import { Route as DialogDialogEthrequestAccountsImport } from './routes/_dialog.dialog/eth_requestAccounts'
import { Route as DialogDialogSplatImport } from './routes/_dialog.dialog/$'

Expand All @@ -33,6 +35,13 @@ const IndexRoute = IndexImport.update({
getParentRoute: () => rootRoute,
} as any)

const DialogDialogWalletsendCallsRoute =
DialogDialogWalletsendCallsImport.update({
id: '/dialog/wallet_sendCalls',
path: '/dialog/wallet_sendCalls',
getParentRoute: () => DialogRoute,
} as any)

const DialogDialogWalletconnectRoute = DialogDialogWalletconnectImport.update({
id: '/dialog/wallet_connect',
path: '/dialog/wallet_connect',
Expand All @@ -59,6 +68,13 @@ const DialogDialogExperimentalauthorizeKeyRoute =
getParentRoute: () => DialogRoute,
} as any)

const DialogDialogEthsendTransactionRoute =
DialogDialogEthsendTransactionImport.update({
id: '/dialog/eth_sendTransaction',
path: '/dialog/eth_sendTransaction',
getParentRoute: () => DialogRoute,
} as any)

const DialogDialogEthrequestAccountsRoute =
DialogDialogEthrequestAccountsImport.update({
id: '/dialog/eth_requestAccounts',
Expand Down Expand Up @@ -104,6 +120,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof DialogDialogEthrequestAccountsImport
parentRoute: typeof DialogImport
}
'/_dialog/dialog/eth_sendTransaction': {
id: '/_dialog/dialog/eth_sendTransaction'
path: '/dialog/eth_sendTransaction'
fullPath: '/dialog/eth_sendTransaction'
preLoaderRoute: typeof DialogDialogEthsendTransactionImport
parentRoute: typeof DialogImport
}
'/_dialog/dialog/experimental_authorizeKey': {
id: '/_dialog/dialog/experimental_authorizeKey'
path: '/dialog/experimental_authorizeKey'
Expand Down Expand Up @@ -132,6 +155,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof DialogDialogWalletconnectImport
parentRoute: typeof DialogImport
}
'/_dialog/dialog/wallet_sendCalls': {
id: '/_dialog/dialog/wallet_sendCalls'
path: '/dialog/wallet_sendCalls'
fullPath: '/dialog/wallet_sendCalls'
preLoaderRoute: typeof DialogDialogWalletsendCallsImport
parentRoute: typeof DialogImport
}
}
}

Expand All @@ -140,21 +170,25 @@ declare module '@tanstack/react-router' {
interface DialogRouteChildren {
DialogDialogSplatRoute: typeof DialogDialogSplatRoute
DialogDialogEthrequestAccountsRoute: typeof DialogDialogEthrequestAccountsRoute
DialogDialogEthsendTransactionRoute: typeof DialogDialogEthsendTransactionRoute
DialogDialogExperimentalauthorizeKeyRoute: typeof DialogDialogExperimentalauthorizeKeyRoute
DialogDialogExperimentalcreateAccountRoute: typeof DialogDialogExperimentalcreateAccountRoute
DialogDialogPersonalsignRoute: typeof DialogDialogPersonalsignRoute
DialogDialogWalletconnectRoute: typeof DialogDialogWalletconnectRoute
DialogDialogWalletsendCallsRoute: typeof DialogDialogWalletsendCallsRoute
}

const DialogRouteChildren: DialogRouteChildren = {
DialogDialogSplatRoute: DialogDialogSplatRoute,
DialogDialogEthrequestAccountsRoute: DialogDialogEthrequestAccountsRoute,
DialogDialogEthsendTransactionRoute: DialogDialogEthsendTransactionRoute,
DialogDialogExperimentalauthorizeKeyRoute:
DialogDialogExperimentalauthorizeKeyRoute,
DialogDialogExperimentalcreateAccountRoute:
DialogDialogExperimentalcreateAccountRoute,
DialogDialogPersonalsignRoute: DialogDialogPersonalsignRoute,
DialogDialogWalletconnectRoute: DialogDialogWalletconnectRoute,
DialogDialogWalletsendCallsRoute: DialogDialogWalletsendCallsRoute,
}

const DialogRouteWithChildren =
Expand All @@ -165,21 +199,25 @@ export interface FileRoutesByFullPath {
'': typeof DialogRouteWithChildren
'/dialog/$': typeof DialogDialogSplatRoute
'/dialog/eth_requestAccounts': typeof DialogDialogEthrequestAccountsRoute
'/dialog/eth_sendTransaction': typeof DialogDialogEthsendTransactionRoute
'/dialog/experimental_authorizeKey': typeof DialogDialogExperimentalauthorizeKeyRoute
'/dialog/experimental_createAccount': typeof DialogDialogExperimentalcreateAccountRoute
'/dialog/personal_sign': typeof DialogDialogPersonalsignRoute
'/dialog/wallet_connect': typeof DialogDialogWalletconnectRoute
'/dialog/wallet_sendCalls': typeof DialogDialogWalletsendCallsRoute
}

export interface FileRoutesByTo {
'/': typeof IndexRoute
'': typeof DialogRouteWithChildren
'/dialog/$': typeof DialogDialogSplatRoute
'/dialog/eth_requestAccounts': typeof DialogDialogEthrequestAccountsRoute
'/dialog/eth_sendTransaction': typeof DialogDialogEthsendTransactionRoute
'/dialog/experimental_authorizeKey': typeof DialogDialogExperimentalauthorizeKeyRoute
'/dialog/experimental_createAccount': typeof DialogDialogExperimentalcreateAccountRoute
'/dialog/personal_sign': typeof DialogDialogPersonalsignRoute
'/dialog/wallet_connect': typeof DialogDialogWalletconnectRoute
'/dialog/wallet_sendCalls': typeof DialogDialogWalletsendCallsRoute
}

export interface FileRoutesById {
Expand All @@ -188,10 +226,12 @@ export interface FileRoutesById {
'/_dialog': typeof DialogRouteWithChildren
'/_dialog/dialog/$': typeof DialogDialogSplatRoute
'/_dialog/dialog/eth_requestAccounts': typeof DialogDialogEthrequestAccountsRoute
'/_dialog/dialog/eth_sendTransaction': typeof DialogDialogEthsendTransactionRoute
'/_dialog/dialog/experimental_authorizeKey': typeof DialogDialogExperimentalauthorizeKeyRoute
'/_dialog/dialog/experimental_createAccount': typeof DialogDialogExperimentalcreateAccountRoute
'/_dialog/dialog/personal_sign': typeof DialogDialogPersonalsignRoute
'/_dialog/dialog/wallet_connect': typeof DialogDialogWalletconnectRoute
'/_dialog/dialog/wallet_sendCalls': typeof DialogDialogWalletsendCallsRoute
}

export interface FileRouteTypes {
Expand All @@ -201,30 +241,36 @@ export interface FileRouteTypes {
| ''
| '/dialog/$'
| '/dialog/eth_requestAccounts'
| '/dialog/eth_sendTransaction'
| '/dialog/experimental_authorizeKey'
| '/dialog/experimental_createAccount'
| '/dialog/personal_sign'
| '/dialog/wallet_connect'
| '/dialog/wallet_sendCalls'
fileRoutesByTo: FileRoutesByTo
to:
| '/'
| ''
| '/dialog/$'
| '/dialog/eth_requestAccounts'
| '/dialog/eth_sendTransaction'
| '/dialog/experimental_authorizeKey'
| '/dialog/experimental_createAccount'
| '/dialog/personal_sign'
| '/dialog/wallet_connect'
| '/dialog/wallet_sendCalls'
id:
| '__root__'
| '/'
| '/_dialog'
| '/_dialog/dialog/$'
| '/_dialog/dialog/eth_requestAccounts'
| '/_dialog/dialog/eth_sendTransaction'
| '/_dialog/dialog/experimental_authorizeKey'
| '/_dialog/dialog/experimental_createAccount'
| '/_dialog/dialog/personal_sign'
| '/_dialog/dialog/wallet_connect'
| '/_dialog/dialog/wallet_sendCalls'
fileRoutesById: FileRoutesById
}

Expand Down Expand Up @@ -260,10 +306,12 @@ export const routeTree = rootRoute
"children": [
"/_dialog/dialog/$",
"/_dialog/dialog/eth_requestAccounts",
"/_dialog/dialog/eth_sendTransaction",
"/_dialog/dialog/experimental_authorizeKey",
"/_dialog/dialog/experimental_createAccount",
"/_dialog/dialog/personal_sign",
"/_dialog/dialog/wallet_connect"
"/_dialog/dialog/wallet_connect",
"/_dialog/dialog/wallet_sendCalls"
]
},
"/_dialog/dialog/$": {
Expand All @@ -274,6 +322,10 @@ export const routeTree = rootRoute
"filePath": "_dialog.dialog/eth_requestAccounts.tsx",
"parent": "/_dialog"
},
"/_dialog/dialog/eth_sendTransaction": {
"filePath": "_dialog.dialog/eth_sendTransaction.tsx",
"parent": "/_dialog"
},
"/_dialog/dialog/experimental_authorizeKey": {
"filePath": "_dialog.dialog/experimental_authorizeKey.tsx",
"parent": "/_dialog"
Expand All @@ -289,6 +341,10 @@ export const routeTree = rootRoute
"/_dialog/dialog/wallet_connect": {
"filePath": "_dialog.dialog/wallet_connect.tsx",
"parent": "/_dialog"
},
"/_dialog/dialog/wallet_sendCalls": {
"filePath": "_dialog.dialog/wallet_sendCalls.tsx",
"parent": "/_dialog"
}
}
}
Expand Down
Loading