Skip to content

Treasury

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / Treasury

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9565

Treasury class - manages DAO treasury with multi-sig support

get treasuryId(): string

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9580

string


get name(): string

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9581

string


get chain(): ChainId

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9582

ChainId


get signingThreshold(): number

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9583

number


get members(): TreasuryMember[]

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9584

TreasuryMember[]


get masterViewingKey(): ViewingKey | undefined

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9585

ViewingKey | undefined

static create(params): Promise<Treasury>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9575

Create a new treasury

CreateTreasuryParams

Promise<Treasury>


static fromConfig(config): Treasury

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9579

Load a treasury from config

TreasuryConfig

Treasury


getConfig(): TreasuryConfig

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9589

Get treasury configuration

TreasuryConfig


getMember(address): TreasuryMember | undefined

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9593

Get a member by address

string

TreasuryMember | undefined


isSigner(address): boolean

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9597

Check if an address is a signer

string

boolean


canCreateProposal(address): boolean

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9601

Check if an address can create proposals

string

boolean


getSigners(): TreasuryMember[]

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9605

Get all signers

TreasuryMember[]


createPaymentProposal(params): Promise<TreasuryProposal>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9609

Create a single payment proposal

CreatePaymentProposalParams

Promise<TreasuryProposal>


createBatchProposal(params): Promise<TreasuryProposal>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9613

Create a batch payment proposal

CreateBatchProposalParams

Promise<TreasuryProposal>


getProposal(proposalId): TreasuryProposal | undefined

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9617

Get a proposal by ID

string

TreasuryProposal | undefined


getAllProposals(): TreasuryProposal[]

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9621

Get all proposals

TreasuryProposal[]


getPendingProposals(): TreasuryProposal[]

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9625

Get pending proposals

TreasuryProposal[]


signProposal(proposalId, signerAddress, privateKey, approve?): Promise<TreasuryProposal>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9629

Sign a proposal

string

string

`0x${string}`

boolean

Promise<TreasuryProposal>


executeProposal(proposalId): Promise<ShieldedPayment[]>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9633

Execute an approved proposal

string

Promise<ShieldedPayment[]>


cancelProposal(proposalId, cancellerAddress): TreasuryProposal

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9637

Cancel a proposal (only by proposer or owner)

string

string

TreasuryProposal


grantAuditorAccess(auditorId, auditorName, granterAddress, scope?, validUntil?): AuditorViewingKey

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9641

Grant viewing access to an auditor

string

string

string

"all" | "inbound" | "outbound"

number

AuditorViewingKey


revokeAuditorAccess(auditorId, revokerAddress): boolean

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9645

Revoke auditor access

string

string

boolean


getAuditorKeys(): AuditorViewingKey[]

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9649

Get all auditor keys

AuditorViewingKey[]


updateBalance(token, balance): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9653

Update balance for a token (called after deposits/withdrawals)

Asset

bigint

void


getBalance(token): TreasuryBalance | undefined

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9657

Get balance for a token

Asset

TreasuryBalance | undefined


getAllBalances(): TreasuryBalance[]

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9661

Get all balances

TreasuryBalance[]


toJSON(): string

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9669

Serialize treasury to JSON

string


static fromJSON(json): Treasury

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9673

Deserialize treasury from JSON

string

Treasury