@keetanetwork/keetanet-client 0.14.8 → 0.14.9
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/client/client_common_tests.d.ts +2 -2
- package/client/index-browser.js +240 -61
- package/client/index.js +208 -27
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BaseSet.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BaseVoteBuilder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperation.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationCREATE_IDENTIFIER.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMANAGE_CERTIFICATE.html +1 -1
- 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.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.IdempotentKey.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.KeetaNetErrorBase.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetLedgerError.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetLedgerIdempotentKeyError.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetLedgerVoteError.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.PermissionSetHolder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.PossiblyExpiredVote.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.SignatureStorage.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.StatsPending.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockBundle.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteBuilder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteLikeBase.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteQuoteBuilder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteStapleHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_asn1.BufferStorageASN1.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_asn1.ValidateASN1.html +73 -2
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_buffer.BufferStorage.html +1 -1
- 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.BaseIdentifierCreateArguments.html +1 -1
- 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 +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.BlockV1Canonical.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockV2Canonical.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.Constructor.html +1 -1
- 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.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.ModifyTokenBalanceEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.MultiSigIdentifierCreateArguments.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.MultisigConfig.html +1 -1
- 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 +1 -1
- 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.WithIsInstance.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Struct.html +5 -0
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_asn1.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1AnyJS.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.src_lib_utils_asn1.ASN1CheckUtilities.html +1 -1
- package/lib/ledger/db_common_tests.d.ts +1 -0
- package/lib/utils/asn1.d.ts +109 -2
- package/lib/utils/helper_testing.d.ts +2 -1
- package/npm-shrinkwrap.json +157 -433
- package/package.json +6 -13
- package/version.d.ts +1 -1
|
@@ -52,14 +52,14 @@ export declare const clientTests: {
|
|
|
52
52
|
options: {
|
|
53
53
|
p2pTested: boolean;
|
|
54
54
|
count: number;
|
|
55
|
+
timeout: number;
|
|
55
56
|
};
|
|
56
57
|
};
|
|
57
|
-
'
|
|
58
|
+
'Non-Node Client Tests': {
|
|
58
59
|
test: typeof runNonNodeTests;
|
|
59
60
|
options: {
|
|
60
61
|
p2pTested: boolean;
|
|
61
62
|
count: number;
|
|
62
|
-
timeout: number;
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
'Fee Block Tests': {
|
package/client/index-browser.js
CHANGED
|
@@ -105604,7 +105604,12 @@ function client_promiseGenerator() {
|
|
|
105604
105604
|
reject
|
|
105605
105605
|
};
|
|
105606
105606
|
}
|
|
105607
|
-
function client_convertToJSON(
|
|
105607
|
+
function client_convertToJSON(key, item) {
|
|
105608
|
+
// @ts-ignore
|
|
105609
|
+
if (this !== undefined) {
|
|
105610
|
+
// @ts-ignore
|
|
105611
|
+
item = this[key];
|
|
105612
|
+
}
|
|
105608
105613
|
switch (typeof item) {
|
|
105609
105614
|
case 'string':
|
|
105610
105615
|
case 'boolean':
|
|
@@ -105644,6 +105649,9 @@ function client_convertToJSON(_ignore_key, item) {
|
|
|
105644
105649
|
if (client_util.types.isArrayBuffer(item)) {
|
|
105645
105650
|
return src_client_Buffer.from(item).toString('base64');
|
|
105646
105651
|
}
|
|
105652
|
+
if (typeof item === 'symbol') {
|
|
105653
|
+
return item.toString();
|
|
105654
|
+
}
|
|
105647
105655
|
if (item instanceof Object) {
|
|
105648
105656
|
if (item.toJSON !== undefined) {
|
|
105649
105657
|
if (typeof item.toJSON === 'function') {
|
|
@@ -113255,6 +113263,37 @@ function client_isASN1Date(input) {
|
|
|
113255
113263
|
}
|
|
113256
113264
|
return true;
|
|
113257
113265
|
}
|
|
113266
|
+
function client_isASN1Struct(input) {
|
|
113267
|
+
if (!client_isASN1Object(input)) {
|
|
113268
|
+
return false;
|
|
113269
|
+
}
|
|
113270
|
+
if (input.type !== 'struct') {
|
|
113271
|
+
return false;
|
|
113272
|
+
}
|
|
113273
|
+
if ('fieldNames' in input && input.fieldNames !== undefined) {
|
|
113274
|
+
if (!Array.isArray(input.fieldNames)) {
|
|
113275
|
+
return false;
|
|
113276
|
+
}
|
|
113277
|
+
for (const fieldName of input.fieldNames) {
|
|
113278
|
+
if (typeof fieldName !== 'string') {
|
|
113279
|
+
return false;
|
|
113280
|
+
}
|
|
113281
|
+
}
|
|
113282
|
+
}
|
|
113283
|
+
if (!('contains' in input) || typeof input.contains !== 'object' || input.contains === null) {
|
|
113284
|
+
return false;
|
|
113285
|
+
}
|
|
113286
|
+
return true;
|
|
113287
|
+
}
|
|
113288
|
+
function client_isASN1ModifierOptional(input) {
|
|
113289
|
+
if (typeof input !== 'object' || input === null) {
|
|
113290
|
+
return false;
|
|
113291
|
+
}
|
|
113292
|
+
if (!('optional' in input)) {
|
|
113293
|
+
return false;
|
|
113294
|
+
}
|
|
113295
|
+
return true;
|
|
113296
|
+
}
|
|
113258
113297
|
function client_isStringValidForKind(input, kind) {
|
|
113259
113298
|
if (input === '') {
|
|
113260
113299
|
return true;
|
|
@@ -113287,7 +113326,8 @@ const client_ASN1CheckUtilities = {
|
|
|
113287
113326
|
isASN1Set: client_isASN1Set,
|
|
113288
113327
|
isASN1ContextTag: client_isASN1ContextTag,
|
|
113289
113328
|
isASN1BitString: client_isASN1BitString,
|
|
113290
|
-
isASN1Date: client_isASN1Date
|
|
113329
|
+
isASN1Date: client_isASN1Date,
|
|
113330
|
+
isASN1Struct: client_isASN1Struct
|
|
113291
113331
|
};
|
|
113292
113332
|
|
|
113293
113333
|
/**
|
|
@@ -113465,6 +113505,21 @@ function client_jsJStoASN1(input, allowUndefined) {
|
|
|
113465
113505
|
constructedObject.valueBlock.value.push(client_jsJStoASN1(input.contains));
|
|
113466
113506
|
return constructedObject;
|
|
113467
113507
|
}
|
|
113508
|
+
} else if (client_isASN1Struct(input)) {
|
|
113509
|
+
/* Structs are encoded as sequences */
|
|
113510
|
+
const structContainer = new client_Sequence();
|
|
113511
|
+
if (input.fieldNames === undefined) {
|
|
113512
|
+
throw new Error('internal error: ASN1Struct is missing fieldNames');
|
|
113513
|
+
}
|
|
113514
|
+
for (const fieldName of input.fieldNames) {
|
|
113515
|
+
const fieldValue = input.contains[fieldName];
|
|
113516
|
+
if (fieldValue === undefined) {
|
|
113517
|
+
/* Skip over undefined values, they should be "optional" in the schema */
|
|
113518
|
+
continue;
|
|
113519
|
+
}
|
|
113520
|
+
structContainer.valueBlock.value.push(client_jsJStoASN1(fieldValue, true));
|
|
113521
|
+
}
|
|
113522
|
+
return structContainer;
|
|
113468
113523
|
} else if (typeof input === 'string') {
|
|
113469
113524
|
if (client_isStringValidForKind(input, 'printable')) {
|
|
113470
113525
|
return new client_PrintableString({
|
|
@@ -113762,6 +113817,39 @@ const {
|
|
|
113762
113817
|
|
|
113763
113818
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
113764
113819
|
var client_schema = /*#__PURE__*/new WeakMap();
|
|
113820
|
+
/**
|
|
113821
|
+
* Helper class to validate ASN.1 values against schemas
|
|
113822
|
+
*
|
|
113823
|
+
* Some schemas are basic types, others are more complex
|
|
113824
|
+
* Basic types are defined as:
|
|
113825
|
+
* - {@link ValidateASN1.IsAny}
|
|
113826
|
+
* - {@link ValidateASN1.IsUnknown}
|
|
113827
|
+
* - {@link ValidateASN1.IsDate}
|
|
113828
|
+
* - {@link ValidateASN1.IsAnyDate}
|
|
113829
|
+
* - {@link ValidateASN1.IsString}
|
|
113830
|
+
* - {@link ValidateASN1.IsAnyString}
|
|
113831
|
+
* - {@link ValidateASN1.IsOctetString}
|
|
113832
|
+
* - {@link ValidateASN1.IsBitString}
|
|
113833
|
+
* - {@link ValidateASN1.IsInteger}
|
|
113834
|
+
* - {@link ValidateASN1.IsBoolean}
|
|
113835
|
+
* - {@link ValidateASN1.IsOID}
|
|
113836
|
+
* - {@link ValidateASN1.IsSet}
|
|
113837
|
+
* - {@link ValidateASN1.IsNull}
|
|
113838
|
+
*
|
|
113839
|
+
* More complex types are defined as:
|
|
113840
|
+
* - Choice: `{ choice: [ schema1, schema2, ... ] }`
|
|
113841
|
+
* - Sequence of: `{ sequenceOf: schema }`
|
|
113842
|
+
* - Optional: `{ optional: schema }`
|
|
113843
|
+
* - Context Tag: `{ type: 'context'; kind: 'implicit' | 'explicit'; contains: schema; value: number }`
|
|
113844
|
+
* - OID: `{ type: 'oid'; oid: string }`
|
|
113845
|
+
* - String: `{ type: 'string'; kind: 'printable' | 'ia5' | 'utf8' }`
|
|
113846
|
+
* - Date: `{ type: 'date'; kind: 'utc' | 'general' }`
|
|
113847
|
+
* - Fixed Integer: `bigint` (where the value is the exact integer required)
|
|
113848
|
+
* - Sequence: `[ schema1, schema2, ... ]` (a tuple where each item is a schema)
|
|
113849
|
+
*
|
|
113850
|
+
* - Lazy Schema: `() => schema` (a function that returns a schema, useful for
|
|
113851
|
+
* recursive schemas)
|
|
113852
|
+
*/
|
|
113765
113853
|
class client_ValidateASN1 {
|
|
113766
113854
|
/**
|
|
113767
113855
|
* Interpret an untagged type as a specific universal tag
|
|
@@ -113846,6 +113934,9 @@ class client_ValidateASN1 {
|
|
|
113846
113934
|
break;
|
|
113847
113935
|
case 'context':
|
|
113848
113936
|
throw new Error('not implemented: Cannot interpret untagged type as Context Tag yet');
|
|
113937
|
+
case 'struct':
|
|
113938
|
+
interpretTag = 16;
|
|
113939
|
+
break;
|
|
113849
113940
|
default:
|
|
113850
113941
|
client_assertNever(tag);
|
|
113851
113942
|
}
|
|
@@ -114095,6 +114186,37 @@ class client_ValidateASN1 {
|
|
|
114095
114186
|
}
|
|
114096
114187
|
needsMoreAnalysis = false;
|
|
114097
114188
|
break;
|
|
114189
|
+
case 'struct':
|
|
114190
|
+
{
|
|
114191
|
+
const outputStruct = {
|
|
114192
|
+
type: 'struct',
|
|
114193
|
+
fieldNames: schema.fieldNames,
|
|
114194
|
+
contains: {}
|
|
114195
|
+
};
|
|
114196
|
+
const schemaAsTuples = schema.fieldNames.map(function (fieldName) {
|
|
114197
|
+
return schema.contains[fieldName];
|
|
114198
|
+
});
|
|
114199
|
+
let valuesAsTuples;
|
|
114200
|
+
if (Array.isArray(input)) {
|
|
114201
|
+
valuesAsTuples = input;
|
|
114202
|
+
} else if (client_isASN1Struct(input)) {
|
|
114203
|
+
const x = input;
|
|
114204
|
+
valuesAsTuples = schema.fieldNames.map(function (fieldName) {
|
|
114205
|
+
return x.contains[fieldName];
|
|
114206
|
+
});
|
|
114207
|
+
} else {
|
|
114208
|
+
throw new Error(`Expected Array or Struct, got ${typeof input} --> ${JSON.stringify(client_debugPrintableObject(input))}`);
|
|
114209
|
+
}
|
|
114210
|
+
|
|
114211
|
+
// @ts-ignore
|
|
114212
|
+
const outputValuesTuples = client_ValidateASN1.againstSchema(valuesAsTuples, schemaAsTuples);
|
|
114213
|
+
schema.fieldNames.forEach(function (fieldName, index) {
|
|
114214
|
+
outputStruct.contains[fieldName] = outputValuesTuples[index];
|
|
114215
|
+
});
|
|
114216
|
+
|
|
114217
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
114218
|
+
return outputStruct;
|
|
114219
|
+
}
|
|
114098
114220
|
default:
|
|
114099
114221
|
client_assertNever(schema);
|
|
114100
114222
|
}
|
|
@@ -114218,18 +114340,63 @@ class client_ValidateASN1 {
|
|
|
114218
114340
|
* Does not handle all possible objects, but those used
|
|
114219
114341
|
* within the ASN1 encoder/decoder
|
|
114220
114342
|
*/
|
|
114343
|
+
/**
|
|
114344
|
+
* Validate that the tag is any valid ASN.1 type
|
|
114345
|
+
*/
|
|
114221
114346
|
client_asn1_defineProperty(client_ValidateASN1, "IsAny", Symbol('IsAny'));
|
|
114347
|
+
/**
|
|
114348
|
+
* Validate that the tag is any valid ASN.1 type, but do not
|
|
114349
|
+
* attempt to interpret it
|
|
114350
|
+
*/
|
|
114222
114351
|
client_asn1_defineProperty(client_ValidateASN1, "IsUnknown", Symbol('IsUnknown'));
|
|
114352
|
+
/**
|
|
114353
|
+
* Validate the tag is either a GeneralizedTime or UTCTime
|
|
114354
|
+
* depending on the value (i.e. before or after 2050)
|
|
114355
|
+
* as per RFC 5280
|
|
114356
|
+
*/
|
|
114223
114357
|
client_asn1_defineProperty(client_ValidateASN1, "IsDate", Symbol('IsDate'));
|
|
114358
|
+
/**
|
|
114359
|
+
* Validate the tag is either a GeneralizedTime or UTCTime
|
|
114360
|
+
*/
|
|
114224
114361
|
client_asn1_defineProperty(client_ValidateASN1, "IsAnyDate", Symbol('IsAnyDate'));
|
|
114362
|
+
/**
|
|
114363
|
+
* Validate that the tag is the least-requisite string type
|
|
114364
|
+
* (i.e. PrintableString, IA5String, or UTF8String) for
|
|
114365
|
+
* the value
|
|
114366
|
+
*/
|
|
114225
114367
|
client_asn1_defineProperty(client_ValidateASN1, "IsString", Symbol('IsString'));
|
|
114368
|
+
/**
|
|
114369
|
+
* Validate that the tag is any string type of PrintableString,
|
|
114370
|
+
* IA5String, or UTF8String
|
|
114371
|
+
*/
|
|
114226
114372
|
client_asn1_defineProperty(client_ValidateASN1, "IsAnyString", Symbol('IsAnyString'));
|
|
114373
|
+
/**
|
|
114374
|
+
* Validate that the tag is an OctetString
|
|
114375
|
+
*/
|
|
114227
114376
|
client_asn1_defineProperty(client_ValidateASN1, "IsOctetString", Symbol('IsOctetString'));
|
|
114377
|
+
/**
|
|
114378
|
+
* Validate that the tag is a BitString
|
|
114379
|
+
*/
|
|
114228
114380
|
client_asn1_defineProperty(client_ValidateASN1, "IsBitString", Symbol('IsBitString'));
|
|
114381
|
+
/**
|
|
114382
|
+
* Validate that the tag is an Integer
|
|
114383
|
+
*/
|
|
114229
114384
|
client_asn1_defineProperty(client_ValidateASN1, "IsInteger", Symbol('IsInteger'));
|
|
114385
|
+
/**
|
|
114386
|
+
* Validate that the tag is a Boolean
|
|
114387
|
+
*/
|
|
114230
114388
|
client_asn1_defineProperty(client_ValidateASN1, "IsBoolean", Symbol('IsBoolean'));
|
|
114389
|
+
/**
|
|
114390
|
+
* Validate that the tag is an Object Identifier (OID)
|
|
114391
|
+
*/
|
|
114231
114392
|
client_asn1_defineProperty(client_ValidateASN1, "IsOID", Symbol('IsOID'));
|
|
114393
|
+
/**
|
|
114394
|
+
* Validate that the tag is a Set
|
|
114395
|
+
*/
|
|
114232
114396
|
client_asn1_defineProperty(client_ValidateASN1, "IsSet", Symbol('IsSet'));
|
|
114397
|
+
/**
|
|
114398
|
+
* Validate that the tag is a Null
|
|
114399
|
+
*/
|
|
114233
114400
|
client_asn1_defineProperty(client_ValidateASN1, "IsNull", Symbol('IsNull'));
|
|
114234
114401
|
var client_data = /*#__PURE__*/new WeakMap();
|
|
114235
114402
|
/**
|
|
@@ -123374,7 +123541,7 @@ class src_client_VoteQuote extends src_client_VoteLikeBase {
|
|
|
123374
123541
|
throw new src_client_KeetaNetVoteError('VOTE_EXPIRED', `VoteQuote is expired (expired on ${this.validityTo.toISOString()}; issued on ${this.validityFrom.toISOString()}; moment: ${expirationCheckMomentISO})`);
|
|
123375
123542
|
}
|
|
123376
123543
|
if (!this.quote) {
|
|
123377
|
-
throw new src_client_KeetaNetVoteError('VOTE_FEE_NOT_QUOTE', `Tried to construct a quote but
|
|
123544
|
+
throw new src_client_KeetaNetVoteError('VOTE_FEE_NOT_QUOTE', `Tried to construct a quote but kind is not QUOTE`);
|
|
123378
123545
|
}
|
|
123379
123546
|
}
|
|
123380
123547
|
}
|
|
@@ -126782,17 +126949,29 @@ class client_LedgerAtomicInterface {
|
|
|
126782
126949
|
}
|
|
126783
126950
|
async getHistory(account, start) {
|
|
126784
126951
|
let limit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 25;
|
|
126785
|
-
|
|
126786
|
-
|
|
126787
|
-
|
|
126788
|
-
|
|
126789
|
-
const
|
|
126790
|
-
|
|
126791
|
-
|
|
126792
|
-
|
|
126793
|
-
|
|
126794
|
-
|
|
126795
|
-
|
|
126952
|
+
try {
|
|
126953
|
+
var _transaction$node, _transaction$node2;
|
|
126954
|
+
var _usingCtx = src_client_usingCtx2();
|
|
126955
|
+
const transaction = client_ledger_assertClassBrand(client_LedgerAtomicInterface_brand, this, client_assertTransaction).call(this);
|
|
126956
|
+
const _getHistoryTiming = _usingCtx.u((_transaction$node = transaction.node) === null || _transaction$node === void 0 ? void 0 : _transaction$node.timing.startTime(`storage-getHistory`));
|
|
126957
|
+
const voteStapleHashes = await client_ledger_classPrivateFieldGet(client_ledger_storage, this).getHistory(transaction, account, start, limit);
|
|
126958
|
+
_getHistoryTiming === null || _getHistoryTiming === void 0 || _getHistoryTiming.end();
|
|
126959
|
+
const _getVoteStaplesTiming = _usingCtx.u((_transaction$node2 = transaction.node) === null || _transaction$node2 === void 0 ? void 0 : _transaction$node2.timing.startTime(`storage-getVoteStaples`));
|
|
126960
|
+
const voteStaplesMap = await this.getVoteStaples(voteStapleHashes, 'main');
|
|
126961
|
+
_getVoteStaplesTiming === null || _getVoteStaplesTiming === void 0 || _getVoteStaplesTiming.end();
|
|
126962
|
+
const voteStaples = voteStapleHashes.map(function (voteStapleHash) {
|
|
126963
|
+
const voteStaple = voteStaplesMap.get(voteStapleHash);
|
|
126964
|
+
if (voteStaple === undefined || voteStaple === null) {
|
|
126965
|
+
throw new Error(`internal error: missing vote staple for ${voteStapleHash}`);
|
|
126966
|
+
}
|
|
126967
|
+
return voteStaple;
|
|
126968
|
+
});
|
|
126969
|
+
return voteStaples;
|
|
126970
|
+
} catch (_) {
|
|
126971
|
+
_usingCtx.e = _;
|
|
126972
|
+
} finally {
|
|
126973
|
+
_usingCtx.d();
|
|
126974
|
+
}
|
|
126796
126975
|
}
|
|
126797
126976
|
async getStaplesFromBlockHashes(hashes) {
|
|
126798
126977
|
const transaction = client_ledger_assertClassBrand(client_LedgerAtomicInterface_brand, this, client_assertTransaction).call(this);
|
|
@@ -127482,8 +127661,8 @@ class src_client_Ledger {
|
|
|
127482
127661
|
async run(identifier, code, readOnly) {
|
|
127483
127662
|
try {
|
|
127484
127663
|
var _this$node, _classPrivateFieldGet8, _classPrivateFieldGet9, _this$node4;
|
|
127485
|
-
var
|
|
127486
|
-
const _timing =
|
|
127664
|
+
var _usingCtx3 = src_client_usingCtx2();
|
|
127665
|
+
const _timing = _usingCtx3.u((_this$node = this.node) === null || _this$node === void 0 ? void 0 : _this$node.timing.startTime(`run-${identifier}`));
|
|
127487
127666
|
let retryConfig;
|
|
127488
127667
|
if (((_classPrivateFieldGet8 = client_ledger_classPrivateFieldGet(src_client_config, this).transactionRetries) === null || _classPrivateFieldGet8 === void 0 ? void 0 : _classPrivateFieldGet8.maxRetries) !== undefined) {
|
|
127489
127668
|
retryConfig = {
|
|
@@ -127565,9 +127744,9 @@ class src_client_Ledger {
|
|
|
127565
127744
|
(_this$node4 = this.node) === null || _this$node4 === void 0 || _this$node4.stats.incr('ledger', 'dbRetries', retryCount);
|
|
127566
127745
|
return retval;
|
|
127567
127746
|
} catch (_) {
|
|
127568
|
-
|
|
127747
|
+
_usingCtx3.e = _;
|
|
127569
127748
|
} finally {
|
|
127570
|
-
|
|
127749
|
+
_usingCtx3.d();
|
|
127571
127750
|
}
|
|
127572
127751
|
}
|
|
127573
127752
|
async runReadOnly(identifier, code) {
|
|
@@ -127656,152 +127835,152 @@ class src_client_Ledger {
|
|
|
127656
127835
|
});
|
|
127657
127836
|
}
|
|
127658
127837
|
async votingPower() {
|
|
127659
|
-
for (var
|
|
127660
|
-
args[
|
|
127838
|
+
for (var _len0 = arguments.length, args = new Array(_len0), _key0 = 0; _key0 < _len0; _key0++) {
|
|
127839
|
+
args[_key0] = arguments[_key0];
|
|
127661
127840
|
}
|
|
127662
127841
|
return await this.runReadOnly('db-votingPower', async function (transaction) {
|
|
127663
127842
|
return await transaction.votingPower(...args);
|
|
127664
127843
|
});
|
|
127665
127844
|
}
|
|
127666
127845
|
async getVotes() {
|
|
127667
|
-
for (var
|
|
127668
|
-
args[
|
|
127846
|
+
for (var _len1 = arguments.length, args = new Array(_len1), _key1 = 0; _key1 < _len1; _key1++) {
|
|
127847
|
+
args[_key1] = arguments[_key1];
|
|
127669
127848
|
}
|
|
127670
127849
|
return await this.runReadOnly('db-getVotes', async function (transaction) {
|
|
127671
127850
|
return await transaction.getVotes(...args);
|
|
127672
127851
|
});
|
|
127673
127852
|
}
|
|
127674
127853
|
async getVotesFromMultiplePrevious() {
|
|
127675
|
-
for (var
|
|
127676
|
-
args[
|
|
127854
|
+
for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
|
|
127855
|
+
args[_key10] = arguments[_key10];
|
|
127677
127856
|
}
|
|
127678
127857
|
return await this.runReadOnly('db-getVotesFromMultiplePrevious', async function (transaction) {
|
|
127679
127858
|
return await transaction.getVotesFromMultiplePrevious(...args);
|
|
127680
127859
|
});
|
|
127681
127860
|
}
|
|
127682
127861
|
async getBlockFromPrevious() {
|
|
127683
|
-
for (var
|
|
127684
|
-
args[
|
|
127862
|
+
for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
|
|
127863
|
+
args[_key11] = arguments[_key11];
|
|
127685
127864
|
}
|
|
127686
127865
|
return await this.runReadOnly('db-getBlockFromPrevious', async function (transaction) {
|
|
127687
127866
|
return await transaction.getBlockFromPrevious(...args);
|
|
127688
127867
|
});
|
|
127689
127868
|
}
|
|
127690
127869
|
async getHeadBlocks() {
|
|
127691
|
-
for (var
|
|
127692
|
-
args[
|
|
127870
|
+
for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
|
|
127871
|
+
args[_key12] = arguments[_key12];
|
|
127693
127872
|
}
|
|
127694
127873
|
return await this.runReadOnly('db-getHeadBlocks', async function (transaction) {
|
|
127695
127874
|
return await transaction.getHeadBlocks(...args);
|
|
127696
127875
|
});
|
|
127697
127876
|
}
|
|
127698
127877
|
async getHeadBlock() {
|
|
127699
|
-
for (var
|
|
127700
|
-
args[
|
|
127878
|
+
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
|
|
127879
|
+
args[_key13] = arguments[_key13];
|
|
127701
127880
|
}
|
|
127702
127881
|
return await this.runReadOnly('db-getHeadBlock', async function (transaction) {
|
|
127703
127882
|
return await transaction.getHeadBlock(...args);
|
|
127704
127883
|
});
|
|
127705
127884
|
}
|
|
127706
127885
|
async getAccountRep() {
|
|
127707
|
-
for (var
|
|
127708
|
-
args[
|
|
127886
|
+
for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
|
|
127887
|
+
args[_key14] = arguments[_key14];
|
|
127709
127888
|
}
|
|
127710
127889
|
return await this.runReadOnly('db-getAccountRep', async function (transaction) {
|
|
127711
127890
|
return await transaction.getAccountRep(...args);
|
|
127712
127891
|
});
|
|
127713
127892
|
}
|
|
127714
127893
|
async getAccountInfo() {
|
|
127715
|
-
for (var
|
|
127716
|
-
args[
|
|
127894
|
+
for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
|
|
127895
|
+
args[_key15] = arguments[_key15];
|
|
127717
127896
|
}
|
|
127718
127897
|
return await this.runReadOnly('db-getAccountInfo', async function (transaction) {
|
|
127719
127898
|
return await transaction.getAccountInfo(...args);
|
|
127720
127899
|
});
|
|
127721
127900
|
}
|
|
127722
127901
|
async getBlock() {
|
|
127723
|
-
for (var
|
|
127724
|
-
args[
|
|
127902
|
+
for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {
|
|
127903
|
+
args[_key16] = arguments[_key16];
|
|
127725
127904
|
}
|
|
127726
127905
|
return await this.runReadOnly('db-getBlock', async function (transaction) {
|
|
127727
127906
|
return await transaction.getBlock(...args);
|
|
127728
127907
|
});
|
|
127729
127908
|
}
|
|
127730
127909
|
async getAccountsBlockHeightInfo() {
|
|
127731
|
-
for (var
|
|
127732
|
-
args[
|
|
127910
|
+
for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) {
|
|
127911
|
+
args[_key17] = arguments[_key17];
|
|
127733
127912
|
}
|
|
127734
127913
|
return await this.runReadOnly('db-getAccountsBlockHeightInfo', async function (transaction) {
|
|
127735
127914
|
return await transaction.getAccountsBlockHeightInfo(...args);
|
|
127736
127915
|
});
|
|
127737
127916
|
}
|
|
127738
127917
|
async getVoteStaple() {
|
|
127739
|
-
for (var
|
|
127740
|
-
args[
|
|
127918
|
+
for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) {
|
|
127919
|
+
args[_key18] = arguments[_key18];
|
|
127741
127920
|
}
|
|
127742
127921
|
return await this.runReadOnly('db-getVoteStaple', async function (transaction) {
|
|
127743
127922
|
return await transaction.getVoteStaple(...args);
|
|
127744
127923
|
});
|
|
127745
127924
|
}
|
|
127746
127925
|
async getVoteStaples() {
|
|
127747
|
-
for (var
|
|
127748
|
-
args[
|
|
127926
|
+
for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) {
|
|
127927
|
+
args[_key19] = arguments[_key19];
|
|
127749
127928
|
}
|
|
127750
127929
|
return await this.runReadOnly('db-getVoteStaples', async function (transaction) {
|
|
127751
127930
|
return await transaction.getVoteStaples(...args);
|
|
127752
127931
|
});
|
|
127753
127932
|
}
|
|
127754
127933
|
async getHistory() {
|
|
127755
|
-
for (var
|
|
127756
|
-
args[
|
|
127934
|
+
for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) {
|
|
127935
|
+
args[_key20] = arguments[_key20];
|
|
127757
127936
|
}
|
|
127758
127937
|
return await this.runReadOnly('db-getHistory', async function (transaction) {
|
|
127759
127938
|
return await transaction.getHistory(...args);
|
|
127760
127939
|
});
|
|
127761
127940
|
}
|
|
127762
127941
|
async getStaplesFromBlockHashes() {
|
|
127763
|
-
for (var
|
|
127764
|
-
args[
|
|
127942
|
+
for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) {
|
|
127943
|
+
args[_key21] = arguments[_key21];
|
|
127765
127944
|
}
|
|
127766
127945
|
return await this.runReadOnly('db-getStaplesFromBlockHashes', async function (transaction) {
|
|
127767
127946
|
return await transaction.getStaplesFromBlockHashes(...args);
|
|
127768
127947
|
});
|
|
127769
127948
|
}
|
|
127770
127949
|
async getVoteStaplesAfter() {
|
|
127771
|
-
for (var
|
|
127772
|
-
args[
|
|
127950
|
+
for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {
|
|
127951
|
+
args[_key22] = arguments[_key22];
|
|
127773
127952
|
}
|
|
127774
127953
|
return await this.runReadOnly('db-getVoteStaplesAfter', async function (transaction) {
|
|
127775
127954
|
return await transaction.getVoteStaplesAfter(...args);
|
|
127776
127955
|
});
|
|
127777
127956
|
}
|
|
127778
127957
|
async gc() {
|
|
127779
|
-
for (var
|
|
127780
|
-
args[
|
|
127958
|
+
for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) {
|
|
127959
|
+
args[_key23] = arguments[_key23];
|
|
127781
127960
|
}
|
|
127782
127961
|
return await this.run('db-gc', async function (transaction) {
|
|
127783
127962
|
return await transaction.gc(...args);
|
|
127784
127963
|
});
|
|
127785
127964
|
}
|
|
127786
127965
|
async getFee() {
|
|
127787
|
-
for (var
|
|
127788
|
-
args[
|
|
127966
|
+
for (var _len24 = arguments.length, args = new Array(_len24), _key24 = 0; _key24 < _len24; _key24++) {
|
|
127967
|
+
args[_key24] = arguments[_key24];
|
|
127789
127968
|
}
|
|
127790
127969
|
return await this.runReadOnly('db-getFee', async function (transaction) {
|
|
127791
127970
|
return await transaction.getFee(...args);
|
|
127792
127971
|
});
|
|
127793
127972
|
}
|
|
127794
127973
|
async getIdempotentBlockHash() {
|
|
127795
|
-
for (var
|
|
127796
|
-
args[
|
|
127974
|
+
for (var _len25 = arguments.length, args = new Array(_len25), _key25 = 0; _key25 < _len25; _key25++) {
|
|
127975
|
+
args[_key25] = arguments[_key25];
|
|
127797
127976
|
}
|
|
127798
127977
|
return await this.runReadOnly('db-getIdempotentBlockHash', async function (transaction) {
|
|
127799
127978
|
return await transaction.getIdempotentBlockHash(...args);
|
|
127800
127979
|
});
|
|
127801
127980
|
}
|
|
127802
127981
|
async getBlockFromIdempotent() {
|
|
127803
|
-
for (var
|
|
127804
|
-
args[
|
|
127982
|
+
for (var _len26 = arguments.length, args = new Array(_len26), _key26 = 0; _key26 < _len26; _key26++) {
|
|
127983
|
+
args[_key26] = arguments[_key26];
|
|
127805
127984
|
}
|
|
127806
127985
|
return await this.runReadOnly('db-getBlockFromIdempotent', async function (transaction) {
|
|
127807
127986
|
return await transaction.getBlockFromIdempotent(...args);
|
|
@@ -127810,14 +127989,14 @@ class src_client_Ledger {
|
|
|
127810
127989
|
async stats() {
|
|
127811
127990
|
try {
|
|
127812
127991
|
var _this$node5;
|
|
127813
|
-
var
|
|
127814
|
-
const _timing =
|
|
127992
|
+
var _usingCtx4 = src_client_usingCtx2();
|
|
127993
|
+
const _timing = _usingCtx4.u((_this$node5 = this.node) === null || _this$node5 === void 0 ? void 0 : _this$node5.timing.startTime('db-stats'));
|
|
127815
127994
|
const retval = await client_ledger_classPrivateFieldGet(client_storage2, this).stats();
|
|
127816
127995
|
return retval;
|
|
127817
127996
|
} catch (_) {
|
|
127818
|
-
|
|
127997
|
+
_usingCtx4.e = _;
|
|
127819
127998
|
} finally {
|
|
127820
|
-
|
|
127999
|
+
_usingCtx4.d();
|
|
127821
128000
|
}
|
|
127822
128001
|
}
|
|
127823
128002
|
async _testingRunStorageFunction(code) {
|
|
@@ -127833,7 +128012,7 @@ client_lib_ledger_defineProperty(src_client_Ledger, "isInstance", client_checkab
|
|
|
127833
128012
|
// EXTERNAL MODULE: ws (ignored)
|
|
127834
128013
|
var client_ws_ignored_ = __webpack_require__(4708);
|
|
127835
128014
|
;// ./src/version.ts
|
|
127836
|
-
const client_version = '0.14.
|
|
128015
|
+
const client_version = '0.14.9+gdb1185935886a43e4feda1919fa65830dc656174';
|
|
127837
128016
|
/* harmony default export */ const client_src_version = ((/* unused pure expression or super */ null && (client_version)));
|
|
127838
128017
|
;// ./src/lib/p2p.ts
|
|
127839
128018
|
/* provided dependency */ var client_p2p_Buffer = __webpack_require__(8287)["Buffer"];
|