From 9e1c76bf13a70804641afa9a7a252f2038f6b8c9 Mon Sep 17 00:00:00 2001 From: Nadeem Date: Wed, 3 Apr 2024 11:50:08 +0530 Subject: [PATCH] update React Interface --- packages/heartbit-react/README.md | 8 ++++---- packages/heartbit-react/src/components/HeartBit/index.tsx | 8 ++++---- packages/heartbit-react/src/components/HeartBit/types.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/heartbit-react/README.md b/packages/heartbit-react/README.md index 8921f35..179eeb3 100644 --- a/packages/heartbit-react/README.md +++ b/packages/heartbit-react/README.md @@ -98,12 +98,12 @@ const CustomHearBit = () => { const { mintHeartBit, getTotalHeartMintsByUser, getTotalHeartBitByHash } = useHeartBit() const [startTime, setStartTime] = useState(null) // should be in seconds - const address = '0x...someaddress' + const account = '0x...someaddress' const hash = 'ipfs://cid' // This is an identifier for the token, if this hash changes you mint a new token eg: ipfs://cid useEffect(() => { const fetchBalances = async () => { const totalMintsByHash = await getTotalHeartBitByHash({ hash }); // Total Supply for a hash - const totalMintsByUser = await getTotalHeartMintsByUser({ address, hash }); // Total mints for a user by hash + const totalMintsByUser = await getTotalHeartMintsByUser({ account, hash }); // Total mints for a user by hash console.log({ totalMintsByHash, totalMintsByUser}) } @@ -144,7 +144,7 @@ interface HeartBitProps coreOptions: HeartBitCoreOptions; getSignatureArgsHook: () => Promise; // this is a required hook, this allows to call sign message operation on the user wallet, must return SignatureArgs hash: string; // This is an identifier for the token, if this hash changes you mint a new token. eg: ipfs://cid - address?: string; // user wallet address + account?: string; // user wallet address showTotalMintsByHash?: boolean; // Default to false, if true will show total mints for a hash to the right of component showTotalMintsByUser?: boolean; // Defaults to false, if true will show total mints by a user on a hash to right of the component } @@ -163,7 +163,7 @@ interface TotalHeartBitCountArgs { } interface HeartBitCountByUserArgs { hash: string; // This is an identifier for the token, if this hash changes you mint a new token. eg: ipfs://cid - address: string; // ethereum wallet address + account: string; // ethereum wallet address } interface MintHeartBitArgs { message: string; diff --git a/packages/heartbit-react/src/components/HeartBit/index.tsx b/packages/heartbit-react/src/components/HeartBit/index.tsx index 62ec7a8..59efe25 100644 --- a/packages/heartbit-react/src/components/HeartBit/index.tsx +++ b/packages/heartbit-react/src/components/HeartBit/index.tsx @@ -41,7 +41,7 @@ const HeartBitWithProvider = (props: HeartBitProps) => { const { getSignatureArgsHook, hash, - address, + account, showTotalMintsByHash = false, showTotalMintsByUser = false, } = props; @@ -63,9 +63,9 @@ const HeartBitWithProvider = (props: HeartBitProps) => { const totalMintsByHash = await getTotalHeartBitByHash({ hash }); balances.totalMintsByHash = totalMintsByHash; } - if (showTotalMintsByUser && address) { + if (showTotalMintsByUser && account) { const totalMintsByUser = await getTotalHeartMintsByUser({ - address, + account, hash, }); balances.totalMintsByUser = totalMintsByUser; @@ -77,7 +77,7 @@ const HeartBitWithProvider = (props: HeartBitProps) => { setLoading(false); } }, [ - address, + account, getTotalHeartBitByHash, getTotalHeartMintsByUser, hash, diff --git a/packages/heartbit-react/src/components/HeartBit/types.ts b/packages/heartbit-react/src/components/HeartBit/types.ts index ac3fc75..742dc8e 100644 --- a/packages/heartbit-react/src/components/HeartBit/types.ts +++ b/packages/heartbit-react/src/components/HeartBit/types.ts @@ -12,7 +12,7 @@ export interface HeartBitProps coreOptions: HeartBitCoreOptions; getSignatureArgsHook: () => Promise; hash: string; - address?: string; + account?: string; showTotalMintsByHash?: boolean; showTotalMintsByUser?: boolean; }