Class SettlementContext
- Namespace
- NArk.Abstractions.Settlement
- Assembly
- NArk.Abstractions.dll
The wallet state a policy evaluates against: everything that is spendable right now, with coins locked by pending intents and coins past their expiry already removed.
BTC and Arkade-issued assets are kept apart. A coin carrying an asset holds a dust-sized satoshi amount as the asset's carrier, not as spendable BTC — moving it would move the asset — so such coins land in AssetCoins and AssetBalances, never in AvailableCoins or AvailableBalanceSats. A BTC threshold never fires on an asset carrier's dust, and an asset threshold never fires on BTC.
Use GetAvailableBalance(string) and GetAvailableCoins(string) to read either denomination through one call.
public record SettlementContext : IEquatable<SettlementContext>
- Inheritance
-
SettlementContext
- Implements
- Inherited Members
Constructors
SettlementContext(string, IReadOnlyCollection<ArkCoin>, long, TimeHeight, IReadOnlyCollection<ArkCoin>, IReadOnlyDictionary<string, ulong>)
The wallet state a policy evaluates against: everything that is spendable right now, with coins locked by pending intents and coins past their expiry already removed.
BTC and Arkade-issued assets are kept apart. A coin carrying an asset holds a dust-sized satoshi amount as the asset's carrier, not as spendable BTC — moving it would move the asset — so such coins land in AssetCoins and AssetBalances, never in AvailableCoins or AvailableBalanceSats. A BTC threshold never fires on an asset carrier's dust, and an asset threshold never fires on BTC.
Use GetAvailableBalance(string) and GetAvailableCoins(string) to read either denomination through one call.
public SettlementContext(string WalletId, IReadOnlyCollection<ArkCoin> AvailableCoins, long AvailableBalanceSats, TimeHeight ChainTime, IReadOnlyCollection<ArkCoin> AssetCoins, IReadOnlyDictionary<string, ulong> AssetBalances)
Parameters
WalletIdstringThe wallet under evaluation.
AvailableCoinsIReadOnlyCollection<ArkCoin>BTC-only coins that could fund a settlement; asset carriers are not among them.
AvailableBalanceSatslongSum of
AvailableCoins, in satoshis.ChainTimeTimeHeightChain time and height the availability was computed against.
AssetCoinsIReadOnlyCollection<ArkCoin>Spendable coins carrying at least one Arkade-issued asset.
AssetBalancesIReadOnlyDictionary<string, ulong>Spendable balance per Arkade asset id, in the asset's own atomic units, summed over
AssetCoins. Keyed case-insensitively.
Properties
AssetBalances
Spendable balance per Arkade asset id, in the asset's own atomic units, summed over
AssetCoins. Keyed case-insensitively.
public IReadOnlyDictionary<string, ulong> AssetBalances { get; init; }
Property Value
AssetCoins
Spendable coins carrying at least one Arkade-issued asset.
public IReadOnlyCollection<ArkCoin> AssetCoins { get; init; }
Property Value
AvailableBalanceSats
Sum of AvailableCoins, in satoshis.
public long AvailableBalanceSats { get; init; }
Property Value
AvailableCoins
BTC-only coins that could fund a settlement; asset carriers are not among them.
public IReadOnlyCollection<ArkCoin> AvailableCoins { get; init; }
Property Value
ChainTime
Chain time and height the availability was computed against.
public TimeHeight ChainTime { get; init; }
Property Value
WalletId
The wallet under evaluation.
public string WalletId { get; init; }
Property Value
Methods
GetAvailableBalance(string)
The spendable balance of asset: satoshis for
Btc, the asset's own atomic units otherwise.
Returns zero for an asset the wallet does not hold.
public long GetAvailableBalance(string asset)
Parameters
assetstring
Returns
GetAvailableCoins(string)
The coins that could fund a settlement of asset: the BTC-only
coins for Btc, the carriers of that asset otherwise.
public IReadOnlyCollection<ArkCoin> GetAvailableCoins(string asset)
Parameters
assetstring