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(rakki): UI enhancement #1434

Merged
merged 16 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
9 changes: 9 additions & 0 deletions assets/icons/ticket.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logos/rakki-ticket.png
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we reduce size of this image ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I used a PNG version because the SVG exported from Figma is glitched.
I asked help to Leonid

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
150 changes: 0 additions & 150 deletions assets/logos/rakki-ticket.svg

This file was deleted.

4 changes: 2 additions & 2 deletions networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -11635,8 +11635,8 @@
},
{
"type": "CosmWasmRakki",
"codeId": 79,
"contractAddress": "tori1smdl4c0mc4kqsrg42rhrx5czqwxtp2gml0v8yrzhclesf5n47wzqds7dx3"
"codeId": 80,
"contractAddress": "tori1kxjygnhf26d8v5fv7vwr3hmxn6f4480qwf3eq7459mhps2muqxps3vu4r2"
}
],
"currencies": [
Expand Down
40 changes: 40 additions & 0 deletions packages/hooks/rakki/useRakkiTicketsByUser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { useQuery } from "@tanstack/react-query";

import { RakkiQueryClient } from "../../contracts-clients/rakki/Rakki.client";
import {
NetworkFeature,
getNetworkFeature,
getNonSigningCosmWasmClient,
} from "../../networks";

export const useRakkiTicketsCountByUser = (
networkId: string,
userAddress?: string,
) => {
n0izn0iz marked this conversation as resolved.
Show resolved Hide resolved
const { data: ticketsCount = null, ...other } = useQuery(
["rakkiTicketsCountByUser", networkId],
n0izn0iz marked this conversation as resolved.
Show resolved Hide resolved
async () => {
if (!userAddress) {
return null;
}
const rakkiFeature = getNetworkFeature(
networkId,
NetworkFeature.CosmWasmRakki,
);
if (!rakkiFeature) {
return null;
}
const cosmWasmClient = await getNonSigningCosmWasmClient(networkId);
if (!cosmWasmClient) {
return null;
}
const client = new RakkiQueryClient(
cosmWasmClient,
rakkiFeature.contractAddress,
);
return await client.ticketsCountByUser({ userAddr: userAddress });
},
{ staleTime: Infinity, refetchInterval: 10000 },
);
return { ticketsCount, ...other };
};
4 changes: 2 additions & 2 deletions packages/networks/teritori-testnet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ const cosmwasmNftLaunchpadFeature: CosmWasmNFTLaunchpad = {

const rakkiFeature: CosmWasmRakki = {
type: NetworkFeature.CosmWasmRakki,
codeId: 79,
codeId: 80,
contractAddress:
"tori1smdl4c0mc4kqsrg42rhrx5czqwxtp2gml0v8yrzhclesf5n47wzqds7dx3",
"tori1kxjygnhf26d8v5fv7vwr3hmxn6f4480qwf3eq7459mhps2muqxps3vu4r2",
};

const riotContractAddressGen0 =
Expand Down
Loading
Loading