0.0.18 • Published 1 year ago

@cigdao/explore v0.0.18

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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;
}
0.0.17

1 year ago

0.0.18

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago