pshenmic-dpp 2.0.0-dev.3 → 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 +8 -3
- 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/Address/PlatformAddress.js +1 -1
- package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.js +1 -1
- package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.js +2 -2
- package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.js +2 -2
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.js +1 -1
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.js +1 -1
- package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.js +1 -1
- package/dist/src/dpp/structs/AddressTransitions/entities/InputAddress.js +1 -1
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.js +1 -1
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.js +1 -1
- package/dist/src/dpp/structs/AssetLockProof/AssetLockProof.js +1 -1
- package/dist/src/dpp/structs/AssetLockProof/ChainAssetLockProof.js +1 -1
- package/dist/src/dpp/structs/AssetLockProof/InstantAssetLockProof.js +1 -1
- package/dist/src/dpp/structs/AssetLockProof/OutPoint.js +1 -1
- package/dist/src/dpp/structs/AssetLockProof/Transaction.js +1 -1
- package/dist/src/dpp/structs/AssetLockProof/TxIn.js +1 -1
- package/dist/src/dpp/structs/AssetLockProof/TxOut.js +1 -1
- package/dist/src/dpp/structs/AssetLockProof/Witness.js +1 -1
- package/dist/src/dpp/structs/Batch/BatchTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/BatchedTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/DocumentBaseTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/DocumentTransition.d.ts +1 -0
- package/dist/src/dpp/structs/Batch/DocumentTransition.js +4 -1
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentCreateTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentDeleteTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentPurchaseTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentReplaceTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentTransferTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentUpdatePriceTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/PrefundedVotingBalance.js +1 -1
- package/dist/src/dpp/structs/Batch/TokenBaseTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/TokenPaymentInfo.js +1 -1
- package/dist/src/dpp/structs/Batch/TokenPricingSchedule.js +1 -1
- package/dist/src/dpp/structs/Batch/TokenTransition.d.ts +1 -0
- package/dist/src/dpp/structs/Batch/TokenTransition.js +4 -1
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenBurnTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenClaimTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenConfigUpdateTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDestroyFrozenFundsTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDirectPurchaseTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenEmergencyActionTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenFreezeTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenMintTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenSetPriceForDirectPurchaseTransition.js +1 -1
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenTransferTransition.d.ts +3 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenTransferTransition.js +8 -1
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenUnFreezeTransition.js +1 -1
- package/dist/src/dpp/structs/ContractBounds.js +1 -1
- package/dist/src/dpp/structs/CoreScript.js +1 -1
- package/dist/src/dpp/structs/DataContract.d.ts +2 -0
- package/dist/src/dpp/structs/DataContract.js +7 -1
- package/dist/src/dpp/structs/DataContractTransitions/DataContractCreateTransition.js +1 -1
- package/dist/src/dpp/structs/DataContractTransitions/DataContractUpdateTransition.js +1 -1
- package/dist/src/dpp/structs/EncryptedNote/PrivateEncryptedNote.js +1 -1
- package/dist/src/dpp/structs/EncryptedNote/SharedEncryptedNote.js +1 -1
- package/dist/src/dpp/structs/GroupStateTransitionInfo.js +1 -1
- package/dist/src/dpp/structs/Identifier.js +1 -1
- package/dist/src/dpp/structs/Identity.js +1 -1
- package/dist/src/dpp/structs/IdentityPublicKey.d.ts +1 -0
- package/dist/src/dpp/structs/IdentityPublicKey.js +6 -1
- package/dist/src/dpp/structs/IdentityPublicKeyInCreation.d.ts +1 -0
- package/dist/src/dpp/structs/IdentityPublicKeyInCreation.js +6 -1
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreateTransition.js +1 -1
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditTransfer.js +1 -1
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditWithdrawalTransition.js +1 -1
- package/dist/src/dpp/structs/IdentityTransitions/IdentityTopUpTransition.js +1 -1
- package/dist/src/dpp/structs/IdentityTransitions/IdentityUpdateTransition.js +1 -1
- package/dist/src/dpp/structs/InstantLock.js +1 -1
- package/dist/src/dpp/structs/MasternodeVote/MasternodeVoteTransition.js +1 -1
- package/dist/src/dpp/structs/MasternodeVote/Vote.js +1 -1
- package/dist/src/dpp/structs/MasternodeVote/VotePoll.d.ts +1 -1
- package/dist/src/dpp/structs/MasternodeVote/VotePoll.js +3 -3
- package/dist/src/dpp/structs/PartialIdentity.js +1 -1
- package/dist/src/dpp/structs/PrivateKey.js +1 -1
- package/dist/src/dpp/structs/PublicKey.js +1 -1
- package/dist/src/dpp/structs/TokenConfiguration/ActionTaker.js +1 -1
- package/dist/src/dpp/structs/TokenConfiguration/ChangeControlRules.js +1 -1
- package/dist/src/dpp/structs/TokenConfiguration/Group.js +1 -1
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfiguration.js +1 -1
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationConvention.js +1 -1
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationLocalization.js +1 -1
- package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRules.js +1 -1
- package/dist/src/dpp/structs/TokenConfiguration/TokenKeepsHistoryRules.js +1 -1
- package/dist/src/dpp/structs/TokenConfiguration/TokenMarketplaceRules.js +1 -1
- package/dist/src/dpp/structs/TokenConfiguration/TokenPerpetualDistribution.js +1 -1
- package/dist/src/dpp/structs/TokenConfiguration/TokenPreProgrammedDistribution.js +1 -1
- 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 +28 -0
|
@@ -48,7 +48,7 @@ export class DataContractUpdateTransitionWASM {
|
|
|
48
48
|
return DataContractUpdateTransitionWASM.createFromRawInstance(dppProvider.dpp.DataContractUpdateTransitionNAPI.fromStateTransition(stateTransition._rawStateTransition));
|
|
49
49
|
}
|
|
50
50
|
static createFromRawInstance(rawInstance) {
|
|
51
|
-
const instance = Object.create(
|
|
51
|
+
const instance = Object.create(DataContractUpdateTransitionWASM.prototype);
|
|
52
52
|
instance._rawDataContractUpdateTransition = rawInstance;
|
|
53
53
|
return instance;
|
|
54
54
|
}
|
|
@@ -24,7 +24,7 @@ export class PrivateEncryptedNoteWASM {
|
|
|
24
24
|
this._rawEncryptedNote.value = value;
|
|
25
25
|
}
|
|
26
26
|
static createFromRawInstance(rawInstance) {
|
|
27
|
-
const instance = Object.create(
|
|
27
|
+
const instance = Object.create(PrivateEncryptedNoteWASM.prototype);
|
|
28
28
|
instance._rawEncryptedNote = rawInstance;
|
|
29
29
|
return instance;
|
|
30
30
|
}
|
|
@@ -24,7 +24,7 @@ export class SharedEncryptedNoteWASM {
|
|
|
24
24
|
this._rawSharedNote.value = value;
|
|
25
25
|
}
|
|
26
26
|
static createFromRawInstance(rawInstance) {
|
|
27
|
-
const instance = Object.create(
|
|
27
|
+
const instance = Object.create(SharedEncryptedNoteWASM.prototype);
|
|
28
28
|
instance._rawSharedNote = rawInstance;
|
|
29
29
|
return instance;
|
|
30
30
|
}
|
|
@@ -26,7 +26,7 @@ export class GroupStateTransitionInfoWASM {
|
|
|
26
26
|
this._rawGroupStateTransitionInfo.actionIsProposer = actionIsProposer;
|
|
27
27
|
}
|
|
28
28
|
static createFromRawInstance(rawInstance) {
|
|
29
|
-
const instance = Object.create(
|
|
29
|
+
const instance = Object.create(GroupStateTransitionInfoWASM.prototype);
|
|
30
30
|
instance._rawGroupStateTransitionInfo = rawInstance;
|
|
31
31
|
return instance;
|
|
32
32
|
}
|
|
@@ -40,7 +40,7 @@ export class IdentifierWASM {
|
|
|
40
40
|
return this.createFromRawInstance(dppProvider.dpp.IdentifierNAPI.fromBytes(id));
|
|
41
41
|
}
|
|
42
42
|
static createFromRawInstance(rawInstance) {
|
|
43
|
-
const instance = Object.create(
|
|
43
|
+
const instance = Object.create(IdentifierWASM.prototype);
|
|
44
44
|
instance._rawIdentifier = rawInstance;
|
|
45
45
|
return instance;
|
|
46
46
|
}
|
|
@@ -63,7 +63,7 @@ export class IdentityWASM {
|
|
|
63
63
|
return this._rawIdentity.base64();
|
|
64
64
|
}
|
|
65
65
|
static createFromRawInstance(rawInstance) {
|
|
66
|
-
const instance = Object.create(
|
|
66
|
+
const instance = Object.create(IdentityWASM.prototype);
|
|
67
67
|
instance._rawIdentity = rawInstance;
|
|
68
68
|
return instance;
|
|
69
69
|
}
|
|
@@ -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
|
}
|
|
@@ -119,7 +124,7 @@ export class IdentityPublicKeyWASM {
|
|
|
119
124
|
return this.createFromRawInstance(rawInstance);
|
|
120
125
|
}
|
|
121
126
|
static createFromRawInstance(rawInstance) {
|
|
122
|
-
const instance = Object.create(
|
|
127
|
+
const instance = Object.create(IdentityPublicKeyWASM.prototype);
|
|
123
128
|
instance._rawIdentityPublicKey = rawInstance;
|
|
124
129
|
return instance;
|
|
125
130
|
}
|
|
@@ -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);
|
|
@@ -70,7 +75,7 @@ export class IdentityPublicKeyInCreationWASM {
|
|
|
70
75
|
this._rawKeyInCreation.signature = value;
|
|
71
76
|
}
|
|
72
77
|
static createFromRawInstance(rawInstance) {
|
|
73
|
-
const instance = Object.create(
|
|
78
|
+
const instance = Object.create(IdentityPublicKeyInCreationWASM.prototype);
|
|
74
79
|
instance._rawKeyInCreation = rawInstance;
|
|
75
80
|
return instance;
|
|
76
81
|
}
|
|
@@ -62,7 +62,7 @@ export class IdentityCreateTransitionWASM {
|
|
|
62
62
|
return IdentityCreateTransitionWASM.createFromRawInstance(dppProvider.dpp.IdentityCreateTransitionNAPI.fromStateTransition(stateTransition._rawStateTransition));
|
|
63
63
|
}
|
|
64
64
|
static createFromRawInstance(rawInstance) {
|
|
65
|
-
const instance = Object.create(
|
|
65
|
+
const instance = Object.create(IdentityCreateTransitionWASM.prototype);
|
|
66
66
|
instance._rawIdentityCreateTransition = rawInstance;
|
|
67
67
|
return instance;
|
|
68
68
|
}
|
|
@@ -78,7 +78,7 @@ export class IdentityCreditTransferWASM {
|
|
|
78
78
|
return IdentityCreditTransferWASM.createFromRawInstance(dppProvider.dpp.IdentityCreditTransferNAPI.fromStateTransition(stateTransition._rawStateTransition));
|
|
79
79
|
}
|
|
80
80
|
static createFromRawInstance(rawInstance) {
|
|
81
|
-
const instance = Object.create(
|
|
81
|
+
const instance = Object.create(IdentityCreditTransferWASM.prototype);
|
|
82
82
|
instance._rawIdentityCreditTransfer = rawInstance;
|
|
83
83
|
return instance;
|
|
84
84
|
}
|
|
@@ -107,7 +107,7 @@ export class IdentityCreditWithdrawalTransitionWASM {
|
|
|
107
107
|
return IdentityCreditWithdrawalTransitionWASM.createFromRawInstance(dppProvider.dpp.IdentityCreditWithdrawalTransitionNAPI.fromStateTransition(stateTransition._rawStateTransition));
|
|
108
108
|
}
|
|
109
109
|
static createFromRawInstance(rawInstance) {
|
|
110
|
-
const instance = Object.create(
|
|
110
|
+
const instance = Object.create(IdentityCreditWithdrawalTransitionWASM.prototype);
|
|
111
111
|
instance._rawIdentityCreditWithdrawalTransition = rawInstance;
|
|
112
112
|
return instance;
|
|
113
113
|
}
|
|
@@ -68,7 +68,7 @@ export class IdentityTopUpTransitionWASM {
|
|
|
68
68
|
return IdentityTopUpTransitionWASM.createFromRawInstance(dppProvider.dpp.IdentityTopUpTransitionNAPI.fromStateTransition(stateTransition._rawStateTransition));
|
|
69
69
|
}
|
|
70
70
|
static createFromRawInstance(rawInstance) {
|
|
71
|
-
const instance = Object.create(
|
|
71
|
+
const instance = Object.create(IdentityTopUpTransitionWASM.prototype);
|
|
72
72
|
instance._rawIdentityTopUpTransition = rawInstance;
|
|
73
73
|
return instance;
|
|
74
74
|
}
|
|
@@ -101,7 +101,7 @@ export class IdentityUpdateTransitionWASM {
|
|
|
101
101
|
return IdentityUpdateTransitionWASM.createFromRawInstance(dppProvider.dpp.IdentityUpdateTransitionNAPI.fromStateTransition(stateTransition._rawStateTransition));
|
|
102
102
|
}
|
|
103
103
|
static createFromRawInstance(rawInstance) {
|
|
104
|
-
const instance = Object.create(
|
|
104
|
+
const instance = Object.create(IdentityUpdateTransitionWASM.prototype);
|
|
105
105
|
instance._rawIdentityUpdateTransition = rawInstance;
|
|
106
106
|
return instance;
|
|
107
107
|
}
|
|
@@ -36,7 +36,7 @@ export class InstantLockWASM {
|
|
|
36
36
|
this._rawInstantLock.blsSignature = sig;
|
|
37
37
|
}
|
|
38
38
|
static createFromRawInstance(rawInstance) {
|
|
39
|
-
const instance = Object.create(
|
|
39
|
+
const instance = Object.create(InstantLockWASM.prototype);
|
|
40
40
|
instance._rawInstantLock = rawInstance;
|
|
41
41
|
return instance;
|
|
42
42
|
}
|
|
@@ -89,7 +89,7 @@ export class MasternodeVoteTransitionWASM {
|
|
|
89
89
|
return MasternodeVoteTransitionWASM.createFromRawInstance(dppProvider.dpp.MasternodeVoteTransitionNAPI.fromStateTransition(stateTransition._rawStateTransition));
|
|
90
90
|
}
|
|
91
91
|
static createFromRawInstance(rawInstance) {
|
|
92
|
-
const instance = Object.create(
|
|
92
|
+
const instance = Object.create(MasternodeVoteTransitionWASM.prototype);
|
|
93
93
|
instance._rawMasternodeVoteTransition = rawInstance;
|
|
94
94
|
return instance;
|
|
95
95
|
}
|
|
@@ -20,7 +20,7 @@ export class VoteWASM {
|
|
|
20
20
|
this._rawVote.resourceVoteChoice = resourceVoteChoice._rawResourceVoteChoice;
|
|
21
21
|
}
|
|
22
22
|
static createFromRawInstance(rawInstance) {
|
|
23
|
-
const instance = Object.create(
|
|
23
|
+
const instance = Object.create(VoteWASM.prototype);
|
|
24
24
|
instance._rawVote = rawInstance;
|
|
25
25
|
return instance;
|
|
26
26
|
}
|
|
@@ -11,7 +11,7 @@ export declare class VotePollWASM {
|
|
|
11
11
|
set documentTypeName(value: string);
|
|
12
12
|
get indexName(): string;
|
|
13
13
|
set indexName(value: string);
|
|
14
|
-
get indexValues():
|
|
14
|
+
get indexValues(): string[];
|
|
15
15
|
set indexValues(values: string[]);
|
|
16
16
|
toString(): string;
|
|
17
17
|
static createFromRawInstance(rawInstance: VotePollNAPI): VotePollWASM;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { dppProvider } from '../../provider.js';
|
|
2
|
-
import { prepareIdentifierValue,
|
|
2
|
+
import { prepareIdentifierValue, valueToDynamicValue } from '../../utils.js';
|
|
3
3
|
import { IdentifierWASM } from '../Identifier.js';
|
|
4
4
|
export class VotePollWASM {
|
|
5
5
|
/** @private **/
|
|
@@ -26,7 +26,7 @@ export class VotePollWASM {
|
|
|
26
26
|
this._rawVotePollWASM.indexName = value;
|
|
27
27
|
}
|
|
28
28
|
get indexValues() {
|
|
29
|
-
return
|
|
29
|
+
return this._rawVotePollWASM.indexValues;
|
|
30
30
|
}
|
|
31
31
|
set indexValues(values) {
|
|
32
32
|
this._rawVotePollWASM.indexValues = valueToDynamicValue(values);
|
|
@@ -35,7 +35,7 @@ export class VotePollWASM {
|
|
|
35
35
|
return this._rawVotePollWASM.toString();
|
|
36
36
|
}
|
|
37
37
|
static createFromRawInstance(rawInstance) {
|
|
38
|
-
const instance = Object.create(
|
|
38
|
+
const instance = Object.create(VotePollWASM.prototype);
|
|
39
39
|
instance._rawVotePollWASM = rawInstance;
|
|
40
40
|
return instance;
|
|
41
41
|
}
|
|
@@ -62,7 +62,7 @@ export class PartialIdentityWASM {
|
|
|
62
62
|
this._rawPartialIdentity.notFoundPublicKeys = keys;
|
|
63
63
|
}
|
|
64
64
|
static createFromRawInstance(rawInstance) {
|
|
65
|
-
const instance = Object.create(
|
|
65
|
+
const instance = Object.create(PartialIdentityWASM.prototype);
|
|
66
66
|
instance._rawPartialIdentity = rawInstance;
|
|
67
67
|
return instance;
|
|
68
68
|
}
|
|
@@ -41,7 +41,7 @@ export class PrivateKeyWASM {
|
|
|
41
41
|
return PrivateKeyWASM.createFromRawInstance(dppProvider.dpp.PrivateKeyNAPI.fromHex(hex, valueToDynamicValue(network)));
|
|
42
42
|
}
|
|
43
43
|
static createFromRawInstance(rawInstance) {
|
|
44
|
-
const instance = Object.create(
|
|
44
|
+
const instance = Object.create(PrivateKeyWASM.prototype);
|
|
45
45
|
instance._rawPrivateKey = rawInstance;
|
|
46
46
|
return instance;
|
|
47
47
|
}
|
|
@@ -30,7 +30,7 @@ export class PublicKeyWASM {
|
|
|
30
30
|
return PublicKeyWASM.createFromRawInstance(dppProvider.dpp.PublicKeyNAPI.fromBytes(bytes));
|
|
31
31
|
}
|
|
32
32
|
static createFromRawInstance(rawInstance) {
|
|
33
|
-
const instance = Object.create(
|
|
33
|
+
const instance = Object.create(PublicKeyWASM.prototype);
|
|
34
34
|
instance._rawPublicKey = rawInstance;
|
|
35
35
|
return instance;
|
|
36
36
|
}
|
|
@@ -37,7 +37,7 @@ export class ActionTakerWASM {
|
|
|
37
37
|
this._rawActionTaker.value = normalValue;
|
|
38
38
|
}
|
|
39
39
|
static createFromRawInstance(rawInstance) {
|
|
40
|
-
const instance = Object.create(
|
|
40
|
+
const instance = Object.create(ActionTakerWASM.prototype);
|
|
41
41
|
instance._rawActionTaker = rawInstance;
|
|
42
42
|
return instance;
|
|
43
43
|
}
|
|
@@ -45,7 +45,7 @@ export class ChangeControlRulesWASM {
|
|
|
45
45
|
return this._rawChangeControlRules.canChangeAdminActionTakers(adminActionTakers._rawAuthorizedActionTakers, prepareIdentifierValue(contractOwnerId), mainGroup, normalGroups, actionTaker._rawActionTaker, valueToDynamicValue(goal));
|
|
46
46
|
}
|
|
47
47
|
static createFromRawInstance(rawInstance) {
|
|
48
|
-
const instance = Object.create(
|
|
48
|
+
const instance = Object.create(ChangeControlRulesWASM.prototype);
|
|
49
49
|
instance._rawChangeControlRules = rawInstance;
|
|
50
50
|
return instance;
|
|
51
51
|
}
|
|
@@ -37,7 +37,7 @@ export class GroupWASM {
|
|
|
37
37
|
this._rawGroup.setMemberRequiredPower(prepareIdentifierValue(member), power);
|
|
38
38
|
}
|
|
39
39
|
static createFromRawInstance(rawInstance) {
|
|
40
|
-
const instance = Object.create(
|
|
40
|
+
const instance = Object.create(GroupWASM.prototype);
|
|
41
41
|
instance._rawGroup = rawInstance;
|
|
42
42
|
return instance;
|
|
43
43
|
}
|
|
@@ -132,7 +132,7 @@ export class TokenConfigurationWASM {
|
|
|
132
132
|
return IdentifierWASM.createFromRawInstance(dppProvider.dpp.TokenConfigurationNAPI.calculateTokenId(prepareIdentifierValue(contractId), tokenPosition));
|
|
133
133
|
}
|
|
134
134
|
static createFromRawInstance(rawInstance) {
|
|
135
|
-
const instance = Object.create(
|
|
135
|
+
const instance = Object.create(TokenConfigurationWASM.prototype);
|
|
136
136
|
instance._rawTokenConfiguration = rawInstance;
|
|
137
137
|
return instance;
|
|
138
138
|
}
|
|
@@ -40,7 +40,7 @@ export class TokenConfigurationConventionWASM {
|
|
|
40
40
|
this._rawTokenConfigurationConvention.localizations = normalLocalization;
|
|
41
41
|
}
|
|
42
42
|
static createFromRawInstance(rawInstance) {
|
|
43
|
-
const instance = Object.create(
|
|
43
|
+
const instance = Object.create(TokenConfigurationConventionWASM.prototype);
|
|
44
44
|
instance._rawTokenConfigurationConvention = rawInstance;
|
|
45
45
|
return instance;
|
|
46
46
|
}
|
|
@@ -27,7 +27,7 @@ export class TokenConfigurationLocalizationWASM {
|
|
|
27
27
|
return this._rawTokenConfigurationLocalization.toJSON();
|
|
28
28
|
}
|
|
29
29
|
static createFromRawInstance(rawInstance) {
|
|
30
|
-
const instance = Object.create(
|
|
30
|
+
const instance = Object.create(TokenConfigurationLocalizationWASM.prototype);
|
|
31
31
|
instance._rawTokenConfigurationLocalization = rawInstance;
|
|
32
32
|
return instance;
|
|
33
33
|
}
|
|
@@ -68,7 +68,7 @@ export class TokenDistributionRulesWASM {
|
|
|
68
68
|
this._rawTokenDistributionRules.changeDirectPurchasePricingRules = changeDirectPurchasePricingRules._rawChangeControlRules;
|
|
69
69
|
}
|
|
70
70
|
static createFromRawInstance(rawInstance) {
|
|
71
|
-
const instance = Object.create(
|
|
71
|
+
const instance = Object.create(TokenDistributionRulesWASM.prototype);
|
|
72
72
|
instance._rawTokenDistributionRules = rawInstance;
|
|
73
73
|
return instance;
|
|
74
74
|
}
|
|
@@ -42,7 +42,7 @@ export class TokenKeepsHistoryRulesWASM {
|
|
|
42
42
|
this._rawTokenKeepsHistoryRules.keepsDirectPurchaseHistory = keepsDirectPurchaseHistory;
|
|
43
43
|
}
|
|
44
44
|
static createFromRawInstance(rawInstance) {
|
|
45
|
-
const instance = Object.create(
|
|
45
|
+
const instance = Object.create(TokenKeepsHistoryRulesWASM.prototype);
|
|
46
46
|
instance._rawTokenKeepsHistoryRules = rawInstance;
|
|
47
47
|
return instance;
|
|
48
48
|
}
|
|
@@ -20,7 +20,7 @@ export class TokenMarketplaceRulesWASM {
|
|
|
20
20
|
this._rawTokenMarketplaceRules.tradeModeChangeRules = value._rawChangeControlRules;
|
|
21
21
|
}
|
|
22
22
|
static createFromRawInstance(rawInstance) {
|
|
23
|
-
const instance = Object.create(
|
|
23
|
+
const instance = Object.create(TokenMarketplaceRulesWASM.prototype);
|
|
24
24
|
instance._rawTokenMarketplaceRules = rawInstance;
|
|
25
25
|
return instance;
|
|
26
26
|
}
|
|
@@ -20,7 +20,7 @@ export class TokenPerpetualDistributionWASM {
|
|
|
20
20
|
this._rawTokenPerpetualDistribution.distributionRecipient = value._rawTokenDistributionRecipient;
|
|
21
21
|
}
|
|
22
22
|
static createFromRawInstance(rawInstance) {
|
|
23
|
-
const instance = Object.create(
|
|
23
|
+
const instance = Object.create(TokenPerpetualDistributionWASM.prototype);
|
|
24
24
|
instance._rawTokenPerpetualDistribution = rawInstance;
|
|
25
25
|
return instance;
|
|
26
26
|
}
|
|
@@ -35,7 +35,7 @@ export class TokenPreProgrammedDistributionWASM {
|
|
|
35
35
|
this._rawTokenPreProgrammedDistribution.distributions = objectToDistributionArray(distributions);
|
|
36
36
|
}
|
|
37
37
|
static createFromRawInstance(rawInstance) {
|
|
38
|
-
const instance = Object.create(
|
|
38
|
+
const instance = Object.create(TokenPreProgrammedDistributionWASM.prototype);
|
|
39
39
|
instance._rawTokenPreProgrammedDistribution = rawInstance;
|
|
40
40
|
return instance;
|
|
41
41
|
}
|
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
|
@@ -83,4 +83,32 @@ describe('DynamicValue', () => {
|
|
|
83
83
|
expect(valueFromDynamicValue(extendedArrayDynamicValue)).toStrictEqual(extendedArrayValue)
|
|
84
84
|
})
|
|
85
85
|
})
|
|
86
|
+
|
|
87
|
+
describe('number values in object', function () {
|
|
88
|
+
const mock = {
|
|
89
|
+
uint: 1999,
|
|
90
|
+
int: -293,
|
|
91
|
+
float: 2222.11231,
|
|
92
|
+
smallBigInt: BigInt(2),
|
|
93
|
+
bigBigInt: BigInt(2000000000000),
|
|
94
|
+
stringUint: '11',
|
|
95
|
+
stringInt: '-11',
|
|
96
|
+
stringFloat: '11.2',
|
|
97
|
+
bigStringNumber: '11111111111111111111111111111111'
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const dynValue = valueToDynamicValue(mock)
|
|
101
|
+
|
|
102
|
+
const result = valueFromDynamicValue(dynValue)
|
|
103
|
+
|
|
104
|
+
expect(valueFromDynamicValue(dynValue)).toStrictEqual(mock)
|
|
105
|
+
expect(dynValue.value.uint.getType()).toStrictEqual('u32')
|
|
106
|
+
expect(dynValue.value.int.getType()).toStrictEqual('i64')
|
|
107
|
+
expect(dynValue.value.float.getType()).toStrictEqual('f64')
|
|
108
|
+
expect(dynValue.value.smallBigInt.getType()).toStrictEqual('BigIntString')
|
|
109
|
+
expect(dynValue.value.bigBigInt.getType()).toStrictEqual('BigIntString')
|
|
110
|
+
expect(dynValue.value.stringUint.getType()).toStrictEqual('String')
|
|
111
|
+
expect(dynValue.value.stringInt.getType()).toStrictEqual('String')
|
|
112
|
+
expect(dynValue.value.stringFloat.getType()).toStrictEqual('String')
|
|
113
|
+
})
|
|
86
114
|
})
|