@maxandriani/indy-besu-vdr-nodejs 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,74 @@
1
- # Temporary Holding Version
1
+ # WASM FFI for Indy Besu VDR
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ ### TypeScript definitions
4
+
5
+ The generated package (`pkg/indy_besu_vdr_wasm.d.ts`) exports full TypeScript
6
+ definitions for every method input and output (see `src/types.rs`). They mirror
7
+ the serde serialization of the corresponding `indy-besu-vdr` Rust types:
8
+
9
+ * `DidString` — template-literal type accepting only the DID methods supported
10
+ by this VDR per the [Indy DID method](https://hyperledger-indy.github.io/indy-did-method/)
11
+ specification: `did:indy:besu(:network)?:<identifier>` and
12
+ `did:ethr(:network)?:<identifier>`.
13
+ * `DidDocument`, `DidRecord`, `DidDocumentWithMeta`, `DidDocAttribute`, DID event types.
14
+ * `SchemaData`/`SchemaRecord`, `CredentialDefinitionData`/`CredentialDefinitionRecord`,
15
+ revocation registry definition/entry/status-list types.
16
+ * Client types: `ContractConfig`, `QuorumConfig`, `PingStatus`, `EventLog`, `SignatureData`.
17
+
18
+ ### Requirements
19
+
20
+ * Rust of version 1.79.0 or higher.
21
+ * Wasm-pack: https://rustwasm.github.io/wasm-pack/installer/
22
+
23
+ Install rustup alongside Homebrew Rust—no need to uninstall anything:
24
+
25
+ ```sh
26
+ brew install rustup
27
+ ```
28
+
29
+ Then initialize a toolchain and install the WebAssembly target:
30
+
31
+ ```sh
32
+ export PATH="/opt/homebrew/opt/rustup/bin:$PATH"
33
+ rustup toolchain install stable
34
+ rustup default stable
35
+ rustup target add wasm32-unknown-unknown
36
+ ```
37
+
38
+ ### Build
39
+
40
+ #### NodeJS bindings
41
+
42
+ ```
43
+ wasm-pack build --target=nodejs
44
+ ```
45
+
46
+ #### WASM (consumed in browser without bundler usage) bindings
47
+
48
+ ```
49
+ wasm-pack build --target=web
50
+ ```
51
+
52
+ #### Bindings to use with webpack
53
+
54
+ ```
55
+ wasm-pack build
56
+ ```
57
+
58
+ ### Run demo
59
+
60
+ #### NodeJS demo
61
+
62
+ * Build NodeJS bindings from `wasm` directory
63
+ ```
64
+ wasm-pack build --target=nodejs
65
+ ```
66
+ * Install dependencies
67
+ ```
68
+ cd demo/node
69
+ yarn install
70
+ ```
71
+ * Run demo
72
+ ```
73
+ yarn start
74
+ ```
@@ -0,0 +1,512 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * A DID handled by this VDR.
6
+ *
7
+ * Supported methods (per https://hyperledger-indy.github.io/indy-did-method/):
8
+ * - `did:indy:besu(:network)?:<identifier>`
9
+ * - `did:ethr(:network)?:<identifier>`
10
+ *
11
+ * At most ONE network segment is allowed, and the identifier must be either
12
+ * a 20-byte Ethereum address or a 64/65-byte uncompressed public key
13
+ * (hex-encoded, `0x` prefixed).
14
+ */
15
+ export type DidString =
16
+ | `did:indy:besu:${string}`
17
+ | `did:ethr:${string}`;
18
+
19
+ /** Ethereum account address (`0x` + 40 hex chars) */
20
+ export type AddressString = string;
21
+
22
+ export interface ContractSpec {
23
+ contractName: string;
24
+ abi: Array<Record<string, unknown>>;
25
+ }
26
+
27
+ export interface ContractConfig {
28
+ address: AddressString;
29
+ specPath?: string | null;
30
+ spec?: ContractSpec | null;
31
+ }
32
+
33
+ export interface QuorumConfig {
34
+ nodes: string[];
35
+ request_retries?: number | null;
36
+ request_timeout?: number | null;
37
+ retry_interval?: number | null;
38
+ }
39
+
40
+ export type Status =
41
+ | { Ok: { block_number: number; block_timestamp: number } }
42
+ | { Err: { msg: string } };
43
+
44
+ export interface PingStatus {
45
+ status: Status;
46
+ }
47
+
48
+ export interface SignatureData {
49
+ /** recovery ID used for public key recovery */
50
+ recovery_id: number;
51
+ /** ECDSA signature bytes */
52
+ signature: number[];
53
+ }
54
+
55
+ export interface EventLog {
56
+ /** 32-byte topic hashes (`0x` prefixed hex) */
57
+ topics: string[];
58
+ data: number[];
59
+ block: number;
60
+ }
61
+
62
+ export type VerificationKeyType =
63
+ | "Ed25519VerificationKey2018"
64
+ | "X25519KeyAgreementKey2019"
65
+ | "Ed25519VerificationKey2020"
66
+ | "X25519KeyAgreementKey2020"
67
+ | "JsonWebKey2020"
68
+ | "EcdsaSecp256k1VerificationKey2019"
69
+ | "EcdsaSecp256k1VerificationKey2020"
70
+ | "EcdsaSecp256k1RecoveryMethod2020";
71
+
72
+ export interface VerificationMethod {
73
+ id: string;
74
+ type: VerificationKeyType;
75
+ controller: string;
76
+ blockchainAccountId?: string;
77
+ publicKeyMultibase?: string;
78
+ publicKeyHex?: string;
79
+ publicKeyBase58?: string;
80
+ publicKeyBase64?: string;
81
+ publicKeyJwk?: string;
82
+ }
83
+
84
+ export type VerificationMethodOrReference = string | VerificationMethod;
85
+
86
+ export type ServiceType =
87
+ | "LinkedDomains"
88
+ | "DIDCommMessaging"
89
+ | "CredentialRegistry"
90
+ | "OID4VCI"
91
+ | "OID4VP";
92
+
93
+ export interface ServiceEndpointObject {
94
+ uri: string;
95
+ accept: string[];
96
+ routingKeys: string[];
97
+ }
98
+
99
+ export type ServiceEndpoint =
100
+ | string
101
+ | ServiceEndpointObject
102
+ | Array<string | ServiceEndpointObject>;
103
+
104
+ export interface DidService {
105
+ id: string;
106
+ type: ServiceType;
107
+ serviceEndpoint: ServiceEndpoint;
108
+ }
109
+
110
+ /** DID Document matching https://www.w3.org/TR/did-core/ */
111
+ export interface DidDocument {
112
+ "@context": string | string[];
113
+ id: DidString;
114
+ controller?: string | string[];
115
+ verificationMethod: VerificationMethod[];
116
+ authentication?: VerificationMethodOrReference[];
117
+ assertionMethod?: VerificationMethodOrReference[];
118
+ capabilityInvocation?: VerificationMethodOrReference[];
119
+ capabilityDelegation?: VerificationMethodOrReference[];
120
+ keyAgreement?: VerificationMethodOrReference[];
121
+ service?: DidService[];
122
+ alsoKnownAs?: string[];
123
+ }
124
+
125
+ export interface DidMetadata {
126
+ owner?: AddressString;
127
+ created?: number;
128
+ deactivated?: boolean;
129
+ versionId?: number;
130
+ updated?: number;
131
+ nextVersionId?: number;
132
+ nextUpdate?: number;
133
+ }
134
+
135
+ /** DID Record stored in the IndyBesu DID Registry */
136
+ export interface DidRecord {
137
+ document: DidDocument;
138
+ metadata: DidMetadata;
139
+ }
140
+
141
+ export type DidResolutionError =
142
+ | "notFound"
143
+ | "invalidDid"
144
+ | "representationNotSupported"
145
+ | "invalidDidUrl"
146
+ | "methodNotSupported";
147
+
148
+ export interface DidResolutionMetadata {
149
+ contentType: string | null;
150
+ error: DidResolutionError | null;
151
+ message: string | null;
152
+ }
153
+
154
+ export interface DidDocumentWithMeta {
155
+ didDocument?: DidDocument;
156
+ didDocumentMetadata: DidMetadata;
157
+ didResolutionMetadata: DidResolutionMetadata;
158
+ }
159
+
160
+ export interface DidResolutionOptions {
161
+ accept?: string | null;
162
+ blockTag?: number | null;
163
+ }
164
+
165
+ export type PublicKeyPurpose = "veriKey" | "sigAuth" | "enc";
166
+
167
+ export type PublicKeyType =
168
+ | "Ed25519VerificationKey2020"
169
+ | "X25519KeyAgreementKey2020"
170
+ | "EcdsaSecp256k1VerificationKey2020";
171
+
172
+ export interface PublicKeyAttribute {
173
+ purpose: PublicKeyPurpose;
174
+ type: PublicKeyType;
175
+ publicKeyHex?: string;
176
+ publicKeyBase64?: string;
177
+ publicKeyBase58?: string;
178
+ publicKeyPem?: string;
179
+ }
180
+
181
+ export interface ServiceAttribute {
182
+ type: ServiceType;
183
+ serviceEndpoint: ServiceEndpoint;
184
+ }
185
+
186
+ /** Attribute which can be associated with a `did:ethr` DID */
187
+ export type DidDocAttribute = PublicKeyAttribute | ServiceAttribute;
188
+
189
+ export interface DidAttributeChanged {
190
+ identity: AddressString;
191
+ name: string;
192
+ value: number[];
193
+ validTo: number;
194
+ previousChange: number;
195
+ }
196
+
197
+ export interface DidDelegateChanged {
198
+ identity: AddressString;
199
+ delegate: AddressString;
200
+ delegateType: number[];
201
+ validTo: number;
202
+ previousChange: number;
203
+ }
204
+
205
+ export interface DidOwnerChanged {
206
+ identity: AddressString;
207
+ owner: AddressString;
208
+ previousChange: number;
209
+ }
210
+
211
+ export type DidEvent =
212
+ | { AttributeChangedEvent: DidAttributeChanged }
213
+ | { DelegateChanged: DidDelegateChanged }
214
+ | { OwnerChanged: DidOwnerChanged };
215
+
216
+ /** AnonCreds Schema matching https://hyperledger.github.io/anoncreds-spec/#term:schema */
217
+ export interface SchemaData {
218
+ issuerId: DidString;
219
+ name: string;
220
+ version: string;
221
+ attrNames: string[];
222
+ }
223
+
224
+ export interface SchemaMetadata {
225
+ created: number;
226
+ }
227
+
228
+ export interface SchemaRecord {
229
+ schema: SchemaData;
230
+ metadata: SchemaMetadata;
231
+ }
232
+
233
+ /** AnonCreds Credential Definition matching https://hyperledger.github.io/anoncreds-spec/#term:credential-definition */
234
+ export interface CredentialDefinitionData {
235
+ issuerId: DidString;
236
+ schemaId: string;
237
+ credDefType: "CL";
238
+ tag: string;
239
+ value: Record<string, unknown>;
240
+ }
241
+
242
+ export interface CredentialDefinitionMetadata {
243
+ created: number;
244
+ }
245
+
246
+ export interface CredentialDefinitionRecord {
247
+ credentialDefinition: CredentialDefinitionData;
248
+ metadata: CredentialDefinitionMetadata;
249
+ }
250
+
251
+ export interface AccumKey {
252
+ z: string;
253
+ }
254
+
255
+ export interface RevocationRegistryPublicKeys {
256
+ accumKey: AccumKey;
257
+ }
258
+
259
+ export interface RevocationRegistryDefinitionValue {
260
+ maxCredNum: number;
261
+ publicKeys: RevocationRegistryPublicKeys;
262
+ tailsHash: string;
263
+ tailsLocation: string;
264
+ }
265
+
266
+ /** AnonCreds Revocation Registry Definition matching https://hyperledger.github.io/anoncreds-spec/#term:revocation-registry-definition */
267
+ export interface RevocationRegistryDefinitionData {
268
+ issuerId: DidString;
269
+ revocDefType: "CL_ACCUM";
270
+ credDefId: string;
271
+ tag: string;
272
+ value: RevocationRegistryDefinitionValue;
273
+ }
274
+
275
+ export interface RevocationRegistryDefinitionMetadata {
276
+ created: number;
277
+ }
278
+
279
+ export interface RevocationRegistryDefinitionRecord {
280
+ revocationRegistryDefinition: RevocationRegistryDefinitionData;
281
+ metadata: RevocationRegistryDefinitionMetadata;
282
+ }
283
+
284
+ export interface RevocationRegistryEntryData {
285
+ currentAccumulator: string;
286
+ prevAccumulator?: string | null;
287
+ issued?: number[] | null;
288
+ revoked?: number[] | null;
289
+ }
290
+
291
+ export interface RevocationRegistryEntryValue {
292
+ revRegDefId: string;
293
+ issuerId: DidString;
294
+ revRegEntryData: RevocationRegistryEntryData;
295
+ }
296
+
297
+ export interface RevocationStatusListData {
298
+ issuerId: DidString;
299
+ revRegDefId: string;
300
+ revocationList: number[];
301
+ currentAccumulator: string;
302
+ timestamp: number;
303
+ }
304
+
305
+
306
+
307
+ export class CredentialDefinition {
308
+ free(): void;
309
+ [Symbol.dispose](): void;
310
+ static fromString(string: string): CredentialDefinition;
311
+ constructor(issuer_id: string, schema_id: string, tag: string, value: Record<string, unknown>);
312
+ getId(): string;
313
+ asValue(): CredentialDefinitionData;
314
+ toString(): string;
315
+ }
316
+
317
+ export class CredentialDefinitionRegistry {
318
+ private constructor();
319
+ free(): void;
320
+ [Symbol.dispose](): void;
321
+ static resolveCredentialDefinition(client: LedgerClient, id: string): Promise<CredentialDefinition>;
322
+ static parseResolveCredentialDefinitionResult(client: LedgerClient, bytes: Uint8Array): CredentialDefinitionRecord;
323
+ static buildCreateCredentialDefinitionTransaction(client: LedgerClient, from: string, cred_def: CredentialDefinition, nonce?: bigint | null): Promise<Transaction>;
324
+ static buildResolveCredentialDefinitionTransaction(client: LedgerClient, id: string): Promise<Transaction>;
325
+ static buildCreateCredentialDefinitionEndorsingData(client: LedgerClient, cred_def: CredentialDefinition): Promise<TransactionEndorsingData>;
326
+ }
327
+
328
+ export class DidResolver {
329
+ private constructor();
330
+ free(): void;
331
+ [Symbol.dispose](): void;
332
+ static resolveDid(client: LedgerClient, did: string, options: DidResolutionOptions | undefined | null): Promise<DidDocumentWithMeta>;
333
+ }
334
+
335
+ export class Endorsement {
336
+ private constructor();
337
+ free(): void;
338
+ [Symbol.dispose](): void;
339
+ static buildEndorsementTransaction(client: LedgerClient, from: string, endorsing_data: TransactionEndorsingData, nonce?: bigint | null): Promise<Transaction>;
340
+ }
341
+
342
+ export class EthrDidRegistry {
343
+ private constructor();
344
+ free(): void;
345
+ [Symbol.dispose](): void;
346
+ static parseDidOwnerResult(client: LedgerClient, bytes: Uint8Array): string;
347
+ static parseDidChangedResult(client: LedgerClient, bytes: Uint8Array): bigint;
348
+ static parseDidEventResponse(client: LedgerClient, log: EventLog): DidEvent;
349
+ static buildGetDidEventsQuery(client: LedgerClient, did: string, from_block?: bigint | null, to_block?: bigint | null): Promise<EventQuery>;
350
+ static buildGetDidOwnerTransaction(client: LedgerClient, did: string): Promise<Transaction>;
351
+ static buildGetDidChangedTransaction(client: LedgerClient, did: string): Promise<Transaction>;
352
+ static buildDidAddDelegateTransaction(client: LedgerClient, sender: string, did: string, delegate_type: string, delegate: string, validity: bigint, nonce?: bigint | null): Promise<Transaction>;
353
+ static buildDidChangeOwnerTransaction(client: LedgerClient, sender: string, did: string, new_owner: string, nonce?: bigint | null): Promise<Transaction>;
354
+ static buildDidSetAttributeTransaction(client: LedgerClient, sender: string, did: string, attribute: DidDocAttribute, validity: bigint, nonce?: bigint | null): Promise<Transaction>;
355
+ static buildGetIdentityNonceTransaction(client: LedgerClient, identity: string): Promise<Transaction>;
356
+ static buildDidAddDelegateEndorsingData(client: LedgerClient, did: string, delegate_type: string, delegate: string, validity: bigint): Promise<TransactionEndorsingData>;
357
+ static buildDidChangeOwnerEndorsingData(client: LedgerClient, did: string, new_owner: string): Promise<TransactionEndorsingData>;
358
+ static buildDidRevokeDelegateTransaction(client: LedgerClient, sender: string, did: string, delegate_type: string, delegate: string, nonce?: bigint | null): Promise<Transaction>;
359
+ static buildDidRevokeAttributeTransaction(client: LedgerClient, sender: string, did: string, attribute: DidDocAttribute, nonce?: bigint | null): Promise<Transaction>;
360
+ static buildDidSetAttributeEndorsingData(client: LedgerClient, did: string, attribute: DidDocAttribute, validity: bigint): Promise<TransactionEndorsingData>;
361
+ static parseDidOwnerChangedEventResponse(client: LedgerClient, log: EventLog): DidOwnerChanged;
362
+ static buildDidRevokeDelegateEndorsingData(client: LedgerClient, did: string, delegate_type: string, delegate: string): Promise<TransactionEndorsingData>;
363
+ static buildDidRevokeAttributeEndorsingData(client: LedgerClient, did: string, attribute: DidDocAttribute): Promise<TransactionEndorsingData>;
364
+ static parseDidDelegateChangedEventResponse(client: LedgerClient, log: EventLog): DidDelegateChanged;
365
+ static parseDidAttributeChangedEventResponse(client: LedgerClient, log: EventLog): DidAttributeChanged;
366
+ }
367
+
368
+ export class EventQuery {
369
+ private constructor();
370
+ free(): void;
371
+ [Symbol.dispose](): void;
372
+ }
373
+
374
+ export class IndyDidRegistry {
375
+ private constructor();
376
+ free(): void;
377
+ [Symbol.dispose](): void;
378
+ static parseResolveDidResult(client: LedgerClient, bytes: Uint8Array): DidRecord;
379
+ static buildCreateDidTransaction(client: LedgerClient, from: string, did: string, did_doc: DidDocument, nonce?: bigint | null): Promise<Transaction>;
380
+ static buildUpdateDidTransaction(client: LedgerClient, from: string, did: string, did_doc: DidDocument, nonce?: bigint | null): Promise<Transaction>;
381
+ static buildResolveDidTransaction(client: LedgerClient, did: string): Promise<Transaction>;
382
+ static buildCreateDidEndorsingData(client: LedgerClient, did: string, did_doc: DidDocument): Promise<TransactionEndorsingData>;
383
+ static buildUpdateDidEndorsingData(client: LedgerClient, did: string, did_doc: DidDocument): Promise<TransactionEndorsingData>;
384
+ static buildDeactivateDidTransaction(client: LedgerClient, from: string, did: string, nonce?: bigint | null): Promise<Transaction>;
385
+ static buildDeactivateDidEndorsingData(client: LedgerClient, did: string): Promise<TransactionEndorsingData>;
386
+ }
387
+
388
+ export class LedgerClient {
389
+ free(): void;
390
+ [Symbol.dispose](): void;
391
+ getReceipt(hash: Uint8Array): Promise<string>;
392
+ queryEvents(query: EventQuery): Promise<EventLog[]>;
393
+ submitTransaction(transaction: Transaction): Promise<number[]>;
394
+ getTransactionCount(address: string): Promise<bigint>;
395
+ constructor(chain_id: number, node_address: string, contract_configs: ContractConfig[], network: string | null | undefined, quorum_config: QuorumConfig | undefined | null);
396
+ ping(): Promise<PingStatus>;
397
+ }
398
+
399
+ export class LegacyMappingRegistry {
400
+ private constructor();
401
+ free(): void;
402
+ [Symbol.dispose](): void;
403
+ static parseDidMappingResult(client: LedgerClient, bytes: Uint8Array): string;
404
+ static parseResourceMappingResult(client: LedgerClient, bytes: Uint8Array): string;
405
+ static buildGetDidMappingTransaction(client: LedgerClient, legacy_identifier: string): Promise<Transaction>;
406
+ static buildCreateDidMappingTransaction(client: LedgerClient, from: string, did: string, legacy_did: string, legacy_verkey: string, ed25519_signature: Uint8Array, nonce?: bigint | null): Promise<Transaction>;
407
+ static buildGetResourceMappingTransaction(client: LedgerClient, legacy_identifier: string): Promise<Transaction>;
408
+ static buildCreateDidMappingEndorsingData(client: LedgerClient, did: string, legacy_did: string, legacy_verkey: string, ed25519_signature: Uint8Array): Promise<TransactionEndorsingData>;
409
+ static buildCreateResourceMappingTransaction(client: LedgerClient, from: string, did: string, legacy_issuer_identifier: string, legacy_identifier: string, new_identifier: string, nonce?: bigint | null): Promise<Transaction>;
410
+ static buildCreateResourceMappingEndorsingData(client: LedgerClient, did: string, legacy_issuer_identifier: string, legacy_identifier: string, new_identifier: string): Promise<TransactionEndorsingData>;
411
+ }
412
+
413
+ export class RevocationRegistry {
414
+ private constructor();
415
+ free(): void;
416
+ [Symbol.dispose](): void;
417
+ static resolveRevocationRegistryDefinition(client: LedgerClient, id: string): Promise<RevocationRegistryDefinition>;
418
+ static resolveRevocationRegistryStatusList(client: LedgerClient, id: string, to_timestamp: bigint): Promise<RevocationRegistryStatusList>;
419
+ static buildCreateRevocationRegistryEntryTransaction(client: LedgerClient, from: string, rev_reg_entry: RevocationRegistryEntry, nonce?: bigint | null): Promise<Transaction>;
420
+ static parseResolveRevocationRegistryDefinitionResult(client: LedgerClient, bytes: Uint8Array): RevocationRegistryDefinitionRecord;
421
+ static buildCreateRevocationRegistryEntryEndorsingData(client: LedgerClient, rev_reg_entry: RevocationRegistryEntry): Promise<TransactionEndorsingData>;
422
+ static buildCreateRevocationRegistryDefinitionTransaction(client: LedgerClient, from: string, rev_reg_def: RevocationRegistryDefinition, nonce?: bigint | null): Promise<Transaction>;
423
+ static buildLatestRevocationRegistryEntryFromStatusList(client: LedgerClient, id: string, revocation_registry_status_list: Uint8Array, accumulator: string): Promise<RevocationRegistryEntry>;
424
+ static buildResolveRevocationRegistryDefinitionTransaction(client: LedgerClient, id: string): Promise<Transaction>;
425
+ static buildCreateRevocationRegistryDefinitionEndorsingData(client: LedgerClient, rev_reg_def: RevocationRegistryDefinition): Promise<TransactionEndorsingData>;
426
+ }
427
+
428
+ export class RevocationRegistryDefinition {
429
+ free(): void;
430
+ [Symbol.dispose](): void;
431
+ static fromString(string: string): RevocationRegistryDefinition;
432
+ constructor(issuer_id: string, cred_def_id: string, tag: string, value: RevocationRegistryDefinitionValue);
433
+ getId(): string;
434
+ asValue(): RevocationRegistryDefinitionData;
435
+ toString(): string;
436
+ }
437
+
438
+ export class RevocationRegistryEntry {
439
+ free(): void;
440
+ [Symbol.dispose](): void;
441
+ constructor(issuer_id: string, rev_reg_def_id: string, current_accumulator: string, prev_accumulator?: string | null, issued?: Uint32Array | null, revoked?: Uint32Array | null);
442
+ asValue(): RevocationRegistryEntryValue;
443
+ toString(): string;
444
+ }
445
+
446
+ export class RevocationRegistryStatusList {
447
+ private constructor();
448
+ free(): void;
449
+ [Symbol.dispose](): void;
450
+ asValue(): RevocationStatusListData;
451
+ toString(): string;
452
+ }
453
+
454
+ export class RoleControl {
455
+ private constructor();
456
+ free(): void;
457
+ [Symbol.dispose](): void;
458
+ static parseGetRoleResult(client: LedgerClient, bytes: Uint8Array): number;
459
+ static parseHasRoleResult(client: LedgerClient, bytes: Uint8Array): boolean;
460
+ static buildGetRoleTransaction(client: LedgerClient, account: string): Promise<Transaction>;
461
+ static buildHasRoleTransaction(client: LedgerClient, role: number, account: string): Promise<Transaction>;
462
+ static buildAssignRoleTransaction(client: LedgerClient, from: string, role: number, account: string, nonce?: bigint | null): Promise<Transaction>;
463
+ static buildRevokeRoleTransaction(client: LedgerClient, from: string, role: number, account: string, nonce?: bigint | null): Promise<Transaction>;
464
+ }
465
+
466
+ export class Schema {
467
+ free(): void;
468
+ [Symbol.dispose](): void;
469
+ static fromString(string: string): Schema;
470
+ constructor(issuer_id: string, name: string, version: string, attr_names: string[]);
471
+ getId(): string;
472
+ asValue(): SchemaData;
473
+ toString(): string;
474
+ }
475
+
476
+ export class SchemaRegistry {
477
+ private constructor();
478
+ free(): void;
479
+ [Symbol.dispose](): void;
480
+ static resolveSchema(client: LedgerClient, id: string): Promise<Schema>;
481
+ static parseResolveSchemaResult(client: LedgerClient, bytes: Uint8Array): SchemaRecord;
482
+ static buildCreateSchemaTransaction(client: LedgerClient, from: string, schema: Schema, nonce?: bigint | null): Promise<Transaction>;
483
+ static buildResolveSchemaTransaction(client: LedgerClient, id: string): Promise<Transaction>;
484
+ static buildCreateSchemaEndorsingData(client: LedgerClient, schema: Schema): Promise<TransactionEndorsingData>;
485
+ }
486
+
487
+ export class Transaction {
488
+ private constructor();
489
+ free(): void;
490
+ [Symbol.dispose](): void;
491
+ setSignature(signature_data: SignatureData): void;
492
+ getSigningBytes(): Uint8Array;
493
+ to(): string;
494
+ }
495
+
496
+ export class TransactionEndorsingData {
497
+ private constructor();
498
+ free(): void;
499
+ [Symbol.dispose](): void;
500
+ setSignature(signature_data: SignatureData): void;
501
+ getSigningBytes(): Uint8Array;
502
+ }
503
+
504
+ export class ValidatorControl {
505
+ private constructor();
506
+ free(): void;
507
+ [Symbol.dispose](): void;
508
+ static parseGetValidatorsResult(client: LedgerClient, bytes: Uint8Array): AddressString[];
509
+ static buildAddValidatorTransaction(client: LedgerClient, from: string, validator_address: string, nonce?: bigint | null): Promise<Transaction>;
510
+ static buildGetValidatorsTransaction(client: LedgerClient): Promise<Transaction>;
511
+ static buildRemoveValidatorTransaction(client: LedgerClient, from: string, validator_address: string, nonce?: bigint | null): Promise<Transaction>;
512
+ }