@keetanetwork/keetanet-client 0.10.4 → 0.12.0
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 +28 -1
- package/client/index-browser.d.ts +129 -7
- package/client/index-browser.js +25383 -37128
- package/client/index.d.ts +129 -7
- package/client/index.js +3828 -6498
- 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 +42 -13
- 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} +12 -9
- 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 +4 -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 +4 -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.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.default.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 +60 -18
- 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_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.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.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_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.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.ClientRepresentative.html +1 -1
- 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.TimingData.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.TimingSectionHandle.html +6 -0
- package/docs/types/KeetaNetSDK.Referenced.src_config.NetworkConfig.html +3 -3
- 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.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/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/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 +3 -3
- package/lib/utils/certificate.d.ts +75 -4
- package/lib/utils/conversion.d.ts +13 -35
- package/lib/utils/helper.d.ts +19 -8
- package/lib/utils/helper_testing.d.ts +1 -1
- package/lib/vote.d.ts +73 -55
- package/package.json +2 -3
- package/version.d.ts +1 -1
- 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.VoteJSONOutput.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
package/lib/ledger/types.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { GenericAccount, TokenAddress } from '../account';
|
|
2
2
|
import type { AdjustMethod } from '../block';
|
|
3
3
|
import type { Permissions } from '../permissions';
|
|
4
|
-
import type { TimeStats } from '../stats';
|
|
4
|
+
import type { DbStats, TimeStats } from '../stats';
|
|
5
|
+
import type { Certificate, CertificateBundle } from '../utils/certificate';
|
|
5
6
|
/**
|
|
6
7
|
* Account info entry
|
|
7
8
|
*/
|
|
@@ -97,5 +98,10 @@ export interface LedgerStatistics {
|
|
|
97
98
|
blockCount: number;
|
|
98
99
|
transactionCount: number;
|
|
99
100
|
representativeCount: number;
|
|
101
|
+
db: DbStats;
|
|
100
102
|
settlementTimes: TimeStats;
|
|
101
103
|
}
|
|
104
|
+
export interface CertificateWithIntermediates {
|
|
105
|
+
certificate: Certificate;
|
|
106
|
+
intermediates: CertificateBundle | null;
|
|
107
|
+
}
|
package/lib/node/local.d.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
import type { Response as ExpressResponse } from 'express';
|
|
1
2
|
import type { NodeConfig } from './';
|
|
2
3
|
import { Node } from './';
|
|
3
4
|
import type { BootstrapConfig } from '../bootstrap';
|
|
4
5
|
import { BootstrapClient } from '../bootstrap';
|
|
5
6
|
import type { ErrorCode } from '../error';
|
|
6
|
-
export type LocalNodeConfig = NodeConfig & {
|
|
7
|
+
export type LocalNodeConfig = Omit<NodeConfig, 'nodeOptions'> & {
|
|
7
8
|
bootstrap?: BootstrapConfig;
|
|
8
9
|
invokeSecret?: string;
|
|
10
|
+
nodeOptions?: {
|
|
11
|
+
listenIP?: string;
|
|
12
|
+
listenPort?: number;
|
|
13
|
+
timingSampleRate?: number;
|
|
14
|
+
noSyncAfterEachRoute?: boolean;
|
|
15
|
+
};
|
|
9
16
|
};
|
|
10
17
|
export type ApiErrorResponse = {
|
|
11
18
|
error: boolean;
|
|
@@ -19,7 +26,9 @@ type LocalNodeRunOptions = {
|
|
|
19
26
|
export declare class LocalNode extends Node {
|
|
20
27
|
#private;
|
|
21
28
|
static isInstance: (obj: any, strict?: boolean) => obj is LocalNode;
|
|
29
|
+
config: LocalNodeConfig;
|
|
22
30
|
constructor(config: LocalNodeConfig);
|
|
31
|
+
setCorsHeaders(response: ExpressResponse): void;
|
|
23
32
|
addRoutes(prefix?: string): void;
|
|
24
33
|
get _app(): import("express-serve-static-core").Express;
|
|
25
34
|
run(options?: LocalNodeRunOptions): Promise<void>;
|
package/lib/node/timing.d.ts
CHANGED
|
@@ -1,11 +1,50 @@
|
|
|
1
|
+
interface DisposableTimingHandle extends Disposable {
|
|
2
|
+
/**
|
|
3
|
+
* Unique identifier for the timing section
|
|
4
|
+
*/
|
|
5
|
+
id: symbol;
|
|
6
|
+
/**
|
|
7
|
+
* End the timing section
|
|
8
|
+
*/
|
|
9
|
+
end: () => void;
|
|
10
|
+
/**
|
|
11
|
+
* Dispose of the timing section, ending it
|
|
12
|
+
*/
|
|
13
|
+
[Symbol.dispose]: () => void;
|
|
14
|
+
}
|
|
1
15
|
export declare class RequestTiming {
|
|
2
16
|
#private;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
17
|
+
static defaultLogger: Console;
|
|
18
|
+
log: Console;
|
|
19
|
+
/**
|
|
20
|
+
* Start timing a section of code
|
|
21
|
+
* @param section Name of the section to time -- should be unique within the code base so that it can be identified later
|
|
22
|
+
* @returns A handle which can be used to end the timing section
|
|
23
|
+
*/
|
|
24
|
+
startTime(section: string): DisposableTimingHandle;
|
|
25
|
+
endTime(section: symbol | undefined | ReturnType<RequestTiming['startTime']>): void;
|
|
26
|
+
/** @deprecated Use `endTime(section: symbol)` instead */
|
|
27
|
+
endTime(section: string | undefined, deduplicate?: boolean): void;
|
|
28
|
+
/**
|
|
29
|
+
* Run a piece of code and time it, returning the result of the code
|
|
30
|
+
*
|
|
31
|
+
* This takes an optional "timing" parameter which is a timing object
|
|
32
|
+
* if one exists, to update -- if this parameter is undefined no timing
|
|
33
|
+
* will be done.
|
|
34
|
+
*
|
|
35
|
+
* @param section Name of the section to time -- should be unique within the code base so that it can be identified later
|
|
36
|
+
* @param timing Timing object to update, if available
|
|
37
|
+
* @param code The code to run
|
|
38
|
+
* @returns The result of the code
|
|
39
|
+
*/
|
|
40
|
+
static runTimer<T>(section: string, timing: RequestTiming | undefined, code: () => Promise<T>): Promise<T>;
|
|
41
|
+
runTimer<T>(section: string, code: () => Promise<T>): Promise<T>;
|
|
42
|
+
private getTiming;
|
|
7
43
|
getAllTiming(): {
|
|
8
|
-
[section: string]:
|
|
44
|
+
[section: string]: {
|
|
45
|
+
name: string;
|
|
46
|
+
duration: number;
|
|
47
|
+
};
|
|
9
48
|
};
|
|
10
49
|
counter(): number;
|
|
11
50
|
}
|
package/lib/p2p.d.ts
CHANGED
|
@@ -72,9 +72,12 @@ interface P2PPeerBase {
|
|
|
72
72
|
interface P2PPeerRepBase extends P2PPeerBase {
|
|
73
73
|
kind: NodeKind.REPRESENTATIVE;
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
75
|
+
* Endpoints to reach the representative
|
|
76
76
|
*/
|
|
77
|
-
|
|
77
|
+
endpoints: {
|
|
78
|
+
p2p: string;
|
|
79
|
+
api: string;
|
|
80
|
+
};
|
|
78
81
|
/**
|
|
79
82
|
* Public key of the representative (used as the ID)
|
|
80
83
|
*/
|
|
@@ -224,7 +227,7 @@ export declare class P2PWebSocket implements P2PConnection {
|
|
|
224
227
|
/**
|
|
225
228
|
* The interfaces from the Node that the P2P switch uses
|
|
226
229
|
*/
|
|
227
|
-
type NodeLike = Pick<Node, 'recvMessageFromPeer' | 'config' | 'stats' | 'log'>;
|
|
230
|
+
type NodeLike = Pick<Node, 'recvMessageFromPeer' | 'sendMessage' | 'config' | 'stats' | 'log'>;
|
|
228
231
|
/**
|
|
229
232
|
* Deserializer DB
|
|
230
233
|
*/
|
package/lib/permissions.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ declare enum BaseFlag {
|
|
|
17
17
|
TOKEN_ADMIN_SUPPLY = 6,/* 0x0040 */
|
|
18
18
|
TOKEN_ADMIN_MODIFY_BALANCE = 7,/* 0x0080 */
|
|
19
19
|
PERMISSION_DELEGATE_ADD = 11,/* 0x0800 */
|
|
20
|
-
PERMISSION_DELEGATE_REMOVE = 12
|
|
20
|
+
PERMISSION_DELEGATE_REMOVE = 12,/* 0x1000 */
|
|
21
|
+
MANAGE_CERTIFICATE = 13
|
|
21
22
|
}
|
|
22
23
|
type ExternalFlagName = `${typeof externalFlagPrefix}${string}`;
|
|
23
24
|
export type BaseFlagName = keyof typeof BaseFlag;
|
|
@@ -116,6 +117,5 @@ export declare class Permissions {
|
|
|
116
117
|
get canUseDelegation(): boolean;
|
|
117
118
|
get base(): BaseSet;
|
|
118
119
|
get external(): ExternalSet;
|
|
119
|
-
|
|
120
|
-
static toJSONSerializable(value: Permissions): bigint[];
|
|
120
|
+
toJSON(): [bigint, bigint];
|
|
121
121
|
}
|
package/lib/pubsub/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JSONSerializable } from '../utils/conversion';
|
|
2
2
|
export type SubscriptionCallback = (message: JSONSerializable) => void;
|
|
3
3
|
export interface PubSubProviderAPI {
|
|
4
|
-
subscribe: (channel: string, callback: SubscriptionCallback) => Promise<void>;
|
|
5
4
|
publish: (channel: string, message: JSONSerializable) => Promise<void>;
|
|
5
|
+
subscribe: (channel: string, callback: SubscriptionCallback) => Promise<void>;
|
|
6
6
|
destroy: () => Promise<void>;
|
|
7
7
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import PubSubProviderMemory from './ps_memory';
|
|
2
2
|
import PubSubProviderRedis from './ps_redis';
|
|
3
|
+
import PubSubProviderGCP from './ps_gcp';
|
|
3
4
|
export declare const PS: {
|
|
4
5
|
Memory: typeof PubSubProviderMemory;
|
|
5
6
|
Redis: typeof PubSubProviderRedis;
|
|
7
|
+
GCP: typeof PubSubProviderGCP;
|
|
6
8
|
};
|
|
7
9
|
export default PS;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { JSONSerializable } from '../utils/conversion';
|
|
2
|
+
import type { PubSubProviderAPI, SubscriptionCallback } from '.';
|
|
3
|
+
import { PubSub } from '@google-cloud/pubsub';
|
|
4
|
+
import type { Topic } from '@google-cloud/pubsub';
|
|
5
|
+
export declare class PubSubProviderGCP implements PubSubProviderAPI {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(projectId: string, apiEndpoint?: string);
|
|
8
|
+
get _testing_pubsub(): PubSub;
|
|
9
|
+
publish(channel: string, message: JSONSerializable): Promise<void>;
|
|
10
|
+
subscribe(channel: string, callback: SubscriptionCallback): Promise<void>;
|
|
11
|
+
destroy(): Promise<void>;
|
|
12
|
+
assertTopicExists(topic: Topic, channel: string): Promise<true | undefined>;
|
|
13
|
+
}
|
|
14
|
+
export default PubSubProviderGCP;
|
package/lib/stats.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { KVStorageProvider } from './kv';
|
|
2
2
|
import { BufferStorage } from './utils/buffer';
|
|
3
3
|
import type { BlockHash } from './block';
|
|
4
|
+
import type { RequestTiming } from './node/timing';
|
|
4
5
|
export interface StatsConfig {
|
|
5
6
|
kv: KVStorageProvider | null;
|
|
6
7
|
}
|
|
@@ -33,6 +34,9 @@ type TimeStat = {
|
|
|
33
34
|
export type TimeStats = {
|
|
34
35
|
[duration in DurationBreakdowns]: TimeStat;
|
|
35
36
|
};
|
|
37
|
+
export type DbStats = {
|
|
38
|
+
retries: number;
|
|
39
|
+
};
|
|
36
40
|
export declare class Stats {
|
|
37
41
|
#private;
|
|
38
42
|
constructor(config: StatsConfig);
|
|
@@ -44,6 +48,7 @@ export declare class Stats {
|
|
|
44
48
|
xor(key: string, change: BlockHash | BufferStorage): void;
|
|
45
49
|
getXor(key: string): Promise<BufferStorage>;
|
|
46
50
|
addTimingPoint(arena: string, category: string, duration: number, returnOnly?: boolean): Parameters<Stats['incr']>;
|
|
51
|
+
addRequestTiming(arena: string, timing: RequestTiming, returnOnly?: boolean): Parameters<Stats['incr']>[];
|
|
47
52
|
get(arena: string, key: string): Promise<number>;
|
|
48
53
|
getTimingData(arena: string, category: string): Promise<TimeStats>;
|
|
49
54
|
sync(): Promise<void>;
|
package/lib/utils/asn1.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export declare namespace ValidateASN1 {
|
|
|
63
63
|
sequenceOf: Schema;
|
|
64
64
|
} | {
|
|
65
65
|
optional: Schema;
|
|
66
|
-
} | {
|
|
66
|
+
} | bigint | {
|
|
67
67
|
type: 'context';
|
|
68
68
|
kind: 'implicit' | 'explicit';
|
|
69
69
|
contains: Schema;
|
|
@@ -110,7 +110,7 @@ export declare namespace ValidateASN1 {
|
|
|
110
110
|
sequenceOf: Schema;
|
|
111
111
|
} ? SchemaMap<T['sequenceOf']>[] : T extends {
|
|
112
112
|
optional: Schema;
|
|
113
|
-
} ? SchemaMap<T['optional']> | undefined : T extends {
|
|
113
|
+
} ? SchemaMap<T['optional']> | undefined : T extends bigint ? T : T extends {
|
|
114
114
|
type: 'context';
|
|
115
115
|
kind: infer U extends 'implicit' | 'explicit';
|
|
116
116
|
value: number;
|
|
@@ -182,7 +182,7 @@ type Mutable<T> = T extends Buffer | ArrayBuffer | Date ? T : T extends object ?
|
|
|
182
182
|
export declare class BufferStorageASN1<T extends ASN1AnyJS | Readonly<ASN1AnyJS> = Readonly<ASN1AnyJS>, S extends ValidateASN1.Schema | undefined = undefined> {
|
|
183
183
|
#private;
|
|
184
184
|
static readonly Validate: typeof ValidateASN1;
|
|
185
|
-
static readonly isInstance: (obj: any, strict?: boolean) => obj is BufferStorageASN1<string | number | bigint | boolean | Buffer | ASN1AnyJS[] |
|
|
185
|
+
static readonly isInstance: (obj: any, strict?: boolean) => obj is BufferStorageASN1<string | number | bigint | boolean | Date | Buffer | ASN1AnyJS[] | ASN1OID | ASN1Set | ASN1ExplicitContextTag | ASN1ImplicitContextTag | ASN1BitString | ASN1Date | ASN1String | readonly ASN1AnyJS[] | Readonly<Date> | Readonly<Buffer> | Readonly<ASN1OID> | Readonly<ASN1Set> | Readonly<ASN1ExplicitContextTag> | Readonly<ASN1ImplicitContextTag> | Readonly<ASN1BitString> | Readonly<ASN1Date> | Readonly<ASN1String> | null | undefined, ValidateASN1.Schema | undefined>;
|
|
186
186
|
constructor(input: T | ArrayBuffer, schema?: S);
|
|
187
187
|
getDER(): ArrayBuffer;
|
|
188
188
|
getDERBuffer(): Buffer;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as ASN1 from './asn1';
|
|
2
|
-
import Account from '../account';
|
|
2
|
+
import Account, { AccountKeyAlgorithm } from '../account';
|
|
3
3
|
import * as HashLib from './hash';
|
|
4
|
+
import { BufferStorage } from './buffer';
|
|
5
|
+
import type { ToJSONSerializableOptions, ToJSONSerializable } from './conversion';
|
|
4
6
|
/**
|
|
5
7
|
* De-normalized mapped Certificate Schema, for use in type annotations since
|
|
6
8
|
* we do not want to expose such a complex type
|
|
@@ -132,7 +134,7 @@ export declare class CertificateBuilder {
|
|
|
132
134
|
* Create a certificate
|
|
133
135
|
*/
|
|
134
136
|
buildDER(params?: Partial<CertificateBuilderParams>): Promise<ArrayBuffer>;
|
|
135
|
-
build(params?: Partial<CertificateBuilderParams>): Promise<Certificate>;
|
|
137
|
+
build(params?: Partial<CertificateBuilderParams>, options?: ConstructorParameters<typeof Certificate>[1]): Promise<Certificate>;
|
|
136
138
|
}
|
|
137
139
|
type CertificateOptions = {
|
|
138
140
|
/**
|
|
@@ -163,6 +165,22 @@ type CertificateOptions = {
|
|
|
163
165
|
*/
|
|
164
166
|
isTrustedRoot?: boolean;
|
|
165
167
|
};
|
|
168
|
+
type CertificateHashString = string & {
|
|
169
|
+
readonly __certificateHash: never;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Certificate hash
|
|
173
|
+
*/
|
|
174
|
+
export declare class CertificateHash extends BufferStorage {
|
|
175
|
+
static isInstance: (obj: any, strict?: boolean) => obj is CertificateHash;
|
|
176
|
+
static Set: import("./helper").InstanceSetConstructor<CertificateHash, CertificateHashString>;
|
|
177
|
+
get hashFunctionName(): string;
|
|
178
|
+
constructor(certificateHash: ConstructorParameters<typeof BufferStorage>[0]);
|
|
179
|
+
static fromData(data: Buffer): CertificateHash;
|
|
180
|
+
toJSON(): CertificateHashString;
|
|
181
|
+
toString(): CertificateHashString;
|
|
182
|
+
}
|
|
183
|
+
export type CertificateJSONOutput = ToJSONSerializable<ReturnType<Certificate['toJSON']>>;
|
|
166
184
|
export declare class Certificate {
|
|
167
185
|
#private;
|
|
168
186
|
/**
|
|
@@ -269,6 +287,11 @@ export declare class Certificate {
|
|
|
269
287
|
* Verifies that the certificate is was signed by the given account or certificate
|
|
270
288
|
*/
|
|
271
289
|
verify(account: Account | Certificate): boolean;
|
|
290
|
+
/**
|
|
291
|
+
* Asserts provided certificates can construct a valid graph with no loops or orphans, and that all provided certificates can reach the root, or current certificate
|
|
292
|
+
* @param certificates Additional intermediate certificates to verify
|
|
293
|
+
*/
|
|
294
|
+
assertCanConstructValidGraph(certificates: Set<Certificate>): true | undefined;
|
|
272
295
|
/**
|
|
273
296
|
* Verify against a given certificate store
|
|
274
297
|
*/
|
|
@@ -331,10 +354,58 @@ export declare class Certificate {
|
|
|
331
354
|
/**
|
|
332
355
|
* Compute a hash of the certificate
|
|
333
356
|
*/
|
|
334
|
-
hash():
|
|
357
|
+
hash(): CertificateHash;
|
|
335
358
|
/**
|
|
336
359
|
* Get a JSON representation of the certificate
|
|
337
360
|
*/
|
|
338
|
-
toJSON(includeChain?: boolean):
|
|
361
|
+
toJSON(options?: ToJSONSerializableOptions, includeChain?: boolean): {
|
|
362
|
+
$binary?: string;
|
|
363
|
+
$chain?: unknown;
|
|
364
|
+
serial: bigint;
|
|
365
|
+
notBefore: Date;
|
|
366
|
+
notAfter: Date;
|
|
367
|
+
subject: string;
|
|
368
|
+
issuer: string;
|
|
369
|
+
subjectPublicKey: Account<AccountKeyAlgorithm.ECDSA_SECP256K1 | AccountKeyAlgorithm.ED25519 | AccountKeyAlgorithm.ECDSA_SECP256R1>;
|
|
370
|
+
baseExtensions: {
|
|
371
|
+
/**
|
|
372
|
+
* Basic Constraints
|
|
373
|
+
*/
|
|
374
|
+
basicConstraints?: [ca: boolean, pathLenConstraint?: bigint];
|
|
375
|
+
/**
|
|
376
|
+
* Subject Key Identifier
|
|
377
|
+
*/
|
|
378
|
+
subjectKeyIdentifier?: Buffer;
|
|
379
|
+
/**
|
|
380
|
+
* Authority Key Identifier
|
|
381
|
+
*/
|
|
382
|
+
authorityKeyIdentifier?: {
|
|
383
|
+
type: "context";
|
|
384
|
+
value: 0;
|
|
385
|
+
contains: Buffer;
|
|
386
|
+
};
|
|
387
|
+
} | undefined;
|
|
388
|
+
subjectDN: {
|
|
389
|
+
name: string;
|
|
390
|
+
value: string;
|
|
391
|
+
}[];
|
|
392
|
+
issuerDN: {
|
|
393
|
+
name: string;
|
|
394
|
+
value: string;
|
|
395
|
+
}[];
|
|
396
|
+
$hash: CertificateHash;
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
export declare class CertificateBundle {
|
|
400
|
+
#private;
|
|
401
|
+
static isInstance: (obj: any, strict?: boolean) => obj is CertificateBundle;
|
|
402
|
+
constructor(input: CertificateBundle | Certificate[] | ArrayBuffer | Buffer | string | (ConstructorParameters<typeof Certificate>[0])[] | Set<Certificate>);
|
|
403
|
+
get bundleSize(): number;
|
|
404
|
+
getDER(): ArrayBuffer;
|
|
405
|
+
getDERBuffer(): Buffer;
|
|
406
|
+
getCertificates(): Certificate[];
|
|
407
|
+
toJSON(): {
|
|
408
|
+
certificates: string[];
|
|
409
|
+
};
|
|
339
410
|
}
|
|
340
411
|
export {};
|
|
@@ -1,46 +1,24 @@
|
|
|
1
|
-
import type { Vote, VoteStaple } from '../vote';
|
|
2
|
-
import type Account from '../account';
|
|
3
|
-
import type { Block, BlockHash } from '../block';
|
|
4
|
-
import type { Permissions } from '../permissions';
|
|
5
1
|
export type JSONSerializable = string | number | boolean | null | JSONSerializable[] | {
|
|
6
2
|
[key: string]: JSONSerializable;
|
|
7
3
|
};
|
|
8
4
|
export type JSONSerializableObject = {
|
|
9
5
|
[key: string]: JSONSerializable;
|
|
10
6
|
};
|
|
11
|
-
|
|
12
|
-
type JSONSupportedObject<T> = {
|
|
13
|
-
[Property in keyof T]: Exclude<T[Property], JSONUnsupportedTypes>;
|
|
14
|
-
};
|
|
15
|
-
type JSONSupportedValue<T> = JSONSupportedObject<T>[any];
|
|
16
|
-
export type JSONSupported<T> = JSONSupportedObject<T> | JSONSupportedValue<T>;
|
|
17
|
-
export type ToJSONSerializableOptions = {
|
|
7
|
+
export interface ToJSONSerializableOptions<AddBinary extends boolean = boolean> {
|
|
18
8
|
debugUnsafe?: boolean;
|
|
19
|
-
addBinary?:
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} ?
|
|
9
|
+
addBinary?: AddBinary;
|
|
10
|
+
}
|
|
11
|
+
type AddBinaryIfIncluded<I> = I extends {
|
|
12
|
+
'$binary'?: infer BinaryType;
|
|
13
|
+
} ? Omit<I, '$binary'> & {
|
|
14
|
+
'$binary': NonNullable<BinaryType>;
|
|
15
|
+
} : I;
|
|
16
|
+
export type ToJSONSerializable<T, Options extends ToJSONSerializableOptions = ToJSONSerializableOptions> = T extends JSONSerializable ? T : T extends undefined ? undefined : T extends bigint ? string : T extends Date ? string : T extends Buffer | ArrayBuffer ? string : T extends {
|
|
24
17
|
toJSON(): infer U;
|
|
25
|
-
} ?
|
|
26
|
-
|
|
27
|
-
} : T extends VoteStaple ? ReturnType<VoteStaple['toJSON']> & {
|
|
28
|
-
'$binary': string;
|
|
29
|
-
} : T extends Block ? ReturnType<Block['toJSON']> & {
|
|
30
|
-
'$binary': string;
|
|
31
|
-
} : T extends JSONSerializable ? T : T extends object ? {
|
|
32
|
-
[K in keyof T]: ToJSONSerializable<T[K]>;
|
|
18
|
+
} ? Options['addBinary'] extends true ? ToJSONSerializable<AddBinaryIfIncluded<U>, Options> : ToJSONSerializable<U, Options> : T extends object ? {
|
|
19
|
+
[K in keyof T]: ToJSONSerializable<T[K], Options>;
|
|
33
20
|
} : never;
|
|
34
|
-
export declare function toJSONSerializable(data:
|
|
35
|
-
|
|
36
|
-
interface WithConversionClass<T, Y> {
|
|
37
|
-
toJSONSerializablePrefix: string;
|
|
38
|
-
toJSONSerializable(value: T, options: ToJSONSerializableOptions): Y;
|
|
39
|
-
isInstance(value: any): value is T;
|
|
40
|
-
new (...args: any[]): T;
|
|
41
|
-
}
|
|
42
|
-
/** @deprecated -- move to toJSON methods */
|
|
43
|
-
export declare function RegisterSerializable(name: string): <X, Y>(target: WithConversionClass<X, Y>) => void;
|
|
44
|
-
export declare function objectToBuffer(data: JSONSupported<any>, opts?: ToJSONSerializableOptions): Buffer;
|
|
21
|
+
export declare function toJSONSerializable<Value, Options extends ToJSONSerializableOptions>(data: Value, opts?: Options): ToJSONSerializable<Value, Options>;
|
|
22
|
+
export declare function objectToBuffer(data: any, opts?: ToJSONSerializableOptions): Buffer;
|
|
45
23
|
export declare function parseHexBigIntString(input: string): bigint;
|
|
46
24
|
export {};
|
package/lib/utils/helper.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare function waitTicks(ticks: number): Promise<void>;
|
|
|
23
23
|
* Throws if neither are defined
|
|
24
24
|
*/
|
|
25
25
|
export declare function env(name: string, defaultValue?: string): string;
|
|
26
|
+
export declare function booleanEnv(name: string, defaultValue?: boolean): boolean;
|
|
26
27
|
/**
|
|
27
28
|
* Generate a random string from length provided (default 32)
|
|
28
29
|
*/
|
|
@@ -44,6 +45,7 @@ interface IsInstance<T> {
|
|
|
44
45
|
check(obj: any, strict?: boolean): obj is T;
|
|
45
46
|
}
|
|
46
47
|
export declare function checkableGenerator<P extends Constructor<T>, T = InstanceType<P>>(parent: P, defaultStrict?: boolean): IsInstance<T>['check'];
|
|
48
|
+
export declare function nonNullable<T>(value: T): NonNullable<T>;
|
|
47
49
|
export type DeepMutable<T> = {
|
|
48
50
|
-readonly [P in keyof T]: DeepMutable<T[P]>;
|
|
49
51
|
};
|
|
@@ -53,15 +55,24 @@ interface WithIsInstance<Inst> extends Constructor<Inst> {
|
|
|
53
55
|
type EncodeFunc<Inst, Enc> = (a: Inst) => Enc;
|
|
54
56
|
type DecodeFunc<Inst, Enc> = (a: Enc) => Inst;
|
|
55
57
|
type CanBeArray<T> = T | T[];
|
|
56
|
-
|
|
57
|
-
add(data: CanBeArray<Instance
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
interface InstanceSet<Instance, Encoded = string> extends Set<Instance> {
|
|
59
|
+
add(data: CanBeArray<Instance>): this;
|
|
60
|
+
forEach(callbackfn: (value: Instance, value2: Instance, set: InstanceSet<Instance, Encoded>) => void, thisArg?: any): void;
|
|
61
|
+
hasInternal(data: Encoded): boolean;
|
|
62
|
+
addInternal(data: Encoded): this;
|
|
63
|
+
deleteInternal(data: Encoded): boolean;
|
|
64
|
+
valuesInternal(): IterableIterator<Encoded>;
|
|
65
|
+
toArray(): Instance[];
|
|
66
|
+
toArrayInternal(): Encoded[];
|
|
67
|
+
isSubsetOf(data: InstanceSet<Instance, Encoded>): boolean;
|
|
68
|
+
isEqualTo(data: InstanceSet<Instance, Encoded>): boolean;
|
|
62
69
|
}
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
/**
|
|
71
|
+
* AsyncDisposableStack https://github.com/tc39/proposal-explicit-resource-management
|
|
72
|
+
*/
|
|
73
|
+
export declare const AsyncDisposableStack: AsyncDisposableStackConstructor;
|
|
74
|
+
export interface InstanceSetConstructor<Instance, Encoded = string> {
|
|
75
|
+
new (data?: (Instance)[]): InstanceSet<Instance, Encoded>;
|
|
65
76
|
}
|
|
66
77
|
export declare function setGenerator<P extends WithIsInstance<Instance>, E extends EncodeFunc<Instance, Encoded>, D extends DecodeFunc<Instance, Encoded>, Instance = InstanceType<P>, Encoded = ReturnType<E>>(parent: P, rawEncode: E, rawDecode: D): InstanceSetConstructor<Instance, Encoded>;
|
|
67
78
|
export {};
|
|
@@ -2,7 +2,7 @@ import Account from '../account';
|
|
|
2
2
|
import LocalNode from '../node/local';
|
|
3
3
|
import { VoteStaple } from '../vote';
|
|
4
4
|
import type { Block } from '../block';
|
|
5
|
-
export declare const testingNetworkId
|
|
5
|
+
export declare const testingNetworkId = 0n;
|
|
6
6
|
type NodeConfig = ConstructorParameters<typeof LocalNode>[0];
|
|
7
7
|
export declare function canListenOn(ip: string): Promise<boolean>;
|
|
8
8
|
export declare function findListenableIP(checkIPs: string[]): Promise<string | null>;
|