Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
33 changes: 18 additions & 15 deletions apps/web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
"private": true,
"type": "module",
"dependencies": {
"@i18next-selector/vite-plugin": "^0.0.18",
"@i18next-selector/vite-plugin": "0.0.18",
"@privy-io/react-auth": "3.0.1",
"@privy-io/wagmi": "2.0.0",
"@radix-ui/react-checkbox": "^1.3.3",
"@radix-ui/react-collapsible": "^1.1.12",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-checkbox": "1.3.3",
"@radix-ui/react-collapsible": "1.1.12",
"@radix-ui/react-dialog": "1.1.15",
"@radix-ui/react-dropdown-menu": "2.1.16",
"@radix-ui/react-label": "2.1.7",
"@radix-ui/react-select": "2.2.6",
"@radix-ui/react-slider": "1.3.6",
"@radix-ui/react-slot": "1.2.3",
"@radix-ui/react-switch": "1.2.6",
"@radix-ui/react-tabs": "^1.1.13",
"@radix-ui/react-tooltip": "^1.2.8",
"@radix-ui/react-tabs": "1.1.13",
"@radix-ui/react-tooltip": "1.2.8",
"@sovryn/slayer-sdk": "workspace:*",
"@sovryn/slayer-shared": "workspace:*",
"@tailwindcss/vite": "4.1.13",
"@tanstack/devtools-vite": "^0.3.3",
"@tanstack/devtools-vite": "0.3.3",
"@tanstack/react-devtools": "0.7.0",
"@tanstack/react-form": "1.23.0",
"@tanstack/react-query": "5.90.2",
Expand All @@ -30,11 +30,12 @@
"@tanstack/router-plugin": "1.131.50",
"class-variance-authority": "0.7.1",
"clsx": "2.1.1",
"debug": "^4.4.3",
"debug": "4.4.3",
"envalid": "8.1.0",
"i18next": "^25.5.2",
"i18next-browser-languagedetector": "^8.2.0",
"i18next-http-backend": "^3.0.2",
"i18next": "25.5.2",
"i18next-browser-languagedetector": "8.2.0",
"i18next-http-backend": "3.0.2",
"immer": "^10.2.0",
Comment thread
creed-victor marked this conversation as resolved.
Outdated
"lucide-react": "0.544.0",
"next-themes": "^0.4.6",
Comment thread
creed-victor marked this conversation as resolved.
Outdated
"react": "19.1.1",
Expand All @@ -45,9 +46,11 @@
"tailwind-merge": "3.3.1",
"tailwindcss": "4.1.13",
"tw-animate-css": "1.3.8",
"viem": "2.37.8",
"wagmi": "2.17.2",
"zod": "4.1.11"
"use-sync-external-store": "1.6.0",
Comment thread
creed-victor marked this conversation as resolved.
"viem": "2.38.6",
"wagmi": "2.19.2",
"zod": "4.1.11",
"zustand": "5.0.8"
},
"devDependencies": {
"@types/debug": "^4.1.12",
Expand Down
6 changes: 5 additions & 1 deletion apps/web-app/public/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"accept": "Accept",
"cancel": "Cancel",
"close": "Close"
"close": "Close",
"confirm": "Confirm",
"continue": "Continue",
"abort": "Abort",
"loading": "Loading..."
}
10 changes: 10 additions & 0 deletions apps/web-app/public/locales/en/tx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"title": "Transaction Confirmation",
"description": "Please review and confirm transactions in your wallet",
"preparing": "Preparing transaction...",
"connectWallet": "Connect your wallet to proceed.",
"switchNetwork": "Switch to {{name}} network",
"signMessage": "Sign Message",
"signTypedData": "Sign Typed Data",
"sendTransaction": "Send Transaction"
}
2 changes: 2 additions & 0 deletions apps/web-app/src/@types/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any
declare type AnyValue = any;
2 changes: 2 additions & 0 deletions apps/web-app/src/@types/i18next.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { resources as common } from 'public/locales/en/common';
import type { resources as glossary } from 'public/locales/en/glossary';
import type { resources as tx } from 'public/locales/en/tx';
import type { resources as validation } from 'public/locales/en/validation';
import { defaultNS } from '../i18n';

Expand All @@ -11,6 +12,7 @@ declare module 'i18next' {
common: typeof common;
glossary: typeof glossary;
validation: typeof validation;
tx: typeof tx;
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ import { AmountRenderer } from '@/components/ui/amount-renderer';
import { Button } from '@/components/ui/button';
import { InfoButton } from '@/components/ui/info-button';
import { sdk } from '@/lib/sdk';
import {
BorrowRateMode,
type MoneyMarketPoolReserve,
type Token,
} from '@sovryn/slayer-sdk';
import { useSlayerTx } from '@/lib/transactions';
import { type MoneyMarketPoolReserve, type Token } from '@sovryn/slayer-sdk';
import { Decimal } from '@sovryn/slayer-shared';
import { useAccount, useWriteContract } from 'wagmi';

Expand All @@ -35,22 +32,31 @@ export const AssetsTable: FC<AssetsTableProps> = ({ assets }) => {

const { writeContractAsync } = useWriteContract();

const { begin } = useSlayerTx();

const handleBorrow = async (token: Token) => {
const msg = await sdk.moneyMarket.borrow(
token,
Decimal.from(1),
BorrowRateMode.stable,
{
begin(async () => {
const s = await sdk.moneyMarket.borrow(token, Decimal.from(1), 1, {
account: address!,
},
);
console.log('Transaction Request:', msg);
});
console.log('Transaction Request:', s);
return s;
});

// const msg = await sdk.moneyMarket.borrow(
// token,
// Decimal.from(1),
// BorrowRateMode.stable,
// {
// account: address!,
// },
// );
// console.log('Transaction Request:', msg);

if (msg.length) {
const { chain, ...contractParams } = msg[0];
const data = await writeContractAsync(contractParams);
console.log('Transaction Response:', data);
}
// if (msg.length) {
// // const data = await writeContractAsync<any>(msg[0]);
// // console.log('Transaction Response:', data);
// }
// const d = await signMessageAsync(msg);
// console.warn('Signature:', { data, d });
};
Expand Down
Loading