pshenmic-dpp 2.0.0-dev.4 → 2.0.0-dev.5
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/dist/binaries/bindingsTypes.d.ts +6 -2
- package/dist/binaries/pshenmic_dpp.android.node/x86_64/libpshenmic_dpp.so +0 -0
- package/dist/binaries/pshenmic_dpp.d.ts +1 -0
- package/dist/binaries/pshenmic_dpp.js +1 -1
- package/dist/binaries/wasm/wasmBytes.js +1 -1
- package/dist/binaries/wasm.d.ts +1 -0
- package/dist/binaries/wasm.js +1 -1
- package/dist/src/dpp/structs/IdentityPublicKey.d.ts +1 -0
- package/dist/src/dpp/structs/IdentityPublicKey.js +5 -0
- package/dist/src/dpp/structs/IdentityPublicKeyInCreation.d.ts +1 -0
- package/dist/src/dpp/structs/IdentityPublicKeyInCreation.js +5 -0
- package/dist/src/dpp/types.d.ts +6 -2
- package/dist/src/dpp/utils.js +1 -1
- package/dist/src/dpp/verify/Contested/verifyVotePollVoteStateProof.js +1 -1
- package/dist/src/dpp/verify/System/verifyEpochsInfoProof.js +1 -1
- package/dist/src/dpp/verify/Tokens/verifyTokenBalancesForIdentitiesProof.js +1 -1
- package/dist/src/dpp/verify/Tokens/verifyTokensBalancesForIdentityProof.js +1 -1
- package/package.json +1 -1
- package/tests/unit/DynamicValue.spec.ts +1 -0
package/dist/binaries/wasm.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export const IdentityNAPI: any;
|
|
|
64
64
|
export const IdentityPublicKeyInCreationNAPI: any;
|
|
65
65
|
export const IdentityPublicKeyNAPI: any;
|
|
66
66
|
export const IdentityTokenBalanceNAPI: any;
|
|
67
|
+
export const IdentityTokenBalanceOptionalNAPI: any;
|
|
67
68
|
export const IdentityTokenInfoNAPI: any;
|
|
68
69
|
export const IdentityTopUpFromAddressesTransitionNAPI: any;
|
|
69
70
|
export const IdentityTopUpTransitionNAPI: any;
|
package/dist/binaries/wasm.js
CHANGED
|
@@ -41,4 +41,4 @@ const wasm = instantiateNapiModuleSync(decompressSync(wasmBytes), {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
-
export const { verifyContractProof, verifyDocumentsProof, verifyEpochsInfoProof, verifyIdentifierByNonUniquePublicKeyHashProof, verifyIdentityBalanceProof, verifyIdentityByIdentifierProof, verifyIdentityByUniqueKeyHashProof, verifyIdentityContractNonceProof, verifyIdentityKeysByIdentifierProof, verifyIdentityNonceProof, verifySignatureDigest, verifyStateTransitionResult, verifyTokenBalancesForIdentitiesProof, verifyTokenContractInfoProof, verifyTokenDirectPurchasePrices, verifyTokensBalancesForIdentityProof, verifyTokenTotalSupplyProof, verifyTotalCreditsProof, verifyVotePollVoteStateProof, ActionTakerNAPI, AddressCreditWithdrawalTransitionNAPI, AddressFundingFromAssetLockTransitionNAPI, AddressFundsFeeStrategyStepNAPI, AddressFundsTransferTransitionNAPI, AddressWitnessNAPI, AssetLockProofNAPI, AuthorizedActionTakersNAPI, BatchedTransitionNAPI, BatchTransitionNAPI, BlockBasedDistributionNAPI, BlockInfoNAPI, ChainAssetLockProofNAPI, ChangeControlRulesNAPI, ConsensusErrorNAPI, ContenderWithSerializedDocumentNAPI, ContestedDocumentVotePollQueryExecutionResultNAPI, ContractBoundsNAPI, CoreScriptNAPI, DataContractCreateTransitionNAPI, DataContractNAPI, DataContractUpdateTransitionNAPI, DistributionFunctionNAPI, DocumentBaseTransitionNAPI, DocumentCreateTransitionNAPI, DocumentDeleteTransitionNAPI, DocumentNAPI, DocumentPurchaseTransitionNAPI, DocumentReplaceTransitionNAPI, DocumentTransferTransitionNAPI, DocumentTransitionNAPI, DocumentUpdatePriceTransitionNAPI, DynamicValue, EpochBasedDistributionNAPI, ExtendedEpochInfoNAPI, GroupNAPI, GroupStateTransitionInfoNAPI, IdentifierNAPI, IdentityCreateFromAddressesTransitionNAPI, IdentityCreateTransitionNAPI, IdentityCreditTransferNAPI, IdentityCreditTransferToAddressesTransitionNAPI, IdentityCreditWithdrawalTransitionNAPI, IdentityNAPI, IdentityPublicKeyInCreationNAPI, IdentityPublicKeyNAPI, IdentityTokenBalanceNAPI, IdentityTokenInfoNAPI, IdentityTopUpFromAddressesTransitionNAPI, IdentityTopUpTransitionNAPI, IdentityUpdateTransitionNAPI, InputAddressNAPI, InstantAssetLockProofNAPI, InstantLockNAPI, MasternodeVoteTransitionNAPI, OutPointNAPI, OutputAddressNAPI, OutputAddressNullableCreditsNAPI, PartialIdentityNAPI, PlatformAddressNAPI, PrefundedVotingBalanceNAPI, PrivateEncryptedNoteNAPI, PrivateKeyNAPI, PublicKeyNAPI, ResourceVoteChoiceNAPI, RewardDistributionTypeNAPI, SharedEncryptedNoteNAPI, StateTransitionNAPI, TimeBasedDistributionNAPI, TokenBaseTransitionNAPI, TokenBurnTransitionNAPI, TokenClaimTransitionNAPI, TokenConfigUpdateTransitionNAPI, TokenConfigurationChangeItemNAPI, TokenConfigurationConventionNAPI, TokenConfigurationLocalizationNAPI, TokenConfigurationNAPI, TokenContractInfoNAPI, TokenDestroyFrozenFundsTransitionNAPI, TokenDirectPurchaseTransitionNAPI, TokenDistributionRecipientNAPI, TokenDistributionRulesNAPI, TokenEmergencyActionTransitionNAPI, TokenFreezeTransitionNAPI, TokenKeepsHistoryRulesNAPI, TokenMarketplaceRulesNAPI, TokenMintTransitionNAPI, TokenPaymentInfoNAPI, TokenPerpetualDistributionNAPI, TokenPreProgrammedDistributionNAPI, TokenPricingScheduleNAPI, TokenSetPriceForDirectPurchaseTransitionNAPI, TokenStatusNAPI, TokenTradeModeNAPI, TokenTransferTransitionNAPI, TokenTransitionNAPI, TokenUnFreezeTransitionNAPI, TotalSingleTokenBalanceNAPI, TransactionNAPI, TxInNAPI, TxOutNAPI, VerifiedAddressInfosNAPI, VerifiedBalanceTransferNAPI, VerifiedContractNAPI, VerifiedDocumentNAPI, VerifiedDocumentsNAPI, VerifiedEpochsInfoNAPI, VerifiedIdentifierByNonUniquePublicKeyHashNAPI, VerifiedIdentityBalanceRootHashNAPI, VerifiedIdentityByIdentifierNAPI, VerifiedIdentityByUniqueKeyHashNAPI, VerifiedIdentityContractNonceNAPI, VerifiedIdentityFullWithAddressInfosNAPI, VerifiedIdentityKeysByIdentifierNAPI, VerifiedIdentityNonceNAPI, VerifiedIdentityTokenInfoNAPI, VerifiedIdentityWithAddressInfosNAPI, VerifiedStateTransitionResultNAPI, VerifiedTokenBalancesForIdentitiesNAPI, VerifiedTokenContractInfoNAPI, VerifiedTokenDirectPurchasePricesNAPI, VerifiedTokenGroupActionWithDocumentNAPI, VerifiedTokenGroupActionWithTokenBalanceNAPI, VerifiedTokenGroupActionWithTokenIdentityInfoNAPI, VerifiedTokenGroupActionWithTokenPricingScheduleNAPI, VerifiedTokenPricingScheduleNAPI, VerifiedTokensBalancesForIdentityNAPI, VerifiedTokenTotalSupplyNAPI, VerifiedTotalCreditsNAPI, VerifiedVoteStateNAPI, VoteNAPI, VotePollNAPI, WitnessNAPI, ActionGoalNAPI, AssetLockProofTypeNAPI, BatchTypeNAPI, GasFeesPaidByNAPI, GroupActionStatusNAPI, KeyTypeNAPI, NetworkNAPI, PlatformVersionNAPI, PoolingNAPI, PurposeNAPI, SecurityLevelNAPI, TokenDistributionTypeNAPI, TokenEmergencyActionNAPI, VoteStateResultTypeNAPI } = wasm.napiModule.exports;
|
|
44
|
+
export const { verifyContractProof, verifyDocumentsProof, verifyEpochsInfoProof, verifyIdentifierByNonUniquePublicKeyHashProof, verifyIdentityBalanceProof, verifyIdentityByIdentifierProof, verifyIdentityByUniqueKeyHashProof, verifyIdentityContractNonceProof, verifyIdentityKeysByIdentifierProof, verifyIdentityNonceProof, verifySignatureDigest, verifyStateTransitionResult, verifyTokenBalancesForIdentitiesProof, verifyTokenContractInfoProof, verifyTokenDirectPurchasePrices, verifyTokensBalancesForIdentityProof, verifyTokenTotalSupplyProof, verifyTotalCreditsProof, verifyVotePollVoteStateProof, ActionTakerNAPI, AddressCreditWithdrawalTransitionNAPI, AddressFundingFromAssetLockTransitionNAPI, AddressFundsFeeStrategyStepNAPI, AddressFundsTransferTransitionNAPI, AddressWitnessNAPI, AssetLockProofNAPI, AuthorizedActionTakersNAPI, BatchedTransitionNAPI, BatchTransitionNAPI, BlockBasedDistributionNAPI, BlockInfoNAPI, ChainAssetLockProofNAPI, ChangeControlRulesNAPI, ConsensusErrorNAPI, ContenderWithSerializedDocumentNAPI, ContestedDocumentVotePollQueryExecutionResultNAPI, ContractBoundsNAPI, CoreScriptNAPI, DataContractCreateTransitionNAPI, DataContractNAPI, DataContractUpdateTransitionNAPI, DistributionFunctionNAPI, DocumentBaseTransitionNAPI, DocumentCreateTransitionNAPI, DocumentDeleteTransitionNAPI, DocumentNAPI, DocumentPurchaseTransitionNAPI, DocumentReplaceTransitionNAPI, DocumentTransferTransitionNAPI, DocumentTransitionNAPI, DocumentUpdatePriceTransitionNAPI, DynamicValue, EpochBasedDistributionNAPI, ExtendedEpochInfoNAPI, GroupNAPI, GroupStateTransitionInfoNAPI, IdentifierNAPI, IdentityCreateFromAddressesTransitionNAPI, IdentityCreateTransitionNAPI, IdentityCreditTransferNAPI, IdentityCreditTransferToAddressesTransitionNAPI, IdentityCreditWithdrawalTransitionNAPI, IdentityNAPI, IdentityPublicKeyInCreationNAPI, IdentityPublicKeyNAPI, IdentityTokenBalanceNAPI, IdentityTokenBalanceOptionalNAPI, IdentityTokenInfoNAPI, IdentityTopUpFromAddressesTransitionNAPI, IdentityTopUpTransitionNAPI, IdentityUpdateTransitionNAPI, InputAddressNAPI, InstantAssetLockProofNAPI, InstantLockNAPI, MasternodeVoteTransitionNAPI, OutPointNAPI, OutputAddressNAPI, OutputAddressNullableCreditsNAPI, PartialIdentityNAPI, PlatformAddressNAPI, PrefundedVotingBalanceNAPI, PrivateEncryptedNoteNAPI, PrivateKeyNAPI, PublicKeyNAPI, ResourceVoteChoiceNAPI, RewardDistributionTypeNAPI, SharedEncryptedNoteNAPI, StateTransitionNAPI, TimeBasedDistributionNAPI, TokenBaseTransitionNAPI, TokenBurnTransitionNAPI, TokenClaimTransitionNAPI, TokenConfigUpdateTransitionNAPI, TokenConfigurationChangeItemNAPI, TokenConfigurationConventionNAPI, TokenConfigurationLocalizationNAPI, TokenConfigurationNAPI, TokenContractInfoNAPI, TokenDestroyFrozenFundsTransitionNAPI, TokenDirectPurchaseTransitionNAPI, TokenDistributionRecipientNAPI, TokenDistributionRulesNAPI, TokenEmergencyActionTransitionNAPI, TokenFreezeTransitionNAPI, TokenKeepsHistoryRulesNAPI, TokenMarketplaceRulesNAPI, TokenMintTransitionNAPI, TokenPaymentInfoNAPI, TokenPerpetualDistributionNAPI, TokenPreProgrammedDistributionNAPI, TokenPricingScheduleNAPI, TokenSetPriceForDirectPurchaseTransitionNAPI, TokenStatusNAPI, TokenTradeModeNAPI, TokenTransferTransitionNAPI, TokenTransitionNAPI, TokenUnFreezeTransitionNAPI, TotalSingleTokenBalanceNAPI, TransactionNAPI, TxInNAPI, TxOutNAPI, VerifiedAddressInfosNAPI, VerifiedBalanceTransferNAPI, VerifiedContractNAPI, VerifiedDocumentNAPI, VerifiedDocumentsNAPI, VerifiedEpochsInfoNAPI, VerifiedIdentifierByNonUniquePublicKeyHashNAPI, VerifiedIdentityBalanceRootHashNAPI, VerifiedIdentityByIdentifierNAPI, VerifiedIdentityByUniqueKeyHashNAPI, VerifiedIdentityContractNonceNAPI, VerifiedIdentityFullWithAddressInfosNAPI, VerifiedIdentityKeysByIdentifierNAPI, VerifiedIdentityNonceNAPI, VerifiedIdentityTokenInfoNAPI, VerifiedIdentityWithAddressInfosNAPI, VerifiedStateTransitionResultNAPI, VerifiedTokenBalancesForIdentitiesNAPI, VerifiedTokenContractInfoNAPI, VerifiedTokenDirectPurchasePricesNAPI, VerifiedTokenGroupActionWithDocumentNAPI, VerifiedTokenGroupActionWithTokenBalanceNAPI, VerifiedTokenGroupActionWithTokenIdentityInfoNAPI, VerifiedTokenGroupActionWithTokenPricingScheduleNAPI, VerifiedTokenPricingScheduleNAPI, VerifiedTokensBalancesForIdentityNAPI, VerifiedTokenTotalSupplyNAPI, VerifiedTotalCreditsNAPI, VerifiedVoteStateNAPI, VoteNAPI, VotePollNAPI, WitnessNAPI, ActionGoalNAPI, AssetLockProofTypeNAPI, BatchTypeNAPI, GasFeesPaidByNAPI, GroupActionStatusNAPI, KeyTypeNAPI, NetworkNAPI, PlatformVersionNAPI, PoolingNAPI, PurposeNAPI, SecurityLevelNAPI, TokenDistributionTypeNAPI, TokenEmergencyActionNAPI, VoteStateResultTypeNAPI } = wasm.napiModule.exports;
|
|
@@ -29,6 +29,7 @@ export declare class IdentityPublicKeyWASM {
|
|
|
29
29
|
set disabledAt(disabledAt: bigint | number);
|
|
30
30
|
get contractBounds(): ContractBoundsWASM | undefined;
|
|
31
31
|
set contractBounds(contractBounds: ContractBoundsWASM | undefined | null);
|
|
32
|
+
getContractBounds(): ContractBoundsWASM | undefined;
|
|
32
33
|
removeDisabledAt(): void;
|
|
33
34
|
getPublicKeyHash(): string;
|
|
34
35
|
isMaster(): boolean;
|
|
@@ -84,6 +84,11 @@ export class IdentityPublicKeyWASM {
|
|
|
84
84
|
set contractBounds(contractBounds) {
|
|
85
85
|
this._rawIdentityPublicKey.contractBounds = contractBounds?._rawContractBounds;
|
|
86
86
|
}
|
|
87
|
+
getContractBounds() {
|
|
88
|
+
if (this._rawIdentityPublicKey.contractBounds != null) {
|
|
89
|
+
return ContractBoundsWASM.createFromRawInstance(this._rawIdentityPublicKey.contractBounds);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
87
92
|
removeDisabledAt() {
|
|
88
93
|
this._rawIdentityPublicKey.removeDisabledAt();
|
|
89
94
|
}
|
|
@@ -10,6 +10,7 @@ export declare class IdentityPublicKeyInCreationWASM {
|
|
|
10
10
|
toIdentityPublicKey(): IdentityPublicKeyWASM;
|
|
11
11
|
validatePrivateKey(privateKey: string | Uint8Array | PrivateKeyWASM, network: NetworkLike): boolean;
|
|
12
12
|
getHash(): Uint8Array;
|
|
13
|
+
getContractBounds(): ContractBoundsWASM | undefined;
|
|
13
14
|
get contractBounds(): ContractBoundsWASM | undefined;
|
|
14
15
|
set contractBounds(value: ContractBoundsWASM);
|
|
15
16
|
get keyId(): number;
|
|
@@ -19,6 +19,11 @@ export class IdentityPublicKeyInCreationWASM {
|
|
|
19
19
|
getHash() {
|
|
20
20
|
return this._rawKeyInCreation.getHash();
|
|
21
21
|
}
|
|
22
|
+
getContractBounds() {
|
|
23
|
+
if (this._rawKeyInCreation.contractBounds != null) {
|
|
24
|
+
return ContractBoundsWASM.createFromRawInstance(this._rawKeyInCreation.contractBounds);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
22
27
|
get contractBounds() {
|
|
23
28
|
if (this._rawKeyInCreation.contractBounds != null) {
|
|
24
29
|
return ContractBoundsWASM.createFromRawInstance(this._rawKeyInCreation.contractBounds);
|
package/dist/src/dpp/types.d.ts
CHANGED
|
@@ -243,9 +243,13 @@ export interface IdentityTokenBalance {
|
|
|
243
243
|
balance: bigint;
|
|
244
244
|
id: IdentifierWASM;
|
|
245
245
|
}
|
|
246
|
+
export interface IdentityTokenBalanceOptional {
|
|
247
|
+
balance?: bigint;
|
|
248
|
+
id: IdentifierWASM;
|
|
249
|
+
}
|
|
246
250
|
export interface VerifiedTokenBalancesForIdentities {
|
|
247
251
|
rootHash: Uint8Array;
|
|
248
|
-
balances:
|
|
252
|
+
balances: IdentityTokenBalanceOptional[];
|
|
249
253
|
}
|
|
250
254
|
export interface TokenContractInfo {
|
|
251
255
|
contractId: IdentifierWASM;
|
|
@@ -269,5 +273,5 @@ export interface VerifiedTokenTotalSupply {
|
|
|
269
273
|
}
|
|
270
274
|
export interface VerifiedTokensBalancesForIdentity {
|
|
271
275
|
rootHash: Uint8Array;
|
|
272
|
-
balances:
|
|
276
|
+
balances: IdentityTokenBalanceOptional[];
|
|
273
277
|
}
|
package/dist/src/dpp/utils.js
CHANGED
|
@@ -2,7 +2,7 @@ import { dppProvider } from './provider.js';
|
|
|
2
2
|
import { UINT32MAX } from './constants.js';
|
|
3
3
|
import { IdentifierWASM } from './structs/Identifier.js';
|
|
4
4
|
export function valueToDynamicValue(value) {
|
|
5
|
-
if (typeof value === 'bigint' || value > UINT32MAX) {
|
|
5
|
+
if (typeof value === 'bigint' || (value > UINT32MAX && typeof value !== 'string')) {
|
|
6
6
|
return dppProvider.dpp.DynamicValue.fromBigIntString(BigInt(value.toString()).toString());
|
|
7
7
|
}
|
|
8
8
|
else if (value instanceof IdentifierWASM || value instanceof dppProvider.dpp.IdentifierNAPI) {
|
|
@@ -2,7 +2,7 @@ import { dppProvider } from '../../provider.js';
|
|
|
2
2
|
import { valueFromDynamicValue, valueToDynamicValue } from '../../utils.js';
|
|
3
3
|
import { IdentifierWASM } from '../../structs/Identifier.js';
|
|
4
4
|
export function verifyVotePollVoteStateProof(proof, contract, documentTypeName, indexName, indexValues, resultType, allowIncludeLockedAndAbstainingVoteTally, count, startAt, platformVersion) {
|
|
5
|
-
const result = dppProvider.dpp.verifyVotePollVoteStateProof(proof, contract._rawDataContract, documentTypeName, indexName, indexValues, valueToDynamicValue(resultType), allowIncludeLockedAndAbstainingVoteTally, count, valueToDynamicValue(startAt), valueToDynamicValue(platformVersion));
|
|
5
|
+
const result = dppProvider.dpp.verifyVotePollVoteStateProof(proof, contract._rawDataContract, documentTypeName, indexName, indexValues, valueToDynamicValue(resultType), allowIncludeLockedAndAbstainingVoteTally ?? true, count, valueToDynamicValue(startAt), valueToDynamicValue(platformVersion));
|
|
6
6
|
const winner = valueFromDynamicValue(result.result.winner);
|
|
7
7
|
const winnerBlockInfo = winner?.blockInfo;
|
|
8
8
|
const outWinner = winner != null
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dppProvider } from '../../provider.js';
|
|
2
2
|
import { valueToDynamicValue } from '../../utils.js';
|
|
3
3
|
export function verifyEpochsInfoProof(proof, currentEpoch, startEpoch, count, ascending, platformVersion) {
|
|
4
|
-
const result = dppProvider.dpp.verifyEpochsInfoProof(proof, currentEpoch, startEpoch, count, ascending, valueToDynamicValue(platformVersion));
|
|
4
|
+
const result = dppProvider.dpp.verifyEpochsInfoProof(proof, currentEpoch, startEpoch, count, ascending ?? false, valueToDynamicValue(platformVersion));
|
|
5
5
|
return {
|
|
6
6
|
rootHash: result.rootHash,
|
|
7
7
|
epochsInfo: result.epochsInfo.map(info => ({
|
|
@@ -6,7 +6,7 @@ export function verifyTokenBalancesForIdentitiesProof(proof, tokenId, isProofSub
|
|
|
6
6
|
return {
|
|
7
7
|
rootHash: result.rootHash,
|
|
8
8
|
balances: result.balances.map(balance => ({
|
|
9
|
-
balance: BigInt(balance.balance),
|
|
9
|
+
balance: balance.balance != null ? BigInt(balance.balance) : undefined,
|
|
10
10
|
id: IdentifierWASM.createFromRawInstance(balance.id)
|
|
11
11
|
}))
|
|
12
12
|
};
|
|
@@ -6,7 +6,7 @@ export function verifyTokensBalancesForIdentityProof(proof, tokenIds, identityId
|
|
|
6
6
|
return {
|
|
7
7
|
rootHash: result.rootHash,
|
|
8
8
|
balances: result.balances.map(balance => ({
|
|
9
|
-
balance: BigInt(balance.balance),
|
|
9
|
+
balance: balance.balance != null ? BigInt(balance.balance) : undefined,
|
|
10
10
|
id: IdentifierWASM.createFromRawInstance(balance.id)
|
|
11
11
|
}))
|
|
12
12
|
};
|
package/package.json
CHANGED