@keetanetwork/keetanet-client
Preparing search index...
KeetaNetSDK
Referenced
LedgerAtomicInterface
Class LedgerAtomicInterface
Atomic transactional interface to a storage backend
Index
Constructors
C
constructor
Methods
M
_
testing
Run
Storage
Function
M
abort
M
add
M
commit
M
gc
M
get
Account
Info
M
get
Account
Rep
M
get
All
Balances
M
get
Balance
M
get
Block
M
get
Block
From
Previous
M
get
Head
Block
M
get
Head
Blocks
M
get
History
M
get
Staples
From
Block
Hashes
M
get
Votes
M
get
Votes
From
Multiple
Previous
M
get
Vote
Staple
M
get
Vote
Staples
M
get
Vote
Staples
After
M
list
AC
Ls
By
Entity
M
list
AC
Ls
By
Principal
M
run
Post
Adjust
Heap
Dequeue
M
vote
M
voting
Power
Constructors
constructor
new
LedgerAtomicInterface
(
transaction
:
LedgerStorageTransactionBase
,
storage
:
LedgerStorageAPI
,
config
:
LedgerConfig
,
ledger
:
Ledger
,
)
:
LedgerAtomicInterface
Parameters
transaction
:
LedgerStorageTransactionBase
storage
:
LedgerStorageAPI
config
:
LedgerConfig
ledger
:
Ledger
Returns
LedgerAtomicInterface
Methods
_
testing
Run
Storage
Function
_testingRunStorageFunction
<
T
>
(
code
:
(
storage
:
LedgerStorageAPI
,
transaction
:
LedgerStorageTransactionBase
,
)
=>
Promise
<
T
>
,
)
:
Promise
<
T
>
Type Parameters
T
Parameters
code
:
(
storage
:
LedgerStorageAPI
,
transaction
:
LedgerStorageTransactionBase
,
)
=>
Promise
<
T
>
Returns
Promise
<
T
>
abort
abort
()
:
Promise
<
void
>
Returns
Promise
<
void
>
add
add
(
votesAndBlocks
:
VoteStaple
,
from
?:
string
)
:
Promise
<
BlockHash
[]
>
Parameters
votesAndBlocks
:
VoteStaple
Optional
from
:
string
Returns
Promise
<
BlockHash
[]
>
commit
commit
()
:
Promise
<
void
>
Returns
Promise
<
void
>
gc
gc
()
:
Promise
<
boolean
>
Returns
Promise
<
boolean
>
get
Account
Info
getAccountInfo
(
account
:
string
|
GenericAccount
)
:
Promise
<
AccountInfo
>
Parameters
account
:
string
|
GenericAccount
Returns
Promise
<
AccountInfo
>
get
Account
Rep
getAccountRep
(
account
:
string
|
Account
<
ECDSA_SECP256K1
|
ED25519
|
ECDSA_SECP256R1
>
,
)
:
Promise
<
null
|
Account
<
ECDSA_SECP256K1
|
ED25519
|
ECDSA_SECP256R1
>
>
Parameters
account
:
string
|
Account
<
ECDSA_SECP256K1
|
ED25519
|
ECDSA_SECP256R1
>
Returns
Promise
<
null
|
Account
<
ECDSA_SECP256K1
|
ED25519
|
ECDSA_SECP256R1
>
>
get
All
Balances
getAllBalances
(
account
:
GenericAccount
)
:
Promise
<
GetAllBalancesResponse
>
Parameters
account
:
GenericAccount
Returns
Promise
<
GetAllBalancesResponse
>
get
Balance
getBalance
(
account
:
GenericAccount
,
token
:
TokenAddress
)
:
Promise
<
bigint
>
Parameters
account
:
GenericAccount
token
:
TokenAddress
Returns
Promise
<
bigint
>
get
Block
getBlock
(
blockhash
:
BlockHash
,
from
?:
LedgerSelector
)
:
Promise
<
null
|
Block
>
Parameters
blockhash
:
BlockHash
from
:
LedgerSelector
= 'main'
Returns
Promise
<
null
|
Block
>
get
Block
From
Previous
getBlockFromPrevious
(
block
:
BlockHash
,
from
:
LedgerSelector
,
)
:
Promise
<
null
|
Block
>
Parameters
block
:
BlockHash
from
:
LedgerSelector
Returns
Promise
<
null
|
Block
>
get
Head
Block
getHeadBlock
(
account
:
GenericAccount
,
from
:
LedgerSelector
,
)
:
Promise
<
null
|
Block
>
Parameters
account
:
GenericAccount
from
:
LedgerSelector
Returns
Promise
<
null
|
Block
>
get
Head
Blocks
getHeadBlocks
(
accounts
:
GenericAccount
[]
,
from
:
LedgerSelector
,
)
:
Promise
<
{
[
account
:
string
]:
null
|
Block
}
>
Parameters
accounts
:
GenericAccount
[]
from
:
LedgerSelector
Returns
Promise
<
{
[
account
:
string
]:
null
|
Block
}
>
get
History
getHistory
(
account
:
GenericAccount
,
start
:
null
|
VoteBlockHash
,
limit
?:
number
,
)
:
Promise
<
VoteStaple
[]
>
Parameters
account
:
GenericAccount
start
:
null
|
VoteBlockHash
limit
:
number
= 25
Returns
Promise
<
VoteStaple
[]
>
get
Staples
From
Block
Hashes
getStaplesFromBlockHashes
(
hashes
:
BlockHash
[]
)
:
Promise
<
VoteStaple
[]
>
Parameters
hashes
:
BlockHash
[]
Returns
Promise
<
VoteStaple
[]
>
get
Votes
getVotes
(
block
:
BlockHash
,
from
?:
LedgerStorage
)
:
Promise
<
null
|
Vote
[]
>
Parameters
block
:
BlockHash
from
:
LedgerStorage
= 'main'
Returns
Promise
<
null
|
Vote
[]
>
get
Votes
From
Multiple
Previous
getVotesFromMultiplePrevious
(
prevBlocks
:
BlockHash
[]
,
from
?:
LedgerSelector
,
issuer
?:
Account
<
ECDSA_SECP256K1
|
ED25519
|
ECDSA_SECP256R1
>
,
)
:
Promise
<
{
[
hash
:
string
]:
null
|
Vote
[]
}
>
Parameters
prevBlocks
:
BlockHash
[]
from
:
LedgerSelector
= 'main'
Optional
issuer
:
Account
<
ECDSA_SECP256K1
|
ED25519
|
ECDSA_SECP256R1
>
Returns
Promise
<
{
[
hash
:
string
]:
null
|
Vote
[]
}
>
get
Vote
Staple
getVoteStaple
(
stapleBlockHash
:
VoteBlockHash
,
from
?:
LedgerSelector
,
)
:
Promise
<
null
|
VoteStaple
>
Parameters
stapleBlockHash
:
VoteBlockHash
from
:
LedgerSelector
= 'main'
Returns
Promise
<
null
|
VoteStaple
>
get
Vote
Staples
getVoteStaples
(
stapleBlockHashes
:
VoteBlockHash
[]
,
from
?:
LedgerSelector
,
)
:
Promise
<
VoteBlockHashMap
<
null
|
VoteStaple
>
>
Parameters
stapleBlockHashes
:
VoteBlockHash
[]
from
:
LedgerSelector
= 'main'
Returns
Promise
<
VoteBlockHashMap
<
null
|
VoteStaple
>
>
get
Vote
Staples
After
getVoteStaplesAfter
(
moment
:
Date
,
limit
?:
number
,
options
?:
GetVotesAfterOptions
,
)
:
Promise
<
VoteStaple
[]
>
Parameters
moment
:
Date
limit
:
number
= 1000
options
:
GetVotesAfterOptions
= {}
Returns
Promise
<
VoteStaple
[]
>
list
AC
Ls
By
Entity
listACLsByEntity
(
entity
:
GenericAccount
)
:
Promise
<
ACLRow
[]
>
Parameters
entity
:
GenericAccount
Returns
Promise
<
ACLRow
[]
>
list
AC
Ls
By
Principal
listACLsByPrincipal
(
principal
:
GenericAccount
,
entityList
?:
GenericAccount
[]
,
)
:
Promise
<
ACLRow
[]
>
Parameters
principal
:
GenericAccount
Optional
entityList
:
GenericAccount
[]
Returns
Promise
<
ACLRow
[]
>
run
Post
Adjust
Heap
Dequeue
runPostAdjustHeapDequeue
(
blockPrevHashes
?:
string
[]
|
BlockHash
[]
,
)
:
Promise
<
BlockHash
[]
>
Parameters
Optional
blockPrevHashes
:
string
[]
|
BlockHash
[]
Returns
Promise
<
BlockHash
[]
>
vote
vote
(
blocks
:
Block
[]
,
otherVotes
?:
Vote
[]
)
:
Promise
<
Vote
>
Parameters
blocks
:
Block
[]
Optional
otherVotes
:
Vote
[]
Returns
Promise
<
Vote
>
voting
Power
votingPower
(
rep
?:
Account
<
ECDSA_SECP256K1
|
ED25519
|
ECDSA_SECP256R1
>
,
)
:
Promise
<
bigint
>
Parameters
Optional
rep
:
Account
<
ECDSA_SECP256K1
|
ED25519
|
ECDSA_SECP256R1
>
Returns
Promise
<
bigint
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
C
constructor
Methods
M
_
testing
Run
Storage
Function
M
abort
M
add
M
commit
M
gc
M
get
Account
Info
M
get
Account
Rep
M
get
All
Balances
M
get
Balance
M
get
Block
M
get
Block
From
Previous
M
get
Head
Block
M
get
Head
Blocks
M
get
History
M
get
Staples
From
Block
Hashes
M
get
Votes
M
get
Votes
From
Multiple
Previous
M
get
Vote
Staple
M
get
Vote
Staples
M
get
Vote
Staples
After
M
list
AC
Ls
By
Entity
M
list
AC
Ls
By
Principal
M
run
Post
Adjust
Heap
Dequeue
M
vote
M
voting
Power
@keetanetwork/keetanet-client
Loading...
Atomic transactional interface to a storage backend