Table of Contents

Class DAOWallet

Namespace
chia.dotnet
Assembly
chia-dotnet.dll

Wraps a DAO Wallet

public sealed class DAOWallet : Wallet
Inheritance
DAOWallet
Inherited Members
Extension Methods

Remarks

ctor

Constructors

DAOWallet(uint, WalletProxy)

Wraps a DAO Wallet

public DAOWallet(uint walletId, WalletProxy walletProxy)

Parameters

walletId uint

The wallet_id to wrap

walletProxy WalletProxy

Wallet RPC proxy to use for communication

Remarks

ctor

Methods

AddFundsToTreasury(ulong, uint, ulong, CancellationToken)

Adds funds to a DAO's treasury.

public Task<(string TxId, TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)> AddFundsToTreasury(ulong amount, uint fundingWalletId, ulong fee = 0, CancellationToken cancellationToken = default)

Parameters

amount ulong
fundingWalletId uint
fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(string TxId, TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)>

AdjustFilterLevel(ulong, CancellationToken)

Adjusts the DAO filter level.

public Task<DAOInfo> AdjustFilterLevel(ulong filterLevel, CancellationToken cancellationToken = default)

Parameters

filterLevel ulong
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<DAOInfo>

DAOInfo

CloseProposal(string, string, string, ulong, CancellationToken)

Closes a DAO proposal.

public Task<(string txId, TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)> CloseProposal(string selfDestruct, string genesisId, string proposalId, ulong fee = 0, CancellationToken cancellationToken = default)

Parameters

selfDestruct string
genesisId string
proposalId string
fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(string TxId, TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)>

CreateProposal(string, CancellationToken)

Creates a DAO proposal.

public Task<(string ProposalId, string TxId, TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)> CreateProposal(string proposalType, CancellationToken cancellationToken = default)

Parameters

proposalType string
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(string ProposalId, string TxId, TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)>

ExitLockup(IEnumerable<object>, ulong, CancellationToken)

Exits the DAO lockup period.

public Task<(string TxId, TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)> ExitLockup(IEnumerable<object> coins, ulong fee = 0, CancellationToken cancellationToken = default)

Parameters

coins IEnumerable<object>
fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(string TxId, TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)>

FreeCoinsFromFinishedProposals(ulong, CancellationToken)

Frees coins from proposals that are finished.

public Task<(string TxId, TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)> FreeCoinsFromFinishedProposals(ulong fee = 0, CancellationToken cancellationToken = default)

Parameters

fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(string TxId, TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)>

GetProposalState(string, CancellationToken)

Use this to figure out whether a proposal has passed or failed and whether it can be closed Given a proposal_id:

  • if required yes votes are recorded then proposal passed.
  • if time lock and attendance are met then proposal can close Returns a dict of passed and closable bools, and the remaining votes/blocks needed

Note that a proposal can be in a passed and closable state now, but become failed if a large number of 'no' votes are received before the soft close is reached.

public Task<ProposalState> GetProposalState(string proposalId, CancellationToken cancellationToken = default)

Parameters

proposalId string
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<ProposalState>

ProposalState

GetProposals(bool, CancellationToken)

Get all proposals for a given dao wallet.

public Task<(IEnumerable<ProposalInfo> Proposals, ulong ProposalTimelock, ulong SoftCloseLength)> GetProposals(bool includeClosed = true, CancellationToken cancellationToken = default)

Parameters

includeClosed bool
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(IEnumerable<ProposalInfo> Proposals, ulong ProposalTimelock, ulong SoftCloseLength)>

GetRules(CancellationToken)

Retrieves the rules of a DAO wallet.

public Task<DAORules> GetRules(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<DAORules>

DAORules

GetTreasuryBalance(CancellationToken)

Retrieves the balance of a DAO's treasury.

public Task<IDictionary<string, BigInteger>> GetTreasuryBalance(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<IDictionary<string, BigInteger>>

GetTreasuryId(CancellationToken)

Retrieves the treasury id of a DAO wallet.

public Task<string> GetTreasuryId(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<string>

string

ParseProposal(string, CancellationToken)

Parses a DAO proposal.

public Task<IDictionary<string, object>> ParseProposal(string proposalId, CancellationToken cancellationToken = default)

Parameters

proposalId string
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<IDictionary<string, object>>

Dictionary

SendToLockup(ulong, ulong, CancellationToken)

Sends the DAO to lockup.

public Task<(string TxId, TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)> SendToLockup(ulong amount, ulong fee = 0, CancellationToken cancellationToken = default)

Parameters

amount ulong
fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(string TxId, TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)>

Validate(CancellationToken)

Validates that WalletId is a DAO

public override Task Validate(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Wraps a DAO Wallet

Returns

Task

True if the wallet is a DAO wallet

VoteOnProposal(bool, ulong, string, ulong, CancellationToken)

Vote on a DAO proposal.

public Task<(string TxId, TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)> VoteOnProposal(bool isYesVote, ulong voteAmount, string proposalId, ulong fee = 0, CancellationToken cancellationToken = default)

Parameters

isYesVote bool
voteAmount ulong
proposalId string
fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(string TxId, TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)>