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.
Files changed (161) hide show
  1. package/README.md +164 -77
  2. package/dist/binaries/bindingsTypes.d.ts +903 -18
  3. package/dist/binaries/bindingsTypes.js +13 -0
  4. package/dist/binaries/memory.cjs +7 -0
  5. package/dist/binaries/memory.d.cts +2 -0
  6. package/dist/binaries/native/aarch64-apple-darwin/pshenmic_dpp.node +0 -0
  7. package/dist/binaries/native/aarch64-pc-windows-msvc/pshenmic_dpp.node +0 -0
  8. package/dist/binaries/native/aarch64-unknown-linux-gnu/pshenmic_dpp.node +0 -0
  9. package/dist/binaries/native/aarch64-unknown-linux-musl/pshenmic_dpp.node +0 -0
  10. package/dist/binaries/native/x86_64-apple-darwin/pshenmic_dpp.node +0 -0
  11. package/dist/binaries/native/x86_64-pc-windows-msvc/pshenmic_dpp.node +0 -0
  12. package/dist/binaries/native/x86_64-unknown-linux-gnu/pshenmic_dpp.node +0 -0
  13. package/dist/binaries/native/x86_64-unknown-linux-musl/pshenmic_dpp.node +0 -0
  14. package/dist/binaries/node.cjs +71 -0
  15. package/dist/binaries/node.d.cts +2 -0
  16. package/dist/binaries/pshenmic_dpp.android.node/arm64-v8a/libpshenmic_dpp.so +0 -0
  17. package/dist/binaries/pshenmic_dpp.apple.node/Info.plist +29 -0
  18. package/dist/binaries/pshenmic_dpp.apple.node/ios-arm64-simulator/libpshenmic_dpp.framework/Info.plist +24 -0
  19. package/dist/binaries/pshenmic_dpp.apple.node/ios-arm64-simulator/libpshenmic_dpp.framework/libpshenmic_dpp +0 -0
  20. package/dist/binaries/pshenmic_dpp.apple.node/react-native-node-api-module +0 -0
  21. package/dist/binaries/pshenmic_dpp.d.ts +60 -0
  22. package/dist/binaries/pshenmic_dpp.js +1 -1
  23. package/dist/binaries/wasm/wasmBytes.cjs +4 -0
  24. package/dist/binaries/wasm/wasmBytes.d.cts +2 -0
  25. package/dist/binaries/wasm/workerBundle.cjs +6 -0
  26. package/dist/binaries/wasm/workerBundle.d.cts +2 -0
  27. package/dist/binaries/wasm.d.ts +60 -0
  28. package/dist/binaries/wasm.js +2 -44
  29. package/dist/binaries/wasmCreation.cjs +127 -0
  30. package/dist/binaries/wasmCreation.d.cts +4 -0
  31. package/dist/src/dpp/dpp.d.ts +32 -0
  32. package/dist/src/dpp/dpp.js +32 -0
  33. package/dist/src/dpp/enums.d.ts +1 -1
  34. package/dist/src/dpp/enums.js +1 -1
  35. package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.d.ts +3 -1
  36. package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.js +6 -0
  37. package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.d.ts +2 -1
  38. package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.js +3 -0
  39. package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.d.ts +3 -1
  40. package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.js +6 -0
  41. package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.d.ts +2 -1
  42. package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.js +3 -0
  43. package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.d.ts +2 -1
  44. package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.js +3 -0
  45. package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.d.ts +2 -1
  46. package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.js +3 -0
  47. package/dist/src/dpp/structs/Batch/BatchTransition.d.ts +2 -1
  48. package/dist/src/dpp/structs/Batch/BatchTransition.js +3 -0
  49. package/dist/src/dpp/structs/DataContractTransitions/DataContractCreateTransition.d.ts +2 -1
  50. package/dist/src/dpp/structs/DataContractTransitions/DataContractCreateTransition.js +3 -0
  51. package/dist/src/dpp/structs/DataContractTransitions/DataContractUpdateTransition.d.ts +2 -1
  52. package/dist/src/dpp/structs/DataContractTransitions/DataContractUpdateTransition.js +3 -0
  53. package/dist/src/dpp/structs/Identifier.js +3 -0
  54. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreateTransition.d.ts +2 -1
  55. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreateTransition.js +3 -0
  56. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditTransfer.d.ts +2 -1
  57. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditTransfer.js +3 -0
  58. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditWithdrawalTransition.d.ts +2 -1
  59. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditWithdrawalTransition.js +3 -0
  60. package/dist/src/dpp/structs/IdentityTransitions/IdentityTopUpTransition.d.ts +2 -1
  61. package/dist/src/dpp/structs/IdentityTransitions/IdentityTopUpTransition.js +3 -0
  62. package/dist/src/dpp/structs/IdentityTransitions/IdentityUpdateTransition.d.ts +2 -1
  63. package/dist/src/dpp/structs/IdentityTransitions/IdentityUpdateTransition.js +3 -0
  64. package/dist/src/dpp/structs/MasternodeVote/MasternodeVoteTransition.d.ts +2 -3
  65. package/dist/src/dpp/structs/MasternodeVote/MasternodeVoteTransition.js +3 -6
  66. package/dist/src/dpp/structs/Orchard/CommitmentTree.d.ts +14 -0
  67. package/dist/src/dpp/structs/Orchard/CommitmentTree.js +31 -0
  68. package/dist/src/dpp/structs/Orchard/FullViewingKey.d.ts +27 -0
  69. package/dist/src/dpp/structs/Orchard/FullViewingKey.js +45 -0
  70. package/dist/src/dpp/structs/Orchard/IdentityCreateFromShieldedPoolResult.d.ts +21 -0
  71. package/dist/src/dpp/structs/Orchard/IdentityCreateFromShieldedPoolResult.js +38 -0
  72. package/dist/src/dpp/structs/Orchard/IncomingViewingKey.d.ts +29 -0
  73. package/dist/src/dpp/structs/Orchard/IncomingViewingKey.js +44 -0
  74. package/dist/src/dpp/structs/Orchard/MerklePath.d.ts +11 -0
  75. package/dist/src/dpp/structs/Orchard/MerklePath.js +25 -0
  76. package/dist/src/dpp/structs/Orchard/Note.d.ts +18 -0
  77. package/dist/src/dpp/structs/Orchard/Note.js +42 -0
  78. package/dist/src/dpp/structs/Orchard/OrchardAddress.d.ts +27 -0
  79. package/dist/src/dpp/structs/Orchard/OrchardAddress.js +45 -0
  80. package/dist/src/dpp/structs/Orchard/OrchardProver.d.ts +19 -0
  81. package/dist/src/dpp/structs/Orchard/OrchardProver.js +34 -0
  82. package/dist/src/dpp/structs/Orchard/RecoveredNote.d.ts +19 -0
  83. package/dist/src/dpp/structs/Orchard/RecoveredNote.js +32 -0
  84. package/dist/src/dpp/structs/Orchard/ShieldedBuilder.d.ts +64 -0
  85. package/dist/src/dpp/structs/Orchard/ShieldedBuilder.js +79 -0
  86. package/dist/src/dpp/structs/Orchard/ShieldedMemo.d.ts +11 -0
  87. package/dist/src/dpp/structs/Orchard/ShieldedMemo.js +25 -0
  88. package/dist/src/dpp/structs/Orchard/ShieldedOutput.d.ts +23 -0
  89. package/dist/src/dpp/structs/Orchard/ShieldedOutput.js +41 -0
  90. package/dist/src/dpp/structs/Orchard/ShieldedWithdrawalResult.d.ts +11 -0
  91. package/dist/src/dpp/structs/Orchard/ShieldedWithdrawalResult.js +18 -0
  92. package/dist/src/dpp/structs/Orchard/SpendableNote.d.ts +13 -0
  93. package/dist/src/dpp/structs/Orchard/SpendableNote.js +27 -0
  94. package/dist/src/dpp/structs/PlatformAddress/PlatformAddress.d.ts +9 -1
  95. package/dist/src/dpp/structs/PlatformAddress/PlatformAddress.js +10 -0
  96. package/dist/src/dpp/structs/ShieldedTransitions/IdentityCreateFromShieldedPoolTransition.d.ts +32 -0
  97. package/dist/src/dpp/structs/ShieldedTransitions/IdentityCreateFromShieldedPoolTransition.js +76 -0
  98. package/dist/src/dpp/structs/ShieldedTransitions/SerializedAction.d.ts +19 -0
  99. package/dist/src/dpp/structs/ShieldedTransitions/SerializedAction.js +49 -0
  100. package/dist/src/dpp/structs/ShieldedTransitions/ShieldFromAssetLockTransition.d.ts +31 -0
  101. package/dist/src/dpp/structs/ShieldedTransitions/ShieldFromAssetLockTransition.js +80 -0
  102. package/dist/src/dpp/structs/ShieldedTransitions/ShieldTransition.d.ts +33 -0
  103. package/dist/src/dpp/structs/ShieldedTransitions/ShieldTransition.js +81 -0
  104. package/dist/src/dpp/structs/ShieldedTransitions/ShieldedTransferTransition.d.ts +22 -0
  105. package/dist/src/dpp/structs/ShieldedTransitions/ShieldedTransferTransition.js +54 -0
  106. package/dist/src/dpp/structs/ShieldedTransitions/ShieldedWithdrawalTransition.d.ts +30 -0
  107. package/dist/src/dpp/structs/ShieldedTransitions/ShieldedWithdrawalTransition.js +74 -0
  108. package/dist/src/dpp/structs/ShieldedTransitions/UnshieldTransition.d.ts +26 -0
  109. package/dist/src/dpp/structs/ShieldedTransitions/UnshieldTransition.js +62 -0
  110. package/dist/src/dpp/structs/StateTransition.d.ts +2 -1
  111. package/dist/src/dpp/structs/StateTransition.js +3 -0
  112. package/dist/src/dpp/types.d.ts +177 -3
  113. package/dist/src/dpp/verify/AddressFunds/utils.d.ts +5 -0
  114. package/dist/src/dpp/verify/AddressFunds/utils.js +28 -0
  115. package/dist/src/dpp/verify/AddressFunds/verifyAddressesBranchState.d.ts +12 -0
  116. package/dist/src/dpp/verify/AddressFunds/verifyAddressesBranchState.js +29 -0
  117. package/dist/src/dpp/verify/AddressFunds/verifyAddressesTrunkState.d.ts +9 -0
  118. package/dist/src/dpp/verify/AddressFunds/verifyAddressesTrunkState.js +30 -0
  119. package/dist/src/dpp/verify/AddressFunds/verifyRecentAddressBalanceChanges.d.ts +9 -0
  120. package/dist/src/dpp/verify/AddressFunds/verifyRecentAddressBalanceChanges.js +24 -0
  121. package/dist/src/dpp/verify/AddressFunds/verifyRecentCompactedAddressBalanceChanges.d.ts +10 -0
  122. package/dist/src/dpp/verify/AddressFunds/verifyRecentCompactedAddressBalanceChanges.js +30 -0
  123. package/dist/src/dpp/verify/Contested/verifyVotePollVoteStateProof.d.ts +1 -1
  124. package/dist/src/dpp/verify/Contested/verifyVotePollVoteStateProof.js +1 -1
  125. package/dist/src/dpp/verify/Shielded/verifyMostRecentShieldedAnchorProof.d.ts +2 -0
  126. package/dist/src/dpp/verify/Shielded/verifyMostRecentShieldedAnchorProof.js +9 -0
  127. package/dist/src/dpp/verify/Shielded/verifyShieldedAnchorsProof.d.ts +2 -0
  128. package/dist/src/dpp/verify/Shielded/verifyShieldedAnchorsProof.js +9 -0
  129. package/dist/src/dpp/verify/Shielded/verifyShieldedEncryptedNotesProof.d.ts +2 -0
  130. package/dist/src/dpp/verify/Shielded/verifyShieldedEncryptedNotesProof.js +15 -0
  131. package/dist/src/dpp/verify/Shielded/verifyShieldedNotesCountProof.d.ts +2 -0
  132. package/dist/src/dpp/verify/Shielded/verifyShieldedNotesCountProof.js +9 -0
  133. package/dist/src/dpp/verify/Shielded/verifyShieldedNullifiersProof.d.ts +2 -0
  134. package/dist/src/dpp/verify/Shielded/verifyShieldedNullifiersProof.js +12 -0
  135. package/dist/src/dpp/verify/Shielded/verifyShieldedPoolStateProof.d.ts +2 -0
  136. package/dist/src/dpp/verify/Shielded/verifyShieldedPoolStateProof.js +9 -0
  137. package/dist/src/dpp/verify/StateTransition/utils.js +76 -11
  138. package/dist/src/dpp/verify/StateTransition/verifyStateTransitionResult.js +2 -1
  139. package/dist/src/dpp/verify/System/verifyFinalizedEpochInfosProof.d.ts +2 -0
  140. package/dist/src/dpp/verify/System/verifyFinalizedEpochInfosProof.js +27 -0
  141. package/dist/src/native.d.ts +3 -0
  142. package/dist/src/native.js +8 -0
  143. package/dist/utils/{base122.js → base122.cjs} +3 -1
  144. package/package.json +17 -27
  145. package/tests/unit/AddressTransitionsFees.spec.ts +274 -0
  146. package/tests/unit/DataContract.spec.ts +281 -0
  147. package/tests/unit/DynamicValue.spec.ts +2 -2
  148. package/tests/unit/Identifier.spec.ts +1 -1
  149. package/tests/unit/Identity.spec.ts +1 -1
  150. package/tests/unit/IdentityPublicKey.spec.ts +1 -1
  151. package/tests/unit/NodeApi.spec.ts +49 -0
  152. package/tests/unit/Shielded.spec.ts +555 -0
  153. package/tests/unit/ShieldedTransitions.spec.ts +877 -0
  154. package/tests/unit/StateTransitionFees.spec.ts +177 -0
  155. package/tests/unit/TokenConfiguration.spec.ts +114 -0
  156. package/tests/unit/WebAssembly.spec.ts +88 -0
  157. package/tests/unit/utils/buildTokenConfiguration.ts +66 -0
  158. package/dist/binaries/pshenmic_dpp.android.node/x86_64/libpshenmic_dpp.so +0 -0
  159. package/dist/binaries/wasm/wasmBytes.d.ts +0 -2
  160. package/dist/binaries/wasm/wasmBytes.js +0 -2
  161. /package/dist/utils/{base122.d.ts → base122.d.cts} +0 -0
@@ -44,6 +44,9 @@ export class IdentityTopUpFromAddressesTransitionWASM {
44
44
  set inputWitness(addressWitness) {
45
45
  this._rawIdentityTopUpFromAddressesTransition.inputWitness = addressWitness.map(w => w._rawWitness);
46
46
  }
47
+ calculateMinRequiredFee(platformVersion) {
48
+ return BigInt(this._rawIdentityTopUpFromAddressesTransition.calculateMinRequiredFee(platformVersion));
49
+ }
47
50
  bytes() {
48
51
  return this._rawIdentityTopUpFromAddressesTransition.bytes();
49
52
  }
@@ -1,4 +1,4 @@
1
- import type { BatchTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
1
+ import type { BatchTransitionNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
2
2
  import { IdentifierLike } from '../../types.js';
3
3
  import { BatchedTransitionWASM } from './BatchedTransition.js';
4
4
  import { DocumentTransitionWASM } from './DocumentTransition.js';
@@ -20,6 +20,7 @@ export declare class BatchTransitionWASM {
20
20
  get modifiedDataIds(): IdentifierWASM[];
21
21
  get allConflictingIndexCollateralVotingFunds(): bigint | undefined;
22
22
  setIdentityContractNonce(nonce: bigint): void;
23
+ calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
23
24
  bytes(): Uint8Array;
24
25
  hex(): string;
25
26
  base64(): string;
@@ -57,6 +57,9 @@ export class BatchTransitionWASM {
57
57
  setIdentityContractNonce(nonce) {
58
58
  this._rawBatchTransition.setIdentityContractNonce(nonce.toString());
59
59
  }
60
+ calculateMinRequiredFee(platformVersion) {
61
+ return BigInt(this._rawBatchTransition.calculateMinRequiredFee(platformVersion));
62
+ }
60
63
  bytes() {
61
64
  return this._rawBatchTransition.bytes();
62
65
  }
@@ -1,4 +1,4 @@
1
- import type { DataContractCreateTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
1
+ import type { DataContractCreateTransitionNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
2
2
  import { DataContractWASM } from '../DataContract.js';
3
3
  import { PlatformVersionLike } from '../../types.js';
4
4
  import { StateTransitionWASM } from '../StateTransition.js';
@@ -11,6 +11,7 @@ export declare class DataContractCreateTransitionWASM {
11
11
  verifyProtocolVersion(protocolVersion: number): boolean;
12
12
  setDataContract(dataContract: DataContractWASM, platformVersion?: PlatformVersionLike): void;
13
13
  getDataContract(platformVersion?: PlatformVersionLike, fullValidation?: boolean): DataContractWASM;
14
+ calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
14
15
  bytes(): Uint8Array;
15
16
  hex(): string;
16
17
  base64(): string;
@@ -23,6 +23,9 @@ export class DataContractCreateTransitionWASM {
23
23
  getDataContract(platformVersion, fullValidation) {
24
24
  return DataContractWASM.createFromRawInstance(this._rawDataContractCreateTransition.getDataContract(valueToDynamicValue(platformVersion), fullValidation));
25
25
  }
26
+ calculateMinRequiredFee(platformVersion) {
27
+ return BigInt(this._rawDataContractCreateTransition.calculateMinRequiredFee(platformVersion));
28
+ }
26
29
  bytes() {
27
30
  return this._rawDataContractCreateTransition.bytes();
28
31
  }
@@ -1,4 +1,4 @@
1
- import type { DataContractUpdateTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
1
+ import type { DataContractUpdateTransitionNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
2
2
  import { DataContractWASM } from '../DataContract.js';
3
3
  import { PlatformVersionLike } from '../../types.js';
4
4
  import { StateTransitionWASM } from '../StateTransition.js';
@@ -11,6 +11,7 @@ export declare class DataContractUpdateTransitionWASM {
11
11
  verifyProtocolVersion(protocolVersion: number): boolean;
12
12
  setDataContract(dataContract: DataContractWASM, platformVersion?: PlatformVersionLike): void;
13
13
  getDataContract(fullValidation?: boolean, platformVersion?: PlatformVersionLike): DataContractWASM;
14
+ calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
14
15
  bytes(): Uint8Array;
15
16
  hex(): string;
16
17
  base64(): string;
@@ -23,6 +23,9 @@ export class DataContractUpdateTransitionWASM {
23
23
  getDataContract(fullValidation, platformVersion) {
24
24
  return DataContractWASM.createFromRawInstance(this._rawDataContractUpdateTransition.getDataContract(fullValidation, valueToDynamicValue(platformVersion)));
25
25
  }
26
+ calculateMinRequiredFee(platformVersion) {
27
+ return BigInt(this._rawDataContractUpdateTransition.calculateMinRequiredFee(platformVersion));
28
+ }
26
29
  bytes() {
27
30
  return this._rawDataContractUpdateTransition.bytes();
28
31
  }
@@ -11,6 +11,9 @@ export class IdentifierWASM {
11
11
  const id = new dpp.DynamicValue(rawId);
12
12
  this._rawIdentifier = new dpp.IdentifierNAPI(id);
13
13
  }
14
+ else if (rawId instanceof dpp.IdentifierNAPI) {
15
+ this._rawIdentifier = rawId;
16
+ }
14
17
  else {
15
18
  throw new Error('Invalid raw ID');
16
19
  }
@@ -1,4 +1,4 @@
1
- import type { IdentityCreateTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
1
+ import type { IdentityCreateTransitionNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
2
2
  import { IdentityPublicKeyInCreationWASM } from '../IdentityPublicKeyInCreation.js';
3
3
  import { AssetLockProofWASM } from '../AssetLockProof/AssetLockProof.js';
4
4
  import { PlatformVersionLike } from '../../types.js';
@@ -18,6 +18,7 @@ export declare class IdentityCreateTransitionWASM {
18
18
  set assetLock(value: AssetLockProofWASM);
19
19
  getSignableBytes(): Uint8Array;
20
20
  getIdentifier(): IdentifierWASM;
21
+ calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
21
22
  bytes(): Uint8Array;
22
23
  toStateTransition(): StateTransitionWASM;
23
24
  static default(platformVersion: PlatformVersionLike): IdentityCreateTransitionWASM;
@@ -40,6 +40,9 @@ export class IdentityCreateTransitionWASM {
40
40
  getIdentifier() {
41
41
  return IdentifierWASM.createFromRawInstance(this._rawIdentityCreateTransition.getIdentifier());
42
42
  }
43
+ calculateMinRequiredFee(platformVersion) {
44
+ return BigInt(this._rawIdentityCreateTransition.calculateMinRequiredFee(platformVersion));
45
+ }
43
46
  bytes() {
44
47
  return this._rawIdentityCreateTransition.bytes();
45
48
  }
@@ -1,4 +1,4 @@
1
- import type { IdentityCreditTransferNAPI } from '../../../../binaries/bindingsTypes.js';
1
+ import type { IdentityCreditTransferNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
2
2
  import { IdentifierLike } from '../../types.js';
3
3
  import { IdentifierWASM } from '../Identifier.js';
4
4
  import { StateTransitionWASM } from '../StateTransition.js';
@@ -21,6 +21,7 @@ export declare class IdentityCreditTransferWASM {
21
21
  get userFeeIncrease(): number;
22
22
  set userFeeIncrease(value: number);
23
23
  getSignableBytes(): Uint8Array;
24
+ calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
24
25
  bytes(): Uint8Array;
25
26
  hex(): string;
26
27
  base64(): string;
@@ -53,6 +53,9 @@ export class IdentityCreditTransferWASM {
53
53
  getSignableBytes() {
54
54
  return this._rawIdentityCreditTransfer.getSignableBytes();
55
55
  }
56
+ calculateMinRequiredFee(platformVersion) {
57
+ return BigInt(this._rawIdentityCreditTransfer.calculateMinRequiredFee(platformVersion));
58
+ }
56
59
  bytes() {
57
60
  return this._rawIdentityCreditTransfer.bytes();
58
61
  }
@@ -1,4 +1,4 @@
1
- import type { IdentityCreditWithdrawalTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
1
+ import type { IdentityCreditWithdrawalTransitionNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
2
2
  import { IdentifierLike, PoolingLike } from '../../types.js';
3
3
  import { CoreScriptWASM } from '../CoreScript.js';
4
4
  import { IdentifierWASM } from '../Identifier.js';
@@ -30,6 +30,7 @@ export declare class IdentityCreditWithdrawalTransitionWASM {
30
30
  getPurposeRequirement(): string[];
31
31
  getModifiedDataIds(): IdentifierWASM[];
32
32
  getOptionalAssetLockProof(): AssetLockProofWASM | undefined;
33
+ calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
33
34
  bytes(): Uint8Array;
34
35
  hex(): string;
35
36
  base64(): string;
@@ -82,6 +82,9 @@ export class IdentityCreditWithdrawalTransitionWASM {
82
82
  return AssetLockProofWASM.createFromRawInstance(lock);
83
83
  }
84
84
  }
85
+ calculateMinRequiredFee(platformVersion) {
86
+ return BigInt(this._rawIdentityCreditWithdrawalTransition.calculateMinRequiredFee(platformVersion));
87
+ }
85
88
  bytes() {
86
89
  return this._rawIdentityCreditWithdrawalTransition.bytes();
87
90
  }
@@ -1,4 +1,4 @@
1
- import type { IdentityTopUpTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
1
+ import type { IdentityTopUpTransitionNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
2
2
  import { AssetLockProofWASM } from '../AssetLockProof/AssetLockProof.js';
3
3
  import { IdentifierLike } from '../../types.js';
4
4
  import { IdentifierWASM } from '../Identifier.js';
@@ -18,6 +18,7 @@ export declare class IdentityTopUpTransitionWASM {
18
18
  getSignableBytes(): Uint8Array;
19
19
  getModifiedDataIds(): IdentifierWASM[];
20
20
  getOptionalAssetLockProof(): AssetLockProofWASM | undefined;
21
+ calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
21
22
  bytes(): Uint8Array;
22
23
  hex(): string;
23
24
  base64(): string;
@@ -43,6 +43,9 @@ export class IdentityTopUpTransitionWASM {
43
43
  const lock = this._rawIdentityTopUpTransition.getOptionalAssetLockProof();
44
44
  return (lock != null) ? AssetLockProofWASM.createFromRawInstance(lock) : undefined;
45
45
  }
46
+ calculateMinRequiredFee(platformVersion) {
47
+ return BigInt(this._rawIdentityTopUpTransition.calculateMinRequiredFee(platformVersion));
48
+ }
46
49
  bytes() {
47
50
  return this._rawIdentityTopUpTransition.bytes();
48
51
  }
@@ -1,4 +1,4 @@
1
- import type { IdentityUpdateTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
1
+ import type { IdentityUpdateTransitionNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
2
2
  import { IdentifierLike } from '../../types.js';
3
3
  import { IdentityPublicKeyInCreationWASM } from '../IdentityPublicKeyInCreation.js';
4
4
  import { IdentifierWASM } from '../Identifier.js';
@@ -28,6 +28,7 @@ export declare class IdentityUpdateTransitionWASM {
28
28
  getPurposeRequirement(): string[];
29
29
  getModifiedDataIds(): IdentifierWASM[];
30
30
  getOptionalAssetLockProof(): AssetLockProofWASM | undefined;
31
+ calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
31
32
  bytes(): Uint8Array;
32
33
  hex(): string;
33
34
  base64(): string;
@@ -76,6 +76,9 @@ export class IdentityUpdateTransitionWASM {
76
76
  return undefined;
77
77
  }
78
78
  }
79
+ calculateMinRequiredFee(platformVersion) {
80
+ return BigInt(this._rawIdentityUpdateTransition.calculateMinRequiredFee(platformVersion));
81
+ }
79
82
  bytes() {
80
83
  return this._rawIdentityUpdateTransition.bytes();
81
84
  }
@@ -1,4 +1,4 @@
1
- import type { MasternodeVoteTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
1
+ import type { MasternodeVoteTransitionNAPI, PlatformVersionNAPI } from '../../../../binaries/bindingsTypes.js';
2
2
  import { IdentifierLike } from '../../types.js';
3
3
  import { VoteWASM } from './Vote.js';
4
4
  import { IdentifierWASM } from '../Identifier.js';
@@ -20,11 +20,10 @@ 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;
26
+ calculateMinRequiredFee(platformVersion?: PlatformVersionNAPI): bigint;
28
27
  bytes(): Uint8Array;
29
28
  hex(): string;
30
29
  base64(): string;
@@ -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) {
@@ -64,6 +58,9 @@ export class MasternodeVoteTransitionWASM {
64
58
  getSignableBytes() {
65
59
  return this._rawMasternodeVoteTransition.getSignableBytes();
66
60
  }
61
+ calculateMinRequiredFee(platformVersion) {
62
+ return BigInt(this._rawMasternodeVoteTransition.calculateMinRequiredFee(platformVersion));
63
+ }
67
64
  bytes() {
68
65
  return this._rawMasternodeVoteTransition.bytes();
69
66
  }
@@ -0,0 +1,14 @@
1
+ import type { CommitmentTreeNAPI } from '../../../../binaries/bindingsTypes.js';
2
+ import { MerklePathWASM } from './MerklePath.js';
3
+ export declare class CommitmentTreeWASM {
4
+ /** @private **/
5
+ _rawCommitmentTree: CommitmentTreeNAPI;
6
+ constructor(maxCheckpoints?: number);
7
+ /** Appends a note commitment (cmx). `marked` = spendable (can be witnessed). */
8
+ append(cmx: Uint8Array, marked: boolean): void;
9
+ checkpoint(checkpointId: number): boolean;
10
+ maxLeafPosition(): number | null;
11
+ witness(position: number, checkpointDepth?: number): MerklePathWASM | null;
12
+ anchor(): Uint8Array;
13
+ static createFromRawInstance(rawInstance: CommitmentTreeNAPI): CommitmentTreeWASM;
14
+ }
@@ -0,0 +1,31 @@
1
+ import { dppProvider } from '../../provider.js';
2
+ import { MerklePathWASM } from './MerklePath.js';
3
+ export class CommitmentTreeWASM {
4
+ /** @private **/
5
+ _rawCommitmentTree;
6
+ constructor(maxCheckpoints) {
7
+ this._rawCommitmentTree = new dppProvider.dpp.CommitmentTreeNAPI(maxCheckpoints);
8
+ }
9
+ /** Appends a note commitment (cmx). `marked` = spendable (can be witnessed). */
10
+ append(cmx, marked) {
11
+ this._rawCommitmentTree.append(cmx, marked);
12
+ }
13
+ checkpoint(checkpointId) {
14
+ return this._rawCommitmentTree.checkpoint(checkpointId);
15
+ }
16
+ maxLeafPosition() {
17
+ return this._rawCommitmentTree.maxLeafPosition();
18
+ }
19
+ witness(position, checkpointDepth) {
20
+ const path = this._rawCommitmentTree.witness(position, checkpointDepth);
21
+ return path != null ? MerklePathWASM.createFromRawInstance(path) : null;
22
+ }
23
+ anchor() {
24
+ return this._rawCommitmentTree.anchor();
25
+ }
26
+ static createFromRawInstance(rawInstance) {
27
+ const instance = Object.create(CommitmentTreeWASM.prototype);
28
+ instance._rawCommitmentTree = rawInstance;
29
+ return instance;
30
+ }
31
+ }
@@ -0,0 +1,27 @@
1
+ import type { FullViewingKeyNAPI } from '../../../../binaries/bindingsTypes.js';
2
+ import { ScopeLike } from '../../types.js';
3
+ import { IncomingViewingKeyWASM } from './IncomingViewingKey.js';
4
+ import { OrchardAddressWASM } from './OrchardAddress.js';
5
+ /**
6
+ * An Orchard full viewing key: it detects both incoming and outgoing notes and
7
+ * computes their nullifiers (so it sees the full balance), but cannot spend.
8
+ */
9
+ export declare class FullViewingKeyWASM {
10
+ /** @private **/
11
+ _rawFullViewingKey: FullViewingKeyNAPI;
12
+ /** The 96-byte raw encoding of this key (ak || nk || rivk). */
13
+ bytes(): Uint8Array;
14
+ /** Derives the incoming viewing key for the given scope (default External). */
15
+ toIvk(scope?: ScopeLike): IncomingViewingKeyWASM;
16
+ /** Derives the 32-byte outgoing viewing key for the given scope (default External). */
17
+ toOvk(scope?: ScopeLike): Uint8Array;
18
+ /** The payment address at `diversifierIndex` (default 0) for `scope` (default External). */
19
+ address(diversifierIndex?: number, scope?: ScopeLike): OrchardAddressWASM;
20
+ /** The scope `address` was derived under, or null if it does not belong to this key. */
21
+ scopeForAddress(address: OrchardAddressWASM): string | null;
22
+ /** Derives the full viewing key from a BIP-39 seed via ZIP-32 (m/32'/coinType'/account'). */
23
+ static fromSeed(seed: Uint8Array, coinType: number, account: number): FullViewingKeyWASM;
24
+ /** Parses a full viewing key from its 96-byte raw encoding. */
25
+ static fromBytes(bytes: Uint8Array): FullViewingKeyWASM;
26
+ static createFromRawInstance(rawInstance: FullViewingKeyNAPI): FullViewingKeyWASM;
27
+ }
@@ -0,0 +1,45 @@
1
+ import { dppProvider } from '../../provider.js';
2
+ import { valueToDynamicValue } from '../../utils.js';
3
+ import { IncomingViewingKeyWASM } from './IncomingViewingKey.js';
4
+ import { OrchardAddressWASM } from './OrchardAddress.js';
5
+ /**
6
+ * An Orchard full viewing key: it detects both incoming and outgoing notes and
7
+ * computes their nullifiers (so it sees the full balance), but cannot spend.
8
+ */
9
+ export class FullViewingKeyWASM {
10
+ /** @private **/
11
+ _rawFullViewingKey;
12
+ /** The 96-byte raw encoding of this key (ak || nk || rivk). */
13
+ bytes() {
14
+ return this._rawFullViewingKey.bytes();
15
+ }
16
+ /** Derives the incoming viewing key for the given scope (default External). */
17
+ toIvk(scope) {
18
+ return IncomingViewingKeyWASM.createFromRawInstance(this._rawFullViewingKey.toIvk(scope == null ? undefined : valueToDynamicValue(scope)));
19
+ }
20
+ /** Derives the 32-byte outgoing viewing key for the given scope (default External). */
21
+ toOvk(scope) {
22
+ return this._rawFullViewingKey.toOvk(scope == null ? undefined : valueToDynamicValue(scope));
23
+ }
24
+ /** The payment address at `diversifierIndex` (default 0) for `scope` (default External). */
25
+ address(diversifierIndex, scope) {
26
+ return OrchardAddressWASM.createFromRawInstance(this._rawFullViewingKey.address(diversifierIndex, scope == null ? undefined : valueToDynamicValue(scope)));
27
+ }
28
+ /** The scope `address` was derived under, or null if it does not belong to this key. */
29
+ scopeForAddress(address) {
30
+ return this._rawFullViewingKey.scopeForAddress(address._rawOrchardAddress);
31
+ }
32
+ /** Derives the full viewing key from a BIP-39 seed via ZIP-32 (m/32'/coinType'/account'). */
33
+ static fromSeed(seed, coinType, account) {
34
+ return FullViewingKeyWASM.createFromRawInstance(dppProvider.dpp.FullViewingKeyNAPI.fromSeed(seed, coinType, account));
35
+ }
36
+ /** Parses a full viewing key from its 96-byte raw encoding. */
37
+ static fromBytes(bytes) {
38
+ return FullViewingKeyWASM.createFromRawInstance(dppProvider.dpp.FullViewingKeyNAPI.fromBytes(bytes));
39
+ }
40
+ static createFromRawInstance(rawInstance) {
41
+ const instance = Object.create(FullViewingKeyWASM.prototype);
42
+ instance._rawFullViewingKey = rawInstance;
43
+ return instance;
44
+ }
45
+ }
@@ -0,0 +1,21 @@
1
+ import type { IdentityCreateFromShieldedPoolResultNAPI } from '../../../../binaries/bindingsTypes.js';
2
+ import { IdentifierWASM } from '../Identifier.js';
3
+ import { IdentityPublicKeyInCreationWASM } from '../IdentityPublicKeyInCreation.js';
4
+ import { SerializedActionWASM } from '../ShieldedTransitions/SerializedAction.js';
5
+ /**
6
+ * Result of `identityCreateFromShieldedPool`: the new identity's keys (with
7
+ * proof-of-possession signatures), the proven Orchard bundle fields, the derived
8
+ * identity id, and the client-predicted fee.
9
+ */
10
+ export declare class IdentityCreateFromShieldedPoolResultWASM {
11
+ /** @private **/
12
+ _rawIdentityCreateFromShieldedPoolResult: IdentityCreateFromShieldedPoolResultNAPI;
13
+ get publicKeys(): IdentityPublicKeyInCreationWASM[];
14
+ get identityId(): IdentifierWASM;
15
+ get predictedFee(): bigint;
16
+ get actions(): SerializedActionWASM[];
17
+ get anchor(): Uint8Array;
18
+ get proof(): Uint8Array;
19
+ get bindingsSignature(): Uint8Array;
20
+ static createFromRawInstance(rawInstance: IdentityCreateFromShieldedPoolResultNAPI): IdentityCreateFromShieldedPoolResultWASM;
21
+ }
@@ -0,0 +1,38 @@
1
+ import { IdentifierWASM } from '../Identifier.js';
2
+ import { IdentityPublicKeyInCreationWASM } from '../IdentityPublicKeyInCreation.js';
3
+ import { SerializedActionWASM } from '../ShieldedTransitions/SerializedAction.js';
4
+ /**
5
+ * Result of `identityCreateFromShieldedPool`: the new identity's keys (with
6
+ * proof-of-possession signatures), the proven Orchard bundle fields, the derived
7
+ * identity id, and the client-predicted fee.
8
+ */
9
+ export class IdentityCreateFromShieldedPoolResultWASM {
10
+ /** @private **/
11
+ _rawIdentityCreateFromShieldedPoolResult;
12
+ get publicKeys() {
13
+ return this._rawIdentityCreateFromShieldedPoolResult.publicKeys.map(IdentityPublicKeyInCreationWASM.createFromRawInstance);
14
+ }
15
+ get identityId() {
16
+ return new IdentifierWASM(this._rawIdentityCreateFromShieldedPoolResult.identityId);
17
+ }
18
+ get predictedFee() {
19
+ return BigInt(this._rawIdentityCreateFromShieldedPoolResult.predictedFee);
20
+ }
21
+ get actions() {
22
+ return this._rawIdentityCreateFromShieldedPoolResult.actions.map(SerializedActionWASM.createFromRawInstance);
23
+ }
24
+ get anchor() {
25
+ return this._rawIdentityCreateFromShieldedPoolResult.anchor;
26
+ }
27
+ get proof() {
28
+ return this._rawIdentityCreateFromShieldedPoolResult.proof;
29
+ }
30
+ get bindingsSignature() {
31
+ return this._rawIdentityCreateFromShieldedPoolResult.bindingsSignature;
32
+ }
33
+ static createFromRawInstance(rawInstance) {
34
+ const instance = Object.create(IdentityCreateFromShieldedPoolResultWASM.prototype);
35
+ instance._rawIdentityCreateFromShieldedPoolResult = rawInstance;
36
+ return instance;
37
+ }
38
+ }
@@ -0,0 +1,29 @@
1
+ import type { IncomingViewingKeyNAPI } from '../../../../binaries/bindingsTypes.js';
2
+ import { ScopeLike } from '../../types.js';
3
+ import { FullViewingKeyWASM } from './FullViewingKey.js';
4
+ import { OrchardAddressWASM } from './OrchardAddress.js';
5
+ /**
6
+ * An Orchard incoming viewing key: it detects and decrypts notes sent to you,
7
+ * but cannot see outgoing notes, tell when a note is spent, or spend it — safe
8
+ * to hand to a watch-only service.
9
+ */
10
+ export declare class IncomingViewingKeyWASM {
11
+ /** @private **/
12
+ _rawIncomingViewingKey: IncomingViewingKeyNAPI;
13
+ /** The 64-byte raw encoding of this key (dk || ivk). */
14
+ bytes(): Uint8Array;
15
+ /** The payment address at `diversifierIndex` (default 0); scope is fixed by the key. */
16
+ address(diversifierIndex?: number): OrchardAddressWASM;
17
+ /** The diversifier index `address` was derived at, or null if it is not from this key. */
18
+ diversifierIndex(address: OrchardAddressWASM): number | null;
19
+ /**
20
+ * Derives the incoming viewing key from a BIP-39 seed via ZIP-32
21
+ * (m/32'/coinType'/account') for the given scope (default External).
22
+ */
23
+ static fromSeed(seed: Uint8Array, coinType: number, account: number, scope?: ScopeLike): IncomingViewingKeyWASM;
24
+ /** Derives the incoming viewing key from a full viewing key (default External scope). */
25
+ static fromFullViewingKey(fullViewingKey: FullViewingKeyWASM, scope?: ScopeLike): IncomingViewingKeyWASM;
26
+ /** Parses an incoming viewing key from its 64-byte raw encoding. */
27
+ static fromBytes(bytes: Uint8Array): IncomingViewingKeyWASM;
28
+ static createFromRawInstance(rawInstance: IncomingViewingKeyNAPI): IncomingViewingKeyWASM;
29
+ }
@@ -0,0 +1,44 @@
1
+ import { dppProvider } from '../../provider.js';
2
+ import { valueToDynamicValue } from '../../utils.js';
3
+ import { OrchardAddressWASM } from './OrchardAddress.js';
4
+ /**
5
+ * An Orchard incoming viewing key: it detects and decrypts notes sent to you,
6
+ * but cannot see outgoing notes, tell when a note is spent, or spend it — safe
7
+ * to hand to a watch-only service.
8
+ */
9
+ export class IncomingViewingKeyWASM {
10
+ /** @private **/
11
+ _rawIncomingViewingKey;
12
+ /** The 64-byte raw encoding of this key (dk || ivk). */
13
+ bytes() {
14
+ return this._rawIncomingViewingKey.bytes();
15
+ }
16
+ /** The payment address at `diversifierIndex` (default 0); scope is fixed by the key. */
17
+ address(diversifierIndex) {
18
+ return OrchardAddressWASM.createFromRawInstance(this._rawIncomingViewingKey.address(diversifierIndex));
19
+ }
20
+ /** The diversifier index `address` was derived at, or null if it is not from this key. */
21
+ diversifierIndex(address) {
22
+ return this._rawIncomingViewingKey.diversifierIndex(address._rawOrchardAddress);
23
+ }
24
+ /**
25
+ * Derives the incoming viewing key from a BIP-39 seed via ZIP-32
26
+ * (m/32'/coinType'/account') for the given scope (default External).
27
+ */
28
+ static fromSeed(seed, coinType, account, scope) {
29
+ return IncomingViewingKeyWASM.createFromRawInstance(dppProvider.dpp.IncomingViewingKeyNAPI.fromSeed(seed, coinType, account, scope == null ? undefined : valueToDynamicValue(scope)));
30
+ }
31
+ /** Derives the incoming viewing key from a full viewing key (default External scope). */
32
+ static fromFullViewingKey(fullViewingKey, scope) {
33
+ return IncomingViewingKeyWASM.createFromRawInstance(dppProvider.dpp.IncomingViewingKeyNAPI.fromFullViewingKey(fullViewingKey._rawFullViewingKey, scope == null ? undefined : valueToDynamicValue(scope)));
34
+ }
35
+ /** Parses an incoming viewing key from its 64-byte raw encoding. */
36
+ static fromBytes(bytes) {
37
+ return IncomingViewingKeyWASM.createFromRawInstance(dppProvider.dpp.IncomingViewingKeyNAPI.fromBytes(bytes));
38
+ }
39
+ static createFromRawInstance(rawInstance) {
40
+ const instance = Object.create(IncomingViewingKeyWASM.prototype);
41
+ instance._rawIncomingViewingKey = rawInstance;
42
+ return instance;
43
+ }
44
+ }
@@ -0,0 +1,11 @@
1
+ import type { MerklePathNAPI } from '../../../../binaries/bindingsTypes.js';
2
+ export declare class MerklePathWASM {
3
+ /** @private **/
4
+ _rawMerklePath: MerklePathNAPI;
5
+ constructor(position: number, authPath: Uint8Array[]);
6
+ get position(): number;
7
+ set position(value: number);
8
+ get authPath(): Uint8Array[];
9
+ set authPath(value: Uint8Array[]);
10
+ static createFromRawInstance(rawInstance: MerklePathNAPI): MerklePathWASM;
11
+ }
@@ -0,0 +1,25 @@
1
+ import { dppProvider } from '../../provider.js';
2
+ export class MerklePathWASM {
3
+ /** @private **/
4
+ _rawMerklePath;
5
+ constructor(position, authPath) {
6
+ this._rawMerklePath = new dppProvider.dpp.MerklePathNAPI(position, authPath);
7
+ }
8
+ get position() {
9
+ return this._rawMerklePath.position;
10
+ }
11
+ set position(value) {
12
+ this._rawMerklePath.position = value;
13
+ }
14
+ get authPath() {
15
+ return this._rawMerklePath.authPath;
16
+ }
17
+ set authPath(value) {
18
+ this._rawMerklePath.authPath = value;
19
+ }
20
+ static createFromRawInstance(rawInstance) {
21
+ const instance = Object.create(MerklePathWASM.prototype);
22
+ instance._rawMerklePath = rawInstance;
23
+ return instance;
24
+ }
25
+ }
@@ -0,0 +1,18 @@
1
+ import type { NoteNAPI } from '../../../../binaries/bindingsTypes.js';
2
+ import { OrchardAddressWASM } from './OrchardAddress.js';
3
+ export declare class NoteWASM {
4
+ /** @private **/
5
+ _rawNote: NoteNAPI;
6
+ constructor(address: OrchardAddressWASM, value: bigint, rho: Uint8Array, rseed: Uint8Array);
7
+ get address(): OrchardAddressWASM;
8
+ set address(value: OrchardAddressWASM);
9
+ get value(): bigint;
10
+ set value(value: bigint);
11
+ get rho(): Uint8Array;
12
+ set rho(value: Uint8Array);
13
+ get rseed(): Uint8Array;
14
+ set rseed(value: Uint8Array);
15
+ /** The note commitment (cmx, 32 bytes) — its leaf in the commitment tree. */
16
+ get cmx(): Uint8Array;
17
+ static createFromRawInstance(rawInstance: NoteNAPI): NoteWASM;
18
+ }
@@ -0,0 +1,42 @@
1
+ import { dppProvider } from '../../provider.js';
2
+ import { OrchardAddressWASM } from './OrchardAddress.js';
3
+ export class NoteWASM {
4
+ /** @private **/
5
+ _rawNote;
6
+ constructor(address, value, rho, rseed) {
7
+ this._rawNote = new dppProvider.dpp.NoteNAPI(address._rawOrchardAddress, value.toString(), rho, rseed);
8
+ }
9
+ get address() {
10
+ return OrchardAddressWASM.createFromRawInstance(this._rawNote.address);
11
+ }
12
+ set address(value) {
13
+ this._rawNote.address = value._rawOrchardAddress;
14
+ }
15
+ get value() {
16
+ return BigInt(this._rawNote.value);
17
+ }
18
+ set value(value) {
19
+ this._rawNote.value = value.toString();
20
+ }
21
+ get rho() {
22
+ return this._rawNote.rho;
23
+ }
24
+ set rho(value) {
25
+ this._rawNote.rho = value;
26
+ }
27
+ get rseed() {
28
+ return this._rawNote.rseed;
29
+ }
30
+ set rseed(value) {
31
+ this._rawNote.rseed = value;
32
+ }
33
+ /** The note commitment (cmx, 32 bytes) — its leaf in the commitment tree. */
34
+ get cmx() {
35
+ return this._rawNote.cmx;
36
+ }
37
+ static createFromRawInstance(rawInstance) {
38
+ const instance = Object.create(NoteWASM.prototype);
39
+ instance._rawNote = rawInstance;
40
+ return instance;
41
+ }
42
+ }