@dashevo/wasm-dpp2 4.2.0-beta.3 → 4.2.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dist/dpp.compressed.js +1 -1
- package/dist/dpp.d.ts +2740 -1961
- package/dist/dpp.js +1 -1
- package/dist/raw/wasm_dpp2.d.ts +2740 -1961
- package/dist/raw/wasm_dpp2.js +436 -25
- package/dist/raw/wasm_dpp2.no_url.js +436 -25
- package/dist/raw/wasm_dpp2_bg.wasm +0 -0
- package/dist/raw/wasm_dpp2_bg.wasm.d.ts +1937 -1919
- package/package.json +1 -1
|
@@ -2519,6 +2519,24 @@ export class ConsensusError {
|
|
|
2519
2519
|
}
|
|
2520
2520
|
return ConsensusError.__wrap(ret[0]);
|
|
2521
2521
|
}
|
|
2522
|
+
/**
|
|
2523
|
+
* The distinctFrom error this is, or `undefined` when it is not code
|
|
2524
|
+
* 10419.
|
|
2525
|
+
* @returns {DocumentDistinctFromErrorCode | undefined}
|
|
2526
|
+
*/
|
|
2527
|
+
get documentDistinctFromErrorCode() {
|
|
2528
|
+
const ret = wasm.consensuserror_document_distinct_from_error_code(this.__wbg_ptr);
|
|
2529
|
+
return ret === 0 ? undefined : ret;
|
|
2530
|
+
}
|
|
2531
|
+
/**
|
|
2532
|
+
* The encrypted-property error this is, or `undefined` when it is not
|
|
2533
|
+
* code 10420.
|
|
2534
|
+
* @returns {DocumentEncryptionErrorCode | undefined}
|
|
2535
|
+
*/
|
|
2536
|
+
get documentEncryptionErrorCode() {
|
|
2537
|
+
const ret = wasm.consensuserror_document_encryption_error_code(this.__wbg_ptr);
|
|
2538
|
+
return ret === 0 ? undefined : ret;
|
|
2539
|
+
}
|
|
2522
2540
|
/**
|
|
2523
2541
|
* The immutable-property error this is, or `undefined` when it is not
|
|
2524
2542
|
* code 40128.
|
|
@@ -2528,9 +2546,26 @@ export class ConsensusError {
|
|
|
2528
2546
|
const ret = wasm.consensuserror_document_immutability_error_code(this.__wbg_ptr);
|
|
2529
2547
|
return ret === 0 ? undefined : ret;
|
|
2530
2548
|
}
|
|
2549
|
+
/**
|
|
2550
|
+
* The maxBytes error this is, or `undefined` when it is not code 10421.
|
|
2551
|
+
* @returns {DocumentMaxBytesErrorCode | undefined}
|
|
2552
|
+
*/
|
|
2553
|
+
get documentMaxBytesErrorCode() {
|
|
2554
|
+
const ret = wasm.consensuserror_document_max_bytes_error_code(this.__wbg_ptr);
|
|
2555
|
+
return ret === 0 ? undefined : ret;
|
|
2556
|
+
}
|
|
2557
|
+
/**
|
|
2558
|
+
* The propertyConstraints error this is, or `undefined` when it is not
|
|
2559
|
+
* code 10422.
|
|
2560
|
+
* @returns {DocumentPropertyConstraintErrorCode | undefined}
|
|
2561
|
+
*/
|
|
2562
|
+
get documentPropertyConstraintErrorCode() {
|
|
2563
|
+
const ret = wasm.consensuserror_document_property_constraint_error_code(this.__wbg_ptr);
|
|
2564
|
+
return ret === 0 ? undefined : ret;
|
|
2565
|
+
}
|
|
2531
2566
|
/**
|
|
2532
2567
|
* The reference-validation error this is, or `undefined` when it is
|
|
2533
|
-
* not one of codes 40120-40125.
|
|
2568
|
+
* not one of codes 40120-40125, 40131, 40135 and 40136.
|
|
2534
2569
|
* @returns {DocumentReferenceErrorCode | undefined}
|
|
2535
2570
|
*/
|
|
2536
2571
|
get documentReferenceErrorCode() {
|
|
@@ -3443,7 +3478,7 @@ export class ContractUserModeration {
|
|
|
3443
3478
|
wasm.__wbg_contractusermoderation_free(ptr, 0);
|
|
3444
3479
|
}
|
|
3445
3480
|
/**
|
|
3446
|
-
* The action's name: ban, unban, suspend, unsuspend or
|
|
3481
|
+
* The action's name: ban, unban, suspend, unsuspend, warn, clearWarnings, deleteDocument or restoreDocument
|
|
3447
3482
|
* @returns {string}
|
|
3448
3483
|
*/
|
|
3449
3484
|
get action() {
|
|
@@ -3477,6 +3512,20 @@ export class ContractUserModeration {
|
|
|
3477
3512
|
const ret = wasm.contractusermoderation_data_contract_id(this.__wbg_ptr);
|
|
3478
3513
|
return Identifier.__wrap(ret);
|
|
3479
3514
|
}
|
|
3515
|
+
/**
|
|
3516
|
+
* For a restoreDocument, the document it brings back, as it was serialized when it was
|
|
3517
|
+
* deleted
|
|
3518
|
+
* @returns {Uint8Array | undefined}
|
|
3519
|
+
*/
|
|
3520
|
+
get document() {
|
|
3521
|
+
const ret = wasm.contractusermoderation_document(this.__wbg_ptr);
|
|
3522
|
+
let v1;
|
|
3523
|
+
if (ret[0] !== 0) {
|
|
3524
|
+
v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
3525
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
3526
|
+
}
|
|
3527
|
+
return v1;
|
|
3528
|
+
}
|
|
3480
3529
|
/**
|
|
3481
3530
|
* For a deleteDocument, the document it deletes
|
|
3482
3531
|
* @returns {Identifier | undefined}
|
|
@@ -3486,7 +3535,7 @@ export class ContractUserModeration {
|
|
|
3486
3535
|
return ret === 0 ? undefined : Identifier.__wrap(ret);
|
|
3487
3536
|
}
|
|
3488
3537
|
/**
|
|
3489
|
-
* For a deleteDocument, the document type of
|
|
3538
|
+
* For a deleteDocument or a restoreDocument, the document type of its document
|
|
3490
3539
|
* @returns {string | undefined}
|
|
3491
3540
|
*/
|
|
3492
3541
|
get documentTypeName() {
|
|
@@ -3579,8 +3628,8 @@ export class ContractUserModeration {
|
|
|
3579
3628
|
return BigInt.asUintN(64, ret);
|
|
3580
3629
|
}
|
|
3581
3630
|
/**
|
|
3582
|
-
* The identity the action targets, undefined for a deleteDocument
|
|
3583
|
-
* and whose it is is only known once the document is read
|
|
3631
|
+
* The identity the action targets, undefined for a deleteDocument and a restoreDocument:
|
|
3632
|
+
* they name a document, and whose it is is only known once the document is read
|
|
3584
3633
|
* @returns {Identifier | undefined}
|
|
3585
3634
|
*/
|
|
3586
3635
|
get identityId() {
|
|
@@ -3595,7 +3644,7 @@ export class ContractUserModeration {
|
|
|
3595
3644
|
return Identifier.__wrap(ret);
|
|
3596
3645
|
}
|
|
3597
3646
|
/**
|
|
3598
|
-
* For a ban, a suspend and a deleteDocument, why
|
|
3647
|
+
* For a ban, a suspend, a warn and a deleteDocument, why
|
|
3599
3648
|
* @returns {ContractModerationReason | undefined}
|
|
3600
3649
|
*/
|
|
3601
3650
|
get reason() {
|
|
@@ -4018,6 +4067,57 @@ export class DataContract {
|
|
|
4018
4067
|
DataContractFinalization.register(this, this.__wbg_ptr, this);
|
|
4019
4068
|
return this;
|
|
4020
4069
|
}
|
|
4070
|
+
/**
|
|
4071
|
+
* The `distinctFrom` declarations of one document type, in schema
|
|
4072
|
+
* property order: each `{ path, distinctFrom }` names an identifier
|
|
4073
|
+
* property and what its value must differ from, `"$ownerId"` or the
|
|
4074
|
+
* dotted path of another identifier property of the same type.
|
|
4075
|
+
*
|
|
4076
|
+
* Empty when the document type declares none (the normal case). Throws
|
|
4077
|
+
* when the contract has no document type by that name, so "no such
|
|
4078
|
+
* type" and "nothing declared" stay distinguishable.
|
|
4079
|
+
*
|
|
4080
|
+
* The keyword is only parsed from protocol version 14 onward. A
|
|
4081
|
+
* contract deserialized against an earlier platform version reports an
|
|
4082
|
+
* empty list, which is exactly what consensus enforced at that version,
|
|
4083
|
+
* while `toJSON()` still shows the raw keyword either way.
|
|
4084
|
+
* @param {string} documentTypeName
|
|
4085
|
+
* @returns {Array<DocumentPropertyDistinctFrom>}
|
|
4086
|
+
*/
|
|
4087
|
+
documentTypeDistinctFrom(documentTypeName) {
|
|
4088
|
+
const ptr0 = passStringToWasm0(documentTypeName, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4089
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4090
|
+
const ret = wasm.datacontract_documentTypeDistinctFrom(this.__wbg_ptr, ptr0, len0);
|
|
4091
|
+
if (ret[2]) {
|
|
4092
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4093
|
+
}
|
|
4094
|
+
return takeFromExternrefTable0(ret[0]);
|
|
4095
|
+
}
|
|
4096
|
+
/**
|
|
4097
|
+
* All `encryptedFor` declarations of one document type, in schema
|
|
4098
|
+
* property order: which byte array properties are encrypted, for whom,
|
|
4099
|
+
* under which key ids and under which scheme.
|
|
4100
|
+
*
|
|
4101
|
+
* Returns an empty array when the document type declares none. Throws
|
|
4102
|
+
* when the contract has no document type by that name, so "no such
|
|
4103
|
+
* type" and "nothing encrypted" stay distinguishable.
|
|
4104
|
+
*
|
|
4105
|
+
* The keyword is only parsed from protocol version 14 onward. A
|
|
4106
|
+
* contract deserialized against an earlier platform version reports
|
|
4107
|
+
* none, which is exactly what consensus enforced at that version, while
|
|
4108
|
+
* `toJSON()` still shows the raw keyword either way.
|
|
4109
|
+
* @param {string} documentTypeName
|
|
4110
|
+
* @returns {Array<DocumentPropertyEncryption>}
|
|
4111
|
+
*/
|
|
4112
|
+
documentTypeEncryptedProperties(documentTypeName) {
|
|
4113
|
+
const ptr0 = passStringToWasm0(documentTypeName, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4114
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4115
|
+
const ret = wasm.datacontract_documentTypeEncryptedProperties(this.__wbg_ptr, ptr0, len0);
|
|
4116
|
+
if (ret[2]) {
|
|
4117
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4118
|
+
}
|
|
4119
|
+
return takeFromExternrefTable0(ret[0]);
|
|
4120
|
+
}
|
|
4021
4121
|
/**
|
|
4022
4122
|
* The `immutable` / `immutableAllowSetting` declarations of one
|
|
4023
4123
|
* document type: `{ immutable: string[], immutableAllowSetting:
|
|
@@ -4045,8 +4145,9 @@ export class DataContract {
|
|
|
4045
4145
|
return takeFromExternrefTable0(ret[0]);
|
|
4046
4146
|
}
|
|
4047
4147
|
/**
|
|
4048
|
-
* All `refersTo` declarations of one document type
|
|
4049
|
-
*
|
|
4148
|
+
* All `refersTo` declarations of one document type: its `ownerRefersTo`
|
|
4149
|
+
* or `creatorRefersTo` first, at the path `$ownerId` or `$creatorId`,
|
|
4150
|
+
* then the properties' own in schema property order.
|
|
4050
4151
|
*
|
|
4051
4152
|
* Returns an empty array when the document type declares none. Throws
|
|
4052
4153
|
* when the contract has no document type by that name — an empty array
|
|
@@ -4070,6 +4171,61 @@ export class DataContract {
|
|
|
4070
4171
|
}
|
|
4071
4172
|
return takeFromExternrefTable0(ret[0]);
|
|
4072
4173
|
}
|
|
4174
|
+
/**
|
|
4175
|
+
* Every typed array property of one document type (`type: "array"`
|
|
4176
|
+
* with an `items` element schema), in schema property order: `{ path,
|
|
4177
|
+
* items, minItems?, maxItems?, uniqueItems }`.
|
|
4178
|
+
*
|
|
4179
|
+
* Returns an empty array when the document type declares none. Throws
|
|
4180
|
+
* when the contract has no document type by that name, so "no such
|
|
4181
|
+
* type" and "no typed arrays" stay distinguishable.
|
|
4182
|
+
*
|
|
4183
|
+
* Typed arrays are only parsed from protocol version 14 onward. A
|
|
4184
|
+
* contract deserialized against an earlier platform version cannot
|
|
4185
|
+
* carry one: the parsers of those versions refuse an array that is not
|
|
4186
|
+
* a byte array.
|
|
4187
|
+
* @param {string} documentTypeName
|
|
4188
|
+
* @returns {Array<DocumentTypedArrayProperty>}
|
|
4189
|
+
*/
|
|
4190
|
+
documentTypeTypedArrays(documentTypeName) {
|
|
4191
|
+
const ptr0 = passStringToWasm0(documentTypeName, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4192
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4193
|
+
const ret = wasm.datacontract_documentTypeTypedArrays(this.__wbg_ptr, ptr0, len0);
|
|
4194
|
+
if (ret[2]) {
|
|
4195
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4196
|
+
}
|
|
4197
|
+
return takeFromExternrefTable0(ret[0]);
|
|
4198
|
+
}
|
|
4199
|
+
/**
|
|
4200
|
+
* Every document type that declares at least one `distinctFrom`, keyed
|
|
4201
|
+
* by document type name.
|
|
4202
|
+
*
|
|
4203
|
+
* Document types with no declarations are omitted, so an empty `Map`
|
|
4204
|
+
* means "this contract declares no distinctFrom at all".
|
|
4205
|
+
* @returns {Map<string, Array<DocumentPropertyDistinctFrom>>}
|
|
4206
|
+
*/
|
|
4207
|
+
get documentDistinctFrom() {
|
|
4208
|
+
const ret = wasm.datacontract_document_distinct_from(this.__wbg_ptr);
|
|
4209
|
+
if (ret[2]) {
|
|
4210
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4211
|
+
}
|
|
4212
|
+
return takeFromExternrefTable0(ret[0]);
|
|
4213
|
+
}
|
|
4214
|
+
/**
|
|
4215
|
+
* Every document type that declares at least one encrypted property,
|
|
4216
|
+
* keyed by document type name.
|
|
4217
|
+
*
|
|
4218
|
+
* Document types with no declarations are omitted, so an empty `Map`
|
|
4219
|
+
* means "this contract declares no encrypted property at all".
|
|
4220
|
+
* @returns {Map<string, Array<DocumentPropertyEncryption>>}
|
|
4221
|
+
*/
|
|
4222
|
+
get documentEncryptedProperties() {
|
|
4223
|
+
const ret = wasm.datacontract_document_encrypted_properties(this.__wbg_ptr);
|
|
4224
|
+
if (ret[2]) {
|
|
4225
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4226
|
+
}
|
|
4227
|
+
return takeFromExternrefTable0(ret[0]);
|
|
4228
|
+
}
|
|
4073
4229
|
/**
|
|
4074
4230
|
* Every document type that freezes at least one property, keyed by
|
|
4075
4231
|
* document type name.
|
|
@@ -4100,6 +4256,21 @@ export class DataContract {
|
|
|
4100
4256
|
}
|
|
4101
4257
|
return takeFromExternrefTable0(ret[0]);
|
|
4102
4258
|
}
|
|
4259
|
+
/**
|
|
4260
|
+
* Every document type that declares at least one typed array property,
|
|
4261
|
+
* keyed by document type name.
|
|
4262
|
+
*
|
|
4263
|
+
* Document types with none are omitted, so an empty `Map` means "this
|
|
4264
|
+
* contract declares no typed arrays at all".
|
|
4265
|
+
* @returns {Map<string, Array<DocumentTypedArrayProperty>>}
|
|
4266
|
+
*/
|
|
4267
|
+
get documentTypedArrays() {
|
|
4268
|
+
const ret = wasm.datacontract_document_typed_arrays(this.__wbg_ptr);
|
|
4269
|
+
if (ret[2]) {
|
|
4270
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4271
|
+
}
|
|
4272
|
+
return takeFromExternrefTable0(ret[0]);
|
|
4273
|
+
}
|
|
4103
4274
|
/**
|
|
4104
4275
|
* @param {string} base64
|
|
4105
4276
|
* @param {boolean} full_validation
|
|
@@ -6288,18 +6459,27 @@ export class Document {
|
|
|
6288
6459
|
return Document.__wrap(ret[0]);
|
|
6289
6460
|
}
|
|
6290
6461
|
/**
|
|
6462
|
+
* Derives the id of a document that is about to be created, the way
|
|
6463
|
+
* consensus recomputes it for the create transition.
|
|
6464
|
+
*
|
|
6465
|
+
* From protocol version 14 the id commits to the identity contract
|
|
6466
|
+
* nonce of the create transition, so `identityContractNonce` is
|
|
6467
|
+
* required at that version (and ignored before it). The platform
|
|
6468
|
+
* version defaults to the latest.
|
|
6291
6469
|
* @param {string} documentTypeName
|
|
6292
6470
|
* @param {IdentifierLike} ownerId
|
|
6293
6471
|
* @param {IdentifierLike} dataContractId
|
|
6294
6472
|
* @param {Uint8Array | null} [entropy]
|
|
6473
|
+
* @param {bigint | null} [identityContractNonce]
|
|
6474
|
+
* @param {PlatformVersionLike | null} [platformVersion]
|
|
6295
6475
|
* @returns {Uint8Array}
|
|
6296
6476
|
*/
|
|
6297
|
-
static generateId(documentTypeName, ownerId, dataContractId, entropy) {
|
|
6477
|
+
static generateId(documentTypeName, ownerId, dataContractId, entropy, identityContractNonce, platformVersion) {
|
|
6298
6478
|
const ptr0 = passStringToWasm0(documentTypeName, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6299
6479
|
const len0 = WASM_VECTOR_LEN;
|
|
6300
6480
|
var ptr1 = isLikeNone(entropy) ? 0 : passArray8ToWasm0(entropy, wasm.__wbindgen_malloc);
|
|
6301
6481
|
var len1 = WASM_VECTOR_LEN;
|
|
6302
|
-
const ret = wasm.document_generateId(ptr0, len0, ownerId, dataContractId, ptr1, len1);
|
|
6482
|
+
const ret = wasm.document_generateId(ptr0, len0, ownerId, dataContractId, ptr1, len1, !isLikeNone(identityContractNonce), isLikeNone(identityContractNonce) ? BigInt(0) : identityContractNonce, isLikeNone(platformVersion) ? 0 : addToExternrefTable0(platformVersion));
|
|
6303
6483
|
if (ret[3]) {
|
|
6304
6484
|
throw takeFromExternrefTable0(ret[2]);
|
|
6305
6485
|
}
|
|
@@ -6338,6 +6518,27 @@ export class Document {
|
|
|
6338
6518
|
const ret = wasm.document_revision(this.__wbg_ptr);
|
|
6339
6519
|
return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
|
|
6340
6520
|
}
|
|
6521
|
+
/**
|
|
6522
|
+
* Gives the document the id its create transition will carry, derived
|
|
6523
|
+
* from its entropy and the identity contract nonce that transition is
|
|
6524
|
+
* going to use.
|
|
6525
|
+
*
|
|
6526
|
+
* `new DocumentCreateTransition(...)` does this on its own; call it
|
|
6527
|
+
* yourself to know the id before the transition exists (a document that
|
|
6528
|
+
* another document in the same batch references). The transition must
|
|
6529
|
+
* then be built with the same nonce.
|
|
6530
|
+
*
|
|
6531
|
+
* Throws when the document carries no entropy (one read back from
|
|
6532
|
+
* Platform), since only a new document can be created.
|
|
6533
|
+
* @param {bigint} identityContractNonce
|
|
6534
|
+
* @param {PlatformVersionLike | null} [platformVersion]
|
|
6535
|
+
*/
|
|
6536
|
+
setIdForCreation(identityContractNonce, platformVersion) {
|
|
6537
|
+
const ret = wasm.document_setIdForCreation(this.__wbg_ptr, identityContractNonce, isLikeNone(platformVersion) ? 0 : addToExternrefTable0(platformVersion));
|
|
6538
|
+
if (ret[1]) {
|
|
6539
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
6540
|
+
}
|
|
6541
|
+
}
|
|
6341
6542
|
/**
|
|
6342
6543
|
* @param {bigint | null} [createdAt]
|
|
6343
6544
|
*/
|
|
@@ -7196,6 +7397,60 @@ export class DocumentDeleteTransition {
|
|
|
7196
7397
|
}
|
|
7197
7398
|
if (Symbol.dispose) DocumentDeleteTransition.prototype[Symbol.dispose] = DocumentDeleteTransition.prototype.free;
|
|
7198
7399
|
|
|
7400
|
+
/**
|
|
7401
|
+
* Consensus error codes emitted by the `distinctFrom` check on document
|
|
7402
|
+
* creates and replaces (protocol version 14+).
|
|
7403
|
+
*
|
|
7404
|
+
* Branch on an error's `code` against this instead of matching its message:
|
|
7405
|
+
*
|
|
7406
|
+
* ```js
|
|
7407
|
+
* try {
|
|
7408
|
+
* await sdk.documents.create({ document, identityKey, signer });
|
|
7409
|
+
* } catch (e) {
|
|
7410
|
+
* if (e.code === DocumentDistinctFromErrorCode.DocumentPropertyNotDistinct) {
|
|
7411
|
+
* // an identifier property equals the value it must differ from
|
|
7412
|
+
* }
|
|
7413
|
+
* }
|
|
7414
|
+
* ```
|
|
7415
|
+
* @enum {10419}
|
|
7416
|
+
*/
|
|
7417
|
+
export const DocumentDistinctFromErrorCode = Object.freeze({
|
|
7418
|
+
/**
|
|
7419
|
+
* A `distinctFrom` identifier property of the written document equals
|
|
7420
|
+
* the value it must differ from: the document's `$ownerId`, or the named
|
|
7421
|
+
* property of the same document.
|
|
7422
|
+
*/
|
|
7423
|
+
DocumentPropertyNotDistinct: 10419, "10419": "DocumentPropertyNotDistinct",
|
|
7424
|
+
});
|
|
7425
|
+
|
|
7426
|
+
/**
|
|
7427
|
+
* Consensus error codes emitted by `encryptedFor` validation, which runs
|
|
7428
|
+
* from protocol version 14 onward on every document create and replace.
|
|
7429
|
+
*
|
|
7430
|
+
* Branch on an error's `code` against these instead of matching its
|
|
7431
|
+
* message:
|
|
7432
|
+
*
|
|
7433
|
+
* ```js
|
|
7434
|
+
* try {
|
|
7435
|
+
* await sdk.documents.create({ document, identityKey, signer });
|
|
7436
|
+
* } catch (e) {
|
|
7437
|
+
* if (e.code === DocumentEncryptionErrorCode.InvalidEncryptedPropertyShape) {
|
|
7438
|
+
* // the bytes are not the shape the declared scheme produces
|
|
7439
|
+
* }
|
|
7440
|
+
* }
|
|
7441
|
+
* ```
|
|
7442
|
+
* @enum {10420}
|
|
7443
|
+
*/
|
|
7444
|
+
export const DocumentEncryptionErrorCode = Object.freeze({
|
|
7445
|
+
/**
|
|
7446
|
+
* A property the document type declares `encryptedFor` was supplied
|
|
7447
|
+
* with bytes that are not a ciphertext of the declared scheme: shorter
|
|
7448
|
+
* than the IV plus one block, or not a multiple of the block length.
|
|
7449
|
+
* The shape is all consensus checks about a ciphertext.
|
|
7450
|
+
*/
|
|
7451
|
+
InvalidEncryptedPropertyShape: 10420, "10420": "InvalidEncryptedPropertyShape",
|
|
7452
|
+
});
|
|
7453
|
+
|
|
7199
7454
|
/**
|
|
7200
7455
|
* Consensus error codes emitted by the immutable-property check on document
|
|
7201
7456
|
* replaces (`immutable` / `immutableAllowSetting`, protocol version 14+).
|
|
@@ -7222,6 +7477,62 @@ export const DocumentImmutabilityErrorCode = Object.freeze({
|
|
|
7222
7477
|
DocumentImmutablePropertyChanged: 40128, "40128": "DocumentImmutablePropertyChanged",
|
|
7223
7478
|
});
|
|
7224
7479
|
|
|
7480
|
+
/**
|
|
7481
|
+
* Consensus error codes emitted by the `maxBytes` check, which runs from
|
|
7482
|
+
* protocol version 14 onward wherever a document is validated, on every
|
|
7483
|
+
* create and replace included.
|
|
7484
|
+
*
|
|
7485
|
+
* Branch on an error's `code` against these instead of matching its
|
|
7486
|
+
* message:
|
|
7487
|
+
*
|
|
7488
|
+
* ```js
|
|
7489
|
+
* try {
|
|
7490
|
+
* await sdk.documents.create({ document, identityKey, signer });
|
|
7491
|
+
* } catch (e) {
|
|
7492
|
+
* if (e.code === DocumentMaxBytesErrorCode.MaxBytesExceeded) {
|
|
7493
|
+
* // a string is longer in UTF-8 bytes than its property's maxBytes
|
|
7494
|
+
* }
|
|
7495
|
+
* }
|
|
7496
|
+
* ```
|
|
7497
|
+
* @enum {10421}
|
|
7498
|
+
*/
|
|
7499
|
+
export const DocumentMaxBytesErrorCode = Object.freeze({
|
|
7500
|
+
/**
|
|
7501
|
+
* A string, or an element of a typed array of strings, is longer in
|
|
7502
|
+
* UTF-8 bytes than the `maxBytes` its property declares. `maxLength`
|
|
7503
|
+
* counts characters, which are up to four bytes each.
|
|
7504
|
+
*/
|
|
7505
|
+
MaxBytesExceeded: 10421, "10421": "MaxBytesExceeded",
|
|
7506
|
+
});
|
|
7507
|
+
|
|
7508
|
+
/**
|
|
7509
|
+
* Consensus error codes emitted by the `propertyConstraints` check, which
|
|
7510
|
+
* runs from protocol version 14 onward wherever a document is validated, on
|
|
7511
|
+
* every create and replace included.
|
|
7512
|
+
*
|
|
7513
|
+
* Branch on an error's `code` against this instead of matching its message:
|
|
7514
|
+
*
|
|
7515
|
+
* ```js
|
|
7516
|
+
* try {
|
|
7517
|
+
* await sdk.documents.create({ document, identityKey, signer });
|
|
7518
|
+
* } catch (e) {
|
|
7519
|
+
* if (e.code === DocumentPropertyConstraintErrorCode.DocumentPropertyConstraintViolated) {
|
|
7520
|
+
* // the document breaks one of its type's rules; the message names it
|
|
7521
|
+
* }
|
|
7522
|
+
* }
|
|
7523
|
+
* ```
|
|
7524
|
+
* @enum {10422}
|
|
7525
|
+
*/
|
|
7526
|
+
export const DocumentPropertyConstraintErrorCode = Object.freeze({
|
|
7527
|
+
/**
|
|
7528
|
+
* The written document breaks a rule of its document type's
|
|
7529
|
+
* `propertyConstraints`: the rule does not hold, or evaluating it
|
|
7530
|
+
* overflowed, divided by zero, raised to a negative power or read a value
|
|
7531
|
+
* that is not an integer.
|
|
7532
|
+
*/
|
|
7533
|
+
DocumentPropertyConstraintViolated: 10422, "10422": "DocumentPropertyConstraintViolated",
|
|
7534
|
+
});
|
|
7535
|
+
|
|
7225
7536
|
export class DocumentPurchaseTransition {
|
|
7226
7537
|
static __wrap(ptr) {
|
|
7227
7538
|
ptr = ptr >>> 0;
|
|
@@ -7370,12 +7681,14 @@ if (Symbol.dispose) DocumentPurchaseTransition.prototype[Symbol.dispose] = Docum
|
|
|
7370
7681
|
* }
|
|
7371
7682
|
* }
|
|
7372
7683
|
* ```
|
|
7373
|
-
* @enum {40120 | 40121 | 40122 | 40123 | 40124 | 40125 | 40131}
|
|
7684
|
+
* @enum {40120 | 40121 | 40122 | 40123 | 40124 | 40125 | 40131 | 40135 | 40136 | 40137 | 40138}
|
|
7374
7685
|
*/
|
|
7375
7686
|
export const DocumentReferenceErrorCode = Object.freeze({
|
|
7376
7687
|
/**
|
|
7377
7688
|
* The referenced identity, contract, token or document (permanent or
|
|
7378
|
-
* deletable) does not exist
|
|
7689
|
+
* deletable) does not exist, or a `listElement` value is not an element
|
|
7690
|
+
* of the list it must be in (or was set while the property finding the
|
|
7691
|
+
* list's document was not).
|
|
7379
7692
|
*/
|
|
7380
7693
|
ReferencedEntityNotFound: 40120, "40120": "ReferencedEntityNotFound",
|
|
7381
7694
|
/**
|
|
@@ -7411,6 +7724,38 @@ export const DocumentReferenceErrorCode = Object.freeze({
|
|
|
7411
7724
|
* declaring `canBeDeleted: false`.
|
|
7412
7725
|
*/
|
|
7413
7726
|
ReferencedDocumentTypeNotDeletable: 40131, "40131": "ReferencedDocumentTypeNotDeletable",
|
|
7727
|
+
/**
|
|
7728
|
+
* The referenced contract exists but does not meet what the reference's
|
|
7729
|
+
* `contractRequirements` require of it: elected moderation, its election
|
|
7730
|
+
* open, a minimum age or a minimum time since its last update at the block
|
|
7731
|
+
* time of the write, an owner relation to the writer of the referring
|
|
7732
|
+
* document, or a config flag (read-only, keeping history, the owner
|
|
7733
|
+
* protection of its elected moderation declaration).
|
|
7734
|
+
*/
|
|
7735
|
+
ReferencedContractRequirementNotMet: 40135, "40135": "ReferencedContractRequirementNotMet",
|
|
7736
|
+
/**
|
|
7737
|
+
* The referenced identity public key exists and is enabled but does not
|
|
7738
|
+
* meet what the reference's `keyRequirements` require of it: its
|
|
7739
|
+
* purpose, or a binding to a document type of the declaring contract.
|
|
7740
|
+
*/
|
|
7741
|
+
ReferencedIdentityKeyRequirementNotMet: 40136, "40136": "ReferencedIdentityKeyRequirementNotMet",
|
|
7742
|
+
/**
|
|
7743
|
+
* A `refersTo` lookup into a document type of another contract cannot
|
|
7744
|
+
* resolve there, reported at contract registration: the named index is
|
|
7745
|
+
* missing or not unique, the keys do not cover it exactly, or a source
|
|
7746
|
+
* holds a different kind of value than its index property. (A lookup into
|
|
7747
|
+
* the declaring contract is refused by the contract parse instead.)
|
|
7748
|
+
*/
|
|
7749
|
+
ReferencedDocumentLookupInvalid: 40137, "40137": "ReferencedDocumentLookupInvalid",
|
|
7750
|
+
/**
|
|
7751
|
+
* A `refersTo: listElement` whose list lives in a document type of
|
|
7752
|
+
* another contract cannot be served by it, reported at contract
|
|
7753
|
+
* registration: that type's documents can be deleted, the list is not a
|
|
7754
|
+
* stored typed array of identifiers of it, or a replace could change the
|
|
7755
|
+
* list. (A list in the declaring contract is refused by the contract parse
|
|
7756
|
+
* instead.)
|
|
7757
|
+
*/
|
|
7758
|
+
ReferencedDocumentListInvalid: 40138, "40138": "ReferencedDocumentListInvalid",
|
|
7414
7759
|
});
|
|
7415
7760
|
|
|
7416
7761
|
export class DocumentReplaceTransition {
|
|
@@ -20390,7 +20735,7 @@ export class TokenDistributionRecipient {
|
|
|
20390
20735
|
* @returns {TokenDistributionRecipient}
|
|
20391
20736
|
*/
|
|
20392
20737
|
static ContractOwner() {
|
|
20393
|
-
const ret = wasm.
|
|
20738
|
+
const ret = wasm.authorizedactiontakers_NoOne();
|
|
20394
20739
|
return TokenDistributionRecipient.__wrap(ret);
|
|
20395
20740
|
}
|
|
20396
20741
|
/**
|
|
@@ -23352,8 +23697,10 @@ if (Symbol.dispose) VerifiedBalanceTransfer.prototype[Symbol.dispose] = Verified
|
|
|
23352
23697
|
|
|
23353
23698
|
/**
|
|
23354
23699
|
* `VerifiedContractDocumentRemoval` proof-result wrapper: the record a moderator's document
|
|
23355
|
-
* deletion left under the contract
|
|
23356
|
-
* was, who removed it, why and
|
|
23700
|
+
* deletion left under the contract, as a deletion or a restore leaves it. After a deletion
|
|
23701
|
+
* the document is gone and the record says whose it was, who removed it, why, when and what
|
|
23702
|
+
* it was (its hash); after a restore the document is live again and the record also says who
|
|
23703
|
+
* brought it back and when.
|
|
23357
23704
|
*/
|
|
23358
23705
|
export class VerifiedContractDocumentRemoval {
|
|
23359
23706
|
__destroy_into_raw() {
|
|
@@ -23419,6 +23766,24 @@ export class VerifiedContractDocumentRemoval {
|
|
|
23419
23766
|
const ret = wasm.__wbg_get_verifiedcontractdocumentremoval_removedAt(this.__wbg_ptr);
|
|
23420
23767
|
return BigInt.asUintN(64, ret);
|
|
23421
23768
|
}
|
|
23769
|
+
/**
|
|
23770
|
+
* The time of the block that restored it, in milliseconds, undefined while the removal
|
|
23771
|
+
* stands
|
|
23772
|
+
* @returns {bigint | undefined}
|
|
23773
|
+
*/
|
|
23774
|
+
get restoredAt() {
|
|
23775
|
+
const ret = wasm.__wbg_get_verifiedcontractdocumentremoval_restoredAt(this.__wbg_ptr);
|
|
23776
|
+
return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
|
|
23777
|
+
}
|
|
23778
|
+
/**
|
|
23779
|
+
* The contract owner or moderator that restored the document, undefined while the
|
|
23780
|
+
* removal stands
|
|
23781
|
+
* @returns {Identifier | undefined}
|
|
23782
|
+
*/
|
|
23783
|
+
get restoredBy() {
|
|
23784
|
+
const ret = wasm.__wbg_get_verifiedcontractdocumentremoval_restoredBy(this.__wbg_ptr);
|
|
23785
|
+
return ret === 0 ? undefined : Identifier.__wrap(ret);
|
|
23786
|
+
}
|
|
23422
23787
|
/**
|
|
23423
23788
|
* @param {Identifier} arg0
|
|
23424
23789
|
*/
|
|
@@ -23468,6 +23833,44 @@ export class VerifiedContractDocumentRemoval {
|
|
|
23468
23833
|
set removedAt(arg0) {
|
|
23469
23834
|
wasm.__wbg_set_verifiedcontractdocumentremoval_removedAt(this.__wbg_ptr, arg0);
|
|
23470
23835
|
}
|
|
23836
|
+
/**
|
|
23837
|
+
* The time of the block that restored it, in milliseconds, undefined while the removal
|
|
23838
|
+
* stands
|
|
23839
|
+
* @param {bigint | null} [arg0]
|
|
23840
|
+
*/
|
|
23841
|
+
set restoredAt(arg0) {
|
|
23842
|
+
wasm.__wbg_set_verifiedcontractdocumentremoval_restoredAt(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
|
|
23843
|
+
}
|
|
23844
|
+
/**
|
|
23845
|
+
* The contract owner or moderator that restored the document, undefined while the
|
|
23846
|
+
* removal stands
|
|
23847
|
+
* @param {Identifier | null} [arg0]
|
|
23848
|
+
*/
|
|
23849
|
+
set restoredBy(arg0) {
|
|
23850
|
+
let ptr0 = 0;
|
|
23851
|
+
if (!isLikeNone(arg0)) {
|
|
23852
|
+
_assertClass(arg0, Identifier);
|
|
23853
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
23854
|
+
}
|
|
23855
|
+
wasm.__wbg_set_verifiedcontractdocumentremoval_restoredBy(this.__wbg_ptr, ptr0);
|
|
23856
|
+
}
|
|
23857
|
+
/**
|
|
23858
|
+
* A double SHA-256 of the document as it was serialized under its type when it was
|
|
23859
|
+
* removed: what a restore must bring back byte for byte, as 64 hex characters
|
|
23860
|
+
* @returns {string}
|
|
23861
|
+
*/
|
|
23862
|
+
get documentHash() {
|
|
23863
|
+
let deferred1_0;
|
|
23864
|
+
let deferred1_1;
|
|
23865
|
+
try {
|
|
23866
|
+
const ret = wasm.verifiedcontractdocumentremoval_document_hash(this.__wbg_ptr);
|
|
23867
|
+
deferred1_0 = ret[0];
|
|
23868
|
+
deferred1_1 = ret[1];
|
|
23869
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
23870
|
+
} finally {
|
|
23871
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
23872
|
+
}
|
|
23873
|
+
}
|
|
23471
23874
|
/**
|
|
23472
23875
|
* Why the moderator removed the document: the text may be empty
|
|
23473
23876
|
* @returns {ContractModerationReason}
|
|
@@ -23703,9 +24106,9 @@ if (Symbol.dispose) VerifiedContractFeeClaim.prototype[Symbol.dispose] = Verifie
|
|
|
23703
24106
|
|
|
23704
24107
|
/**
|
|
23705
24108
|
* `VerifiedContractModerationListStatuses` proof-result wrapper: the target identity's status
|
|
23706
|
-
* on the lists a moderation transition touched (
|
|
23707
|
-
* A list the proof does not cover is unknown: `banned` is undefined unless
|
|
23708
|
-
* `banlist`.
|
|
24109
|
+
* on the lists a moderation transition touched (every barring list for a ban, the edited one
|
|
24110
|
+
* otherwise). A list the proof does not cover is unknown: `banned` is undefined unless
|
|
24111
|
+
* `lists` includes `banlist`, and `warnings` unless it includes `warnings`.
|
|
23709
24112
|
*/
|
|
23710
24113
|
export class VerifiedContractModerationListStatuses {
|
|
23711
24114
|
__destroy_into_raw() {
|
|
@@ -23741,7 +24144,7 @@ export class VerifiedContractModerationListStatuses {
|
|
|
23741
24144
|
return Identifier.__wrap(ret);
|
|
23742
24145
|
}
|
|
23743
24146
|
/**
|
|
23744
|
-
* The lists the proof covers: `banlist
|
|
24147
|
+
* The lists the proof covers: `banlist` and `suspensions` for a ban, else the one edited
|
|
23745
24148
|
* @returns {string[]}
|
|
23746
24149
|
*/
|
|
23747
24150
|
get lists() {
|
|
@@ -23772,7 +24175,7 @@ export class VerifiedContractModerationListStatuses {
|
|
|
23772
24175
|
set contractId(arg0) {
|
|
23773
24176
|
_assertClass(arg0, Identifier);
|
|
23774
24177
|
var ptr0 = arg0.__destroy_into_raw();
|
|
23775
|
-
wasm.
|
|
24178
|
+
wasm.__wbg_set_verifiedcontractdocumentremoval_documentOwnerId(this.__wbg_ptr, ptr0);
|
|
23776
24179
|
}
|
|
23777
24180
|
/**
|
|
23778
24181
|
* @param {Identifier} arg0
|
|
@@ -23780,10 +24183,10 @@ export class VerifiedContractModerationListStatuses {
|
|
|
23780
24183
|
set identityId(arg0) {
|
|
23781
24184
|
_assertClass(arg0, Identifier);
|
|
23782
24185
|
var ptr0 = arg0.__destroy_into_raw();
|
|
23783
|
-
wasm.
|
|
24186
|
+
wasm.__wbg_set_verifiedcontractdocumentremoval_moderatorId(this.__wbg_ptr, ptr0);
|
|
23784
24187
|
}
|
|
23785
24188
|
/**
|
|
23786
|
-
* The lists the proof covers: `banlist
|
|
24189
|
+
* The lists the proof covers: `banlist` and `suspensions` for a ban, else the one edited
|
|
23787
24190
|
* @param {string[]} arg0
|
|
23788
24191
|
*/
|
|
23789
24192
|
set lists(arg0) {
|
|
@@ -23797,7 +24200,7 @@ export class VerifiedContractModerationListStatuses {
|
|
|
23797
24200
|
* @param {bigint | null} [arg0]
|
|
23798
24201
|
*/
|
|
23799
24202
|
set suspendedUntil(arg0) {
|
|
23800
|
-
wasm.
|
|
24203
|
+
wasm.__wbg_set_verifiedcontractdocumentremoval_restoredAt(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
|
|
23801
24204
|
}
|
|
23802
24205
|
/**
|
|
23803
24206
|
* When the identity is banned: why
|
|
@@ -23865,6 +24268,14 @@ export class VerifiedContractModerationListStatuses {
|
|
|
23865
24268
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
23866
24269
|
}
|
|
23867
24270
|
}
|
|
24271
|
+
/**
|
|
24272
|
+
* When `lists` includes `warnings`: the identity's warnings, oldest first
|
|
24273
|
+
* @returns {ContractWarning[] | undefined}
|
|
24274
|
+
*/
|
|
24275
|
+
get warnings() {
|
|
24276
|
+
const ret = wasm.verifiedcontractmoderationliststatuses_warnings(this.__wbg_ptr);
|
|
24277
|
+
return ret;
|
|
24278
|
+
}
|
|
23868
24279
|
}
|
|
23869
24280
|
if (Symbol.dispose) VerifiedContractModerationListStatuses.prototype[Symbol.dispose] = VerifiedContractModerationListStatuses.prototype.free;
|
|
23870
24281
|
|
|
@@ -24457,7 +24868,7 @@ export class VerifiedIdentityWithShieldedNullifiers {
|
|
|
24457
24868
|
set identity(arg0) {
|
|
24458
24869
|
_assertClass(arg0, Identity);
|
|
24459
24870
|
var ptr0 = arg0.__destroy_into_raw();
|
|
24460
|
-
wasm.
|
|
24871
|
+
wasm.__wbg_set_verifiedidentityfullwithaddressinfos_identity(this.__wbg_ptr, ptr0);
|
|
24461
24872
|
}
|
|
24462
24873
|
/**
|
|
24463
24874
|
* @param {any} value
|
|
@@ -25418,7 +25829,7 @@ export class VerifiedTokenBalance {
|
|
|
25418
25829
|
set tokenId(arg0) {
|
|
25419
25830
|
_assertClass(arg0, Identifier);
|
|
25420
25831
|
var ptr0 = arg0.__destroy_into_raw();
|
|
25421
|
-
wasm.
|
|
25832
|
+
wasm.__wbg_set_verifiedcontractfeeclaim_contractId(this.__wbg_ptr, ptr0);
|
|
25422
25833
|
}
|
|
25423
25834
|
/**
|
|
25424
25835
|
* @returns {any}
|
|
Binary file
|