Skip to content

Commit

Permalink
update JS wrapper calls to indy_vdr_build_nym_request
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Whitehead <[email protected]>
  • Loading branch information
andrewwhitehead committed Jul 19, 2023
1 parent 04faad5 commit f21a882
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
14 changes: 12 additions & 2 deletions wrappers/javascript/indy-vdr-nodejs/src/NodeJSIndyVdr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<number>(requestHandle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
2 changes: 2 additions & 0 deletions wrappers/javascript/indy-vdr-shared/src/builder/NymRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f21a882

Please sign in to comment.