Skip to content

Commit

Permalink
fix: SDKConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
jamalavedra committed Jun 20, 2024
1 parent 5ba0055 commit 299fb8a
Show file tree
Hide file tree
Showing 8 changed files with 432 additions and 354 deletions.
2 changes: 1 addition & 1 deletion examples/apps/auth-sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@heroicons/react": "^2.0.13",
"@openfort/openfort-js": "0.7.9",
"@openfort/openfort-js": "0.7.10",
"@openfort/openfort-node": "^0.6.47",
"@radix-ui/react-toast": "^1.1.2",
"@rainbow-me/rainbowkit": "^2.1.1",
Expand Down
4 changes: 2 additions & 2 deletions examples/apps/auth-sample/src/utils/openfortConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Openfort, { SDKConfiguration } from '@openfort/openfort-js';
import Openfort from '@openfort/openfort-js';


const openfort = new Openfort({
Expand All @@ -10,6 +10,6 @@ const openfort = new Openfort({
shieldEncryptionKey: process.env.NEXT_PUBLIC_SHIELD_ENCRYPTION_SHARE!,
debug: true,
}
} as SDKConfiguration);
});

export default openfort;
2 changes: 1 addition & 1 deletion packages/platform-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@openfort/platform-bridge",
"version": "0.0.0",
"dependencies": {
"@openfort/openfort-js": "0.7.9",
"@openfort/openfort-js": "0.7.10",
"ethers": "^5.7.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfort/openfort-js",
"version": "0.7.9",
"version": "0.7.10",
"author": "Openfort (https://www.openfort.xyz)",
"bugs": "https://github.com/openfort-xyz/openfort-js/issues",
"repository": "openfort-xyz/openfort-js.git",
Expand Down
13 changes: 8 additions & 5 deletions sdk/src/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createConfig, OpenfortAPIConfiguration } from '@openfort/openapi-clients';
import { SDKOverrides } from '../types';
import { OpenfortError, OpenfortErrorType } from '../errors/openfortError';
import { SDKOverrides } from '../types';

const validateConfiguration = <T>(
configuration: T,
Expand Down Expand Up @@ -48,6 +48,12 @@ export class ShieldConfiguration {
}
}

export type OpenfortSDKConfiguration = {
baseConfiguration: OpenfortConfiguration,
shieldConfiguration?: ShieldConfiguration,
overrides?: SDKOverrides
};

export class SDKConfiguration {
readonly baseConfiguration: OpenfortConfiguration;

Expand All @@ -65,10 +71,7 @@ export class SDKConfiguration {
baseConfiguration,
shieldConfiguration,
overrides,
}: { baseConfiguration: OpenfortConfiguration,
shieldConfiguration?: ShieldConfiguration,
overrides?: SDKOverrides
}) {
}: OpenfortSDKConfiguration) {
this.shieldConfiguration = shieldConfiguration;
this.baseConfiguration = baseConfiguration;
if (overrides) {
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/openfort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
OpenfortEventMap,
AuthType,
} from './types';
import { SDKConfiguration } from './config';
import { OpenfortSDKConfiguration, SDKConfiguration } from './config';
import { EvmProvider } from './evm';
import { Provider } from './evm/types';
import { announceProvider, openfortProviderInfo } from './evm/provider/eip6963';
Expand Down Expand Up @@ -52,7 +52,7 @@ export class Openfort {

private readonly openfortEventEmitter: TypedEventEmitter<OpenfortEventMap>;

constructor(sdkConfiguration: SDKConfiguration) {
constructor(sdkConfiguration: OpenfortSDKConfiguration) {
this.config = new SDKConfiguration(sdkConfiguration);
this.backendApiClients = new BackendApiClients(this.config.openfortAPIConfig);
this.instanceManager = new InstanceManager(
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const VERSION = '0.7.9';
export const VERSION = '0.7.10';
export const PACKAGE = '@openfort/openfort-js';
Loading

0 comments on commit 299fb8a

Please sign in to comment.