Skip to content

Commit

Permalink
Wrapper imports
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Kovar <[email protected]>
  • Loading branch information
mirgee committed Jan 10, 2023
1 parent 50c8842 commit 537ba3c
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 24 deletions.
2 changes: 1 addition & 1 deletion wrappers/node/src/api/credential-def.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as ffi from 'vcx-napi-rs';
import * as ffi from '@hyperledger/vcx-napi-rs';
import { ISerializedData } from './common';
import { VcxBase } from './vcx-base';
import { VCXInternalError } from '../errors';
Expand Down
2 changes: 1 addition & 1 deletion wrappers/node/src/api/credential.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as ffi from 'vcx-napi-rs';
import * as ffi from '@hyperledger/vcx-napi-rs';
import { ISerializedData, HolderStateType } from './common';
import { Connection } from './mediated-connection';
import { VcxBaseWithState } from './vcx-base-with-state';
Expand Down
2 changes: 1 addition & 1 deletion wrappers/node/src/api/disclosed-proof.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ISerializedData, ProverStateType } from './common';
import { Connection } from './mediated-connection';
import { VcxBaseWithState } from './vcx-base-with-state';
import * as ffi from '../../../vcx-napi-rs';
import * as ffi from '@hyperledger/vcx-napi-rs';
import { VCXInternalError } from '../errors';

export interface IDisclosedProofData {
Expand Down
2 changes: 1 addition & 1 deletion wrappers/node/src/api/init.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as ffiNapi from 'vcx-napi-rs';
import * as ffiNapi from '@hyperledger/vcx-napi-rs';
import { VCXInternalError } from '../errors';

export function createAgencyClientForMainWallet(config: object): void {
Expand Down
2 changes: 1 addition & 1 deletion wrappers/node/src/api/issuer-credential.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as ffi from 'vcx-napi-rs';
import * as ffi from '@hyperledger/vcx-napi-rs';
import { ISerializedData, IssuerStateType } from './common';
import { Connection } from './mediated-connection';
import { CredentialDef } from './credential-def';
Expand Down
2 changes: 1 addition & 1 deletion wrappers/node/src/api/logging.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as ffiNapi from 'vcx-napi-rs';
import * as ffiNapi from '@hyperledger/vcx-napi-rs';

import {VCXInternalError} from "../errors";

Expand Down
2 changes: 1 addition & 1 deletion wrappers/node/src/api/mediated-connection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as ffiNapi from 'vcx-napi-rs';
import * as ffiNapi from '@hyperledger/vcx-napi-rs';
import { VCXInternalError } from '../errors';
import { ISerializedData, ConnectionStateType } from './common';
import { VcxBaseWithState } from './vcx-base-with-state';
Expand Down
2 changes: 1 addition & 1 deletion wrappers/node/src/api/out-of-band-receiver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as ffi from 'vcx-napi-rs';
import * as ffi from '@hyperledger/vcx-napi-rs';
import { VCXInternalError } from '../errors';
import { IOOBSerializedData } from './out-of-band-sender';
import { Connection } from './mediated-connection';
Expand Down
2 changes: 1 addition & 1 deletion wrappers/node/src/api/out-of-band-sender.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as ffi from 'vcx-napi-rs';
import * as ffi from '@hyperledger/vcx-napi-rs';
import { VCXInternalError } from '../errors';
import { VcxBase } from './vcx-base';
import { ISerializedData } from './common';
Expand Down
4 changes: 2 additions & 2 deletions wrappers/node/src/api/proof.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as ffi from '../../../vcx-napi-rs';
import * as ffi from '@hyperledger/vcx-napi-rs';
import { ISerializedData, VerifierStateType } from './common';
import { Connection } from './mediated-connection';
import { VcxBaseWithState } from './vcx-base-with-state';
Expand Down Expand Up @@ -127,7 +127,7 @@ export class Proof extends VcxBaseWithState<IProofData, VerifierStateType> {

public async updateStateWithMessage(connection: Connection, message: string): Promise<number> {
try {
return await ffi.v2DisclosedProofUpdateStateWithMessage(
return await ffi.v2ProofUpdateStateWithMessage(
this.handle,
message,
connection.handle,
Expand Down
2 changes: 1 addition & 1 deletion wrappers/node/src/api/revocation-registry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as ffi from 'vcx-napi-rs';
import * as ffi from '@hyperledger/vcx-napi-rs';
import { ISerializedData } from './common';
import { VcxBase } from './vcx-base';
import { VCXInternalError } from '../errors';
Expand Down
2 changes: 1 addition & 1 deletion wrappers/node/src/api/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as ffi from 'vcx-napi-rs';
import * as ffi from '@hyperledger/vcx-napi-rs';
import { ISerializedData } from './common';
import { VcxBase } from './vcx-base';
import { VCXInternalError } from '../errors';
Expand Down
9 changes: 4 additions & 5 deletions wrappers/node/src/api/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as ffiNapi from 'vcx-napi-rs';
import { VCXInternalError } from '../errors';
import * as ffi from '../../../vcx-napi-rs';
import * as ffi from '@hyperledger/vcx-napi-rs';

export interface IPwInfo {
pw_did: string;
Expand All @@ -23,7 +22,7 @@ export interface IAriesService {

export async function provisionCloudAgent(configAgent: object): Promise<string> {
try {
return await ffiNapi.provisionCloudAgent(JSON.stringify(configAgent));
return await ffi.provisionCloudAgent(JSON.stringify(configAgent));
} catch (err: any) {
throw new VCXInternalError(err);
}
Expand Down Expand Up @@ -67,7 +66,7 @@ export function setActiveTxnAuthorAgreementMeta(

export function shutdownVcx(deleteWallet: boolean): void {
try {
ffiNapi.shutdown(deleteWallet);
ffi.shutdown(deleteWallet);
} catch (err: any) {
throw new VCXInternalError(err);
}
Expand All @@ -91,7 +90,7 @@ export interface IUpdateMessagesConfigs {

export async function updateMessages(updateConfig: IUpdateMessagesConfigs): Promise<void> {
try {
await ffiNapi.messagesUpdateStatus('MS-106', updateConfig.msgJson);
await ffi.messagesUpdateStatus('MS-106', updateConfig.msgJson);
} catch (err: any) {
throw new VCXInternalError(err);
}
Expand Down
11 changes: 5 additions & 6 deletions wrappers/node/src/api/wallet.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
import * as ffiNapi from 'vcx-napi-rs';
import { VCXInternalError } from '../errors';
import * as ffi from '../../../vcx-napi-rs';
import * as ffi from '@hyperledger/vcx-napi-rs';

export async function createWallet(config: object): Promise<void> {
try {
return await ffiNapi.walletCreateMain(JSON.stringify(config));
return await ffi.walletCreateMain(JSON.stringify(config));
} catch (err: any) {
throw new VCXInternalError(err);
}
}

export async function configureIssuerWallet(seed: string): Promise<string> {
try {
return await ffiNapi.configureIssuerWallet(seed);
return await ffi.configureIssuerWallet(seed);
} catch (err: any) {
throw new VCXInternalError(err);
}
}

export async function openMainWallet(config: object): Promise<void> {
try {
await ffiNapi.walletOpenAsMain(JSON.stringify(config));
await ffi.walletOpenAsMain(JSON.stringify(config));
} catch (err: any) {
throw new VCXInternalError(err);
}
}

export async function closeMainWallet(): Promise<void> {
try {
await ffiNapi.walletCloseMain();
await ffi.walletCloseMain();
} catch (err: any) {
throw new VCXInternalError(err);
}
Expand Down

0 comments on commit 537ba3c

Please sign in to comment.