BalanceApi
public protocol BalanceApi : BaseApi
Undocumented
-
get(byAccountId:asset:)
Default implementationGet account balance by account id.
Throws
DCoreException.Network.notFound
if account does not exist.Default Implementation
Declaration
Swift
func get(byAccountId id: AccountObjectIdConvertible, asset: AssetObjectIdConvertible) -> Single<AssetAmount>
Parameters
id
Account id, eg. 1.2.*, as
AccountObjectId
orString
format.asset
Asset id, eg. 1.3.*, as
AssetObjectId
orString
format.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
id
Account id, eg. 1.2.*, as
AccountObjectId
orString
format.assets
Asset ids, eg. 1.3.*, as
AssetObjectId
orString
format, 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.notFound
if account does not exist.Default Implementation
Declaration
Swift
func get(byReference ref: Account.Reference, asset: AssetObjectIdConvertible) -> Single<AssetAmount>
Parameters
id
Account id, eg. 1.2.*.
asset
Asset id, eg. 1.3.*, as
AssetObjectId
orString
formatReturn 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
id
Account id, eg. 1.2.*.
assets
Asset ids, eg. 1.3.*, as
AssetObjectId
orString
format, 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.notFound
if account does not exist.Default Implementation
Declaration
Swift
func getWithAsset(byAccountId id: AccountObjectIdConvertible, symbol: Asset.Symbol) -> Single<AssetAmountPair>
Parameters
id
Account id, eg. 1.2.*, as
AccountObjectId
orString
format.symbol
Asset symbol, default
Asset.Symbol.dct
.Return Value
AssetAmountPair
asset 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
id
Account id, eg. 1.2.*, as
AccountObjectId
orString
format.symbols
Asset 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
id
Account id, eg. 1.2.*, as
AccountObjectId
orString
format.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.notFound
if account does not exist.Default Implementation
Declaration
Swift
func getWithAsset(byReference ref: Account.Reference, symbol: Asset.Symbol) -> Single<AssetAmountPair>
Parameters
ref
Account id or name in string format, eg. 1.2.*.
symbol
Asset symbol, default
Asset.Symbol.dct
.Return Value
AssetAmountPair
asset 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
ref
Account 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
ref
Account id or name in string format, eg. 1.2.*.
symbols
Asset 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
id
Account id, eg. 1.2.*, as
AccountObjectId
orString
format.Return Value
Array
[VestingBalance]
vesting balances with additional information.