Class DAOWallet
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
uintThe wallet_id to wrap
walletProxy
WalletProxyWallet 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
ulongfundingWalletId
uintfee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
AdjustFilterLevel(ulong, CancellationToken)
Adjusts the DAO filter level.
public Task<DAOInfo> AdjustFilterLevel(ulong filterLevel, CancellationToken cancellationToken = default)
Parameters
filterLevel
ulongcancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
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
stringgenesisId
stringproposalId
stringfee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
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
stringcancellationToken
CancellationTokenA 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
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
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
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
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
stringcancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
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
boolcancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetRules(CancellationToken)
Retrieves the rules of a DAO wallet.
public Task<DAORules> GetRules(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetTreasuryBalance(CancellationToken)
Retrieves the balance of a DAO's treasury.
public Task<IDictionary<string, BigInteger>> GetTreasuryBalance(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetTreasuryId(CancellationToken)
Retrieves the treasury id of a DAO wallet.
public Task<string> GetTreasuryId(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
ParseProposal(string, CancellationToken)
Parses a DAO proposal.
public Task<IDictionary<string, object>> ParseProposal(string proposalId, CancellationToken cancellationToken = default)
Parameters
proposalId
stringcancellationToken
CancellationTokenA 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
ulongfee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
Validate(CancellationToken)
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
boolvoteAmount
ulongproposalId
stringfee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled