@keetanetwork/keetanet-client 0.12.0 → 0.14.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 -2
- package/api/node.d.ts +7 -1
- package/api/p2p.d.ts +13 -0
- package/api/vote.d.ts +10 -0
- package/benchmarking/test.d.ts +4 -0
- package/client/builder.d.ts +6 -4
- package/client/client_common_tests.d.ts +18 -0
- package/client/index-browser.d.ts +42 -14
- package/client/index-browser.js +2577 -881
- package/client/index.d.ts +42 -14
- package/client/index.js +2318 -663
- package/config/index.d.ts +2 -0
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/KeetaNetSDK.Client.html +14 -10
- package/docs/classes/KeetaNetSDK.Referenced.BaseSet.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BaseVoteBuilder.html +10 -0
- package/docs/classes/KeetaNetSDK.Referenced.Block.html +9 -5
- package/docs/classes/KeetaNetSDK.Referenced.BlockBuilder.html +3 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperation.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationCREATE_IDENTIFIER.html +4 -4
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMANAGE_CERTIFICATE.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMODIFY_PERMISSIONS.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationRECEIVE.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSEND.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_INFO.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_REP.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_MODIFY_BALANCE.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_SUPPLY.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.Certificate.html +26 -8
- package/docs/classes/KeetaNetSDK.Referenced.CertificateBundle.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.CertificateHash.html +1 -1
- 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 +1 -1
- 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 +5 -2
- package/docs/classes/KeetaNetSDK.Referenced.LedgerAtomicInterface.html +3 -1
- package/docs/classes/KeetaNetSDK.Referenced.P2PSwitch.html +6 -2
- package/docs/classes/KeetaNetSDK.Referenced.PermissionSetHolder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.PossiblyExpiredVote.html +31 -26
- package/docs/classes/KeetaNetSDK.Referenced.SignatureStorage.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.UserClientBuilder.html +4 -3
- package/docs/classes/KeetaNetSDK.Referenced.Vote.html +8 -3
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockBundle.html +3 -3
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockHash.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.VoteBuilder.html +10 -7
- package/docs/classes/KeetaNetSDK.Referenced.VoteHash.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.VoteLikeBase.html +32 -0
- package/docs/classes/KeetaNetSDK.Referenced.VoteQuote.html +34 -0
- package/docs/classes/KeetaNetSDK.Referenced.VoteQuoteBuilder.html +11 -0
- package/docs/classes/KeetaNetSDK.Referenced.VoteStaple.html +3 -3
- package/docs/classes/KeetaNetSDK.Referenced.VoteStapleHash.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.default.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_asn1.ValidateASN1.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_buffer.BufferStorage.html +1 -1
- package/docs/classes/KeetaNetSDK.UserClient.html +7 -2
- package/docs/enums/KeetaNetSDK.Referenced.BaseFlag.html +2 -1
- package/docs/enums/KeetaNetSDK.Referenced.BasePermissionGroup.html +3 -1
- package/docs/enums/KeetaNetSDK.Referenced.BlockPurpose.html +3 -0
- 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_helper.bufferToBigInt.html +1 -0
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/KeetaNetSDK.PublishOptions.html +5 -0
- 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.AccountInfo.html +4 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseExternalKeyPairFunctions.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseGenerationConfig.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseIdentifierCreateArguments.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperation.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationCREATE_IDENTIFIER.html +3 -3
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMANAGE_CERTIFICATE.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMANAGE_CERTIFICATESerializable.html +1 -1
- 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 +1 -1
- package/docs/interfaces/{KeetaNetSDK.Referenced.BlockCanonical.html → KeetaNetSDK.Referenced.BlockV1Canonical.html} +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockV1JSON.html +12 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockV1UnsignedCanonical.html +11 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockV2Canonical.html +11 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockV2JSON.html +12 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockV2UnsignedCanonical.html +11 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ComputedBlocksEffectFields.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.Constructor.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.CreateIdentifierRequest.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.DisposableTimingHandle.html +1 -1
- 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.InitialConfigSupply.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.InstanceSet.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.KVGenericOptionsType.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.KVSetOptionsType.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.LedgerConfig.html +5 -3
- package/docs/interfaces/KeetaNetSDK.Referenced.LedgerStorageAPI.html +3 -3
- package/docs/interfaces/KeetaNetSDK.Referenced.ModifyTokenBalanceEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.MultiSigIdentifierCreateArguments.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.MultisigConfig.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.NumericValueEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PConfig.html +4 -2
- 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 +4 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.PrincipalACLWithInfoParsed.html +1 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.PublicKeyStorage.html +1 -1
- 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 +5 -3
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientOptions.html +4 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteJSON.html +4 -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_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_helper.html +1 -1
- package/docs/modules/KeetaNetSDK.html +2 -2
- package/docs/types/KeetaNetSDK.Referenced.BlockASN1SchemaWithoutSignature.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockJSON.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockJSONIncomplete.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.BlockOperationASN1SchemaType.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockOperationTypes.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockSignature.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockSignatureField.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockSignerField.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockSignerFieldJSON.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockV1ASN1WithoutSignature.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockV2ASN1WithoutSignature.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateBuilderParams.html +8 -3
- package/docs/types/KeetaNetSDK.Referenced.CertificateExtensionData.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateExtensions.html +2 -2
- package/docs/types/KeetaNetSDK.Referenced.ComputedEffectOfBlocks.html +2 -2
- package/docs/types/KeetaNetSDK.Referenced.GetAccountStateAPIResponseFormatted.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.HashNames.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.MultisigAddress.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.MultisigSignerField.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.MultisigSignerFieldJSON.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.OmitLastArrayValue.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.P2PUpdateOptions.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.StorageAddress.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.UserEditableAccountInfo.html +1 -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/variables/KeetaNetSDK.Referenced.BlockErrorCodes.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.BlockOperationASN1Schema.html +2 -0
- package/docs/variables/KeetaNetSDK.Referenced.LedgerErrorCodes.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.VoteErrorCodes.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_helper.crypto.html +1 -0
- package/lib/block/index.d.ts +104 -36
- package/lib/block/operations.d.ts +31 -3
- package/lib/error/block.d.ts +1 -1
- package/lib/error/ledger.d.ts +1 -1
- package/lib/error/vote.d.ts +1 -1
- package/lib/ledger/common.d.ts +14 -1
- package/lib/ledger/db_dynamodb.d.ts +2 -2
- package/lib/ledger/db_postgres.d.ts +1 -1
- package/lib/ledger/db_spanner.d.ts +1 -1
- package/lib/ledger/db_spanner_helper.d.ts +28 -5
- package/lib/ledger/db_sqlite.d.ts +1 -1
- package/lib/ledger/effects.d.ts +10 -9
- package/lib/ledger/index.d.ts +17 -8
- package/lib/ledger/types.d.ts +10 -1
- package/lib/node/utils.d.ts +5 -0
- package/lib/p2p.d.ts +32 -0
- package/lib/permissions.d.ts +5 -2
- package/lib/utils/asn1.d.ts +5 -4
- package/lib/utils/buffer.d.ts +4 -0
- package/lib/utils/certificate.d.ts +82 -15
- package/lib/utils/helper.d.ts +9 -1
- package/lib/vote.d.ts +106 -30
- package/package.json +1 -1
- package/version.d.ts +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSON.html +0 -11
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockUnsignedCanonical.html +0 -11
- package/docs/types/KeetaNetSDK.Referenced.CreateIdentifierRequest.html +0 -6
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ValidateASN1 } from '../utils/asn1';
|
|
2
2
|
import type { DeepMutable } from '../utils/helper';
|
|
3
|
-
import type { GenericAccount, IdentifierAddress, TokenAddress, TokenPublicKeyString } from '../account';
|
|
4
|
-
import Account from '../account';
|
|
3
|
+
import type { GenericAccount, IdentifierAddress, IdentifierKeyAlgorithm, TokenAddress, TokenPublicKeyString } from '../account';
|
|
4
|
+
import Account, { AccountKeyAlgorithm } from '../account';
|
|
5
5
|
import type { AcceptedPermissionTypes } from '../permissions';
|
|
6
6
|
import { Permissions } from '../permissions';
|
|
7
7
|
import type { ToJSONSerializable } from '../utils/conversion';
|
|
8
8
|
import Block, { AdjustMethod } from '.';
|
|
9
9
|
import { Certificate, CertificateBundle, CertificateHash } from '../utils/certificate';
|
|
10
|
+
import type { MultisigConfig } from '../ledger/types';
|
|
10
11
|
/**
|
|
11
12
|
* All supported operations
|
|
12
13
|
*/
|
|
@@ -110,6 +111,20 @@ declare const BlockOperationASN1SchemaBase: {
|
|
|
110
111
|
readonly CREATE_IDENTIFIER: [{
|
|
111
112
|
readonly name: "identifier";
|
|
112
113
|
readonly schema: typeof ValidateASN1.IsOctetString;
|
|
114
|
+
}, {
|
|
115
|
+
readonly name: "createArguments";
|
|
116
|
+
readonly schema: {
|
|
117
|
+
readonly optional: {
|
|
118
|
+
readonly choice: [{
|
|
119
|
+
readonly type: "context";
|
|
120
|
+
readonly kind: "explicit";
|
|
121
|
+
readonly value: 7;
|
|
122
|
+
readonly contains: readonly [{
|
|
123
|
+
readonly sequenceOf: typeof ValidateASN1.IsOctetString;
|
|
124
|
+
}, typeof ValidateASN1.IsInteger];
|
|
125
|
+
}];
|
|
126
|
+
};
|
|
127
|
+
};
|
|
113
128
|
}];
|
|
114
129
|
readonly TOKEN_ADMIN_SUPPLY: [{
|
|
115
130
|
readonly name: "amount";
|
|
@@ -264,9 +279,16 @@ declare class BlockOperationSET_REP extends BlockOperation implements BlockJSONO
|
|
|
264
279
|
/**
|
|
265
280
|
* TokenCreate Operation
|
|
266
281
|
*/
|
|
282
|
+
interface BaseIdentifierCreateArguments<KeyType extends IdentifierKeyAlgorithm> {
|
|
283
|
+
type: KeyType;
|
|
284
|
+
}
|
|
285
|
+
interface MultiSigIdentifierCreateArguments extends BaseIdentifierCreateArguments<AccountKeyAlgorithm.MULTISIG>, MultisigConfig {
|
|
286
|
+
}
|
|
287
|
+
export type IdentifierCreateArguments = MultiSigIdentifierCreateArguments;
|
|
267
288
|
export interface BlockJSONOperationCREATE_IDENTIFIER extends BlockJSONOperation {
|
|
268
289
|
type: OperationType.CREATE_IDENTIFIER;
|
|
269
290
|
identifier: IdentifierAddress | string;
|
|
291
|
+
createArguments?: ToJSONSerializable<IdentifierCreateArguments> | IdentifierCreateArguments;
|
|
270
292
|
}
|
|
271
293
|
declare class BlockOperationCREATE_IDENTIFIER extends BlockOperation implements BlockJSONOperationCREATE_IDENTIFIER {
|
|
272
294
|
#private;
|
|
@@ -275,6 +297,8 @@ declare class BlockOperationCREATE_IDENTIFIER extends BlockOperation implements
|
|
|
275
297
|
constructor(input: BlockJSONOperationCREATE_IDENTIFIER);
|
|
276
298
|
set identifier(identifier: string | IdentifierAddress);
|
|
277
299
|
get identifier(): IdentifierAddress;
|
|
300
|
+
set createArguments(input: IdentifierCreateArguments | ToJSONSerializable<IdentifierCreateArguments> | undefined);
|
|
301
|
+
get createArguments(): IdentifierCreateArguments | undefined;
|
|
278
302
|
validate(context: BlockOperationValidateContext): void;
|
|
279
303
|
toJSON(): BlockJSONOperationCREATE_IDENTIFIER;
|
|
280
304
|
}
|
|
@@ -441,7 +465,11 @@ export declare function ExportBlockOperations(operations: BlockOperations[]): ((
|
|
|
441
465
|
value: OperationType.MODIFY_PERMISSIONS;
|
|
442
466
|
kind: "explicit";
|
|
443
467
|
}) | (Omit<import("../utils/asn1").ASN1ContextTag, "kind" | "value" | "contains"> & {
|
|
444
|
-
contains: [Buffer
|
|
468
|
+
contains: [Buffer, (Omit<import("../utils/asn1").ASN1ContextTag, "kind" | "value" | "contains"> & {
|
|
469
|
+
contains: [Buffer[], bigint];
|
|
470
|
+
value: 7;
|
|
471
|
+
kind: "explicit";
|
|
472
|
+
}) | undefined];
|
|
445
473
|
value: OperationType.CREATE_IDENTIFIER;
|
|
446
474
|
kind: "explicit";
|
|
447
475
|
}) | (Omit<import("../utils/asn1").ASN1ContextTag, "kind" | "value" | "contains"> & {
|
package/lib/error/block.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KeetaNetError } from '.';
|
|
2
2
|
declare const BlockErrorType: "BLOCK";
|
|
3
|
-
declare const BlockErrorCodes: readonly ["INVALID_TYPE", "INVALID_VERSION", "NO_MULTIPLE_SET_REP", "IDENTIFIER_NEED_DEFAULT_PERMISSIONS", "CANNOT_SEND_NON_TOKEN", "TOKEN_RECEIVE_DIFFERS", "ONLY_TOKEN_OP", "ONLY_IDENTIFIER_OP", "NO_TOKEN_OP", "NO_IDENTIFIER_OP", "NO_MULTISIG_OP", "IDENTIFIER_INVALID", "GENERAL_FIELD_INVALID", "PERMISSIONS_INVALID_DEFAULT", "PERMISSIONS_INVALID_ENTITY", "PERMISSIONS_INVALID_PRINCIPAL", "PERMISSIONS_INVALID_TARGET", "INVALID_ACCOUNT_TYPE", "NO_ADMIN_ON_TARGET", "PREVIOUS_SELF", "NO_DELEGATE_ADMIN", "NO_MODIFY_PERMISSION_DUPE", "CANNOT_FORWARD_TO_SELF", "EXACT_TRUE_WHEN_FORWARDING", "CERTIFICATE_SUBJECT_MISMATCH", "NO_DUPLICATE_CERTIFICATE_OPERATION", "INTERMEDIATE_CERTIFICATES_ONLY_ADD", "INVALID_CERTIFICATE_VALUE", "EXTERNAL_TOO_LONG", "EXTERNAL_INVALID", "EXTERNAL_MISSING", "SUPPLY_INVALID"];
|
|
3
|
+
declare const BlockErrorCodes: readonly ["INVALID_TYPE", "INVALID_VERSION", "NO_MULTIPLE_SET_REP", "IDENTIFIER_NEED_DEFAULT_PERMISSIONS", "CANNOT_SEND_NON_TOKEN", "TOKEN_RECEIVE_DIFFERS", "ONLY_TOKEN_OP", "ONLY_IDENTIFIER_OP", "NO_TOKEN_OP", "NO_IDENTIFIER_OP", "INVALID_SIGNER", "INVALID_PURPOSE_VALIDATION", "INVALID_MULTISIG_QUORUM", "INVALID_MULTISIG_SIGNER_DEPTH", "INVALID_MULTISIG_SIGNER_COUNT", "INVALID_MULTISIG_SIGNER_DUPLICATE", "INVALID_CREATE_IDENTIFIER_ARGS", "NO_MULTISIG_OP", "IDENTIFIER_INVALID", "GENERAL_FIELD_INVALID", "PERMISSIONS_INVALID_DEFAULT", "PERMISSIONS_INVALID_ENTITY", "PERMISSIONS_INVALID_PRINCIPAL", "PERMISSIONS_INVALID_TARGET", "INVALID_ACCOUNT_TYPE", "NO_ADMIN_ON_TARGET", "PREVIOUS_SELF", "NO_DELEGATE_ADMIN", "NO_MODIFY_PERMISSION_DUPE", "CANNOT_FORWARD_TO_SELF", "EXACT_TRUE_WHEN_FORWARDING", "CERTIFICATE_SUBJECT_MISMATCH", "NO_DUPLICATE_CERTIFICATE_OPERATION", "INTERMEDIATE_CERTIFICATES_ONLY_ADD", "INVALID_CERTIFICATE_VALUE", "EXTERNAL_TOO_LONG", "EXTERNAL_INVALID", "EXTERNAL_MISSING", "SUPPLY_INVALID"];
|
|
4
4
|
export type BlockErrorCode = `${typeof BlockErrorType}_${typeof BlockErrorCodes[number]}`;
|
|
5
5
|
export default class KeetaNetBlockError extends KeetaNetError {
|
|
6
6
|
static isInstance: (obj: any, strict?: boolean) => obj is KeetaNetBlockError;
|
package/lib/error/ledger.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KeetaNetError } from '.';
|
|
2
2
|
declare const LedgerErrorType: "LEDGER";
|
|
3
|
-
declare const LedgerErrorCodes: readonly ["TRANSACTION_ABORTED", "INVALID_CHAIN", "INVALID_NETWORK", "INVALID_SUBNET", "NOT_EMPTY", "NOT_OPENING", "NOT_SUCCESSOR", "INVALID_PERMISSIONS", "INVALID_OWNER_COUNT", "INVALID_BALANCE", "PREVIOUS_ALREADY_USED", "PREVIOUS_NOT_SEEN", "SUCCESSOR_VOTE_EXISTS", "INSUFFICIENT_VOTING_WEIGHT", "INVALID_ACCOUNT_INFO_KEY", "RECEIVE_NOT_MET", "DUPLICATE_VOTE_FOUND", "CANNOT_EXCHANGE_PERM_VOTE", "BLOCKS_DIFFER_FROM_VOTED_ON", "NO_PERM_WITHOUT_SELF_TEMP", "DUPLICATE_VOTE_ISSUER_FOUND", "OTHER"];
|
|
3
|
+
declare const LedgerErrorCodes: readonly ["TRANSACTION_ABORTED", "INVALID_CHAIN", "INVALID_NETWORK", "INVALID_SUBNET", "NOT_EMPTY", "NOT_OPENING", "NOT_SUCCESSOR", "INVALID_PERMISSIONS", "INVALID_OWNER_COUNT", "INVALID_BALANCE", "PREVIOUS_ALREADY_USED", "PREVIOUS_NOT_SEEN", "SUCCESSOR_VOTE_EXISTS", "INSUFFICIENT_VOTING_WEIGHT", "INVALID_ACCOUNT_INFO_KEY", "RECEIVE_NOT_MET", "DUPLICATE_VOTE_FOUND", "CANNOT_EXCHANGE_PERM_VOTE", "BLOCKS_DIFFER_FROM_VOTED_ON", "NO_PERM_WITHOUT_SELF_TEMP", "DUPLICATE_VOTE_ISSUER_FOUND", "OTHER", "MISSING_BLOCKS", "FEE_AMOUNT_MISMATCH", "FEE_TOKEN_MISMATCH", "FEE_MISSING", "MISSING_REQUIRED_FEE_BLOCK", "PERM_VOTE_WITH_QUOTE", "QUOTE_MISMATCH", "REQUIRED_FEE_MISMATCH"];
|
|
4
4
|
export type LedgerErrorCode = `${typeof LedgerErrorType}_${typeof LedgerErrorCodes[number]}`;
|
|
5
5
|
export declare class KeetaNetLedgerError extends KeetaNetError {
|
|
6
6
|
static isInstance: (obj: any, strict?: boolean) => obj is KeetaNetLedgerError;
|
package/lib/error/vote.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KeetaNetError } from '.';
|
|
2
2
|
declare const VoteErrorType: "VOTE";
|
|
3
|
-
declare const VoteErrorCodes: readonly ["SERIAL_MISMATCH", "INVALID_VERSION", "INVALID_CONSTRUCTION", "INVALID_CONSTRUCTION_JSON", "SIGNATURE_INVALID", "EXPIRED", "INVALID_VALIDITY", "MOMENT_BEFORE_VALIDITY_FROM", "STAPLE_INVALID_CONSTRUCTION", "STAPLE_ALL_VOTES_MUST_HAVE_SAME_BLOCKS_COUNT", "STAPLE_ALL_VOTES_MUST_HAVE_SAME_BLOCKS_MISSING", "STAPLE_ALL_VOTES_MUST_HAVE_SAME_BLOCKS_ORDER", "STAPLE_DUPLICATE_VOTE_ISSUER", "STAPLE_PERMANENCE_MISMATCH", "BUILDER_INVALID_CONSTRUCTION", "BUILDER_INVALID_BLOCK_TYPE", "BUILDER_INVALID_SERIAL", "BUILDER_INVALID_VALID_TO_FROM", "MALFORMED_WRAPPER", "MALFORMED_VOTE_WRAPPER", "MALFORMED_VOTE_CONTENT", "MALFORMED_VOTE_CONTENT_EXTRA_DATA", "MALFORMED_VOTE_VERSION", "MALFORMED_VOTE_SERIAL", "MALFORMED_VOTE_SIGNATURE_INFORMATION", "MALFORMED_VOTE_ISSUER_INFORMATION", "MALFORMED_VOTE_SUBJECT_INFORMATION", "MALFORMED_VOTE_VALIDITY_INFORMATION", "MALFORMED_VOTE_SERIAL", "MALFORMED_VOTE_EXTENSIONS", "MALFORMED_VOTE_EXTENSIONS_VALUE", "MALFORMED_VOTE_EXTENSIONS_VALUE_OID", "MALFORMED_VOTE_EXTENSIONS_VALUE_CRITICAL", "MALFORMED_VOTE_EXTENSIONS_VALUE_CRITICAL_TYPE", "
|
|
3
|
+
declare const VoteErrorCodes: readonly ["SERIAL_MISMATCH", "INVALID_VERSION", "INVALID_CONSTRUCTION", "INVALID_CONSTRUCTION_JSON", "SIGNATURE_INVALID", "EXPIRED", "INVALID_VALIDITY", "MOMENT_BEFORE_VALIDITY_FROM", "STAPLE_INVALID_CONSTRUCTION", "STAPLE_ALL_VOTES_MUST_HAVE_SAME_BLOCKS_COUNT", "STAPLE_ALL_VOTES_MUST_HAVE_SAME_BLOCKS_MISSING", "STAPLE_ALL_VOTES_MUST_HAVE_SAME_BLOCKS_ORDER", "STAPLE_DUPLICATE_VOTE_ISSUER", "STAPLE_PERMANENCE_MISMATCH", "BUILDER_INVALID_CONSTRUCTION", "BUILDER_INVALID_BLOCK_TYPE", "BUILDER_INVALID_SERIAL", "BUILDER_INVALID_VALID_TO_FROM", "MALFORMED_WRAPPER", "MALFORMED_VOTE_WRAPPER", "MALFORMED_VOTE_CONTENT", "MALFORMED_VOTE_CONTENT_EXTRA_DATA", "MALFORMED_VOTE_VERSION", "MALFORMED_VOTE_SERIAL", "MALFORMED_VOTE_SIGNATURE_INFORMATION", "MALFORMED_VOTE_ISSUER_INFORMATION", "MALFORMED_VOTE_SUBJECT_INFORMATION", "MALFORMED_VOTE_VALIDITY_INFORMATION", "MALFORMED_VOTE_SERIAL", "MALFORMED_VOTE_EXTENSIONS", "MALFORMED_VOTE_EXTENSIONS_DATA", "MALFORMED_VOTE_EXTENSIONS_VALUE", "MALFORMED_VOTE_EXTENSIONS_VALUE_OID", "MALFORMED_VOTE_EXTENSIONS_VALUE_CRITICAL", "MALFORMED_VOTE_EXTENSIONS_VALUE_CRITICAL_TYPE", "MALFORMED_VOTE_SIGNATURE_SCHEME_DOES_NOT_MATCH_ISSUER", "MALFORMED_VOTE_SIGNATURE_SCHEME_DOES_NOT_MATCH_WRAPPER", "MALFORMED_VOTE_SIGNATURE_SCHEME_ECDSA_INVALID_CURVE", "MALFORMED_VOTE_SIGNATURE_UNSUPPORTED_SCHEME", "MALFORMED_VOTE_SUBJECT_PUBLIC_KEY_INFORMATION", "MALFORMED_VOTE_SIGNATURE_VALUE", "MALFORMED_VOTE_NO_BLOCKS_FOUND", "MALFORMED_STAPLE", "MALFORMED_STAPLE_BLOCKS", "MALFORMED_STAPLE_BLOCKS_AT_LEAST_ONE", "MALFORMED_STAPLE_VOTES", "MALFORMED_STAPLE_VOTES_AT_LEAST_ONE", "MALFORMED_FIND_RDN_INVALID_TYPE", "MALFORMED_FIND_RDN_MUST_HAVE_ONE", "MALFORMED_FIND_RDN_PART_WELL_FORMED", "MALFORMED_FIND_RDN_MUST_BE_SET", "MALFORMED_FIND_RDN_TYPE_MUST_BE_OID", "MALFORMED_HASHES_FROM_VOTE_INVALID_INPUT", "MALFORMED_HASHES_FROM_VOTE_INVALID_TYPE", "MALFORMED_HASHES_FROM_VOTE_INVALID_CONTEXT_SPECIFIC", "MALFORMED_HASHES_FROM_VOTE_DATA_NEEDS_OID", "MALFORMED_HASHES_FROM_VOTE_DATA_HASH_DATA_MUST_BE_SEQUENCE", "MALFORMED_HASHES_FROM_VOTE_DATA_NOT_TWO_ITEMS", "MALFORMED_HASHES_FROM_VOTE_DATA_UNSUPPORTED_HASH_FUNC", "MALFORMED_HASHES_FROM_VOTE_DATA_UNSUPPORTED_HASH_TYPE", "MALFORMED_HASHES_FROM_VOTE_DATA_SECOND_MUST_BE_SEQUENCE", "MALFORMED_FEES_AMOUNT", "MALFORMED_FEES_FROM_VOTE_INVALID_INPUT", "MALFORMED_FEES_IN_PERMANENT_VOTE", "MALFORMED_FEES_PAY_TO_INVALID", "MALFORMED_FEES_TOKEN_NOT_TOKEN", "FEE_IS_QUOTE", "FEE_QUOTE_MISSING_FEES", "FEE_NOT_QUOTE", "MALFORMED_FEES_KIND_MISSING", "MALFORMED_FEES_QUOTE_INVALID"];
|
|
4
4
|
export type VoteErrorCode = `${typeof VoteErrorType}_${typeof VoteErrorCodes[number]}`;
|
|
5
5
|
export default class KeetaNetVoteError extends KeetaNetError {
|
|
6
6
|
static isInstance: (obj: any, strict?: boolean) => obj is KeetaNetVoteError;
|
package/lib/ledger/common.d.ts
CHANGED
|
@@ -57,6 +57,8 @@ interface ComputeLedgerEffectOptions<T extends boolean, P extends boolean, W ext
|
|
|
57
57
|
baseToken: TokenAddress;
|
|
58
58
|
}
|
|
59
59
|
export declare function validateSupply(amount: bigint, network: bigint): void;
|
|
60
|
+
export declare function validateBlockSignerCount(amount: bigint, network: bigint): void;
|
|
61
|
+
export declare function validateBlockSignerDepth(depth: bigint, network: bigint): void;
|
|
60
62
|
/**
|
|
61
63
|
* Compute effects on the ledger from block effects
|
|
62
64
|
*/
|
|
@@ -87,6 +89,7 @@ type AccountInfoUnparsedRow = {
|
|
|
87
89
|
description?: string;
|
|
88
90
|
metadata?: string;
|
|
89
91
|
supply?: bigint | string;
|
|
92
|
+
multisigQuorum?: bigint | string;
|
|
90
93
|
defaultBasePermission?: string | bigint | BaseSet;
|
|
91
94
|
defaultExternalPermission?: string | bigint | ExternalSet;
|
|
92
95
|
};
|
|
@@ -116,10 +119,20 @@ export declare abstract class LedgerStorageBase {
|
|
|
116
119
|
}>;
|
|
117
120
|
_formatAccountInfoFromRow(account: GenericAccount, row?: AccountInfoUnparsedRow | undefined): AccountInfo;
|
|
118
121
|
_validateAccountInfoKeys(account: GenericAccount, info: Partial<AccountInfo>): void;
|
|
122
|
+
/**
|
|
123
|
+
* @param moment - The date to use as the base for the timestamp.
|
|
124
|
+
* @param momentBits - The number of bits to use for the timestamp
|
|
125
|
+
* @param totalLength - The total length of the generated number in bits
|
|
126
|
+
* @param randomData - A hexadecimal string to use as the random data.
|
|
127
|
+
* @param timestampFuzzMS - The number of milliseconds to fuzz the timestamp by, defaults to 1n (precise).
|
|
128
|
+
* @param optimistic - If true, the timestamp will be incremented by 1 quanta, defaults to false.
|
|
129
|
+
* @returns A bigint representing the noisy timestamp.
|
|
130
|
+
*/
|
|
131
|
+
_generateNoisyTimestamp(moment: Date, momentBits: bigint, totalLength: bigint, randomData: Buffer, timestampFuzzMS?: number | bigint, optimistic?: boolean): bigint;
|
|
119
132
|
getHeadBlock(transaction: any, account: GenericAccount, from: LedgerSelector): Promise<Block | null>;
|
|
120
133
|
getVotesFromPrevious(transaction: any, prevBlock: BlockHash, from: LedgerSelector, issuer?: Account): Promise<Vote[] | null>;
|
|
121
134
|
protected abstract gcBatch(transaction: any): Promise<boolean>;
|
|
122
|
-
gc(transaction: any): Promise<boolean>;
|
|
135
|
+
gc(transaction: any, timeLimitMS?: number): Promise<boolean>;
|
|
123
136
|
}
|
|
124
137
|
export declare function assertLedgerStorage(value: string): LedgerStorage;
|
|
125
138
|
export {};
|
|
@@ -41,7 +41,7 @@ declare class DynamoDBTransaction implements LedgerStorageTransactionBase {
|
|
|
41
41
|
getBlockHeight(blockHash: BlockHash, account: GenericAccount): Promise<bigint | null>;
|
|
42
42
|
getVotes(block: BlockHash, from: LedgerSelector, issuer?: Account, transactionAlreadyVerifiedActiveByCaller?: boolean): Promise<Vote[] | null>;
|
|
43
43
|
getVoteStaple(stapleBlockHashes: VoteBlockHash[], from?: LedgerSelector): Promise<VoteBlockHashMap<VoteStaple | null>>;
|
|
44
|
-
getHistory(account: GenericAccount, start: VoteBlockHash | null, limit: number): Promise<VoteBlockHash[]>;
|
|
44
|
+
getHistory(account: GenericAccount | null, start: VoteBlockHash | null, limit: number): Promise<VoteBlockHash[]>;
|
|
45
45
|
getVotesFromMultiplePrevious(prevBlocks: BlockHash[], from: LedgerSelector, issuer?: Account): Promise<{
|
|
46
46
|
[hash: string]: Vote[] | null;
|
|
47
47
|
}>;
|
|
@@ -86,7 +86,7 @@ export declare class DBDynamoDB extends LedgerStorageBase implements LedgerStora
|
|
|
86
86
|
getBlockHeight(transaction: DynamoDBTransaction, blockHash: BlockHash, account: GenericAccount): Promise<bigint | null>;
|
|
87
87
|
getVotes(transaction: DynamoDBTransaction, block: BlockHash, from: LedgerSelector): Promise<Vote[] | null>;
|
|
88
88
|
getVoteStaples(transaction: DynamoDBTransaction, stapleBlockHashes: VoteBlockHash[], from?: LedgerSelector): Promise<VoteBlockHashMap<VoteStaple | null>>;
|
|
89
|
-
getHistory(transaction: DynamoDBTransaction, account: GenericAccount, start: VoteBlockHash | null, limit?: number): Promise<VoteBlockHash[]>;
|
|
89
|
+
getHistory(transaction: DynamoDBTransaction, account: GenericAccount | null, start: VoteBlockHash | null, limit?: number): Promise<VoteBlockHash[]>;
|
|
90
90
|
getVotesFromMultiplePrevious(transaction: DynamoDBTransaction, prevBlocks: BlockHash[], from: LedgerSelector, issuer?: Account): Promise<{
|
|
91
91
|
[hash: string]: Vote[] | null;
|
|
92
92
|
}>;
|
|
@@ -47,7 +47,7 @@ export declare class DBPostgres extends LedgerStorageBase implements LedgerStora
|
|
|
47
47
|
getBlockHeight(transaction: PostgresTransaction, blockHash: BlockHash, account: GenericAccount): Promise<bigint | null>;
|
|
48
48
|
getVotes(transaction: PostgresTransaction, block: BlockHash, from: LedgerSelector, issuer?: GenericAccount): Promise<Vote[] | null>;
|
|
49
49
|
getVoteStaples(transaction: PostgresTransaction, stapleBlockHashes: VoteBlockHash[], from?: LedgerSelector): Promise<VoteBlockHashMap<VoteStaple | null>>;
|
|
50
|
-
getHistory(transaction: PostgresTransaction, account: GenericAccount, start: VoteBlockHash | null, limit?: number): Promise<VoteBlockHash[]>;
|
|
50
|
+
getHistory(transaction: PostgresTransaction, account: GenericAccount | null, start: VoteBlockHash | null, limit?: number): Promise<VoteBlockHash[]>;
|
|
51
51
|
getBlockFromPrevious(transaction: PostgresTransaction, prevBlock: BlockHash, from: LedgerSelector): Promise<Block | null>;
|
|
52
52
|
getVotesFromMultiplePrevious(transaction: PostgresTransaction, prevBlocks: BlockHash[], from: LedgerSelector, issuer?: Account): Promise<{
|
|
53
53
|
[hash: string]: Vote[] | null;
|
|
@@ -93,7 +93,7 @@ export declare class DBSpanner extends LedgerStorageBase implements LedgerStorag
|
|
|
93
93
|
getBlockHeight(transaction: SpannerTransaction, blockHash: BlockHash, account: GenericAccount): Promise<bigint | null>;
|
|
94
94
|
getVotes(transaction: SpannerTransaction, blockHash: BlockHash, from: LedgerSelector): Promise<Vote[] | null>;
|
|
95
95
|
getVoteStaples(transaction: SpannerTransaction, stapleBlockHashes: VoteBlockHash[], from?: LedgerSelector): Promise<VoteBlockHashMap<VoteStaple | null>>;
|
|
96
|
-
getHistory(transaction: SpannerTransaction, account: GenericAccount, start: VoteBlockHash | null, limit?: number): Promise<VoteBlockHash[]>;
|
|
96
|
+
getHistory(transaction: SpannerTransaction, account: GenericAccount | null, start: VoteBlockHash | null, limit?: number): Promise<VoteBlockHash[]>;
|
|
97
97
|
getBlockFromPrevious(transaction: SpannerTransaction, prevBlock: BlockHash, from: LedgerSelector): Promise<Block | null>;
|
|
98
98
|
getVotesFromMultiplePrevious(transaction: SpannerTransaction, prevBlocks: BlockHash[], from: LedgerSelector, issuer?: Account): Promise<{
|
|
99
99
|
[hash: string]: Vote[] | null;
|
|
@@ -184,7 +184,21 @@ declare const ColumnTypes: {
|
|
|
184
184
|
fromSpanner: (pubKey: string) => GenericAccount;
|
|
185
185
|
toSpanner: (account: GenericAccount) => import("../account").TokenPublicKeyString | import("../account").NetworkPublicKeyString | import("../account").StoragePublicKeyString | import("../account").MultisigPublicKeyString | import("../account").Secp256K1PublicKeyString | import("../account").Secp256R1PublicKeyString | import("../account").ED25519PublicKeyString;
|
|
186
186
|
};
|
|
187
|
-
readonly
|
|
187
|
+
readonly BUFFER_BIGINT_39: {
|
|
188
|
+
dbType: string;
|
|
189
|
+
dbSize: string;
|
|
190
|
+
toSpanner: (buf: bigint) => Buffer;
|
|
191
|
+
fromSpanner: (value: Buffer) => bigint;
|
|
192
|
+
toComparable: (val: Buffer | bigint | string) => bigint;
|
|
193
|
+
};
|
|
194
|
+
readonly BUFFER_BIGINT_16: {
|
|
195
|
+
dbType: string;
|
|
196
|
+
dbSize: string;
|
|
197
|
+
toSpanner: (buf: bigint) => Buffer;
|
|
198
|
+
fromSpanner: (value: Buffer) => bigint;
|
|
199
|
+
toComparable: (val: Buffer | bigint | string) => bigint;
|
|
200
|
+
};
|
|
201
|
+
readonly BUFFER_BIGINT_8: {
|
|
188
202
|
dbType: string;
|
|
189
203
|
dbSize: string;
|
|
190
204
|
toSpanner: (buf: bigint) => Buffer;
|
|
@@ -231,6 +245,7 @@ declare const schema: {
|
|
|
231
245
|
readonly description: ColumnInterface<"INFO_DESCRIPTION", true>;
|
|
232
246
|
readonly metadata: ColumnInterface<"INFO_METADATA", true>;
|
|
233
247
|
readonly supply: ColumnInterface<"SUPPLY", true>;
|
|
248
|
+
readonly multisigQuorum: ColumnInterface<"BIGINT", true>;
|
|
234
249
|
readonly defaultBasePermission: ColumnInterface<"BASE_PERMISSION", true>;
|
|
235
250
|
readonly defaultExternalPermission: ColumnInterface<"EXTERNAL_PERMISSION", true>;
|
|
236
251
|
};
|
|
@@ -274,7 +289,7 @@ declare const schema: {
|
|
|
274
289
|
readonly columns: {
|
|
275
290
|
readonly account: ColumnInterface<"GENERIC_ACCOUNT", false>;
|
|
276
291
|
readonly voteBlockHash: ColumnInterface<"VOTEBLOCKHASH", false>;
|
|
277
|
-
readonly orderIndex: ColumnInterface<"
|
|
292
|
+
readonly orderIndex: ColumnInterface<"BUFFER_BIGINT_39", false>;
|
|
278
293
|
};
|
|
279
294
|
readonly key: readonly [Key, Key];
|
|
280
295
|
readonly interleave: Interleave;
|
|
@@ -295,9 +310,10 @@ declare const schema: {
|
|
|
295
310
|
readonly onLedger: ColumnInterface<"LEDGER", false>;
|
|
296
311
|
readonly vote: ColumnInterface<"VOTE", false>;
|
|
297
312
|
readonly timestamp: ColumnInterface<"TIMESTAMP", false>;
|
|
298
|
-
readonly expires: ColumnInterface<"TIMESTAMP", false>;
|
|
299
313
|
readonly issuer: ColumnInterface<"ACCOUNT", false>;
|
|
300
314
|
readonly voteBlockHash: ColumnInterface<"VOTEBLOCKHASH", false>;
|
|
315
|
+
readonly orderIndex: ColumnInterface<"BUFFER_BIGINT_16", false>;
|
|
316
|
+
readonly expiresIndex: ColumnInterface<"BUFFER_BIGINT_8", true>;
|
|
301
317
|
};
|
|
302
318
|
readonly key: readonly [Key, Key];
|
|
303
319
|
};
|
|
@@ -370,6 +386,12 @@ declare const schema: {
|
|
|
370
386
|
readonly table: "history";
|
|
371
387
|
readonly key: readonly [Key, Key];
|
|
372
388
|
};
|
|
389
|
+
readonly historyOrdered: {
|
|
390
|
+
readonly type: "INDEX";
|
|
391
|
+
readonly table: "history";
|
|
392
|
+
readonly key: readonly [Key];
|
|
393
|
+
readonly storing: readonly [Key];
|
|
394
|
+
};
|
|
373
395
|
readonly chainAccountHash: {
|
|
374
396
|
readonly type: "INDEX";
|
|
375
397
|
readonly table: "chain";
|
|
@@ -383,15 +405,16 @@ declare const schema: {
|
|
|
383
405
|
readonly key: readonly [Key];
|
|
384
406
|
readonly storing: readonly [Key];
|
|
385
407
|
};
|
|
386
|
-
readonly
|
|
408
|
+
readonly votesOrderIndex: {
|
|
387
409
|
readonly type: "INDEX";
|
|
388
410
|
readonly table: "votes";
|
|
389
411
|
readonly key: readonly [Key, Key];
|
|
390
412
|
readonly storing: readonly [Key];
|
|
391
413
|
};
|
|
392
|
-
readonly
|
|
414
|
+
readonly votesExpiredIndex: {
|
|
393
415
|
readonly type: "INDEX";
|
|
394
416
|
readonly table: "votes";
|
|
417
|
+
readonly nullFiltered: true;
|
|
395
418
|
readonly key: readonly [Key, Key];
|
|
396
419
|
readonly storing: readonly [Key];
|
|
397
420
|
};
|
|
@@ -46,7 +46,7 @@ export declare class DBSqlite extends LedgerStorageBase implements LedgerStorage
|
|
|
46
46
|
getBlockHeight(transaction: DBSqliteTransaction, blockHash: BlockHash, account: GenericAccount): Promise<bigint | null>;
|
|
47
47
|
getVotes(transaction: DBSqliteTransaction, block: BlockHash, from: LedgerSelector): Promise<Vote[] | null>;
|
|
48
48
|
getVoteStaples(transaction: DBSqliteTransaction, voteBlockHashes: VoteBlockHash[], from?: LedgerSelector): Promise<VoteBlockHashMap<VoteStaple | null>>;
|
|
49
|
-
getHistory(transaction: DBSqliteTransaction, account: GenericAccount, start: VoteBlockHash | null, limit?: number): Promise<VoteBlockHash[]>;
|
|
49
|
+
getHistory(transaction: DBSqliteTransaction, account: GenericAccount | null, start: VoteBlockHash | null, limit?: number): Promise<VoteBlockHash[]>;
|
|
50
50
|
getBlockFromPrevious(transaction: DBSqliteTransaction, prevBlock: BlockHash, from: LedgerSelector): Promise<Block | null>;
|
|
51
51
|
getVotesFromMultiplePrevious(transaction: DBSqliteTransaction, prevBlocks: BlockHash[], from: LedgerSelector, issuer?: GenericAccount): Promise<{
|
|
52
52
|
[hash: string]: Vote[] | null;
|
package/lib/ledger/effects.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { GenericAccount, IdentifierAddress, NetworkAddress, TokenAddress } from '../account';
|
|
2
2
|
import Account from '../account';
|
|
3
|
-
import type { AdjustMethod
|
|
3
|
+
import type { AdjustMethod } from '../block';
|
|
4
4
|
import { Block } from '../block';
|
|
5
|
-
import type
|
|
5
|
+
import type * as Operations from '../block/operations';
|
|
6
|
+
import type { UserEditableAccountInfo, ACLEntry, ACLUpdate } from '../ledger/types';
|
|
6
7
|
import type { Certificate, CertificateBundle } from '../utils/certificate';
|
|
7
8
|
import { CertificateHash } from '../utils/certificate';
|
|
8
9
|
interface NumericValueEntry {
|
|
@@ -41,24 +42,23 @@ interface ComputedBlocksEffectTokenChangesField {
|
|
|
41
42
|
/**
|
|
42
43
|
* Which fields may be affected by blocks
|
|
43
44
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
account: GenericAccount;
|
|
49
|
-
};
|
|
45
|
+
interface CreateIdentifierRequest {
|
|
46
|
+
createdIdentifier: IdentifierAddress;
|
|
47
|
+
createArguments?: Operations.IdentifierCreateArguments;
|
|
48
|
+
}
|
|
50
49
|
type DelegationUpdate = {
|
|
51
50
|
delegateTo: Account;
|
|
52
51
|
};
|
|
53
52
|
interface ComputedBlocksEffectFields {
|
|
54
53
|
balance?: ComputedBlocksEffectTokenChangesField;
|
|
55
54
|
supply?: NumericValueEntry[];
|
|
56
|
-
info?:
|
|
55
|
+
info?: Partial<UserEditableAccountInfo>;
|
|
57
56
|
permissions?: ACLUpdate[];
|
|
58
57
|
permissionRequirements?: ACLEntry[];
|
|
59
58
|
createRequests?: CreateIdentifierRequest[];
|
|
60
59
|
delegation?: DelegationUpdate;
|
|
61
60
|
certificate?: CertificateUpdate[];
|
|
61
|
+
minSignerSetLength?: bigint;
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Which accounts and fields are affected by a set of block
|
|
@@ -80,6 +80,7 @@ export type ComputedEffectOfBlocks = {
|
|
|
80
80
|
metadata: {
|
|
81
81
|
operationCount: number;
|
|
82
82
|
blockCount: number;
|
|
83
|
+
feeUnits: bigint;
|
|
83
84
|
};
|
|
84
85
|
};
|
|
85
86
|
type LedgerOptions = {
|
package/lib/ledger/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VoteStaple, Vote, VoteBlockHashMap } from '../vote';
|
|
2
2
|
import { Block, BlockHash } from '../block';
|
|
3
|
-
import type { VoteBlockHash } from '../vote';
|
|
4
|
-
import type { GenericAccount, IdentifierAddress, NetworkAddress, TokenAddress } from '../account';
|
|
3
|
+
import type { FeeAmountAndToken, VoteBlockHash, VoteQuote } from '../vote';
|
|
4
|
+
import type { GenericAccount, IdentifierAddress, NetworkAddress, StorageAddress, TokenAddress } from '../account';
|
|
5
5
|
import Account from '../account';
|
|
6
6
|
import type Node from '../node';
|
|
7
7
|
import type { BloomFilter } from '../utils/bloom';
|
|
@@ -31,6 +31,10 @@ export interface LedgerConfig {
|
|
|
31
31
|
* Private key for the ledger if it is acting as a representative
|
|
32
32
|
*/
|
|
33
33
|
privateKey?: Account;
|
|
34
|
+
/**
|
|
35
|
+
* Provided function to compute fees for a given set of Blocks and computed effects
|
|
36
|
+
*/
|
|
37
|
+
computeFeeFromBlocks: (ledger: Ledger, blocks: Block[], effects: ComputedEffectOfBlocks) => FeeAmountAndToken | null;
|
|
34
38
|
/**
|
|
35
39
|
* Storage mechanism
|
|
36
40
|
*/
|
|
@@ -208,9 +212,9 @@ export interface LedgerStorageAPI {
|
|
|
208
212
|
*/
|
|
209
213
|
getVoteStaples: (transaction: any, voteBlockHashes: VoteBlockHash[], from: LedgerSelector) => Promise<VoteBlockHashMap<VoteStaple | null>>;
|
|
210
214
|
/**
|
|
211
|
-
* Get the history for a specific account
|
|
215
|
+
* Get the history for a specific account or all accounts if account is null
|
|
212
216
|
*/
|
|
213
|
-
getHistory: (transaction: any, account: GenericAccount, start: VoteBlockHash | null, limit?: number) => Promise<VoteBlockHash[]>;
|
|
217
|
+
getHistory: (transaction: any, account: GenericAccount | null, start: VoteBlockHash | null, limit?: number) => Promise<VoteBlockHash[]>;
|
|
214
218
|
/**
|
|
215
219
|
* Get multiple head blocks at the same time for a set of accounts
|
|
216
220
|
*/
|
|
@@ -250,7 +254,7 @@ export interface LedgerStorageAPI {
|
|
|
250
254
|
/**
|
|
251
255
|
* Perform Garbage Collection
|
|
252
256
|
*/
|
|
253
|
-
gc: (transaction: any) => Promise<boolean>;
|
|
257
|
+
gc: (transaction: any, timeLimitMS?: number) => Promise<boolean>;
|
|
254
258
|
/**
|
|
255
259
|
* Get the next serial number for a representative
|
|
256
260
|
*/
|
|
@@ -276,7 +280,8 @@ declare class LedgerAtomicInterface {
|
|
|
276
280
|
constructor(transaction: LedgerStorageTransactionBase, storage: LedgerStorageAPI, config: LedgerConfig, ledger: Ledger);
|
|
277
281
|
commit(): Promise<void>;
|
|
278
282
|
abort(): Promise<void>;
|
|
279
|
-
vote(blocks: Block[], otherVotes?: Vote[]): Promise<Vote>;
|
|
283
|
+
vote(blocks: Block[], otherVotes?: Vote[], quote?: VoteQuote): Promise<Vote>;
|
|
284
|
+
quote(blocks: Block[]): Promise<VoteQuote>;
|
|
280
285
|
add(votesAndBlocks: VoteStaple, from?: 'bootstrap' | string): Promise<VoteStaple[]>;
|
|
281
286
|
getBalance(account: GenericAccount, token: TokenAddress): Promise<bigint>;
|
|
282
287
|
getAllBalances(account: GenericAccount): Promise<GetAllBalancesResponse>;
|
|
@@ -299,10 +304,11 @@ declare class LedgerAtomicInterface {
|
|
|
299
304
|
getBlock(blockhash: BlockHash, from?: LedgerSelector): Promise<Block | null>;
|
|
300
305
|
getVoteStaple(stapleBlockHash: VoteBlockHash, from?: LedgerSelector): Promise<VoteStaple | null>;
|
|
301
306
|
getVoteStaples(stapleBlockHashes: VoteBlockHash[], from?: LedgerSelector): Promise<VoteBlockHashMap<VoteStaple | null>>;
|
|
302
|
-
getHistory(account: GenericAccount, start: VoteBlockHash | null, limit?: number): Promise<VoteStaple[]>;
|
|
307
|
+
getHistory(account: GenericAccount | null, start: VoteBlockHash | null, limit?: number): Promise<VoteStaple[]>;
|
|
303
308
|
getStaplesFromBlockHashes(hashes: BlockHash[]): Promise<VoteStaple[]>;
|
|
304
309
|
getVoteStaplesAfter(moment: Date, limit?: number, options?: GetVotesAfterOptions): Promise<VoteStaple[]>;
|
|
305
|
-
gc(): Promise<boolean>;
|
|
310
|
+
gc(timeLimitMS?: number): Promise<boolean>;
|
|
311
|
+
getFee(blocks: Block[], effectsInput?: ComputedEffectOfBlocks): Promise<FeeAmountAndToken | null>;
|
|
306
312
|
_testingRunStorageFunction<T>(code: (storage: LedgerStorageAPI, transaction: LedgerStorageTransactionBase) => Promise<T>): Promise<T>;
|
|
307
313
|
}
|
|
308
314
|
/**
|
|
@@ -319,6 +325,7 @@ export declare class Ledger implements Omit<LedgerAtomicInterface, 'commit' | 'a
|
|
|
319
325
|
constructor(config: LedgerConfig, node?: Node, existingStorage?: LedgerStorageAPI);
|
|
320
326
|
get ledgerWriteMode(): NonNullable<LedgerConfig['ledgerWriteMode']>;
|
|
321
327
|
copy(newNode: Node): Ledger;
|
|
328
|
+
getFeePayToAndToken(accounts?: (Account | StorageAddress)[], token?: TokenAddress): Partial<FeeAmountAndToken>;
|
|
322
329
|
/**
|
|
323
330
|
* Execute some code with a transaction held, if the code fails the
|
|
324
331
|
* transaction is aborted, otherwise it is committed
|
|
@@ -330,6 +337,7 @@ export declare class Ledger implements Omit<LedgerAtomicInterface, 'commit' | 'a
|
|
|
330
337
|
runReadOnly<T>(identifier: string, code: (transaction: LedgerAtomicInterface) => Promise<T>): ReturnType<typeof code>;
|
|
331
338
|
beginTransaction(identifier: string, readOnly?: boolean): Promise<LedgerAtomicInterface>;
|
|
332
339
|
vote(...args: Parameters<LedgerAtomicInterface['vote']>): ReturnType<LedgerAtomicInterface['vote']>;
|
|
340
|
+
quote(...args: Parameters<LedgerAtomicInterface['quote']>): ReturnType<LedgerAtomicInterface['quote']>;
|
|
333
341
|
add(...args: Parameters<LedgerAtomicInterface['add']>): ReturnType<LedgerAtomicInterface['add']>;
|
|
334
342
|
listACLsByPrincipal(...args: Parameters<LedgerAtomicInterface['listACLsByPrincipal']>): ReturnType<LedgerAtomicInterface['listACLsByPrincipal']>;
|
|
335
343
|
listACLsByEntity(...args: Parameters<LedgerAtomicInterface['listACLsByEntity']>): ReturnType<LedgerAtomicInterface['listACLsByEntity']>;
|
|
@@ -352,6 +360,7 @@ export declare class Ledger implements Omit<LedgerAtomicInterface, 'commit' | 'a
|
|
|
352
360
|
getStaplesFromBlockHashes(...args: Parameters<LedgerAtomicInterface['getStaplesFromBlockHashes']>): ReturnType<LedgerAtomicInterface['getStaplesFromBlockHashes']>;
|
|
353
361
|
getVoteStaplesAfter(...args: Parameters<LedgerAtomicInterface['getVoteStaplesAfter']>): ReturnType<LedgerAtomicInterface['getVoteStaplesAfter']>;
|
|
354
362
|
gc(...args: Parameters<LedgerAtomicInterface['gc']>): ReturnType<LedgerAtomicInterface['gc']>;
|
|
363
|
+
getFee(...args: Parameters<LedgerAtomicInterface['getFee']>): ReturnType<LedgerAtomicInterface['getFee']>;
|
|
355
364
|
stats(): Promise<LedgerStatistics>;
|
|
356
365
|
_testingRunStorageFunction<T>(code: (storage: LedgerStorageAPI, transaction: LedgerStorageTransactionBase) => Promise<T>): Promise<T>;
|
|
357
366
|
}
|
package/lib/ledger/types.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import type { GenericAccount, TokenAddress } from '../account';
|
|
1
|
+
import type { Account, GenericAccount, MultisigAddress, TokenAddress } from '../account';
|
|
2
2
|
import type { AdjustMethod } from '../block';
|
|
3
3
|
import type { Permissions } from '../permissions';
|
|
4
4
|
import type { DbStats, TimeStats } from '../stats';
|
|
5
5
|
import type { Certificate, CertificateBundle } from '../utils/certificate';
|
|
6
|
+
export interface MultisigConfig {
|
|
7
|
+
signers: (Account | MultisigAddress)[];
|
|
8
|
+
quorum: bigint;
|
|
9
|
+
}
|
|
6
10
|
/**
|
|
7
11
|
* Account info entry
|
|
8
12
|
*/
|
|
@@ -27,7 +31,12 @@ export interface AccountInfo {
|
|
|
27
31
|
* The default permissions for the account
|
|
28
32
|
*/
|
|
29
33
|
defaultPermission?: Permissions;
|
|
34
|
+
/**
|
|
35
|
+
* If this is a multisig account, the number of signers required
|
|
36
|
+
*/
|
|
37
|
+
multisigQuorum?: bigint;
|
|
30
38
|
}
|
|
39
|
+
export type UserEditableAccountInfo = Omit<AccountInfo, 'supply'>;
|
|
31
40
|
/**
|
|
32
41
|
* Permissions types
|
|
33
42
|
*/
|
package/lib/node/utils.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import Account, { type StorageAddress, type TokenAddress } from '../account';
|
|
1
2
|
import type { NodeConfig } from '.';
|
|
2
3
|
export declare function getConfigFromEnv(type: 'local' | 'lambda'): Partial<Omit<NodeConfig, 'ledger'> & {
|
|
3
4
|
ledger: Partial<NodeConfig['ledger']>;
|
|
4
5
|
}>;
|
|
6
|
+
export declare function getFeeConfigFromEnv(type: 'local' | 'lambda'): {
|
|
7
|
+
feeAccounts: (Account | StorageAddress)[];
|
|
8
|
+
feeToken: TokenAddress | undefined;
|
|
9
|
+
};
|
package/lib/p2p.d.ts
CHANGED
|
@@ -48,6 +48,10 @@ export interface P2PConfig {
|
|
|
48
48
|
* Forget about seen message ids after this many milliseconds
|
|
49
49
|
*/
|
|
50
50
|
seenMessageTTL?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Whether to republish over http or p2p websockets
|
|
53
|
+
*/
|
|
54
|
+
useHTTPRepublish?: boolean;
|
|
51
55
|
}
|
|
52
56
|
/**
|
|
53
57
|
* Shape of statistics
|
|
@@ -66,6 +70,7 @@ export interface P2PSwitchStatistics {
|
|
|
66
70
|
interface P2PPeerBase {
|
|
67
71
|
kind: NodeKind;
|
|
68
72
|
}
|
|
73
|
+
export type P2PUpdateOptions = 'http' | 'websocket';
|
|
69
74
|
/**
|
|
70
75
|
* Peering information for a Representative (Basic, unsigned information)
|
|
71
76
|
*/
|
|
@@ -82,6 +87,10 @@ interface P2PPeerRepBase extends P2PPeerBase {
|
|
|
82
87
|
* Public key of the representative (used as the ID)
|
|
83
88
|
*/
|
|
84
89
|
key: Account;
|
|
90
|
+
/**
|
|
91
|
+
* Prefer to receive updates over http or websocket
|
|
92
|
+
*/
|
|
93
|
+
preferUpdates: P2PUpdateOptions;
|
|
85
94
|
}
|
|
86
95
|
/**
|
|
87
96
|
* Peering information for a Representative
|
|
@@ -200,6 +209,23 @@ type JSONMessage = {
|
|
|
200
209
|
};
|
|
201
210
|
export declare function randomizeReps(reps: Representative[]): Representative[];
|
|
202
211
|
export declare function formatRepEndpoints(peers: P2PPeer[]): Representative[];
|
|
212
|
+
export declare class P2PHttpConnection implements P2PConnection {
|
|
213
|
+
#private;
|
|
214
|
+
abort: boolean;
|
|
215
|
+
peer: P2PPeer;
|
|
216
|
+
validatedPeer: P2PPeer | null;
|
|
217
|
+
timeout: number;
|
|
218
|
+
static readonly isInstance: (obj: any, strict?: boolean) => obj is P2PHttpConnection;
|
|
219
|
+
/**
|
|
220
|
+
* Initiate an outbound http connection and attach it to the specified switch
|
|
221
|
+
*/
|
|
222
|
+
static initiate(peer: P2PPeer, p2pSwitch: P2PSwitch): Promise<P2PHttpConnection | null>;
|
|
223
|
+
constructor(peer: P2PPeer, p2pSwitch: P2PSwitch);
|
|
224
|
+
get connString(): string;
|
|
225
|
+
get peerString(): string | null;
|
|
226
|
+
send(messageBuffer: Buffer): Promise<boolean>;
|
|
227
|
+
close(): Promise<void>;
|
|
228
|
+
}
|
|
203
229
|
/**
|
|
204
230
|
* A P2PConnection using the "ws" package
|
|
205
231
|
*/
|
|
@@ -275,6 +301,7 @@ export declare class P2PSwitch {
|
|
|
275
301
|
* Our own peer information
|
|
276
302
|
*/
|
|
277
303
|
selfPeer(): Promise<P2PPeer | null>;
|
|
304
|
+
getOutgoingGreetingInfo(): Promise<JSONSerializableObject>;
|
|
278
305
|
/**
|
|
279
306
|
* Receive a message from a connection
|
|
280
307
|
*
|
|
@@ -299,5 +326,10 @@ export declare class P2PSwitch {
|
|
|
299
326
|
* @returns If the message could be delivered to at least one peer
|
|
300
327
|
*/
|
|
301
328
|
sendMessage(to: P2PConnection | Account | P2PPeer | null, id: string, type: string, data: any, ttl?: number, exclude?: (string | P2PConnection)[], skipConnectToPeers?: boolean): Promise<boolean>;
|
|
329
|
+
/**
|
|
330
|
+
* TODO - make this private after refactoring websockets to handle higher load
|
|
331
|
+
* https://github.com/KeetaNetwork/node/issues/785
|
|
332
|
+
*/
|
|
333
|
+
haveAnyFilter(data: any): Promise<boolean>;
|
|
302
334
|
}
|
|
303
335
|
export default P2PSwitch;
|
package/lib/permissions.d.ts
CHANGED
|
@@ -18,7 +18,8 @@ declare enum BaseFlag {
|
|
|
18
18
|
TOKEN_ADMIN_MODIFY_BALANCE = 7,/* 0x0080 */
|
|
19
19
|
PERMISSION_DELEGATE_ADD = 11,/* 0x0800 */
|
|
20
20
|
PERMISSION_DELEGATE_REMOVE = 12,/* 0x1000 */
|
|
21
|
-
MANAGE_CERTIFICATE = 13
|
|
21
|
+
MANAGE_CERTIFICATE = 13,/* 0x2000 */
|
|
22
|
+
MULTISIG_SIGNER = 14
|
|
22
23
|
}
|
|
23
24
|
type ExternalFlagName = `${typeof externalFlagPrefix}${string}`;
|
|
24
25
|
export type BaseFlagName = keyof typeof BaseFlag;
|
|
@@ -42,7 +43,9 @@ declare enum BasePermissionGroup {
|
|
|
42
43
|
NONIDENTIFIER = 2,
|
|
43
44
|
NETWORK = 3,
|
|
44
45
|
TOKEN = 4,
|
|
45
|
-
STORAGE = 5
|
|
46
|
+
STORAGE = 5,
|
|
47
|
+
NONIDENTIFIER_OR_MULTISIG = 6,
|
|
48
|
+
MULTISIG = 7
|
|
46
49
|
}
|
|
47
50
|
interface BaseFlagRule {
|
|
48
51
|
canBeDefault: boolean;
|
package/lib/utils/asn1.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export interface ASN1String extends ASN1Object {
|
|
|
44
44
|
kind: 'printable' | 'ia5' | 'utf8';
|
|
45
45
|
value: string;
|
|
46
46
|
}
|
|
47
|
+
export declare function isASN1Object(input: unknown): input is ASN1Object;
|
|
47
48
|
/**
|
|
48
49
|
* Validation function for {@link isValidSequenceSchema}
|
|
49
50
|
*/
|
|
@@ -58,7 +59,7 @@ declare function jsASN1toJS(input: ArrayBuffer): ASN1AnyJS;
|
|
|
58
59
|
declare const ASN1toJS: typeof jsASN1toJS, JStoASN1: typeof jsJStoASN1, ASN1IntegerToBigInt: typeof jsIntegerToBigInt, ASN1BigIntToBuffer: typeof jsBigIntToBuffer;
|
|
59
60
|
export declare namespace ValidateASN1 {
|
|
60
61
|
export type Schema = keyof BasicSchemaMap | {
|
|
61
|
-
choice: Schema[];
|
|
62
|
+
choice: Schema[] | readonly Schema[];
|
|
62
63
|
} | {
|
|
63
64
|
sequenceOf: Schema;
|
|
64
65
|
} | {
|
|
@@ -86,7 +87,7 @@ export declare namespace ValidateASN1 {
|
|
|
86
87
|
} | {
|
|
87
88
|
type: 'date';
|
|
88
89
|
kind: 'general';
|
|
89
|
-
} | readonly [Schema, ...Schema[]];
|
|
90
|
+
} | readonly [Schema, ...Schema[]] | (() => Schema);
|
|
90
91
|
type BasicSchemaMap = {
|
|
91
92
|
[ValidateASN1.IsAny]: ASN1AnyJS;
|
|
92
93
|
[ValidateASN1.IsUnknown]: unknown;
|
|
@@ -102,7 +103,7 @@ export declare namespace ValidateASN1 {
|
|
|
102
103
|
[ValidateASN1.IsSet]: ASN1Set;
|
|
103
104
|
[ValidateASN1.IsNull]: null;
|
|
104
105
|
};
|
|
105
|
-
export type SchemaMap<T extends Schema> = T extends keyof BasicSchemaMap ? BasicSchemaMap[T] : T extends {
|
|
106
|
+
export type SchemaMap<T extends Schema> = T extends () => infer U ? U extends Schema ? SchemaMap<U> : never : T extends keyof BasicSchemaMap ? BasicSchemaMap[T] : T extends {
|
|
106
107
|
choice: Schema[];
|
|
107
108
|
} ? SchemaMap<T['choice'][number]> : T extends {
|
|
108
109
|
choice: readonly Schema[];
|
|
@@ -162,7 +163,7 @@ export declare class ValidateASN1<T extends ValidateASN1.Schema> {
|
|
|
162
163
|
* Given a schema, validate the ASN.1 object against it and return the
|
|
163
164
|
* object as the validated type
|
|
164
165
|
*/
|
|
165
|
-
static againstSchema<T extends ValidateASN1.Schema>(input: ASN1AnyJS,
|
|
166
|
+
static againstSchema<T extends ValidateASN1.Schema>(input: ASN1AnyJS, schemaIn: T): ValidateASN1.SchemaMap<T>;
|
|
166
167
|
constructor(schema: T);
|
|
167
168
|
validate(input: ASN1AnyJS): ValidateASN1.SchemaMap<T>;
|
|
168
169
|
}
|
package/lib/utils/buffer.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Buffer } from 'buffer';
|
|
1
2
|
import zlib from 'zlib';
|
|
2
3
|
/**
|
|
3
4
|
* RFC 4648 Base32 Decoder
|
|
@@ -11,6 +12,8 @@ export declare function DecodeBase64(data: string): ArrayBuffer;
|
|
|
11
12
|
export declare function EncodeBase64(data: ArrayBuffer): string;
|
|
12
13
|
export declare function ZlibInflate(data: ArrayBuffer, options?: zlib.ZlibOptions): ArrayBuffer;
|
|
13
14
|
export declare function ZlibDeflate(data: ArrayBuffer, options?: zlib.ZlibOptions): ArrayBuffer;
|
|
15
|
+
export declare function ZlibInflateAsync(data: ArrayBuffer, options?: zlib.ZlibOptions): Promise<ArrayBuffer>;
|
|
16
|
+
export declare function ZlibDeflateAsync(data: ArrayBuffer, options?: zlib.ZlibOptions): Promise<ArrayBuffer>;
|
|
14
17
|
export declare class BufferStorage {
|
|
15
18
|
#private;
|
|
16
19
|
readonly storageKind: string;
|
|
@@ -24,3 +27,4 @@ export declare class BufferStorage {
|
|
|
24
27
|
compare(compareWith: typeof this | undefined | null): boolean;
|
|
25
28
|
compareHexString(compareWith: BufferStorage | string | undefined | null): boolean;
|
|
26
29
|
}
|
|
30
|
+
export { Buffer };
|