> For the complete documentation index, see [llms.txt](https://andrewkimjoseph.gitbook.io/celina-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://andrewkimjoseph.gitbook.io/celina-sdk/services/governanceservice.md).

# GovernanceService

[**@andrewkimjoseph/celina-sdk**](/celina-sdk/api-reference/api-reference.md)

***

[@andrewkimjoseph/celina-sdk](/celina-sdk/api-reference/api-reference.md) / [services/governance.service](https://github.com/andrewkimjoseph/celina-sdk/tree/main/docs/api-reference/services/governance.service/README.md) / GovernanceService

## Class: GovernanceService

Defined in: [src/services/governance.service.ts:127](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L127)

Celo on-chain governance proposal reads, CGP enrichment, and LockedGold writes.

### Constructors

#### Constructor

> **new GovernanceService**(`clientFactory`): `GovernanceService`

Defined in: [src/services/governance.service.ts:130](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L130)

**Parameters**

**clientFactory**

`CeloClientFactory`

**Returns**

`GovernanceService`

### Methods

#### getActionableGovernanceProposals()

> **getActionableGovernanceProposals**(): `Promise`<{ `hasAny`: `boolean`; `hasQueued`: `boolean`; `hasReferendum`: `boolean`; `message`: `string`; `network`: `"mainnet"`; `queued`: `object`\[]; `referendum`: `object`\[]; }>

Defined in: [src/services/governance.service.ts:501](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L501)

Queued and Referendum proposals you can upvote or vote on now.

**Returns**

`Promise`<{ `hasAny`: `boolean`; `hasQueued`: `boolean`; `hasReferendum`: `boolean`; `message`: `string`; `network`: `"mainnet"`; `queued`: `object`\[]; `referendum`: `object`\[]; }>

***

#### getDequeueWithIndices()

> **getDequeueWithIndices**(): `Promise`<`object`\[]>

Defined in: [src/services/governance.service.ts:427](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L427)

Raw getDequeue with positional indices preserved for Governance.vote().

**Returns**

`Promise`<`object`\[]>

***

#### getGovernanceProposals()

> **getGovernanceProposals**(`options?`): `Promise`<{ `network`: `"mainnet"`; `pagination`: { `hasMore`: `boolean`; `limit`: `number`; `offset`: `number`; `page`: `number`; `pageSize`: `number`; `total`: `number`; `totalPages`: `number`; }; `proposals`: `object`\[]; }>

Defined in: [src/services/governance.service.ts:309](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L309)

List governance proposals with pagination and optional CGP metadata.

**Parameters**

**options?**

[`GovernanceProposalsOptions`](/celina-sdk/types/governanceproposalsoptions.md) = `{}`

Pagination (`page`/`pageSize` or `offset`/`limit`) and filters

**Returns**

`Promise`<{ `network`: `"mainnet"`; `pagination`: { `hasMore`: `boolean`; `limit`: `number`; `offset`: `number`; `page`: `number`; `pageSize`: `number`; `total`: `number`; `totalPages`: `number`; }; `proposals`: `object`\[]; }>

Proposals with stage names, vote totals, and optional CGP frontmatter

***

#### getGovernanceVotes()

> **getGovernanceVotes**(`address`, `options?`): `Promise`<{ `address`: `` `0x${string}` ``; `goldUsedForVoting`: `string`; `goldUsedForVotingFormatted`: `string`; `message`: `string`; `network`: `"mainnet"`; `queriedAddress?`: `` `0x${string}` ``; `referendumVotes`: `object`\[]; `upvote`: { `proposalId`: `number`; `weight`: `string`; `weightFormatted`: `string`; } | `null`; }>

Defined in: [src/services/governance.service.ts:531](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L531)

Referendum votes and queue upvotes cast by an address on Celo governance.

**Parameters**

**address**

`` `0x${string}` ``

**options?**

[`GovernanceVotesOptions`](https://github.com/andrewkimjoseph/celina-sdk/tree/main/docs/api-reference/services/governance.service/interfaces/GovernanceVotesOptions.md) = `{}`

**Returns**

`Promise`<{ `address`: `` `0x${string}` ``; `goldUsedForVoting`: `string`; `goldUsedForVotingFormatted`: `string`; `message`: `string`; `network`: `"mainnet"`; `queriedAddress?`: `` `0x${string}` ``; `referendumVotes`: `object`\[]; `upvote`: { `proposalId`: `number`; `weight`: `string`; `weightFormatted`: `string`; } | `null`; }>

***

#### getLockedCeloBalance()

> **getLockedCeloBalance**(`address`): `Promise`<{ `address`: `` `0x${string}` ``; `delegatedFraction`: `string`; `governanceVotingPower`: `string`; `governanceVotingPowerFormatted`: `string`; `network`: `"mainnet"`; `nonvotingLocked`: `string`; `nonvotingLockedFormatted`: `string`; `totalLocked`: `string`; `totalLockedFormatted`: `string`; }>

Defined in: [src/services/governance.service.ts:658](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L658)

Locked CELO balances and governance voting power for an address.

**Parameters**

**address**

`` `0x${string}` ``

**Returns**

`Promise`<{ `address`: `` `0x${string}` ``; `delegatedFraction`: `string`; `governanceVotingPower`: `string`; `governanceVotingPowerFormatted`: `string`; `network`: `"mainnet"`; `nonvotingLocked`: `string`; `nonvotingLockedFormatted`: `string`; `totalLocked`: `string`; `totalLockedFormatted`: `string`; }>

***

#### getPendingWithdrawals()

> **getPendingWithdrawals**(`address`): `Promise`<{ `address`: `` `0x${string}` ``; `matureCount`: `number`; `network`: `"mainnet"`; `unlockingPeriodSeconds`: `number`; `withdrawals`: `object`\[]; }>

Defined in: [src/services/governance.service.ts:708](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L708)

Pending LockedGold withdrawals with maturity timestamps.

**Parameters**

**address**

`` `0x${string}` ``

**Returns**

`Promise`<{ `address`: `` `0x${string}` ``; `matureCount`: `number`; `network`: `"mainnet"`; `unlockingPeriodSeconds`: `number`; `withdrawals`: `object`\[]; }>

***

#### getProposalDetails()

> **getProposalDetails**(`proposalId`): `Promise`<{ `content`: `null`; `error`: `string`; `network`: `"mainnet"`; `proposal`: `null`; } | { `content`: `string` | `null`; `error`: `null`; `network`: `"mainnet"`; `proposal`: { `deposit`: `string`; `expiryTimestamp`: `number` | `null`; `id`: `number`; `isApproved`: `boolean`; `metadata`: `Record`<`string`, `unknown`> | `null`; `networkWeight`: `string`; `numTransactions`: `number`; `proposer`: `string`; `stage`: `number`; `stageName`: `"Approval"` | `"None"` | `"Queued"` | `"Referendum"` | `"Execution"` | `"Executed"` | `"Expiration"` | `"Rejected"` | `"Withdrawn"`; `timestamp`: `number`; `upvotes`: `number`; `url`: `string`; `votes`: { `abstain`: `string`; `no`: `string`; `yes`: `string`; }; }; }>

Defined in: [src/services/governance.service.ts:392](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L392)

Full details for a single proposal, including CGP markdown body when available.

**Parameters**

**proposalId**

`number`

On-chain governance proposal id

**Returns**

`Promise`<{ `content`: `null`; `error`: `string`; `network`: `"mainnet"`; `proposal`: `null`; } | { `content`: `string` | `null`; `error`: `null`; `network`: `"mainnet"`; `proposal`: { `deposit`: `string`; `expiryTimestamp`: `number` | `null`; `id`: `number`; `isApproved`: `boolean`; `metadata`: `Record`<`string`, `unknown`> | `null`; `networkWeight`: `string`; `numTransactions`: `number`; `proposer`: `string`; `stage`: `number`; `stageName`: `"Approval"` | `"None"` | `"Queued"` | `"Referendum"` | `"Execution"` | `"Executed"` | `"Expiration"` | `"Rejected"` | `"Withdrawn"`; `timestamp`: `number`; `upvotes`: `number`; `url`: `string`; `votes`: { `abstain`: `string`; `no`: `string`; `yes`: `string`; }; }; }>

Proposal record, CGP content, or `{ proposal: null, error }` if missing

***

#### getQueuedProposals()

> **getQueuedProposals**(): `Promise`<{ `message`: `string`; `network`: `"mainnet"`; `proposals`: `object`\[]; }>

Defined in: [src/services/governance.service.ts:472](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L472)

Proposals currently in Queue stage with upvote weight.

**Returns**

`Promise`<{ `message`: `string`; `network`: `"mainnet"`; `proposals`: `object`\[]; }>

***

#### getVotableProposals()

> **getVotableProposals**(): `Promise`<{ `message`: `string`; `network`: `"mainnet"`; `proposals`: `object`\[]; }>

Defined in: [src/services/governance.service.ts:442](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L442)

Proposals currently in Referendum stage with their dequeue index.

**Returns**

`Promise`<{ `message`: `string`; `network`: `"mainnet"`; `proposals`: `object`\[]; }>

***

#### prepareLockCelo()

> **prepareLockCelo**(`from`, `amount`): `Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

Defined in: [src/services/governance.service.ts:784](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L784)

Lock CELO, relocking matured pending withdrawals first (reverse index order).

**Parameters**

**from**

`` `0x${string}` ``

**amount**

`string`

**Returns**

`Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

***

#### prepareRelockCelo()

> **prepareRelockCelo**(`from`, `index`, `amount`): `Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

Defined in: [src/services/governance.service.ts:866](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L866)

**Parameters**

**from**

`` `0x${string}` ``

**index**

`number`

**amount**

`string`

**Returns**

`Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

***

#### prepareRevokeGovernanceUpvote()

> **prepareRevokeGovernanceUpvote**(`from`, `options?`): `Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

Defined in: [src/services/governance.service.ts:1075](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L1075)

Revoke the account's active queue upvote.

**Parameters**

**from**

`` `0x${string}` ``

**options?**

[`GovernanceRevokeUpvoteOptions`](https://github.com/andrewkimjoseph/celina-sdk/tree/main/docs/api-reference/services/governance.service/interfaces/GovernanceRevokeUpvoteOptions.md) = `{}`

**Returns**

`Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

***

#### prepareRevokeGovernanceVotes()

> **prepareRevokeGovernanceVotes**(`from`): `Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

Defined in: [src/services/governance.service.ts:1043](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L1043)

Revoke all active referendum votes for an account (bulk on-chain).

**Parameters**

**from**

`` `0x${string}` ``

**Returns**

`Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

***

#### prepareUnlockCelo()

> **prepareUnlockCelo**(`from`, `amount`): `Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

Defined in: [src/services/governance.service.ts:841](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L841)

**Parameters**

**from**

`` `0x${string}` ``

**amount**

`string`

**Returns**

`Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

***

#### prepareUpvote()

> **prepareUpvote**(`from`, `proposalId`): `Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

Defined in: [src/services/governance.service.ts:972](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L972)

Upvote a Queued governance proposal (one active queue upvote per account).

**Parameters**

**from**

`` `0x${string}` ``

**proposalId**

`number`

**Returns**

`Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

***

#### prepareVote()

> **prepareVote**(`from`, `proposalId`, `vote`): `Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

Defined in: [src/services/governance.service.ts:930](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L930)

**Parameters**

**from**

`` `0x${string}` ``

**proposalId**

`number`

**vote**

`"None"` | `"Abstain"` | `"No"` | `"Yes"`

**Returns**

`Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

***

#### prepareWithdrawCelo()

> **prepareWithdrawCelo**(`from`): `Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>

Defined in: [src/services/governance.service.ts:896](https://github.com/andrewkimjoseph/celina-sdk/blob/c35fe1db07a45a3cd14b2185df4abf2e6a2ec609/src/services/governance.service.ts#L896)

Withdraw all matured pending withdrawals.

**Parameters**

**from**

`` `0x${string}` ``

**Returns**

`Promise`<[`SerializedPreparedFlow`](/celina-sdk/types/serializedpreparedflow.md)>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://andrewkimjoseph.gitbook.io/celina-sdk/services/governanceservice.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
