@bluxcc/core 0.2.9 → 0.2.11

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.
@@ -7,10 +7,15 @@ type ApiPasskeyChallenge = {
7
7
  challenge_id: number;
8
8
  };
9
9
  export declare const authenticateAppId: (appId: string) => Promise<AuthenticateApiResponse>;
10
- export declare const apiRegisterPasskeyChallenge: (appId: string) => Promise<ApiPasskeyChallenge>;
11
- export declare const apiRegisterPasskey: (appId: string, challenge: ApiPasskeyChallenge, passkeyResult: PasskeyFlowResult) => Promise<string>;
10
+ export declare const apiPasskeyChallenge: (appId: string, authValue: string) => Promise<ApiPasskeyChallenge>;
11
+ export declare const apiPasskeyVerify: (appId: string, challenge: ApiPasskeyChallenge, passkeyResult: PasskeyFlowResult) => Promise<string>;
12
12
  export declare const apiSendOtp: (appId: string, authValue: string) => Promise<boolean>;
13
- export declare const apiStoreWalletConnection: (appId: string, walletName: string, walletAddress: string) => Promise<boolean>;
13
+ type ApiWalletChallenge = {
14
+ challenge_xdr: string;
15
+ network_passphrase: string;
16
+ };
17
+ export declare const apiWalletChallenge: (appId: string, walletName: string, walletAddress: string) => Promise<ApiWalletChallenge>;
18
+ export declare const apiVerifyWalletChallenge: (appId: string, signedXdr: string) => Promise<string>;
14
19
  export declare const apiVerifyOtp: (appId: string, user: IUser, otp: string) => Promise<string>;
15
20
  type ApiGetUserResponse = {
16
21
  auth_method: string;
@@ -0,0 +1,22 @@
1
+ /** Whether appId validation has finished (regardless of the outcome). */
2
+ export declare const isAppValidated: () => boolean;
3
+ /** Whether the configured appId was confirmed valid by the Blux API. */
4
+ export declare const isAppValid: () => boolean;
5
+ /**
6
+ * Throws when the appId is known to be invalid. Every authentication / wallet
7
+ * entry point (login, profile, fundMe, and all signing methods) calls this so
8
+ * Blux refuses to operate with a bad appId. The read-only chain helpers under
9
+ * `exports/core` intentionally do NOT call this — they don't depend on the
10
+ * appId and must keep working.
11
+ *
12
+ * No-op while validation is still pending: callers that need a settled result
13
+ * (e.g. login) await {@link waitForBluxReady} first; the rest are already gated
14
+ * behind an auth check that can't pass before validation completes.
15
+ */
16
+ export declare const assertAppIsValid: () => void;
17
+ /**
18
+ * Resolves once the SDK has finished initializing (wallets loaded) AND appId
19
+ * validation has settled, so the caller can then assert validity. Polls because
20
+ * both happen asynchronously after createConfig.
21
+ */
22
+ export declare const waitForBluxReady: () => Promise<void>;
@@ -4,6 +4,7 @@ import { Route, SupportedWallet } from '../enums';
4
4
  import { IAsset, IWallet, IExplorer, LanguageKey, ITransports, IWalletNames } from '../types';
5
5
  import { INetworkTransports } from '../constants/networkDetails';
6
6
  export declare const bufferToBase64Url: (buf: ArrayBuffer) => string;
7
+ export declare const base64UrlToBuffer: (value: string) => ArrayBuffer;
7
8
  export declare const getAssetTitle: (asset: Horizon.HorizonApi.BalanceLineNative | Horizon.HorizonApi.BalanceLineAsset<"credit_alphanum4"> | Horizon.HorizonApi.BalanceLineAsset<"credit_alphanum12"> | Horizon.HorizonApi.BalanceLineLiquidityPool) => string;
8
9
  export declare const getAssetSubtitle: (asset: Horizon.HorizonApi.BalanceLineNative | Horizon.HorizonApi.BalanceLineAsset<"credit_alphanum4"> | Horizon.HorizonApi.BalanceLineAsset<"credit_alphanum12"> | Horizon.HorizonApi.BalanceLineLiquidityPool) => string;
9
10
  export declare const iAssetToAsset: (asset: IAsset) => Asset;
@@ -0,0 +1,4 @@
1
+ export declare const getStoredPasskeyCredentialId: (appId: string) => string | null;
2
+ export declare const setStoredPasskeyCredentialId: (appId: string, credentialId: string) => void;
3
+ export declare const clearStoredPasskeyCredentialId: (appId: string) => void;
4
+ export declare const createPasskeyRegistrationHandle: () => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluxcc/core",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "homepage": "https://blux.cc",
5
5
  "description": "Blux is a wallet infra for the Stellar network",
6
6
  "type": "module",