BalanceApi
public protocol BalanceApi : BaseApi
Undocumented
-
get(byAccountId:asset:)Default implementationGet account balance by account id.
Throws
DCoreException.Network.notFoundif account does not exist.Default Implementation
Declaration
Swift
func get(byAccountId id: AccountObjectIdConvertible, asset: AssetObjectIdConvertible) -> Single<AssetAmount>Parameters
idAccount id, eg. 1.2.*, as
AccountObjectIdorStringformat.assetAsset id, eg. 1.3.*, as
AssetObjectIdorStringformat.Return Value
Amount for asset.
-
getAll(byAccountId:assets:)Default implementationGet all account balances by account id.
Default Implementation
Declaration
Swift
func getAll(byAccountId id: AccountObjectIdConvertible, assets: [AssetObjectIdConvertible]) -> Single<[AssetAmount]>Parameters
idAccount id, eg. 1.2.*, as
AccountObjectIdorStringformat.assetsAsset ids, eg. 1.3.*, as
AssetObjectIdorStringformat, default[]- all.Return Value
Array
[AssetAmount]of amount for different assets. -
get(byReference:asset:)Default implementationGet account balance by account reference (name or id).
Throws
DCoreException.Network.notFoundif account does not exist.Default Implementation
Declaration
Swift
func get(byReference ref: Account.Reference, asset: AssetObjectIdConvertible) -> Single<AssetAmount>Parameters
idAccount id, eg. 1.2.*.
assetAsset id, eg. 1.3.*, as
AssetObjectIdorStringformatReturn Value
Array
[AssetAmount]of amount for different assets. -
getAll(byReference:assets:)Default implementationGet all account balances by account reference (name or id).
Default Implementation
Declaration
Swift
func getAll(byReference ref: Account.Reference, assets: [AssetObjectIdConvertible]) -> Single<[AssetAmount]>Parameters
idAccount id, eg. 1.2.*.
assetsAsset ids, eg. 1.3.*, as
AssetObjectIdorStringformat, default[]- all.Return Value
Array
[AssetAmount]of amount for different assets. -
getWithAsset(byAccountId:symbol:)Default implementationGet account balance with asset by account id and symbol.
Throws
DCoreException.Network.notFoundif account does not exist.Default Implementation
Declaration
Swift
func getWithAsset(byAccountId id: AccountObjectIdConvertible, symbol: Asset.Symbol) -> Single<AssetAmountPair>Parameters
idAccount id, eg. 1.2.*, as
AccountObjectIdorStringformat.symbolAsset symbol, default
Asset.Symbol.dct.Return Value
AssetAmountPairasset pair with amount. -
getAllWithAsset(byAccountId:symbols:)Default implementationGet all account balances with asset by account id and symbols.
Default Implementation
Declaration
Swift
func getAllWithAsset(byAccountId id: AccountObjectIdConvertible, symbols: [Asset.Symbol]) -> Single<[AssetAmountPair]>Parameters
idAccount id, eg. 1.2.*, as
AccountObjectIdorStringformat.symbolsAsset symbols, eg.
[Asset.Symbol.dct].Return Value
Array
[AssetAmountPair]of asset pairs with amounts. -
getAllWithAsset(byAccountId:)Default implementationGet all account balances with asset by account id.
Default Implementation
Declaration
Swift
func getAllWithAsset(byAccountId id: AccountObjectIdConvertible) -> Single<[AssetAmountPair]>Parameters
idAccount id, eg. 1.2.*, as
AccountObjectIdorStringformat.Return Value
Array
[AssetAmountPair]of asset pairs with amounts. -
getWithAsset(byReference:symbol:)Default implementationGet account balance with asset by account reference (id or name) and symbol.
Throws
DCoreException.Network.notFoundif account does not exist.Default Implementation
Declaration
Swift
func getWithAsset(byReference ref: Account.Reference, symbol: Asset.Symbol) -> Single<AssetAmountPair>Parameters
refAccount id or name in string format, eg. 1.2.*.
symbolAsset symbol, default
Asset.Symbol.dct.Return Value
AssetAmountPairasset pair with amount. -
getAllWithAsset(byReference:)Default implementationGet all account balances with asset by account reference (id or name).
Default Implementation
Declaration
Swift
func getAllWithAsset(byReference ref: Account.Reference) -> Single<[AssetAmountPair]>Parameters
refAccount id or name in string format, eg. 1.2.*.
Return Value
Array
[AssetAmountPair]of asset pairs with amounts. -
getAllWithAsset(byReference:symbols:)Default implementationGet all account balances with asset by account reference (id or name) and symbols.
Default Implementation
Declaration
Swift
func getAllWithAsset(byReference ref: Account.Reference, symbols: [Asset.Symbol]) -> Single<[AssetAmountPair]>Parameters
refAccount id or name in string format, eg. 1.2.*.
symbolsAsset symbols, eg.
[Asset.Symbol.dct].Return Value
Array
[AssetAmountPair]of asset pairs with amounts. -
getAllVesting(byAccountId:)Default implementationGet information about vesting balances by account id.
Default Implementation
Declaration
Swift
func getAllVesting(byAccountId id: AccountObjectIdConvertible) -> Single<[VestingBalance]>Parameters
idAccount id, eg. 1.2.*, as
AccountObjectIdorStringformat.Return Value
Array
[VestingBalance]vesting balances with additional information.
View on GitHub
Install in Dash
BalanceApi Protocol Reference