@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.
- package/api/index.d.ts +23 -7
- package/api/node.d.ts +27 -2
- package/api/vote.d.ts +4 -6
- package/client/builder.d.ts +17 -0
- package/client/client_common_tests.d.ts +1 -1
- package/client/index-browser.d.ts +112 -3
- package/client/index-browser.js +18234 -29816
- package/client/index.d.ts +112 -3
- package/client/index.js +4070 -6581
- package/config/index.d.ts +6 -1
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/KeetaNetSDK.Client.html +31 -11
- package/docs/classes/KeetaNetSDK.Referenced.Account.html +31 -21
- package/docs/classes/KeetaNetSDK.Referenced.BaseSet.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.Block.html +2 -4
- package/docs/classes/KeetaNetSDK.Referenced.BlockBuilder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockHash.html +4 -5
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperation.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationCREATE_IDENTIFIER.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMANAGE_CERTIFICATE.html +12 -0
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMODIFY_PERMISSIONS.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationRECEIVE.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSEND.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_INFO.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_REP.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_MODIFY_BALANCE.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_SUPPLY.html +2 -2
- package/docs/classes/{KeetaNetSDK.Referenced.src_lib_utils_certificate.Certificate.html → KeetaNetSDK.Referenced.Certificate.html} +31 -14
- package/docs/classes/KeetaNetSDK.Referenced.CertificateBundle.html +8 -0
- package/docs/classes/KeetaNetSDK.Referenced.CertificateHash.html +16 -0
- package/docs/classes/KeetaNetSDK.Referenced.ECDSAKeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1KeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1PrivateKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1PublicKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1Signature.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1KeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1PrivateKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1PublicKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1Signature.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ED25519KeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ED25519PrivateKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ED25519PublicKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ED25519Signature.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ExternalKeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ExternalSet.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.IdentifierKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.IdentifierKeyPair.html +4 -4
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetError.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeyInterface.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeyStorage.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.Ledger.html +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.LedgerAtomicInterface.html +3 -1
- package/docs/classes/KeetaNetSDK.Referenced.LedgerRequestCache.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.Node.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.P2PSwitch.html +3 -3
- package/docs/classes/KeetaNetSDK.Referenced.PendingAccount.html +3 -2
- package/docs/classes/KeetaNetSDK.Referenced.PermissionSetHolder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.Permissions.html +2 -3
- package/docs/classes/KeetaNetSDK.Referenced.PossiblyExpiredVote.html +5 -3
- package/docs/classes/KeetaNetSDK.Referenced.RequestTiming.html +16 -2
- package/docs/classes/KeetaNetSDK.Referenced.SignatureStorage.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.Stats.html +3 -2
- package/docs/classes/KeetaNetSDK.Referenced.UserClientBuilder.html +3 -2
- package/docs/classes/KeetaNetSDK.Referenced.Vote.html +5 -5
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockBundle.html +35 -0
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockHashMap.html +9 -8
- package/docs/classes/KeetaNetSDK.Referenced.VoteBuilder.html +2 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteStaple.html +23 -29
- package/docs/classes/KeetaNetSDK.Referenced.VoteStapleHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_asn1.BufferStorageASN1.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_buffer.BufferStorage.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_certificate.CertificateBuilder.html +1 -1
- package/docs/classes/KeetaNetSDK.UserClient.html +57 -15
- package/docs/documents/GETTING-STARTED.html +5 -2
- package/docs/enums/KeetaNetSDK.Referenced.AccountKeyAlgorithm.html +2 -1
- package/docs/enums/KeetaNetSDK.Referenced.AdjustMethod.html +4 -4
- package/docs/enums/KeetaNetSDK.Referenced.BaseFlag.html +2 -1
- package/docs/enums/KeetaNetSDK.Referenced.OperationType.html +2 -1
- package/docs/functions/KeetaNetSDK.Referenced.src_config.getDefaultConfig.html +2 -2
- package/docs/functions/KeetaNetSDK.Referenced.src_config.getNetworkAlias.html +1 -1
- package/docs/functions/KeetaNetSDK.Referenced.src_config.getValidation.html +1 -1
- package/docs/functions/KeetaNetSDK.Referenced.src_config.isNetwork.html +1 -1
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_asn1.isASN1Object.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_buffer.ZlibDeflateAsync.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_buffer.ZlibInflateAsync.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_conversion.objectToBuffer.html +1 -1
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_conversion.toJSONSerializable.html +1 -1
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.booleanEnv.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.nonNullable.html +1 -0
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ACLEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ACLUpdate.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1ExplicitContextTag.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1ImplicitContextTag.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1Object.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseExternalKeyPairFunctions.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseGenerationConfig.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockCanonical.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSON.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperation.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationCREATE_IDENTIFIER.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMANAGE_CERTIFICATE.html +6 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMANAGE_CERTIFICATESerializable.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMODIFY_PERMISSIONS.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationRECEIVE.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSEND.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSET_INFO.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSET_REP.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationTOKEN_ADMIN_MODIFY_BALANCE.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationTOKEN_ADMIN_SUPPLY.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockUnsignedCanonical.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.CertificateWithIntermediates.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.CertificateWithIntermediatesResponse.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ComputedBlocksEffectFields.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.Constructor.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.DisposableTimingHandle.html +7 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsNoEncryption.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsSupportsEncryption.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.FeeAmountAndToken.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.FeeAmountAndTokenJSON.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.IdentifierCreateRequest.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.InitialConfigSupply.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.InstanceSet.html +13 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.KVGenericOptionsType.html +2 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.KVSetOptionsType.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.KVStorageProviderAPI.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.LedgerConfig.html +4 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.LedgerStatistics.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.LedgerStorageAPI.html +15 -7
- package/docs/interfaces/KeetaNetSDK.Referenced.LedgerStorageTransactionBase.html +6 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ModifyTokenBalanceEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.NodeConfig.html +3 -3
- package/docs/interfaces/KeetaNetSDK.Referenced.NumericValidationRule.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.NumericValueEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerBase.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerListener.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerRepBase.html +3 -3
- package/docs/interfaces/KeetaNetSDK.Referenced.PendingOperations.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.PendingOperationsJSON.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.PublicKeyStorage.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.PublicKeyStringMapping.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.RequestTokenReceiveEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.TokenNumericEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientConfig.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientListenerOptions.html +2 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientOptions.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteBundleConstructor.html +6 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteJSON.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteStapleJSON.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.WithIsInstance.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_config.ValidationConfig.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1BitString.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Date.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1OID.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Set.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1String.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_conversion.ToJSONSerializableOptions.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_helper.InstanceSetConstructor.html +2 -2
- package/docs/modules/KeetaNetSDK.Referenced.html +1 -1
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_asn1.html +1 -1
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_buffer.html +1 -1
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_certificate.html +1 -1
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_conversion.html +1 -1
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_helper.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.AccountKeyAlgorithmHex.html +8 -0
- package/docs/types/KeetaNetSDK.Referenced.AccountKeyAlgorithmHexReverse.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.AccountKeyAlgorithmHexToType.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.AddBinaryIfIncluded.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockHashString.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateErrorCode.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateExtensionData.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateExtensions.html +2 -2
- package/docs/types/KeetaNetSDK.Referenced.CertificateHashString.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateOptions.html +4 -4
- package/docs/types/KeetaNetSDK.Referenced.CertificateUpdate.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.ComputedEffectOfBlocks.html +3 -2
- package/docs/types/KeetaNetSDK.Referenced.DbStats.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.ErrorCode.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.ExportedJSONOperation.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.MultisigPublicKeyString.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.NodeLike-1.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.NodeLike.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.PublicKeyAndTypeStringHex.html +3 -0
- package/docs/types/{KeetaNetSDK.Referenced.VoteJSONOutput.html → KeetaNetSDK.Referenced.StorageAddress.html} +1 -1
- package/docs/types/KeetaNetSDK.Referenced.TimingData.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.TimingSectionHandle.html +6 -0
- package/docs/types/KeetaNetSDK.Referenced.VoteBuilderOptions.html +4 -0
- package/docs/types/KeetaNetSDK.Referenced.src_config.NetworkConfig.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_asn1.ValidateASN1.Schema.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_asn1.ValidateASN1.SchemaMap.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_certificate.CertificateJSONOutput.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.ToJSONSerializable.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.BlockErrorCodes-1.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.BlockErrorCodes.html +1 -1
- package/docs/{types/KeetaNetSDK.Referenced.JSONUnsupportedTypes.html → variables/KeetaNetSDK.Referenced.CertificateErrorType.html} +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.ClientErrorCodes.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.KVErrorCodes.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.Operation.html +2 -2
- package/docs/variables/KeetaNetSDK.Referenced.VoteErrorCodes.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.identifierKeyTypes.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.src_config.networksArray.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_helper.AsyncDisposableStack.html +2 -0
- package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_helper.crypto.html +1 -0
- package/lib/account.d.ts +68 -29
- package/lib/block/index.d.ts +53 -23
- package/lib/block/operations.d.ts +78 -33
- package/lib/error/block.d.ts +1 -1
- package/lib/error/certificate.d.ts +9 -0
- package/lib/error/client.d.ts +1 -1
- package/lib/error/index.d.ts +2 -1
- package/lib/error/kv.d.ts +1 -1
- package/lib/error/vote.d.ts +1 -1
- package/lib/kv/index.d.ts +15 -8
- package/lib/kv/kv_redis.d.ts +18 -8
- package/lib/ledger/common.d.ts +13 -5
- package/lib/ledger/db_dynamodb.d.ts +22 -16
- package/lib/ledger/db_postgres.d.ts +10 -10
- package/lib/ledger/db_spanner.d.ts +26 -14
- package/lib/ledger/db_spanner_helper.d.ts +94 -109
- package/lib/ledger/db_sqlite.d.ts +10 -10
- package/lib/ledger/effects.d.ts +19 -4
- package/lib/ledger/index.d.ts +57 -12
- package/lib/ledger/types.d.ts +7 -1
- package/lib/node/local.d.ts +10 -1
- package/lib/node/timing.d.ts +44 -5
- package/lib/p2p.d.ts +6 -3
- package/lib/permissions.d.ts +3 -3
- package/lib/pubsub/index.d.ts +1 -1
- package/lib/pubsub/providers.d.ts +2 -0
- package/lib/pubsub/ps_gcp.d.ts +14 -0
- package/lib/stats.d.ts +5 -0
- package/lib/utils/asn1.d.ts +4 -3
- package/lib/utils/buffer.d.ts +4 -0
- package/lib/utils/certificate.d.ts +107 -6
- package/lib/utils/conversion.d.ts +13 -35
- package/lib/utils/helper.d.ts +26 -8
- package/lib/utils/helper_testing.d.ts +1 -1
- package/lib/vote.d.ts +122 -63
- package/package.json +2 -3
- package/version.d.ts +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.HTTPAgentManager.html +0 -4
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_conversion.RegisterSerializable.html +0 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOutput.html +0 -5
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteJSONOutput.html +0 -4
- package/docs/interfaces/KeetaNetSDK.Referenced.WithConversionClass.html +0 -6
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_helper.InstanceSet.html +0 -10
- package/docs/types/KeetaNetSDK.Referenced.JSONSupportedObject.html +0 -1
- package/docs/types/KeetaNetSDK.Referenced.JSONSupportedValue.html +0 -1
- package/docs/types/KeetaNetSDK.Referenced.Vote.html +0 -1
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.JSONSupported.html +0 -1
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.ToJSONSerializableOptions.html +0 -3
- package/docs/variables/KeetaNetSDK.Referenced.default.html +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>crypto | @keetanetwork/keetanet-client</title><meta name="description" content="Documentation for @keetanetwork/keetanet-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title"><img src="../assets/logo-keeta-light.svg" alt="Keeta Logo" class="keeta-logo-light" width="50" height="20"/><img src="../assets/logo-keeta-dark.svg" alt="Keeta Logo" class="keeta-logo-dark" width="50" height="20"/>@keetanetwork/keetanet-client</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.9421 17.0578L14.0304 13.1469C15.1642 11.7857 15.7295 10.0398 15.6089 8.27245C15.4882 6.50506 14.6908 4.85223 13.3825 3.65779C12.0743 2.46335 10.3559 1.81926 8.58486 1.85951C6.81382 1.89976 5.12647 2.62125 3.87383 3.87389C2.62118 5.12653 1.89969 6.81388 1.85944 8.58493C1.8192 10.356 2.46328 12.0744 3.65772 13.3826C4.85217 14.6909 6.50499 15.4883 8.27238 15.6089C10.0398 15.7296 11.7856 15.1642 13.1468 14.0305L17.0577 17.9422C17.1158 18.0003 17.1848 18.0463 17.2606 18.0777C17.3365 18.1092 17.4178 18.1253 17.4999 18.1253C17.5821 18.1253 17.6634 18.1092 17.7392 18.0777C17.8151 18.0463 17.8841 18.0003 17.9421 17.9422C18.0002 17.8841 18.0463 17.8152 18.0777 17.7393C18.1091 17.6634 18.1253 17.5821 18.1253 17.5C18.1253 17.4179 18.1091 17.3366 18.0777 17.2607C18.0463 17.1848 18.0002 17.1159 17.9421 17.0578ZM3.12493 8.75C3.12493 7.63748 3.45483 6.54994 4.07292 5.62492C4.691 4.69989 5.56951 3.97892 6.59734 3.55318C7.62517 3.12743 8.75617 3.01604 9.84732 3.23308C10.9385 3.45012 11.9407 3.98585 12.7274 4.77252C13.5141 5.55919 14.0498 6.56147 14.2669 7.65262C14.4839 8.74376 14.3725 9.87476 13.9468 10.9026C13.521 11.9304 12.8 12.8089 11.875 13.427C10.95 14.0451 9.86245 14.375 8.74993 14.375C7.2586 14.3733 5.82882 13.7802 4.77429 12.7256C3.71975 11.6711 3.12659 10.2413 3.12493 8.75Z" fill="var(--color-icon-text)"></path></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><rect x="1" y="3" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-icon-text)"></rect></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/KeetaNetSDK.html">KeetaNetSDK</a></li><li><a href="../modules/KeetaNetSDK.Referenced.html">Referenced</a></li><li><a href="../modules/KeetaNetSDK.Referenced.src_lib_utils_helper.html">src/lib/utils/helper</a></li><li><a href="" aria-current="page">crypto</a></li></ul><h1>Variable crypto<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">crypto</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">createCipheriv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherCCMTypes</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherCCMOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherCCM</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherOCBTypes</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherOCBOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherOCB</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherGCMTypes</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">CipherGCMOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherGCM</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">TransformOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Cipher</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">createDecipheriv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherCCMTypes</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherCCMOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">DecipherCCM</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherOCBTypes</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherOCBOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">DecipherOCB</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherGCMTypes</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">CipherGCMOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">DecipherGCM</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">TransformOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Decipher</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">randomBytes</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">size</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">size</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">callback</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">buf</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">randomUUID</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">|</span> (<br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">RandomUUIDOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-symbol">`</span><span class="tsd-signature-symbol">${</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-type">-</span><span class="tsd-signature-symbol">${</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-type">-</span><span class="tsd-signature-symbol">${</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-type">-</span><span class="tsd-signature-symbol">${</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-type">-</span><span class="tsd-signature-symbol">${</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">`</span><br/> )<br/> <span class="tsd-signature-symbol">|</span> (<span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">string</span>)<span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = ...</span></div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5 id="createcipheriv"><span class="tsd-kind-property">createCipheriv</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherCCMTypes</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherCCMOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherCCM</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherOCBTypes</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherOCBOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherOCB</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherGCMTypes</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">CipherGCMOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherGCM</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">TransformOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Cipher</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></h5></li><li class="tsd-parameter"><h5 id="createdecipheriv"><span class="tsd-kind-property">createDecipheriv</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherCCMTypes</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherCCMOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">DecipherCCM</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherOCBTypes</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherOCBOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">DecipherOCB</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherGCMTypes</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">CipherGCMOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">DecipherGCM</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">algorithm</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CipherKey</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">iv</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">BinaryLike</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">TransformOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Decipher</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></h5></li><li class="tsd-parameter"><h5 id="randombytes"><span class="tsd-kind-property">randomBytes</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">size</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">size</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">callback</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">buf</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></h5></li><li class="tsd-parameter"><h5 id="randomuuid"><span class="tsd-kind-property">randomUUID</span><span class="tsd-signature-symbol">: </span><br/> <span class="tsd-signature-symbol">|</span> (<br/> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">RandomUUIDOptions</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-symbol">`</span><span class="tsd-signature-symbol">${</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-type">-</span><span class="tsd-signature-symbol">${</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-type">-</span><span class="tsd-signature-symbol">${</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-type">-</span><span class="tsd-signature-symbol">${</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-type">-</span><span class="tsd-signature-symbol">${</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">`</span><br/> )<br/> <span class="tsd-signature-symbol">|</span> (<span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">string</span>)</h5></li></ul></div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-icon-text)"></path></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@keetanetwork/keetanet-client</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">KeetaSDK Documentation</p></footer><div class="overlay"></div></body></html>
|
package/lib/account.d.ts
CHANGED
|
@@ -16,7 +16,8 @@ export declare enum AccountKeyAlgorithm {
|
|
|
16
16
|
NETWORK = 2,
|
|
17
17
|
TOKEN = 3,
|
|
18
18
|
STORAGE = 4,
|
|
19
|
-
ECDSA_SECP256R1 = 6
|
|
19
|
+
ECDSA_SECP256R1 = 6,// NIST P-256
|
|
20
|
+
MULTISIG = 7
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Type for ASN.1 encoded public keys -- this is equivalent to {@link ValidateASN1.SchemaMap<typeof publicKeyASN1Schema>}
|
|
@@ -32,7 +33,55 @@ type publicKeyASN1 = [
|
|
|
32
33
|
value: Buffer;
|
|
33
34
|
}
|
|
34
35
|
];
|
|
35
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Key pair types which we can process
|
|
38
|
+
*/
|
|
39
|
+
type KeyPairTypes = ECDSAKeyPair | ECDSASECP256K1KeyPair | ECDSASECP256R1KeyPair | ED25519KeyPair | IdentifierKeyPair | ExternalKeyPair;
|
|
40
|
+
/**
|
|
41
|
+
* Generic interface to an account. An account may be backed by a private key
|
|
42
|
+
* (in which case it can sign data), a seed+index (which is used to generate
|
|
43
|
+
* a private key), or a public key (which can only verify blocks).
|
|
44
|
+
*/
|
|
45
|
+
type PublicKeyStringPrefixed<X extends string> = `${AccountPrefix}${X}${string}`;
|
|
46
|
+
export type Secp256K1PublicKeyString = PublicKeyStringPrefixed<'aa' | 'ab' | 'ac' | 'ad'>;
|
|
47
|
+
export type Secp256R1PublicKeyString = PublicKeyStringPrefixed<'ay' | 'az' | 'a2' | 'a3'>;
|
|
48
|
+
export type ED25519PublicKeyString = PublicKeyStringPrefixed<'ae' | 'af' | 'ag' | 'ah'>;
|
|
49
|
+
export type NetworkPublicKeyString = PublicKeyStringPrefixed<'ai' | 'aj' | 'ak' | 'al'>;
|
|
50
|
+
export type TokenPublicKeyString = PublicKeyStringPrefixed<'am' | 'an' | 'ao' | 'ap'>;
|
|
51
|
+
export type StoragePublicKeyString = PublicKeyStringPrefixed<'aq' | 'ar' | 'as' | 'at'>;
|
|
52
|
+
export type MultisigPublicKeyString = PublicKeyStringPrefixed<'a4' | 'a5' | 'a6' | 'a7'>;
|
|
53
|
+
export interface PublicKeyStringMapping {
|
|
54
|
+
[AccountKeyAlgorithm.ECDSA_SECP256K1]: Secp256K1PublicKeyString;
|
|
55
|
+
[AccountKeyAlgorithm.ECDSA_SECP256R1]: Secp256R1PublicKeyString;
|
|
56
|
+
[AccountKeyAlgorithm.ED25519]: ED25519PublicKeyString;
|
|
57
|
+
[AccountKeyAlgorithm.TOKEN]: TokenPublicKeyString;
|
|
58
|
+
[AccountKeyAlgorithm.NETWORK]: NetworkPublicKeyString;
|
|
59
|
+
[AccountKeyAlgorithm.STORAGE]: StoragePublicKeyString;
|
|
60
|
+
[AccountKeyAlgorithm.MULTISIG]: MultisigPublicKeyString;
|
|
61
|
+
}
|
|
62
|
+
export type IdentifierPublicKeyString = PublicKeyStringMapping[IdentifierKeyAlgorithm];
|
|
63
|
+
export type AccountPublicKeyString = Secp256K1PublicKeyString | Secp256R1PublicKeyString | ED25519PublicKeyString;
|
|
64
|
+
type AccountKeyAlgorithmHex = {
|
|
65
|
+
[AccountKeyAlgorithm.ECDSA_SECP256K1]: '0x00';
|
|
66
|
+
[AccountKeyAlgorithm.ED25519]: '0x01';
|
|
67
|
+
[AccountKeyAlgorithm.TOKEN]: '0x02';
|
|
68
|
+
[AccountKeyAlgorithm.NETWORK]: '0x03';
|
|
69
|
+
[AccountKeyAlgorithm.STORAGE]: '0x04';
|
|
70
|
+
[AccountKeyAlgorithm.ECDSA_SECP256R1]: '0x06';
|
|
71
|
+
[AccountKeyAlgorithm.MULTISIG]: '0x07';
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* A hex-encoded public key and type, where the type is the first byte
|
|
75
|
+
* and the public key is the rest of the string.
|
|
76
|
+
*/
|
|
77
|
+
export type PublicKeyAndTypeStringHex<Algo extends typeof AccountKeyAlgorithm[keyof typeof AccountKeyAlgorithm] = AccountKeyAlgorithm> = `${AccountKeyAlgorithmHex[Algo]}${string}`;
|
|
78
|
+
type AccountKeyAlgorithmHexReverse = {
|
|
79
|
+
[Hex in AccountKeyAlgorithmHex[keyof AccountKeyAlgorithmHex]]: Extract<keyof AccountKeyAlgorithmHex, {
|
|
80
|
+
[K in keyof AccountKeyAlgorithmHex]: AccountKeyAlgorithmHex[K] extends Hex ? K : never;
|
|
81
|
+
}[keyof AccountKeyAlgorithmHex]>;
|
|
82
|
+
};
|
|
83
|
+
type AccountKeyAlgorithmHexToType<T extends PublicKeyAndTypeStringHex> = T extends `0x${infer AlgorithmHex1}${infer AlgorithmHex2}${string}` ? `0x${AlgorithmHex1}${AlgorithmHex2}` extends keyof AccountKeyAlgorithmHexReverse ? AccountKeyAlgorithmHexReverse[`0x${AlgorithmHex1}${AlgorithmHex2}`] : never : never;
|
|
84
|
+
declare const identifierKeyTypes: readonly [AccountKeyAlgorithm.NETWORK, AccountKeyAlgorithm.TOKEN, AccountKeyAlgorithm.STORAGE, AccountKeyAlgorithm.MULTISIG];
|
|
36
85
|
export type IdentifierKeyAlgorithm = typeof identifierKeyTypes[any];
|
|
37
86
|
/**
|
|
38
87
|
* Things we can use to construct a key from
|
|
@@ -324,31 +373,11 @@ declare class IdentifierKeyPair extends KeyInterface {
|
|
|
324
373
|
decrypt(..._ignored_parameters: Parameters<decryptFunctionType>): ReturnType<decryptFunctionType>;
|
|
325
374
|
}
|
|
326
375
|
/**
|
|
327
|
-
*
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
* Generic interface to an account. An account may be backed by a private key
|
|
332
|
-
* (in which case it can sign data), a seed+index (which is used to generate
|
|
333
|
-
* a private key), or a public key (which can only verify blocks).
|
|
376
|
+
* Account class, which is used to represent a key pair or an identifier
|
|
377
|
+
* account (which have no private key) such as tokens.
|
|
378
|
+
*
|
|
379
|
+
* @template T - The type of the key algorithm used for this account.
|
|
334
380
|
*/
|
|
335
|
-
type PublicKeyStringPrefixed<X extends string> = `${AccountPrefix}${X}${string}`;
|
|
336
|
-
export type Secp256K1PublicKeyString = PublicKeyStringPrefixed<'aa' | 'ab' | 'ac' | 'ad'>;
|
|
337
|
-
export type Secp256R1PublicKeyString = PublicKeyStringPrefixed<'ay' | 'az' | 'a2' | 'a3'>;
|
|
338
|
-
export type ED25519PublicKeyString = PublicKeyStringPrefixed<'ae' | 'af' | 'ag' | 'ah'>;
|
|
339
|
-
export type NetworkPublicKeyString = PublicKeyStringPrefixed<'ai' | 'aj' | 'ak' | 'al'>;
|
|
340
|
-
export type TokenPublicKeyString = PublicKeyStringPrefixed<'am' | 'an' | 'ao' | 'ap'>;
|
|
341
|
-
export type StoragePublicKeyString = PublicKeyStringPrefixed<'aq' | 'ar' | 'as' | 'at'>;
|
|
342
|
-
export interface PublicKeyStringMapping {
|
|
343
|
-
[AccountKeyAlgorithm.ECDSA_SECP256K1]: Secp256K1PublicKeyString;
|
|
344
|
-
[AccountKeyAlgorithm.ECDSA_SECP256R1]: Secp256R1PublicKeyString;
|
|
345
|
-
[AccountKeyAlgorithm.ED25519]: ED25519PublicKeyString;
|
|
346
|
-
[AccountKeyAlgorithm.TOKEN]: TokenPublicKeyString;
|
|
347
|
-
[AccountKeyAlgorithm.NETWORK]: NetworkPublicKeyString;
|
|
348
|
-
[AccountKeyAlgorithm.STORAGE]: StoragePublicKeyString;
|
|
349
|
-
}
|
|
350
|
-
export type IdentifierPublicKeyString = PublicKeyStringMapping[IdentifierKeyAlgorithm];
|
|
351
|
-
export type AccountPublicKeyString = Secp256K1PublicKeyString | Secp256R1PublicKeyString | ED25519PublicKeyString;
|
|
352
381
|
export declare class Account<T extends AccountKeyAlgorithm = Exclude<AccountKeyAlgorithm, IdentifierKeyAlgorithm>> {
|
|
353
382
|
#private;
|
|
354
383
|
static AccountKeyAlgorithm: typeof AccountKeyAlgorithm;
|
|
@@ -360,6 +389,7 @@ export declare class Account<T extends AccountKeyAlgorithm = Exclude<AccountKeyA
|
|
|
360
389
|
static fromPublicKeyString(key: TokenPublicKeyString): Account<AccountKeyAlgorithm.TOKEN>;
|
|
361
390
|
static fromPublicKeyString(key: NetworkPublicKeyString): Account<AccountKeyAlgorithm.NETWORK>;
|
|
362
391
|
static fromPublicKeyString(key: StoragePublicKeyString): Account<AccountKeyAlgorithm.STORAGE>;
|
|
392
|
+
static fromPublicKeyString(key: MultisigPublicKeyString): Account<AccountKeyAlgorithm.MULTISIG>;
|
|
363
393
|
static fromPublicKeyString(key: Secp256K1PublicKeyString): Account<AccountKeyAlgorithm.ECDSA_SECP256K1>;
|
|
364
394
|
static fromPublicKeyString(key: Secp256R1PublicKeyString): Account<AccountKeyAlgorithm.ECDSA_SECP256R1>;
|
|
365
395
|
static fromPublicKeyString(key: ED25519PublicKeyString): Account<AccountKeyAlgorithm.ED25519>;
|
|
@@ -402,6 +432,10 @@ export declare class Account<T extends AccountKeyAlgorithm = Exclude<AccountKeyA
|
|
|
402
432
|
* Construct an account from a storage identifier public key
|
|
403
433
|
*/
|
|
404
434
|
static fromStoragePublicKey(key: InputKeyTypes): Account<AccountKeyAlgorithm.STORAGE>;
|
|
435
|
+
/**
|
|
436
|
+
* Construct an account from a multisig identifier public key
|
|
437
|
+
*/
|
|
438
|
+
static fromMultisigPublicKey(key: InputKeyTypes): Account<AccountKeyAlgorithm.MULTISIG>;
|
|
405
439
|
/**
|
|
406
440
|
* Construct an account from an ED25519 public key.
|
|
407
441
|
*/
|
|
@@ -410,6 +444,8 @@ export declare class Account<T extends AccountKeyAlgorithm = Exclude<AccountKeyA
|
|
|
410
444
|
* Construct an Account from an KeyType and Public Key buffer
|
|
411
445
|
*/
|
|
412
446
|
static fromPublicKeyAndType(keyData: Buffer): GenericAccount;
|
|
447
|
+
static fromPublicKeyAndType<T extends AccountKeyAlgorithm>(keyData: PublicKeyAndTypeStringHex<T>): Account<T>;
|
|
448
|
+
static fromPublicKeyAndType(keyData: string): GenericAccount;
|
|
413
449
|
/**
|
|
414
450
|
* Construct a new account from a public key encoded in DER-encoded ASN.1
|
|
415
451
|
*/
|
|
@@ -453,6 +489,7 @@ export declare class Account<T extends AccountKeyAlgorithm = Exclude<AccountKeyA
|
|
|
453
489
|
static toAccount(): undefined;
|
|
454
490
|
static toAccount(acct: null): null;
|
|
455
491
|
static toAccount(acct: undefined): undefined;
|
|
492
|
+
static toAccount<X extends PublicKeyAndTypeStringHex>(acct: X): Account<AccountKeyAlgorithmHexToType<X>>;
|
|
456
493
|
static toAccount<toAlgo extends AccountKeyAlgorithm>(acct: string | Account<toAlgo>): Account<toAlgo>;
|
|
457
494
|
static toAccount<toAlgo extends AccountKeyAlgorithm>(acct: string | Account<toAlgo> | null): Account<toAlgo> | null;
|
|
458
495
|
static toAccount<toAlgo extends AccountKeyAlgorithm>(acct: string | Account<toAlgo> | undefined): Account<toAlgo> | undefined;
|
|
@@ -468,7 +505,7 @@ export declare class Account<T extends AccountKeyAlgorithm = Exclude<AccountKeyA
|
|
|
468
505
|
static toPublicKeyString(acct: string | Account<AccountKeyAlgorithm> | undefined | null): string | undefined | null;
|
|
469
506
|
static comparePublicKeys(acct1: Account<AccountKeyAlgorithm> | string | undefined | null, acct2: Account<AccountKeyAlgorithm> | string | undefined | null): boolean;
|
|
470
507
|
static isInstance: (obj: any, strict?: boolean) => obj is Account<AccountKeyAlgorithm>;
|
|
471
|
-
static Set: import("./utils/helper").InstanceSetConstructor<Account<AccountKeyAlgorithm>, string
|
|
508
|
+
static Set: import("./utils/helper").InstanceSetConstructor<Account<AccountKeyAlgorithm>, `0x00${string}` | `0x01${string}` | `0x03${string}` | `0x02${string}` | `0x04${string}` | `0x06${string}` | `0x07${string}`>;
|
|
472
509
|
constructor(key: KeyPairTypes | ECDSASECP256K1PrivateKey | ECDSASECP256R1PrivateKey | ED25519PrivateKey | ECDSASECP256K1PublicKey | ECDSASECP256R1PublicKey | ED25519PublicKey | IdentifierKeyPair | IdentifierKey | PublicKeyString | Account<T>, requiredKeyType?: T);
|
|
473
510
|
/**
|
|
474
511
|
* Sign some data and generate a detached signature in SEC format
|
|
@@ -507,6 +544,7 @@ export declare class Account<T extends AccountKeyAlgorithm = Exclude<AccountKeyA
|
|
|
507
544
|
*/
|
|
508
545
|
get publicKey(): ECDSASECP256K1PublicKey | ECDSASECP256R1PublicKey | ED25519PublicKey;
|
|
509
546
|
get publicKeyAndType(): Buffer;
|
|
547
|
+
get publicKeyAndTypeString(): PublicKeyAndTypeStringHex<T>;
|
|
510
548
|
/**
|
|
511
549
|
* Determine if this account has a private key associated with it
|
|
512
550
|
*/
|
|
@@ -529,15 +567,16 @@ export declare class Account<T extends AccountKeyAlgorithm = Exclude<AccountKeyA
|
|
|
529
567
|
isStorage(): this is Account<AccountKeyAlgorithm.STORAGE>;
|
|
530
568
|
isNetwork(): this is Account<AccountKeyAlgorithm.NETWORK>;
|
|
531
569
|
isToken(): this is Account<AccountKeyAlgorithm.TOKEN>;
|
|
570
|
+
isMultisig(): this is Account<AccountKeyAlgorithm.MULTISIG>;
|
|
532
571
|
assertKeyType<KeyType extends AccountKeyAlgorithm>(keyType: KeyType): Account<KeyType>;
|
|
533
572
|
assertAccount(): Account;
|
|
534
573
|
assertIdentifier(): IdentifierAddress;
|
|
535
|
-
|
|
536
|
-
static toJSONSerializable(value: GenericAccount): Secp256K1PublicKeyString | ED25519PublicKeyString | NetworkPublicKeyString | TokenPublicKeyString | StoragePublicKeyString | Secp256R1PublicKeyString;
|
|
574
|
+
toJSON(): PublicKeyStringMapping[T];
|
|
537
575
|
}
|
|
538
576
|
export type TokenAddress = Account<AccountKeyAlgorithm.TOKEN>;
|
|
539
577
|
export type StorageAddress = Account<AccountKeyAlgorithm.STORAGE>;
|
|
540
578
|
export type NetworkAddress = Account<AccountKeyAlgorithm.NETWORK>;
|
|
579
|
+
export type MultisigAddress = Account<AccountKeyAlgorithm.MULTISIG>;
|
|
541
580
|
export type IdentifierAddress = Account<IdentifierKeyAlgorithm>;
|
|
542
581
|
export type NonIdentifierAccount = Account<Exclude<AccountKeyAlgorithm, IdentifierKeyAlgorithm>>;
|
|
543
582
|
export type GenericAccount = Account<AccountKeyAlgorithm>;
|
package/lib/block/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { GenericAccount } from '../account';
|
|
|
2
2
|
import Account from '../account';
|
|
3
3
|
import { BufferStorage } from '../utils/buffer';
|
|
4
4
|
import * as ASN1 from '../utils/asn1';
|
|
5
|
-
import type {
|
|
5
|
+
import type { ToJSONSerializable, ToJSONSerializableOptions } from '../utils/conversion';
|
|
6
6
|
import * as Operations from './operations';
|
|
7
7
|
export declare enum AdjustMethod {
|
|
8
8
|
ADD = 0,
|
|
@@ -10,18 +10,21 @@ export declare enum AdjustMethod {
|
|
|
10
10
|
SET = 2
|
|
11
11
|
}
|
|
12
12
|
export declare function assertAdjustMethod(value: any, bigintOkay?: boolean): AdjustMethod;
|
|
13
|
+
type BlockHashString = string & {
|
|
14
|
+
readonly __blockhash: never;
|
|
15
|
+
};
|
|
13
16
|
/**
|
|
14
17
|
* Block hash
|
|
15
18
|
*/
|
|
16
19
|
export declare class BlockHash extends BufferStorage {
|
|
17
20
|
static isInstance: (obj: any, strict?: boolean) => obj is BlockHash;
|
|
18
|
-
static Set: import("../utils/helper").InstanceSetConstructor<BlockHash,
|
|
21
|
+
static Set: import("../utils/helper").InstanceSetConstructor<BlockHash, BlockHashString>;
|
|
19
22
|
static getAccountOpeningHash(account: GenericAccount): BlockHash;
|
|
20
23
|
fromData(data: Buffer): BlockHash;
|
|
21
24
|
get hashFunctionName(): string;
|
|
22
25
|
constructor(blockhash: ConstructorParameters<typeof BufferStorage>[0]);
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
toJSON(): BlockHashString;
|
|
27
|
+
toString(): BlockHashString;
|
|
25
28
|
}
|
|
26
29
|
/**
|
|
27
30
|
* Network ID
|
|
@@ -39,7 +42,7 @@ type BlockSignature = Buffer;
|
|
|
39
42
|
* Representation of the block
|
|
40
43
|
*/
|
|
41
44
|
export interface BlockJSON {
|
|
42
|
-
version:
|
|
45
|
+
version: 1;
|
|
43
46
|
date: string | Date;
|
|
44
47
|
previous: string | BlockHash;
|
|
45
48
|
network: string | NetworkID;
|
|
@@ -53,17 +56,13 @@ export type BlockJSONIncomplete = Partial<BlockJSON>;
|
|
|
53
56
|
/**
|
|
54
57
|
* Output of block suitable to JSON serialization
|
|
55
58
|
*/
|
|
56
|
-
export
|
|
57
|
-
operations: JSONSupported<Operations.BlockJSONOperations>[];
|
|
58
|
-
$hash: string;
|
|
59
|
-
$opening: boolean;
|
|
60
|
-
}
|
|
59
|
+
export type BlockJSONOutput = ToJSONSerializable<ReturnType<Block['toJSON']>>;
|
|
61
60
|
export type BlockJSONOutputIncomplete = Partial<BlockJSONOutput>;
|
|
62
61
|
/**
|
|
63
62
|
* Map input to our values
|
|
64
63
|
*/
|
|
65
64
|
interface BlockUnsignedCanonical {
|
|
66
|
-
version:
|
|
65
|
+
version: 1;
|
|
67
66
|
date: Date;
|
|
68
67
|
previous: BlockHash;
|
|
69
68
|
account: GenericAccount;
|
|
@@ -95,11 +94,12 @@ export declare class Block implements BlockCanonical {
|
|
|
95
94
|
TOKEN_ADMIN_SUPPLY: typeof Operations.BlockOperationTOKEN_ADMIN_SUPPLY;
|
|
96
95
|
TOKEN_ADMIN_MODIFY_BALANCE: typeof Operations.BlockOperationTOKEN_ADMIN_MODIFY_BALANCE;
|
|
97
96
|
RECEIVE: typeof Operations.BlockOperationRECEIVE;
|
|
97
|
+
MANAGE_CERTIFICATE: typeof Operations.BlockOperationMANAGE_CERTIFICATE;
|
|
98
98
|
};
|
|
99
99
|
static NO_PREVIOUS: string;
|
|
100
100
|
static AdjustMethod: typeof AdjustMethod;
|
|
101
101
|
static Builder: typeof BlockBuilder;
|
|
102
|
-
readonly version:
|
|
102
|
+
readonly version: 1;
|
|
103
103
|
readonly date: Date;
|
|
104
104
|
readonly previous: BlockHash;
|
|
105
105
|
readonly account: GenericAccount;
|
|
@@ -116,7 +116,20 @@ export declare class Block implements BlockCanonical {
|
|
|
116
116
|
static getAccountOpeningHash(account: GenericAccount): BlockHash;
|
|
117
117
|
toBytes(includeSignature?: boolean): ArrayBuffer;
|
|
118
118
|
protected static getASN1ContainerWithoutSignature(input: BlockUnsignedCanonical | BlockCanonical): BlockASN1WithoutSignature;
|
|
119
|
-
toJSON():
|
|
119
|
+
toJSON(options?: ToJSONSerializableOptions): {
|
|
120
|
+
$binary?: string;
|
|
121
|
+
version: 1;
|
|
122
|
+
date: Date;
|
|
123
|
+
previous: BlockHash;
|
|
124
|
+
account: GenericAccount;
|
|
125
|
+
signer: Account<import("../account").AccountKeyAlgorithm.ECDSA_SECP256K1 | import("../account").AccountKeyAlgorithm.ED25519 | import("../account").AccountKeyAlgorithm.ECDSA_SECP256R1>;
|
|
126
|
+
signature: string;
|
|
127
|
+
network: bigint;
|
|
128
|
+
subnet: bigint | undefined;
|
|
129
|
+
operations: Operations.ExportedJSONOperation[];
|
|
130
|
+
$hash: BlockHash;
|
|
131
|
+
$opening: boolean;
|
|
132
|
+
};
|
|
120
133
|
/**
|
|
121
134
|
* Hash of the block minus the signature
|
|
122
135
|
*
|
|
@@ -126,13 +139,6 @@ export declare class Block implements BlockCanonical {
|
|
|
126
139
|
* signature (which isn't signed)
|
|
127
140
|
*/
|
|
128
141
|
get hash(): BlockHash;
|
|
129
|
-
static toJSONSerializablePrefix: string;
|
|
130
|
-
static toJSONSerializable(value: Block, opts: ToJSONSerializableOptions): {
|
|
131
|
-
[x: string]: any;
|
|
132
|
-
operations: JSONSupported<Operations.BlockJSONOperations>[];
|
|
133
|
-
$hash: string;
|
|
134
|
-
$opening: boolean;
|
|
135
|
-
};
|
|
136
142
|
}
|
|
137
143
|
export declare class BlockBuilder implements BlockJSONIncomplete {
|
|
138
144
|
#private;
|
|
@@ -148,13 +154,37 @@ export declare class BlockBuilder implements BlockJSONIncomplete {
|
|
|
148
154
|
TOKEN_ADMIN_SUPPLY: typeof Operations.BlockOperationTOKEN_ADMIN_SUPPLY;
|
|
149
155
|
TOKEN_ADMIN_MODIFY_BALANCE: typeof Operations.BlockOperationTOKEN_ADMIN_MODIFY_BALANCE;
|
|
150
156
|
RECEIVE: typeof Operations.BlockOperationRECEIVE;
|
|
157
|
+
MANAGE_CERTIFICATE: typeof Operations.BlockOperationMANAGE_CERTIFICATE;
|
|
151
158
|
};
|
|
152
159
|
static NO_PREVIOUS: string;
|
|
153
160
|
constructor(block?: BlockJSONIncomplete | BlockJSON | Block | ArrayBuffer | string);
|
|
154
161
|
protected get currentBlock(): Block | BlockJSONIncomplete;
|
|
155
162
|
protected get currentWIP(): BlockJSONIncomplete;
|
|
156
163
|
protected get currentBlockSealed(): Block;
|
|
157
|
-
toJSON():
|
|
164
|
+
toJSON(opts?: ToJSONSerializableOptions): {
|
|
165
|
+
$binary?: string;
|
|
166
|
+
version: 1;
|
|
167
|
+
date: Date;
|
|
168
|
+
previous: BlockHash;
|
|
169
|
+
account: GenericAccount;
|
|
170
|
+
signer: Account<import("../account").AccountKeyAlgorithm.ECDSA_SECP256K1 | import("../account").AccountKeyAlgorithm.ED25519 | import("../account").AccountKeyAlgorithm.ECDSA_SECP256R1>;
|
|
171
|
+
signature: string;
|
|
172
|
+
network: bigint;
|
|
173
|
+
subnet: bigint | undefined;
|
|
174
|
+
operations: Operations.ExportedJSONOperation[];
|
|
175
|
+
$hash: BlockHash;
|
|
176
|
+
$opening: boolean;
|
|
177
|
+
} | {
|
|
178
|
+
version: 1 | undefined;
|
|
179
|
+
date: Date | undefined;
|
|
180
|
+
previous: BlockHash | undefined;
|
|
181
|
+
account: GenericAccount | undefined;
|
|
182
|
+
signer: Account<import("../account").AccountKeyAlgorithm.ECDSA_SECP256K1 | import("../account").AccountKeyAlgorithm.ED25519 | import("../account").AccountKeyAlgorithm.ECDSA_SECP256R1> | undefined;
|
|
183
|
+
network: bigint | undefined;
|
|
184
|
+
subnet: bigint | undefined;
|
|
185
|
+
operations: Operations.BlockOperations[] | undefined;
|
|
186
|
+
$opening: boolean | undefined;
|
|
187
|
+
};
|
|
158
188
|
seal(): Promise<Block>;
|
|
159
189
|
unseal(): BlockJSONIncomplete;
|
|
160
190
|
get sealed(): boolean;
|
|
@@ -169,8 +199,8 @@ export declare class BlockBuilder implements BlockJSONIncomplete {
|
|
|
169
199
|
get $opening(): boolean | undefined;
|
|
170
200
|
set date(date: Date | string | undefined);
|
|
171
201
|
get date(): Date | undefined;
|
|
172
|
-
set version(version:
|
|
173
|
-
get version():
|
|
202
|
+
set version(version: 1 | undefined);
|
|
203
|
+
get version(): 1 | undefined;
|
|
174
204
|
set network(network: NetworkID | string | undefined);
|
|
175
205
|
get network(): NetworkID | undefined;
|
|
176
206
|
set subnet(subnet: SubnetID | string | undefined);
|