pshenmic-dpp 2.0.0-dev.2 → 2.0.0-dev.20
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 +200 -37
- package/dist/binaries/bindingsTypes.js +4 -3
- package/dist/binaries/native/aarch64-apple-darwin/pshenmic_dpp.node +0 -0
- package/dist/binaries/native/x86_64-apple-darwin/pshenmic_dpp.node +0 -0
- package/dist/binaries/native/x86_64-unknown-linux-gnu/pshenmic_dpp.node +0 -0
- package/dist/binaries/native/x86_64-unknown-linux-musl/pshenmic_dpp.node +0 -0
- package/dist/binaries/node.cjs +50 -0
- package/dist/binaries/node.d.cts +2 -0
- package/dist/binaries/pshenmic_dpp.android.node/arm64-v8a/libpshenmic_dpp.so +0 -0
- package/dist/binaries/pshenmic_dpp.apple.node/Info.plist +29 -0
- package/dist/binaries/pshenmic_dpp.apple.node/ios-arm64-simulator/libpshenmic_dpp.framework/Info.plist +24 -0
- package/dist/binaries/pshenmic_dpp.apple.node/ios-arm64-simulator/libpshenmic_dpp.framework/libpshenmic_dpp +0 -0
- package/dist/binaries/pshenmic_dpp.apple.node/react-native-node-api-module +0 -0
- package/dist/binaries/pshenmic_dpp.d.ts +15 -1
- package/dist/binaries/pshenmic_dpp.js +1 -1
- package/dist/binaries/wasm/wasmBytes.cjs +3 -0
- package/dist/binaries/wasm/wasmBytes.d.cts +1 -0
- package/dist/binaries/wasm.d.ts +15 -1
- package/dist/binaries/wasm.js +2 -44
- package/dist/binaries/wasmCreation.cjs +46 -0
- package/dist/binaries/wasmCreation.d.cts +2 -0
- package/dist/src/dpp/dpp.d.ts +11 -2
- package/dist/src/dpp/dpp.js +11 -2
- package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.d.ts +1 -1
- package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.js +2 -2
- package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.d.ts +1 -1
- package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.js +3 -3
- package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.d.ts +1 -1
- package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.js +3 -3
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.d.ts +1 -1
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.js +2 -2
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.js +1 -1
- package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.d.ts +1 -1
- package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.js +2 -2
- package/dist/src/dpp/structs/AddressTransitions/entities/InputAddress.d.ts +4 -3
- package/dist/src/dpp/structs/AddressTransitions/entities/InputAddress.js +5 -4
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.d.ts +4 -3
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.js +5 -4
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.d.ts +4 -3
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.js +5 -4
- package/dist/src/dpp/structs/AssetLockProof/AssetLockProof.js +1 -1
- package/dist/src/dpp/structs/AssetLockProof/ChainAssetLockProof.js +2 -2
- 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.d.ts +1 -1
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentCreateTransition.js +2 -2
- 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.d.ts +1 -1
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentReplaceTransition.js +2 -2
- 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 +6 -4
- package/dist/src/dpp/structs/DataContract.js +8 -2
- 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/Document.d.ts +1 -1
- package/dist/src/dpp/structs/Document.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.d.ts +0 -2
- package/dist/src/dpp/structs/MasternodeVote/MasternodeVoteTransition.js +1 -7
- 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/{Address → PlatformAddress}/AddressWitness.d.ts +2 -2
- package/dist/src/dpp/structs/{Address → PlatformAddress}/AddressWitness.js +2 -2
- package/dist/src/dpp/structs/{Address → PlatformAddress}/PlatformAddress.d.ts +4 -2
- package/dist/src/dpp/structs/{Address → PlatformAddress}/PlatformAddress.js +9 -3
- package/dist/src/dpp/structs/PrivateKey.js +1 -1
- package/dist/src/dpp/structs/PublicKey.js +1 -1
- package/dist/src/dpp/structs/ShieldedTransitions/IdentityCreateFromShieldedPoolTransition.d.ts +31 -0
- package/dist/src/dpp/structs/ShieldedTransitions/IdentityCreateFromShieldedPoolTransition.js +73 -0
- package/dist/src/dpp/structs/ShieldedTransitions/SerializedAction.d.ts +19 -0
- package/dist/src/dpp/structs/ShieldedTransitions/SerializedAction.js +49 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldFromAssetLockTransition.d.ts +30 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldFromAssetLockTransition.js +77 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldTransition.d.ts +32 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldTransition.js +78 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldedTransferTransition.d.ts +21 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldedTransferTransition.js +51 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldedWithdrawalTransition.d.ts +29 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldedWithdrawalTransition.js +71 -0
- package/dist/src/dpp/structs/ShieldedTransitions/UnshieldTransition.d.ts +25 -0
- package/dist/src/dpp/structs/ShieldedTransitions/UnshieldTransition.js +59 -0
- package/dist/src/dpp/structs/StateTransition.d.ts +1 -0
- package/dist/src/dpp/structs/StateTransition.js +3 -0
- 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 +50 -11
- package/dist/src/dpp/utils.d.ts +4 -3
- package/dist/src/dpp/utils.js +24 -6
- package/dist/src/dpp/verify/Contested/verifyVotePollVoteStateProof.d.ts +1 -1
- package/dist/src/dpp/verify/Contested/verifyVotePollVoteStateProof.js +1 -1
- package/dist/src/dpp/verify/PlatformAddress/verifyPlatformAddressInfo.d.ts +2 -0
- package/dist/src/dpp/verify/PlatformAddress/verifyPlatformAddressInfo.js +12 -0
- package/dist/src/dpp/verify/PlatformAddress/verifyPlatformAddressesInfos.d.ts +2 -0
- package/dist/src/dpp/verify/PlatformAddress/verifyPlatformAddressesInfos.js +14 -0
- package/dist/src/dpp/verify/StateTransition/utils.js +80 -15
- 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/dist/src/native.d.ts +3 -0
- package/dist/src/native.js +8 -0
- package/dist/utils/{base122.js → base122.cjs} +3 -1
- package/package.json +18 -28
- package/tests/unit/DataContract.spec.ts +281 -0
- package/tests/unit/DynamicValue.spec.ts +42 -2
- package/tests/unit/Identifier.spec.ts +1 -1
- package/tests/unit/Identity.spec.ts +1 -1
- package/tests/unit/IdentityPublicKey.spec.ts +1 -1
- package/tests/unit/NodeApi.spec.ts +49 -0
- package/tests/unit/ShieldedTransitions.spec.ts +709 -0
- package/tests/unit/TokenConfiguration.spec.ts +114 -0
- package/tests/unit/WebAssembly.spec.ts +49 -0
- package/tests/unit/utils/buildTokenConfiguration.ts +66 -0
- package/dist/binaries/pshenmic_dpp.android.node/x86_64/libpshenmic_dpp.so +0 -0
- package/dist/binaries/wasm/wasmBytes.d.ts +0 -2
- package/dist/binaries/wasm/wasmBytes.js +0 -2
- /package/dist/utils/{base122.d.ts → base122.d.cts} +0 -0
|
@@ -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
|
}
|
|
@@ -20,8 +20,6 @@ export declare class MasternodeVoteTransitionWASM {
|
|
|
20
20
|
set signaturePublicKeyId(keyId: number);
|
|
21
21
|
get signature(): Uint8Array;
|
|
22
22
|
set signature(value: Uint8Array);
|
|
23
|
-
get userFeeIncrease(): number;
|
|
24
|
-
set userFeeIncrease(value: number);
|
|
25
23
|
get assetLock(): AssetLockProofWASM | undefined;
|
|
26
24
|
get modifiedDataIds(): IdentifierWASM[];
|
|
27
25
|
getSignableBytes(): Uint8Array;
|
|
@@ -46,12 +46,6 @@ export class MasternodeVoteTransitionWASM {
|
|
|
46
46
|
set signature(value) {
|
|
47
47
|
this._rawMasternodeVoteTransition.signature = value;
|
|
48
48
|
}
|
|
49
|
-
get userFeeIncrease() {
|
|
50
|
-
return this._rawMasternodeVoteTransition.userFeeIncrease;
|
|
51
|
-
}
|
|
52
|
-
set userFeeIncrease(value) {
|
|
53
|
-
this._rawMasternodeVoteTransition.userFeeIncrease = value;
|
|
54
|
-
}
|
|
55
49
|
get assetLock() {
|
|
56
50
|
const lock = this._rawMasternodeVoteTransition.assetLock;
|
|
57
51
|
if (lock != null) {
|
|
@@ -89,7 +83,7 @@ export class MasternodeVoteTransitionWASM {
|
|
|
89
83
|
return MasternodeVoteTransitionWASM.createFromRawInstance(dppProvider.dpp.MasternodeVoteTransitionNAPI.fromStateTransition(stateTransition._rawStateTransition));
|
|
90
84
|
}
|
|
91
85
|
static createFromRawInstance(rawInstance) {
|
|
92
|
-
const instance = Object.create(
|
|
86
|
+
const instance = Object.create(MasternodeVoteTransitionWASM.prototype);
|
|
93
87
|
instance._rawMasternodeVoteTransition = rawInstance;
|
|
94
88
|
return instance;
|
|
95
89
|
}
|
|
@@ -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
|
}
|
|
@@ -4,8 +4,8 @@ export declare class AddressWitnessWASM {
|
|
|
4
4
|
/** @private **/
|
|
5
5
|
_rawWitness: AddressWitnessNAPI;
|
|
6
6
|
private constructor();
|
|
7
|
-
P2PKH(signature: Uint8Array): AddressWitnessWASM;
|
|
8
|
-
P2SH(signatures: Uint8Array[], redeemScript: Uint8Array): AddressWitnessWASM;
|
|
7
|
+
static P2PKH(signature: Uint8Array): AddressWitnessWASM;
|
|
8
|
+
static P2SH(signatures: Uint8Array[], redeemScript: Uint8Array): AddressWitnessWASM;
|
|
9
9
|
getType(): string;
|
|
10
10
|
getValue(): AddressWitnessP2PKH | AddressWitnessP2SH;
|
|
11
11
|
static createFromRawInstance(rawInstance: AddressWitnessNAPI): AddressWitnessWASM;
|
|
@@ -5,10 +5,10 @@ export class AddressWitnessWASM {
|
|
|
5
5
|
constructor(witness) {
|
|
6
6
|
this._rawWitness = witness;
|
|
7
7
|
}
|
|
8
|
-
P2PKH(signature) {
|
|
8
|
+
static P2PKH(signature) {
|
|
9
9
|
return AddressWitnessWASM.createFromRawInstance(dppProvider.dpp.AddressWitnessNAPI.P2PKH(signature));
|
|
10
10
|
}
|
|
11
|
-
P2SH(signatures, redeemScript) {
|
|
11
|
+
static P2SH(signatures, redeemScript) {
|
|
12
12
|
return AddressWitnessWASM.createFromRawInstance(dppProvider.dpp.AddressWitnessNAPI.P2SH(signatures, redeemScript));
|
|
13
13
|
}
|
|
14
14
|
getType() {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { PlatformAddressNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
-
import { NetworkLike } from '../../types.js';
|
|
2
|
+
import { NetworkLike, PlatformAddressLike } from '../../types.js';
|
|
3
3
|
export declare class PlatformAddressWASM {
|
|
4
4
|
/** @private **/
|
|
5
5
|
_rawPlatformAddress: PlatformAddressNAPI;
|
|
6
|
-
constructor(address:
|
|
6
|
+
constructor(address: PlatformAddressLike);
|
|
7
7
|
bytes(): Uint8Array;
|
|
8
8
|
toAddress(network: NetworkLike): string;
|
|
9
9
|
toBech32m(network: NetworkLike): string;
|
|
10
10
|
isP2PKH(): boolean;
|
|
11
11
|
isP2SH(): boolean;
|
|
12
12
|
hash(): Uint8Array;
|
|
13
|
+
static fromBech32m(bech32m: string): PlatformAddressWASM;
|
|
14
|
+
static fromBytes(bytes: Uint8Array): PlatformAddressWASM;
|
|
13
15
|
static createFromRawInstance(rawInstance: PlatformAddressNAPI): PlatformAddressWASM;
|
|
14
16
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { dppProvider } from '../../provider.js';
|
|
2
|
-
import { valueToDynamicValue } from '../../utils.js';
|
|
2
|
+
import { preparePlatformAddressValue, valueToDynamicValue } from '../../utils.js';
|
|
3
3
|
export class PlatformAddressWASM {
|
|
4
4
|
/** @private **/
|
|
5
5
|
_rawPlatformAddress;
|
|
6
6
|
constructor(address) {
|
|
7
|
-
this._rawPlatformAddress = new dppProvider.dpp.PlatformAddressNAPI(address);
|
|
7
|
+
this._rawPlatformAddress = new dppProvider.dpp.PlatformAddressNAPI(preparePlatformAddressValue(address));
|
|
8
8
|
}
|
|
9
9
|
bytes() {
|
|
10
10
|
return this._rawPlatformAddress.bytes();
|
|
@@ -24,8 +24,14 @@ export class PlatformAddressWASM {
|
|
|
24
24
|
hash() {
|
|
25
25
|
return this._rawPlatformAddress.hash();
|
|
26
26
|
}
|
|
27
|
+
static fromBech32m(bech32m) {
|
|
28
|
+
return PlatformAddressWASM.createFromRawInstance(dppProvider.dpp.PlatformAddressNAPI.fromBech32m(bech32m));
|
|
29
|
+
}
|
|
30
|
+
static fromBytes(bytes) {
|
|
31
|
+
return PlatformAddressWASM.createFromRawInstance(dppProvider.dpp.PlatformAddressNAPI.fromBytes(bytes));
|
|
32
|
+
}
|
|
27
33
|
static createFromRawInstance(rawInstance) {
|
|
28
|
-
const instance = Object.create(
|
|
34
|
+
const instance = Object.create(PlatformAddressWASM.prototype);
|
|
29
35
|
instance._rawPlatformAddress = rawInstance;
|
|
30
36
|
return instance;
|
|
31
37
|
}
|
|
@@ -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
|
}
|
package/dist/src/dpp/structs/ShieldedTransitions/IdentityCreateFromShieldedPoolTransition.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IdentityCreateFromShieldedPoolTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { IdentityPublicKeyInCreationWASM } from '../IdentityPublicKeyInCreation.js';
|
|
3
|
+
import { SerializedActionWASM } from './SerializedAction.js';
|
|
4
|
+
import { PlatformAddressWASM } from '../PlatformAddress/PlatformAddress.js';
|
|
5
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
6
|
+
import { IdentifierLike, PlatformAddressLike } from '../../types.js';
|
|
7
|
+
import { StateTransitionWASM } from '../StateTransition.js';
|
|
8
|
+
export declare class IdentityCreateFromShieldedPoolTransitionWASM {
|
|
9
|
+
/** @private **/
|
|
10
|
+
_rawIdentityCreateFromShieldedPoolTransition: IdentityCreateFromShieldedPoolTransitionNAPI;
|
|
11
|
+
constructor(publicKeys: IdentityPublicKeyInCreationWASM[], denomination: bigint, actions: SerializedActionWASM[], anchor: Uint8Array, proof: Uint8Array, bindingsSignature: Uint8Array, sendToAddressOnCreationFailure: PlatformAddressLike, identityId: IdentifierLike);
|
|
12
|
+
get publicKeys(): IdentityPublicKeyInCreationWASM[];
|
|
13
|
+
set publicKeys(value: IdentityPublicKeyInCreationWASM[]);
|
|
14
|
+
get denomination(): bigint;
|
|
15
|
+
set denomination(value: bigint);
|
|
16
|
+
get actions(): SerializedActionWASM[];
|
|
17
|
+
set actions(value: SerializedActionWASM[]);
|
|
18
|
+
get anchor(): Uint8Array;
|
|
19
|
+
set anchor(value: Uint8Array);
|
|
20
|
+
get proof(): Uint8Array;
|
|
21
|
+
set proof(value: Uint8Array);
|
|
22
|
+
get bindingsSignature(): Uint8Array;
|
|
23
|
+
set bindingsSignature(value: Uint8Array);
|
|
24
|
+
get sendToAddressOnCreationFailure(): PlatformAddressWASM;
|
|
25
|
+
set sendToAddressOnCreationFailure(value: PlatformAddressLike);
|
|
26
|
+
get identityId(): IdentifierWASM;
|
|
27
|
+
set identityId(value: IdentifierLike);
|
|
28
|
+
toStateTransition(): StateTransitionWASM;
|
|
29
|
+
static fromStateTransition(st: StateTransitionWASM): IdentityCreateFromShieldedPoolTransitionWASM;
|
|
30
|
+
static createFromRawInstance(rawInstance: IdentityCreateFromShieldedPoolTransitionNAPI): IdentityCreateFromShieldedPoolTransitionWASM;
|
|
31
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { IdentityPublicKeyInCreationWASM } from '../IdentityPublicKeyInCreation.js';
|
|
2
|
+
import { SerializedActionWASM } from './SerializedAction.js';
|
|
3
|
+
import { PlatformAddressWASM } from '../PlatformAddress/PlatformAddress.js';
|
|
4
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
5
|
+
import { dppProvider } from '../../provider.js';
|
|
6
|
+
import { prepareIdentifierValue, preparePlatformAddressValue } from '../../utils.js';
|
|
7
|
+
import { StateTransitionWASM } from '../StateTransition.js';
|
|
8
|
+
export class IdentityCreateFromShieldedPoolTransitionWASM {
|
|
9
|
+
/** @private **/
|
|
10
|
+
_rawIdentityCreateFromShieldedPoolTransition;
|
|
11
|
+
constructor(publicKeys, denomination, actions, anchor, proof, bindingsSignature, sendToAddressOnCreationFailure, identityId) {
|
|
12
|
+
this._rawIdentityCreateFromShieldedPoolTransition = new dppProvider.dpp.IdentityCreateFromShieldedPoolTransitionNAPI(publicKeys.map(k => k._rawKeyInCreation), denomination.toString(), actions.map(a => a._rawSerializedAction), anchor, proof, bindingsSignature, preparePlatformAddressValue(sendToAddressOnCreationFailure), prepareIdentifierValue(identityId));
|
|
13
|
+
}
|
|
14
|
+
get publicKeys() {
|
|
15
|
+
return this._rawIdentityCreateFromShieldedPoolTransition.publicKeys.map(IdentityPublicKeyInCreationWASM.createFromRawInstance);
|
|
16
|
+
}
|
|
17
|
+
set publicKeys(value) {
|
|
18
|
+
this._rawIdentityCreateFromShieldedPoolTransition.publicKeys = value.map(k => k._rawKeyInCreation);
|
|
19
|
+
}
|
|
20
|
+
get denomination() {
|
|
21
|
+
return BigInt(this._rawIdentityCreateFromShieldedPoolTransition.denomination);
|
|
22
|
+
}
|
|
23
|
+
set denomination(value) {
|
|
24
|
+
this._rawIdentityCreateFromShieldedPoolTransition.denomination = value.toString();
|
|
25
|
+
}
|
|
26
|
+
get actions() {
|
|
27
|
+
return this._rawIdentityCreateFromShieldedPoolTransition.actions.map(SerializedActionWASM.createFromRawInstance);
|
|
28
|
+
}
|
|
29
|
+
set actions(value) {
|
|
30
|
+
this._rawIdentityCreateFromShieldedPoolTransition.actions = value.map(a => a._rawSerializedAction);
|
|
31
|
+
}
|
|
32
|
+
get anchor() {
|
|
33
|
+
return this._rawIdentityCreateFromShieldedPoolTransition.anchor;
|
|
34
|
+
}
|
|
35
|
+
set anchor(value) {
|
|
36
|
+
this._rawIdentityCreateFromShieldedPoolTransition.anchor = value;
|
|
37
|
+
}
|
|
38
|
+
get proof() {
|
|
39
|
+
return this._rawIdentityCreateFromShieldedPoolTransition.proof;
|
|
40
|
+
}
|
|
41
|
+
set proof(value) {
|
|
42
|
+
this._rawIdentityCreateFromShieldedPoolTransition.proof = value;
|
|
43
|
+
}
|
|
44
|
+
get bindingsSignature() {
|
|
45
|
+
return this._rawIdentityCreateFromShieldedPoolTransition.bindingsSignature;
|
|
46
|
+
}
|
|
47
|
+
set bindingsSignature(value) {
|
|
48
|
+
this._rawIdentityCreateFromShieldedPoolTransition.bindingsSignature = value;
|
|
49
|
+
}
|
|
50
|
+
get sendToAddressOnCreationFailure() {
|
|
51
|
+
return PlatformAddressWASM.createFromRawInstance(this._rawIdentityCreateFromShieldedPoolTransition.sendToAddressOnCreationFailure);
|
|
52
|
+
}
|
|
53
|
+
set sendToAddressOnCreationFailure(value) {
|
|
54
|
+
this._rawIdentityCreateFromShieldedPoolTransition.sendToAddressOnCreationFailure = preparePlatformAddressValue(value);
|
|
55
|
+
}
|
|
56
|
+
get identityId() {
|
|
57
|
+
return IdentifierWASM.createFromRawInstance(this._rawIdentityCreateFromShieldedPoolTransition.identityId);
|
|
58
|
+
}
|
|
59
|
+
set identityId(value) {
|
|
60
|
+
this._rawIdentityCreateFromShieldedPoolTransition.identityId = prepareIdentifierValue(value);
|
|
61
|
+
}
|
|
62
|
+
toStateTransition() {
|
|
63
|
+
return StateTransitionWASM.createFromRawInstance(this._rawIdentityCreateFromShieldedPoolTransition.toStateTransition());
|
|
64
|
+
}
|
|
65
|
+
static fromStateTransition(st) {
|
|
66
|
+
return IdentityCreateFromShieldedPoolTransitionWASM.createFromRawInstance(dppProvider.dpp.IdentityCreateFromShieldedPoolTransitionNAPI.fromStateTransition(st._rawStateTransition));
|
|
67
|
+
}
|
|
68
|
+
static createFromRawInstance(rawInstance) {
|
|
69
|
+
const instance = Object.create(IdentityCreateFromShieldedPoolTransitionWASM.prototype);
|
|
70
|
+
instance._rawIdentityCreateFromShieldedPoolTransition = rawInstance;
|
|
71
|
+
return instance;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SerializedActionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
export declare class SerializedActionWASM {
|
|
3
|
+
/** @private **/
|
|
4
|
+
_rawSerializedAction: SerializedActionNAPI;
|
|
5
|
+
constructor(nullifier: Uint8Array, rk: Uint8Array, cmx: Uint8Array, encryptedNote: Uint8Array, cvNet: Uint8Array, spendAuthSig: Uint8Array);
|
|
6
|
+
get nullifier(): Uint8Array;
|
|
7
|
+
set nullifier(value: Uint8Array);
|
|
8
|
+
get rk(): Uint8Array;
|
|
9
|
+
set rk(value: Uint8Array);
|
|
10
|
+
get cmx(): Uint8Array;
|
|
11
|
+
set cmx(value: Uint8Array);
|
|
12
|
+
get encryptedNote(): Uint8Array;
|
|
13
|
+
set encryptedNote(value: Uint8Array);
|
|
14
|
+
get cvNet(): Uint8Array;
|
|
15
|
+
set cvNet(value: Uint8Array);
|
|
16
|
+
get spendAuthSig(): Uint8Array;
|
|
17
|
+
set spendAuthSig(value: Uint8Array);
|
|
18
|
+
static createFromRawInstance(rawInstance: SerializedActionNAPI): SerializedActionWASM;
|
|
19
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
export class SerializedActionWASM {
|
|
3
|
+
/** @private **/
|
|
4
|
+
_rawSerializedAction;
|
|
5
|
+
constructor(nullifier, rk, cmx, encryptedNote, cvNet, spendAuthSig) {
|
|
6
|
+
this._rawSerializedAction = new dppProvider.dpp.SerializedActionNAPI(nullifier, rk, cmx, encryptedNote, cvNet, spendAuthSig);
|
|
7
|
+
}
|
|
8
|
+
get nullifier() {
|
|
9
|
+
return this._rawSerializedAction.nullifier;
|
|
10
|
+
}
|
|
11
|
+
set nullifier(value) {
|
|
12
|
+
this._rawSerializedAction.nullifier = value;
|
|
13
|
+
}
|
|
14
|
+
get rk() {
|
|
15
|
+
return this._rawSerializedAction.rk;
|
|
16
|
+
}
|
|
17
|
+
set rk(value) {
|
|
18
|
+
this._rawSerializedAction.rk = value;
|
|
19
|
+
}
|
|
20
|
+
get cmx() {
|
|
21
|
+
return this._rawSerializedAction.cmx;
|
|
22
|
+
}
|
|
23
|
+
set cmx(value) {
|
|
24
|
+
this._rawSerializedAction.cmx = value;
|
|
25
|
+
}
|
|
26
|
+
get encryptedNote() {
|
|
27
|
+
return this._rawSerializedAction.encrypted_note;
|
|
28
|
+
}
|
|
29
|
+
set encryptedNote(value) {
|
|
30
|
+
this._rawSerializedAction.encrypted_note = value;
|
|
31
|
+
}
|
|
32
|
+
get cvNet() {
|
|
33
|
+
return this._rawSerializedAction.cvNet;
|
|
34
|
+
}
|
|
35
|
+
set cvNet(value) {
|
|
36
|
+
this._rawSerializedAction.cvNet = value;
|
|
37
|
+
}
|
|
38
|
+
get spendAuthSig() {
|
|
39
|
+
return this._rawSerializedAction.spendAuthSig;
|
|
40
|
+
}
|
|
41
|
+
set spendAuthSig(value) {
|
|
42
|
+
this._rawSerializedAction.spendAuthSig = value;
|
|
43
|
+
}
|
|
44
|
+
static createFromRawInstance(rawInstance) {
|
|
45
|
+
const instance = Object.create(SerializedActionWASM.prototype);
|
|
46
|
+
instance._rawSerializedAction = rawInstance;
|
|
47
|
+
return instance;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ShieldFromAssetLockTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { SerializedActionWASM } from './SerializedAction.js';
|
|
3
|
+
import { AssetLockProofWASM } from '../AssetLockProof/AssetLockProof.js';
|
|
4
|
+
import { PlatformAddressWASM } from '../PlatformAddress/PlatformAddress.js';
|
|
5
|
+
import { PlatformAddressLike } from '../../types.js';
|
|
6
|
+
import { StateTransitionWASM } from '../StateTransition.js';
|
|
7
|
+
export declare class ShieldFromAssetLockTransitionWASM {
|
|
8
|
+
/** @private **/
|
|
9
|
+
_rawShieldFromAssetLockTransition: ShieldFromAssetLockTransitionNAPI;
|
|
10
|
+
constructor(assetLockProof: AssetLockProofWASM, actions: SerializedActionWASM[], valueBalance: bigint, anchor: Uint8Array, proof: Uint8Array, bindingsSignature: Uint8Array, surplusOutput?: PlatformAddressLike);
|
|
11
|
+
get assetLockProof(): AssetLockProofWASM;
|
|
12
|
+
set assetLockProof(value: AssetLockProofWASM);
|
|
13
|
+
get actions(): SerializedActionWASM[];
|
|
14
|
+
set actions(value: SerializedActionWASM[]);
|
|
15
|
+
get valueBalance(): bigint;
|
|
16
|
+
set valueBalance(value: bigint);
|
|
17
|
+
get anchor(): Uint8Array;
|
|
18
|
+
set anchor(value: Uint8Array);
|
|
19
|
+
get proof(): Uint8Array;
|
|
20
|
+
set proof(value: Uint8Array);
|
|
21
|
+
get bindingsSignature(): Uint8Array;
|
|
22
|
+
set bindingsSignature(value: Uint8Array);
|
|
23
|
+
get surplusOutput(): PlatformAddressWASM | undefined;
|
|
24
|
+
set surplusOutput(value: PlatformAddressLike | undefined);
|
|
25
|
+
get signature(): Uint8Array;
|
|
26
|
+
set signature(value: Uint8Array);
|
|
27
|
+
toStateTransition(): StateTransitionWASM;
|
|
28
|
+
static fromStateTransition(st: StateTransitionWASM): ShieldFromAssetLockTransitionWASM;
|
|
29
|
+
static createFromRawInstance(rawInstance: ShieldFromAssetLockTransitionNAPI): ShieldFromAssetLockTransitionWASM;
|
|
30
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { SerializedActionWASM } from './SerializedAction.js';
|
|
2
|
+
import { AssetLockProofWASM } from '../AssetLockProof/AssetLockProof.js';
|
|
3
|
+
import { PlatformAddressWASM } from '../PlatformAddress/PlatformAddress.js';
|
|
4
|
+
import { dppProvider } from '../../provider.js';
|
|
5
|
+
import { preparePlatformAddressValue } from '../../utils.js';
|
|
6
|
+
import { StateTransitionWASM } from '../StateTransition.js';
|
|
7
|
+
export class ShieldFromAssetLockTransitionWASM {
|
|
8
|
+
/** @private **/
|
|
9
|
+
_rawShieldFromAssetLockTransition;
|
|
10
|
+
constructor(assetLockProof, actions, valueBalance, anchor, proof, bindingsSignature, surplusOutput) {
|
|
11
|
+
this._rawShieldFromAssetLockTransition = new dppProvider.dpp.ShieldFromAssetLockTransitionNAPI(assetLockProof._rawAssetLockProof, actions.map(a => a._rawSerializedAction), valueBalance.toString(), anchor, proof, bindingsSignature, surplusOutput != null ? preparePlatformAddressValue(surplusOutput) : undefined);
|
|
12
|
+
}
|
|
13
|
+
get assetLockProof() {
|
|
14
|
+
return AssetLockProofWASM.createFromRawInstance(this._rawShieldFromAssetLockTransition.assetLockProof);
|
|
15
|
+
}
|
|
16
|
+
set assetLockProof(value) {
|
|
17
|
+
this._rawShieldFromAssetLockTransition.assetLockProof = value._rawAssetLockProof;
|
|
18
|
+
}
|
|
19
|
+
get actions() {
|
|
20
|
+
return this._rawShieldFromAssetLockTransition.actions.map(SerializedActionWASM.createFromRawInstance);
|
|
21
|
+
}
|
|
22
|
+
set actions(value) {
|
|
23
|
+
this._rawShieldFromAssetLockTransition.actions = value.map(a => a._rawSerializedAction);
|
|
24
|
+
}
|
|
25
|
+
get valueBalance() {
|
|
26
|
+
return BigInt(this._rawShieldFromAssetLockTransition.valueBalance);
|
|
27
|
+
}
|
|
28
|
+
set valueBalance(value) {
|
|
29
|
+
this._rawShieldFromAssetLockTransition.valueBalance = value.toString();
|
|
30
|
+
}
|
|
31
|
+
get anchor() {
|
|
32
|
+
return this._rawShieldFromAssetLockTransition.anchor;
|
|
33
|
+
}
|
|
34
|
+
set anchor(value) {
|
|
35
|
+
this._rawShieldFromAssetLockTransition.anchor = value;
|
|
36
|
+
}
|
|
37
|
+
get proof() {
|
|
38
|
+
return this._rawShieldFromAssetLockTransition.proof;
|
|
39
|
+
}
|
|
40
|
+
set proof(value) {
|
|
41
|
+
this._rawShieldFromAssetLockTransition.proof = value;
|
|
42
|
+
}
|
|
43
|
+
get bindingsSignature() {
|
|
44
|
+
return this._rawShieldFromAssetLockTransition.bindingsSignature;
|
|
45
|
+
}
|
|
46
|
+
set bindingsSignature(value) {
|
|
47
|
+
this._rawShieldFromAssetLockTransition.bindingsSignature = value;
|
|
48
|
+
}
|
|
49
|
+
get surplusOutput() {
|
|
50
|
+
const output = this._rawShieldFromAssetLockTransition.surplusOutput;
|
|
51
|
+
if (output != null) {
|
|
52
|
+
return PlatformAddressWASM.createFromRawInstance(output);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
set surplusOutput(value) {
|
|
56
|
+
this._rawShieldFromAssetLockTransition.surplusOutput = value != null
|
|
57
|
+
? preparePlatformAddressValue(value)
|
|
58
|
+
: undefined;
|
|
59
|
+
}
|
|
60
|
+
get signature() {
|
|
61
|
+
return this._rawShieldFromAssetLockTransition.signature;
|
|
62
|
+
}
|
|
63
|
+
set signature(value) {
|
|
64
|
+
this._rawShieldFromAssetLockTransition.signature = value;
|
|
65
|
+
}
|
|
66
|
+
toStateTransition() {
|
|
67
|
+
return StateTransitionWASM.createFromRawInstance(this._rawShieldFromAssetLockTransition.toStateTransition());
|
|
68
|
+
}
|
|
69
|
+
static fromStateTransition(st) {
|
|
70
|
+
return ShieldFromAssetLockTransitionWASM.createFromRawInstance(dppProvider.dpp.ShieldFromAssetLockTransitionNAPI.fromStateTransition(st._rawStateTransition));
|
|
71
|
+
}
|
|
72
|
+
static createFromRawInstance(rawInstance) {
|
|
73
|
+
const instance = Object.create(ShieldFromAssetLockTransitionWASM.prototype);
|
|
74
|
+
instance._rawShieldFromAssetLockTransition = rawInstance;
|
|
75
|
+
return instance;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ShieldTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { InputAddressWASM } from '../AddressTransitions/entities/InputAddress.js';
|
|
3
|
+
import { AddressFundsFeeStrategyStepWASM } from '../AddressTransitions/entities/AddressFundsFeeStrategyStep.js';
|
|
4
|
+
import { AddressWitnessWASM } from '../PlatformAddress/AddressWitness.js';
|
|
5
|
+
import { SerializedActionWASM } from './SerializedAction.js';
|
|
6
|
+
import { StateTransitionWASM } from '../StateTransition.js';
|
|
7
|
+
export declare class ShieldTransitionWASM {
|
|
8
|
+
/** @private **/
|
|
9
|
+
_rawShieldTransition: ShieldTransitionNAPI;
|
|
10
|
+
constructor(inputs: InputAddressWASM[], actions: SerializedActionWASM[], amount: bigint, anchor: Uint8Array, proof: Uint8Array, bindingsSignature: Uint8Array, feeStrategy: AddressFundsFeeStrategyStepWASM[], userFeeIncrease: number, inputWitnesses: AddressWitnessWASM[]);
|
|
11
|
+
get inputs(): InputAddressWASM[];
|
|
12
|
+
set inputs(value: InputAddressWASM[]);
|
|
13
|
+
get actions(): SerializedActionWASM[];
|
|
14
|
+
set actions(value: SerializedActionWASM[]);
|
|
15
|
+
get amount(): bigint;
|
|
16
|
+
set amount(value: bigint);
|
|
17
|
+
get anchor(): Uint8Array;
|
|
18
|
+
set anchor(value: Uint8Array);
|
|
19
|
+
get proof(): Uint8Array;
|
|
20
|
+
set proof(value: Uint8Array);
|
|
21
|
+
get bindingsSignature(): Uint8Array;
|
|
22
|
+
set bindingsSignature(value: Uint8Array);
|
|
23
|
+
get feeStrategy(): AddressFundsFeeStrategyStepWASM[];
|
|
24
|
+
set feeStrategy(value: AddressFundsFeeStrategyStepWASM[]);
|
|
25
|
+
get userFeeIncrease(): number;
|
|
26
|
+
set userFeeIncrease(value: number);
|
|
27
|
+
get inputWitnesses(): AddressWitnessWASM[];
|
|
28
|
+
set inputWitnesses(value: AddressWitnessWASM[]);
|
|
29
|
+
toStateTransition(): StateTransitionWASM;
|
|
30
|
+
static fromStateTransition(st: StateTransitionWASM): ShieldTransitionWASM;
|
|
31
|
+
static createFromRawInstance(rawInstance: ShieldTransitionNAPI): ShieldTransitionWASM;
|
|
32
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { InputAddressWASM } from '../AddressTransitions/entities/InputAddress.js';
|
|
2
|
+
import { AddressFundsFeeStrategyStepWASM } from '../AddressTransitions/entities/AddressFundsFeeStrategyStep.js';
|
|
3
|
+
import { AddressWitnessWASM } from '../PlatformAddress/AddressWitness.js';
|
|
4
|
+
import { SerializedActionWASM } from './SerializedAction.js';
|
|
5
|
+
import { dppProvider } from '../../provider.js';
|
|
6
|
+
import { StateTransitionWASM } from '../StateTransition.js';
|
|
7
|
+
export class ShieldTransitionWASM {
|
|
8
|
+
/** @private **/
|
|
9
|
+
_rawShieldTransition;
|
|
10
|
+
constructor(inputs, actions, amount, anchor, proof, bindingsSignature, feeStrategy, userFeeIncrease, inputWitnesses) {
|
|
11
|
+
this._rawShieldTransition = new dppProvider.dpp.ShieldTransitionNAPI(inputs.map(i => i._rawInputAddress), actions.map(a => a._rawSerializedAction), amount.toString(), anchor, proof, bindingsSignature, feeStrategy.map(s => s._rawAddressFundsFeeStrategyStep), userFeeIncrease, inputWitnesses.map(w => w._rawWitness));
|
|
12
|
+
}
|
|
13
|
+
get inputs() {
|
|
14
|
+
return this._rawShieldTransition.inputs.map(InputAddressWASM.createFromRawInstance);
|
|
15
|
+
}
|
|
16
|
+
set inputs(value) {
|
|
17
|
+
this._rawShieldTransition.inputs = value.map(i => i._rawInputAddress);
|
|
18
|
+
}
|
|
19
|
+
get actions() {
|
|
20
|
+
return this._rawShieldTransition.actions.map(SerializedActionWASM.createFromRawInstance);
|
|
21
|
+
}
|
|
22
|
+
set actions(value) {
|
|
23
|
+
this._rawShieldTransition.actions = value.map(a => a._rawSerializedAction);
|
|
24
|
+
}
|
|
25
|
+
get amount() {
|
|
26
|
+
return BigInt(this._rawShieldTransition.amount);
|
|
27
|
+
}
|
|
28
|
+
set amount(value) {
|
|
29
|
+
this._rawShieldTransition.amount = value.toString();
|
|
30
|
+
}
|
|
31
|
+
get anchor() {
|
|
32
|
+
return this._rawShieldTransition.anchor;
|
|
33
|
+
}
|
|
34
|
+
set anchor(value) {
|
|
35
|
+
this._rawShieldTransition.anchor = value;
|
|
36
|
+
}
|
|
37
|
+
get proof() {
|
|
38
|
+
return this._rawShieldTransition.proof;
|
|
39
|
+
}
|
|
40
|
+
set proof(value) {
|
|
41
|
+
this._rawShieldTransition.proof = value;
|
|
42
|
+
}
|
|
43
|
+
get bindingsSignature() {
|
|
44
|
+
return this._rawShieldTransition.bindingsSignature;
|
|
45
|
+
}
|
|
46
|
+
set bindingsSignature(value) {
|
|
47
|
+
this._rawShieldTransition.bindingsSignature = value;
|
|
48
|
+
}
|
|
49
|
+
get feeStrategy() {
|
|
50
|
+
return this._rawShieldTransition.feeStrategy.map(AddressFundsFeeStrategyStepWASM.createFromRawInstance);
|
|
51
|
+
}
|
|
52
|
+
set feeStrategy(value) {
|
|
53
|
+
this._rawShieldTransition.feeStrategy = value.map(s => s._rawAddressFundsFeeStrategyStep);
|
|
54
|
+
}
|
|
55
|
+
get userFeeIncrease() {
|
|
56
|
+
return this._rawShieldTransition.userFeeIncrease;
|
|
57
|
+
}
|
|
58
|
+
set userFeeIncrease(value) {
|
|
59
|
+
this._rawShieldTransition.userFeeIncrease = value;
|
|
60
|
+
}
|
|
61
|
+
get inputWitnesses() {
|
|
62
|
+
return this._rawShieldTransition.inputWitnesses.map(AddressWitnessWASM.createFromRawInstance);
|
|
63
|
+
}
|
|
64
|
+
set inputWitnesses(value) {
|
|
65
|
+
this._rawShieldTransition.inputWitnesses = value.map(w => w._rawWitness);
|
|
66
|
+
}
|
|
67
|
+
toStateTransition() {
|
|
68
|
+
return StateTransitionWASM.createFromRawInstance(this._rawShieldTransition.toStateTransition());
|
|
69
|
+
}
|
|
70
|
+
static fromStateTransition(st) {
|
|
71
|
+
return ShieldTransitionWASM.createFromRawInstance(dppProvider.dpp.ShieldTransitionNAPI.fromStateTransition(st._rawStateTransition));
|
|
72
|
+
}
|
|
73
|
+
static createFromRawInstance(rawInstance) {
|
|
74
|
+
const instance = Object.create(ShieldTransitionWASM.prototype);
|
|
75
|
+
instance._rawShieldTransition = rawInstance;
|
|
76
|
+
return instance;
|
|
77
|
+
}
|
|
78
|
+
}
|