Table of Contents

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

WalletId string

The wallet under evaluation.

AvailableCoins IReadOnlyCollection<ArkCoin>

BTC-only coins that could fund a settlement; asset carriers are not among them.

AvailableBalanceSats long

Sum of AvailableCoins, in satoshis.

ChainTime TimeHeight

Chain time and height the availability was computed against.

AssetCoins IReadOnlyCollection<ArkCoin>

Spendable coins carrying at least one Arkade-issued asset.

AssetBalances IReadOnlyDictionary<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

IReadOnlyDictionary<string, ulong>

AssetCoins

Spendable coins carrying at least one Arkade-issued asset.

public IReadOnlyCollection<ArkCoin> AssetCoins { get; init; }

Property Value

IReadOnlyCollection<ArkCoin>

AvailableBalanceSats

Sum of AvailableCoins, in satoshis.

public long AvailableBalanceSats { get; init; }

Property Value

long

AvailableCoins

BTC-only coins that could fund a settlement; asset carriers are not among them.

public IReadOnlyCollection<ArkCoin> AvailableCoins { get; init; }

Property Value

IReadOnlyCollection<ArkCoin>

ChainTime

Chain time and height the availability was computed against.

public TimeHeight ChainTime { get; init; }

Property Value

TimeHeight

WalletId

The wallet under evaluation.

public string WalletId { get; init; }

Property Value

string

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

asset string

Returns

long

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

asset string

Returns

IReadOnlyCollection<ArkCoin>