Module-level declarations

Types

Link copied to clipboard

Functions

Link copied to clipboard
function map_command(command: command): (command_id: rowid, name: text, description: text, is_executed: boolean)
Link copied to clipboard
function map_option(option_item: option_item): (option_id: rowid, proposal_id: rowid, option: text, total_vote: big_integer, (command_id: rowid, name: text, description: text, is_executed: boolean)?)
Link copied to clipboard
function map_proposal(proposal: proposal): (id: rowid, author_id: byte_array, author_type: citizen_types, category: text, title: text, description: text, state: proposal_state, duration: integer, start_timestamp: integer, end_timestamp: integer, options: list<(option_id: rowid, proposal_id: rowid, option: text, total_vote: big_integer, (command_id: rowid, name: text, description: text, is_executed: boolean)?)>, winner_option: text, approvals_response?)
Link copied to clipboard
function map_proposal_with_vote_requirements(proposal: proposal): (id: rowid, author_id: byte_array, author_type: citizen_types, category: text, title: text, description: text, state: proposal_state, duration: integer, start_timestamp: integer, end_timestamp: integer, options: list<(option_id: rowid, proposal_id: rowid, option: text, total_vote: big_integer, (command_id: rowid, name: text, description: text, is_executed: boolean)?)>, winner_option: text, (id: rowid, proposal_id: rowid, contract_address: byte_array, required_amount: big_integer, map<text, gtv>?))
Link copied to clipboard
function map_vote_requirements(vote_requirements: vote_requirements): (id: rowid, proposal_id: rowid, contract_address: byte_array, required_amount: big_integer, map<text, gtv>?)
Link copied to clipboard
function validate_create_draft_proposal(title: text, category: text, duration: integer, options: list<option_spec>, vote_requirements: vote_requirements_struct)

Queries

Link copied to clipboard
@mount("proposals.external.get_categories") query get_categories(page_cursor: text): paged_result

Retrieves a paginated list of proposal categories.

Link copied to clipboard
@mount("proposals.external.get_last_submitted_proposal") query get_last_submitted_proposal(): (id: rowid, author_id: byte_array, author_type: citizen_types, category: text, title: text, description: text, state: proposal_state, duration: integer, start_timestamp: integer, end_timestamp: integer, options: list<(option_id: rowid, proposal_id: rowid, option: text, total_vote: big_integer, (command_id: rowid, name: text, description: text, is_executed: boolean)?)>, winner_option: text, approvals_response?)?

Retrieves the most recently submitted proposal.

Link copied to clipboard
@mount("proposals.external.get_option_item_by_id") query get_option_item_by_id(opt_id: rowid): (option_id: rowid, proposal_id: rowid, option: text, total_vote: big_integer, (command_id: rowid, name: text, description: text, is_executed: boolean)?)?

Retrieves an option item by its ID.

Link copied to clipboard
@mount("proposals.external.get_option_items_of_proposal") query get_option_items_of_proposal(prop_id: rowid): list<(option_id: rowid, proposal_id: rowid, option: text, total_vote: big_integer, (command_id: rowid, name: text, description: text, is_executed: boolean)?)>

Retrieves all option items associated with a specific proposal.

@mount("proposals.external.get_paginated_proposals_sorted_by_sort_type") query get_paginated_proposals_sorted_by_sort_type(page_cursor: text, sort_direction: text, filter: filter, caller_account_id: byte_array?, sort_type: text?): paged_result

Retrieves a paginated list of proposals, sorted by a specified sort type or the default sorting order.

Link copied to clipboard
@mount("proposals.external.get_proposal_by_id") query get_proposal_by_id(prop_id: rowid): (id: rowid, author_id: byte_array, author_type: citizen_types, category: text, title: text, description: text, state: proposal_state, duration: integer, start_timestamp: integer, end_timestamp: integer, options: list<(option_id: rowid, proposal_id: rowid, option: text, total_vote: big_integer, (command_id: rowid, name: text, description: text, is_executed: boolean)?)>, winner_option: text, approvals_response?)?

Retrieves a proposal by its ID.

Link copied to clipboard
@mount("proposals.external.get_proposals_by_author") query get_proposals_by_author(page_cursor: text, author_acc_id: byte_array): paged_result

Retrieves a paginated list of proposals submitted by a specific author.

Link copied to clipboard
@mount("proposals.external.get_proposals_sorted_by_end_timestamp") query get_proposals_sorted_by_end_timestamp(page_cursor: text, sort_direction: text, filter: filter, caller_account_id: byte_array?): paged_result

Retrieves a paginated list of proposals, sorted by their end timestamp in the specified direction.

Link copied to clipboard
@mount("proposals.external.get_proposals_sorted_by_start_timestamp") query get_proposals_sorted_by_start_timestamp(page_cursor: text, sort_direction: text, filter: filter, caller_account_id: byte_array?): paged_result

Retrieves a paginated list of proposals, sorted by their start timestamp in the specified direction.

Operations

Link copied to clipboard
@mount("proposals.external.change_proposal_config") operation change_proposal_config(max_end_time: integer?, max_option_item: integer?)

Changes the configuration settings for proposals.

Link copied to clipboard
@mount("proposals.external.create_draft_proposal") operation create_draft_proposal(title: text, category: text, duration: integer, description: text, options: list<option_spec>, vote_requirements: vote_requirements_struct)

Creates a draft proposal and initializes voting requirements.

Link copied to clipboard
@mount("proposals.external.finalize_proposal") operation finalize_proposal(proposal_id: rowid)

Finalizes a proposal, marking it as complete and preventing further modifications.

Link copied to clipboard
@mount("proposals.external.start_voting_on_proposal") operation start_voting_on_proposal(proposal: proposal, start_time: integer)

Initiates the voting process for a proposal.

Link copied to clipboard
@mount("proposals.external.verify_draft_proposal") operation verify_draft_proposal(proposal_id: rowid)

Verifies a draft proposal, confirming its readiness for further actions.