pshenmic-dpp 2.0.0-dev.9 → 2.0.0
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/README.md +164 -77
- package/dist/binaries/bindingsTypes.d.ts +903 -18
- package/dist/binaries/bindingsTypes.js +13 -0
- package/dist/binaries/memory.cjs +7 -0
- package/dist/binaries/memory.d.cts +2 -0
- package/dist/binaries/native/aarch64-apple-darwin/pshenmic_dpp.node +0 -0
- package/dist/binaries/native/aarch64-pc-windows-msvc/pshenmic_dpp.node +0 -0
- package/dist/binaries/native/aarch64-unknown-linux-gnu/pshenmic_dpp.node +0 -0
- package/dist/binaries/native/aarch64-unknown-linux-musl/pshenmic_dpp.node +0 -0
- package/dist/binaries/native/x86_64-apple-darwin/pshenmic_dpp.node +0 -0
- package/dist/binaries/native/x86_64-pc-windows-msvc/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 +71 -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 +60 -0
- package/dist/binaries/pshenmic_dpp.js +1 -1
- package/dist/binaries/wasm/wasmBytes.cjs +4 -0
- package/dist/binaries/wasm/wasmBytes.d.cts +2 -0
- package/dist/binaries/wasm/workerBundle.cjs +6 -0
- package/dist/binaries/wasm/workerBundle.d.cts +2 -0
- package/dist/binaries/wasm.d.ts +60 -0
- package/dist/binaries/wasm.js +2 -44
- package/dist/binaries/wasmCreation.cjs +127 -0
- package/dist/binaries/wasmCreation.d.cts +4 -0
- package/dist/src/dpp/dpp.d.ts +32 -0
- package/dist/src/dpp/dpp.js +32 -0
- package/dist/src/dpp/enums.d.ts +1 -1
- package/dist/src/dpp/enums.js +1 -1
- package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.d.ts +3 -1
- package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.js +6 -0
- package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.d.ts +2 -1
- package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.js +3 -0
- package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.d.ts +3 -1
- package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.js +6 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.d.ts +2 -1
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.js +3 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.d.ts +2 -1
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.js +3 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.d.ts +2 -1
- package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.js +3 -0
- package/dist/src/dpp/structs/Batch/BatchTransition.d.ts +2 -1
- package/dist/src/dpp/structs/Batch/BatchTransition.js +3 -0
- package/dist/src/dpp/structs/DataContractTransitions/DataContractCreateTransition.d.ts +2 -1
- package/dist/src/dpp/structs/DataContractTransitions/DataContractCreateTransition.js +3 -0
- package/dist/src/dpp/structs/DataContractTransitions/DataContractUpdateTransition.d.ts +2 -1
- package/dist/src/dpp/structs/DataContractTransitions/DataContractUpdateTransition.js +3 -0
- package/dist/src/dpp/structs/Identifier.js +3 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreateTransition.d.ts +2 -1
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreateTransition.js +3 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditTransfer.d.ts +2 -1
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditTransfer.js +3 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditWithdrawalTransition.d.ts +2 -1
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditWithdrawalTransition.js +3 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityTopUpTransition.d.ts +2 -1
- package/dist/src/dpp/structs/IdentityTransitions/IdentityTopUpTransition.js +3 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityUpdateTransition.d.ts +2 -1
- package/dist/src/dpp/structs/IdentityTransitions/IdentityUpdateTransition.js +3 -0
- package/dist/src/dpp/structs/MasternodeVote/MasternodeVoteTransition.d.ts +2 -3
- package/dist/src/dpp/structs/MasternodeVote/MasternodeVoteTransition.js +3 -6
- package/dist/src/dpp/structs/Orchard/CommitmentTree.d.ts +14 -0
- package/dist/src/dpp/structs/Orchard/CommitmentTree.js +31 -0
- package/dist/src/dpp/structs/Orchard/FullViewingKey.d.ts +27 -0
- package/dist/src/dpp/structs/Orchard/FullViewingKey.js +45 -0
- package/dist/src/dpp/structs/Orchard/IdentityCreateFromShieldedPoolResult.d.ts +21 -0
- package/dist/src/dpp/structs/Orchard/IdentityCreateFromShieldedPoolResult.js +38 -0
- package/dist/src/dpp/structs/Orchard/IncomingViewingKey.d.ts +29 -0
- package/dist/src/dpp/structs/Orchard/IncomingViewingKey.js +44 -0
- package/dist/src/dpp/structs/Orchard/MerklePath.d.ts +11 -0
- package/dist/src/dpp/structs/Orchard/MerklePath.js +25 -0
- package/dist/src/dpp/structs/Orchard/Note.d.ts +18 -0
- package/dist/src/dpp/structs/Orchard/Note.js +42 -0
- package/dist/src/dpp/structs/Orchard/OrchardAddress.d.ts +27 -0
- package/dist/src/dpp/structs/Orchard/OrchardAddress.js +45 -0
- package/dist/src/dpp/structs/Orchard/OrchardProver.d.ts +19 -0
- package/dist/src/dpp/structs/Orchard/OrchardProver.js +34 -0
- package/dist/src/dpp/structs/Orchard/RecoveredNote.d.ts +19 -0
- package/dist/src/dpp/structs/Orchard/RecoveredNote.js +32 -0
- package/dist/src/dpp/structs/Orchard/ShieldedBuilder.d.ts +64 -0
- package/dist/src/dpp/structs/Orchard/ShieldedBuilder.js +79 -0
- package/dist/src/dpp/structs/Orchard/ShieldedMemo.d.ts +11 -0
- package/dist/src/dpp/structs/Orchard/ShieldedMemo.js +25 -0
- package/dist/src/dpp/structs/Orchard/ShieldedOutput.d.ts +23 -0
- package/dist/src/dpp/structs/Orchard/ShieldedOutput.js +41 -0
- package/dist/src/dpp/structs/Orchard/ShieldedWithdrawalResult.d.ts +11 -0
- package/dist/src/dpp/structs/Orchard/ShieldedWithdrawalResult.js +18 -0
- package/dist/src/dpp/structs/Orchard/SpendableNote.d.ts +13 -0
- package/dist/src/dpp/structs/Orchard/SpendableNote.js +27 -0
- package/dist/src/dpp/structs/PlatformAddress/PlatformAddress.d.ts +9 -1
- package/dist/src/dpp/structs/PlatformAddress/PlatformAddress.js +10 -0
- package/dist/src/dpp/structs/ShieldedTransitions/IdentityCreateFromShieldedPoolTransition.d.ts +32 -0
- package/dist/src/dpp/structs/ShieldedTransitions/IdentityCreateFromShieldedPoolTransition.js +76 -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 +31 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldFromAssetLockTransition.js +80 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldTransition.d.ts +33 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldTransition.js +81 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldedTransferTransition.d.ts +22 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldedTransferTransition.js +54 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldedWithdrawalTransition.d.ts +30 -0
- package/dist/src/dpp/structs/ShieldedTransitions/ShieldedWithdrawalTransition.js +74 -0
- package/dist/src/dpp/structs/ShieldedTransitions/UnshieldTransition.d.ts +26 -0
- package/dist/src/dpp/structs/ShieldedTransitions/UnshieldTransition.js +62 -0
- package/dist/src/dpp/structs/StateTransition.d.ts +2 -1
- package/dist/src/dpp/structs/StateTransition.js +3 -0
- package/dist/src/dpp/types.d.ts +177 -3
- package/dist/src/dpp/verify/AddressFunds/utils.d.ts +5 -0
- package/dist/src/dpp/verify/AddressFunds/utils.js +28 -0
- package/dist/src/dpp/verify/AddressFunds/verifyAddressesBranchState.d.ts +12 -0
- package/dist/src/dpp/verify/AddressFunds/verifyAddressesBranchState.js +29 -0
- package/dist/src/dpp/verify/AddressFunds/verifyAddressesTrunkState.d.ts +9 -0
- package/dist/src/dpp/verify/AddressFunds/verifyAddressesTrunkState.js +30 -0
- package/dist/src/dpp/verify/AddressFunds/verifyRecentAddressBalanceChanges.d.ts +9 -0
- package/dist/src/dpp/verify/AddressFunds/verifyRecentAddressBalanceChanges.js +24 -0
- package/dist/src/dpp/verify/AddressFunds/verifyRecentCompactedAddressBalanceChanges.d.ts +10 -0
- package/dist/src/dpp/verify/AddressFunds/verifyRecentCompactedAddressBalanceChanges.js +30 -0
- 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/Shielded/verifyMostRecentShieldedAnchorProof.d.ts +2 -0
- package/dist/src/dpp/verify/Shielded/verifyMostRecentShieldedAnchorProof.js +9 -0
- package/dist/src/dpp/verify/Shielded/verifyShieldedAnchorsProof.d.ts +2 -0
- package/dist/src/dpp/verify/Shielded/verifyShieldedAnchorsProof.js +9 -0
- package/dist/src/dpp/verify/Shielded/verifyShieldedEncryptedNotesProof.d.ts +2 -0
- package/dist/src/dpp/verify/Shielded/verifyShieldedEncryptedNotesProof.js +15 -0
- package/dist/src/dpp/verify/Shielded/verifyShieldedNotesCountProof.d.ts +2 -0
- package/dist/src/dpp/verify/Shielded/verifyShieldedNotesCountProof.js +9 -0
- package/dist/src/dpp/verify/Shielded/verifyShieldedNullifiersProof.d.ts +2 -0
- package/dist/src/dpp/verify/Shielded/verifyShieldedNullifiersProof.js +12 -0
- package/dist/src/dpp/verify/Shielded/verifyShieldedPoolStateProof.d.ts +2 -0
- package/dist/src/dpp/verify/Shielded/verifyShieldedPoolStateProof.js +9 -0
- package/dist/src/dpp/verify/StateTransition/utils.js +76 -11
- package/dist/src/dpp/verify/StateTransition/verifyStateTransitionResult.js +2 -1
- package/dist/src/dpp/verify/System/verifyFinalizedEpochInfosProof.d.ts +2 -0
- package/dist/src/dpp/verify/System/verifyFinalizedEpochInfosProof.js +27 -0
- 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 +17 -27
- package/tests/unit/AddressTransitionsFees.spec.ts +274 -0
- package/tests/unit/DataContract.spec.ts +281 -0
- package/tests/unit/DynamicValue.spec.ts +2 -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/Shielded.spec.ts +555 -0
- package/tests/unit/ShieldedTransitions.spec.ts +877 -0
- package/tests/unit/StateTransitionFees.spec.ts +177 -0
- package/tests/unit/TokenConfiguration.spec.ts +114 -0
- package/tests/unit/WebAssembly.spec.ts +88 -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
package/dist/binaries/wasm.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
export const orchardOvkFromSeed: any;
|
|
2
|
+
export const recoverNotes: any;
|
|
3
|
+
export const verifyAddressesBranchState: any;
|
|
1
4
|
export const verifyAddressesInfos: any;
|
|
5
|
+
export const verifyAddressesTrunkState: any;
|
|
2
6
|
export const verifyAddressInfo: any;
|
|
3
7
|
export const verifyContractProof: any;
|
|
4
8
|
export const verifyDocumentsProof: any;
|
|
5
9
|
export const verifyEpochsInfoProof: any;
|
|
10
|
+
export const verifyFinalizedEpochInfosProof: any;
|
|
6
11
|
export const verifyIdentifierByNonUniquePublicKeyHashProof: any;
|
|
7
12
|
export const verifyIdentityBalanceProof: any;
|
|
8
13
|
export const verifyIdentityByIdentifierProof: any;
|
|
@@ -10,6 +15,14 @@ export const verifyIdentityByUniqueKeyHashProof: any;
|
|
|
10
15
|
export const verifyIdentityContractNonceProof: any;
|
|
11
16
|
export const verifyIdentityKeysByIdentifierProof: any;
|
|
12
17
|
export const verifyIdentityNonceProof: any;
|
|
18
|
+
export const verifyMostRecentShieldedAnchorProof: any;
|
|
19
|
+
export const verifyRecentAddressBalanceChanges: any;
|
|
20
|
+
export const verifyRecentCompactedAddressBalanceChanges: any;
|
|
21
|
+
export const verifyShieldedAnchorsProof: any;
|
|
22
|
+
export const verifyShieldedEncryptedNotesProof: any;
|
|
23
|
+
export const verifyShieldedNotesCountProof: any;
|
|
24
|
+
export const verifyShieldedNullifiersProof: any;
|
|
25
|
+
export const verifyShieldedPoolStateProof: any;
|
|
13
26
|
export const verifySignatureDigest: any;
|
|
14
27
|
export const verifyStateTransitionResult: any;
|
|
15
28
|
export const verifyTokenBalancesForIdentitiesProof: any;
|
|
@@ -20,19 +33,26 @@ export const verifyTokenTotalSupplyProof: any;
|
|
|
20
33
|
export const verifyTotalCreditsProof: any;
|
|
21
34
|
export const verifyVotePollVoteStateProof: any;
|
|
22
35
|
export const ActionTakerNAPI: any;
|
|
36
|
+
export const AddressBalanceChangeNAPI: any;
|
|
23
37
|
export const AddressCreditWithdrawalTransitionNAPI: any;
|
|
24
38
|
export const AddressFundingFromAssetLockTransitionNAPI: any;
|
|
25
39
|
export const AddressFundsFeeStrategyStepNAPI: any;
|
|
26
40
|
export const AddressFundsTransferTransitionNAPI: any;
|
|
27
41
|
export const AddressWitnessNAPI: any;
|
|
28
42
|
export const AssetLockProofNAPI: any;
|
|
43
|
+
export const AssetLockValueNAPI: any;
|
|
29
44
|
export const AuthorizedActionTakersNAPI: any;
|
|
30
45
|
export const BatchedTransitionNAPI: any;
|
|
31
46
|
export const BatchTransitionNAPI: any;
|
|
47
|
+
export const BlockAddressBalanceChangesNAPI: any;
|
|
32
48
|
export const BlockBasedDistributionNAPI: any;
|
|
49
|
+
export const BlockHeightCreditNAPI: any;
|
|
33
50
|
export const BlockInfoNAPI: any;
|
|
34
51
|
export const ChainAssetLockProofNAPI: any;
|
|
35
52
|
export const ChangeControlRulesNAPI: any;
|
|
53
|
+
export const CommitmentTreeNAPI: any;
|
|
54
|
+
export const CompactedAddressBalanceChangeNAPI: any;
|
|
55
|
+
export const CompactedBlockAddressBalanceChangesNAPI: any;
|
|
36
56
|
export const ConsensusErrorNAPI: any;
|
|
37
57
|
export const ContenderWithSerializedDocumentNAPI: any;
|
|
38
58
|
export const ContestedDocumentVotePollQueryExecutionResultNAPI: any;
|
|
@@ -54,10 +74,18 @@ export const DocumentUpdatePriceTransitionNAPI: any;
|
|
|
54
74
|
export const DynamicValue: any;
|
|
55
75
|
export const EpochBasedDistributionNAPI: any;
|
|
56
76
|
export const ExtendedEpochInfoNAPI: any;
|
|
77
|
+
export const FinalizedEpochInfoNAPI: any;
|
|
78
|
+
export const FullViewingKeyNAPI: any;
|
|
57
79
|
export const GroupNAPI: any;
|
|
58
80
|
export const GroupStateTransitionInfoNAPI: any;
|
|
81
|
+
export const GroveAncestorNAPI: any;
|
|
82
|
+
export const GroveElementEntryNAPI: any;
|
|
83
|
+
export const GroveElementNAPI: any;
|
|
84
|
+
export const GroveLeafInfoNAPI: any;
|
|
59
85
|
export const IdentifierNAPI: any;
|
|
60
86
|
export const IdentityCreateFromAddressesTransitionNAPI: any;
|
|
87
|
+
export const IdentityCreateFromShieldedPoolResultNAPI: any;
|
|
88
|
+
export const IdentityCreateFromShieldedPoolTransitionNAPI: any;
|
|
61
89
|
export const IdentityCreateTransitionNAPI: any;
|
|
62
90
|
export const IdentityCreditTransferNAPI: any;
|
|
63
91
|
export const IdentityCreditTransferToAddressesTransitionNAPI: any;
|
|
@@ -71,10 +99,15 @@ export const IdentityTokenInfoNAPI: any;
|
|
|
71
99
|
export const IdentityTopUpFromAddressesTransitionNAPI: any;
|
|
72
100
|
export const IdentityTopUpTransitionNAPI: any;
|
|
73
101
|
export const IdentityUpdateTransitionNAPI: any;
|
|
102
|
+
export const IncomingViewingKeyNAPI: any;
|
|
74
103
|
export const InputAddressNAPI: any;
|
|
75
104
|
export const InstantAssetLockProofNAPI: any;
|
|
76
105
|
export const InstantLockNAPI: any;
|
|
77
106
|
export const MasternodeVoteTransitionNAPI: any;
|
|
107
|
+
export const MerklePathNAPI: any;
|
|
108
|
+
export const NoteNAPI: any;
|
|
109
|
+
export const OrchardAddressNAPI: any;
|
|
110
|
+
export const OrchardProverNAPI: any;
|
|
78
111
|
export const OutPointNAPI: any;
|
|
79
112
|
export const OutputAddressNAPI: any;
|
|
80
113
|
export const OutputAddressNullableCreditsNAPI: any;
|
|
@@ -85,10 +118,22 @@ export const PrefundedVotingBalanceNAPI: any;
|
|
|
85
118
|
export const PrivateEncryptedNoteNAPI: any;
|
|
86
119
|
export const PrivateKeyNAPI: any;
|
|
87
120
|
export const PublicKeyNAPI: any;
|
|
121
|
+
export const RecoveredNoteNAPI: any;
|
|
88
122
|
export const ResourceVoteChoiceNAPI: any;
|
|
89
123
|
export const RewardDistributionTypeNAPI: any;
|
|
124
|
+
export const SerializedActionNAPI: any;
|
|
90
125
|
export const SharedEncryptedNoteNAPI: any;
|
|
126
|
+
export const ShieldedBuilderNAPI: any;
|
|
127
|
+
export const ShieldedMemoNAPI: any;
|
|
128
|
+
export const ShieldedOutputNAPI: any;
|
|
129
|
+
export const ShieldedTransferTransitionNAPI: any;
|
|
130
|
+
export const ShieldedWithdrawalResultNAPI: any;
|
|
131
|
+
export const ShieldedWithdrawalTransitionNAPI: any;
|
|
132
|
+
export const ShieldFromAssetLockTransitionNAPI: any;
|
|
133
|
+
export const ShieldTransitionNAPI: any;
|
|
134
|
+
export const SpendableNoteNAPI: any;
|
|
91
135
|
export const StateTransitionNAPI: any;
|
|
136
|
+
export const StoredAssetLockInfoNAPI: any;
|
|
92
137
|
export const TimeBasedDistributionNAPI: any;
|
|
93
138
|
export const TokenBaseTransitionNAPI: any;
|
|
94
139
|
export const TokenBurnTransitionNAPI: any;
|
|
@@ -122,11 +167,15 @@ export const TotalSingleTokenBalanceNAPI: any;
|
|
|
122
167
|
export const TransactionNAPI: any;
|
|
123
168
|
export const TxInNAPI: any;
|
|
124
169
|
export const TxOutNAPI: any;
|
|
170
|
+
export const UnshieldTransitionNAPI: any;
|
|
171
|
+
export const VerifiedAddressesBranchStateNAPI: any;
|
|
172
|
+
export const VerifiedAddressesTrunkStateNAPI: any;
|
|
125
173
|
export const VerifiedBalanceTransferNAPI: any;
|
|
126
174
|
export const VerifiedContractNAPI: any;
|
|
127
175
|
export const VerifiedDocumentNAPI: any;
|
|
128
176
|
export const VerifiedDocumentsNAPI: any;
|
|
129
177
|
export const VerifiedEpochsInfoNAPI: any;
|
|
178
|
+
export const VerifiedFinlizedEpochInfosNAPI: any;
|
|
130
179
|
export const VerifiedIdentifierByNonUniquePublicKeyHashNAPI: any;
|
|
131
180
|
export const VerifiedIdentityBalanceRootHashNAPI: any;
|
|
132
181
|
export const VerifiedIdentityByIdentifierNAPI: any;
|
|
@@ -137,8 +186,18 @@ export const VerifiedIdentityKeysByIdentifierNAPI: any;
|
|
|
137
186
|
export const VerifiedIdentityNonceNAPI: any;
|
|
138
187
|
export const VerifiedIdentityTokenInfoNAPI: any;
|
|
139
188
|
export const VerifiedIdentityWithAddressInfosNAPI: any;
|
|
189
|
+
export const VerifiedMostRecentShieldedAnchorNAPI: any;
|
|
140
190
|
export const VerifiedPlatformAddressesInfosNAPI: any;
|
|
141
191
|
export const VerifiedPlatformAddressInfoNAPI: any;
|
|
192
|
+
export const VerifiedRecentAddressBalanceChangesNAPI: any;
|
|
193
|
+
export const VerifiedRecentCompactedAddressBalanceChangesNAPI: any;
|
|
194
|
+
export const VerifiedShieldedAnchorsNAPI: any;
|
|
195
|
+
export const VerifiedShieldedEncryptedNoteNAPI: any;
|
|
196
|
+
export const VerifiedShieldedEncryptedNotesNAPI: any;
|
|
197
|
+
export const VerifiedShieldedNotesCountNAPI: any;
|
|
198
|
+
export const VerifiedShieldedNullifierNAPI: any;
|
|
199
|
+
export const VerifiedShieldedNullifiersNAPI: any;
|
|
200
|
+
export const VerifiedShieldedPoolStateNAPI: any;
|
|
142
201
|
export const VerifiedStateTransitionResultNAPI: any;
|
|
143
202
|
export const VerifiedTokenBalancesForIdentitiesNAPI: any;
|
|
144
203
|
export const VerifiedTokenContractInfoNAPI: any;
|
|
@@ -165,6 +224,7 @@ export const NetworkNAPI: any;
|
|
|
165
224
|
export const PlatformVersionNAPI: any;
|
|
166
225
|
export const PoolingNAPI: any;
|
|
167
226
|
export const PurposeNAPI: any;
|
|
227
|
+
export const ScopeNAPI: any;
|
|
168
228
|
export const SecurityLevelNAPI: any;
|
|
169
229
|
export const TokenDistributionTypeNAPI: any;
|
|
170
230
|
export const TokenEmergencyActionNAPI: any;
|
package/dist/binaries/wasm.js
CHANGED
|
@@ -1,44 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { instantiateNapiModuleSync } from '@emnapi/core';
|
|
4
|
-
import { bytes } from './wasm/wasmBytes.js';
|
|
5
|
-
import { decode } from '../utils/base122.js';
|
|
6
|
-
import { decompressSync } from 'fflate';
|
|
7
|
-
const wasmBytes = new Uint8Array(decode(bytes));
|
|
8
|
-
const wasi = new WASI({
|
|
9
|
-
version: 'preview1',
|
|
10
|
-
print: function () {
|
|
11
|
-
console.log.apply(console, arguments);
|
|
12
|
-
},
|
|
13
|
-
printErr: function () {
|
|
14
|
-
console.error.apply(console, arguments);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
const emnapiContext = getDefaultContext();
|
|
18
|
-
emnapiContext.feature.supportNewFunction = false;
|
|
19
|
-
emnapiContext.feature.supportBigInt = false;
|
|
20
|
-
const __sharedMemory = new WebAssembly.Memory({
|
|
21
|
-
initial: 1000,
|
|
22
|
-
maximum: 2000,
|
|
23
|
-
shared: true
|
|
24
|
-
});
|
|
25
|
-
const wasm = instantiateNapiModuleSync(decompressSync(wasmBytes), {
|
|
26
|
-
context: emnapiContext,
|
|
27
|
-
wasi,
|
|
28
|
-
overwriteImports(importObject) {
|
|
29
|
-
importObject.env = {
|
|
30
|
-
...importObject.env,
|
|
31
|
-
...importObject.napi,
|
|
32
|
-
...importObject.emnapi,
|
|
33
|
-
memory: __sharedMemory
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
beforeInit({ instance }) {
|
|
37
|
-
for (const name of Object.keys(instance.exports)) {
|
|
38
|
-
if (name.startsWith('__napi_register__')) {
|
|
39
|
-
instance.exports[name]();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
export const { verifyAddressesInfos, verifyAddressInfo, 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, PlatformAddressInfoNAPI, 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, VerifiedBalanceTransferNAPI, VerifiedContractNAPI, VerifiedDocumentNAPI, VerifiedDocumentsNAPI, VerifiedEpochsInfoNAPI, VerifiedIdentifierByNonUniquePublicKeyHashNAPI, VerifiedIdentityBalanceRootHashNAPI, VerifiedIdentityByIdentifierNAPI, VerifiedIdentityByUniqueKeyHashNAPI, VerifiedIdentityContractNonceNAPI, VerifiedIdentityFullWithAddressInfosNAPI, VerifiedIdentityKeysByIdentifierNAPI, VerifiedIdentityNonceNAPI, VerifiedIdentityTokenInfoNAPI, VerifiedIdentityWithAddressInfosNAPI, VerifiedPlatformAddressesInfosNAPI, VerifiedPlatformAddressInfoNAPI, 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;
|
|
1
|
+
import * as protocol from "./wasmCreation.cjs";
|
|
2
|
+
export const { orchardOvkFromSeed, recoverNotes, verifyAddressesBranchState, verifyAddressesInfos, verifyAddressesTrunkState, verifyAddressInfo, verifyContractProof, verifyDocumentsProof, verifyEpochsInfoProof, verifyFinalizedEpochInfosProof, verifyIdentifierByNonUniquePublicKeyHashProof, verifyIdentityBalanceProof, verifyIdentityByIdentifierProof, verifyIdentityByUniqueKeyHashProof, verifyIdentityContractNonceProof, verifyIdentityKeysByIdentifierProof, verifyIdentityNonceProof, verifyMostRecentShieldedAnchorProof, verifyRecentAddressBalanceChanges, verifyRecentCompactedAddressBalanceChanges, verifyShieldedAnchorsProof, verifyShieldedEncryptedNotesProof, verifyShieldedNotesCountProof, verifyShieldedNullifiersProof, verifyShieldedPoolStateProof, verifySignatureDigest, verifyStateTransitionResult, verifyTokenBalancesForIdentitiesProof, verifyTokenContractInfoProof, verifyTokenDirectPurchasePrices, verifyTokensBalancesForIdentityProof, verifyTokenTotalSupplyProof, verifyTotalCreditsProof, verifyVotePollVoteStateProof, ActionTakerNAPI, AddressBalanceChangeNAPI, AddressCreditWithdrawalTransitionNAPI, AddressFundingFromAssetLockTransitionNAPI, AddressFundsFeeStrategyStepNAPI, AddressFundsTransferTransitionNAPI, AddressWitnessNAPI, AssetLockProofNAPI, AssetLockValueNAPI, AuthorizedActionTakersNAPI, BatchedTransitionNAPI, BatchTransitionNAPI, BlockAddressBalanceChangesNAPI, BlockBasedDistributionNAPI, BlockHeightCreditNAPI, BlockInfoNAPI, ChainAssetLockProofNAPI, ChangeControlRulesNAPI, CommitmentTreeNAPI, CompactedAddressBalanceChangeNAPI, CompactedBlockAddressBalanceChangesNAPI, ConsensusErrorNAPI, ContenderWithSerializedDocumentNAPI, ContestedDocumentVotePollQueryExecutionResultNAPI, ContractBoundsNAPI, CoreScriptNAPI, DataContractCreateTransitionNAPI, DataContractNAPI, DataContractUpdateTransitionNAPI, DistributionFunctionNAPI, DocumentBaseTransitionNAPI, DocumentCreateTransitionNAPI, DocumentDeleteTransitionNAPI, DocumentNAPI, DocumentPurchaseTransitionNAPI, DocumentReplaceTransitionNAPI, DocumentTransferTransitionNAPI, DocumentTransitionNAPI, DocumentUpdatePriceTransitionNAPI, DynamicValue, EpochBasedDistributionNAPI, ExtendedEpochInfoNAPI, FinalizedEpochInfoNAPI, FullViewingKeyNAPI, GroupNAPI, GroupStateTransitionInfoNAPI, GroveAncestorNAPI, GroveElementEntryNAPI, GroveElementNAPI, GroveLeafInfoNAPI, IdentifierNAPI, IdentityCreateFromAddressesTransitionNAPI, IdentityCreateFromShieldedPoolResultNAPI, IdentityCreateFromShieldedPoolTransitionNAPI, IdentityCreateTransitionNAPI, IdentityCreditTransferNAPI, IdentityCreditTransferToAddressesTransitionNAPI, IdentityCreditWithdrawalTransitionNAPI, IdentityNAPI, IdentityPublicKeyInCreationNAPI, IdentityPublicKeyNAPI, IdentityTokenBalanceNAPI, IdentityTokenBalanceOptionalNAPI, IdentityTokenInfoNAPI, IdentityTopUpFromAddressesTransitionNAPI, IdentityTopUpTransitionNAPI, IdentityUpdateTransitionNAPI, IncomingViewingKeyNAPI, InputAddressNAPI, InstantAssetLockProofNAPI, InstantLockNAPI, MasternodeVoteTransitionNAPI, MerklePathNAPI, NoteNAPI, OrchardAddressNAPI, OrchardProverNAPI, OutPointNAPI, OutputAddressNAPI, OutputAddressNullableCreditsNAPI, PartialIdentityNAPI, PlatformAddressInfoNAPI, PlatformAddressNAPI, PrefundedVotingBalanceNAPI, PrivateEncryptedNoteNAPI, PrivateKeyNAPI, PublicKeyNAPI, RecoveredNoteNAPI, ResourceVoteChoiceNAPI, RewardDistributionTypeNAPI, SerializedActionNAPI, SharedEncryptedNoteNAPI, ShieldedBuilderNAPI, ShieldedMemoNAPI, ShieldedOutputNAPI, ShieldedTransferTransitionNAPI, ShieldedWithdrawalResultNAPI, ShieldedWithdrawalTransitionNAPI, ShieldFromAssetLockTransitionNAPI, ShieldTransitionNAPI, SpendableNoteNAPI, StateTransitionNAPI, StoredAssetLockInfoNAPI, 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, UnshieldTransitionNAPI, VerifiedAddressesBranchStateNAPI, VerifiedAddressesTrunkStateNAPI, VerifiedBalanceTransferNAPI, VerifiedContractNAPI, VerifiedDocumentNAPI, VerifiedDocumentsNAPI, VerifiedEpochsInfoNAPI, VerifiedFinlizedEpochInfosNAPI, VerifiedIdentifierByNonUniquePublicKeyHashNAPI, VerifiedIdentityBalanceRootHashNAPI, VerifiedIdentityByIdentifierNAPI, VerifiedIdentityByUniqueKeyHashNAPI, VerifiedIdentityContractNonceNAPI, VerifiedIdentityFullWithAddressInfosNAPI, VerifiedIdentityKeysByIdentifierNAPI, VerifiedIdentityNonceNAPI, VerifiedIdentityTokenInfoNAPI, VerifiedIdentityWithAddressInfosNAPI, VerifiedMostRecentShieldedAnchorNAPI, VerifiedPlatformAddressesInfosNAPI, VerifiedPlatformAddressInfoNAPI, VerifiedRecentAddressBalanceChangesNAPI, VerifiedRecentCompactedAddressBalanceChangesNAPI, VerifiedShieldedAnchorsNAPI, VerifiedShieldedEncryptedNoteNAPI, VerifiedShieldedEncryptedNotesNAPI, VerifiedShieldedNotesCountNAPI, VerifiedShieldedNullifierNAPI, VerifiedShieldedNullifiersNAPI, VerifiedShieldedPoolStateNAPI, 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, ScopeNAPI, SecurityLevelNAPI, TokenDistributionTypeNAPI, TokenEmergencyActionNAPI, VoteStateResultTypeNAPI } = protocol.default;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const { WASI } = require('@tybys/wasm-util');
|
|
3
|
+
const { getDefaultContext } = require('@emnapi/runtime');
|
|
4
|
+
const { instantiateNapiModuleSync, MessageHandler } = require('@emnapi/core');
|
|
5
|
+
const emnapiContext = getDefaultContext();
|
|
6
|
+
emnapiContext.feature.supportNewFunction = false;
|
|
7
|
+
emnapiContext.feature.supportBigInt = false;
|
|
8
|
+
const isNode = typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
|
|
9
|
+
const nodeWorkerThreads = isNode ? require('worker_threads') : null;
|
|
10
|
+
const isWorker = isNode
|
|
11
|
+
? !nodeWorkerThreads.isMainThread
|
|
12
|
+
: (typeof self !== 'undefined' && !self.document);
|
|
13
|
+
if (isWorker) {
|
|
14
|
+
// wasi pthread worker: the main thread posts the compiled module + shared
|
|
15
|
+
// memory here and this instantiates a child-thread copy over them. Async
|
|
16
|
+
// `#[napi]` fns (the Halo 2 proving stack) run on these threads.
|
|
17
|
+
const postMsg = isNode
|
|
18
|
+
? (d) => nodeWorkerThreads.parentPort.postMessage(d)
|
|
19
|
+
: (d) => self.postMessage(d);
|
|
20
|
+
if (isNode) {
|
|
21
|
+
// emnapi's threadsafe-function dispatch calls the bare global
|
|
22
|
+
// `postMessage` from pthread contexts (a Web Worker global); Node
|
|
23
|
+
// worker_threads doesn't have it, so polyfill with parentPort.
|
|
24
|
+
globalThis.self = globalThis;
|
|
25
|
+
globalThis.postMessage = postMsg;
|
|
26
|
+
}
|
|
27
|
+
const handler = new MessageHandler({
|
|
28
|
+
postMessage: postMsg,
|
|
29
|
+
onLoad({ wasmModule, wasmMemory }) {
|
|
30
|
+
const wasi = new WASI({ version: 'preview1' });
|
|
31
|
+
return instantiateNapiModuleSync(wasmModule, {
|
|
32
|
+
childThread: true,
|
|
33
|
+
wasi,
|
|
34
|
+
context: emnapiContext,
|
|
35
|
+
postMessage: postMsg,
|
|
36
|
+
overwriteImports(importObject) {
|
|
37
|
+
importObject.env = {
|
|
38
|
+
...importObject.env,
|
|
39
|
+
...importObject.napi,
|
|
40
|
+
...importObject.emnapi,
|
|
41
|
+
memory: wasmMemory
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
if (isNode) {
|
|
48
|
+
nodeWorkerThreads.parentPort.on('message', (data) => handler.handle({ data }));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
self.onmessage = (e) => handler.handle({ data: e.data });
|
|
52
|
+
}
|
|
53
|
+
module.exports = null;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
// Main thread only. This block must NEVER run in a worker: it decodes,
|
|
57
|
+
// decompresses and sync-compiles the whole 7.5MB module and allocates a
|
|
58
|
+
// fresh 64MB shared memory — workers receive the already-compiled module
|
|
59
|
+
// and the real memory via the 'load' message instead. Running it per
|
|
60
|
+
// worker multiplies init time by the core count (rayon spawns one thread
|
|
61
|
+
// per core while building the proving key).
|
|
62
|
+
const { bytes } = require('./wasm/wasmBytes.cjs');
|
|
63
|
+
const { decode } = require('../utils/base122.cjs');
|
|
64
|
+
const { decompressSync } = require('fflate');
|
|
65
|
+
const { default: sharedMemory } = require('./memory.cjs');
|
|
66
|
+
const wasmBytes = new Uint8Array(decode(bytes));
|
|
67
|
+
const wasi = new WASI({
|
|
68
|
+
version: 'preview1',
|
|
69
|
+
print: function () {
|
|
70
|
+
console.log.apply(console, arguments);
|
|
71
|
+
},
|
|
72
|
+
printErr: function () {
|
|
73
|
+
console.error.apply(console, arguments);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
let workerBlobUrl;
|
|
77
|
+
const wasm = instantiateNapiModuleSync(decompressSync(wasmBytes), {
|
|
78
|
+
context: emnapiContext,
|
|
79
|
+
wasi,
|
|
80
|
+
// Threads are spawned lazily (first async `#[napi]` call), so
|
|
81
|
+
// instantiation stays synchronous: emnapi only forbids sync loading
|
|
82
|
+
// with a PREloaded worker pool (`reuseWorker.size > 0`). `true` keeps
|
|
83
|
+
// size 0 but returns finished workers to a pool instead of
|
|
84
|
+
// terminating them, so repeated proving calls reuse them.
|
|
85
|
+
reuseWorker: true,
|
|
86
|
+
onCreateWorker() {
|
|
87
|
+
if (isNode) {
|
|
88
|
+
return new nodeWorkerThreads.Worker(__filename);
|
|
89
|
+
}
|
|
90
|
+
// Escape hatch for hosts that want to control worker creation
|
|
91
|
+
// (e.g. strict CSP environments where blob: workers are forbidden).
|
|
92
|
+
if (typeof globalThis.__PSHENMIC_DPP_CREATE_WORKER__ === 'function') {
|
|
93
|
+
return globalThis.__PSHENMIC_DPP_CREATE_WORKER__();
|
|
94
|
+
}
|
|
95
|
+
if (typeof Worker === 'undefined') {
|
|
96
|
+
throw new Error('Cannot create a wasm thread worker: no Worker constructor in this environment. ' +
|
|
97
|
+
'Provide globalThis.__PSHENMIC_DPP_CREATE_WORKER__ returning a Worker running workerBundle.cjs `source`.');
|
|
98
|
+
}
|
|
99
|
+
// Self-contained worker (all emnapi deps inlined) spawned from a Blob
|
|
100
|
+
// URL, so it survives being bundled into a single file: the worker
|
|
101
|
+
// receives the compiled module + shared memory via postMessage and
|
|
102
|
+
// needs no access to this script's URL or the wasm bytes.
|
|
103
|
+
if (workerBlobUrl === undefined) {
|
|
104
|
+
const { source } = require('./wasm/workerBundle.cjs');
|
|
105
|
+
workerBlobUrl = URL.createObjectURL(new Blob([source], { type: 'text/javascript' }));
|
|
106
|
+
}
|
|
107
|
+
return new Worker(workerBlobUrl, { name: 'pshenmic-dpp-wasm-thread' });
|
|
108
|
+
},
|
|
109
|
+
overwriteImports(importObject) {
|
|
110
|
+
importObject.env = {
|
|
111
|
+
...importObject.env,
|
|
112
|
+
...importObject.napi,
|
|
113
|
+
...importObject.emnapi,
|
|
114
|
+
memory: sharedMemory
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
beforeInit({ instance }) {
|
|
118
|
+
for (const name of Object.keys(instance.exports)) {
|
|
119
|
+
if (name.startsWith('__napi_register__')) {
|
|
120
|
+
instance.exports[name]();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
module.exports = wasm.napiModule.exports;
|
|
126
|
+
module.exports.default = wasm.napiModule.exports;
|
|
127
|
+
}
|
package/dist/src/dpp/dpp.d.ts
CHANGED
|
@@ -42,6 +42,13 @@ export { AddressFundsTransferTransitionWASM } from './structs/AddressTransitions
|
|
|
42
42
|
export { IdentityCreateFromAddressesTransitionWASM } from './structs/AddressTransitions/IdentityCreateFromAddressesTransition.js';
|
|
43
43
|
export { IdentityCreditTransferToAddressesTransitionWASM } from './structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.js';
|
|
44
44
|
export { IdentityTopUpFromAddressesTransitionWASM } from './structs/AddressTransitions/IdentityTopUpFromAddressesTransition.js';
|
|
45
|
+
export { SerializedActionWASM } from './structs/ShieldedTransitions/SerializedAction.js';
|
|
46
|
+
export { ShieldTransitionWASM } from './structs/ShieldedTransitions/ShieldTransition.js';
|
|
47
|
+
export { ShieldedTransferTransitionWASM } from './structs/ShieldedTransitions/ShieldedTransferTransition.js';
|
|
48
|
+
export { UnshieldTransitionWASM } from './structs/ShieldedTransitions/UnshieldTransition.js';
|
|
49
|
+
export { ShieldFromAssetLockTransitionWASM } from './structs/ShieldedTransitions/ShieldFromAssetLockTransition.js';
|
|
50
|
+
export { ShieldedWithdrawalTransitionWASM } from './structs/ShieldedTransitions/ShieldedWithdrawalTransition.js';
|
|
51
|
+
export { IdentityCreateFromShieldedPoolTransitionWASM } from './structs/ShieldedTransitions/IdentityCreateFromShieldedPoolTransition.js';
|
|
45
52
|
export { ActionTakerWASM } from './structs/TokenConfiguration/ActionTaker.js';
|
|
46
53
|
export { AuthorizedActionTakersWASM } from './structs/TokenConfiguration/AuthorizedActionTakers.js';
|
|
47
54
|
export { ChangeControlRulesWASM } from './structs/TokenConfiguration/ChangeControlRules.js';
|
|
@@ -91,6 +98,7 @@ export { BatchedTransitionWASM } from './structs/Batch/BatchedTransition.js';
|
|
|
91
98
|
export { BatchTransitionWASM } from './structs/Batch/BatchTransition.js';
|
|
92
99
|
export { verifySignatureDigest } from './verify/verifySignatureDigest.js';
|
|
93
100
|
export { verifyEpochsInfoProof } from './verify/System/verifyEpochsInfoProof.js';
|
|
101
|
+
export { verifyFinalizedEpochInfosProof } from './verify/System/verifyFinalizedEpochInfosProof.js';
|
|
94
102
|
export { verifyTotalCreditsProof } from './verify/System/verifyTotalCreditsProof.js';
|
|
95
103
|
export { verifyVotePollVoteStateProof } from './verify/Contested/verifyVotePollVoteStateProof.js';
|
|
96
104
|
export { verifyContractProof } from './verify/Contract/verifyContract.js';
|
|
@@ -103,6 +111,10 @@ export { verifyIdentityByUniqueKeyHashProof } from './verify/Identity/verifyIden
|
|
|
103
111
|
export { verifyIdentityContractNonceProof } from './verify/Identity/verifyIdentityContractNonceProof.js';
|
|
104
112
|
export { verifyIdentityKeysByIdentifierProof } from './verify/Identity/verifyIdentityKeysByIdentifierProof.js';
|
|
105
113
|
export { verifyIdentityNonceProof } from './verify/Identity/verifyIdentityNonceProof.js';
|
|
114
|
+
export { verifyAddressesTrunkState } from './verify/AddressFunds/verifyAddressesTrunkState.js';
|
|
115
|
+
export { verifyAddressesBranchState } from './verify/AddressFunds/verifyAddressesBranchState.js';
|
|
116
|
+
export { verifyRecentAddressBalanceChanges } from './verify/AddressFunds/verifyRecentAddressBalanceChanges.js';
|
|
117
|
+
export { verifyRecentCompactedAddressBalanceChanges } from './verify/AddressFunds/verifyRecentCompactedAddressBalanceChanges.js';
|
|
106
118
|
export { verifyTokenBalancesForIdentitiesProof } from './verify/Tokens/verifyTokenBalancesForIdentitiesProof.js';
|
|
107
119
|
export { verifyTokenContractInfoProof } from './verify/Tokens/verifyTokenContractInfoProof.js';
|
|
108
120
|
export { verifyTokenDirectPurchasePrices } from './verify/Tokens/verifyTokenDirectPurchasePrices.js';
|
|
@@ -110,3 +122,23 @@ export { verifyTokenTotalSupplyProof } from './verify/Tokens/verifyTokenTotalSup
|
|
|
110
122
|
export { verifyTokensBalancesForIdentityProof } from './verify/Tokens/verifyTokensBalancesForIdentityProof.js';
|
|
111
123
|
export { verifyPlatformAddressInfo } from './verify/PlatformAddress/verifyPlatformAddressInfo.js';
|
|
112
124
|
export { verifyPlatformAddressesInfos } from './verify/PlatformAddress/verifyPlatformAddressesInfos.js';
|
|
125
|
+
export { verifyShieldedEncryptedNotesProof } from './verify/Shielded/verifyShieldedEncryptedNotesProof.js';
|
|
126
|
+
export { verifyShieldedAnchorsProof } from './verify/Shielded/verifyShieldedAnchorsProof.js';
|
|
127
|
+
export { verifyMostRecentShieldedAnchorProof } from './verify/Shielded/verifyMostRecentShieldedAnchorProof.js';
|
|
128
|
+
export { verifyShieldedPoolStateProof } from './verify/Shielded/verifyShieldedPoolStateProof.js';
|
|
129
|
+
export { verifyShieldedNotesCountProof } from './verify/Shielded/verifyShieldedNotesCountProof.js';
|
|
130
|
+
export { verifyShieldedNullifiersProof } from './verify/Shielded/verifyShieldedNullifiersProof.js';
|
|
131
|
+
export { OrchardAddressWASM, orchardOvkFromSeed } from './structs/Orchard/OrchardAddress.js';
|
|
132
|
+
export { FullViewingKeyWASM } from './structs/Orchard/FullViewingKey.js';
|
|
133
|
+
export { IncomingViewingKeyWASM } from './structs/Orchard/IncomingViewingKey.js';
|
|
134
|
+
export { ShieldedMemoWASM } from './structs/Orchard/ShieldedMemo.js';
|
|
135
|
+
export { NoteWASM } from './structs/Orchard/Note.js';
|
|
136
|
+
export { MerklePathWASM } from './structs/Orchard/MerklePath.js';
|
|
137
|
+
export { SpendableNoteWASM } from './structs/Orchard/SpendableNote.js';
|
|
138
|
+
export { ShieldedOutputWASM } from './structs/Orchard/ShieldedOutput.js';
|
|
139
|
+
export { CommitmentTreeWASM } from './structs/Orchard/CommitmentTree.js';
|
|
140
|
+
export { OrchardProverWASM } from './structs/Orchard/OrchardProver.js';
|
|
141
|
+
export { ShieldedWithdrawalResultWASM } from './structs/Orchard/ShieldedWithdrawalResult.js';
|
|
142
|
+
export { RecoveredNoteWASM, recoverNotes } from './structs/Orchard/RecoveredNote.js';
|
|
143
|
+
export { ShieldedBuilderWASM } from './structs/Orchard/ShieldedBuilder.js';
|
|
144
|
+
export { IdentityCreateFromShieldedPoolResultWASM } from './structs/Orchard/IdentityCreateFromShieldedPoolResult.js';
|
package/dist/src/dpp/dpp.js
CHANGED
|
@@ -42,6 +42,13 @@ export { AddressFundsTransferTransitionWASM } from './structs/AddressTransitions
|
|
|
42
42
|
export { IdentityCreateFromAddressesTransitionWASM } from './structs/AddressTransitions/IdentityCreateFromAddressesTransition.js';
|
|
43
43
|
export { IdentityCreditTransferToAddressesTransitionWASM } from './structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.js';
|
|
44
44
|
export { IdentityTopUpFromAddressesTransitionWASM } from './structs/AddressTransitions/IdentityTopUpFromAddressesTransition.js';
|
|
45
|
+
export { SerializedActionWASM } from './structs/ShieldedTransitions/SerializedAction.js';
|
|
46
|
+
export { ShieldTransitionWASM } from './structs/ShieldedTransitions/ShieldTransition.js';
|
|
47
|
+
export { ShieldedTransferTransitionWASM } from './structs/ShieldedTransitions/ShieldedTransferTransition.js';
|
|
48
|
+
export { UnshieldTransitionWASM } from './structs/ShieldedTransitions/UnshieldTransition.js';
|
|
49
|
+
export { ShieldFromAssetLockTransitionWASM } from './structs/ShieldedTransitions/ShieldFromAssetLockTransition.js';
|
|
50
|
+
export { ShieldedWithdrawalTransitionWASM } from './structs/ShieldedTransitions/ShieldedWithdrawalTransition.js';
|
|
51
|
+
export { IdentityCreateFromShieldedPoolTransitionWASM } from './structs/ShieldedTransitions/IdentityCreateFromShieldedPoolTransition.js';
|
|
45
52
|
export { ActionTakerWASM } from './structs/TokenConfiguration/ActionTaker.js';
|
|
46
53
|
export { AuthorizedActionTakersWASM } from './structs/TokenConfiguration/AuthorizedActionTakers.js';
|
|
47
54
|
export { ChangeControlRulesWASM } from './structs/TokenConfiguration/ChangeControlRules.js';
|
|
@@ -91,6 +98,7 @@ export { BatchedTransitionWASM } from './structs/Batch/BatchedTransition.js';
|
|
|
91
98
|
export { BatchTransitionWASM } from './structs/Batch/BatchTransition.js';
|
|
92
99
|
export { verifySignatureDigest } from './verify/verifySignatureDigest.js';
|
|
93
100
|
export { verifyEpochsInfoProof } from './verify/System/verifyEpochsInfoProof.js';
|
|
101
|
+
export { verifyFinalizedEpochInfosProof } from './verify/System/verifyFinalizedEpochInfosProof.js';
|
|
94
102
|
export { verifyTotalCreditsProof } from './verify/System/verifyTotalCreditsProof.js';
|
|
95
103
|
export { verifyVotePollVoteStateProof } from './verify/Contested/verifyVotePollVoteStateProof.js';
|
|
96
104
|
export { verifyContractProof } from './verify/Contract/verifyContract.js';
|
|
@@ -103,6 +111,10 @@ export { verifyIdentityByUniqueKeyHashProof } from './verify/Identity/verifyIden
|
|
|
103
111
|
export { verifyIdentityContractNonceProof } from './verify/Identity/verifyIdentityContractNonceProof.js';
|
|
104
112
|
export { verifyIdentityKeysByIdentifierProof } from './verify/Identity/verifyIdentityKeysByIdentifierProof.js';
|
|
105
113
|
export { verifyIdentityNonceProof } from './verify/Identity/verifyIdentityNonceProof.js';
|
|
114
|
+
export { verifyAddressesTrunkState } from './verify/AddressFunds/verifyAddressesTrunkState.js';
|
|
115
|
+
export { verifyAddressesBranchState } from './verify/AddressFunds/verifyAddressesBranchState.js';
|
|
116
|
+
export { verifyRecentAddressBalanceChanges } from './verify/AddressFunds/verifyRecentAddressBalanceChanges.js';
|
|
117
|
+
export { verifyRecentCompactedAddressBalanceChanges } from './verify/AddressFunds/verifyRecentCompactedAddressBalanceChanges.js';
|
|
106
118
|
export { verifyTokenBalancesForIdentitiesProof } from './verify/Tokens/verifyTokenBalancesForIdentitiesProof.js';
|
|
107
119
|
export { verifyTokenContractInfoProof } from './verify/Tokens/verifyTokenContractInfoProof.js';
|
|
108
120
|
export { verifyTokenDirectPurchasePrices } from './verify/Tokens/verifyTokenDirectPurchasePrices.js';
|
|
@@ -110,3 +122,23 @@ export { verifyTokenTotalSupplyProof } from './verify/Tokens/verifyTokenTotalSup
|
|
|
110
122
|
export { verifyTokensBalancesForIdentityProof } from './verify/Tokens/verifyTokensBalancesForIdentityProof.js';
|
|
111
123
|
export { verifyPlatformAddressInfo } from './verify/PlatformAddress/verifyPlatformAddressInfo.js';
|
|
112
124
|
export { verifyPlatformAddressesInfos } from './verify/PlatformAddress/verifyPlatformAddressesInfos.js';
|
|
125
|
+
export { verifyShieldedEncryptedNotesProof } from './verify/Shielded/verifyShieldedEncryptedNotesProof.js';
|
|
126
|
+
export { verifyShieldedAnchorsProof } from './verify/Shielded/verifyShieldedAnchorsProof.js';
|
|
127
|
+
export { verifyMostRecentShieldedAnchorProof } from './verify/Shielded/verifyMostRecentShieldedAnchorProof.js';
|
|
128
|
+
export { verifyShieldedPoolStateProof } from './verify/Shielded/verifyShieldedPoolStateProof.js';
|
|
129
|
+
export { verifyShieldedNotesCountProof } from './verify/Shielded/verifyShieldedNotesCountProof.js';
|
|
130
|
+
export { verifyShieldedNullifiersProof } from './verify/Shielded/verifyShieldedNullifiersProof.js';
|
|
131
|
+
export { OrchardAddressWASM, orchardOvkFromSeed } from './structs/Orchard/OrchardAddress.js';
|
|
132
|
+
export { FullViewingKeyWASM } from './structs/Orchard/FullViewingKey.js';
|
|
133
|
+
export { IncomingViewingKeyWASM } from './structs/Orchard/IncomingViewingKey.js';
|
|
134
|
+
export { ShieldedMemoWASM } from './structs/Orchard/ShieldedMemo.js';
|
|
135
|
+
export { NoteWASM } from './structs/Orchard/Note.js';
|
|
136
|
+
export { MerklePathWASM } from './structs/Orchard/MerklePath.js';
|
|
137
|
+
export { SpendableNoteWASM } from './structs/Orchard/SpendableNote.js';
|
|
138
|
+
export { ShieldedOutputWASM } from './structs/Orchard/ShieldedOutput.js';
|
|
139
|
+
export { CommitmentTreeWASM } from './structs/Orchard/CommitmentTree.js';
|
|
140
|
+
export { OrchardProverWASM } from './structs/Orchard/OrchardProver.js';
|
|
141
|
+
export { ShieldedWithdrawalResultWASM } from './structs/Orchard/ShieldedWithdrawalResult.js';
|
|
142
|
+
export { RecoveredNoteWASM, recoverNotes } from './structs/Orchard/RecoveredNote.js';
|
|
143
|
+
export { ShieldedBuilderWASM } from './structs/Orchard/ShieldedBuilder.js';
|
|
144
|
+
export { IdentityCreateFromShieldedPoolResultWASM } from './structs/Orchard/IdentityCreateFromShieldedPoolResult.js';
|
package/dist/src/dpp/enums.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { KeyTypeNAPI as KeyType, NetworkNAPI as NetworkWASM, PlatformVersionNAPI as PlatformVersionWASM, PurposeNAPI as Purpose, SecurityLevelNAPI as SecurityLevel, ActionGoalNAPI as ActionGoal, TokenDistributionTypeNAPI as TokenDistributionType, TokenEmergencyActionNAPI as TokenEmergencyActionWASM, AssetLockProofTypeNAPI as AssetLockProofType, PoolingNAPI as PoolingWASM, GasFeesPaidByNAPI as GasFeesPaidByWASM, VoteStateResultTypeNAPI as VoteStateResultType } from '../../binaries/bindingsTypes.js';
|
|
1
|
+
export { KeyTypeNAPI as KeyType, NetworkNAPI as NetworkWASM, PlatformVersionNAPI as PlatformVersionWASM, PurposeNAPI as Purpose, SecurityLevelNAPI as SecurityLevel, ActionGoalNAPI as ActionGoal, TokenDistributionTypeNAPI as TokenDistributionType, TokenEmergencyActionNAPI as TokenEmergencyActionWASM, AssetLockProofTypeNAPI as AssetLockProofType, PoolingNAPI as PoolingWASM, GasFeesPaidByNAPI as GasFeesPaidByWASM, VoteStateResultTypeNAPI as VoteStateResultType, ScopeNAPI as ScopeWASM } from '../../binaries/bindingsTypes.js';
|
package/dist/src/dpp/enums.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { KeyTypeNAPI as KeyType, NetworkNAPI as NetworkWASM, PlatformVersionNAPI as PlatformVersionWASM, PurposeNAPI as Purpose, SecurityLevelNAPI as SecurityLevel, ActionGoalNAPI as ActionGoal, TokenDistributionTypeNAPI as TokenDistributionType, TokenEmergencyActionNAPI as TokenEmergencyActionWASM, AssetLockProofTypeNAPI as AssetLockProofType, PoolingNAPI as PoolingWASM, GasFeesPaidByNAPI as GasFeesPaidByWASM, VoteStateResultTypeNAPI as VoteStateResultType } from '../../binaries/bindingsTypes.js';
|
|
1
|
+
export { KeyTypeNAPI as KeyType, NetworkNAPI as NetworkWASM, PlatformVersionNAPI as PlatformVersionWASM, PurposeNAPI as Purpose, SecurityLevelNAPI as SecurityLevel, ActionGoalNAPI as ActionGoal, TokenDistributionTypeNAPI as TokenDistributionType, TokenEmergencyActionNAPI as TokenEmergencyActionWASM, AssetLockProofTypeNAPI as AssetLockProofType, PoolingNAPI as PoolingWASM, GasFeesPaidByNAPI as GasFeesPaidByWASM, VoteStateResultTypeNAPI as VoteStateResultType, ScopeNAPI as ScopeWASM } from '../../binaries/bindingsTypes.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AddressCreditWithdrawalTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
1
|
+
import type { AddressCreditWithdrawalTransitionNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
2
|
import { InputAddressWASM } from './entities/InputAddress.js';
|
|
3
3
|
import { AddressFundsFeeStrategyStepWASM } from './entities/AddressFundsFeeStrategyStep.js';
|
|
4
4
|
import { PoolingLike } from '../../types.js';
|
|
@@ -26,6 +26,8 @@ export declare class AddressCreditWithdrawalTransitionWASM {
|
|
|
26
26
|
set userFeeIncrease(value: number);
|
|
27
27
|
get inputWitness(): AddressWitnessWASM[];
|
|
28
28
|
set inputWitness(value: AddressWitnessWASM[]);
|
|
29
|
+
static estimateMinFee(inputCount: number, hasChangeOutput: boolean, platformVersion?: PlatformVersionNAPI): bigint;
|
|
30
|
+
calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
|
|
29
31
|
bytes(): Uint8Array;
|
|
30
32
|
hex(): string;
|
|
31
33
|
base64(): string;
|
|
@@ -63,6 +63,12 @@ export class AddressCreditWithdrawalTransitionWASM {
|
|
|
63
63
|
set inputWitness(value) {
|
|
64
64
|
this._rawAddressCreditWithdrawalTransition.inputWitness = value.map(witness => witness._rawWitness);
|
|
65
65
|
}
|
|
66
|
+
static estimateMinFee(inputCount, hasChangeOutput, platformVersion) {
|
|
67
|
+
return BigInt(dppProvider.dpp.AddressCreditWithdrawalTransitionNAPI.estimateMinFee(inputCount, hasChangeOutput, platformVersion));
|
|
68
|
+
}
|
|
69
|
+
calculateMinRequiredFee(platformVersion) {
|
|
70
|
+
return BigInt(this._rawAddressCreditWithdrawalTransition.calculateMinRequiredFee(platformVersion));
|
|
71
|
+
}
|
|
66
72
|
bytes() {
|
|
67
73
|
return this._rawAddressCreditWithdrawalTransition.bytes();
|
|
68
74
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AddressFundingFromAssetLockTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
1
|
+
import type { AddressFundingFromAssetLockTransitionNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
2
|
import { AssetLockProofWASM } from '../AssetLockProof/AssetLockProof.js';
|
|
3
3
|
import { InputAddressWASM } from './entities/InputAddress.js';
|
|
4
4
|
import { AddressFundsFeeStrategyStepWASM } from './entities/AddressFundsFeeStrategyStep.js';
|
|
@@ -23,6 +23,7 @@ export declare class AddressFundingFromAssetLockTransitionWASM {
|
|
|
23
23
|
set inputWitness(value: AddressWitnessWASM[]);
|
|
24
24
|
get signature(): Uint8Array;
|
|
25
25
|
set signature(value: Uint8Array);
|
|
26
|
+
calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
|
|
26
27
|
bytes(): Uint8Array;
|
|
27
28
|
hex(): string;
|
|
28
29
|
base64(): string;
|
|
@@ -53,6 +53,9 @@ export class AddressFundingFromAssetLockTransitionWASM {
|
|
|
53
53
|
set signature(value) {
|
|
54
54
|
this._rawAddressFundingFromAssetLockTransition.signature = value;
|
|
55
55
|
}
|
|
56
|
+
calculateMinRequiredFee(platformVersion) {
|
|
57
|
+
return BigInt(this._rawAddressFundingFromAssetLockTransition.calculateMinRequiredFee(platformVersion));
|
|
58
|
+
}
|
|
56
59
|
bytes() {
|
|
57
60
|
return this._rawAddressFundingFromAssetLockTransition.bytes();
|
|
58
61
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AddressFundsTransferTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
1
|
+
import type { AddressFundsTransferTransitionNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
2
|
import { InputAddressWASM } from './entities/InputAddress.js';
|
|
3
3
|
import { AddressFundsFeeStrategyStepWASM } from './entities/AddressFundsFeeStrategyStep.js';
|
|
4
4
|
import { AddressWitnessWASM } from '../PlatformAddress/AddressWitness.js';
|
|
@@ -18,6 +18,8 @@ export declare class AddressFundsTransferTransitionWASM {
|
|
|
18
18
|
set userFeeIncrease(value: number);
|
|
19
19
|
get inputWitness(): AddressWitnessWASM[];
|
|
20
20
|
set inputWitness(witness: AddressWitnessWASM[]);
|
|
21
|
+
static estimateMinFee(inputCount: number, outputCount: number, platformVersion?: PlatformVersionNAPI): bigint;
|
|
22
|
+
calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
|
|
21
23
|
bytes(): Uint8Array;
|
|
22
24
|
hex(): string;
|
|
23
25
|
base64(): string;
|
|
@@ -40,6 +40,12 @@ export class AddressFundsTransferTransitionWASM {
|
|
|
40
40
|
set inputWitness(witness) {
|
|
41
41
|
this._rawAddressFundsTransferTransition.inputWitness = witness.map(w => w._rawWitness);
|
|
42
42
|
}
|
|
43
|
+
static estimateMinFee(inputCount, outputCount, platformVersion) {
|
|
44
|
+
return BigInt(dppProvider.dpp.AddressFundsTransferTransitionNAPI.estimateMinFee(inputCount, outputCount, platformVersion));
|
|
45
|
+
}
|
|
46
|
+
calculateMinRequiredFee(platformVersion) {
|
|
47
|
+
return BigInt(this._rawAddressFundsTransferTransition.calculateMinRequiredFee(platformVersion));
|
|
48
|
+
}
|
|
43
49
|
bytes() {
|
|
44
50
|
return this._rawAddressFundsTransferTransition.bytes();
|
|
45
51
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IdentityCreateFromAddressesTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
1
|
+
import type { IdentityCreateFromAddressesTransitionNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
2
|
import { IdentityPublicKeyInCreationWASM } from '../IdentityPublicKeyInCreation.js';
|
|
3
3
|
import { InputAddressWASM } from './entities/InputAddress.js';
|
|
4
4
|
import { AddressFundsFeeStrategyStepWASM } from './entities/AddressFundsFeeStrategyStep.js';
|
|
@@ -21,6 +21,7 @@ export declare class IdentityCreateFromAddressesTransitionWASM {
|
|
|
21
21
|
set userFeeIncrease(value: number);
|
|
22
22
|
get inputWitness(): AddressWitnessWASM[];
|
|
23
23
|
set inputWitness(value: AddressWitnessWASM[]);
|
|
24
|
+
calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
|
|
24
25
|
bytes(): Uint8Array;
|
|
25
26
|
hex(): string;
|
|
26
27
|
base64(): string;
|
|
@@ -50,6 +50,9 @@ export class IdentityCreateFromAddressesTransitionWASM {
|
|
|
50
50
|
set inputWitness(value) {
|
|
51
51
|
this._rawIdentityCreateFromAddressesTransition.inputWitness = value.map(w => w._rawWitness);
|
|
52
52
|
}
|
|
53
|
+
calculateMinRequiredFee(platformVersion) {
|
|
54
|
+
return BigInt(this._rawIdentityCreateFromAddressesTransition.calculateMinRequiredFee(platformVersion));
|
|
55
|
+
}
|
|
53
56
|
bytes() {
|
|
54
57
|
return this._rawIdentityCreateFromAddressesTransition.bytes();
|
|
55
58
|
}
|
package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IdentityCreditTransferToAddressesTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
1
|
+
import type { IdentityCreditTransferToAddressesTransitionNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
2
|
import { IdentifierLike } from '../../types.js';
|
|
3
3
|
import { OutputAddressWASM } from './entities/OutputAddress.js';
|
|
4
4
|
import { IdentifierWASM } from '../Identifier.js';
|
|
@@ -19,6 +19,7 @@ export declare class IdentityCreditTransferToAddressesTransitionWASM {
|
|
|
19
19
|
set signaturePublicKeyId(value: number);
|
|
20
20
|
get signature(): Uint8Array;
|
|
21
21
|
set signature(sig: Uint8Array);
|
|
22
|
+
calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
|
|
22
23
|
bytes(): Uint8Array;
|
|
23
24
|
hex(): string;
|
|
24
25
|
base64(): string;
|
package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.js
CHANGED
|
@@ -45,6 +45,9 @@ export class IdentityCreditTransferToAddressesTransitionWASM {
|
|
|
45
45
|
set signature(sig) {
|
|
46
46
|
this._rawIdentityCreditTransferToAddressesTransition.signature = sig;
|
|
47
47
|
}
|
|
48
|
+
calculateMinRequiredFee(platformVersion) {
|
|
49
|
+
return BigInt(this._rawIdentityCreditTransferToAddressesTransition.calculateMinRequiredFee(platformVersion));
|
|
50
|
+
}
|
|
48
51
|
bytes() {
|
|
49
52
|
return this._rawIdentityCreditTransferToAddressesTransition.bytes();
|
|
50
53
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IdentityTopUpFromAddressesTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
1
|
+
import type { IdentityTopUpFromAddressesTransitionNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
2
|
import { IdentifierLike } from '../../types.js';
|
|
3
3
|
import { InputAddressWASM } from './entities/InputAddress.js';
|
|
4
4
|
import { AddressFundsFeeStrategyStepWASM } from './entities/AddressFundsFeeStrategyStep.js';
|
|
@@ -19,6 +19,7 @@ export declare class IdentityTopUpFromAddressesTransitionWASM {
|
|
|
19
19
|
set userFeeIncrease(userFeeIncrease: number);
|
|
20
20
|
get inputWitness(): AddressWitnessWASM[];
|
|
21
21
|
set inputWitness(addressWitness: AddressWitnessWASM[]);
|
|
22
|
+
calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
|
|
22
23
|
bytes(): Uint8Array;
|
|
23
24
|
hex(): string;
|
|
24
25
|
base64(): string;
|