From f21a882b07dd2b66eb84b10bc15ad6b2aad3bc5a Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Fri, 24 Feb 2023 15:35:54 -0800 Subject: [PATCH] update JS wrapper calls to indy_vdr_build_nym_request Signed-off-by: Andrew Whitehead --- .../indy-vdr-nodejs/src/NodeJSIndyVdr.ts | 14 ++++++++++++-- .../indy-vdr-nodejs/src/library/NativeBindings.ts | 2 ++ .../indy-vdr-nodejs/src/library/bindings.ts | 2 +- .../indy-vdr-shared/src/builder/NymRequest.ts | 2 ++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/wrappers/javascript/indy-vdr-nodejs/src/NodeJSIndyVdr.ts b/wrappers/javascript/indy-vdr-nodejs/src/NodeJSIndyVdr.ts index c5844bc5..65de5f8f 100644 --- a/wrappers/javascript/indy-vdr-nodejs/src/NodeJSIndyVdr.ts +++ b/wrappers/javascript/indy-vdr-nodejs/src/NodeJSIndyVdr.ts @@ -358,10 +358,20 @@ export class NodeJSIndyVdr implements IndyVdr { public buildNymRequest(options: NymRequestOptions): number { const requestHandle = allocateHandle() - const { dest, submitterDid, alias, role, verkey } = serializeArguments(options) + const { dest, submitterDid, alias, role, verkey, diddocContent } = serializeArguments(options) + const version = options.version || -1 this.handleError( - this.nativeIndyVdr.indy_vdr_build_nym_request(submitterDid, dest, verkey, alias, role, requestHandle) + this.nativeIndyVdr.indy_vdr_build_nym_request( + submitterDid, + dest, + verkey, + alias, + role, + diddocContent, + version, + requestHandle + ) ) return handleReturnPointer(requestHandle) diff --git a/wrappers/javascript/indy-vdr-nodejs/src/library/NativeBindings.ts b/wrappers/javascript/indy-vdr-nodejs/src/library/NativeBindings.ts index 7241037c..98fc4bf0 100644 --- a/wrappers/javascript/indy-vdr-nodejs/src/library/NativeBindings.ts +++ b/wrappers/javascript/indy-vdr-nodejs/src/library/NativeBindings.ts @@ -79,6 +79,8 @@ export interface NativeMethods { arg2: string, arg3: string, arg4: string, + arg5: string, + arg6: number, requestHandlePtr: Buffer ) => number indy_vdr_pool_create: (arg0: string, poolHandlePtr: Buffer) => number diff --git a/wrappers/javascript/indy-vdr-nodejs/src/library/bindings.ts b/wrappers/javascript/indy-vdr-nodejs/src/library/bindings.ts index 1d8aed90..4914066c 100644 --- a/wrappers/javascript/indy-vdr-nodejs/src/library/bindings.ts +++ b/wrappers/javascript/indy-vdr-nodejs/src/library/bindings.ts @@ -67,7 +67,7 @@ export const nativeBindings = { indy_vdr_build_get_validator_info_request: [FFI_ERROR_CODE, [FFI_STRING, FFI_REQUEST_HANDLE_POINTER]], indy_vdr_build_nym_request: [ FFI_ERROR_CODE, - [FFI_STRING, FFI_STRING, FFI_STRING, FFI_STRING, FFI_STRING, FFI_REQUEST_HANDLE_POINTER], + [FFI_STRING, FFI_STRING, FFI_STRING, FFI_STRING, FFI_STRING, FFI_STRING, FFI_INT32, FFI_REQUEST_HANDLE_POINTER], ], indy_vdr_build_revoc_reg_def_request: [FFI_ERROR_CODE, [FFI_STRING, FFI_STRING, FFI_REQUEST_HANDLE_POINTER]], indy_vdr_build_revoc_reg_entry_request: [ diff --git a/wrappers/javascript/indy-vdr-shared/src/builder/NymRequest.ts b/wrappers/javascript/indy-vdr-shared/src/builder/NymRequest.ts index b405f801..e633304c 100644 --- a/wrappers/javascript/indy-vdr-shared/src/builder/NymRequest.ts +++ b/wrappers/javascript/indy-vdr-shared/src/builder/NymRequest.ts @@ -8,6 +8,8 @@ export type NymRequestOptions = { verkey?: string alias?: string role?: 'STEWARD' | 'TRUSTEE' | 'ENDORSER' | 'NETWORK_MONITOR' + diddocContent?: string + version?: number } interface NymResultTxn extends WriteRequestResultTxnBase {