@openfort/openfort-js 0.8.4 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3207,7 +3207,7 @@ class KeyPair extends signingKey.SigningKey {
3207
3207
  }
3208
3208
  }
3209
3209
 
3210
- const VERSION = '0.8.4';
3210
+ const VERSION = '0.8.6';
3211
3211
 
3212
3212
  var Event;
3213
3213
  (function (Event) {
@@ -3898,6 +3898,7 @@ class Account {
3898
3898
  }
3899
3899
  }
3900
3900
 
3901
+ let iframeManagerSingleton = null;
3901
3902
  class SignerManager {
3902
3903
  static storage = new LocalStorage();
3903
3904
  static fromStorage() {
@@ -3940,11 +3941,14 @@ class SignerManager {
3940
3941
  return new EmbeddedSigner(iframeManager, iframeConfiguration, this.storage);
3941
3942
  }
3942
3943
  static get iframeManager() {
3944
+ if (iframeManagerSingleton) {
3945
+ return iframeManagerSingleton;
3946
+ }
3943
3947
  const configuration = Configuration.fromStorage();
3944
3948
  if (!configuration) {
3945
3949
  throw new OpenfortError('Must be configured to create a signer', exports.OpenfortErrorType.INVALID_CONFIGURATION);
3946
3950
  }
3947
- return new IframeManager({
3951
+ const iframeManager = new IframeManager({
3948
3952
  backendUrl: configuration.openfortURL,
3949
3953
  baseConfiguration: {
3950
3954
  publishableKey: configuration.publishableKey,
@@ -3963,6 +3967,8 @@ class SignerManager {
3963
3967
  },
3964
3968
  shieldUrl: configuration.shieldURL,
3965
3969
  });
3970
+ iframeManagerSingleton = iframeManager;
3971
+ return iframeManager;
3966
3972
  }
3967
3973
  static session() {
3968
3974
  let session = Session.fromStorage(this.storage);
@@ -4185,7 +4191,8 @@ class AuthManager {
4185
4191
  return withOpenfortError(async () => {
4186
4192
  const response = await this.backendApiClients.authenticationApi.thirdParty(request, AuthManager.getEcosystemGameOptsOrUndefined(ecosystemGame));
4187
4193
  return response.data;
4188
- }, { default: exports.OpenfortErrorType.AUTHENTICATION_ERROR });
4194
+ // eslint-disable-next-line @typescript-eslint/naming-convention
4195
+ }, { default: exports.OpenfortErrorType.AUTHENTICATION_ERROR, 403: exports.OpenfortErrorType.USER_NOT_AUTHORIZED_ON_ECOSYSTEM });
4189
4196
  }
4190
4197
  async initSIWE(address, ecosystemGame) {
4191
4198
  const request = {
@@ -4212,7 +4219,8 @@ class AuthManager {
4212
4219
  return withOpenfortError(async () => {
4213
4220
  const response = await this.backendApiClients.authenticationApi.authenticateSIWE(request);
4214
4221
  return response.data;
4215
- }, { default: exports.OpenfortErrorType.AUTHENTICATION_ERROR });
4222
+ // eslint-disable-next-line @typescript-eslint/naming-convention
4223
+ }, { default: exports.OpenfortErrorType.AUTHENTICATION_ERROR, 403: exports.OpenfortErrorType.USER_NOT_AUTHORIZED_ON_ECOSYSTEM });
4216
4224
  }
4217
4225
  static getEcosystemGameOptsOrUndefined(ecosystemGame) {
4218
4226
  if (ecosystemGame) {
@@ -4322,7 +4330,8 @@ class AuthManager {
4322
4330
  return withOpenfortError(async () => {
4323
4331
  const response = await this.backendApiClients.authenticationApi.signupEmailPassword(request, AuthManager.getEcosystemGameOptsOrUndefined(ecosystemGame));
4324
4332
  return response.data;
4325
- }, { default: exports.OpenfortErrorType.USER_REGISTRATION_ERROR });
4333
+ // eslint-disable-next-line @typescript-eslint/naming-convention
4334
+ }, { default: exports.OpenfortErrorType.USER_REGISTRATION_ERROR, 403: exports.OpenfortErrorType.USER_NOT_AUTHORIZED_ON_ECOSYSTEM });
4326
4335
  }
4327
4336
  async validateCredentials(authentication, forceRefresh) {
4328
4337
  const jwk = await this.getJWK();
package/dist/index.js CHANGED
@@ -3184,7 +3184,7 @@ class KeyPair extends SigningKey {
3184
3184
  }
3185
3185
  }
3186
3186
 
3187
- const VERSION = '0.8.4';
3187
+ const VERSION = '0.8.6';
3188
3188
 
3189
3189
  var Event;
3190
3190
  (function (Event) {
@@ -3875,6 +3875,7 @@ class Account {
3875
3875
  }
3876
3876
  }
3877
3877
 
3878
+ let iframeManagerSingleton = null;
3878
3879
  class SignerManager {
3879
3880
  static storage = new LocalStorage();
3880
3881
  static fromStorage() {
@@ -3917,11 +3918,14 @@ class SignerManager {
3917
3918
  return new EmbeddedSigner(iframeManager, iframeConfiguration, this.storage);
3918
3919
  }
3919
3920
  static get iframeManager() {
3921
+ if (iframeManagerSingleton) {
3922
+ return iframeManagerSingleton;
3923
+ }
3920
3924
  const configuration = Configuration.fromStorage();
3921
3925
  if (!configuration) {
3922
3926
  throw new OpenfortError('Must be configured to create a signer', OpenfortErrorType.INVALID_CONFIGURATION);
3923
3927
  }
3924
- return new IframeManager({
3928
+ const iframeManager = new IframeManager({
3925
3929
  backendUrl: configuration.openfortURL,
3926
3930
  baseConfiguration: {
3927
3931
  publishableKey: configuration.publishableKey,
@@ -3940,6 +3944,8 @@ class SignerManager {
3940
3944
  },
3941
3945
  shieldUrl: configuration.shieldURL,
3942
3946
  });
3947
+ iframeManagerSingleton = iframeManager;
3948
+ return iframeManager;
3943
3949
  }
3944
3950
  static session() {
3945
3951
  let session = Session.fromStorage(this.storage);
@@ -4162,7 +4168,8 @@ class AuthManager {
4162
4168
  return withOpenfortError(async () => {
4163
4169
  const response = await this.backendApiClients.authenticationApi.thirdParty(request, AuthManager.getEcosystemGameOptsOrUndefined(ecosystemGame));
4164
4170
  return response.data;
4165
- }, { default: OpenfortErrorType.AUTHENTICATION_ERROR });
4171
+ // eslint-disable-next-line @typescript-eslint/naming-convention
4172
+ }, { default: OpenfortErrorType.AUTHENTICATION_ERROR, 403: OpenfortErrorType.USER_NOT_AUTHORIZED_ON_ECOSYSTEM });
4166
4173
  }
4167
4174
  async initSIWE(address, ecosystemGame) {
4168
4175
  const request = {
@@ -4189,7 +4196,8 @@ class AuthManager {
4189
4196
  return withOpenfortError(async () => {
4190
4197
  const response = await this.backendApiClients.authenticationApi.authenticateSIWE(request);
4191
4198
  return response.data;
4192
- }, { default: OpenfortErrorType.AUTHENTICATION_ERROR });
4199
+ // eslint-disable-next-line @typescript-eslint/naming-convention
4200
+ }, { default: OpenfortErrorType.AUTHENTICATION_ERROR, 403: OpenfortErrorType.USER_NOT_AUTHORIZED_ON_ECOSYSTEM });
4193
4201
  }
4194
4202
  static getEcosystemGameOptsOrUndefined(ecosystemGame) {
4195
4203
  if (ecosystemGame) {
@@ -4299,7 +4307,8 @@ class AuthManager {
4299
4307
  return withOpenfortError(async () => {
4300
4308
  const response = await this.backendApiClients.authenticationApi.signupEmailPassword(request, AuthManager.getEcosystemGameOptsOrUndefined(ecosystemGame));
4301
4309
  return response.data;
4302
- }, { default: OpenfortErrorType.USER_REGISTRATION_ERROR });
4310
+ // eslint-disable-next-line @typescript-eslint/naming-convention
4311
+ }, { default: OpenfortErrorType.USER_REGISTRATION_ERROR, 403: OpenfortErrorType.USER_NOT_AUTHORIZED_ON_ECOSYSTEM });
4303
4312
  }
4304
4313
  async validateCredentials(authentication, forceRefresh) {
4305
4314
  const jwk = await this.getJWK();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfort/openfort-js",
3
- "version": "0.8.4",
3
+ "version": "0.8.6",
4
4
  "author": "Openfort (https://www.openfort.xyz)",
5
5
  "bugs": "https://github.com/openfort-xyz/openfort-js/issues",
6
6
  "repository": "openfort-xyz/openfort-js.git",