Skip to content

Commit

Permalink
config for urls
Browse files Browse the repository at this point in the history
  • Loading branch information
gllm-dev committed Mar 6, 2024
1 parent 3eb977b commit 2e29dc2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfort/openfort-js",
"version": "0.4.2",
"version": "0.4.3",
"description": "",
"author": "Openfort",
"repository": {
Expand Down
3 changes: 1 addition & 2 deletions src/openfort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ export default class Openfort {
private _transactionsApi?: TransactionIntentsApi;
private readonly _signer?: Signer;

constructor(publishableKey: string, signer: Signer = undefined) {
const basePath = process.env.OPENFORT_API_BASE_URL || undefined;
constructor(publishableKey: string, signer: Signer = undefined, basePath: string = undefined) {
this._configuration = new Configuration({accessToken: publishableKey, basePath});
this._signer = signer;
}
Expand Down
4 changes: 2 additions & 2 deletions src/signer/embedded.signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export class EmbeddedSigner implements Signer {
private readonly _recoverySharePassword?: string;
private _deviceID: string|null = null;

constructor(chainId: number, publishableKey: string,accessToken: string, accountUuid?: string, recoverySharePassword?: string) {
this._iframeClient = new IframeClient(publishableKey, accessToken, chainId);
constructor(chainId: number, publishableKey: string,accessToken: string, accountUuid?: string, recoverySharePassword?: string, iframeURL?: string) {
this._iframeClient = new IframeClient(publishableKey, accessToken, chainId, iframeURL);
this._accountUuid = accountUuid;
this._recoverySharePassword = recoverySharePassword;
}
Expand Down
5 changes: 3 additions & 2 deletions src/utils/iframe-client.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
export class IframeClient {
private readonly _iframe: HTMLIFrameElement;
private readonly _chainId: number;
constructor(publishableKey:string, accessToken: string, chainId: number) {

constructor(publishableKey: string, accessToken: string, chainId: number, iframeURL?: string) {
if (!document) {
throw new Error("must be run in a browser");
}
this._chainId = chainId;
this._iframe = document.createElement("iframe");
const baseURL = process.env.OPENFORT_IFRAME_BASE_URL || "https://iframe.openfort.xyz";
const baseURL = iframeURL || "https://iframe.openfort.xyz";
this._iframe.src = baseURL + "/iframe?accessToken=" + accessToken + "&publishableKey=" + publishableKey;
this._iframe.style.display = "none";
document.body.appendChild(this._iframe);
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const VERSION = "0.4.2";
export const VERSION = "0.4.3";
export const PACKAGE = "@openfort/openfort-js";

0 comments on commit 2e29dc2

Please sign in to comment.