Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@boardroom/powerpool

Package Overview
Dependencies
Maintainers
3
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@boardroom/powerpool - npm Package Compare versions

Comparing version 1.0.0-alpha.4 to 2.0.0-alpha.0

dist/generated/operations/queries/getPowerpoolVoters.gql

10

dist/generated/operations/annotatedQueries.d.ts

@@ -1,5 +0,5 @@

export declare const getPowerpoolProposals = "\n query getPowerpoolProposals {\n getPowerpoolProposals (filter: $filter) @client {\n id\n title\n description\n author\n proposerId\n targets\n values\n calldatas\n executionETA\n votes{\n id\n support\n votes\n voterId\n proposalId\n }\n }\n}\n ";
export declare const getPowerpoolDelegates = "\n query getPowerpoolDelegates {\n getPowerpoolDelegates (filter: $filter) @client {\n lpVotesRaw\n lpVotes\n lpVotesLast\n tokenHoldersRepresented{\n id\n tokenBalanceRaw\n tokenBalance\n totalTokensHeldRaw\n totalTokensHeld\n delegateId\n }\n votes{\n id\n support\n votes\n voterId\n proposalId\n }\n proposalIds\n }\n}\n ";
export declare const getPowerpoolGovernance = "\n query getPowerpoolGovernance {\n getPowerpoolGovernance (filter: $filter) @client {\n protocol\n hasDelegation\n hasStaking\n currentDelegates\n currentTokenHolders\n delegatedVotes\n paidRewards\n proposalsQueued\n totalDelegates\n totalTokenHolders\n totalProposalCount\n totalVotes\n totalVoterCount\n totalStakers\n totalStakedAmount\n id\n proposals\n currentLPDelegates\n delegatedVotesRaw\n }\n}\n ";
export declare const getPowerpoolReceipts = "\n query getPowerpoolReceipts {\n getPowerpoolReceipts (filter: $filter) @client {\n id\n proposalId\n protocol\n support\n votesRaw\n voterId\n votes\n }\n}\n ";
export declare const getPowerpoolTokenHolders = "\n query getPowerpoolTokenHolders {\n getPowerpoolTokenHolders (filter: $filter) @client {\n id\n tokenBalanceRaw\n tokenBalance\n totalTokensHeldRaw\n totalTokensHeld\n delegateId\n }\n}\n ";
export declare const getPowerpoolProposals = "\n query getPowerpoolProposals {\n getPowerpoolProposals (pageSize: $pageSize, filter: $filter) @client {\n id\n title\n description\n author\n proposerId\n targets\n values\n calldatas\n executionETA\n votes{\n id\n support\n votes\n voterId\n proposalId\n }\n startBlock\n endBlock\n status\n }\n}\n ";
export declare const getPowerpoolVoters = "\n query getPowerpoolVoters {\n getPowerpoolVoters (pageSize: $pageSize, filter: $filter) @client {\n id\n delegatedVotesRaw\n delegatedVotes\n votingPower\n voteWeight\n proposalsCreated\n proposalsVoted\n tokenHoldersRepresentedAmount\n quorum\n cumulativePower\n lpVotesRaw\n lpVotes\n lpVotesLast\n tokenHoldersRepresented{\n id\n tokenBalanceRaw\n tokenBalance\n totalTokensHeldRaw\n totalTokensHeld\n delegateId\n }\n votes{\n id\n support\n votes\n voterId\n proposalId\n }\n proposalIds\n name\n description\n website\n }\n}\n ";
export declare const getPowerpoolGovernance = "\n query getPowerpoolGovernance {\n getPowerpoolGovernance (pageSize: $pageSize, filter: $filter) @client {\n protocol\n hasDelegation\n hasStaking\n currentDelegates\n currentTokenHolders\n delegatedVotes\n paidRewards\n proposalsQueued\n totalDelegates\n totalTokenHolders\n totalProposalCount\n totalVotes\n totalVoterCount\n totalStakers\n totalStakedAmount\n delegatedVotesRaw\n }\n}\n ";
export declare const getPowerpoolReceipts = "\n query getPowerpoolReceipts {\n getPowerpoolReceipts (pageSize: $pageSize, filter: $filter) @client {\n id\n proposalId\n protocol\n support\n votesRaw\n voterId\n votes\n }\n}\n ";
export declare const getPowerpoolTokenHolders = "\n query getPowerpoolTokenHolders {\n getPowerpoolTokenHolders (pageSize: $pageSize, filter: $filter) @client {\n id\n tokenBalanceRaw\n tokenBalance\n totalTokensHeldRaw\n totalTokensHeld\n delegateId\n }\n}\n ";
"use strict";
//THIS IS AN AUTOGENERATED FILE
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPowerpoolTokenHolders = exports.getPowerpoolReceipts = exports.getPowerpoolGovernance = exports.getPowerpoolDelegates = exports.getPowerpoolProposals = void 0;
exports.getPowerpoolTokenHolders = exports.getPowerpoolReceipts = exports.getPowerpoolGovernance = exports.getPowerpoolVoters = exports.getPowerpoolProposals = void 0;
exports.getPowerpoolProposals = `
query getPowerpoolProposals {
getPowerpoolProposals (filter: $filter) @client {
getPowerpoolProposals (pageSize: $pageSize, filter: $filter) @client {
id

@@ -24,8 +24,21 @@ title

}
startBlock
endBlock
status
}
}
`;
exports.getPowerpoolDelegates = `
query getPowerpoolDelegates {
getPowerpoolDelegates (filter: $filter) @client {
exports.getPowerpoolVoters = `
query getPowerpoolVoters {
getPowerpoolVoters (pageSize: $pageSize, filter: $filter) @client {
id
delegatedVotesRaw
delegatedVotes
votingPower
voteWeight
proposalsCreated
proposalsVoted
tokenHoldersRepresentedAmount
quorum
cumulativePower
lpVotesRaw

@@ -50,2 +63,5 @@ lpVotes

proposalIds
name
description
website
}

@@ -56,3 +72,3 @@ }

query getPowerpoolGovernance {
getPowerpoolGovernance (filter: $filter) @client {
getPowerpoolGovernance (pageSize: $pageSize, filter: $filter) @client {
protocol

@@ -73,5 +89,2 @@ hasDelegation

totalStakedAmount
id
proposals
currentLPDelegates
delegatedVotesRaw

@@ -83,3 +96,3 @@ }

query getPowerpoolReceipts {
getPowerpoolReceipts (filter: $filter) @client {
getPowerpoolReceipts (pageSize: $pageSize, filter: $filter) @client {
id

@@ -97,3 +110,3 @@ proposalId

query getPowerpoolTokenHolders {
getPowerpoolTokenHolders (filter: $filter) @client {
getPowerpoolTokenHolders (pageSize: $pageSize, filter: $filter) @client {
id

@@ -100,0 +113,0 @@ tokenBalanceRaw

@@ -5,5 +5,5 @@ const fs = require('fs');

module.exports.getPowerpoolProposals = fs.readFileSync(path.join(__dirname, 'getPowerpoolProposals.gql'), 'utf8');
module.exports.getPowerpoolDelegates = fs.readFileSync(path.join(__dirname, 'getPowerpoolDelegates.gql'), 'utf8');
module.exports.getPowerpoolVoters = fs.readFileSync(path.join(__dirname, 'getPowerpoolVoters.gql'), 'utf8');
module.exports.getPowerpoolGovernance = fs.readFileSync(path.join(__dirname, 'getPowerpoolGovernance.gql'), 'utf8');
module.exports.getPowerpoolReceipts = fs.readFileSync(path.join(__dirname, 'getPowerpoolReceipts.gql'), 'utf8');
module.exports.getPowerpoolTokenHolders = fs.readFileSync(path.join(__dirname, 'getPowerpoolTokenHolders.gql'), 'utf8');
export declare const resolvers: {
Query: {
getPowerpoolProposals: (root: any, args: any, context: any, info: any) => Promise<any[]>;
getPowerpoolDelegates: (root: any, args: any, context: any, info: any) => Promise<any[]>;
getPowerpoolVoters: (root: any, args: any, context: any, info: any) => Promise<any[]>;
getPowerpoolGovernance: (root: any, args: any, context: any, info: any) => Promise<any[]>;

@@ -6,0 +6,0 @@ getPowerpoolReceipts: (root: any, args: any, context: any, info: any) => Promise<any[]>;

@@ -9,3 +9,3 @@ "use strict";

getPowerpoolProposals: resolvers_1.resolvers.Query.getProposals,
getPowerpoolDelegates: resolvers_1.resolvers.Query.getDelegates,
getPowerpoolVoters: resolvers_1.resolvers.Query.getVoters,
getPowerpoolGovernance: resolvers_1.resolvers.Query.getGovernance,

@@ -12,0 +12,0 @@ getPowerpoolReceipts: resolvers_1.resolvers.Query.getReceipts,

@@ -19,3 +19,9 @@ export declare type Maybe<T> = T | null;

delegatedVotes: Scalars['String'];
votingPower: Scalars['String'];
voteWeight: Scalars['String'];
proposalsCreated: Scalars['String'];
proposalsVoted: Scalars['String'];
tokenHoldersRepresentedAmount: Scalars['Int'];
quorum: Scalars['String'];
cumulativePower: Scalars['String'];
};

@@ -26,14 +32,14 @@ export declare type Governance = {

hasStaking: Scalars['Boolean'];
currentDelegates: Scalars['Int'];
currentTokenHolders: Scalars['Int'];
delegatedVotes: Scalars['Int'];
paidRewards: Scalars['Float'];
proposalsQueued: Scalars['Int'];
totalDelegates: Scalars['Int'];
totalTokenHolders: Scalars['Int'];
currentDelegates?: Maybe<Scalars['Int']>;
currentTokenHolders?: Maybe<Scalars['Int']>;
delegatedVotes?: Maybe<Scalars['Int']>;
paidRewards?: Maybe<Scalars['Float']>;
proposalsQueued?: Maybe<Scalars['Int']>;
totalDelegates?: Maybe<Scalars['Int']>;
totalTokenHolders?: Maybe<Scalars['Int']>;
totalProposalCount: Scalars['Int'];
totalVotes: Scalars['Int'];
totalVoterCount: Scalars['Int'];
totalStakers: Scalars['Int'];
totalStakedAmount: Scalars['Float'];
totalVotes?: Maybe<Scalars['Int']>;
totalVoterCount?: Maybe<Scalars['Int']>;
totalStakers?: Maybe<Scalars['Int']>;
totalStakedAmount?: Maybe<Scalars['Float']>;
};

@@ -49,3 +55,6 @@ export declare enum ProposalStatus {

Rejected = "rejected",
Wip = "wip"
Wip = "wip",
Initializing = "initializing",
Voting = "voting",
Validating = "validating"
}

@@ -90,3 +99,3 @@ export declare enum VoteType {

export declare type Receipt = {
id: Scalars['ID'];
id?: Maybe<Scalars['ID']>;
proposalId: Scalars['ID'];

@@ -96,47 +105,2 @@ protocol: Scalars['String'];

};
export declare type Metadata = {
metadata?: Maybe<Scalars['String']>;
};
export declare type SnapshotMessagePayload = {
choice: Scalars['Int'];
proposal: Scalars['String'];
metadata: Metadata;
};
export declare type SnapshotMessage = {
timestamp: Scalars['String'];
space: Scalars['String'];
type: Scalars['String'];
version: Scalars['String'];
payload: Array<Maybe<SnapshotMessagePayload>>;
};
export declare type SnapshotVoter = {
address: Scalars['String'];
authorIpfsHash: Scalars['String'];
relayerIpfsHash: Scalars['String'];
sig: Scalars['String'];
msg: SnapshotMessage;
};
export declare type SnapshotProposalMessagePayload = {
end: Scalars['Int'];
body: Scalars['String'];
name: Scalars['String'];
start: Scalars['Int'];
choices: Array<Scalars['String']>;
metadata: Metadata;
snapshot: Scalars['String'];
};
export declare type SnapshotProposalMessage = {
timestamp: Scalars['String'];
space: Scalars['String'];
type: Scalars['String'];
version: Scalars['String'];
payload: Array<Maybe<SnapshotProposalMessagePayload>>;
};
export declare type SnapshotProposal = {
address: Scalars['String'];
msg: SnapshotProposalMessage;
sig: Scalars['String'];
authorIpfsHash: Scalars['String'];
relayerIpfsHash: Scalars['String'];
};
export declare type TokenHolder = {

@@ -149,16 +113,6 @@ id: Scalars['ID'];

};
export declare type Voter = {
activeProtocols?: Maybe<Array<Maybe<Scalars['String']>>>;
allKnownAddresses?: Maybe<Array<Maybe<Scalars['String']>>>;
description: Scalars['String'];
name: Scalars['String'];
hash: Scalars['String'];
imageUrl: Scalars['String'];
tags?: Maybe<Array<Maybe<Scalars['String']>>>;
twitter?: Maybe<Scalars['String']>;
};
export declare type Query = {
__typename?: 'Query';
getPowerpoolProposals: Array<PowerpoolProposal>;
getPowerpoolDelegates: Array<PowerpoolDelegate>;
getPowerpoolVoters: Array<PowerpoolDelegate>;
getPowerpoolGovernance: Array<PowerpoolGovernance>;

@@ -169,14 +123,19 @@ getPowerpoolReceipts: Array<PowerpoolReceipt>;

export declare type QueryGetPowerpoolProposalsArgs = {
pageSize?: Maybe<Scalars['Int']>;
filter?: Maybe<Scalars['String']>;
};
export declare type QueryGetPowerpoolDelegatesArgs = {
export declare type QueryGetPowerpoolVotersArgs = {
pageSize?: Maybe<Scalars['Int']>;
filter?: Maybe<Scalars['String']>;
};
export declare type QueryGetPowerpoolGovernanceArgs = {
pageSize?: Maybe<Scalars['Int']>;
filter?: Maybe<Scalars['String']>;
};
export declare type QueryGetPowerpoolReceiptsArgs = {
pageSize?: Maybe<Scalars['Int']>;
filter?: Maybe<Scalars['String']>;
};
export declare type QueryGetPowerpoolTokenHoldersArgs = {
pageSize?: Maybe<Scalars['Int']>;
filter?: Maybe<Scalars['String']>;

@@ -203,3 +162,3 @@ };

__typename?: 'PowerpoolReceipt';
id: Scalars['ID'];
id?: Maybe<Scalars['ID']>;
proposalId: Scalars['ID'];

@@ -224,2 +183,5 @@ protocol: Scalars['String'];

votes: Array<PowerpoolVote>;
startBlock: Scalars['Int'];
endBlock: Scalars['Int'];
status: Scalars['String'];
};

@@ -231,21 +193,28 @@ export declare type PowerpoolGovernance = Governance & {

hasStaking: Scalars['Boolean'];
currentDelegates: Scalars['Int'];
currentTokenHolders: Scalars['Int'];
delegatedVotes: Scalars['Int'];
paidRewards: Scalars['Float'];
proposalsQueued: Scalars['Int'];
totalDelegates: Scalars['Int'];
totalTokenHolders: Scalars['Int'];
currentDelegates?: Maybe<Scalars['Int']>;
currentTokenHolders?: Maybe<Scalars['Int']>;
delegatedVotes?: Maybe<Scalars['Int']>;
paidRewards?: Maybe<Scalars['Float']>;
proposalsQueued?: Maybe<Scalars['Int']>;
totalDelegates?: Maybe<Scalars['Int']>;
totalTokenHolders?: Maybe<Scalars['Int']>;
totalProposalCount: Scalars['Int'];
totalVotes: Scalars['Int'];
totalVoterCount: Scalars['Int'];
totalStakers: Scalars['Int'];
totalStakedAmount: Scalars['Float'];
id: Scalars['ID'];
proposals: Scalars['Int'];
currentLPDelegates: Scalars['Int'];
totalVotes?: Maybe<Scalars['Int']>;
totalVoterCount?: Maybe<Scalars['Int']>;
totalStakers?: Maybe<Scalars['Int']>;
totalStakedAmount?: Maybe<Scalars['Float']>;
delegatedVotesRaw: Scalars['Int'];
};
export declare type PowerpoolDelegate = {
export declare type PowerpoolDelegate = Delegate & {
__typename?: 'PowerpoolDelegate';
id: Scalars['ID'];
delegatedVotesRaw: Scalars['String'];
delegatedVotes: Scalars['String'];
votingPower: Scalars['String'];
voteWeight: Scalars['String'];
proposalsCreated: Scalars['String'];
proposalsVoted: Scalars['String'];
tokenHoldersRepresentedAmount: Scalars['Int'];
quorum: Scalars['String'];
cumulativePower: Scalars['String'];
lpVotesRaw: Scalars['Int'];

@@ -257,2 +226,5 @@ lpVotes: Scalars['Float'];

proposalIds: Array<Scalars['Int']>;
name?: Maybe<Scalars['String']>;
description?: Maybe<Scalars['String']>;
website?: Maybe<Scalars['String']>;
};

@@ -16,2 +16,5 @@ "use strict";

ProposalStatus["Wip"] = "wip";
ProposalStatus["Initializing"] = "initializing";
ProposalStatus["Voting"] = "voting";
ProposalStatus["Validating"] = "validating";
})(ProposalStatus = exports.ProposalStatus || (exports.ProposalStatus = {}));

@@ -18,0 +21,0 @@ var VoteType;

@@ -1,72 +0,6 @@

export declare const proposalMapper: (proposal: any) => {
id: any;
protocol: string;
proposerId: any;
title: null;
author: any;
startBlock: any;
endBlock: any;
description: any;
status: any;
targets: any;
calldatas: any;
values: any;
executionETA: any;
votes: any;
__typename: string;
};
export declare const delegateMapper: (delegate: any) => {
id: any;
delegatedVotesRaw: any;
delegatedVotes: any;
lpVotesRaw: any;
lpVotes: any;
lpVotesLast: any;
tokenHoldersRepresentedAmount: any;
tokenHoldersRepresented: any;
votes: any;
proposalIds: any;
__typename: string;
};
export declare const governanceMapper: (governance: any) => {
protocol: string;
hasDelegation: boolean;
hasStaking: boolean;
paidRewards: null;
totalProposalCount: null;
totalVotes: null;
totalVoterCount: null;
totalStakers: null;
totalStakedAmount: null;
id: null;
currentLPDelegates: null;
delegatedVotesRaw: null;
proposals: any;
currentDelegates: any;
currentTokenHolders: any;
totalDelegates: any;
totalTokenHolders: any;
delegatedVotes: any;
proposalsQueued: any;
__typename: string;
};
export declare const receiptMapper: (receipt: any) => {
id: any;
protocol: string;
support: any;
votesRaw: any;
votes: any;
proposalId: any;
voterId: any;
__typename: string;
};
export declare const tokenHolderMapper: (tokenHolder: any) => {
id: any;
tokenBalance: any;
tokenBalanceRaw: any;
totalTokensHeld: any;
totalTokensHeldRaw: any;
delegateId: any;
__typename: string;
_: null;
};
import { PowerpoolProposal, PowerpoolDelegate, PowerpoolGovernance, PowerpoolReceipt, PowerpoolTokenHolder } from "./generated/types";
export declare const proposalMapper: (proposal: any) => PowerpoolProposal;
export declare const delegateMapper: (delegate: any) => PowerpoolDelegate;
export declare const governanceMapper: (governance: any) => PowerpoolGovernance;
export declare const receiptMapper: (receipt: any) => PowerpoolReceipt;
export declare const tokenHolderMapper: (tokenHolder: any) => PowerpoolTokenHolder;

@@ -10,3 +10,2 @@ "use strict";

votes: vote.votes,
votesRaw: vote.votesRaw,
proposalId: idMapper(vote.proposal),

@@ -17,6 +16,5 @@ voterId: idMapper(vote.voter),

};
exports.proposalMapper = (proposal) => {
const proposalMapper = (proposal) => {
return {
id: proposal.id,
protocol: "Powerpool",
proposerId: idMapper(proposal.proposer),

@@ -37,3 +35,4 @@ title: null,

};
exports.delegateMapper = (delegate) => {
exports.proposalMapper = proposalMapper;
const delegateMapper = (delegate) => {
return {

@@ -48,8 +47,18 @@ id: delegate.id,

tokenHoldersRepresented: delegate.tokenHoldersRepresented.map(exports.tokenHolderMapper),
votingPower: delegate.delegatedVotes,
voteWeight: (Number(delegate.delegatedVotes) / 100000000 * 100).toFixed(6),
proposalsCreated: delegate.proposals.length,
proposalsVoted: delegate.votes.length,
votes: delegate.votes.map(voteMapper),
proposalIds: delegate.proposals.map(idMapper),
name: delegate.name ? delegate.name : null,
description: delegate.description ? delegate.description : null,
website: delegate.website ? delegate.website : null,
cumulativePower: '0',
quorum: '0',
__typename: "PowerpoolDelegate"
};
};
exports.governanceMapper = (governance) => {
exports.delegateMapper = delegateMapper;
const governanceMapper = (governance) => {
return {

@@ -60,3 +69,3 @@ protocol: "Powerpool",

paidRewards: null,
totalProposalCount: null,
totalProposalCount: governance.proposals,
totalVotes: null,

@@ -66,6 +75,3 @@ totalVoterCount: null,

totalStakedAmount: null,
id: null,
currentLPDelegates: null,
delegatedVotesRaw: null,
proposals: governance.proposals,
delegatedVotesRaw: governance.delegatedVotesRaw,
currentDelegates: governance.currentDelegates,

@@ -80,3 +86,4 @@ currentTokenHolders: governance.currentTokenHolders,

};
exports.receiptMapper = (receipt) => {
exports.governanceMapper = governanceMapper;
const receiptMapper = (receipt) => {
return {

@@ -93,3 +100,4 @@ id: receipt.id,

};
exports.tokenHolderMapper = (tokenHolder) => {
exports.receiptMapper = receiptMapper;
const tokenHolderMapper = (tokenHolder) => {
return {

@@ -103,5 +111,5 @@ id: tokenHolder.id,

__typename: "PowerpoolTokenHolder",
_: null,
};
};
exports.tokenHolderMapper = tokenHolderMapper;
//# sourceMappingURL=mappers.js.map

@@ -1,10 +0,10 @@

export declare const getProposalsResolver: () => Promise<any>;
export declare const getDelegatesResolver: () => Promise<any>;
export declare const getGovernanceResolver: () => Promise<any>;
export declare const getReceiptsResolver: () => Promise<any>;
export declare const getTokenHoldersResolver: () => Promise<any>;
export declare const getProposalsResolver: (_: any, args: any) => Promise<any>;
export declare const getVotersResolver: (_: any, args: any) => Promise<any[]>;
export declare const getGovernanceResolver: (_: any, args: any) => Promise<any>;
export declare const getReceiptsResolver: (_: any, args: any) => Promise<any>;
export declare const getTokenHoldersResolver: (_: any, args: any) => Promise<any>;
export declare const resolvers: {
Query: {
getProposals: (root: any, args: any, context: any, info: any) => Promise<any[]>;
getDelegates: (root: any, args: any, context: any, info: any) => Promise<any[]>;
getVoters: (root: any, args: any, context: any, info: any) => Promise<any[]>;
getGovernance: (root: any, args: any, context: any, info: any) => Promise<any[]>;

@@ -11,0 +11,0 @@ getReceipts: (root: any, args: any, context: any, info: any) => Promise<any[]>;

@@ -6,11 +6,12 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.resolvers = exports.getTokenHoldersResolver = exports.getReceiptsResolver = exports.getGovernanceResolver = exports.getDelegatesResolver = exports.getProposalsResolver = void 0;
exports.resolvers = exports.getTokenHoldersResolver = exports.getReceiptsResolver = exports.getGovernanceResolver = exports.getVotersResolver = exports.getProposalsResolver = void 0;
const dist_1 = require("@boardroom/base/dist");
const graphql_tag_1 = __importDefault(require("graphql-tag"));
const dist_2 = require("../../base/dist");
const mappers_1 = require("./mappers");
const graphQLFetcher = new dist_1.GraphqlFetcher('https://api.thegraph.com/subgraphs/name/powerpool-finance/powerpool-governance');
exports.getProposalsResolver = async () => {
const getProposalsResolver = async (_, args) => {
const query = graphql_tag_1.default `
{
proposals(last: 100) {
proposals(first: ${(args && args.pageSize) || 1000}) {
id

@@ -47,6 +48,7 @@ proposer {

};
exports.getDelegatesResolver = async () => {
exports.getProposalsResolver = getProposalsResolver;
const getVotersResolver = async (_, args) => {
const query = graphql_tag_1.default `
{
delegates(last: 1000) {
delegates(first: ${(args && args.pageSize) || 1000}) {
id

@@ -88,6 +90,17 @@ delegatedVotesRaw

const data = await graphQLFetcher.query(query);
const formattedDelegates = data.delegates.map(mappers_1.delegateMapper);
return formattedDelegates;
const addresses = data.delegates.map((v) => v.id);
const metadata = await dist_1.get3BoxProfiles(addresses);
const combinedData = data.delegates.map((v) => {
return {
...v,
name: metadata[v.id]?.name,
description: metadata[v.id]?.description,
website: metadata[v.id]?.website
};
});
const formattedDelegates = combinedData.map(mappers_1.delegateMapper);
return dist_2.setQuorum(formattedDelegates);
};
exports.getGovernanceResolver = async () => {
exports.getVotersResolver = getVotersResolver;
const getGovernanceResolver = async (_, args) => {
const query = graphql_tag_1.default `

@@ -102,2 +115,3 @@ {

delegatedVotes
delegatedVotesRaw
proposalsQueued

@@ -108,9 +122,10 @@ }

const data = await graphQLFetcher.query(query);
const formatteboardroomernance = data.governances.map(mappers_1.governanceMapper)[0];
const formatteboardroomernance = data.governances.map(mappers_1.governanceMapper);
return formatteboardroomernance;
};
exports.getReceiptsResolver = async () => {
exports.getGovernanceResolver = getGovernanceResolver;
const getReceiptsResolver = async (_, args) => {
const query = graphql_tag_1.default `
{
votes(last: 1000) {
votes(first: ${(args && args.pageSize) || 1000}) {
id

@@ -133,6 +148,7 @@ support

};
exports.getTokenHoldersResolver = async () => {
exports.getReceiptsResolver = getReceiptsResolver;
const getTokenHoldersResolver = async (_, args) => {
const query = graphql_tag_1.default `
{
tokenHolders(last: 1000) {
tokenHolders(first: ${(args && args.pageSize) || 1000}) {
id

@@ -153,6 +169,7 @@ tokenBalance

};
exports.getTokenHoldersResolver = getTokenHoldersResolver;
exports.resolvers = {
Query: {
getProposals: dist_1.addFilter(exports.getProposalsResolver),
getDelegates: dist_1.addFilter(exports.getDelegatesResolver),
getVoters: dist_1.addFilter(exports.getVotersResolver),
getGovernance: dist_1.addFilter(exports.getGovernanceResolver),

@@ -159,0 +176,0 @@ getReceipts: dist_1.addFilter(exports.getReceiptsResolver),

{
"name": "@boardroom/powerpool",
"version": "1.0.0-alpha.4",
"version": "2.0.0-alpha.0",
"main": "./dist/index.js",

@@ -16,3 +16,3 @@ "files": [

"dependencies": {
"@boardroom/base": "^1.0.0-alpha.4",
"@boardroom/base": "^2.0.0-alpha.0",
"graphql": "^15.3.0",

@@ -34,3 +34,3 @@ "graphql-tag": "^1.0.0"

"ts-jest": {
"tsConfig": false
"tsconfig": false
}

@@ -42,3 +42,3 @@ },

},
"gitHead": "7c7669ee03bce90d269f85be15407b1ac92ba787"
"gitHead": "045b162bbfe402f0a3fc6655c7eef7614a174da8"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc