Skip to content

Instantly share code, notes, and snippets.

@iGroza
Created March 11, 2024 09:43
Show Gist options
  • Save iGroza/005f677b9a0cfb1cbdabbe247a6ad4ab to your computer and use it in GitHub Desktop.
Save iGroza/005f677b9a0cfb1cbdabbe247a6ad4ab to your computer and use it in GitHub Desktop.
export type Currency = {
created_at: string;
icon: string;
id: string;
postfix: string;
prefix: string;
status: string;
title: string;
updated_at: string;
};
export type CurrencyRate = {
amount: number;
denom: string;
};
export enum AddressType {
wallet = 'wallet',
contract = 'contract',
unknown = 'unknown',
}
export type IContract = {
address_type: AddressType;
created_at: string;
decimals: number | null;
id: HaqqCosmosAddress;
is_erc20: boolean | null;
is_erc721: boolean | null;
is_erc1155: boolean | null;
is_in_white_list: boolean | null;
name: string | null;
symbol: string | null;
updated_at: string;
icon: string | null;
};
export type HaqqCosmosAddress = `haqq${string}` & string;
export type HexNumber = `0x${string}` & string;
export type IndexerBalance = Record<HaqqCosmosAddress, HexNumber>;
export type IndexerToken = {
address: HaqqCosmosAddress;
contract: HaqqCosmosAddress;
created_at: string;
updated_at: string;
value: string;
};
export type IndexerTime = Record<HaqqCosmosAddress, number>;
export type Rate = { denom: string; amount: string };
export type RatesResponse = Record<string, Rate[]>;
export type IndexerUpdatesResponse = {
addresses: IContract[];
balance: IndexerBalance;
staked: IndexerBalance;
vested: IndexerBalance;
available: IndexerBalance;
locked: IndexerBalance;
total: IndexerBalance;
available_for_stake: IndexerBalance;
// next time for unlock vested tokens
unlock: IndexerTime;
last_update: string;
// TODO: add types
nfts: unknown[];
tokens: IndexerToken[];
transactions: unknown[];
rates: RatesResponse;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment