pshenmic-dpp 1.0.6 → 1.0.7-rc.10
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 +46 -1
- package/dist/wasm/index.d.ts +50 -2
- package/dist/wasm/index.js +14 -0
- package/dist/wasm/pshenmic_dpp.d.ts +1329 -126
- package/dist/wasm/pshenmic_dpp.js +11353 -3088
- package/dist/wasm/pshenmic_dpp_bg.js +1 -1
- package/dist/wasm/pshenmic_dpp_bg.wasm.d.ts +683 -86
- package/package.json +11 -4
- package/tests/AssetLockProof.spec.js +3 -8
- package/tests/AuthorizedActionTakers.spec.js +75 -0
- package/tests/BatchTransition.spec.js +141 -0
- package/tests/ChainLockProof.spec.js +3 -9
- package/tests/ChangeControlRules.spec.js +184 -0
- package/tests/CoreScript.spec.js +3 -9
- package/tests/DataContract.spec.js +5 -9
- package/tests/DataContractCreateStateTransition.spec.js +11 -17
- package/tests/DataContractUpdateStateTransition.spec.js +11 -17
- package/tests/DistributionFunction.spec.js +416 -0
- package/tests/Document.spec.js +4 -9
- package/tests/DocumentTransition.spec.js +2 -5
- package/tests/DocumentsTransitions.spec.js +85 -91
- package/tests/Identifier.spec.js +1 -3
- package/tests/Identity.spec.js +5 -11
- package/tests/IdentityCreateTransition.spec.js +3 -9
- package/tests/IdentityCreditTransferTransition.spec.js +2 -8
- package/tests/IdentityCreditWithdrawalTransition.spec.js +2 -8
- package/tests/IdentityPublicKey.spec.js +5 -11
- package/tests/IdentityTopUpTransition.spec.js +2 -8
- package/tests/IdentityUpdateTransition.spec.js +2 -8
- package/tests/InstantLockProof.spec.js +2 -8
- package/tests/OutPoint.spec.js +3 -9
- package/tests/PrivateKey.spec.js +8 -14
- package/tests/PublicKeyInCreation.spec.js +2 -8
- package/tests/RewardDistributionType.spec.js +90 -0
- package/tests/TokenBaseTransition.spec.js +96 -0
- package/tests/TokenConfiguration.spec.js +110 -0
- package/tests/TokenConfigurationConvention.spec.js +93 -0
- package/tests/TokenConfigurationLocalization.spec.js +59 -0
- package/tests/TokenDistributionRecipient.spec.js +49 -0
- package/tests/TokenDistributionRules.spec.js +313 -0
- package/tests/TokenKeepsHistoryRules.spec.js +67 -0
- package/tests/TokenPerpetualDistribution.spec.js +130 -0
- package/tests/TokenPreProgrammedDistribution.spec.js +61 -0
- package/tests/TokensTransitions.spec.js +509 -0
- package/tests/TxOut.spec.js +2 -8
- package/tests/mocks/PublicKey/index.js +1 -1
- package/tests/mocks/TokenConfiguration/index.js +7 -0
- package/.editorconfig +0 -10
- package/.gitattributes +0 -4
- package/.github/workflows/build.yml +0 -54
- package/.github/workflows/publish.yml +0 -50
- package/Cargo.lock +0 -2452
- package/Cargo.toml +0 -52
- package/babel.config.json +0 -19
- package/docs/AssetLockProof.md +0 -107
- package/docs/Building.md +0 -50
- package/docs/ChainLockProof.md +0 -63
- package/docs/CoreScript.md +0 -17
- package/docs/DataContract.md +0 -192
- package/docs/DataContractCreateTransition.md +0 -84
- package/docs/DataContractUpdateTransition.md +0 -84
- package/docs/Document.md +0 -396
- package/docs/DocumentBaseTransition.md +0 -111
- package/docs/DocumentCreateTransition.md +0 -132
- package/docs/DocumentDeleteTransition.md +0 -82
- package/docs/DocumentPurchaseTransition.md +0 -109
- package/docs/DocumentReplaceTransition.md +0 -112
- package/docs/DocumentTransferTransition.md +0 -96
- package/docs/DocumentTransition.md +0 -125
- package/docs/DocumentUpdatePriceTransition.md +0 -109
- package/docs/DocumentsBatch.md +0 -133
- package/docs/Enums.md +0 -103
- package/docs/Home.md +0 -28
- package/docs/Identifier.md +0 -37
- package/docs/Identity.md +0 -140
- package/docs/IdentityCreateTransition.md +0 -155
- package/docs/IdentityCreditTransfer.md +0 -187
- package/docs/IdentityCreditWithdrawalTransition.md +0 -244
- package/docs/IdentityPublicKey.md +0 -348
- package/docs/IdentityPublicKeyInCreation.md +0 -141
- package/docs/IdentityTopUpTransition.md +0 -166
- package/docs/IdentityUpdateTransition.md +0 -234
- package/docs/InstantAssetLockProof.md +0 -117
- package/docs/InstantLock.md +0 -100
- package/docs/OutPoint.md +0 -80
- package/docs/PrefundedVotingBalance.md +0 -48
- package/docs/PrivateKey.md +0 -112
- package/docs/TxOut.md +0 -93
- package/packages/asset_lock_proof/Cargo.toml +0 -19
- package/packages/asset_lock_proof/src/chain/mod.rs +0 -79
- package/packages/asset_lock_proof/src/instant/instant_lock.rs +0 -111
- package/packages/asset_lock_proof/src/instant/mod.rs +0 -115
- package/packages/asset_lock_proof/src/lib.rs +0 -133
- package/packages/asset_lock_proof/src/outpoint/mod.rs +0 -79
- package/packages/asset_lock_proof/src/tx_out/mod.rs +0 -80
- package/packages/cbor_conversation/Cargo.toml +0 -17
- package/packages/cbor_conversation/src/lib.rs +0 -24
- package/packages/core_script/Cargo.toml +0 -13
- package/packages/core_script/src/lib.rs +0 -69
- package/packages/data_contract/Cargo.toml +0 -18
- package/packages/data_contract/src/lib.rs +0 -338
- package/packages/data_contract_transitions/Cargo.toml +0 -14
- package/packages/data_contract_transitions/src/create/mod.rs +0 -161
- package/packages/data_contract_transitions/src/lib.rs +0 -2
- package/packages/data_contract_transitions/src/update/mod.rs +0 -144
- package/packages/document/Cargo.toml +0 -18
- package/packages/document/src/lib.rs +0 -102
- package/packages/document/src/methods/mod.rs +0 -373
- package/packages/documents_batch/Cargo.toml +0 -20
- package/packages/documents_batch/src/document_base_transition/mod.rs +0 -88
- package/packages/documents_batch/src/document_transition/mod.rs +0 -166
- package/packages/documents_batch/src/generators.rs +0 -122
- package/packages/documents_batch/src/lib.rs +0 -195
- package/packages/documents_batch/src/prefunded_voting_balance/mod.rs +0 -45
- package/packages/documents_batch/src/transitions/create/mod.rs +0 -126
- package/packages/documents_batch/src/transitions/delete/mod.rs +0 -67
- package/packages/documents_batch/src/transitions/mod.rs +0 -6
- package/packages/documents_batch/src/transitions/purchase/mod.rs +0 -91
- package/packages/documents_batch/src/transitions/replace/mod.rs +0 -93
- package/packages/documents_batch/src/transitions/transfer/mod.rs +0 -84
- package/packages/documents_batch/src/transitions/update_price/mod.rs +0 -75
- package/packages/enums/Cargo.toml +0 -13
- package/packages/enums/src/batch/batch_enum.rs +0 -84
- package/packages/enums/src/batch/mod.rs +0 -1
- package/packages/enums/src/keys/key_type.rs +0 -82
- package/packages/enums/src/keys/mod.rs +0 -3
- package/packages/enums/src/keys/purpose.rs +0 -96
- package/packages/enums/src/keys/security_level.rs +0 -78
- package/packages/enums/src/lib.rs +0 -6
- package/packages/enums/src/lock_types/mod.rs +0 -65
- package/packages/enums/src/network/mod.rs +0 -67
- package/packages/enums/src/platform/mod.rs +0 -98
- package/packages/enums/src/withdrawal/mod.rs +0 -72
- package/packages/identifier/Cargo.toml +0 -9
- package/packages/identifier/src/lib.rs +0 -105
- package/packages/identity/Cargo.toml +0 -16
- package/packages/identity/src/lib.rs +0 -103
- package/packages/identity_public_key/Cargo.toml +0 -15
- package/packages/identity_public_key/src/lib.rs +0 -190
- package/packages/identity_transitions/Cargo.toml +0 -21
- package/packages/identity_transitions/src/create_transition/mod.rs +0 -164
- package/packages/identity_transitions/src/credit_withdrawal_transition/mod.rs +0 -212
- package/packages/identity_transitions/src/identity_credit_transfer_transition/mod.rs +0 -169
- package/packages/identity_transitions/src/lib.rs +0 -6
- package/packages/identity_transitions/src/public_key_in_creation/mod.rs +0 -197
- package/packages/identity_transitions/src/top_up_transition/mod.rs +0 -141
- package/packages/identity_transitions/src/update_transition/mod.rs +0 -213
- package/packages/mock_bls/Cargo.toml +0 -12
- package/packages/mock_bls/src/lib.rs +0 -26
- package/packages/private_key/Cargo.toml +0 -14
- package/packages/private_key/src/lib.rs +0 -70
- package/packages/state_transition/Cargo.toml +0 -20
- package/packages/state_transition/src/lib.rs +0 -163
- package/packages/utils/Cargo.toml +0 -19
- package/packages/utils/src/buffer.rs +0 -29
- package/packages/utils/src/lib.rs +0 -350
- package/scripts/build-js.sh +0 -56
- package/scripts/build.sh +0 -59
- package/src/lib.rs +0 -18
- package/tests/DocumentBatchTransition.spec.js +0 -109
- package/tests/utils/wasm.js +0 -14
- package/tsconfig.json +0 -18
- package/typings/index.d.ts +0 -52
package/README.md
CHANGED
|
@@ -37,10 +37,43 @@ ___
|
|
|
37
37
|
|
|
38
38
|
**At this moment available structs:**
|
|
39
39
|
- `Document`
|
|
40
|
-
- `
|
|
40
|
+
- `Batch`
|
|
41
41
|
- `DocumentsBaseTransition`
|
|
42
|
+
- `TokenBaseTransitionWASM`
|
|
43
|
+
- `TokenPricingScheduleWASM`
|
|
44
|
+
- `TokenTransitionWASM`
|
|
45
|
+
- `BatchedTransitionWASM`
|
|
46
|
+
- `TokenConfigurationChangeItemWASM`
|
|
47
|
+
- `TokenConfigurationWASM`
|
|
48
|
+
- `ActionTakerWASM`
|
|
49
|
+
- `AuthorizedActionTakersWASM`
|
|
50
|
+
- `ChangeControlRulesWASM`
|
|
51
|
+
- `TokenConfigurationConventionWASM`
|
|
52
|
+
- `DistributionFunctionWASM`
|
|
53
|
+
- `TokenDistributionRecipientWASM`
|
|
54
|
+
- `TokenDistributionRulesWASM`
|
|
55
|
+
- distribution structs:
|
|
56
|
+
- `DistributionFixedAmountWASM`
|
|
57
|
+
- `DistributionRandomWASM`
|
|
58
|
+
- `DistributionStepDecreasingAmountWASM`
|
|
59
|
+
- `DistributionLinearWASM`
|
|
60
|
+
- `DistributionPolynomialWASM`
|
|
61
|
+
- `DistributionExponentialWASM`
|
|
62
|
+
- `DistributionLogarithmicWASM`
|
|
63
|
+
- `DistributionInvertedLogarithmicWASM`
|
|
64
|
+
- `GroupWASM`
|
|
65
|
+
- `TokenKeepsHistoryRulesWASM`
|
|
66
|
+
- `TokenConfigurationLocalizationWASM`
|
|
67
|
+
- `TokenMarketplaceRulesWASM`
|
|
68
|
+
- `TokenPerpetualDistributionWASM`
|
|
69
|
+
- `TokenPreProgrammedDistributionWASM`
|
|
70
|
+
- `RewardDistributionTypeWASM`
|
|
71
|
+
- `TokenTradeModeWASM`
|
|
72
|
+
- `GroupStateTransitionInfoWASM`
|
|
42
73
|
- `DocumentsTransition`
|
|
43
74
|
- `PrefundedVotingBalance`
|
|
75
|
+
- `PrivateEncryptedNoteWASM`
|
|
76
|
+
- `SharedEncryptedNoteWASM`
|
|
44
77
|
- DocumentsTransitions:
|
|
45
78
|
- `DocuemntCreateTransition`
|
|
46
79
|
- `DocuemntDeleteTransition`
|
|
@@ -48,6 +81,18 @@ ___
|
|
|
48
81
|
- `DocuemntReplaceTransition`
|
|
49
82
|
- `DocumentTransferTransition`
|
|
50
83
|
- `DocumentUpdatePriceTransition`
|
|
84
|
+
- Tokens Transitions:
|
|
85
|
+
- `TokenConfigUpdateTransitionWASM`
|
|
86
|
+
- `TokenDirectPurchaseTransitionWASM`
|
|
87
|
+
- `TokenSetPriceForDirectPurchaseTransitionWASM`
|
|
88
|
+
- `TokenBurnTransitionWASM`
|
|
89
|
+
- `TokenClaimTransitionWASM`
|
|
90
|
+
- `TokenDestroyFrozenFundsTransitionWASM`
|
|
91
|
+
- `TokenEmergencyActionTransitionWASM`
|
|
92
|
+
- `TokenFreezeTransitionWASM`
|
|
93
|
+
- `TokenMintTransitionWASM`
|
|
94
|
+
- `TokenTransferTransitionWASM`
|
|
95
|
+
- `TokenUnFreezeTransitionWASM`
|
|
51
96
|
- `IdentityPublicKey`
|
|
52
97
|
- IdentityTransitions:
|
|
53
98
|
- `IdentityCreateTransition`
|
package/dist/wasm/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as DPP from './pshenmic_dpp';
|
|
2
2
|
|
|
3
|
-
export * from './pshenmic_dpp'
|
|
3
|
+
export * from './pshenmic_dpp'
|
|
4
|
+
|
|
5
|
+
export default dpp;
|
|
6
|
+
|
|
7
|
+
declare const dpp: DashPlatformProtocolWASM;
|
|
4
8
|
|
|
5
9
|
export class DashPlatformProtocolWASM {
|
|
6
10
|
// CLASSES
|
|
@@ -19,7 +23,50 @@ export class DashPlatformProtocolWASM {
|
|
|
19
23
|
DocumentTransitionWASM: typeof DPP.DocumentTransitionWASM
|
|
20
24
|
DocumentUpdatePriceTransitionWASM: typeof DPP.DocumentUpdatePriceTransitionWASM
|
|
21
25
|
DocumentWASM: typeof DPP.DocumentWASM
|
|
22
|
-
|
|
26
|
+
BatchTransitionWASM: typeof DPP.BatchTransitionWASM
|
|
27
|
+
BatchedTransitionWASM: typeof DPP.BatchedTransitionWASM
|
|
28
|
+
TokenTransitionWASM: typeof DPP.TokenTransitionWASM
|
|
29
|
+
TokenBaseTransitionWASM: typeof DPP.TokenBaseTransitionWASM
|
|
30
|
+
TokenPricingScheduleWASM: typeof DPP.TokenPricingScheduleWASM
|
|
31
|
+
TokenConfigUpdateTransitionWASM: typeof DPP.TokenConfigUpdateTransitionWASM
|
|
32
|
+
TokenDirectPurchaseTransitionWASM: typeof DPP.TokenDirectPurchaseTransitionWASM
|
|
33
|
+
TokenSetPriceForDirectPurchaseTransitionWASM: typeof DPP.TokenSetPriceForDirectPurchaseTransitionWASM
|
|
34
|
+
TokenBurnTransitionWASM: typeof DPP.TokenBurnTransitionWASM
|
|
35
|
+
TokenClaimTransitionWASM: typeof DPP.TokenClaimTransitionWASM
|
|
36
|
+
TokenDestroyFrozenFundsTransitionWASM: typeof DPP.TokenDestroyFrozenFundsTransitionWASM
|
|
37
|
+
TokenEmergencyActionTransitionWASM: typeof DPP.TokenEmergencyActionTransitionWASM
|
|
38
|
+
TokenFreezeTransitionWASM: typeof DPP.TokenFreezeTransitionWASM
|
|
39
|
+
TokenMintTransitionWASM: typeof DPP.TokenMintTransitionWASM
|
|
40
|
+
TokenTransferTransitionWASM: typeof DPP.TokenTransferTransitionWASM
|
|
41
|
+
TokenUnFreezeTransitionWASM: typeof DPP.TokenUnFreezeTransitionWASM
|
|
42
|
+
GroupStateTransitionInfoWASM: typeof DPP.GroupStateTransitionInfoWASM
|
|
43
|
+
PrivateEncryptedNoteWASM: typeof DPP.PrivateEncryptedNoteWASM
|
|
44
|
+
SharedEncryptedNoteWASM: typeof DPP.SharedEncryptedNoteWASM
|
|
45
|
+
TokenConfigurationChangeItemWASM: typeof DPP.TokenConfigurationChangeItemWASM
|
|
46
|
+
AuthorizedActionTakersWASM: typeof DPP.AuthorizedActionTakersWASM
|
|
47
|
+
DistributionFunctionWASM: typeof DPP.DistributionFunctionWASM
|
|
48
|
+
TokenDistributionRecipientWASM: typeof DPP.TokenDistributionRecipientWASM
|
|
49
|
+
DistributionFixedAmountWASM: typeof DPP.DistributionFixedAmountWASM
|
|
50
|
+
DistributionRandomWASM: typeof DPP.DistributionRandomWASM
|
|
51
|
+
DistributionStepDecreasingAmountWASM: typeof DPP.DistributionStepDecreasingAmountWASM
|
|
52
|
+
DistributionLinearWASM: typeof DPP.DistributionLinearWASM
|
|
53
|
+
DistributionPolynomialWASM: typeof DPP.DistributionPolynomialWASM
|
|
54
|
+
DistributionExponentialWASM: typeof DPP.DistributionExponentialWASM
|
|
55
|
+
DistributionLogarithmicWASM: typeof DPP.DistributionLogarithmicWASM
|
|
56
|
+
DistributionInvertedLogarithmicWASM: typeof DPP.DistributionInvertedLogarithmicWASM
|
|
57
|
+
TokenConfigurationLocalizationWASM: typeof DPP.TokenConfigurationLocalizationWASM
|
|
58
|
+
TokenPerpetualDistributionWASM: typeof DPP.TokenPerpetualDistributionWASM
|
|
59
|
+
RewardDistributionTypeWASM: typeof DPP.RewardDistributionTypeWASM
|
|
60
|
+
TokenConfigurationConventionWASM: typeof DPP.TokenConfigurationConventionWASM
|
|
61
|
+
TokenTradeModeWASM: typeof DPP.TokenTradeModeWASM
|
|
62
|
+
TokenConfigurationWASM: typeof DPP.TokenConfigurationWASM
|
|
63
|
+
ActionTakerWASM: typeof DPP.ActionTakerWASM
|
|
64
|
+
ChangeControlRulesWASM: typeof DPP.ChangeControlRulesWASM
|
|
65
|
+
TokenDistributionRulesWASM: typeof DPP.TokenDistributionRulesWASM
|
|
66
|
+
GroupWASM: typeof DPP.GroupWASM
|
|
67
|
+
TokenKeepsHistoryRulesWASM: typeof DPP.TokenKeepsHistoryRulesWASM
|
|
68
|
+
TokenMarketplaceRulesWASM: typeof DPP.TokenMarketplaceRulesWASM
|
|
69
|
+
TokenPreProgrammedDistributionWASM: typeof DPP.TokenPreProgrammedDistributionWASM
|
|
23
70
|
IdentifierWASM: typeof DPP.IdentifierWASM
|
|
24
71
|
IdentityCreateTransitionWASM: typeof DPP.IdentityCreateTransitionWASM
|
|
25
72
|
IdentityCreditTransferWASM: typeof DPP.IdentityCreditTransferWASM
|
|
@@ -45,6 +92,7 @@ export class DashPlatformProtocolWASM {
|
|
|
45
92
|
PoolingWASM: typeof DPP.PoolingWASM
|
|
46
93
|
Purpose: typeof DPP.Purpose
|
|
47
94
|
SecurityLevel: typeof DPP.SecurityLevel
|
|
95
|
+
ActionGoalWASM: typeof DPP.ActionGoalWASM
|
|
48
96
|
// METHODS
|
|
49
97
|
cborToObject: typeof DPP.cborToObject
|
|
50
98
|
objectToCbor: typeof DPP.objectToCbor
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as DPP from './pshenmic_dpp.js';
|
|
2
|
+
import {default as wasmBytes} from "./pshenmic_dpp_bg.js";
|
|
3
|
+
|
|
4
|
+
export * from './pshenmic_dpp.js'
|
|
5
|
+
|
|
6
|
+
const binaryString = atob(wasmBytes);
|
|
7
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
8
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
9
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const dppInstance = DPP.initSync({ module: bytes.buffer });
|
|
13
|
+
|
|
14
|
+
export default DPP;
|