-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rwa): show maxsupply numbers (#2717)
- Loading branch information
1 parent
5e9bfd0
commit 7360b1c
Showing
32 changed files
with
584 additions
and
406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 17 additions & 6 deletions
23
packages/apps/rwa-demo/src/app/(app)/assets/[uuid]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
'use client'; | ||
import type { IWalletAccount } from '@/components/AccountProvider/utils'; | ||
import type { IAsset } from '@/components/AssetProvider/AssetProvider'; | ||
import { useAccount } from '@/hooks/account'; | ||
import { useAsset } from '@/hooks/asset'; | ||
import { useParams } from 'next/navigation'; | ||
import { useMemo } from 'react'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
const Assets = () => { | ||
const { getAsset } = useAsset(); | ||
const { account } = useAccount(); | ||
const [asset, setAsset] = useState<IAsset | undefined>(); | ||
const { uuid } = useParams(); | ||
const asset = useMemo(() => { | ||
return getAsset(uuid as string); | ||
}, [uuid]); | ||
|
||
console.log({ asset }); | ||
const initData = async (uuid: string, account: IWalletAccount) => { | ||
const data = await getAsset(uuid, account); | ||
setAsset(data); | ||
}; | ||
|
||
useEffect(() => { | ||
if (!account) return; | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
initData(uuid as string, account); | ||
}, [uuid, account?.address]); | ||
|
||
return <pre>{JSON.stringify(asset, null, 2)}</pre>; | ||
}; | ||
|
||
export default Assets; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.