nance-eth / nance-interface

An Interface of Nance platform
https://nance.app
4 stars 0 forks source link

use nance-sdk in nance-interface #109

Open twodam opened 1 year ago

twodam commented 1 year ago
jigglyjams commented 1 year ago

we should update Proposal type. Currently has a lot of legacy things from notion

Currently:

export interface Proposal {
  hash: string;
  title: string;
  body?: string;
  governanceCycle?: number;
  date?: string,
  status: string;
  proposalId: number | null;
  author?: string;
  coauthors?: string[];
  discussionThreadURL: string;
  ipfsURL: string;
  voteURL: string;
  voteSetup?: SnapshotVoteOptions;
  internalVoteResults?: InternalVoteResults;
  voteResults?: VoteResults;
  version?: string;
  authorAddress?: string;
  authorDiscordId?: string;
  temperatureCheckVotes?: number[];
  createdTime?: Date;
  lastEditedTime?: Date;
  actions?: Action[];
}

I am using a different type internally called SQLProposal

can we just unify on SQLProposal and rename to Proposal

export type SQLProposal = {
  uuid: string;
  createdTime: Date;
  lastEditedTime: Date;
  title: string;
  body: string;
  authorAddress: string;
  coauthors: string[];
  authorDiscordId?: string;
  proposalStatus: string;
  proposalId?: number;
  temperatureCheckVotes: number[];
  snapshotId?: string;
  voteType: string;
  choices: string[];
  snapshotVotes: number[];
  voteAddressCount: number;
  governanceCycle: number;
  discussionURL?: string;
  ipfsCID?: string;
  actions: Action[];
};
jigglyjams commented 1 year ago

https://www.npmjs.com/package/@nance/nance-sdk live preview of demo: https://nance-sdk.vercel.app/

twodam commented 1 year ago

should add functions to support vanilla js fetch in case client is not using React