@keetanetwork/keetanet-client 0.10.5 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/api/index.d.ts +23 -7
  2. package/api/node.d.ts +27 -2
  3. package/api/vote.d.ts +4 -6
  4. package/client/builder.d.ts +17 -0
  5. package/client/client_common_tests.d.ts +1 -1
  6. package/client/index-browser.d.ts +112 -3
  7. package/client/index-browser.js +18234 -29816
  8. package/client/index.d.ts +112 -3
  9. package/client/index.js +4070 -6581
  10. package/config/index.d.ts +6 -1
  11. package/docs/assets/hierarchy.js +1 -1
  12. package/docs/assets/search.js +1 -1
  13. package/docs/classes/KeetaNetSDK.Client.html +31 -11
  14. package/docs/classes/KeetaNetSDK.Referenced.Account.html +31 -21
  15. package/docs/classes/KeetaNetSDK.Referenced.BaseSet.html +2 -2
  16. package/docs/classes/KeetaNetSDK.Referenced.Block.html +2 -4
  17. package/docs/classes/KeetaNetSDK.Referenced.BlockBuilder.html +1 -1
  18. package/docs/classes/KeetaNetSDK.Referenced.BlockHash.html +4 -5
  19. package/docs/classes/KeetaNetSDK.Referenced.BlockOperation.html +1 -1
  20. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationCREATE_IDENTIFIER.html +2 -2
  21. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMANAGE_CERTIFICATE.html +12 -0
  22. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMODIFY_PERMISSIONS.html +2 -2
  23. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationRECEIVE.html +2 -2
  24. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSEND.html +2 -2
  25. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_INFO.html +2 -2
  26. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_REP.html +2 -2
  27. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_MODIFY_BALANCE.html +2 -2
  28. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_SUPPLY.html +2 -2
  29. package/docs/classes/{KeetaNetSDK.Referenced.src_lib_utils_certificate.Certificate.html → KeetaNetSDK.Referenced.Certificate.html} +31 -14
  30. package/docs/classes/KeetaNetSDK.Referenced.CertificateBundle.html +8 -0
  31. package/docs/classes/KeetaNetSDK.Referenced.CertificateHash.html +16 -0
  32. package/docs/classes/KeetaNetSDK.Referenced.ECDSAKeyPair.html +1 -1
  33. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1KeyPair.html +1 -1
  34. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1PrivateKey.html +1 -1
  35. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1PublicKey.html +1 -1
  36. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1Signature.html +1 -1
  37. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1KeyPair.html +1 -1
  38. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1PrivateKey.html +1 -1
  39. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1PublicKey.html +1 -1
  40. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1Signature.html +1 -1
  41. package/docs/classes/KeetaNetSDK.Referenced.ED25519KeyPair.html +1 -1
  42. package/docs/classes/KeetaNetSDK.Referenced.ED25519PrivateKey.html +1 -1
  43. package/docs/classes/KeetaNetSDK.Referenced.ED25519PublicKey.html +1 -1
  44. package/docs/classes/KeetaNetSDK.Referenced.ED25519Signature.html +1 -1
  45. package/docs/classes/KeetaNetSDK.Referenced.ExternalKeyPair.html +1 -1
  46. package/docs/classes/KeetaNetSDK.Referenced.ExternalSet.html +1 -1
  47. package/docs/classes/KeetaNetSDK.Referenced.IdentifierKey.html +1 -1
  48. package/docs/classes/KeetaNetSDK.Referenced.IdentifierKeyPair.html +4 -4
  49. package/docs/classes/KeetaNetSDK.Referenced.KeetaNetError.html +1 -1
  50. package/docs/classes/KeetaNetSDK.Referenced.KeyInterface.html +1 -1
  51. package/docs/classes/KeetaNetSDK.Referenced.KeyStorage.html +1 -1
  52. package/docs/classes/KeetaNetSDK.Referenced.Ledger.html +4 -2
  53. package/docs/classes/KeetaNetSDK.Referenced.LedgerAtomicInterface.html +3 -1
  54. package/docs/classes/KeetaNetSDK.Referenced.LedgerRequestCache.html +1 -1
  55. package/docs/classes/KeetaNetSDK.Referenced.Node.html +1 -1
  56. package/docs/classes/KeetaNetSDK.Referenced.P2PSwitch.html +3 -3
  57. package/docs/classes/KeetaNetSDK.Referenced.PendingAccount.html +3 -2
  58. package/docs/classes/KeetaNetSDK.Referenced.PermissionSetHolder.html +1 -1
  59. package/docs/classes/KeetaNetSDK.Referenced.Permissions.html +2 -3
  60. package/docs/classes/KeetaNetSDK.Referenced.PossiblyExpiredVote.html +5 -3
  61. package/docs/classes/KeetaNetSDK.Referenced.RequestTiming.html +16 -2
  62. package/docs/classes/KeetaNetSDK.Referenced.SignatureStorage.html +1 -1
  63. package/docs/classes/KeetaNetSDK.Referenced.Stats.html +3 -2
  64. package/docs/classes/KeetaNetSDK.Referenced.UserClientBuilder.html +3 -2
  65. package/docs/classes/KeetaNetSDK.Referenced.Vote.html +5 -5
  66. package/docs/classes/KeetaNetSDK.Referenced.VoteBlockBundle.html +35 -0
  67. package/docs/classes/KeetaNetSDK.Referenced.VoteBlockHash.html +1 -1
  68. package/docs/classes/KeetaNetSDK.Referenced.VoteBlockHashMap.html +9 -8
  69. package/docs/classes/KeetaNetSDK.Referenced.VoteBuilder.html +2 -1
  70. package/docs/classes/KeetaNetSDK.Referenced.VoteHash.html +1 -1
  71. package/docs/classes/KeetaNetSDK.Referenced.VoteStaple.html +23 -29
  72. package/docs/classes/KeetaNetSDK.Referenced.VoteStapleHash.html +1 -1
  73. package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_asn1.BufferStorageASN1.html +1 -1
  74. package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_buffer.BufferStorage.html +1 -1
  75. package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_certificate.CertificateBuilder.html +1 -1
  76. package/docs/classes/KeetaNetSDK.UserClient.html +57 -15
  77. package/docs/documents/GETTING-STARTED.html +5 -2
  78. package/docs/enums/KeetaNetSDK.Referenced.AccountKeyAlgorithm.html +2 -1
  79. package/docs/enums/KeetaNetSDK.Referenced.AdjustMethod.html +4 -4
  80. package/docs/enums/KeetaNetSDK.Referenced.BaseFlag.html +2 -1
  81. package/docs/enums/KeetaNetSDK.Referenced.OperationType.html +2 -1
  82. package/docs/functions/KeetaNetSDK.Referenced.src_config.getDefaultConfig.html +2 -2
  83. package/docs/functions/KeetaNetSDK.Referenced.src_config.getNetworkAlias.html +1 -1
  84. package/docs/functions/KeetaNetSDK.Referenced.src_config.getValidation.html +1 -1
  85. package/docs/functions/KeetaNetSDK.Referenced.src_config.isNetwork.html +1 -1
  86. package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_asn1.isASN1Object.html +1 -0
  87. package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_buffer.ZlibDeflateAsync.html +1 -0
  88. package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_buffer.ZlibInflateAsync.html +1 -0
  89. package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_conversion.objectToBuffer.html +1 -1
  90. package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_conversion.toJSONSerializable.html +1 -1
  91. package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.booleanEnv.html +1 -0
  92. package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.nonNullable.html +1 -0
  93. package/docs/hierarchy.html +1 -1
  94. package/docs/interfaces/KeetaNetSDK.Referenced.ACLEntry.html +1 -1
  95. package/docs/interfaces/KeetaNetSDK.Referenced.ACLUpdate.html +1 -1
  96. package/docs/interfaces/KeetaNetSDK.Referenced.ASN1ExplicitContextTag.html +1 -1
  97. package/docs/interfaces/KeetaNetSDK.Referenced.ASN1ImplicitContextTag.html +1 -1
  98. package/docs/interfaces/KeetaNetSDK.Referenced.ASN1Object.html +1 -1
  99. package/docs/interfaces/KeetaNetSDK.Referenced.BaseExternalKeyPairFunctions.html +1 -1
  100. package/docs/interfaces/KeetaNetSDK.Referenced.BaseGenerationConfig.html +1 -1
  101. package/docs/interfaces/KeetaNetSDK.Referenced.BlockCanonical.html +2 -2
  102. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSON.html +2 -2
  103. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperation.html +1 -1
  104. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationCREATE_IDENTIFIER.html +1 -1
  105. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMANAGE_CERTIFICATE.html +6 -0
  106. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMANAGE_CERTIFICATESerializable.html +5 -0
  107. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMODIFY_PERMISSIONS.html +1 -1
  108. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationRECEIVE.html +1 -1
  109. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSEND.html +1 -1
  110. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSET_INFO.html +1 -1
  111. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSET_REP.html +1 -1
  112. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationTOKEN_ADMIN_MODIFY_BALANCE.html +1 -1
  113. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationTOKEN_ADMIN_SUPPLY.html +2 -2
  114. package/docs/interfaces/KeetaNetSDK.Referenced.BlockUnsignedCanonical.html +2 -2
  115. package/docs/interfaces/KeetaNetSDK.Referenced.CertificateWithIntermediates.html +3 -0
  116. package/docs/interfaces/KeetaNetSDK.Referenced.CertificateWithIntermediatesResponse.html +3 -0
  117. package/docs/interfaces/KeetaNetSDK.Referenced.ComputedBlocksEffectFields.html +3 -2
  118. package/docs/interfaces/KeetaNetSDK.Referenced.Constructor.html +1 -1
  119. package/docs/interfaces/KeetaNetSDK.Referenced.DisposableTimingHandle.html +7 -0
  120. package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsNoEncryption.html +1 -1
  121. package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsSupportsEncryption.html +1 -1
  122. package/docs/interfaces/KeetaNetSDK.Referenced.FeeAmountAndToken.html +5 -0
  123. package/docs/interfaces/KeetaNetSDK.Referenced.FeeAmountAndTokenJSON.html +4 -0
  124. package/docs/interfaces/KeetaNetSDK.Referenced.IdentifierCreateRequest.html +2 -2
  125. package/docs/interfaces/KeetaNetSDK.Referenced.InitialConfigSupply.html +1 -1
  126. package/docs/interfaces/KeetaNetSDK.Referenced.InstanceSet.html +13 -0
  127. package/docs/interfaces/KeetaNetSDK.Referenced.KVGenericOptionsType.html +2 -0
  128. package/docs/interfaces/KeetaNetSDK.Referenced.KVSetOptionsType.html +3 -2
  129. package/docs/interfaces/KeetaNetSDK.Referenced.KVStorageProviderAPI.html +2 -2
  130. package/docs/interfaces/KeetaNetSDK.Referenced.LedgerConfig.html +4 -2
  131. package/docs/interfaces/KeetaNetSDK.Referenced.LedgerStatistics.html +3 -2
  132. package/docs/interfaces/KeetaNetSDK.Referenced.LedgerStorageAPI.html +15 -7
  133. package/docs/interfaces/KeetaNetSDK.Referenced.LedgerStorageTransactionBase.html +6 -0
  134. package/docs/interfaces/KeetaNetSDK.Referenced.ModifyTokenBalanceEntry.html +1 -1
  135. package/docs/interfaces/KeetaNetSDK.Referenced.NodeConfig.html +3 -3
  136. package/docs/interfaces/KeetaNetSDK.Referenced.NumericValidationRule.html +3 -0
  137. package/docs/interfaces/KeetaNetSDK.Referenced.NumericValueEntry.html +1 -1
  138. package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerBase.html +1 -1
  139. package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerListener.html +1 -1
  140. package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerRepBase.html +3 -3
  141. package/docs/interfaces/KeetaNetSDK.Referenced.PendingOperations.html +3 -2
  142. package/docs/interfaces/KeetaNetSDK.Referenced.PendingOperationsJSON.html +3 -2
  143. package/docs/interfaces/KeetaNetSDK.Referenced.PublicKeyStorage.html +1 -1
  144. package/docs/interfaces/KeetaNetSDK.Referenced.PublicKeyStringMapping.html +3 -2
  145. package/docs/interfaces/KeetaNetSDK.Referenced.RequestTokenReceiveEntry.html +1 -1
  146. package/docs/interfaces/KeetaNetSDK.Referenced.TokenNumericEntry.html +1 -1
  147. package/docs/interfaces/KeetaNetSDK.Referenced.UserClientConfig.html +2 -2
  148. package/docs/interfaces/KeetaNetSDK.Referenced.UserClientListenerOptions.html +2 -0
  149. package/docs/interfaces/KeetaNetSDK.Referenced.UserClientOptions.html +1 -1
  150. package/docs/interfaces/KeetaNetSDK.Referenced.VoteBundleConstructor.html +6 -0
  151. package/docs/interfaces/KeetaNetSDK.Referenced.VoteJSON.html +3 -2
  152. package/docs/interfaces/KeetaNetSDK.Referenced.VoteStapleJSON.html +2 -2
  153. package/docs/interfaces/KeetaNetSDK.Referenced.WithIsInstance.html +1 -1
  154. package/docs/interfaces/KeetaNetSDK.Referenced.src_config.ValidationConfig.html +2 -2
  155. package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1BitString.html +1 -1
  156. package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Date.html +1 -1
  157. package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1OID.html +1 -1
  158. package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Set.html +1 -1
  159. package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1String.html +1 -1
  160. package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_conversion.ToJSONSerializableOptions.html +3 -0
  161. package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_helper.InstanceSetConstructor.html +2 -2
  162. package/docs/modules/KeetaNetSDK.Referenced.html +1 -1
  163. package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_asn1.html +1 -1
  164. package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_buffer.html +1 -1
  165. package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_certificate.html +1 -1
  166. package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_conversion.html +1 -1
  167. package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_helper.html +1 -1
  168. package/docs/types/KeetaNetSDK.Referenced.AccountKeyAlgorithmHex.html +8 -0
  169. package/docs/types/KeetaNetSDK.Referenced.AccountKeyAlgorithmHexReverse.html +1 -0
  170. package/docs/types/KeetaNetSDK.Referenced.AccountKeyAlgorithmHexToType.html +1 -0
  171. package/docs/types/KeetaNetSDK.Referenced.AddBinaryIfIncluded.html +1 -0
  172. package/docs/types/KeetaNetSDK.Referenced.BlockHashString.html +1 -0
  173. package/docs/types/KeetaNetSDK.Referenced.CertificateErrorCode.html +1 -0
  174. package/docs/types/KeetaNetSDK.Referenced.CertificateExtensionData.html +1 -0
  175. package/docs/types/KeetaNetSDK.Referenced.CertificateExtensions.html +2 -2
  176. package/docs/types/KeetaNetSDK.Referenced.CertificateHashString.html +1 -0
  177. package/docs/types/KeetaNetSDK.Referenced.CertificateOptions.html +4 -4
  178. package/docs/types/KeetaNetSDK.Referenced.CertificateUpdate.html +2 -0
  179. package/docs/types/KeetaNetSDK.Referenced.ComputedEffectOfBlocks.html +3 -2
  180. package/docs/types/KeetaNetSDK.Referenced.DbStats.html +2 -0
  181. package/docs/types/KeetaNetSDK.Referenced.ErrorCode.html +1 -1
  182. package/docs/types/KeetaNetSDK.Referenced.ExportedJSONOperation.html +1 -0
  183. package/docs/types/KeetaNetSDK.Referenced.MultisigPublicKeyString.html +1 -0
  184. package/docs/types/KeetaNetSDK.Referenced.NodeLike-1.html +1 -0
  185. package/docs/types/KeetaNetSDK.Referenced.NodeLike.html +1 -1
  186. package/docs/types/KeetaNetSDK.Referenced.PublicKeyAndTypeStringHex.html +3 -0
  187. package/docs/types/{KeetaNetSDK.Referenced.VoteJSONOutput.html → KeetaNetSDK.Referenced.StorageAddress.html} +1 -1
  188. package/docs/types/KeetaNetSDK.Referenced.TimingData.html +2 -0
  189. package/docs/types/KeetaNetSDK.Referenced.TimingSectionHandle.html +6 -0
  190. package/docs/types/KeetaNetSDK.Referenced.VoteBuilderOptions.html +4 -0
  191. package/docs/types/KeetaNetSDK.Referenced.src_config.NetworkConfig.html +1 -1
  192. package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_asn1.ValidateASN1.Schema.html +1 -1
  193. package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_asn1.ValidateASN1.SchemaMap.html +1 -1
  194. package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_certificate.CertificateJSONOutput.html +1 -0
  195. package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.ToJSONSerializable.html +1 -1
  196. package/docs/variables/KeetaNetSDK.Referenced.BlockErrorCodes-1.html +1 -0
  197. package/docs/variables/KeetaNetSDK.Referenced.BlockErrorCodes.html +1 -1
  198. package/docs/{types/KeetaNetSDK.Referenced.JSONUnsupportedTypes.html → variables/KeetaNetSDK.Referenced.CertificateErrorType.html} +1 -1
  199. package/docs/variables/KeetaNetSDK.Referenced.ClientErrorCodes.html +1 -1
  200. package/docs/variables/KeetaNetSDK.Referenced.KVErrorCodes.html +1 -1
  201. package/docs/variables/KeetaNetSDK.Referenced.Operation.html +2 -2
  202. package/docs/variables/KeetaNetSDK.Referenced.VoteErrorCodes.html +1 -1
  203. package/docs/variables/KeetaNetSDK.Referenced.identifierKeyTypes.html +1 -1
  204. package/docs/variables/KeetaNetSDK.Referenced.src_config.networksArray.html +1 -1
  205. package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_helper.AsyncDisposableStack.html +2 -0
  206. package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_helper.crypto.html +1 -0
  207. package/lib/account.d.ts +68 -29
  208. package/lib/block/index.d.ts +53 -23
  209. package/lib/block/operations.d.ts +78 -33
  210. package/lib/error/block.d.ts +1 -1
  211. package/lib/error/certificate.d.ts +9 -0
  212. package/lib/error/client.d.ts +1 -1
  213. package/lib/error/index.d.ts +2 -1
  214. package/lib/error/kv.d.ts +1 -1
  215. package/lib/error/vote.d.ts +1 -1
  216. package/lib/kv/index.d.ts +15 -8
  217. package/lib/kv/kv_redis.d.ts +18 -8
  218. package/lib/ledger/common.d.ts +13 -5
  219. package/lib/ledger/db_dynamodb.d.ts +22 -16
  220. package/lib/ledger/db_postgres.d.ts +10 -10
  221. package/lib/ledger/db_spanner.d.ts +26 -14
  222. package/lib/ledger/db_spanner_helper.d.ts +94 -109
  223. package/lib/ledger/db_sqlite.d.ts +10 -10
  224. package/lib/ledger/effects.d.ts +19 -4
  225. package/lib/ledger/index.d.ts +57 -12
  226. package/lib/ledger/types.d.ts +7 -1
  227. package/lib/node/local.d.ts +10 -1
  228. package/lib/node/timing.d.ts +44 -5
  229. package/lib/p2p.d.ts +6 -3
  230. package/lib/permissions.d.ts +3 -3
  231. package/lib/pubsub/index.d.ts +1 -1
  232. package/lib/pubsub/providers.d.ts +2 -0
  233. package/lib/pubsub/ps_gcp.d.ts +14 -0
  234. package/lib/stats.d.ts +5 -0
  235. package/lib/utils/asn1.d.ts +4 -3
  236. package/lib/utils/buffer.d.ts +4 -0
  237. package/lib/utils/certificate.d.ts +107 -6
  238. package/lib/utils/conversion.d.ts +13 -35
  239. package/lib/utils/helper.d.ts +26 -8
  240. package/lib/utils/helper_testing.d.ts +1 -1
  241. package/lib/vote.d.ts +122 -63
  242. package/package.json +2 -3
  243. package/version.d.ts +1 -1
  244. package/docs/classes/KeetaNetSDK.Referenced.HTTPAgentManager.html +0 -4
  245. package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_conversion.RegisterSerializable.html +0 -2
  246. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOutput.html +0 -5
  247. package/docs/interfaces/KeetaNetSDK.Referenced.VoteJSONOutput.html +0 -4
  248. package/docs/interfaces/KeetaNetSDK.Referenced.WithConversionClass.html +0 -6
  249. package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_helper.InstanceSet.html +0 -10
  250. package/docs/types/KeetaNetSDK.Referenced.JSONSupportedObject.html +0 -1
  251. package/docs/types/KeetaNetSDK.Referenced.JSONSupportedValue.html +0 -1
  252. package/docs/types/KeetaNetSDK.Referenced.Vote.html +0 -1
  253. package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.JSONSupported.html +0 -1
  254. package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.ToJSONSerializableOptions.html +0 -3
  255. package/docs/variables/KeetaNetSDK.Referenced.default.html +0 -3
@@ -4,15 +4,16 @@ import { BlockHash } from '../block';
4
4
  import type { VoteBlockHash, VoteBlockHashMap } from '../vote';
5
5
  import type { GenericAccount, IdentifierAddress, TokenAddress } from '../account';
6
6
  import Account from '../account';
7
- import type { Ledger, LedgerConfig, LedgerStorageAPI, LedgerSelector, PaginatedVotes, GetVotesAfterOptions } from '../ledger';
8
- import type { AccountInfo, ACLRow, GetAllBalancesResponse, LedgerStatistics } from './types';
7
+ import type { Ledger, LedgerConfig, LedgerStorageAPI, LedgerSelector, PaginatedVotes, GetVotesAfterOptions, LedgerStorageTransactionBase } from '../ledger';
8
+ import type { AccountInfo, ACLRow, GetAllBalancesResponse, LedgerStatistics, CertificateWithIntermediates } from './types';
9
9
  import type { KVStorageProviderAPI } from '../kv';
10
10
  import { LedgerStorageBase } from './common';
11
11
  import Stats from '../stats';
12
- import { KeetaNetLedgerError } from '../error/ledger';
13
12
  import type { Database as GoogleSpannerDatabase } from '@google-cloud/spanner';
14
13
  import type { TableColumn, FilteredResponseRow, IndexName, TableName, QueryRow as HelperQueryRow, QueryRows } from './db_spanner_helper';
15
14
  import type { ComputedEffectOfBlocks } from './effects';
15
+ import type Node from '../node';
16
+ import type { CertificateHash } from '../utils/certificate';
16
17
  type QueryRow<T extends TableName> = HelperQueryRow<T> | QueryRows<T>;
17
18
  type ReadOptions = {
18
19
  limit?: number;
@@ -30,16 +31,18 @@ type SpannerReadResponse<T extends TableName, C extends TableColumn<T>[]> = {
30
31
  moment: Date;
31
32
  };
32
33
  interface SpannerTransactionOptions {
33
- readOnly?: boolean;
34
34
  strongRead?: boolean;
35
35
  }
36
- export declare class SpannerTransaction {
36
+ export declare class SpannerTransaction implements LedgerStorageTransactionBase {
37
37
  #private;
38
+ readonly node: Node | undefined;
38
39
  readonly moment: Date;
40
+ readonly identifier: string;
41
+ readonly readOnly: boolean;
39
42
  readonly options: SpannerTransactionOptions;
40
43
  readonly statsChanges: Parameters<Stats['incr']>[];
41
- constructor(database: GoogleSpannerDatabase, options?: SpannerTransactionOptions);
42
- evaluateError(error: any): KeetaNetLedgerError;
44
+ constructor(database: GoogleSpannerDatabase, options: SpannerTransactionOptions, transactionBase: LedgerStorageTransactionBase);
45
+ evaluateError(error: any): any;
43
46
  beginTransaction(identifier: string, strongRead?: boolean): Promise<void>;
44
47
  endTransaction(mode: 'COMMIT' | 'ROLLBACK'): Promise<void>;
45
48
  insert<T extends TableName, R extends QueryRow<T>>(table: T, query: R): void;
@@ -66,11 +69,11 @@ export declare class DBSpanner extends LedgerStorageBase implements LedgerStorag
66
69
  constructor();
67
70
  init(config: LedgerConfig, ledger: Ledger): void;
68
71
  destroy(): Promise<void>;
69
- beginTransaction(identifier: string, readOnly?: boolean): Promise<SpannerTransaction>;
72
+ beginTransaction(transactionBase: LedgerStorageTransactionBase): Promise<SpannerTransaction>;
70
73
  commitTransaction(transaction: SpannerTransaction): Promise<void>;
71
74
  abortTransaction(transaction: SpannerTransaction): Promise<void>;
72
- evaluateError(error: any): Promise<KeetaNetLedgerError>;
73
- delegatedWeight(transaction: SpannerTransaction, rep?: Account): Promise<bigint>;
75
+ evaluateError(error: any): Promise<any>;
76
+ delegatedWeight(transaction: SpannerTransaction, rep?: Account | InstanceType<typeof Account.Set>): Promise<bigint>;
74
77
  getBalance(transaction: SpannerTransaction, account: GenericAccount | string, token: TokenAddress | string): Promise<bigint>;
75
78
  getAllBalances(transaction: SpannerTransaction, account: GenericAccount): Promise<GetAllBalancesResponse>;
76
79
  addPendingVote(transaction: SpannerTransaction, votesAndBlocks: VoteStaple): Promise<void>;
@@ -79,11 +82,15 @@ export declare class DBSpanner extends LedgerStorageBase implements LedgerStorag
79
82
  * If an adjustment cannot be made right now, defer it for follow-up
80
83
  */
81
84
  protected adjustDefer(transaction: SpannerTransaction, input: VoteStaple): Promise<void>;
82
- adjust(transaction: SpannerTransaction, input: VoteStaple, changes: ComputedEffectOfBlocks, mayDefer?: boolean): Promise<BlockHash[]>;
85
+ adjust(transaction: SpannerTransaction, input: VoteStaple, changes: ComputedEffectOfBlocks, mayDefer?: boolean, completedStaples?: Set<string>): Promise<VoteStaple[]>;
83
86
  getBlock(transaction: SpannerTransaction, blockHash: BlockHash, from: LedgerSelector): Promise<Block | null>;
84
- getBlockHeight(transaction: SpannerTransaction, blockHash: BlockHash, account: GenericAccount): Promise<{
85
- blockHeight: string | null;
86
- } | null>;
87
+ getBlockHeights(transaction: any, toFetch: {
88
+ blockHash: BlockHash;
89
+ account: GenericAccount;
90
+ }[]): Promise<{
91
+ [blockHash: string]: bigint | null;
92
+ }>;
93
+ getBlockHeight(transaction: SpannerTransaction, blockHash: BlockHash, account: GenericAccount): Promise<bigint | null>;
87
94
  getVotes(transaction: SpannerTransaction, blockHash: BlockHash, from: LedgerSelector): Promise<Vote[] | null>;
88
95
  getVoteStaples(transaction: SpannerTransaction, stapleBlockHashes: VoteBlockHash[], from?: LedgerSelector): Promise<VoteBlockHashMap<VoteStaple | null>>;
89
96
  getHistory(transaction: SpannerTransaction, account: GenericAccount, start: VoteBlockHash | null, limit?: number): Promise<VoteBlockHash[]>;
@@ -91,6 +98,9 @@ export declare class DBSpanner extends LedgerStorageBase implements LedgerStorag
91
98
  getVotesFromMultiplePrevious(transaction: SpannerTransaction, prevBlocks: BlockHash[], from: LedgerSelector, issuer?: Account): Promise<{
92
99
  [hash: string]: Vote[] | null;
93
100
  }>;
101
+ getHeadBlockHashes(transaction: any, accounts: InstanceType<typeof Account.Set>): Promise<{
102
+ [account: string]: BlockHash | null;
103
+ }>;
94
104
  getHeadBlocks(transaction: SpannerTransaction, accounts: GenericAccount[], from: LedgerSelector): Promise<{
95
105
  [publicKey: string]: Block | null;
96
106
  }>;
@@ -102,6 +112,8 @@ export declare class DBSpanner extends LedgerStorageBase implements LedgerStorag
102
112
  getVotesAfter(transaction: SpannerTransaction, moment: Date, startKey?: string, options?: GetVotesAfterOptions): Promise<PaginatedVotes>;
103
113
  protected gcBatch(transaction: SpannerTransaction): Promise<boolean>;
104
114
  getNextSerialNumber(): Promise<bigint>;
115
+ getAccountCertificates(transaction: SpannerTransaction, account: GenericAccount): Promise<CertificateWithIntermediates[]>;
116
+ getAccountCertificateByHash(transaction: SpannerTransaction, account: GenericAccount, certificateHash: CertificateHash): Promise<CertificateWithIntermediates | null>;
105
117
  stats(): Promise<LedgerStatistics>;
106
118
  }
107
119
  export declare const Testing: {
@@ -5,6 +5,7 @@ import Block, { BlockHash } from '../block';
5
5
  import Vote, { PossiblyExpiredVote, VoteBlockHash } from '../vote';
6
6
  import type { BaseSet, ExternalSet } from '../permissions';
7
7
  import type { SpannerTransaction } from './db_spanner';
8
+ import { Certificate, CertificateBundle, CertificateHash } from '../utils/certificate';
8
9
  declare const ColumnTypes: {
9
10
  readonly LEDGER: {
10
11
  readonly dbType: "STRING";
@@ -15,7 +16,7 @@ declare const ColumnTypes: {
15
16
  };
16
17
  readonly ACCOUNT: {
17
18
  readonly fromSpanner: (pubKey: string) => Account<AccountKeyAlgorithm.ECDSA_SECP256K1 | AccountKeyAlgorithm.ED25519 | AccountKeyAlgorithm.ECDSA_SECP256R1>;
18
- readonly toSpanner: (account: Account) => import("../account").Secp256K1PublicKeyString | import("../account").ED25519PublicKeyString | import("../account").Secp256R1PublicKeyString;
19
+ readonly toSpanner: (account: Account) => import("../account").Secp256K1PublicKeyString | import("../account").Secp256R1PublicKeyString | import("../account").ED25519PublicKeyString;
19
20
  readonly dbType: string;
20
21
  readonly dbSize: number;
21
22
  readonly toComparable: (account: string | Account) => string;
@@ -42,7 +43,7 @@ declare const ColumnTypes: {
42
43
  readonly toComparable: (str: string) => string;
43
44
  };
44
45
  readonly INFO_METADATA: {
45
- readonly dbSize: 750;
46
+ readonly dbSize: 5464;
46
47
  readonly dbType: string;
47
48
  readonly fromSpanner: (str: string) => string;
48
49
  readonly toSpanner: (str: string) => string;
@@ -84,18 +85,25 @@ declare const ColumnTypes: {
84
85
  readonly dbSize: undefined;
85
86
  };
86
87
  readonly BLOCKHASH: {
87
- readonly fromSpanner: (hash: string) => BlockHash;
88
- readonly toSpanner: (blockHash: BlockHash) => string;
89
- readonly toComparable: (blockHash: BlockHash | string) => string;
90
- readonly dbType: string;
91
- readonly dbSize: number;
88
+ fromSpanner: (hash: string) => BlockHash;
89
+ toSpanner: (constructedInput: BlockHash) => string;
90
+ toComparable: (input: string | BlockHash) => string;
91
+ dbType: string;
92
+ dbSize: number;
93
+ };
94
+ readonly CERTIFICATE_HASH: {
95
+ fromSpanner: (hash: string) => CertificateHash;
96
+ toSpanner: (constructedInput: CertificateHash) => string;
97
+ toComparable: (input: string | CertificateHash) => string;
98
+ dbType: string;
99
+ dbSize: number;
92
100
  };
93
101
  readonly VOTEBLOCKHASH: {
94
- readonly fromSpanner: (hash: string) => VoteBlockHash;
95
- readonly toSpanner: (blockHash: VoteBlockHash) => string;
96
- readonly toComparable: (blockHash: VoteBlockHash | string) => string;
97
- readonly dbType: string;
98
- readonly dbSize: number;
102
+ fromSpanner: (hash: string) => VoteBlockHash;
103
+ toSpanner: (constructedInput: VoteBlockHash) => string;
104
+ toComparable: (input: string | VoteBlockHash) => string;
105
+ dbType: string;
106
+ dbSize: number;
99
107
  };
100
108
  readonly VOTE_UID: {
101
109
  readonly dbSize: 150;
@@ -104,6 +112,22 @@ declare const ColumnTypes: {
104
112
  readonly toSpanner: (str: string) => string;
105
113
  readonly toComparable: (str: string) => string;
106
114
  };
115
+ readonly CERTIFICATE: {
116
+ readonly fromSpanner: (certificate: Buffer) => Certificate;
117
+ readonly toSpanner: (certificate: Certificate) => Buffer;
118
+ readonly toComparable: (input: Certificate | Buffer) => string & {
119
+ readonly __certificateHash: never;
120
+ };
121
+ readonly dbType: string;
122
+ readonly dbSize: string;
123
+ };
124
+ readonly CERTIFICATE_BUNDLE: {
125
+ readonly fromSpanner: (bundle: Buffer) => CertificateBundle;
126
+ readonly toSpanner: (bundle: CertificateBundle) => Buffer;
127
+ readonly toComparable: (input: CertificateBundle | Buffer) => string;
128
+ readonly dbType: string;
129
+ readonly dbSize: string;
130
+ };
107
131
  readonly BUFFER: {
108
132
  dbType: string;
109
133
  dbSize: string;
@@ -158,7 +182,7 @@ declare const ColumnTypes: {
158
182
  dbSize: number;
159
183
  toComparable: (account: string | Account) => string;
160
184
  fromSpanner: (pubKey: string) => GenericAccount;
161
- toSpanner: (account: GenericAccount) => import("../account").Secp256K1PublicKeyString | import("../account").ED25519PublicKeyString | import("../account").NetworkPublicKeyString | import("../account").TokenPublicKeyString | import("../account").StoragePublicKeyString | import("../account").Secp256R1PublicKeyString;
185
+ toSpanner: (account: GenericAccount) => import("../account").TokenPublicKeyString | import("../account").NetworkPublicKeyString | import("../account").StoragePublicKeyString | import("../account").MultisigPublicKeyString | import("../account").Secp256K1PublicKeyString | import("../account").Secp256R1PublicKeyString | import("../account").ED25519PublicKeyString;
162
186
  };
163
187
  readonly BUFFER_BIGINT: {
164
188
  dbType: string;
@@ -171,11 +195,12 @@ declare const ColumnTypes: {
171
195
  type ColumnTypeName = keyof typeof ColumnTypes;
172
196
  type ColumnOutputTypeArg<T extends ColumnTypeName> = Parameters<typeof ColumnTypes[T]['fromSpanner']>[0];
173
197
  type ColumnOutputTypeReturn<T extends ColumnTypeName> = ReturnType<typeof ColumnTypes[T]['fromSpanner']>;
174
- type ColumnOutputTypeInfer<X> = X extends ColumnInterface<infer TR> ? ColumnOutputTypeReturn<TR> : never;
198
+ type IfNullable<T, I> = I extends false ? T : (T | null);
199
+ type ColumnOutputTypeInfer<X> = X extends ColumnInterface<infer TR, infer Nullable> ? IfNullable<ColumnOutputTypeReturn<TR>, Nullable> : never;
175
200
  type ColumnInputTypeArg<T extends ColumnTypeName> = Parameters<typeof ColumnTypes[T]['toSpanner']>[0];
176
201
  type ColumnInputTypeReturn<T extends ColumnTypeName> = ReturnType<typeof ColumnTypes[T]['toSpanner']>;
177
- interface ColumnInterface<T extends ColumnTypeName> {
178
- nullable: (nullable: boolean) => ColumnInterface<T>;
202
+ interface ColumnInterface<T extends ColumnTypeName, Nullable extends boolean = boolean> {
203
+ nullable: <SetNullable extends boolean>(nullable: SetNullable) => ColumnInterface<T, SetNullable>;
179
204
  fromSpanner: (value: ColumnOutputTypeArg<T>, transaction: SpannerTransaction) => ColumnOutputTypeReturn<T>;
180
205
  toSpanner: (value: ColumnInputTypeArg<T>, transaction: SpannerTransaction) => ColumnInputTypeReturn<T>;
181
206
  toComparable: (value: any, transaction: SpannerTransaction) => any;
@@ -201,24 +226,24 @@ declare const schema: {
201
226
  readonly accountInfo: {
202
227
  readonly type: "TABLE";
203
228
  readonly columns: {
204
- readonly account: ColumnInterface<"GENERIC_ACCOUNT">;
205
- readonly name: ColumnInterface<"INFO_NAME">;
206
- readonly description: ColumnInterface<"INFO_DESCRIPTION">;
207
- readonly metadata: ColumnInterface<"INFO_METADATA">;
208
- readonly supply: ColumnInterface<"SUPPLY">;
209
- readonly defaultBasePermission: ColumnInterface<"BASE_PERMISSION">;
210
- readonly defaultExternalPermission: ColumnInterface<"EXTERNAL_PERMISSION">;
229
+ readonly account: ColumnInterface<"GENERIC_ACCOUNT", false>;
230
+ readonly name: ColumnInterface<"INFO_NAME", true>;
231
+ readonly description: ColumnInterface<"INFO_DESCRIPTION", true>;
232
+ readonly metadata: ColumnInterface<"INFO_METADATA", true>;
233
+ readonly supply: ColumnInterface<"SUPPLY", true>;
234
+ readonly defaultBasePermission: ColumnInterface<"BASE_PERMISSION", true>;
235
+ readonly defaultExternalPermission: ColumnInterface<"EXTERNAL_PERMISSION", true>;
211
236
  };
212
237
  readonly key: readonly [Key];
213
238
  };
214
239
  readonly permissions: {
215
240
  readonly type: "TABLE";
216
241
  readonly columns: {
217
- readonly account: ColumnInterface<"GENERIC_ACCOUNT">;
218
- readonly entity: ColumnInterface<"GENERIC_ACCOUNT">;
219
- readonly target: ColumnInterface<"GENERIC_ACCOUNT">;
220
- readonly basePermission: ColumnInterface<"BASE_PERMISSION">;
221
- readonly externalPermission: ColumnInterface<"EXTERNAL_PERMISSION">;
242
+ readonly account: ColumnInterface<"GENERIC_ACCOUNT", false>;
243
+ readonly entity: ColumnInterface<"GENERIC_ACCOUNT", false>;
244
+ readonly target: ColumnInterface<"GENERIC_ACCOUNT", false>;
245
+ readonly basePermission: ColumnInterface<"BASE_PERMISSION", false>;
246
+ readonly externalPermission: ColumnInterface<"EXTERNAL_PERMISSION", false>;
222
247
  };
223
248
  readonly key: readonly [Key, Key, Key];
224
249
  readonly interleave: Interleave;
@@ -226,10 +251,10 @@ declare const schema: {
226
251
  readonly ledger: {
227
252
  readonly type: "TABLE";
228
253
  readonly columns: {
229
- readonly account: ColumnInterface<"GENERIC_ACCOUNT">;
230
- readonly token: ColumnInterface<"TOKEN_ACCOUNT">;
231
- readonly onLedger: ColumnInterface<"LEDGER">;
232
- readonly balance: ColumnInterface<"INT_AS_STRING">;
254
+ readonly account: ColumnInterface<"GENERIC_ACCOUNT", false>;
255
+ readonly token: ColumnInterface<"TOKEN_ACCOUNT", false>;
256
+ readonly onLedger: ColumnInterface<"LEDGER", false>;
257
+ readonly balance: ColumnInterface<"INT_AS_STRING", false>;
233
258
  };
234
259
  readonly key: readonly [Key, Key, Key];
235
260
  readonly interleave: Interleave;
@@ -237,9 +262,9 @@ declare const schema: {
237
262
  readonly chain: {
238
263
  readonly type: "TABLE";
239
264
  readonly columns: {
240
- readonly account: ColumnInterface<"GENERIC_ACCOUNT">;
241
- readonly blockHeight: ColumnInterface<"BIGINT">;
242
- readonly blockHash: ColumnInterface<"BLOCKHASH">;
265
+ readonly account: ColumnInterface<"GENERIC_ACCOUNT", false>;
266
+ readonly blockHeight: ColumnInterface<"BIGINT", false>;
267
+ readonly blockHash: ColumnInterface<"BLOCKHASH", false>;
243
268
  };
244
269
  readonly key: readonly [Key, Key];
245
270
  readonly interleave: Interleave;
@@ -247,9 +272,9 @@ declare const schema: {
247
272
  readonly history: {
248
273
  readonly type: "TABLE";
249
274
  readonly columns: {
250
- readonly account: ColumnInterface<"GENERIC_ACCOUNT">;
251
- readonly voteBlockHash: ColumnInterface<"VOTEBLOCKHASH">;
252
- readonly orderIndex: ColumnInterface<"BUFFER_BIGINT">;
275
+ readonly account: ColumnInterface<"GENERIC_ACCOUNT", false>;
276
+ readonly voteBlockHash: ColumnInterface<"VOTEBLOCKHASH", false>;
277
+ readonly orderIndex: ColumnInterface<"BUFFER_BIGINT", false>;
253
278
  };
254
279
  readonly key: readonly [Key, Key];
255
280
  readonly interleave: Interleave;
@@ -257,8 +282,8 @@ declare const schema: {
257
282
  readonly delegation: {
258
283
  readonly type: "TABLE";
259
284
  readonly columns: {
260
- readonly account: ColumnInterface<"ACCOUNT">;
261
- readonly delegatedToRep: ColumnInterface<"ACCOUNT">;
285
+ readonly account: ColumnInterface<"ACCOUNT", false>;
286
+ readonly delegatedToRep: ColumnInterface<"ACCOUNT", false>;
262
287
  };
263
288
  readonly key: readonly [Key];
264
289
  readonly interleave: Interleave;
@@ -266,31 +291,31 @@ declare const schema: {
266
291
  readonly votes: {
267
292
  readonly type: "TABLE";
268
293
  readonly columns: {
269
- readonly voteUID: ColumnInterface<"VOTE_UID">;
270
- readonly onLedger: ColumnInterface<"LEDGER">;
271
- readonly vote: ColumnInterface<"VOTE">;
272
- readonly timestamp: ColumnInterface<"TIMESTAMP">;
273
- readonly expires: ColumnInterface<"TIMESTAMP">;
274
- readonly issuer: ColumnInterface<"ACCOUNT">;
275
- readonly voteBlockHash: ColumnInterface<"VOTEBLOCKHASH">;
294
+ readonly voteUID: ColumnInterface<"VOTE_UID", false>;
295
+ readonly onLedger: ColumnInterface<"LEDGER", false>;
296
+ readonly vote: ColumnInterface<"VOTE", false>;
297
+ readonly timestamp: ColumnInterface<"TIMESTAMP", false>;
298
+ readonly expires: ColumnInterface<"TIMESTAMP", false>;
299
+ readonly issuer: ColumnInterface<"ACCOUNT", false>;
300
+ readonly voteBlockHash: ColumnInterface<"VOTEBLOCKHASH", false>;
276
301
  };
277
302
  readonly key: readonly [Key, Key];
278
303
  };
279
304
  readonly blocks: {
280
305
  readonly type: "TABLE";
281
306
  readonly columns: {
282
- readonly blockHash: ColumnInterface<"BLOCKHASH">;
283
- readonly onLedger: ColumnInterface<"LEDGER">;
284
- readonly block: ColumnInterface<"BLOCK">;
285
- readonly prevBlockHash: ColumnInterface<"BLOCKHASH">;
307
+ readonly blockHash: ColumnInterface<"BLOCKHASH", false>;
308
+ readonly onLedger: ColumnInterface<"LEDGER", false>;
309
+ readonly block: ColumnInterface<"BLOCK", false>;
310
+ readonly prevBlockHash: ColumnInterface<"BLOCKHASH", false>;
286
311
  };
287
312
  readonly key: readonly [Key];
288
313
  };
289
314
  readonly voteBlocks: {
290
315
  readonly type: "TABLE";
291
316
  readonly columns: {
292
- readonly blockHash: ColumnInterface<"BLOCKHASH">;
293
- readonly voteUID: ColumnInterface<"VOTE_UID">;
317
+ readonly blockHash: ColumnInterface<"BLOCKHASH", false>;
318
+ readonly voteUID: ColumnInterface<"VOTE_UID", false>;
294
319
  };
295
320
  readonly key: readonly [Key, Key];
296
321
  readonly interleave: Interleave;
@@ -298,38 +323,36 @@ declare const schema: {
298
323
  readonly weight: {
299
324
  readonly type: "TABLE";
300
325
  readonly columns: {
301
- readonly repAccount: ColumnInterface<"ACCOUNT">;
302
- readonly weight: ColumnInterface<"INT_AS_STRING">;
326
+ readonly repAccount: ColumnInterface<"ACCOUNT", false>;
327
+ readonly weight: ColumnInterface<"INT_AS_STRING", false>;
303
328
  };
304
329
  readonly key: readonly [Key];
305
330
  };
306
331
  readonly heapBlocks: {
307
332
  readonly type: "TABLE";
308
333
  readonly columns: {
309
- readonly prevBlockHash: ColumnInterface<"BLOCKHASH">;
310
- readonly storageHash: ColumnInterface<"HASH">;
334
+ readonly prevBlockHash: ColumnInterface<"BLOCKHASH", false>;
335
+ readonly storageHash: ColumnInterface<"HASH", false>;
311
336
  };
312
337
  readonly key: readonly [Key];
313
338
  };
314
339
  readonly heapStorage: {
315
340
  readonly type: "TABLE";
316
341
  readonly columns: {
317
- readonly storageHash: ColumnInterface<"HASH">;
318
- readonly data: ColumnInterface<"BUFFER">;
342
+ readonly storageHash: ColumnInterface<"HASH", false>;
343
+ readonly data: ColumnInterface<"BUFFER", false>;
319
344
  };
320
345
  readonly key: readonly [Key];
321
346
  };
322
- readonly permissionsAccount: {
323
- readonly type: "INDEX";
324
- readonly table: "permissions";
325
- readonly key: readonly [Key];
326
- readonly storing: readonly [Key, Key];
327
- };
328
- readonly permissionsPrincipalEntity: {
329
- readonly type: "INDEX";
330
- readonly table: "permissions";
347
+ readonly accountCertificates: {
348
+ readonly type: "TABLE";
349
+ readonly columns: {
350
+ readonly account: ColumnInterface<"GENERIC_ACCOUNT", false>;
351
+ readonly certificateHash: ColumnInterface<"CERTIFICATE_HASH", false>;
352
+ readonly certificate: ColumnInterface<"CERTIFICATE", false>;
353
+ readonly intermediates: ColumnInterface<"CERTIFICATE_BUNDLE", true>;
354
+ };
331
355
  readonly key: readonly [Key, Key];
332
- readonly storing: readonly [Key, Key];
333
356
  };
334
357
  readonly permissionsEntity: {
335
358
  readonly type: "INDEX";
@@ -342,30 +365,11 @@ declare const schema: {
342
365
  readonly table: "permissions";
343
366
  readonly key: readonly [Key, Key];
344
367
  };
345
- readonly historyAccount: {
346
- readonly type: "INDEX";
347
- readonly table: "history";
348
- readonly key: readonly [Key];
349
- readonly storing: readonly [Key];
350
- };
351
368
  readonly historyVoteBlockHash: {
352
369
  readonly type: "INDEX";
353
370
  readonly table: "history";
354
371
  readonly key: readonly [Key, Key];
355
372
  };
356
- readonly historyAccountOrderIndex: {
357
- readonly type: "INDEX";
358
- readonly table: "history";
359
- readonly key: readonly [Key, Key];
360
- readonly storing: readonly [Key];
361
- };
362
- readonly chainAccount: {
363
- readonly type: "INDEX";
364
- readonly table: "chain";
365
- readonly key: readonly [Key];
366
- readonly interleave: Interleave;
367
- readonly storing: readonly [Key];
368
- };
369
373
  readonly chainAccountHash: {
370
374
  readonly type: "INDEX";
371
375
  readonly table: "chain";
@@ -377,13 +381,7 @@ declare const schema: {
377
381
  readonly type: "INDEX";
378
382
  readonly table: "blocks";
379
383
  readonly key: readonly [Key];
380
- readonly storing: readonly [Key, Key];
381
- };
382
- readonly voteBlocksBlockhash: {
383
- readonly type: "INDEX";
384
- readonly table: "voteBlocks";
385
- readonly key: readonly [Key];
386
- readonly interleave: Interleave;
384
+ readonly storing: readonly [Key];
387
385
  };
388
386
  readonly votesTimestamp: {
389
387
  readonly type: "INDEX";
@@ -403,25 +401,12 @@ declare const schema: {
403
401
  readonly key: readonly [Key, Key];
404
402
  readonly storing: readonly [Key];
405
403
  };
406
- readonly votesUid: {
407
- readonly type: "INDEX";
408
- readonly table: "votes";
409
- readonly key: readonly [Key];
410
- readonly storing: readonly [Key];
411
- };
412
404
  readonly votesBlockHash: {
413
405
  readonly type: "INDEX";
414
406
  readonly table: "votes";
415
407
  readonly key: readonly [Key];
416
408
  readonly storing: readonly [Key];
417
409
  };
418
- readonly ledgerBalanceByAccount: {
419
- readonly type: "INDEX";
420
- readonly table: "ledger";
421
- readonly key: readonly [Key];
422
- readonly storing: readonly [Key];
423
- readonly interleave: Interleave;
424
- };
425
410
  };
426
411
  type SchemaEntriesFilter<T extends SchemaType> = keyof {
427
412
  [K in (keyof typeof schema) as typeof schema[K]['type'] extends T ? K : never]: true;
@@ -458,7 +443,7 @@ export declare class Helper {
458
443
  static getPrimaryKeyNames<X extends TableIndexName>(table: X): string[];
459
444
  static getNameFromType(filterType: 'INDEX'): IndexName[];
460
445
  static getNameFromType(filterType: 'TABLE'): TableName[];
461
- static getAllTables(): ("permissions" | "blocks" | "votes" | "ledger" | "chain" | "history" | "weight" | "accountInfo" | "heapBlocks" | "heapStorage" | "delegation" | "voteBlocks")[];
446
+ static getAllTables(): ("blocks" | "permissions" | "votes" | "ledger" | "chain" | "history" | "weight" | "accountInfo" | "accountCertificates" | "heapBlocks" | "heapStorage" | "delegation" | "voteBlocks")[];
462
447
  static IsTable(name: TableIndexName): name is TableName;
463
448
  static IsIndex(name: TableIndexName): name is IndexName;
464
449
  static getIndexParent(index: IndexName): TableName;
@@ -4,14 +4,14 @@ import type { BlockHash } from '../block';
4
4
  import { Block } from '../block';
5
5
  import type { GenericAccount, IdentifierAddress, TokenAddress } from '../account';
6
6
  import Account, { AccountKeyAlgorithm } from '../account';
7
- import type { Ledger, LedgerConfig, LedgerStorageAPI, LedgerSelector, PaginatedVotes, GetVotesAfterOptions } from '../ledger';
8
- import type { AccountInfo, ACLRow, GetAllBalancesResponse, LedgerStatistics } from './types';
7
+ import type { Ledger, LedgerConfig, LedgerStorageAPI, LedgerSelector, PaginatedVotes, GetVotesAfterOptions, LedgerStorageTransactionBase } from '../ledger';
8
+ import type { AccountInfo, ACLRow, GetAllBalancesResponse, LedgerStatistics, CertificateWithIntermediates } from './types';
9
9
  import { LedgerStorageBase } from './common';
10
10
  import * as sqlite from 'sqlite';
11
11
  import type { ComputedEffectOfBlocks } from './effects';
12
- interface DBSqliteTransaction {
12
+ import type { CertificateHash } from '../utils/certificate';
13
+ interface DBSqliteTransaction extends LedgerStorageTransactionBase {
13
14
  sql: Awaited<ReturnType<typeof sqlite['open']>>;
14
- moment: Date;
15
15
  release: null | ((value: null | number) => void);
16
16
  lock: null | Promise<null | number>;
17
17
  }
@@ -24,11 +24,11 @@ export declare class DBSqlite extends LedgerStorageBase implements LedgerStorage
24
24
  constructor();
25
25
  init(config: LedgerConfig, ledger: Ledger): void;
26
26
  destroy(): Promise<void>;
27
- beginTransaction(): Promise<DBSqliteTransaction>;
27
+ beginTransaction(transactionBase: LedgerStorageTransactionBase): Promise<DBSqliteTransaction>;
28
28
  commitTransaction(transaction: DBSqliteTransaction): Promise<void>;
29
29
  abortTransaction(transaction: DBSqliteTransaction): Promise<void>;
30
30
  evaluateError(error: any): Promise<any>;
31
- delegatedWeight(transaction: DBSqliteTransaction, rep?: Account): Promise<bigint>;
31
+ delegatedWeight(transaction: DBSqliteTransaction, rep?: Account | InstanceType<typeof Account.Set>): Promise<bigint>;
32
32
  getBalance(transaction: DBSqliteTransaction, account: GenericAccount, token: TokenAddress): Promise<bigint>;
33
33
  getAllBalances(transaction: DBSqliteTransaction, account: GenericAccount): Promise<GetAllBalancesResponse>;
34
34
  addPendingVote(transaction: DBSqliteTransaction, votesAndBlocks: VoteStaple): Promise<void>;
@@ -41,11 +41,9 @@ export declare class DBSqlite extends LedgerStorageBase implements LedgerStorage
41
41
  listACLsByEntity(transaction: DBSqliteTransaction, entity: GenericAccount): Promise<ACLRow[]>;
42
42
  listACLsByPrincipal(transaction: DBSqliteTransaction, principal: GenericAccount, entityList?: GenericAccount[]): Promise<ACLRow[]>;
43
43
  getAccountInfo(transaction: DBSqliteTransaction, account: GenericAccount | string): Promise<AccountInfo>;
44
- adjust(transaction: DBSqliteTransaction, input: VoteStaple, changes: ComputedEffectOfBlocks, mayDefer?: boolean): Promise<BlockHash[]>;
44
+ adjust(transaction: DBSqliteTransaction, input: VoteStaple, changes: ComputedEffectOfBlocks, mayDefer?: boolean, completedStaples?: Set<string>): Promise<VoteStaple[]>;
45
45
  getBlock(transaction: DBSqliteTransaction, block: BlockHash, from: LedgerSelector): Promise<Block | null>;
46
- getBlockHeight(transaction: DBSqliteTransaction, blockHash: BlockHash, account: GenericAccount): Promise<{
47
- blockHeight: string | null;
48
- } | null>;
46
+ getBlockHeight(transaction: DBSqliteTransaction, blockHash: BlockHash, account: GenericAccount): Promise<bigint | null>;
49
47
  getVotes(transaction: DBSqliteTransaction, block: BlockHash, from: LedgerSelector): Promise<Vote[] | null>;
50
48
  getVoteStaples(transaction: DBSqliteTransaction, voteBlockHashes: VoteBlockHash[], from?: LedgerSelector): Promise<VoteBlockHashMap<VoteStaple | null>>;
51
49
  getHistory(transaction: DBSqliteTransaction, account: GenericAccount, start: VoteBlockHash | null, limit?: number): Promise<VoteBlockHash[]>;
@@ -57,6 +55,8 @@ export declare class DBSqlite extends LedgerStorageBase implements LedgerStorage
57
55
  [publicKey: string]: Block | null;
58
56
  }>;
59
57
  getVotesAfter(transaction: DBSqliteTransaction, moment: Date, startKey?: string, options?: GetVotesAfterOptions): Promise<PaginatedVotes>;
58
+ getAccountCertificates(transaction: DBSqliteTransaction, account: GenericAccount): Promise<CertificateWithIntermediates[]>;
59
+ getAccountCertificateByHash(transaction: DBSqliteTransaction, account: GenericAccount, hash: CertificateHash): Promise<CertificateWithIntermediates | null>;
60
60
  protected gcBatch(transaction: DBSqliteTransaction): Promise<boolean>;
61
61
  getNextSerialNumber(transaction: DBSqliteTransaction): Promise<bigint>;
62
62
  stats(): Promise<LedgerStatistics>;
@@ -1,9 +1,10 @@
1
1
  import type { GenericAccount, IdentifierAddress, NetworkAddress, TokenAddress } from '../account';
2
2
  import Account from '../account';
3
- import type { BlockHash } from '../block';
3
+ import type { AdjustMethod, BlockHash } from '../block';
4
4
  import { Block } from '../block';
5
5
  import type { AccountInfo, ACLEntry, ACLUpdate } from '../ledger/types';
6
- import type { InstanceSet } from '../utils/helper';
6
+ import type { Certificate, CertificateBundle } from '../utils/certificate';
7
+ import { CertificateHash } from '../utils/certificate';
7
8
  interface NumericValueEntry {
8
9
  value: bigint;
9
10
  }
@@ -21,6 +22,18 @@ interface ModifyTokenBalanceEntry extends TokenNumericEntry {
21
22
  set: boolean;
22
23
  receivable: boolean;
23
24
  }
25
+ /**
26
+ * Change of certificate indication
27
+ */
28
+ export type CertificateUpdate = {
29
+ method: AdjustMethod.ADD;
30
+ certificateHash: CertificateHash;
31
+ certificate: Certificate;
32
+ intermediateCertificates: CertificateBundle | null;
33
+ } | {
34
+ method: AdjustMethod.SUBTRACT;
35
+ certificateHash: CertificateHash;
36
+ };
24
37
  type TokenEntry = ModifyTokenBalanceEntry | RequestTokenReceiveEntry;
25
38
  interface ComputedBlocksEffectTokenChangesField {
26
39
  [tokenPubKey: string]: TokenEntry[];
@@ -45,6 +58,7 @@ interface ComputedBlocksEffectFields {
45
58
  permissionRequirements?: ACLEntry[];
46
59
  createRequests?: CreateIdentifierRequest[];
47
60
  delegation?: DelegationUpdate;
61
+ certificate?: CertificateUpdate[];
48
62
  }
49
63
  /**
50
64
  * Which accounts and fields are affected by a set of block
@@ -61,7 +75,8 @@ export type ComputedEffectOfBlocksByAccount = {
61
75
  };
62
76
  export type ComputedEffectOfBlocks = {
63
77
  accounts: ComputedEffectOfBlocksByAccount;
64
- touched: InstanceSet<GenericAccount>;
78
+ touched: InstanceType<typeof Account.Set>;
79
+ possibleNewAccounts: InstanceType<typeof Account.Set>;
65
80
  metadata: {
66
81
  operationCount: number;
67
82
  blockCount: number;
@@ -72,7 +87,7 @@ type LedgerOptions = {
72
87
  baseToken: TokenAddress;
73
88
  networkAddress: NetworkAddress;
74
89
  };
75
- type OnlyTouchedEffects = Pick<ComputedEffectOfBlocks, 'touched'>;
90
+ type OnlyTouchedEffects = Pick<ComputedEffectOfBlocks, 'touched' | 'possibleNewAccounts'>;
76
91
  export declare function computeEffectOfBlocks(blocks: Block[], ledger?: undefined): OnlyTouchedEffects;
77
92
  export declare function computeEffectOfBlocks(blocks: Block[], ledger: LedgerOptions): ComputedEffectOfBlocks;
78
93
  export {};