@keetanetwork/keetanet-client 0.14.10 → 0.14.11
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/index-browser.js +40 -12
- package/client/index.js +37 -9
- 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.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.KeetaNetError.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetErrorBase.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetLedgerError.html +2 -2
- 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/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/modules/KeetaNetSDK.Referenced.src_lib_utils_helper.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.FullLedgerBaseErrorCode.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.allFullErrorCodes.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_helper.crypto.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_helper.util.html +1 -0
- package/lib/error/index.d.ts +1 -1
- package/lib/error/ledger.d.ts +3 -3
- package/lib/log/index.d.ts +2 -2
- package/lib/utils/helper.d.ts +7 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/version.d.ts +1 -1
package/client/index-browser.js
CHANGED
|
@@ -101243,6 +101243,7 @@ __webpack_require__.d(client_helper_namespaceObject, {
|
|
|
101243
101243
|
randomInt: () => (client_randomInt),
|
|
101244
101244
|
randomString: () => (client_randomString),
|
|
101245
101245
|
setGenerator: () => (client_setGenerator),
|
|
101246
|
+
util: () => (client_helper_util),
|
|
101246
101247
|
validateBase64ToBuffer: () => (client_validateBase64ToBuffer),
|
|
101247
101248
|
waitTicks: () => (client_waitTicks)
|
|
101248
101249
|
});
|
|
@@ -105947,7 +105948,13 @@ const client_helper_crypto = {
|
|
|
105947
105948
|
randomUUID: client_helper_randomUUID,
|
|
105948
105949
|
randomBytes: client_helper_randomBytes,
|
|
105949
105950
|
createCipheriv: client_crypto_default().createCipheriv.bind((client_crypto_default())),
|
|
105950
|
-
createDecipheriv: client_crypto_default().createDecipheriv.bind((client_crypto_default()))
|
|
105951
|
+
createDecipheriv: client_crypto_default().createDecipheriv.bind((client_crypto_default())),
|
|
105952
|
+
createHash: client_crypto_default().createHash.bind((client_crypto_default())),
|
|
105953
|
+
createHmac: client_crypto_default().createHmac.bind((client_crypto_default()))
|
|
105954
|
+
};
|
|
105955
|
+
const client_helper_util = {
|
|
105956
|
+
inspect: client_util.inspect,
|
|
105957
|
+
types: client_util.types
|
|
105951
105958
|
};
|
|
105952
105959
|
;// ./node_modules/rfc4648/lib/rfc4648.js
|
|
105953
105960
|
/* eslint-disable @typescript-eslint/strict-boolean-expressions */
|
|
@@ -116914,7 +116921,7 @@ function client_ledger_toPrimitive(t, r) { if ("object" != typeof t || !t) retur
|
|
|
116914
116921
|
const client_LedgerErrorType = 'LEDGER';
|
|
116915
116922
|
const client_LedgerBaseErrorCodes = ['BLOCK_ALREADY_EXISTS', 'BLOCK_EXPIRED', 'TRANSACTION_ABORTED', 'INVALID_CHAIN', 'INVALID_NETWORK', 'INVALID_SUBNET', 'INVALID_PERMISSIONS', 'INVALID_OWNER_COUNT', 'INVALID_BALANCE', 'INVALID_SET_REP', 'OPERATION_NOT_SUPPORTED', 'NOT_EMPTY', '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', 'TEMP_VOTE_INCLUDES_SELF', 'BLOCKS_DIFFER_FROM_VOTED_ON', 'NO_PERM_WITHOUT_SELF_TEMP', 'DUPLICATE_VOTE_ISSUER_FOUND', 'OTHER', 'MISSING_BLOCKS',
|
|
116916
116923
|
// Fee Errors
|
|
116917
|
-
'FEE_AMOUNT_MISMATCH', 'FEE_TOKEN_MISMATCH', 'FEE_MISSING', 'MISSING_REQUIRED_FEE_BLOCK', 'VOTE_WITH_QUOTE', 'QUOTE_MISMATCH', 'REQUIRED_FEE_MISMATCH'];
|
|
116924
|
+
'FEE_AMOUNT_MISMATCH', 'FEE_TOKEN_MISMATCH', 'FEE_MISSING', 'MISSING_REQUIRED_FEE_BLOCK', 'MULTIPLE_FEE_BLOCK', 'VOTE_WITH_QUOTE', 'QUOTE_MISMATCH', 'REQUIRED_FEE_MISMATCH'];
|
|
116918
116925
|
|
|
116919
116926
|
// Errors that can trigger rep sync
|
|
116920
116927
|
const client_LedgerVoteErrorCodes = ['NOT_SUCCESSOR', 'NOT_OPENING'];
|
|
@@ -126564,6 +126571,9 @@ class client_LedgerAtomicInterface {
|
|
|
126564
126571
|
if (blocks.length === 0) {
|
|
126565
126572
|
throw new client_ledger_KeetaNetLedgerError('LEDGER_MISSING_BLOCKS', 'At least one block is required to issue a vote');
|
|
126566
126573
|
}
|
|
126574
|
+
if (blocks[0].purpose === src_client_Block.Purpose.FEE) {
|
|
126575
|
+
throw new client_ledger_KeetaNetLedgerError('LEDGER_MISSING_BLOCKS', 'First block cannot be a fee block');
|
|
126576
|
+
}
|
|
126567
126577
|
if (!client_ledger_classPrivateFieldGet(client_ledger_privateKey, this)) {
|
|
126568
126578
|
throw new Error('Cannot vote on block, no private key loaded');
|
|
126569
126579
|
}
|
|
@@ -126622,7 +126632,16 @@ class client_LedgerAtomicInterface {
|
|
|
126622
126632
|
const possibleFeeBlock = blocks.at(-1);
|
|
126623
126633
|
if ((possibleFeeBlock === null || possibleFeeBlock === void 0 ? void 0 : possibleFeeBlock.purpose) === client_BlockPurpose.FEE) {
|
|
126624
126634
|
hasFeeBlock = true;
|
|
126625
|
-
|
|
126635
|
+
/**
|
|
126636
|
+
* If permanent votes were provided then all votes should include the fee block
|
|
126637
|
+
* So only decrement block count if otherVotes are all temporary votes
|
|
126638
|
+
*/
|
|
126639
|
+
const otherVotesAllTemporary = !otherVotes.some(function (checkVote) {
|
|
126640
|
+
return checkVote.$permanent;
|
|
126641
|
+
});
|
|
126642
|
+
if (otherVotesAllTemporary) {
|
|
126643
|
+
blockCount--;
|
|
126644
|
+
}
|
|
126626
126645
|
}
|
|
126627
126646
|
const requiredFees = new Map();
|
|
126628
126647
|
for (const checkVote of otherVotes) {
|
|
@@ -126649,13 +126668,9 @@ class client_LedgerAtomicInterface {
|
|
|
126649
126668
|
throw new client_ledger_KeetaNetLedgerError('LEDGER_CANNOT_EXCHANGE_PERM_VOTE', 'Asked to exchange a permanent vote from us for a permanent vote from us');
|
|
126650
126669
|
}
|
|
126651
126670
|
}
|
|
126652
|
-
|
|
126653
|
-
/* XXX:TODO: Need to account for fee blocks if the input is a permanent vote */
|
|
126654
126671
|
let blocksDifferFromVoteBlocks = checkVote.blocks.length !== blockCount;
|
|
126655
|
-
|
|
126656
126672
|
/* If they do not differ from length alone, compare block hashes */
|
|
126657
126673
|
if (!blocksDifferFromVoteBlocks) {
|
|
126658
|
-
/* XXX:TODO: Need to account for fee blocks if the input is a permanent vote */
|
|
126659
126674
|
for (let blockIndex = 0; blockIndex < blockCount; blockIndex++) {
|
|
126660
126675
|
if (!blocks[blockIndex].hash.compareHexString(checkVote.blocks[blockIndex])) {
|
|
126661
126676
|
blocksDifferFromVoteBlocks = true;
|
|
@@ -127584,7 +127599,15 @@ async function client_validateBlocksForVote(blocks) {
|
|
|
127584
127599
|
const allLedgerHeads = new Map();
|
|
127585
127600
|
const allLedgerIdempotentKeys = new Map();
|
|
127586
127601
|
const allLedgerIdempotentKeysReverse = new Map();
|
|
127602
|
+
let foundFeeBlock = false;
|
|
127587
127603
|
for (const block of blocks) {
|
|
127604
|
+
if (block.purpose === src_client_Block.Purpose.FEE) {
|
|
127605
|
+
if (foundFeeBlock) {
|
|
127606
|
+
throw new client_ledger_KeetaNetLedgerError('LEDGER_MULTIPLE_FEE_BLOCK', 'Should only contain 1 fee block');
|
|
127607
|
+
} else {
|
|
127608
|
+
foundFeeBlock = true;
|
|
127609
|
+
}
|
|
127610
|
+
}
|
|
127588
127611
|
const prevBlockHash = block.previous;
|
|
127589
127612
|
seenBlockHashes.add(block.hash);
|
|
127590
127613
|
if (block.network !== client_ledger_classPrivateFieldGet(client_network, this)) {
|
|
@@ -127641,7 +127664,7 @@ async function client_validateBlocksForVote(blocks) {
|
|
|
127641
127664
|
};
|
|
127642
127665
|
}
|
|
127643
127666
|
async function client_voteOrQuoteWithFees(blocks, type, quote, options) {
|
|
127644
|
-
var _options$requireBlock
|
|
127667
|
+
var _options$requireBlock;
|
|
127645
127668
|
if (client_ledger_classPrivateFieldGet(client_ledger, this).ledgerWriteMode !== 'read-write') {
|
|
127646
127669
|
throw new Error(`May not issue votes in read-only mode, in ${client_ledger_classPrivateFieldGet(client_ledger, this).ledgerWriteMode} mode`);
|
|
127647
127670
|
}
|
|
@@ -127691,10 +127714,15 @@ async function client_voteOrQuoteWithFees(blocks, type, quote, options) {
|
|
|
127691
127714
|
|
|
127692
127715
|
/**
|
|
127693
127716
|
* If a quote was provided use it as the fee, otherwise generate new fee
|
|
127717
|
+
* If we are creating a vote with permanent `otherVotes` then do not include the fee.
|
|
127718
|
+
* TODO - considering changing how fees are handled when recovering
|
|
127694
127719
|
*/
|
|
127695
|
-
|
|
127696
|
-
|
|
127697
|
-
|
|
127720
|
+
if (requireBlockTimestampCheck) {
|
|
127721
|
+
var _quote$fee;
|
|
127722
|
+
const fee = (_quote$fee = quote === null || quote === void 0 ? void 0 : quote.fee) !== null && _quote$fee !== void 0 ? _quote$fee : await this.getFee(blocks, effects);
|
|
127723
|
+
if (fee !== null) {
|
|
127724
|
+
builder.addFee(fee);
|
|
127725
|
+
}
|
|
127698
127726
|
}
|
|
127699
127727
|
const voteOrQuote = await builder.seal(serial, pendingVoteExpiry);
|
|
127700
127728
|
return voteOrQuote;
|
|
@@ -128122,7 +128150,7 @@ client_lib_ledger_defineProperty(src_client_Ledger, "isInstance", client_checkab
|
|
|
128122
128150
|
// EXTERNAL MODULE: ws (ignored)
|
|
128123
128151
|
var client_ws_ignored_ = __webpack_require__(4708);
|
|
128124
128152
|
;// ./src/version.ts
|
|
128125
|
-
const client_version = '0.14.
|
|
128153
|
+
const client_version = '0.14.11+gfb27e304d06f586fd5f3532fae4f1504a46d359b';
|
|
128126
128154
|
/* harmony default export */ const client_src_version = ((/* unused pure expression or super */ null && (client_version)));
|
|
128127
128155
|
;// ./src/lib/p2p.ts
|
|
128128
128156
|
/* provided dependency */ var client_p2p_Buffer = __webpack_require__(8287)["Buffer"];
|
package/client/index.js
CHANGED
|
@@ -65849,6 +65849,7 @@ exports.LedgerBaseErrorCodes = [
|
|
|
65849
65849
|
'FEE_TOKEN_MISMATCH',
|
|
65850
65850
|
'FEE_MISSING',
|
|
65851
65851
|
'MISSING_REQUIRED_FEE_BLOCK',
|
|
65852
|
+
'MULTIPLE_FEE_BLOCK',
|
|
65852
65853
|
'VOTE_WITH_QUOTE',
|
|
65853
65854
|
'QUOTE_MISMATCH',
|
|
65854
65855
|
'REQUIRED_FEE_MISMATCH'
|
|
@@ -68115,6 +68116,9 @@ class LedgerAtomicInterface {
|
|
|
68115
68116
|
if (blocks.length === 0) {
|
|
68116
68117
|
throw (new ledger_1.KeetaNetLedgerError('LEDGER_MISSING_BLOCKS', 'At least one block is required to issue a vote'));
|
|
68117
68118
|
}
|
|
68119
|
+
if (blocks[0].purpose === block_1.Block.Purpose.FEE) {
|
|
68120
|
+
throw (new ledger_1.KeetaNetLedgerError('LEDGER_MISSING_BLOCKS', 'First block cannot be a fee block'));
|
|
68121
|
+
}
|
|
68118
68122
|
if (!__classPrivateFieldGet(this, _LedgerAtomicInterface_privateKey, "f")) {
|
|
68119
68123
|
throw (new Error('Cannot vote on block, no private key loaded'));
|
|
68120
68124
|
}
|
|
@@ -68171,7 +68175,14 @@ class LedgerAtomicInterface {
|
|
|
68171
68175
|
const possibleFeeBlock = blocks.at(-1);
|
|
68172
68176
|
if (possibleFeeBlock?.purpose === block_1.BlockPurpose.FEE) {
|
|
68173
68177
|
hasFeeBlock = true;
|
|
68174
|
-
|
|
68178
|
+
/**
|
|
68179
|
+
* If permanent votes were provided then all votes should include the fee block
|
|
68180
|
+
* So only decrement block count if otherVotes are all temporary votes
|
|
68181
|
+
*/
|
|
68182
|
+
const otherVotesAllTemporary = !otherVotes.some(function (checkVote) { return (checkVote.$permanent); });
|
|
68183
|
+
if (otherVotesAllTemporary) {
|
|
68184
|
+
blockCount--;
|
|
68185
|
+
}
|
|
68175
68186
|
}
|
|
68176
68187
|
const requiredFees = new Map();
|
|
68177
68188
|
for (const checkVote of otherVotes) {
|
|
@@ -68197,11 +68208,9 @@ class LedgerAtomicInterface {
|
|
|
68197
68208
|
throw (new ledger_1.KeetaNetLedgerError('LEDGER_CANNOT_EXCHANGE_PERM_VOTE', 'Asked to exchange a permanent vote from us for a permanent vote from us'));
|
|
68198
68209
|
}
|
|
68199
68210
|
}
|
|
68200
|
-
/* XXX:TODO: Need to account for fee blocks if the input is a permanent vote */
|
|
68201
68211
|
let blocksDifferFromVoteBlocks = checkVote.blocks.length !== blockCount;
|
|
68202
68212
|
/* If they do not differ from length alone, compare block hashes */
|
|
68203
68213
|
if (!blocksDifferFromVoteBlocks) {
|
|
68204
|
-
/* XXX:TODO: Need to account for fee blocks if the input is a permanent vote */
|
|
68205
68214
|
for (let blockIndex = 0; blockIndex < blockCount; blockIndex++) {
|
|
68206
68215
|
if (!blocks[blockIndex].hash.compareHexString(checkVote.blocks[blockIndex])) {
|
|
68207
68216
|
blocksDifferFromVoteBlocks = true;
|
|
@@ -69032,7 +69041,16 @@ async function _LedgerAtomicInterface_validateLedgerOutcome(blocks) {
|
|
|
69032
69041
|
const allLedgerHeads = new Map();
|
|
69033
69042
|
const allLedgerIdempotentKeys = new Map();
|
|
69034
69043
|
const allLedgerIdempotentKeysReverse = new Map();
|
|
69044
|
+
let foundFeeBlock = false;
|
|
69035
69045
|
for (const block of blocks) {
|
|
69046
|
+
if (block.purpose === block_1.Block.Purpose.FEE) {
|
|
69047
|
+
if (foundFeeBlock) {
|
|
69048
|
+
throw (new ledger_1.KeetaNetLedgerError('LEDGER_MULTIPLE_FEE_BLOCK', 'Should only contain 1 fee block'));
|
|
69049
|
+
}
|
|
69050
|
+
else {
|
|
69051
|
+
foundFeeBlock = true;
|
|
69052
|
+
}
|
|
69053
|
+
}
|
|
69036
69054
|
const prevBlockHash = block.previous;
|
|
69037
69055
|
seenBlockHashes.add(block.hash);
|
|
69038
69056
|
if (block.network !== __classPrivateFieldGet(this, _LedgerAtomicInterface_network, "f")) {
|
|
@@ -69129,10 +69147,14 @@ async function _LedgerAtomicInterface_validateLedgerOutcome(blocks) {
|
|
|
69129
69147
|
}
|
|
69130
69148
|
/**
|
|
69131
69149
|
* If a quote was provided use it as the fee, otherwise generate new fee
|
|
69150
|
+
* If we are creating a vote with permanent `otherVotes` then do not include the fee.
|
|
69151
|
+
* TODO - considering changing how fees are handled when recovering
|
|
69132
69152
|
*/
|
|
69133
|
-
|
|
69134
|
-
|
|
69135
|
-
|
|
69153
|
+
if (requireBlockTimestampCheck) {
|
|
69154
|
+
const fee = quote?.fee ?? await this.getFee(blocks, effects);
|
|
69155
|
+
if (fee !== null) {
|
|
69156
|
+
builder.addFee(fee);
|
|
69157
|
+
}
|
|
69136
69158
|
}
|
|
69137
69159
|
const voteOrQuote = await builder.seal(serial, pendingVoteExpiry);
|
|
69138
69160
|
return (voteOrQuote);
|
|
@@ -76825,7 +76847,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
76825
76847
|
};
|
|
76826
76848
|
var _AsyncDisposableStackPolyfill_instances, _AsyncDisposableStackPolyfill_toDispose, _AsyncDisposableStackPolyfill_validateNotDisposed, _a;
|
|
76827
76849
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
76828
|
-
exports.crypto = exports.AsyncDisposableStack = void 0;
|
|
76850
|
+
exports.util = exports.crypto = exports.AsyncDisposableStack = void 0;
|
|
76829
76851
|
exports.validateBase64ToBuffer = validateBase64ToBuffer;
|
|
76830
76852
|
exports.bufferToArrayBuffer = bufferToArrayBuffer;
|
|
76831
76853
|
exports.bufferToBigInt = bufferToBigInt;
|
|
@@ -77318,7 +77340,13 @@ exports.crypto = {
|
|
|
77318
77340
|
randomUUID: randomUUID,
|
|
77319
77341
|
randomBytes: randomBytes,
|
|
77320
77342
|
createCipheriv: crypto_1.default.createCipheriv.bind(crypto_1.default),
|
|
77321
|
-
createDecipheriv: crypto_1.default.createDecipheriv.bind(crypto_1.default)
|
|
77343
|
+
createDecipheriv: crypto_1.default.createDecipheriv.bind(crypto_1.default),
|
|
77344
|
+
createHash: crypto_1.default.createHash.bind(crypto_1.default),
|
|
77345
|
+
createHmac: crypto_1.default.createHmac.bind(crypto_1.default)
|
|
77346
|
+
};
|
|
77347
|
+
exports.util = {
|
|
77348
|
+
inspect: util_1.inspect,
|
|
77349
|
+
types: util_1.types
|
|
77322
77350
|
};
|
|
77323
77351
|
|
|
77324
77352
|
|
|
@@ -79106,7 +79134,7 @@ exports.Testing = { findRDN, blockHashesFromVote, feeFromVote };
|
|
|
79106
79134
|
|
|
79107
79135
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
79108
79136
|
exports.version = void 0;
|
|
79109
|
-
exports.version = '0.14.
|
|
79137
|
+
exports.version = '0.14.11+gfb27e304d06f586fd5f3532fae4f1504a46d359b';
|
|
79110
79138
|
exports["default"] = exports.version;
|
|
79111
79139
|
|
|
79112
79140
|
|
package/docs/assets/hierarchy.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
window.hierarchyData = "
|
|
1
|
+
window.hierarchyData = "eJy1m21zozYQx7+LX6spz4J759jcnZvEcW33Op3OjYfYikOPgAu4c5nOfffuAkkQGFsS9A2Xs6P//qSVxGpX+XeUJkmejT78SXXDJq5u64QaJiWuZnvwk6fhT5RQS7eJ6Zk2obptE8cw4Pds04RvDYdQz4XPXPjJ8TQPPnMMkKKgolsm/J4Gv6K5OjEoSFmGZRALBL+SUcoeI7bNwyQGhH9Huuk4+G8cPLPRh9GXJGerPDhEbERG38J4N/qgGy4ZHdMIvt1GQZax7OcbxvJgzvLV9OZqyR5ZyuIt2129N756yp8jUCgaQMM82/2Eaj+VH/wgI53qtGH31yM8FM0WbQWsuo7VsKpo8LItw7D0mq3rKNl++xxkTwoG39qKWHXr/lwcH6Iwe7o/lA5/NW3YzqvpMM5Z+hhsu63zGp0Ib0IFBkzeGsaEpXn4GG6DnCkOQUNBYCAs22i4uo8LuPYC1mHZ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