@cigdao/explore
v0.0.18
Published
npm package for query explore
Downloads
7
Readme
Exlore
Explore package is a utility that makes it easier to traverse the Cigdao token explorer
Installation
npm install @cigdao/explore
import
import CigExplorer from '@cigdao/explore'
Examples
Instantiation
By default CigExplorer package will connect to "vnlar-biaaa-aaaan-qc4wq-cai"
. However contracts can be passed to constructor.
const expl = new CigExplorer("asaa-asdfs");
Fetch all transactions
const expl = new CigExplorer();
const transactions: Transaction[] = Transexpl.fetchTransactions();
Fetch transaction by hash
const expl = new CigExplorer();
const transaction: Transaction = expl.getTransaction("asdfasdfasdfasdfa");
Fetch Sender transaction
const expl = new CigExplorer();
const transaction: Transaction = expl.fetchSenderTransactions("zxssa-asdfs");
Fetch Receiver transaction
const expl = new CigExplorer();
const transaction: Transaction = expl.fetchReceiverTransactions("zxssa-asdfs");
Types
export interface transactions {
sk: string;
transactions: Transaction[];
}
export interface Transaction {
amount: number;
timeStamp: number;
hash: string;
receiver: string;
fee: number;
sender: string;
transactionType: string;
type?: string;
}
export interface Reflection {
amount: number;
timestamp: number;
}
export interface CombinedReflection {
amount: number;
timestamp: string;
}
export interface Proposal {
id: number;
vote?: boolean | null;
creator: string;
title: string;
yay: bigint;
description: string;
timeStamp: number;
treasuryRequestId?: number | null;
executed: boolean;
nay: bigint;
request?: Request | null;
type?: string;
executedAt: bigint;
}
export interface TreasuryRequest {
id: number;
recipient: string;
amount: number;
description: string;
createdAt: number;
executed: boolean;
approvals: [Approval];
}
export interface Approval {
power: number;
member: string;
}
export interface Request {
recipient: string;
amount: number;
description: string;
}
export interface Vote {
yay: boolean;
timeStamp: bigint;
power: number;
proposalId: number;
member: string;
}