Skip to content

Commit bba5cf2

Browse files
committed
feat: referrer in sp club
1 parent 0e880fd commit bba5cf2

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

src/components/AccountList/SpClub.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ export default function SpClub() {
6565
</div>
6666

6767
{
68-
profiles?.[0]?.spClub?.inviter &&
68+
profiles?.[0]?.spClub?.referrer &&
6969
<div>
7070
<p style={{ fontSize: '14px', color: '#FFFFFF' }}>Inviter</p>
71-
<p style={{ fontSize: '16px', color: '#989899' }}>{profiles?.[0]?.spClub?.inviter?.toString()}</p>
71+
<p style={{ fontSize: '16px', color: '#989899' }}>{profiles?.[0]?.spClub?.referrer?.toString().slice(0, 5) + '...' + profiles?.[0]?.spClub?.referrer?.toString().slice(-5)}</p>
7272
</div>
7373
}
7474

src/services/wallets.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -774,16 +774,9 @@ const getSpClubInfo = async (profile: profile) => {
774774
console.log(error);
775775
}
776776

777-
try {
778-
const result = await contract.getReferrer(profile.keyID);
779-
profile.spClub.referrer = result;
780-
} catch (error) {
781-
console.log(error);
782-
}
783-
784777
if (profile.spClub.memberId) {
785778
try {
786-
const referrerResult = await contract.getReferer(profile.keyID);
779+
const referrerResult = await contract.getReferrer(profile.keyID);
787780

788781
if (
789782
referrerResult.referrer !== "0x0000000000000000000000000000000000000000"

src/utils/contracts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const contracts = {
6868
network: "CONET Holesky",
6969
},
7070
SpClub: {
71-
address: "0x1FB1E32E801D240C9727c954ff93614Baa933702",
71+
address: "0xe1949263B338D8c1eD7d4CbDE2026eb82DB78D3a",
7272
abi: SpClubAbi,
7373
network: "CONET DePIN",
7474
},

0 commit comments

Comments
 (0)