-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa4eb26
commit 446f1f9
Showing
4 changed files
with
119 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export async function GET(request: Request) { | ||
const { searchParams } = new URL(request.url); | ||
const id = searchParams.get("id"); | ||
|
||
if (!id) { | ||
throw new Error("no id"); | ||
} | ||
|
||
const res = await fetch( | ||
`https://explorer-test-side02.aelf.io/api/proposal/proposalInfo?proposalId=${id}` | ||
); | ||
const data = await res.json(); | ||
|
||
return Response.json(data); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
export interface ProposalInfo { | ||
msg: string; | ||
code: number; | ||
data: Data; | ||
} | ||
|
||
export interface Data { | ||
proposal: Proposal; | ||
bpList: string[]; | ||
organization: Organization; | ||
parliamentProposerList: any[]; | ||
} | ||
|
||
export interface Proposal { | ||
createAt: string; | ||
expiredTime: string; | ||
approvals: number; | ||
rejections: number; | ||
abstentions: number; | ||
leftInfo: LeftInfo; | ||
releasedTime: string; | ||
id: number; | ||
orgAddress: string; | ||
createTxId: string; | ||
proposalId: string; | ||
proposer: string; | ||
contractAddress: string; | ||
contractMethod: string; | ||
contractParams: string; | ||
status: string; | ||
releasedTxId: string; | ||
createdBy: string; | ||
isContractDeployed: boolean; | ||
proposalType: string; | ||
canVote: boolean; | ||
votedStatus: string; | ||
} | ||
|
||
export interface LeftInfo { | ||
organizationAddress: string; | ||
} | ||
|
||
export interface Organization { | ||
createdAt: string; | ||
updatedAt: string; | ||
releaseThreshold: ReleaseThreshold; | ||
leftOrgInfo: LeftOrgInfo; | ||
orgAddress: string; | ||
orgHash: string; | ||
txId: string; | ||
creator: string; | ||
proposalType: string; | ||
} | ||
|
||
export interface ReleaseThreshold { | ||
minimalApprovalThreshold: string; | ||
maximalRejectionThreshold: string; | ||
maximalAbstentionThreshold: string; | ||
minimalVoteThreshold: string; | ||
} | ||
|
||
export interface LeftOrgInfo { | ||
proposerAuthorityRequired: boolean; | ||
parliamentMemberProposingAllowed: boolean; | ||
creationToken: any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters