Class PoolWallet
Wraps a Pool Wallet
public sealed class PoolWallet : Wallet
- Inheritance
-
PoolWallet
- Inherited Members
- Extension Methods
Remarks
ctor
Constructors
PoolWallet(uint, WalletProxy)
Wraps a Pool Wallet
public PoolWallet(uint walletId, WalletProxy walletProxy)
Parameters
walletId
uintThe wallet_id to wrap
walletProxy
WalletProxyWallet RPC proxy to use for communication
Remarks
ctor
Methods
AbsorbRewards(ulong, CancellationToken)
Perform a sweep of the p2_singleton rewards controlled by the pool wallet singleton
public Task<(PoolWalletInfo State, TransactionRecord Transaction, TransactionRecord FeeTransaction, IEnumerable<TransactionRecord> Transactions)> AbsorbRewards(ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<(PoolWalletInfo State, TransactionRecord Transaction, TransactionRecord FeeTransaction, IEnumerable<TransactionRecord> Transactions)>
Wallet state and transaction
JoinPool(string, string, uint, CancellationToken)
Join the wallet to a pool
public Task<(TransactionRecord Transaction, TransactionRecord FeeTransaction, ulong TotalFee, IEnumerable<TransactionRecord> Transactions)> JoinPool(string targetPuzzlehash, string poolUrl, uint relativeLockHeight, CancellationToken cancellationToken = default)
Parameters
targetPuzzlehash
stringPuzzle hash
poolUrl
stringUrl of the pool to join
relativeLockHeight
uintRelative lock height
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<(TransactionRecord Transaction, TransactionRecord FeeTransaction, ulong TotalFee, IEnumerable<TransactionRecord> Transactions)>
The resulting TransactionRecord
Remarks
SelfPool(CancellationToken)
Leaving a pool requires two state transitions. First we transition to PoolSingletonState.LEAVING_POOL Then we transition to FARMING_TO_POOL or SELF_POOLING
public Task<(TransactionRecord Transaction, TransactionRecord FeeTransaction, ulong TotalFee, IEnumerable<TransactionRecord> Transactions)> SelfPool(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<(TransactionRecord Transaction, TransactionRecord FeeTransaction, ulong TotalFee, IEnumerable<TransactionRecord> Transactions)>
The resulting TransactionRecord
Status(CancellationToken)
Perform a sweep of the p2_singleton rewards controlled by the pool wallet singleton
public Task<(PoolWalletInfo State, IEnumerable<TransactionRecord> UnconfirmedTransactions)> Status(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<(PoolWalletInfo State, IEnumerable<TransactionRecord> UnconfirmedTransactions)>
Wallet state and list of unconfirmed transactions
Validate(CancellationToken)
Validates that WalletId is a POOLING_WALLET
public override Task Validate(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationToken- Wraps a Pool Wallet
Returns
- Task
True if the wallet is a pooling wallet